JPH02127781A - Color changing method and device for color picture - Google Patents

Color changing method and device for color picture

Info

Publication number
JPH02127781A
JPH02127781A JP28193388A JP28193388A JPH02127781A JP H02127781 A JPH02127781 A JP H02127781A JP 28193388 A JP28193388 A JP 28193388A JP 28193388 A JP28193388 A JP 28193388A JP H02127781 A JPH02127781 A JP H02127781A
Authority
JP
Japan
Prior art keywords
color
light source
changed
picture
values
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.)
Pending
Application number
JP28193388A
Other languages
Japanese (ja)
Inventor
Joji Tajima
譲二 田島
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP28193388A priority Critical patent/JPH02127781A/en
Publication of JPH02127781A publication Critical patent/JPH02127781A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To change the color of a color picture without damaging naturality by changing the three primary color values of the respective picture elements of an object in the color picture according to a fixed rule when the three primary color values of a light source color are changed. CONSTITUTION:When the light source color is changed, the color of the object is naturally changed. Namely, when the three primary color values of the light source color in the color picture are changed from (Rs, Gs, Bs) to (Rs', Gs', Bs'), three primary color values (R, G, B) of the respective picture elements of the object in the color picture are changed to (R', G', B') according to an expression I. Thus, a color scenary picture can be changed to the color scenary picture, which is irradiated with the light source of a color different from the original light source, and displayed. Then, a condition in the case that an industrial product is set under an environment to be different from the conventional environment can be checked without really executing the setting.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、カラーの画像の色を、自然さを損なわずに変
更する方法及び装置に関する。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a method and apparatus for changing the colors of a color image without impairing its naturalness.

