JPH06100900B2 - Method and apparatus for high-speed color change display of color image - Google Patents
Method and apparatus for high-speed color change display of color imageInfo
- Publication number
- JPH06100900B2 JPH06100900B2 JP62080236A JP8023687A JPH06100900B2 JP H06100900 B2 JPH06100900 B2 JP H06100900B2 JP 62080236 A JP62080236 A JP 62080236A JP 8023687 A JP8023687 A JP 8023687A JP H06100900 B2 JPH06100900 B2 JP H06100900B2
- Authority
- JP
- Japan
- Prior art keywords
- color
- image
- pixel
- clustering
- storage means
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
- 238000000034 method Methods 0.000 title claims description 15
- 239000003086 colorant Substances 0.000 claims description 27
- 230000015654 memory Effects 0.000 description 30
- 238000004364 calculation method Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 12
- 238000013461 design Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000003595 spectral effect Effects 0.000 description 3
- 238000011960 computer-aided design Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000010521 absorption reaction Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 230000006866 deterioration Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000004313 glare Effects 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000010187 selection method Methods 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
Landscapes
- Digital Computer Display Output (AREA)
- Processing Of Color Television Signals (AREA)
- Controls And Circuits For Display Device (AREA)
Description
【発明の詳細な説明】 (産業上の利用分野) 本発明は、カラー画像の色の自然さを損なわずに高速に
変更して表示する方法及び装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method and an apparatus for rapidly changing and displaying a color image without impairing the naturalness of the color.
(従来の技術) カラーデザインの分野にCAD(コンピュータ・エイデイ
ッドデザイン)が適用され、その中で色を変更すること
が求められている。具体的には、デザインの対象(例え
ば自動車)を含む画像を、スキャナやカラーカメラでコ
ンピュータ・システムにとり込み、カラーディスプレイ
に表示したのち、この対象の部分の色を変更(例えば、
元々、赤い自動車のボディーを青色に)することによ
り、各種の色にしたときのデザインの結果を、実際に物
を作ることなく予測することが要求される。(Prior Art) CAD (Computer Aided Design) is applied in the field of color design, and it is required to change the color in it. Specifically, after capturing an image including a design target (for example, an automobile) into a computer system with a scanner or a color camera and displaying the image on a color display, the color of the target portion is changed (for example,
Originally, by making the body of a red car blue), it is required to predict the design results of various colors without actually making things.
このような目的のため、従来、第3図で示されたよう
な、ある面の色(最終的にR(赤)、G(緑)、B
(青)、三成分で与えられる)をTVカメラ(モノクロ)
で得られた陰影に応じてつける回路が知られている(繊
維と工業、36巻、6号、1980年、195〜199ページ)。こ
の場合、物体の色を変化させたい部分を異なった濃度で
塗った濃淡の原画101をモノクロテレビカメラ102で入力
し、偽信号補正回路103で信号を整形したのち、A/Dコン
バータ104により、ディジタル値に変換して各部分を分
離し、色彩コントローラ105によってR,G,B値を与えカラ
ーエンコーダ106によってカラーテレビ信号とする。こ
の段階では、同色部分は平板な(R,G,B)で示される色
となっている。これと同時に製品の実物107を原画101と
位置を合わせて、もう一つのモノクロテレビカメラ108
により撮影し、これにより得られる陰影のある画像信号
Nと、先のカラーテレビ信号を陰影合成回路109により
合成する。これにより、カラーテレビ110には陰影のつ
いたカラー画像を色を自由に変化させながらシミュレー
トできる。For such a purpose, conventionally, as shown in FIG. 3, the color of a certain surface (finally R (red), G (green), B
(Blue), given by the three components) TV camera (monochrome)
It is known that a circuit is added depending on the shade obtained in (Fiber and Industry, Vol. 36, No. 6, 1980, pp. 195-199). In this case, a grayscale original image 101 in which a portion of which the color of the object is desired to be changed is painted with different densities is input by the monochrome television camera 102, the signal is shaped by the false signal correction circuit 103, and then by the A / D converter 104, It is converted into a digital value and each part is separated, and R, G, B values are given by a color controller 105 and a color television signal is made by a color encoder 106. At this stage, the same color part has a flat plate color (R, G, B). At the same time, the actual product 107 is aligned with the original image 101, and another monochrome TV camera 108
The image signal N having a shadow obtained by the above is combined with the previous color television signal by the shadow combining circuit 109. This allows the color television 110 to simulate a shaded color image while freely changing the color.
このとき、物体の色が(R,G,B)と与えられると、モノ
クロカメラから与えられる各画素の明度Nによって、各
画素の色(R′,G′,B′)は次のように求められる。At this time, if the color of the object is given as (R, G, B), the color (R ', G', B ') of each pixel is as follows according to the lightness N of each pixel given from the monochrome camera. Desired.
ここでNは0〜1の値をとると考える。 Here, it is considered that N takes a value of 0 to 1.
この方法は、「一つの色領域の色は、元々(R,G,B)と
いう明るい色であり、陰影により暗くなっている部分が
ある。」という根拠によっている。言いかえれば、第4
図の3次元色空間で考えたとき、一つの領域の色
(R′,G′,B′)は黒(0,0,0)と物体色(R,G,B)を結
ぶ直線上に乗っていることが仮定されている。This method is based on the ground that "the color of one color area is originally a bright color (R, G, B), and there is a portion that is dark due to shading." In other words, the fourth
When considered in the three-dimensional color space of the figure, the color (R ', G', B ') of one area is on the straight line connecting black (0,0,0) and object color (R, G, B). It is supposed to be on board.
(本発明が解決しようとする問題点) しかし、実際は、一つの色領域でも、光が照り返して明
るいために、第4図Pのように白に近い位置の色も存在
するのが普通である。しかし、上記の回路では、このよ
うな部分に正しく対応することはできない。(Problems to be Solved by the Present Invention) However, in reality, even in one color region, since light is reflected and bright, it is common that a color near white exists as shown in FIG. 4P. . However, the above circuit cannot correctly deal with such a part.
本発明は、この問題を解決し、照り返しの部分を持つ画
像の色領域でも自然にしかも、非常に高速に色変更を行
なって表示する方法及び装置を提供することを目的とし
ている。SUMMARY OF THE INVENTION It is an object of the present invention to solve this problem and provide a method and an apparatus for displaying a color area of an image having a reflection part by changing the color naturally and at a very high speed.
(問題点を解決するための手段) 第1の発明は、カラー画像の対象となる色領域中の各画
素の三原色値を、三次元の色空間において黒色、物体
色、光源色の三色が張る平面上の色を示すと仮定して二
次元の中間座標値に変換し、その分布からクラスタリン
グにより少数の代表色を選択し、前記色領域中の各画素
について前記クラスタリングの基準に従って前記代表色
を示す色コードを与え、色コード画像を作成し、各色コ
ードに対応する変更色を前記光源色及び新たに与えられ
た第2の物体色を用いて前記代表色について求めてルッ
クアップテーブルに登録し、前記カラー画像と、前記色
コード画像に対しルリックアップテーブルを適用した画
像を切り換えて表示することにより、上記色領域のみに
所望の色変更が自然になされた画像を高速に表示するカ
ラー画像の高速色変更表示方法である。(Means for Solving the Problems) In the first invention, the three primary color values of each pixel in a color region targeted for a color image are converted into three colors of black, an object color, and a light source color in a three-dimensional color space. Converted to a two-dimensional intermediate coordinate value assuming that it shows a color on a stretched plane, select a small number of representative colors from the distribution by clustering, and the representative color according to the clustering criterion for each pixel in the color region. Color code image is created, a changed color corresponding to each color code is obtained for the representative color using the light source color and the newly provided second object color, and registered in a lookup table. Then, by switching and displaying the color image and the image in which the rulicup table is applied to the color code image, the image in which the desired color change is naturally performed only in the color area can be displayed at high speed. This is a high-speed color change display method of the color image displayed on.
また、第2の発明は、カラー画像を格納するカラー画像
記憶手段と、該カラー画像の対象となる色領域の物体色
を記憶する第一の物体色記憶手段と、該カラー画像の光
源色を記憶する光源色記憶手段と、前記カラー画像の対
象となる色領域中の各画素の三原色値を、三次元の色空
間において、黒色、物体色、光源色の三色が張る平面上
の色を示すと仮定して、二次元の色空間の中間座標値に
変換する中間画素計算手段と、該中間画素値計算手段か
ら得られる色分布をクラスタリングし、少数の代表色を
選択するクラスタリング手段と、該クラスタリングの過
程で得られるクラスタリング基準と前記代表色を格納す
るクラスタ記憶手段と、前記中間画素値計算手段から得
られる中間座標値と前記クラスタリング基準により求め
られる各画素の前記代表色に対応する色コードを画像と
して記憶する色コード画像記憶手段と、前記色領域の色
変更後の物体色を記憶する第二の物体色記憶手段と、該
第二の物体色と前記光源色によって前記代表色から計算
された前記色コードに対応する三原色値を格納し、画像
の表示の際、前記色コード画像記憶手段から読み出され
る色コードを三原色値に変換するルックアップ・テーブ
ルと、画像の表示の際、前記カラー画像記憶手段から読
み出される画素の三原色値を前記色領域に属する画素に
ついては前記ルック・アップ・テーブルから出力される
三原色値に置き換えるディスプレイコントローラとを含
み、カラー画像の対象となる色領域の色を高速に変更し
表示するカラー画像の高速色変更表示装置である。A second aspect of the present invention is to provide a color image storage unit that stores a color image, a first object color storage unit that stores an object color of a color region that is a target of the color image, and a light source color of the color image. A light source color storage unit that stores the three primary color values of each pixel in the color region that is the target of the color image, in a three-dimensional color space, a color on a plane formed by three colors of black, an object color, and a light source color. Assuming that, intermediate pixel calculation means for converting into intermediate coordinate values of a two-dimensional color space, clustering means for clustering the color distribution obtained from the intermediate pixel value calculation means, and selecting a small number of representative colors, In front of each pixel obtained by the clustering reference obtained in the clustering process and the cluster storage means for storing the representative color, the intermediate coordinate value obtained by the intermediate pixel value calculation means, and the clustering reference. Color code image storage means for storing a color code corresponding to a representative color as an image, second object color storage means for storing the object color after the color change of the color area, the second object color and the light source. A lookup table that stores the three primary color values corresponding to the color code calculated from the representative color by color, and converts the color code read from the color code image storage means into the three primary color values when displaying an image; A display controller that replaces the three primary color values of the pixels read from the color image storage means with the three primary color values output from the look-up table for the pixels belonging to the color area when displaying the image; It is a high-speed color change display device for a color image that changes and displays a color of a target color region at high speed.
(作用) 本発明の作用を第5図を参照して説明する。光源120か
ら物体121に当たって、カメラ122に入る光は、鏡面反射
光123と拡散反射光124に大別できる。鏡面反射光は、物
体の表面で反射するもので、その分光組成は、光源と同
じで、強度だけが変化する。拡散反射光は、光源の光が
物体の中に入射し、物質特有の分光吸収を受けたのち、
等方的に外部に射出されるものである。拡散反射光の分
光組成は光源とは異なっているのが普通である。そのた
め、対象面の各点の色の三成分(R,G,B)は、 と書くことができる。ここで、(R0,G0,B0)は拡散反射
光の三成分であり、物体により異なるので、本明細書で
は以降、「物体色」と呼ばれる。(RS,GS,BS)は鏡面反
射光の三成分であり、光源の色と等しいので、本明細書
では以降「光源色」と呼ばれる。α,βは射出光量に対
する拡散反射光、鏡面反射光の寄与の度合を示してお
り、表面の材質、方向などに関係する。これは、画素毎
に異なるので、画素内の画素位置を(x,y)とすると、 と書かれる。このようなモデルは、コンピュータ・グラ
フィクスで利用されており、例えばPhongのモデルによ
ると、 となる(第13回画像工学コンファレンス、1982年、55〜
58ページ)。(Operation) The operation of the present invention will be described with reference to FIG. Light that strikes the object 121 from the light source 120 and enters the camera 122 can be roughly classified into specular reflection light 123 and diffuse reflection light 124. The specularly reflected light is reflected by the surface of the object, its spectral composition is the same as that of the light source, and only the intensity changes. Diffuse reflected light, after the light from the light source enters the object and undergoes spectral absorption peculiar to the substance,
It is isotropically injected to the outside. The spectral composition of diffusely reflected light is usually different from that of the light source. Therefore, the three components (R, G, B) of the color of each point on the target surface are Can be written. Here, (R 0 , G 0 , B 0 ) is the three components of the diffuse reflected light, and varies depending on the object, and is henceforth referred to as “object color” in the present specification. (R S , G S , B S ) is the three components of the specularly reflected light and is equal to the color of the light source, and is henceforth referred to as "light source color" in this specification. α and β indicate the degree of contribution of diffuse reflection light and specular reflection light to the amount of emitted light, and are related to the material and direction of the surface. This is different for each pixel, so if the pixel position within a pixel is (x, y), Is written. Such models are used in computer graphics. For example, according to Phong's model, (13th Imaging Engineering Conference, 1982, 55-
(Page 58).
ここで、θは表面の法線とカメラの方向のなす角、αは
鏡面反射方向とカメラの方向のなす角、dは拡散反射光
と周囲光の強度の度合を示す定数、w(θ)は、やはり
鏡面反射光の拡散反射光に対する度合を示す項である。Where θ is the angle between the surface normal and the camera direction, α is the angle between the specular reflection direction and the camera direction, d is a constant indicating the intensity of diffusely reflected light and ambient light, and w (θ) Is a term indicating the degree of specular reflection light to diffuse reflection light.
ある対象の表面が式(3)で表わされる場合、同じ材質
で色が異なるものは、物体色のみを(R0′,G0′,
B0′)に変更することにより、式(5)のように各画素
値を計算することができる。When the surface of a certain object is expressed by the formula (3), if the same material and different colors are used, only the object color (R 0 ′, G 0 ′,
By changing to B 0 ′), each pixel value can be calculated as in Expression (5).
本発明では、カラー画像内の一つの各領域での各画素の
色は式(3)に従うものと仮定する。これを第6図〜第
8図を参照して説明する。第6図においてカラー画像内
の一つの色領域で色分布200はR,G,B色空間において、原
点O、物体色C0、光源色CSの作る平面内に含まれる。そ
して、各画素の色は、OとC0を結ぶ座標軸αと、OとCS
を結ぶ座標軸βにより表わすことができる。この色分布
は2つの座標軸α,βを直交座標と見れば、第7図のよ
うになる。これに対し、物体色のみをC0′に変更するこ
とにより、α軸が第8図のα′軸に変わり、色分布は不
変とすることで自然な色変化を得ることができる。 In the present invention, it is assumed that the color of each pixel in each one region in the color image complies with Expression (3). This will be described with reference to FIGS. 6 to 8. In FIG. 6, the color distribution 200 in one color area in the color image is included in the plane formed by the origin O, the object color C 0 , and the light source color C S in the R, G, B color spaces. The color of each pixel is the coordinate axis α connecting O and C 0 , and O and C S
It can be represented by a coordinate axis β connecting the two. This color distribution is as shown in FIG. 7 when the two coordinate axes α and β are regarded as orthogonal coordinates. On the other hand, by changing only the object color to C 0 ′, the α-axis changes to the α′-axis in FIG. 8 and the color distribution remains unchanged, so that a natural color change can be obtained.
これを実現するためには、与えられたカラー画像の色領
域に対して、C0,CSを決定し、各画素のα,β値を求め
る必要がある。実際には、α=0,又はβ=0の色は存在
しないので、画像からC0,CSを正確に求めることはでき
ないが、画像中で、最もその色領域の色らしい部分(例
えば、赤い車体の自動車なら、大変赤く見える部分)の
画像値を読み取ってC0とし、鏡面反射で真っ白に光って
見える部分の画像値を読み取ってCSとすめば実用上十分
である。In order to realize this, it is necessary to determine C 0 and C S for the color region of a given color image and obtain α and β values of each pixel. Actually, since there is no color with α = 0 or β = 0, it is not possible to accurately obtain C 0 and C S from the image, but in the image, the most likely color part of the color region (for example, In the case of a car with a red car body, it is sufficient for practical use to read the image value of the part that looks very red) and set it to C 0, and read the image value of the part that appears to be pure white due to specular reflection and set it to C S.
各画素のα,βを求めるため便宜上C0及びCSに垂直な第
三の色彩ベクトルCdを、例えばC0とC0のベクトル積(外
積)として、 Cd=C0×CS (6) のように定める。このCdをR,G,B空間で式(7)のよう
に表わしたとき 画像内の各画素の色(R,G,B)は、γを導入して、 と書くことができる。ここでγは、各色のO,Cs,C0の作
る平面からの距離に対応し、対象となる色領域の画素に
ついてはノイズ分と考えられる。To obtain α and β of each pixel, for convenience, a third color vector C d perpendicular to C 0 and C S is defined as a vector product (outer product) of C 0 and C 0 , and C d = C 0 × C S ( 6) Set as follows. When this C d is expressed in R, G, B space as shown in equation (7), The color (R, G, B) of each pixel in the image is introduced by γ, Can be written. Here, γ corresponds to the distance from the plane formed by O, C s , and C 0 of each color, and the pixel in the target color area is considered to be noise.
式(8)を逆に解いて、式(9)が成立するため、各画
素について、R,G,B値からα,β,γを求めることがで
きる。γはノイズ分なので無視してよい。Since equation (9) is established by solving equation (8) in reverse, α, β, γ can be obtained from the R, G, B values for each pixel. Since γ is noise, it can be ignored.
このようにして、各画素についてαとβが求められる。
物体色C0をもっていた画像部分をC0′に変換し、この色
領域の他の部分もこれに即して、自然に見えるように変
換するには、式(5)を利用すればよいのは先に述べた
通りである。 In this way, α and β are obtained for each pixel.
In order to convert the image part having the object color C 0 into C 0 ′ and to convert other parts of this color region so as to look natural, the formula (5) should be used. Is as described above.
しかし、上記の方法によると、カラー画像のすべての画
素について対象色領域であるかどうかを調べ、それを満
たすすべての画素について式(5)を実行することにな
るので、C0′を1秒に、何回も変化させ、その結果を連
続的に観測するには非常に高速な専用演算回路を作る必
要がある。この問題を解決するために、第9図に示すよ
うなディスプレイ装置を利用する。このディスプレイは
リフレッシュのための画像メモリを2種類もつ。カラー
画像メモリ1は、カラー画像を各画素につきR,G,B各8
ビットでも。色コード画像メモリ2は、各画素に例えば
8ビットの色コードを持ち、次段のルック・アップ・テ
ーブル(LUT)3は、各画素の色コードに従って、予め
セットされているR,G,B値を出力する。これにより、同
時に256色の画像を表示することができる。一般には、
カラー画像を256色で表示するのは画質の著しい劣化を
免れないが、一つの色領域の色の変化を表示すること
は、256色を適切に選べば可能であることが多い。本発
明は、画像全体をカラー画像メモリ1からのR,G,B値で
表示し、色の変更を行なう色領域のみを色コード画像メ
モリ2とルック・アップ・テーブル3で表示し、ルック
・アップ・テーブル3の内容を書き換えるとにより、高
速の色変更表示を実現しようとするものである。ディス
プレイ・コントローラ5は、この2つの画像メモリから
の信号の切り換えを各画素毎にマスク画像メモリ4の画
素値によって行なう。即ち、マスク画像メモリ4は、各
画像1ビットを持つメモリである。第10図にカラー画像
メモリ1に格納された画像とマスク画像メモリ4に格納
されたマスク画像との関係を示す。マスク画像は、色変
更を行なう対象である自動車のボディー部のみで“1"の
画素値を持つ。ディスプレイ・コントローラ5は、画像
の表示の際に、各画素毎にマスク画像の画素値を調べ、
“1"であれば、ルック・アップ・テーブル3からの(R,
G,B)値を“0"であればカラー画像メモリ1からの(R,
G,B)値をD/A変換器6に与え、カラーモニタ7上に自然
に色変更された部分が合成されたカラー画像が表示され
る。However, according to the above method, it is determined whether or not all the pixels of the color image are in the target color area and the equation (5) is executed for all the pixels that satisfy the condition. Therefore, C 0 ′ is set to 1 second. In addition, it is necessary to make a very high-speed dedicated arithmetic circuit in order to change it many times and continuously observe the result. To solve this problem, a display device as shown in FIG. 9 is used. This display has two types of image memories for refreshing. The color image memory 1 stores a color image for each pixel in each of R, G, B 8
Even a bit. The color code image memory 2 has, for example, an 8-bit color code for each pixel, and the look-up table (LUT) 3 in the next stage has R, G, B preset according to the color code of each pixel. Output the value. As a result, an image of 256 colors can be displayed at the same time. In general,
Displaying a color image with 256 colors inevitably causes a significant deterioration in image quality, but displaying a color change in one color region is often possible by appropriately selecting 256 colors. The present invention displays the entire image with R, G, B values from the color image memory 1 and displays only the color area for changing the color with the color code image memory 2 and the look-up table 3, By rewriting the contents of the up table 3, high-speed color change display is realized. The display controller 5 switches the signals from the two image memories for each pixel according to the pixel value of the mask image memory 4. That is, the mask image memory 4 is a memory having 1 bit for each image. FIG. 10 shows the relationship between the image stored in the color image memory 1 and the mask image stored in the mask image memory 4. The mask image has a pixel value of "1" only in the body part of the car that is the target of color change. The display controller 5 checks the pixel value of the mask image for each pixel when displaying the image,
If it is "1", (R,
If the G, B) value is "0", (R,
G, B) values are given to the D / A converter 6, and a color image in which the naturally changed color portions are combined is displayed on the color monitor 7.
このようにすると、C0′を変化させたときに、色変更の
ために行なう計算は、ルックアップテーブル3の内容の
みであり、256回の式(5)の計算で済むため大巾な高
速化が実現される。In this way, when C 0 ′ is changed, only the contents of the lookup table 3 need to be calculated for changing the color, and the calculation of formula (5) can be performed 256 times. Is realized.
次に、対象の色領域を少ない色数で表現するための適切
な色選択方法について第11図〜第14図を参照して説明す
る。色領域に存在するすべての色が、第7図のα−β空
間で斜線の領域200に分布しているとしても、各色の頻
度を等高線で表示すると、第11図に示すようにほとんど
の色は非常に頻度は少なく、クラスタ101〜105で示すよ
うな幾つかの部分でのみ頻度が高い。そのためこのよう
な部分についてのみ正確に再現し、その他の部分は、不
正確であっても実用上ほとんど問題はない。従って、ル
ックアップテーブルに登録する256色を、このようなク
ラスタの色に集中させることによって自然な色再現を行
なう。Next, an appropriate color selection method for expressing the target color region with a small number of colors will be described with reference to FIGS. 11 to 14. Even if all the colors existing in the color area are distributed in the shaded area 200 in the α-β space of FIG. 7, if the frequency of each color is displayed as contour lines, most of the colors are as shown in FIG. Are very infrequent and only in some parts as shown by clusters 101-105. Therefore, only such a portion is accurately reproduced, and the other portions have practically no problem even if they are inaccurate. Therefore, natural colors are reproduced by concentrating the 256 colors registered in the lookup table on the colors of such clusters.
クラスタを求めるクラスタリングの手法の一例を次に説
明する。ここでは簡単のため、4色のクラスタを得る方
法を例示する。ここで、対象色領域の色は第12図の×印
のように分布していると仮定する。この18色の(α,
β)座標は第13図の通りである。クラスタリングは通常
コンピュータプログラムにより実行されるが、(α,
β)のデータセットを2つのクラスタに分ける際の処理
フローを第14図に示す。データセットは、最も分散の大
きい主軸の方向についてのメディアンの位置cを求める
ことにより、2等分される。2n色にクラスタリングする
場合は、この分割されたデータセットについて更に同じ
処理を繰り返し、全体でn段階行えばよい。このように
して得られたクラスタの代表色として、各クラスタに含
まれる画素の色の平均を求めた結果を第12図の〇印とし
て示した。An example of a clustering method for obtaining a cluster will be described below. Here, for simplification, a method of obtaining clusters of four colors will be exemplified. Here, it is assumed that the colors of the target color area are distributed as shown by the crosses in FIG. These 18 colors (α,
β) coordinates are shown in Fig. 13. Clustering is usually performed by a computer program, but (α,
FIG. 14 shows a processing flow for dividing the β) data set into two clusters. The data set is bisected by determining the median position c for the direction of the principal axis with the greatest variance. In the case of clustering into 2 n colors, the same processing may be further repeated for this divided data set, and n steps in total may be performed. As a representative color of the cluster thus obtained, the result of obtaining the average of the colors of the pixels included in each cluster is shown as a circle in FIG.
このような手法により、256色の代表色を選択し、色コ
ード0から色コード255とする。また上記のクラスタリ
ングのための主軸とメディアンを用いることによって色
領域中の各画素について色コードを与え、第9図の色コ
ード画像メモリ2に格納する。また、ルックアップテー
ブル3には、各代表色の(α,β)から式(5)によっ
て各色コードに対する(R′,G′,β′)を求め書き込
む。このようにすると、自然な色変更表示が得られる。With such a method, the 256 representative colors are selected, and the color codes 0 to 255 are selected. A color code is given to each pixel in the color area by using the above-mentioned main axis for clustering and the median, and stored in the color code image memory 2 in FIG. Further, in the lookup table 3, (R ', G', β ') for each color code is calculated from (α, β) of each representative color by the formula (5) and written. In this way, a natural color change display can be obtained.
尚、カラー画像の対象とする領域中に鏡面反射と考えら
れる部分がない場合には、Csとして、ディスプレイ装置
において通常白と考えられる値(例えば、R,G,Bそれぞ
れに8ビットを割り当てているディスプレイ装置では、
Rs=Gs=Bs=255)を与えても実用上は差し支えない。If there is no specular reflection part in the target area of the color image, C s is a value that is normally considered white in the display device (for example, 8 bits are assigned to each of R, G, and B). Display device,
It is practically acceptable to give R s = G s = B s = 255).
(実施例) 本発明の実施例を第1図を参照して説明する。カラー画
像メモリ1、色コード画像メモリ2、ルック・アップ・
テーブル(LUT)3、マスク画像メモリ4、ディスプレ
イコントローラ5、D/A変換器6、カラーモニター7の
各々の働きは、既に第9図で説明した通りである。カラ
ー画像メモリ1には例えば自動車などを含むフルカラー
画像が格納されており、マスク画像メモリ4には、マス
ク画像が、CRTによってカラー画像を観察しながら、ポ
インティングデバイスで輪郭をとり、中を塗りつぶすよ
うな公知の技術で既に作られていると仮定する。(Example) An example of the present invention will be described with reference to FIG. Color image memory 1, color code image memory 2, look-up
The functions of the table (LUT) 3, the mask image memory 4, the display controller 5, the D / A converter 6, and the color monitor 7 are as already described with reference to FIG. The color image memory 1 stores a full-color image including, for example, a car, and the mask image memory 4 draws an outline with a pointing device and fills the inside while observing the color image by CRT. It is assumed that it is already made by various known techniques.
色指定手段8は、利用者の指示によりCRT7とポインティ
ング・デバイス9を利用して、画像中から物体色C0及び
光源色Csをピックアップし、それぞれ第1の物体色記憶
手段10、光源色記憶手段11に格納するもので、マイクロ
コンピュータなどで実現できる。中間画素値計算手段12
は、マスク画像メモリ4の各画素を走査し、値が“1"で
ある画素に対して、カラー画像メモリ1に格納されてい
る(R,G,B)から、式(9)に従って中間画素値(α,
β)を計算しまず色分布メモリ13に与える。色分布メモ
リ13は(α,β)をメモリの二次元アドレスとし、対象
色領域の色分布を各アドレスの頻度として第11図に示し
たような形で記憶する。The color designating means 8 uses the CRT 7 and the pointing device 9 according to the user's instruction to pick up the object color C 0 and the light source color C s from the image, and respectively picks up the first object color storing means 10 and the light source color. It is stored in the storage means 11, and can be realized by a microcomputer or the like. Intermediate pixel value calculation means 12
Scans each pixel of the mask image memory 4, and for the pixel whose value is “1”, from (R, G, B) stored in the color image memory 1 to the intermediate pixel according to the equation (9). Value (α,
β) is first calculated and given to the color distribution memory 13. The color distribution memory 13 stores (α, β) as a two-dimensional address of the memory, and stores the color distribution of the target color area as the frequency of each address in the form shown in FIG.
クラスタリング手段14は、この色分布に対し、先に述べ
たようなクラスタリングを施こし、その結果をクラスタ
記憶手段15に格納する。クラスタリング手段14はマイク
ロコンピュータなどで実現できる。クラスタ記憶手段15
の内容を第2図に示す。代表色に当たる各クラスタの平
均値,がクラスタ平均値テーブル153に、これを得
る過程で決定された、各段階における主軸ベクトルとそ
の方向での分割点の値が、それぞれ主軸ベクトルテーブ
ル151及び分割点テーブル152に格納される。代表色が28
=256色の場合、クラスタ平均値テーブル153の容量は25
6であり、これは8段階の2等分の繰り返しで決定され
るため、 1+2+4+8+16+32+64+128=255 により主軸ベクトルテーブル151と分割点テーブル152は
各々255の容量を持つ。The clustering unit 14 performs the above-described clustering on this color distribution, and stores the result in the cluster storage unit 15. The clustering means 14 can be realized by a microcomputer or the like. Cluster storage means 15
The contents of the above are shown in FIG. The average value of each cluster corresponding to the representative color is stored in the cluster average value table 153, and the values of the main axis vector at each stage and the division points in that direction, which are determined in the process of obtaining this, are the main axis vector table 151 and the division point, respectively. It is stored in the table 152. Representative color is 2 8
= 256 colors, the cluster average value table 153 has a capacity of 25
Since this is 6 and this is determined by the equal division of 8 steps, the main axis vector table 151 and the division point table 152 each have a capacity of 255 by 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 = 255.
クラスタが決定された段階で、中間画素値計算手段12
は、再び対象色領域の各画素を走査し、(α,β)を今
度は色コード計算手段16に送る。色コード計算手段は、
各中間画素値(α,β)を主軸ベクトルテーブル151及
び分割点テーブル152の内容に従って8段階の判別によ
り、色コードを決定し色コード画素メモリ2の対応する
画素が書き込む。色コード画素が完成した段階で、色変
更表示の準備は整ったことになる。When the cluster is determined, the intermediate pixel value calculation means 12
Scans each pixel in the target color area again, and sends (α, β) to the color code calculation means 16 this time. The color code calculation means is
Each intermediate pixel value (α, β) is determined in eight steps according to the contents of the main axis vector table 151 and the division point table 152 to determine the color code, and the corresponding pixel of the color code pixel memory 2 writes it. When the color code pixel is completed, the color change display is ready.
実際の色変更は、まず利用者が、例えばポインティング
デバイス9やキーボード18から物体色C0の代わりの新し
い物体色C0′のR,G,B値(R0′,G0′,B0′)を色指定
手段8に与え、これが第2の物体色記憶手段19に格納さ
れることにより開始される。変更色計算手段17は、クラ
スタ平均値テーブル153に格納された各,に対し、C
s及びC0′を用いて式(5)によってそれぞれのR,G,B値
を計算し、LUT3に書き込む。これにより、カラー画像の
内、マスク画像の画素に“1"が立っている部分だけが色
コード画像メモリ2とLUT3により発生される色に置きか
えられ、所望の色に変更されて自然に表示される。Actual color change is first user, for example a new object color C 0 instead of object color C 0 from the pointing device 9, a keyboard 18 'R of, G, B values (R 0', G 0 ' , B 0 ′) Is given to the color designating means 8 and this is stored in the second object color storing means 19 to start. The changed color calculation means 17 sets C for each of the values stored in the cluster average value table 153.
Using s and C 0 ′, the respective R, G, B values are calculated according to equation (5) and written in LUT3. As a result, of the color image, only the part where "1" is set in the pixel of the mask image is replaced with the color generated by the color code image memory 2 and the LUT3, and the color is changed to the desired color and displayed naturally. It
(発明の効果) 以上に述べた方法及び装置により、カラー画像中に含ま
れる、従来一定色であるが、陰影や照り返しにより濃淡
のある領域の色を、高速に、しかも自然さを損なわず指
定した色に変更して表示することができる。本発明によ
りデザインされた製品などの色を、その周囲の状況を変
化させることなく、自然に、しかも次々と変更しながら
表示することができるので、実際にその色の製品を作る
ことなく配色などのチェックを行なうことができ、工業
的、経済的に大きな効果がある。(Effects of the Invention) With the method and apparatus described above, a color of a region which is conventionally a constant color but is included in a color image but has a shade due to shading or glare can be specified at high speed and without impairing naturalness. It is possible to change and display it in the specified color. Colors of products designed according to the present invention can be displayed naturally without changing the surrounding conditions, and while being changed one after another, so that colors can be displayed without actually making products of that color. Can be checked, which has a great industrial and economic effect.
第1図は本発明の実施例を示すブロック図、第2図はク
ラスタ記憶手段の詳細構成を示すブロック図、第3図は
従来の装置のブロック図、第4図は従来の装置の原理の
説明図、第5図は本発明の作用の説明図、第6図は1つ
の色領域の色分布を色空間中に示した説明図、第7図は
これを別の座標系で示した説明図、第8図は上記色領域
の色を本発明により変更した場合の色分布を色空間中に
示した図、第9図は、本発明の高速色変更表示のための
構成の説明図、第10図はカラー画像メモリとマクス画像
メモリの関係を示す説明図、第11図は対象色領域におけ
る色分布の説明図、第12〜13図は色分布のクラスタリン
グ例の説明図、第14図はクラスタリングの1段階の処理
フローである。 1……カラー画像メモリ、2……色コード画像メモリ、
3……ルック・アップ・テーブル、4……マスク画像メ
モリ、5……ディスプレイコントローラ、6……D/A変
換器、7……カラーモニタ、8……色指定手段、9……
ポインティング・デバイス、10……第1の物体色記憶手
段、11……光源色記憶手段、12……中間画素値計算手
段、13……色分布メモリ、14……クラスタリング手段、
15……クラスタ記憶手段、16……色コード計算手段、17
……変更色計算手段、18……キーボード、19……第2の
物体色記憶手段。FIG. 1 is a block diagram showing an embodiment of the present invention, FIG. 2 is a block diagram showing a detailed configuration of a cluster storage means, FIG. 3 is a block diagram of a conventional device, and FIG. 4 is a principle of the conventional device. Explanatory diagram, FIG. 5 is an explanatory diagram of the operation of the present invention, FIG. 6 is an explanatory diagram showing the color distribution of one color region in a color space, and FIG. 7 is an explanatory diagram showing this in another coordinate system. FIG. 8 is a diagram showing a color distribution in a color space when the color of the color region is changed according to the present invention, and FIG. 9 is an explanatory diagram of a configuration for high-speed color change display according to the present invention, FIG. 10 is an explanatory diagram showing the relationship between the color image memory and the max image memory, FIG. 11 is an explanatory diagram of color distribution in the target color region, FIGS. 12 to 13 are explanatory diagrams of clustering examples of color distribution, and FIG. Is a one-step processing flow of clustering. 1 ... Color image memory, 2 ... Color code image memory,
3 ... Look-up table, 4 ... Mask image memory, 5 ... Display controller, 6 ... D / A converter, 7 ... Color monitor, 8 ... Color designating means, 9 ...
Pointing device, 10 ... First object color storage means, 11 ... Light source color storage means, 12 ... Intermediate pixel value calculation means, 13 ... Color distribution memory, 14 ... Clustering means,
15 ... Cluster storage means, 16 ... Color code calculation means, 17
...... Change color calculation means, 18 ...... Keyboard, 19 ...... Second object color storage means.
Claims (2)
の三原色値を、三次元の色空間において黒色、物体色、
光源色の三色が張る平面上の色を示すと仮定して二次元
の中間座標値に変換し、その分布からクラスタリングに
より少数の代表色を選択し、前記色領域中の各画素につ
いて前記クラスタリングの基準に従って前記代表色を示
す色コードを与え、色コード画像を作成し、各色コード
に対応する変更色を前記光源色及び新たに与えられた第
2の物体色を用いて前記代表色について求めてルックア
ップテーブルに登録し、前記カラー画像と、前記色コー
ド画像に対しルックアップテーブルを適用した画像を切
り換えて表示することにより、上記色領域のみに所望の
色変更が自然になされた画像を高速に表示するカラー画
像の高速色変更表示方法。1. The three primary color values of each pixel in a target color region of a color image are set to black, object color,
Converted to a two-dimensional intermediate coordinate value assuming that the color of the light source color is on a plane, and select a small number of representative colors from the distribution by clustering, and the clustering for each pixel in the color region. A color code indicating the representative color is given according to the standard of 1., a color code image is created, and a changed color corresponding to each color code is obtained for the representative color using the light source color and the newly given second object color. By registering in the lookup table and switching between the color image and the image to which the lookup table is applied to the color code image to display, an image in which a desired color change is naturally made only in the color region is displayed. High-speed color change display method for color images displayed at high speed.
と、該カラー画像の対象となる色領域の物体色を記憶す
る第一の物体色記憶手段と、該カラー画像の光源色を記
憶する光源色記憶手段と、前記カラー画像の対象となる
色領域中の各画素の三原色値を、三次元の色空間におい
て、黒色、物体色、光源色の三色が張る平面上の色を示
すと仮定して、二次元の色空間の中間座標値に変換する
中間画素値計算手段と、該中間画素値計算手段から得ら
れる色分布をクラスタリングし、少数の代表色を選択す
るクラスタリング手段と、該クラスタリングの過程で得
られるクラスタリング基準と前記代表色を格納するクラ
スタ記憶手段と、前記中間画素値計算手段から得られる
中間座標値と前記クラスタリング基準により求められる
各画素の前記代表色に対応する色コードを画像として記
憶する色コード画像記憶手段と、前記色領域の色変更後
の物体色を記憶する第二の物体色記憶手段と、該第二の
物体色と前記光源色によって前記代表色から計算された
前記色コードに対応する三原色値を格納し、画像の表示
の際、前記色コード画像記憶手段から読み出される色コ
ードを三原色値に変換するルック・アップ・テーブル
と、画像の表示の際、前記カラー画像記憶手段から読み
出される画像の三原色値を前記色領域に属する画素につ
いては前記ルック・アップ・テーブルから出力される三
原色値に置き換えるディスプレイコントローラとを含
み、カラー画像の対象となる色領域の色を高速に変更し
表示するカラー画像の高速色変更表示装置。2. A color image storage means for storing a color image, a first object color storage means for storing an object color of a color region which is a target of the color image, and a light source for storing a light source color of the color image. It is assumed that the color storage means and the three primary color values of each pixel in the target color area of the color image represent a color on a plane formed by three colors of black, object color, and light source color in a three-dimensional color space. Then, an intermediate pixel value calculating means for converting into an intermediate coordinate value of a two-dimensional color space, a clustering means for clustering the color distribution obtained from the intermediate pixel value calculating means and selecting a small number of representative colors, and the clustering Clustering standard obtained in the process of and the cluster storage means for storing the representative color, the intermediate coordinate value obtained from the intermediate pixel value calculating means, and the representative of each pixel obtained by the clustering standard. A color code image storage means for storing the color code corresponding to the image as an image, a second object color storage means for storing the object color after the color change of the color region, and a second object color and the light source color. A look-up table that stores the three primary color values corresponding to the color code calculated from the representative color and converts the color code read from the color code image storage means into the three primary color values when the image is displayed; A display controller that replaces the three primary color values of the image read from the color image storage means with the three primary color values output from the look-up table for the pixels belonging to the color area. High-speed color change display device for color images that changes and displays the color of the color area to be displayed at high speed.
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP62080236A JPH06100900B2 (en) | 1987-03-31 | 1987-03-31 | Method and apparatus for high-speed color change display of color image |
| US07/596,425 US5058040A (en) | 1987-03-25 | 1990-10-11 | Simulation of a change in three-component color values by using two-component color values |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP62080236A JPH06100900B2 (en) | 1987-03-31 | 1987-03-31 | Method and apparatus for high-speed color change display of color image |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS63244094A JPS63244094A (en) | 1988-10-11 |
| JPH06100900B2 true JPH06100900B2 (en) | 1994-12-12 |
Family
ID=13712702
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP62080236A Expired - Lifetime JPH06100900B2 (en) | 1987-03-25 | 1987-03-31 | Method and apparatus for high-speed color change display of color image |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH06100900B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO1996022659A1 (en) | 1995-01-18 | 1996-07-25 | Sony Corporation | Device and method for converting color of picture data |
-
1987
- 1987-03-31 JP JP62080236A patent/JPH06100900B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPS63244094A (en) | 1988-10-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6429877B1 (en) | System and method for reducing the effects of aliasing in a computer graphics system | |
| US6621925B1 (en) | Image processing apparatus and method and information providing medium | |
| US5949426A (en) | Non-linear texture map blending | |
| US6768491B2 (en) | Barycentric centroid sampling method and apparatus | |
| US5877769A (en) | Image processing apparatus and method | |
| JPH07114503B2 (en) | Color correction method | |
| JPH08287239A (en) | Color adjusting device and method thereof | |
| JP3126046B2 (en) | Color adjustment method and color adjustment device for color image | |
| US5880735A (en) | Method for and apparatus for transparency conversion, image processing system | |
| US6771265B1 (en) | Computer-readable recording medium storing a program for 3-D computer image processing, method of depicting shadow, and video game apparatus | |
| US6744440B1 (en) | Image processing apparatus, recording medium, and program | |
| JPH09502816A (en) | Color matching system | |
| US7446767B2 (en) | Game apparatus and game program | |
| US6563497B1 (en) | Image processing apparatus | |
| JPH06100900B2 (en) | Method and apparatus for high-speed color change display of color image | |
| JPH0580704B2 (en) | ||
| US6900804B1 (en) | Method of forming polygon image and image processing apparatus using the same | |
| JPH05233826A (en) | Method and device for changing lighting direction of image and method and device for synthesizing images | |
| JPH0345427B2 (en) | ||
| US12322030B2 (en) | Computer-readable non-transitory storage medium having image processing program stored therein, image processing apparatus, image processing system, and image processing method | |
| JP2795083B2 (en) | Creating the same material appearance image in image processing | |
| JP2898569B2 (en) | Video accelerator board for computer game development | |
| JP4106719B2 (en) | Image processing device | |
| JPH05298455A (en) | Texture mapping device | |
| JP3468887B2 (en) | Image creation method and image creation device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| EXPY | Cancellation because of completion of term | ||
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20071212 Year of fee payment: 13 |