(従来の技術) カラーデザインの分野にCAD(コンピュータ・エイデ
イラド・デザイン)が適用され、その中で色を変更する
ことが求められている。具体的には、デザインの対象(
例えば自動車)を含む画像を、スキャナやカラーカメラ
でコンピュータ・システムにとり込み、例えば他の風景
の中に合成する場合、この対象の部分の色を変更(例え
ば、元々、赤い自動車のボディーを青色)したり、光源
の色を(例えば、昼間の情景を夕暮れの情景に)変更し
たりすることが要求される。前者の対象物体の色を変更
することに関しては、既に以下のような方法が知られて
いる(特願昭62−072056号明細書)。
(Prior Art) CAD (Computer Aided Design) is applied to the field of color design, and there is a need to change colors within it. Specifically, the object of design (
For example, when an image containing a car (for example, a car) is imported into a computer system using a scanner or a color camera, and then composited into another scene, the color of this object part is changed (for example, the body of a car that was originally red is changed to blue). or change the color of the light source (eg, from a daytime scene to a dusk scene). Regarding the former method of changing the color of a target object, the following method is already known (Japanese Patent Application No. 1982-072056).

従来の方法を第3図を参照して説明する。光源11から
物体12に当たって、カメラ13に入る光は、鏡面反射
光14と拡散反射光15に大別できる。鏡面反射光は、
物体の表面で反射するもので、その分光組成は、光源と
同じで強度だけが変化する。拡散反射光は、光源の光が
物体の中に入射し、物体特有の分光吸収を受けたのち、
等方的に外部に射出されるものである。拡散反射光の分
光組成は光源とは異なっているのが普通である。そのた
め、対象面の各点の色の三成分(R,G、B)は、と書
くことができる。ここで、(RO2Go、Bo)は拡散
反射光の三成分であり、物体により異なるので、本明細
書では以降、[物体色」と呼ばれる。
The conventional method will be explained with reference to FIG. Light that hits the object 12 from the light source 11 and enters the camera 13 can be roughly divided into specularly reflected light 14 and diffusely reflected light 15. Specular reflected light is
Light is reflected from the surface of an object, and its spectral composition is the same as that of the light source, only the intensity changes. Diffuse reflected light is generated when light from a light source enters an object and undergoes spectral absorption unique to the object.
It is isotropically injected to the outside. The spectral composition of the diffusely reflected light is usually different from that of the light source. Therefore, the three color components (R, G, B) of each point on the target surface can be written as: Here, (RO2Go, Bo) are three components of the diffusely reflected light, and since they differ depending on the object, they are hereinafter referred to as "object colors" in this specification.

(Rs、Gs、B、)は鏡面反射光の三成分である、光
源の色と等しいので、本明細書では以降[光源色」と呼
ばれる。α、pは射出光量に対する拡散反射光、鏡面反
射光の寄与の度合いを示しており、表面の材質、方向な
どに関係する。これは、画素毎に異なるので、画素内の
画素位置を(x、y)とすると、と書かれる。
(Rs, Gs, B,) are the three components of specularly reflected light, and are equal to the color of the light source, so they are hereinafter referred to as [light source color] in this specification. α and p indicate the degree of contribution of diffuse reflected light and specular reflected light to the amount of emitted light, and are related to the surface material, direction, etc. This differs from pixel to pixel, so if the pixel position within a pixel is (x, y), then it is written as:

このとき、同じ材質で色が異なるものの見えがたは、物
体色のみを(馬、GO−BO)に変更することにより、
式(3)のように各画素値を計算することができる。
At this time, the appearance of objects with the same material but different colors can be changed by changing only the object color to (horse, GO-BO).
Each pixel value can be calculated as shown in equation (3).

同様に考えれば、後者の光源の色を変更する場合には、
光源色を(Rs’、Gs’、Bsつに変更することによ
り、式(4)のように各画素値を計算すればよいと考え
られる。
Thinking similarly, when changing the color of the latter light source,
It is considered that by changing the light source color to (Rs', Gs', and Bs), each pixel value may be calculated as shown in equation (4).

(本発明が解決しようとする問題点) しかし、実際には、この方法では自然に情景の色を変更
することができない。それは、光源色が変化した場合に
は物体色も変化するのか自然であるにも拘わらず、この
モデルでは物体色が変化することか考慮されていないた
めである。
(Problems to be Solved by the Present Invention) However, in reality, this method cannot naturally change the color of the scene. This is because, although it is natural that the object color also changes when the light source color changes, this model does not take into account whether the object color changes.

本発明は、この問題を解決し、光源色が変化した場合に
物体色も自然に変化させることによって情景の色を変更
する方法及び装置を提供することを目的としている。
The present invention aims to solve this problem and provide a method and apparatus for changing the color of a scene by naturally changing the object color when the light source color changes.

(問題点を解決するための手段) 第一の発明は、カラー画像における光源色の三原色値を
(Rs、G、B、)から所望の(Rs’、Gs’、Bs
’)に変更したとき、該カラー画像中の物体の各画素の
三原色値(R,G、B)を(R′、α、Bつにに従って
変更するカラー画像の色変更方法である。
(Means for solving the problem) The first invention is to change the three primary color values of the light source color in a color image from (Rs, G, B,) to desired (Rs', Gs', Bs
This is a method of changing the color of a color image, in which the three primary color values (R, G, B) of each pixel of an object in the color image are changed according to (R', α, B) when the object is changed to (R', α, B).

第二の発明は、カラー画像を格納するカラー画像記憶手
段と、該カラー画像の光源色の三原色値(”s、Gs、
Bs)を記憶する第一の光源色記憶手段と、所望の光源
色の三原色値(Rs’、Gs’、B8つを記憶する第二
の光源色記憶手段と、前記カラー画像の各画素の三原色
値(R,G、B)を前記第一の光源色記憶手段に記憶さ
れている三原色値(Rs、Gs、Bs)と前記第二の光
源色記憶手段に記憶されている三原色値(Rs’、GS
’、Bs’)を参照して新しい三原色値(R’、G’、
B”)にに従って変更する変更画像計算手段とがら成る
カラー画像の色変更装置である。
The second invention provides a color image storage means for storing a color image, and three primary color values ("s, Gs,
a first light source color storage means for storing the three primary color values (Rs', Gs', B) of the desired light source color; The values (R, G, B) are stored in the three primary color values (Rs, Gs, Bs) stored in the first light source color storage means and the three primary color values (Rs') stored in the second light source color storage means. , G.S.
', Bs') to create new primary color values (R', G',
This is a color changing device for a color image, comprising a changed image calculating means for changing the color according to the method (B).

(作用) デイスプレィに表示される光源色(Rs、Gs、Bs)
、及び物体色の三原色(馬、Go、Bo)は、光源の波
長λに関する分光エネルギ分布S(λ)及び物体の分光
反射率分布p(λ)により、 馬=JS(λ)〒(λ)dλ Gs=fS(λ)前(入)dλ         (5
)Bs=fS(λ)b(λ)dλ Rつ=fSCλ)p(入)i:(λ)dλGo=fS(
λ)p(λ)g(λ)dλ   (6)Bo=fS(λ
)p(λ)b(λ)dλの関係にある。ここで、〒(入
)、i(λ)、石(λ)はカメラなどの三原色センサの
分光感度である。
(Function) Light source color displayed on the display (Rs, Gs, Bs)
, and the three primary colors of the object (Ma, Go, Bo) are determined by the spectral energy distribution S (λ) regarding the wavelength λ of the light source and the spectral reflectance distribution p (λ) of the object, as follows: Ma = JS (λ) 〒 (λ) dλ Gs=fS(λ) before (in) dλ (5
)Bs=fS(λ)b(λ)dλR=fSCλ)p(in)i:(λ)dλGo=fS(
λ) p(λ) g(λ) dλ (6) Bo=fS(λ
)p(λ)b(λ)dλ. Here, 〒 (in), i (λ), and stone (λ) are the spectral sensitivities of a three primary color sensor such as a camera.

一般に、光源色が(Rs−Gs、Bs)から(L、’、
G8’、B、りに変化したとき、p(λ)が一定として
もS(λ)を求めることができないので、物体色がどの
ように変化するかは予測することができない。しかし、
すべての分光特性が、波長に関して滑らかに変化するこ
とを仮定すれば、第4図のように区分的に一定な分光特
性で近似することが可能である。即ち、光源はλ〉λ2
で馬、λ1くλく入2でG5、λくλ1でB、の強度を
持つ光と考え、物体の反射率はλ〉λ2でpr、λ1く
λくλ2でpg、λくλ1でpbであると考える。この
場合、物体色は(RO2Go、Bo)は光源色(Rs、
GS、B、)と反射率(pr、pg、pb)により、 ”o =”s’9r、Go = Gs’Pg、Bo =
 Bs・9b   (7)と書かれるので、光源色が(
Rs’、Gs’、Bs’)のように変更されたとき、物
体色は式(8)のように(Ro’、Go’、Bo’)で
表される。
Generally, the light source color changes from (Rs-Gs, Bs) to (L,',
Since it is not possible to obtain S(λ) even if p(λ) is constant when G8', B, and B change, it is not possible to predict how the object color will change. but,
Assuming that all spectral characteristics change smoothly with respect to wavelength, it is possible to approximate them with piecewise constant spectral characteristics as shown in FIG. That is, the light source is λ>λ2
Assuming that light has an intensity of G5 for λ1 x λ x 2, and B for λ x λ1, the reflectance of the object is pr for λ>λ2, pg for λ1 x λ x λ2, and pb for λ x λ1. I believe that. In this case, the object color (RO2Go, Bo) is the light source color (Rs,
GS, B, ) and reflectance (pr, pg, pb), "o = "s'9r, Go = Gs'Pg, Bo =
Since it is written as Bs・9b (7), the light source color is (
Rs', Gs', Bs'), the object color is expressed as (Ro', Go', Bo') as in equation (8).

5I Bo’ = Bs’l)b = Bo’−Bs そのため、同じ物体が含まれている情景で、光源色が(
Rs、Gs、B、)から(L、’、Gs’、Bsりに変
化した場合、各画素の色は式(8)で求められた(RO
’、Go’、Bo″)を用いて、 合には、 式(2)と比較すれば簡単に式(10)が成り立つこの
手法によれば、光源色が変化した場合の物体色の変化を
自然に表現することが可能である。
5I Bo' = Bs'l)b = Bo'-Bs Therefore, in a scene containing the same object, the light source color is (
When the color changes from Rs, Gs, B,) to (L,', Gs', Bs), the color of each pixel is calculated using equation (8).
According to this method, formula (10) is easily established when compared with formula (2). It is possible to express it naturally.

(実施例) 本発明の実施例を第1図を参照して説明する。カラー画
像メモリ1には色変更を行いたい対象を含むフルカラー
画像が例えば、R,G、B各8ビットの階調で格納され
ている。この内容はD/Aコンバータ2を介して、CR
T3にカラー画像として表示される。マスク画素メモリ
4は、この画像中の、色変更の対象とする色領域のマス
クを各画素1ビツトで格納している。この関係第2図に
示す。夕暮れの情景の中に、色変更の対象となる自動車
が存在する。
(Example) An example of the present invention will be described with reference to FIG. In the color image memory 1, a full-color image including an object whose color is to be changed is stored, for example, in R, G, and B gradations of 8 bits each. This content is transferred to the CR via the D/A converter 2.
It is displayed as a color image on T3. The mask pixel memory 4 stores a mask of a color area to be changed in this image, with one bit for each pixel. This relationship is shown in FIG. In the scene at dusk, there is a car whose color is to be changed.

元々、自動車の画像は別の昼間の画像から合成された場
合、この部分だけ色変更の対象となる。マスク画像メモ
リ4は、この色変更の対象となる自動車の部分について
のみ“1”で、それ以外の部分については“′0″で、
それ以外の部分については110+1を値とするマスク
画像を持つ。マスク画像は、CRTによってカラー画像
は、通常画像部分を別の画像から切り抜き合成する際に
作られている。
Originally, when an image of a car is synthesized from other daytime images, only this part is subject to color change. The mask image memory 4 is "1" only for the part of the car that is subject to this color change, and is "0" for the other parts.
Other parts have a mask image with a value of 110+1. A color image is usually created by cutting out an image part from another image and combining the mask image with a CRT.

第1図の色指定手段5は利用者の指示により、CRT3
とボインティング・デバイス6を利用して、挿入される
自動車を含む元の画像をカラー画像メモリに格納するこ
とによって表示し、その画像中から光源色型のR,G、
B値(Rs、G8.Bs)をピックアップし、第一の光
源色記憶手段7に格納するものでマイクロコンピュータ
などで実現できる。
The color specifying means 5 in FIG.
The original image including the inserted car is stored in the color image memory and displayed using the pointing device 6 and the light source color type R, G,
The B value (Rs, G8.Bs) is picked up and stored in the first light source color storage means 7, and can be realized by a microcomputer or the like.

実際の色変更は、まず利用者が自動車が合成された画像
をカラー画像メモリに格納して表示しそれに対し、例え
ばボインティング・デバイス6により夕暮れの情景から
光源色Csの代わりの新しい光源色Cs’のR,G、B
値(”s’、Gs’、Bs’)を色指定手段5に与え、
これが第二の光源色記憶手段8に格納されることにより
開始される。変更画像計算手段9は、マスク画像メモリ
4の各画素を走査し、値が“1″である画素に対して、
カラー画像メモリ1の各画素に対して(R(x、y)、
G(x、y)、B(x、y))を読み出し、第一の光源
色記憶手段7及び第二の光源色記憶手段8に記憶されて
いる2つのR,G、B値により、式(10)の計算を行
い、変更された画素値(R’(x、y)、G’(x、y
)、B’(x、y))を再びカラー画像メモリに書き込
む。これが、全画素について終了した時点で、カラー画
像メモリ1中の情景画像は所望の光源で照らされた情景
画像に、自然に置き換えられている。
To actually change the color, the user first stores an image in which the car is synthesized in the color image memory and displays it, and then, for example, uses the pointing device 6 to select a new light source color Cs instead of the light source color Cs from a twilight scene. 'R, G, B
Give the values ("s', Gs', Bs') to the color specifying means 5,
This is started by being stored in the second light source color storage means 8. The modified image calculation means 9 scans each pixel of the mask image memory 4, and calculates the value for the pixel whose value is "1".
For each pixel of color image memory 1, (R(x, y),
G(x, y), B(x, y)), and use the two R, G, and B values stored in the first light source color storage means 7 and the second light source color storage means 8 to form the formula (10) is calculated, and the changed pixel values (R'(x, y), G'(x, y
), B'(x,y)) are written into the color image memory again. When this is completed for all pixels, the scene image in the color image memory 1 has been naturally replaced with a scene image illuminated by the desired light source.

(発明の効果) 以上に述べた方法及び装置により、カラー情景画像を本
来の光源と異なった色の光源で照らされた情景画像に変
更して表示することが可能となる。本発明により、工業
製品を従来と異なった環境に置いた場合の様子を実際に
実行することなくチエツクすることができ、工業的、経
済的に大きな効果がある。
(Effects of the Invention) With the method and device described above, it becomes possible to change a color scene image into a scene image illuminated by a light source of a different color from the original light source and display it. According to the present invention, it is possible to check what happens when an industrial product is placed in an environment different from the conventional one without actually carrying out the test, and this has great industrial and economical effects.

【図面の簡単な説明】[Brief explanation of drawings]

第1図は本発明の実施例をしめずブロック図、第2図は
第1図におけるカラー画像メモリとマスク画像メモリの
関係を示す説明図、第3図は従来の色変更方法で用いる
物体から反射される光の組成の説明図、第4図は本発明
の作用で仮定する区分的に一定な分光特性の説明図であ
る。 図において、 1・・・カラー画像メモリ、2・・−D/A変換器、3
・・・CRT、4・・・マスク画像メモリ、5・・・色
指定手段、6・・・ポインティングデバイス、7・・・
第一の光源色記憶手段、8・・・第二の光源色記憶手段
、9・・・変更画像計画手段。
FIG. 1 is a block diagram showing an embodiment of the present invention, FIG. 2 is an explanatory diagram showing the relationship between the color image memory and mask image memory in FIG. 1, and FIG. FIG. 4 is an explanatory diagram of the composition of reflected light, and is an explanatory diagram of piecewise constant spectral characteristics assumed in the operation of the present invention. In the figure, 1...color image memory, 2...-D/A converter, 3
... CRT, 4... Mask image memory, 5... Color specifying means, 6... Pointing device, 7...
First light source color storage means, 8... Second light source color storage means, 9... Changed image planning means.

Claims (1)

【特許請求の範囲】 1、カラー画像における光源色の三原色値を(R_s、
G_s、B_s)から所望の(R_s’、G_s’、B
_s’)に変更したとき、該カラー画像中の物体の各画
素の三原色値(R、G、B)を(R’、G’、B’)に
、 R’=(R_s’/R_s)R、G’=(G_s’/G
_s)G、B’=(B_s’/B_s)Bに従って変更
するカラー画像の色変更方法。 2、カラー画像を格納するカラー画像記憶手段と、該カ
ラー画像の光源色の三原色値(R_s、G_s、B_s
)を記憶する第一の光源色記憶手段と、所望の光源色の
三原色値(R_s’、G_s’、B_s’)を記憶する
第二の光源色記憶手段と、前記カラー画素の各画素の三
原色値(R、G、B)を前記第一の光源色記憶手段に記
憶されている三原色値(R_s、G_s、B_s)と前
記第二の光源色記憶手段に記憶されている三原色値(R
_s’、G_s’、B_s’)を参照して新しい三原色
値(R’、G’、B’)に、 R’=(R_s’/R_s)R、G’=(G_s’/G
_s)G、B’=(B_s’/B_s)Bに従って変更
する変更画像計算手段とから成るカラー画素の色変更装
置。
[Claims] 1. The three primary color values of the light source color in a color image are (R_s,
G_s, B_s) to the desired (R_s', G_s', B
_s'), the three primary color values (R, G, B) of each pixel of the object in the color image are changed to (R', G', B'), R'=(R_s'/R_s)R , G'=(G_s'/G
__s) A method of changing the color of a color image according to G, B'=(B_s'/B_s)B. 2. Color image storage means for storing a color image, and three primary color values (R_s, G_s, B_s) of the light source color of the color image.
), a second light source color storage means for storing the three primary color values (R_s', G_s', B_s') of the desired light source color, and the three primary colors of each pixel of the color pixels. The values (R, G, B) are stored in the three primary color values (R_s, G_s, B_s) stored in the first light source color storage means and the three primary color values (R_s) stored in the second light source color storage means.
__s', G_s', B_s') to new three primary color values (R', G', B'), R'=(R_s'/R_s)R, G'=(G_s'/G
_s) A change image calculation means for changing the color according to G, B'=(B_s'/B_s)B.
JP28193388A 1988-11-07 1988-11-07 Color changing method and device for color picture Pending JPH02127781A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP28193388A JPH02127781A (en) 1988-11-07 1988-11-07 Color changing method and device for color picture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP28193388A JPH02127781A (en) 1988-11-07 1988-11-07 Color changing method and device for color picture

Publications (1)

Publication Number Publication Date
JPH02127781A true JPH02127781A (en) 1990-05-16

Family

ID=17645960

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28193388A Pending JPH02127781A (en) 1988-11-07 1988-11-07 Color changing method and device for color picture

Country Status (1)

Country Link
JP (1) JPH02127781A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5572635A (en) * 1991-06-04 1996-11-05 Hitachi, Ltd. Method for changing a natural image based on a light environment in the natural image
JP2010506228A (en) * 2006-10-12 2010-02-25 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Color mapping method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5572635A (en) * 1991-06-04 1996-11-05 Hitachi, Ltd. Method for changing a natural image based on a light environment in the natural image
JP2010506228A (en) * 2006-10-12 2010-02-25 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Color mapping method

Similar Documents

Publication Publication Date Title
Hall et al. A testbed for realistic image synthesis
WO1998038591A2 (en) Method for rendering shadows on a graphical display
JP5615041B2 (en) Image processing apparatus and image processing method
US20020030681A1 (en) Method for efficiently calculating texture coordinate gradient vectors
US20030222875A1 (en) Method and program for generating a two-dimensional cartoonish picturization of a three-dimensional object
US8081185B2 (en) Information processing apparatus and information processing method
US5880735A (en) Method for and apparatus for transparency conversion, image processing system
JPH02127781A (en) Color changing method and device for color picture
US7230619B2 (en) Use of sigma-weighted darkmaps for texture map processing
US6753875B2 (en) System and method for rendering a texture map utilizing an illumination modulation value
JP2007272847A (en) Lighting simulation method and image composition method
JPH0580704B2 (en)
US20050249407A1 (en) Color characterization using color value clipping
EP2063395B1 (en) Tinting a surface to simulate a visual effect in a computer generated scene
JP2702185B2 (en) Method and apparatus for coloring grayscale images
JPH02127779A (en) Color changing method and device for color picture
JP2009020206A (en) Rear projection liquid crystal display device
JPH05210721A (en) Electronic picture generator
JP2713677B2 (en) Color image color change processing method and color image synthesis processing method
WO2001020556A1 (en) Image processing apparatus, recording medium, and program
JP2756047B2 (en) Color image color adjustment method and apparatus, and image synthesis method
JPS63244094A (en) Fast color alteration display method and apparatus for color image
JPH0981771A (en) Image display device
Um et al. Rendering Theory
Ammeraal et al. Color, Texture, and Shading