JP2896311B2 - How to make a color image mask - Google Patents

How to make a color image mask

Info

Publication number
JP2896311B2
JP2896311B2 JP16592094A JP16592094A JP2896311B2 JP 2896311 B2 JP2896311 B2 JP 2896311B2 JP 16592094 A JP16592094 A JP 16592094A JP 16592094 A JP16592094 A JP 16592094A JP 2896311 B2 JP2896311 B2 JP 2896311B2
Authority
JP
Japan
Prior art keywords
color
vector
mask
vectors
value
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 - Fee Related
Application number
JP16592094A
Other languages
Japanese (ja)
Other versions
JPH087107A (en
Inventor
淳志 今村
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.)
Dainippon Screen Manufacturing Co Ltd
Original Assignee
Dainippon Screen Manufacturing Co Ltd
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 Dainippon Screen Manufacturing Co Ltd filed Critical Dainippon Screen Manufacturing Co Ltd
Priority to JP16592094A priority Critical patent/JP2896311B2/en
Priority to EP95108520A priority patent/EP0693738A3/en
Priority to US08/466,598 priority patent/US5659490A/en
Publication of JPH087107A publication Critical patent/JPH087107A/en
Application granted granted Critical
Publication of JP2896311B2 publication Critical patent/JP2896311B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Preparing Plates And Mask In Photomechanical Process (AREA)
  • Image Analysis (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】この発明は、カラー画像内の所望
の色部分の切抜き処理等に使用されるマスクを作成する
方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for producing a mask used for cutting out a desired color portion in a color image.

【0002】[0002]

【従来の技術】印刷製版工程においては、写真原稿など
のカラー画像の特定の色の部分に対して色変更や鮮鋭度
強調等の種々の処理を選択的に行ないたい場合がある。
例えば、衣服を着たモデルの衣服の色のみを変更した
り、モデルの肌を除く部分に鮮鋭度強調を行ないたい場
合などがある。このように、カラー画像の特定の色部分
にのみ所望の処理を行なう(または行わない)際には、
その色部分を示す切抜きマスクが作成される。
2. Description of the Related Art In a printing plate making process, it is sometimes desired to selectively perform various processes such as color change and sharpness enhancement on a specific color portion of a color image such as a photo original.
For example, there are cases where it is desired to change only the color of the clothes of the model wearing the clothes, or to emphasize the sharpness on the portion excluding the skin of the model. As described above, when the desired processing is performed (or not performed) only on a specific color portion of a color image,
A cutout mask indicating the color portion is created.

【0003】図1は、カラー画像と好ましいマスクの一
例を示す説明図である。図1(A)に示すカラー画像
は、黒色の髪のモデルが、黄色地にバラの花の模様がプ
リントされた衣服を着ている写真である。バラの花は、
白色およびピンク色の花びらと、その周囲にある緑色の
葉とを有している。図1(B)に示すマスクは、衣服の
黄色部分と緑色部分とを示すマスクである。
FIG. 1 is an explanatory diagram showing an example of a color image and a preferable mask. The color image shown in FIG. 1A is a photograph in which a black hair model is wearing clothes in which a rose flower pattern is printed on a yellow background. Rose flower
It has white and pink petals and green leaves around it. The mask shown in FIG. 1B is a mask showing a yellow portion and a green portion of the clothes.

【0004】カラー画像の色を分析することによってマ
スクを作成する方法としては、例えば特開平1−298
477号公報に記載されたものがある。この方法は、マ
スク領域となるべき部分(トレーニングエリア)の複数
の画素の色を分析してその色の主成分軸を求める。そし
て、カラー画像内の各画素の色がその主成分軸以外の成
分を多く含む場合(すなわち、その色が主成分軸から遠
い場合)には、その画素をマスク領域から除外する。
As a method of creating a mask by analyzing the color of a color image, for example, Japanese Patent Laid-Open No. 1-298
There is one described in Japanese Patent No. 477. According to this method, the colors of a plurality of pixels in a portion (training area) to be a mask region are analyzed to obtain a principal component axis of the color. When the color of each pixel in the color image includes many components other than the principal component axis (that is, when the color is far from the principal component axis), the pixel is excluded from the mask area.

【0005】[0005]

【発明が解決しようとする課題】しかし、上述の従来の
技術では、図1(B)に示すように黄色をマスク領域と
しつつ肌色をマスク領域から除外することは困難であっ
た。これは、肌色が黄色成分をかなり含むので、黄色を
マスク領域の色として指定した場合には、肌色もマスク
領域として認識されてしまうからである。このような問
題は、比較的近い色相を有する2つの色の一方をマスク
領域とし、他方をマスク領域から除外しようとする場合
に共通する問題であった。
However, in the above-described conventional technique, it was difficult to exclude the skin color from the mask area while using yellow as the mask area as shown in FIG. 1 (B). This is because the skin color contains a considerable amount of yellow component, and if yellow is specified as the color of the mask area, the skin color is also recognized as the mask area. Such a problem is a common problem when one of two colors having relatively similar hues is used as a mask region and the other is excluded from the mask region.

【0006】この発明は、従来技術における上述の課題
を解決するためになされたものであり、比較的近い色相
の2つの色のうちで、一方の色部分をマスク領域とし、
他方の色部分をマスク領域から除外することのできるマ
スク作成方法を提供することを目的とする。
The present invention has been made to solve the above-mentioned problem in the prior art, and one of two colors having relatively close hues is used as a mask area.
It is an object of the present invention to provide a mask creating method capable of excluding the other color portion from a mask area.

【0007】[0007]

【課題を解決するための手段および作用】上述の課題を
解決するため、この発明の請求項1に記載した方法は、
前記カラー画像内において前記マスクの対象色を指定す
る工程と、前記カラー画像内において前記マスクの対象
外色を指定する工程と、所定の色空間における前記対象
色の第1の色ベクトルを求める工程と、前記所定の色空
間における前記対象外色の第2の色ベクトルを求める工
程と、前記第1と第2の色ベクトルとは独立の第3の色
ベクトルを求める工程と、前記カラー画像内の各画素の
色を、前記第1ないし第3の色ベクトルの線形結合で表
わすときの前記第1ないし第3の色ベクトルに対する第
1ないし第3の係数をそれぞれ求める工程と、前記カラ
ー画像内の各画素における前記第1の係数の値に応じて
前記マスクを作成する工程と、を備えることを特徴とす
る。
In order to solve the above-mentioned problems, a method according to claim 1 of the present invention comprises:
Specifying a target color of the mask in the color image; specifying a non-target color of the mask in the color image; and obtaining a first color vector of the target color in a predetermined color space Obtaining a second color vector of the non-target color in the predetermined color space; obtaining a third color vector independent of the first and second color vectors; Calculating the first to third coefficients for the first to third color vectors when the color of each pixel is represented by a linear combination of the first to third color vectors; And forming the mask in accordance with the value of the first coefficient in each pixel.

【0008】上述の方法によれば、対象色に近い色につ
いては第1の係数が大で第2の係数は小さく、一方、対
象外色に近い色については第1の係数が小で第2の係数
が大きくなる。従って、対象色と対象外色の色相が近い
場合にも、第1の係数に応じてマスクを作成すれば、対
象色に近い色部分をマスク領域とし、対象外色に近い色
部分をマスク領域から除外することができる。
According to the above-described method, the first coefficient is large and the second coefficient is small for a color close to the target color, while the first coefficient is small for the color close to the non-target color. Becomes larger. Therefore, even when the hue of the target color and the non-target color are close to each other, if a mask is created according to the first coefficient, a color part close to the target color is set as a mask area and a color part close to the non-target color is set as a mask area Can be excluded from

【0009】請求項2に記載した方法では、前記マスク
作成工程は、前記第1の係数をしきい値で2値化するこ
とによって、前記マスクを表わすマスクデータを作成す
る工程を含む。
According to a second aspect of the present invention, the mask forming step includes a step of forming mask data representing the mask by binarizing the first coefficient with a threshold value.

【0010】こうすれば、マスク領域のみを示す2値の
マスクデータを容易に作成することができる。
This makes it possible to easily create binary mask data indicating only the mask area.

【0011】請求項3に記載した方法では、前記第1の
係数を2値化する工程は、前記第1の係数の出現頻度を
示すヒストグラムを作成する工程と、前記ヒストグラム
の極小値における前記第1の係数を前記しきい値として
設定する工程と、を備える、。
According to a third aspect of the present invention, the step of binarizing the first coefficient includes the step of creating a histogram indicating the frequency of occurrence of the first coefficient, and the step of binarizing the first coefficient. Setting a coefficient of 1 as the threshold value.

【0012】こうすれば、ヒストグラムに応じて2値化
のしきい値を自動的に決定することができる。
In this case, the threshold for binarization can be automatically determined according to the histogram.

【0013】請求項4に記載した方法では、前記第3の
色ベクトルは白色を表わすベクトルである。
[0013] In the method according to claim 4, the third color vector is a vector representing white.

【0014】こうすれば、第3の色ベクトルを容易に決
定することができる。
In this case, the third color vector can be easily determined.

【0015】請求項5に記載した方法では、前記第3の
色ベクトルを求める工程は、前記第1と第2の色ベクト
ルを、色相/彩度/明度空間における第4および第5の
色ベクトルにそれぞれ変換する工程と、前記第4と第5
の色ベクトルの少なくとも一方の彩度成分が所定の値を
超える場合には、前記所定の色空間において白色を表わ
すベクトルを前記第3の色ベクトルとして選択し、前記
第4と第5の色ベクトルの少なくとも一方の彩度成分が
前記所定の値未満の場合には、前記第4と第5の色ベク
トルのうちで彩度成分のより大きな色ベクトルについて
前記色相/彩度/明度空間において色相を所定の角度回
転した第6の色ベクトルを生成し、前記第6の色ベクト
ルを前記所定の色空間のベクトルに変換することによっ
て前記第3の色ベクトルを生成する工程と、を備える。
The method according to claim 5, wherein the step of obtaining the third color vector includes the steps of converting the first and second color vectors into fourth and fifth color vectors in a hue / saturation / lightness space. And the fourth and fifth steps, respectively.
If at least one of the chroma components of the color vector exceeds a predetermined value, a vector representing white in the predetermined color space is selected as the third color vector, and the fourth and fifth color vectors are selected. If at least one of the chroma components is less than the predetermined value, the hue in the hue / saturation / brightness space is determined for the color vector having the larger chroma component among the fourth and fifth color vectors. Generating a sixth color vector rotated by a predetermined angle, and generating the third color vector by converting the sixth color vector into a vector in the predetermined color space.

【0016】こうすれば、第1と第2の色ベクトルとは
独立な第3の色ベクトルを容易に決定することができ
る。また、第1ないし第3の色ベクトルはそれぞれ現実
の色を表わすことになるので、各画素の色に対する第1
の係数が、対象色の成分を実際に表わす指標となる。
This makes it possible to easily determine a third color vector independent of the first and second color vectors. In addition, since the first to third color vectors each represent an actual color, the first to third color vectors correspond to the color of each pixel.
Is an index that actually represents the component of the target color.

【0017】請求項6に記載した方法では、前記第1な
いし第3の色ベクトルは単位ベクトルである。
According to a sixth aspect of the present invention, the first to third color vectors are unit vectors.

【0018】こうすれば、第1ないし第3の色ベクトル
が色相のみを表わすベクトルになるので、カラー画像の
各画像の色相に応じてマスクを作成することができる。
In this case, the first to third color vectors are vectors representing only the hues, so that a mask can be created according to the hues of each color image.

【0019】[0019]

【実施例】図2は、この発明の一実施例を適用して切抜
きマスクを作成するマスク作成システムの構成を示すブ
ロック図である。このマスク作成システムは、CPU2
0と、カラー原稿画像を記憶する元画像メモリ22と、
色ベクトルの成分を記憶するベクトル値メモリ24と、
後述するマトリクスの成分を記憶するマトリクスメモリ
26と、多階調マスクデータを記憶する多階調マスクメ
モリと、2値マスクデータを記憶する2値マスクメモリ
30とを備えたコンピュータシステムである。このシス
テムは、さらに、入力手段または指定手段としてのキー
ボード32およびマウス34と、画像入力手段としての
読取スキャナ36と、表示手段としてのカラーCRT3
8と、外部記憶手段としてのハードディスク装置40と
を備えている。
FIG. 2 is a block diagram showing the configuration of a mask making system for making a cutout mask by applying an embodiment of the present invention. This mask creation system is based on the CPU 2
0, an original image memory 22 for storing a color original image,
A vector value memory 24 for storing components of a color vector,
This is a computer system including a matrix memory 26 for storing components of a matrix described later, a multi-tone mask memory for storing multi-tone mask data, and a binary mask memory 30 for storing binary mask data. The system further includes a keyboard 32 and a mouse 34 as input means or designation means, a reading scanner 36 as image input means, and a color CRT 3 as display means.
8 and a hard disk device 40 as external storage means.

【0020】CPU20は、マトリクス演算部50と、
多階調マスク演算部52と、2値化演算部54としての
機能を有する。これらの各部は、図示しないRAMに記
憶されたソフトウェアプログラムをCPU20が実行す
ることによって実現される。なお、これらの機能につい
ては更に後述する。
The CPU 20 includes a matrix operation unit 50,
It has a function as a multi-tone mask calculation unit 52 and a binarization calculation unit 54. These components are realized by the CPU 20 executing a software program stored in a RAM (not shown). Note that these functions will be further described later.

【0021】図3は、実施例における切抜きマスクの作
成の全体手順を示すフローチャートである。ステップS
1では、カラー原稿の画像データを読取スキャナ36で
読み取って、元画像メモリ22に記憶する。このカラー
原稿は、例えば、図1(A)に示すようなカラー写真で
ある。なお、元画像メモリ22はフレームメモリであ
り、元画像メモリ22に記憶された画像はカラーCRT
38に表示される。
FIG. 3 is a flowchart showing the overall procedure for creating a cutout mask in the embodiment. Step S
In step 1, the image data of the color original is read by the reading scanner 36 and stored in the original image memory 22. This color original is, for example, a color photograph as shown in FIG. The original image memory 22 is a frame memory, and the image stored in the original image memory 22 is a color CRT.
38 is displayed.

【0022】ステップS2およびS3では、ユーザがカ
ラーCRT38に表示されたカラー画像上において、切
抜きの対象色と対象外色とをそれぞれ指定する。例え
ば、図1(A)における衣服の地の色である黄色を対象
色として指定し、モデルの肌色を対象外色として指定す
る。色の指定は、マウス34などのポインティングデバ
イスを用いて、カラーCRT38に表示されたカラー画
像の上の一点を指定することによって行なわれる。この
代わりに、近似する色の複数の点を指定して、その平均
の色を求める処理によって、対象色と対象外色とをそれ
ぞれ指定するようにしてもよい。
In steps S2 and S3, the user specifies a target color and a non-target color on the color image displayed on the color CRT 38, respectively. For example, yellow as the background color of the clothes in FIG. 1A is designated as the target color, and the skin color of the model is designated as the non-target color. The color is specified by using a pointing device such as a mouse 34 to specify a point on the color image displayed on the color CRT 38. Alternatively, a target color and a non-target color may be respectively specified by a process of specifying a plurality of points of an approximate color and calculating the average color.

【0023】図4は、マンセルの色相環上における対象
色と対象外色の位置を示す説明図である。対象色として
指定された黄色と、対象外色として指定された肌色は色
相環上で近接した位置にある。この発明では、このよう
に2つの色の色相が近接している場合でも、一方の色を
マスクの対象色とし、他方の色をマスクの対象外色とす
ることが可能である。なお、以下においては、特に言及
しない限り、対象色および対象外色として黄色および肌
色を指定した場合に特定せず、一般的に説明する。
FIG. 4 is an explanatory diagram showing the positions of target colors and non-target colors on the Munsell hue circle. The yellow color specified as the target color and the flesh color specified as the non-target color are close to each other on the hue circle. According to the present invention, even when the hues of two colors are close to each other, it is possible to set one color as a target color of the mask and the other color as a non-target color of the mask. In the following, unless otherwise specified, the case where yellow and flesh color are designated as target colors and non-target colors will not be specified, and will be generally described.

【0024】ステップS4では、マトリクス演算部50
(図2)が対象色と対象外色の色ベクトルをそれぞれ算
出するとともに、後述するマトリクス(行列)を求める
処理を行なう。
In step S4, the matrix operation unit 50
(FIG. 2) calculates the color vector of the target color and the color vector of the non-target color, and performs a process of obtaining a matrix (matrix) described later.

【0025】図5は、ステップS4の詳細手順を示すフ
ローチャートである。ステップS11では、対象色の色
ベクトルを正規化することによって、第1の色ベクトル
を求める。図6は、第1と第2の色ベクトルを示すグラ
フである。対象色Csub のRGBの各成分を(R1 ,G
1 ,B1 )とすると、対象色Csub を表わすベクトルは
Vsub (R1 ,G1 ,B1 )と表わされる。なお、図6
では図示の便宜上、RGB空間のG軸を省略している。
ステップS11においては、マトリクス演算部50がこ
の色ベクトルVsub の単位ベクトルV1(r1 ,g1 ,
b1 )を求め、その成分(r1 ,g1 ,b1 )をベクト
ル値メモリ24に記憶する。ここで、単位ベクトルとは
長さ1のベクトルである。ステップS12においても同
様に、対象外色の色ベクトルVnsub(R2 ,G2 ,B2
)の単位ベクトルV2(r2 ,g2 ,b2 )を求め、
その成分をベクトル値メモリ24に記憶する。
FIG. 5 is a flowchart showing a detailed procedure of step S4. In step S11, a first color vector is obtained by normalizing the color vector of the target color. FIG. 6 is a graph showing the first and second color vectors. Each of the RGB components of the target color Csub is represented by (R1, G
1, B1), the vector representing the target color Csub is represented as Vsub (R1, G1, B1). FIG.
For simplicity of illustration, the G axis in the RGB space is omitted.
In step S11, the matrix operation unit 50 determines that the unit vector V1 (r1, g1,
b1), and the components (r1, g1, b1) are stored in the vector value memory 24. Here, the unit vector is a vector having a length of one. Similarly, in step S12, the color vector Vnsub (R2, G2, B2
) Is determined, and a unit vector V2 (r2, g2, b2)
The component is stored in the vector value memory 24.

【0026】こうして得られた第1と第2の色ベクトル
V1,V2は、RGB空間内の色を表現するための基底
を構成する3つのベクトルのうちの2つを構成する。基
底を構成するための第3の色ベクトルV3としては、第
1と第2の色ベクトルV1,V2とは独立な単位ベクト
ルが選択される。すなわち、第3の色ベクトルは、第1
と第2の色ベクトルV1,V2の線形結合では表わせな
い単位ベクトルである。例えば、第3の色ベクトルV3
として、白色を表わす単位ベクトルVWHが選択される。
白色の単位ベクトルVWHの成分は、(1/√3,1/√
3,1/√3)である。
The first and second color vectors V1 and V2 thus obtained constitute two of the three vectors constituting the basis for expressing colors in the RGB space. As the third color vector V3 for forming the basis, a unit vector independent of the first and second color vectors V1 and V2 is selected. That is, the third color vector is the first color vector.
Is a unit vector that cannot be expressed by a linear combination of the second color vector V1 and the second color vector V2. For example, the third color vector V3
Is selected as the unit vector VWH representing white.
The component of the white unit vector VWH is (1 / {3,1 / √)
3,1 / √3).

【0027】図7は、第1ないし第3の色ベクトルV
1,V2,V3とRGB空間の関係を示す説明図であ
る。この実施例では、次の数式1に示すように、一次独
立な3つの色ベクトルV1,V2,V3を基底として用
い、RGB空間内の任意の色E(Re,Ge,Be)
を、3つの色ベクトルV1,V2,V3の線形結合(一
次結合)で表現する。
FIG. 7 shows the first to third color vectors V
FIG. 3 is an explanatory diagram illustrating a relationship between 1, V2, and V3 and an RGB space. In this embodiment, as shown in the following Expression 1, three linearly independent color vectors V1, V2, and V3 are used as bases, and an arbitrary color E (Re, Ge, Be) in an RGB space is used.
Is represented by a linear combination (linear combination) of three color vectors V1, V2, and V3.

【0028】[0028]

【数1】 (Equation 1)

【0029】後述するように、マスクを表わすマスクデ
ータは、第1の色ベクトルV1(すなわち、対象色に関
する色ベクトル)に対する係数k1に基づいて作成され
る。ところで、第1と第2の色ベクトルV1,V2のい
ずれか一方が第3の色ベクトルV3に一致している場合
には、3つの色ベクトルが一次独立ではなくなるので、
任意の色を3つのベクトルV1〜V3で表現することは
できなくなる。また、第1と第2の色ベクトルV1,V
2のいずれか一方が第3の色ベクトルV3に十分に近接
している場合にも、第1の色ベクトルV1に対する係数
k1が過度に大きくなったり小さくなったりすることが
ある。そこで、図5のステップS13では、第1と第2
の色ベクトルV1,V2のいずれか一方が白色の単位ベ
クトルVWH(1/√3,1/√3,1/√3)に十分に
近接しているか否かを調べる。そして、十分に近接して
いる場合には、ステップS14において、第3の色ベク
トルV3として白色の単位ベクトルVWH以外のベクトル
を設定する。
As will be described later, mask data representing a mask is created based on the coefficient k1 for the first color vector V1 (ie, the color vector for the target color). By the way, when one of the first and second color vectors V1 and V2 coincides with the third color vector V3, the three color vectors are not linearly independent.
An arbitrary color cannot be represented by the three vectors V1 to V3. Also, the first and second color vectors V1, V
Even when one of the two is sufficiently close to the third color vector V3, the coefficient k1 for the first color vector V1 may become excessively large or small. Therefore, in step S13 of FIG.
It is checked whether one of the color vectors V1 and V2 is sufficiently close to the white unit vector VWH (1 / √3, 1 / √3, 1 / √3). If they are sufficiently close, in step S14, a vector other than the white unit vector VWH is set as the third color vector V3.

【0030】まず、ステップS13では、次の数式2に
従って、第1と第2の色ベクトルV1,V2をHSV座
標系(色相/彩度/明度座標系)に変換する。
First, in step S13, the first and second color vectors V1 and V2 are converted into an HSV coordinate system (hue / saturation / lightness coordinate system) according to the following equation (2).

【0031】[0031]

【数2】 (Equation 2)

【0032】数式2において、演算子「max」と「m
in」は、括弧内の値の最大値と最小値をそれぞれ取る
演算を示す。数式2によって、第1の色ベクトルV1
(r1,g1 ,b1 )と第2の色ベクトルV2(r2 ,
g2 ,b2 )のそれぞれの色相値H,明度値V,彩度値
Sが求められる。
In equation (2), the operators "max" and "m
"in" indicates an operation that takes the maximum value and the minimum value of the values in parentheses, respectively. According to Equation 2, the first color vector V1
(R1, g1, b1) and the second color vector V2 (r2,
g2, b2), the hue value H, lightness value V, and saturation value S are obtained.

【0033】図8は、HSV空間を示す説明図である。
図8から解るように、白色の単位ベクトルVWHは明度V
の座標軸上に存在する。換言すれば、白色の単位ベクト
ルVWHは彩度Sと色相Hとを持たないベクトルである。
なお、HSV空間は円筒座標系(zrθ座標系)であ
り、明度Vが垂直座標zに、彩度Sが径rに、色相Hが
角度θに相当する。
FIG. 8 is an explanatory diagram showing the HSV space.
As can be seen from FIG. 8, the white unit vector VWH is
Exists on the coordinate axis. In other words, the white unit vector VWH is a vector having no saturation S and no hue H.
The HSV space is a cylindrical coordinate system (zrθ coordinate system), in which lightness V corresponds to vertical coordinate z, saturation S corresponds to diameter r, and hue H corresponds to angle θ.

【0034】彩度値Sが小さい色ベクトルは、白色の単
位ベクトルVWH(1/√3,1/√3,1/√3)に近
接している。従って、第1と第2の色ベクトルV1,V
2の少なくとも一方の彩度値Sが所定の値以下の場合に
は、その色ベクトルが白色の単位ベクトルVWHに十分に
近接していると判断できる。この所定の値としては、例
えば、各成分が8ビットのデータ、すなわち0〜255
の範囲の値で表わされる場合には10(16進数で0A
h)程度が適当である。
A color vector having a small saturation value S is close to a white unit vector VWH (1 / √3, 1 / √3, 1 / √3). Accordingly, the first and second color vectors V1, V
If at least one of the saturation values S is equal to or less than a predetermined value, it can be determined that the color vector is sufficiently close to the white unit vector VWH. As the predetermined value, for example, each component is 8-bit data, that is, 0 to 255
10 (0A in hexadecimal)
h) The degree is appropriate.

【0035】上述の方法の代わりに、彩度値Sと明度値
Vとの比S/Vが一定値以下の場合に、その色ベクトル
が白色の単位ベクトルVWHに十分近接しているものと判
断するようにしてもよい。
Instead of the above method, when the ratio S / V between the saturation value S and the lightness value V is equal to or less than a predetermined value, it is determined that the color vector is sufficiently close to the white unit vector VWH. You may make it.

【0036】第1と第2の色ベクトルV1,V2の少な
くとも一方が白色の単位ベクトルVWHに十分に近接して
いる場合には、ステップS14において、第3の色ベク
トルV3として、白色の単位ベクトルVWH以外のベクト
ルが求められる。図9は、白色の単位ベクトルVWH以外
のベクトルを第3の色ベクトルV3として設定する方法
を示す説明図である。まず、第1と第2の色ベクトルV
1,V2のうちで、白色の単位ベクトルからより遠い方
の色ベクトルを選択する。図9の例では、彩度値Sが比
較的大きい第1の色ベクトルV1が選択される。そし
て、選択された色ベクトルV1の色相値Hから90を減
算する。すなわち、HSV空間内で色ベクトルV2を時
計廻りに90°回転する。こうして得られたベクトル
(H−90,S,V)をRGB座標系に逆変換し、その
RGB成分を正規化することによって、単位ベクトルで
ある第3の色ベクトルV3が得られる。図9には、この
ような演算によって得られた第3の色ベクトルV3が描
かれている。なお、回転角度は90°以外の任意の角度
とすることも可能である。
If at least one of the first and second color vectors V1 and V2 is sufficiently close to the white unit vector VWH, the white unit vector V3 is set as the third color vector V3 in step S14. Vectors other than VWH are determined. FIG. 9 is an explanatory diagram showing a method of setting a vector other than the white unit vector VWH as the third color vector V3. First, the first and second color vectors V
A color vector that is farther from the white unit vector is selected from 1, V2. In the example of FIG. 9, the first color vector V1 having a relatively large saturation value S is selected. Then, 90 is subtracted from the hue value H of the selected color vector V1. That is, the color vector V2 is rotated clockwise by 90 ° in the HSV space. The vector (H-90, S, V) obtained in this way is inversely transformed into an RGB coordinate system, and the RGB components are normalized, whereby a third color vector V3 as a unit vector is obtained. FIG. 9 illustrates the third color vector V3 obtained by such an operation. Note that the rotation angle can be set to any angle other than 90 °.

【0037】上述の手順によって得られた第3の色ベク
トルV3は、第1と第2の色ベクトルV1,V2から独
立なので、3つの色ベクトルV1〜V3を基底として用
いることができる。換言すれば、RGB色空間内の任意
の色が、上述の数式1のように、3つの色ベクトルV1
〜V3の線形結合によって表わされる。また、第3の色
ベクトルV3は第1または第2の色ベクトルの色相を回
転したものなので、現実に存在する色を示すベクトルで
ある。3つの色ベクトルV1〜V3はいずれも現実の色
を示すベクトルなので、各色ベクトルに対する係数k1
〜k3の値が、3つの色の混合比を表わす現実的な意味
を有することになる。
The third color vector V3 obtained by the above procedure is independent of the first and second color vectors V1 and V2, so that the three color vectors V1 to V3 can be used as a basis. In other words, any color in the RGB color space is represented by the three color vectors V1
VV3. The third color vector V3 is a vector indicating a color that actually exists because the third color vector V3 is obtained by rotating the hue of the first or second color vector. Since all three color vectors V1 to V3 are vectors indicating actual colors, the coefficient k1 for each color vector
The value of ~ k3 will have a realistic meaning representing the mixture ratio of the three colors.

【0038】第3の色ベクトルとしては、第1と第2の
色ベクトルV1,V2とは独立なベクトルを選択すれば
よいので、上記以外の種々の方法で第3の色ベクトルを
設定することができる。例えば、第1と第2の色ベクト
ルV1,V2の外積V1×V2を第3の色ベクトルV3
として使用することも可能である。しかし、この外積V
1×V2は現実の色を表わさない場合があり、この場合
には各色ベクトルに対する係数k1〜k3の値が現実的
な意味を有さなくなる。従って、上述したように、第1
と第2の色ベクトルの色相を回転することによって第3
の色ベクトルを求める方が好ましい。
As the third color vector, a vector independent of the first and second color vectors V1 and V2 may be selected, so that the third color vector is set by various methods other than those described above. Can be. For example, the outer product V1 × V2 of the first and second color vectors V1 and V2 is converted to the third color vector V3.
It is also possible to use as. However, this cross product V
In some cases, 1 × V2 does not represent a real color. In this case, the values of the coefficients k1 to k3 for each color vector have no practical meaning. Therefore, as described above, the first
And by rotating the hue of the second color vector
It is preferable to obtain the color vector of

【0039】こうして第3の色ベクトルV3が決定され
ると、ステップS15(図5)において3つの色ベクト
ルV1〜V3の成分で構成される3×3マトリクスM
(数式1参照)が作成され、マトリクスメモリ26に記
憶される。
When the third color vector V3 is determined in this way, in step S15 (FIG. 5), a 3 × 3 matrix M composed of components of three color vectors V1 to V3 is used.
(See Equation 1) is created and stored in the matrix memory 26.

【0040】任意の色E(Re,Ge,Be)に対する
係数K(k1,k2,k3)は、次の数式3で与えられ
る。
The coefficient K (k1, k2, k3) for an arbitrary color E (Re, Ge, Be) is given by the following equation (3).

【0041】[0041]

【数3】 (Equation 3)

【0042】従って、マトリクスMの逆行列M-1を求め
ておけば、任意の色E(Re,Ge,Be)にこの逆行
列M-1を乗ずることによって、係数K(k1,k2,k
3)を求めることができる。そこで、ステップS16で
は、マトリクス演算部50がこの逆行列M-1を演算し、
マトリクスメモリ26に格納する。
Therefore, if the inverse matrix M -1 of the matrix M is determined, the coefficient K (k1, k2, k) can be obtained by multiplying the inverse matrix M -1 by an arbitrary color E (Re, Ge, Be).
3) can be obtained. Therefore, in step S16, the matrix calculation unit 50 calculates the inverse matrix M −1 ,
It is stored in the matrix memory 26.

【0043】こうして、図3のステップS4の処理が終
了すると、ステップS5において多階調マスクが作成さ
れる。図10は、多階調マスクの作成手順を示すフロー
チャートである。ステップS21では、多階調マスク演
算部52が元画像メモリ22内のカラー画像の各画素の
画素値E(Re,Ge,Be)を読出し、数式3の右辺
に代入してその係数K(k1,k2,k3)を求める。
ステップS22では、得られた係数K(k1,k2,k
3)の中から第1の色ベクトルV1の係数k1を抽出
し、ステップS23で多階調マスクメモリ28に格納す
る。
When the processing in step S4 in FIG. 3 is completed, a multi-tone mask is created in step S5. FIG. 10 is a flowchart showing a procedure for creating a multi-tone mask. In step S21, the multi-tone mask calculation unit 52 reads out the pixel value E (Re, Ge, Be) of each pixel of the color image in the original image memory 22, substitutes it into the right side of Expression 3 and assigns its coefficient K (k1 , K2, k3).
In step S22, the obtained coefficient K (k1, k2, k
The coefficient k1 of the first color vector V1 is extracted from 3) and stored in the multi-tone mask memory 28 in step S23.

【0044】第1の係数k1は、各画素の色における第
1の色ベクトルV1の強度を示している。換言すれば、
各画素の色が第1の色ベクトルV1の成分を多く含むほ
ど第1の係数k1の値が大きい。従って、カラー画像内
の全画素についての第1の係数k1を表わすビットマッ
プデータは、対象色に近似した色の領域を示す多階調マ
スクとして使用できる。
The first coefficient k1 indicates the intensity of the first color vector V1 in the color of each pixel. In other words,
The value of the first coefficient k1 increases as the color of each pixel includes more components of the first color vector V1. Therefore, the bitmap data representing the first coefficient k1 for all the pixels in the color image can be used as a multi-tone mask indicating a color region similar to the target color.

【0045】なお、第1の係数k1の値が負の場合に
は、その画素は切抜きの対象色とは正反対の色を有する
ので、その係数k1の値を0に置換してもよい。
When the value of the first coefficient k1 is negative, the value of the coefficient k1 may be replaced with 0 since the pixel has a color opposite to the color to be clipped.

【0046】また、各画素の第1の係数k1を、対象色
に対する第1の係数k1a(=R1/r1 =G1 /g1
=B1 /b1 )で除算して得られた値kk(=k1/k
1a)を、多階調マスクとして使用することも可能であ
る。この際、kkの値が1以上の場合にはこれを1に置
き換え、また、負の値を0に置き換えても良い。こうす
れば、多階調マスクを表わすビットマップデータの値を
0〜1の範囲内に納めることができるので、後述する2
値化処理におけるしきい値の設定が容易になる。
Further, the first coefficient k1 of each pixel is set to the first coefficient k1a (= R1 / r1 = G1 / g1) for the target color.
= B1 / b1) divided by kk (= k1 / k)
It is also possible to use 1a) as a multi-tone mask. At this time, if the value of kk is 1 or more, it may be replaced with 1, and a negative value may be replaced with 0. By doing so, the value of the bitmap data representing the multi-tone mask can be contained in the range of 0 to 1, so that 2
Setting of the threshold value in the binarization process is facilitated.

【0047】あるいは、各画素における3つの係数k
1,k2,k3の値を次の数式4に従って正規化し、正
規化された係数ku1のビットマップデータを多階調マ
スクとして用いるようにしてもよい。
Alternatively, three coefficients k for each pixel
The values of 1, k2, and k3 may be normalized according to the following Expression 4, and the bitmap data of the normalized coefficient ku1 may be used as a multi-tone mask.

【0048】[0048]

【数4】 (Equation 4)

【0049】なお、係数ku1に関しても、負の値を0
にすることが好ましい。こうして得られた係数ku1も
0〜1の範囲内に納めることができるので、後述する2
値化処理におけるしきい値の設定が容易になる。
It should be noted that a negative value of 0 is also set for the coefficient ku1.
Is preferable. The coefficient ku1 obtained in this way can also be set within the range of 0 to 1, so that
Setting of the threshold value in the binarization process is facilitated.

【0050】こうして多階調マスクが作成されると、図
3のステップS6において、多階調マスクをそのまま出
力するか、2値マスクを作成して出力するかの選択指示
を受ける。指示がNoであれば、ステップS7におい
て、多階調マスクが出力される。
When the multi-tone mask is created in this way, in step S6 of FIG. 3, an instruction is given to select whether to output the multi-tone mask as it is or to create and output a binary mask. If the instruction is No, a multi-tone mask is output in step S7.

【0051】多階調マスクの用途としては、例えば、透
かし合成処理が挙げられ、この場合には、対象色の強度
を合成比率として利用することができる。また、多階調
マスクの階調値を参照することで、切抜き対象部分に施
す画像処理の強弱あるいは重み付けが可能となる。例え
ば、画像の対象部分に輪郭強調処理を施す場合、マスク
の階調値が高い部分には強い輪郭強調、階調値が低い部
分には弱い輪郭強調をかけることができる。
An application of the multi-tone mask is, for example, a watermark synthesizing process. In this case, the intensity of the target color can be used as a synthesizing ratio. In addition, by referring to the gradation value of the multi-tone mask, it is possible to weight or weaken the image processing performed on the cutout target portion. For example, when performing a contour emphasis process on a target portion of an image, a strong contour emphasis can be applied to a portion having a high tone value of the mask, and a weak contour emphasis can be applied to a portion having a low tone value.

【0052】ステップS6における指示がYesであれ
ば、ステップS8において、2値化演算部54が多階調
マスクを2値化することによって2値マスクが作成さ
れ、さらにステップS9において、2値マスクが出力さ
れる。2値化に用いられるしきい値を設定する方法とし
ては、以下のような種々のものが考えられる。
If the instruction in step S6 is Yes, in step S8, the binarization operation section 54 binarizes the multi-tone mask to create a binary mask. In step S9, the binary mask is generated. Is output. As a method of setting a threshold value used for binarization, the following various methods can be considered.

【0053】図11は、マニュアルでしきい値を入力し
つつ2値マスクを作成する手順を示すフローチャートで
ある。ユーザが対話処理によってしきい値を入力すると
(ステップS31)、そのしきい値を用いて2値化演算
部54が多階調マスクを2値化することにより2値マス
クを作成する(ステップS32)。ユーザは、カラーC
RT38に表示された2値化マスクを観察し、満足のい
くものであるか否かを判断する(ステップS33,S3
4)。なお、2値マスクの表示の際には、図1(A),
1(B)のように、カラー画像と2値マスクとを並べて
表示するのが好ましい。2値マスクが満足のいくもので
ない場合には、ステップS31に戻って新たなしきい値
を入力し、2値化処理を再度実行する。一方、2値マス
クが満足のいくものであれば、2値化処理を終了する。
図11の手順に従って2値マスクを作成すれば、ユーザ
が欲するマスクを作成しやすいという利点がある。
FIG. 11 is a flowchart showing a procedure for creating a binary mask while manually inputting a threshold value. When the user inputs a threshold value through the interactive processing (step S31), the binarization calculation unit 54 binarizes the multi-tone mask using the threshold value to create a binary mask (step S32). ). The user has access to color C
Observe the binarized mask displayed on the RT 38 and determine whether or not the mask is satisfactory (steps S33 and S3).
4). Note that when displaying the binary mask, FIG.
It is preferable to display a color image and a binary mask side by side as in 1 (B). If the binary mask is not satisfactory, the process returns to step S31, inputs a new threshold value, and executes the binarization process again. On the other hand, if the binary mask is satisfactory, the binarization process ends.
If a binary mask is created according to the procedure of FIG. 11, there is an advantage that a mask desired by a user can be easily created.

【0054】多階調マスクの分布に基づいて2値化のし
きい値を自動的に設定することも可能である。図12
は、多階調マスクデータのヒストグラムである。図12
の横軸における値Kstは、対象色の多階調マスク値であ
る。通常のカラー画像では、切抜きの対象色に近い色を
有する画素がかなり多い場合が普通であるので、対象色
のマスク値の付近にヒストグラムのピークが現われる。
また、画像の背景部分は暗い色を有しているので、マス
ク値が小さい部分にもピークが現われる。このような場
合には、図12に示すように、対象色のマスク値Kstよ
りも小さな値xにおいて出現頻度が極小値を示す。従っ
て、対象色に対するマスク値Kstよりも小さく、かつ、
出現頻度が極小値を示すマスク値xを求めてこれを2値
化のしきい値とすれば、対象色に近い色の部分を表わす
2値マスクを作成することができる。
It is also possible to automatically set the threshold for binarization based on the distribution of the multi-tone mask. FIG.
Is a histogram of multi-tone mask data. FIG.
Is the multi-tone mask value of the target color. In a normal color image, the number of pixels having a color close to the target color to be clipped is usually quite large, and therefore, a peak of the histogram appears near the mask value of the target color.
Further, since the background portion of the image has a dark color, a peak also appears in a portion where the mask value is small. In such a case, as shown in FIG. 12, the appearance frequency shows the minimum value at a value x smaller than the mask value Kst of the target color. Therefore, it is smaller than the mask value Kst for the target color, and
If a mask value x whose appearance frequency indicates a minimum value is obtained and used as a threshold value for binarization, a binary mask representing a color portion close to the target color can be created.

【0055】なお、図13に示すように、多階調マスク
値の最大値を所定の値Kmax とし、Kmax 以上の値をす
べてKmax で置き換えるようにすれば、出現頻度が極小
値となるマスク値xを、より容易に求めることが可能で
ある。この値Kmax としては、多階調マスク値が8ビッ
トデータで表わされる場合には、128程度の値が適当
である。
As shown in FIG. 13, when the maximum value of the multi-tone mask value is set to a predetermined value Kmax, and all values above Kmax are replaced by Kmax, the mask value with which the appearance frequency becomes the minimum value is obtained. x can be determined more easily. When the multi-tone mask value is represented by 8-bit data, a value of about 128 is appropriate as the value Kmax.

【0056】2値化のしきい値を求める方法としては、
多階調マスク値のヒストグラムに基づいて、いわゆる非
階層的クラスタリング法(再配置法、k−mean法と
も呼ばれる)を用いて決定することができる。この方法
によってヒストグラム内のクラスタを求め、対象色のク
ラスタの下限値をしきい値として使用すれば、対象色に
近似する色部分を示す2値マスクを得ることができる。
As a method for obtaining the threshold value for binarization,
Based on the histogram of the multi-tone mask values, it can be determined using a so-called non-hierarchical clustering method (also called a rearrangement method or k-mean method). If a cluster in the histogram is obtained by this method and the lower limit value of the cluster of the target color is used as a threshold value, a binary mask indicating a color portion similar to the target color can be obtained.

【0057】図14は、2値マスクで切り抜かれる色の
領域を示すグラフである。領域(Ra+Rb)内の色
は、第1の色ベクトルV1の係数k1の値がTa以上と
なる色である。また、領域Rb内の色は、第1の色ベク
トルV1の係数k1の値がTb以上となる色である。従
って、2値化のしきい値をTaに設定すれば、領域(R
a+Rb)内の色の部分を示す2値マスクを作成するこ
とができる。この際、領域Raの左側に隣接する領域R
c内の色は、対象色の成分が小さいのでマスク領域から
は除外されることになる。なお、2値化のしきい値をT
bに設定すれば、領域Rb内の色の部分を示す2値マス
クを作成することができる。
FIG. 14 is a graph showing a color region cut out by the binary mask. The color in the region (Ra + Rb) is a color in which the value of the coefficient k1 of the first color vector V1 is equal to or greater than Ta. The color in the region Rb is a color in which the value of the coefficient k1 of the first color vector V1 is equal to or larger than Tb. Therefore, if the binarization threshold is set to Ta, the region (R
It is possible to create a binary mask indicating the color portion in (a + Rb). At this time, the region R adjacent to the left side of the region Ra
The color in c is excluded from the mask area because the component of the target color is small. Note that the threshold value for binarization is T
If it is set to b, a binary mask indicating the color portion in the region Rb can be created.

【0058】図15は、実施例によって作成されたマス
クの効果を示す説明図である。図15における多数の丸
は、カラー画像内における色の分布を示している。この
カラー画像は、対象色Csub に近い色の画素の第1の集
合Ob1と、対象外色Cnsubに近い色の画素の第2の集合
Ob2とを含んでいる。第1の集合Ob1には、写真撮影時
に光線が反射して光った部分(いわゆるハイライト領
域)の色が存在する。例えば、図1(A)のカラー原稿
において、黄色い服地の光った部分などがこのハイライ
ト領域に対応している。上述の実施例によれば、しきい
値を図中のTaに設定することによって、ハイライト領
域を含む第1の集合Ob1を含み、第2の集合Ob2を除外
するような2値マスクを得ることができる。第1の集合
Ob1内のハイライト領域と第2の集合Ob2とは、どちら
もB成分が大きいので、RGB空間における色ベクトル
を使用する従来の方法では、このハイライト領域と第2
の集合Ob2とを分離することは不可能である。これに対
して、この実施例による方法では、対象色に近いハイラ
イト領域を、第2の集合Ob2から容易に分離することが
できる。
FIG. 15 is an explanatory diagram showing the effect of the mask created by the embodiment. Many circles in FIG. 15 indicate the color distribution in the color image. This color image includes a first set Ob1 of pixels of a color close to the target color Csub and a second set Ob2 of pixels of a color close to the non-target color Cnsub. The first set Ob1 has a color of a portion (so-called highlight area) where light rays are reflected and shined during photographing. For example, in the color original shown in FIG. 1A, a shining portion of yellow clothing corresponds to the highlight area. According to the above-described embodiment, by setting the threshold value to Ta in the figure, a binary mask including the first set Ob1 including the highlight region and excluding the second set Ob2 is obtained. be able to. Since both the highlight region in the first set Ob1 and the second set Ob2 have a large B component, the conventional method using the color vector in the RGB space uses the highlight region and the second set Ob2.
Cannot be separated from the set Ob2. On the other hand, in the method according to this embodiment, the highlight area close to the target color can be easily separated from the second set Ob2.

【0059】なお、図1(A)のカラー画像において、
服地の色である黄色を対象色Csubとして指定し、モデ
ルの肌色を対象外色Cnsubとして指定すれば、服地の黄
色部分を示す図1(B)のマスクを得ることができる。
なお、図4に示すマンセルの色相環からも解るように、
緑色は対象色から見て対象外色とは反対側の色相であ
る。従って、対象色Csub を黄色と指定し、対象外色C
nsubを肌色と指定すると、緑色の葉の部分もマスク領域
に含まれることになる。すなわち、図1(B)に示すよ
うに、黄色と緑色の部分をマスク領域とする2値マスク
を得ることができる。
In the color image shown in FIG.
If the color yellow of the cloth is specified as the target color Csub and the skin color of the model is specified as the non-target color Cnsub, the mask shown in FIG. 1B showing the yellow part of the cloth can be obtained.
As can be seen from the Munsell hue circle shown in FIG.
Green is a hue on the opposite side of the non-target color from the target color. Therefore, the target color Csub is designated as yellow, and the non-target color Csub
If nsub is specified as a flesh color, a green leaf portion is also included in the mask area. That is, as shown in FIG. 1B, a binary mask having the yellow and green portions as mask regions can be obtained.

【0060】以上のように、この実施例では、対象色C
sub と対象外色Cnsubとを指定することによって、対象
色Csub に近い色部分を含み、かつ、対象外色Cnsubに
近い色を含まないマスクを容易に得ることができる。
As described above, in this embodiment, the target color C
By specifying the sub and the non-target color Cnsub, a mask including a color portion close to the target color Csub and not including a color close to the non-target color Cnsub can be easily obtained.

【0061】なお、この発明は上記実施例に限られるも
のではなく、その要旨を逸脱しない範囲において種々の
態様において実施することが可能であり、例えば次のよ
うな変形も可能である。
The present invention is not limited to the above-described embodiment, but can be embodied in various modes without departing from the gist thereof. For example, the following modifications are possible.

【0062】(1)上記実施例では、色空間としてRG
B座標系を用いたが、CIE−XYZ座標系,YMC座
標系,YUV座標系などの他の色空間を用いてもよい。
(1) In the above embodiment, RG is used as the color space.
Although the B coordinate system is used, other color spaces such as a CIE-XYZ coordinate system, a YMC coordinate system, and a YUV coordinate system may be used.

【0063】(2)前述の数式3または4で得られた第
1の係数k1またはku1をそのまま多階調マスクデー
タとして使用し、多階調マスクデータが正の画素につい
ては2値マスクの値を1とし、負の画素については2値
マスクの値を0としてもよい。すなわち、しきい値とし
て0を用いても良い。特に、カラー画像の色を変更する
ための2値マスクを作成する場合には、このような方法
によっても良好なマスクを得ることができる。
(2) The first coefficient k1 or ku1 obtained by the above equation 3 or 4 is used as it is as the multi-tone mask data, and the value of the binary mask is set for the pixel where the multi-tone mask data is positive. May be set to 1, and the value of the binary mask may be set to 0 for a negative pixel. That is, 0 may be used as the threshold. In particular, when creating a binary mask for changing the color of a color image, a good mask can be obtained by such a method.

【0064】(3)第1ないし第3の色ベクトルは、単
位ベクトルでなくてもよい。ただし、第1ないし第3の
色ベクトルを単位ベクトルとすれば、各色ベクトルが色
相のみを表わすベクトルになる。従って、上述のように
第1の係数に応じてマスクを作成すれば、カラー画像の
各画素の色相に応じてマスク領域を決定することが可能
である。
(3) The first to third color vectors need not be unit vectors. However, if the first to third color vectors are unit vectors, each color vector is a vector representing only the hue. Therefore, if a mask is created according to the first coefficient as described above, it is possible to determine the mask area according to the hue of each pixel of the color image.

【0065】[0065]

【発明の効果】以上説明したように、請求項1に記載し
た発明によれば、対象色と対象外色の色相が近い場合に
も、対象色に近い色部分をマスク領域とし、対象外色に
近い色部分をマスク領域から除外することができる。
As described above, according to the first aspect of the present invention, even when the target color and the non-target color have similar hues, a color portion close to the target color is used as a mask area, and Can be excluded from the mask area.

【0066】請求項2に記載した発明によれば、マスク
領域のみを示す2値のマスクデータを容易に作成するこ
とができる。
According to the second aspect of the present invention, it is possible to easily create binary mask data indicating only a mask area.

【0067】請求項3に記載した発明によれば、ヒスト
グラムに応じて2値化のしきい値を自動的に決定するこ
とができる。
According to the third aspect of the present invention, the binarization threshold can be automatically determined according to the histogram.

【0068】請求項4に記載した発明によれば、第3の
色ベクトルを容易に決定することができる。
According to the fourth aspect of the invention, the third color vector can be easily determined.

【0069】請求項5に記載した発明によれば、第1と
第2の色ベクトルとは独立な第3の色ベクトルを容易に
決定することができる。また、第1ないし第3の色ベク
トルはそれぞれ現実の色を表わすことになるので、各画
素の色に対する第1の係数を、対象色の成分を実際に表
わす指標とすることができる。
According to the invention described in claim 5, the third color vector independent of the first and second color vectors can be easily determined. In addition, since the first to third color vectors each represent an actual color, the first coefficient for the color of each pixel can be used as an index that actually represents the component of the target color.

【0070】請求項6に記載した発明によれば、第1な
いし第3の色ベクトルが色相のみを表わすベクトルにな
るので、カラー画像の各画像の色相に応じてマスクを作
成することができる。
According to the sixth aspect of the present invention, since the first to third color vectors are vectors representing only the hues, a mask can be created according to the hues of each color image.

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

【図1】カラー写真原稿とそのマスクを示す説明図。FIG. 1 is an explanatory view showing a color photographic document and its mask.

【図2】この発明の一実施例を適用して切抜きマスクを
作成するマスク作成システムの構成を示すブロック図。
FIG. 2 is a block diagram showing a configuration of a mask creating system that creates a cutout mask by applying an embodiment of the present invention.

【図3】実施例における切抜きマスクの作成の全体手順
を示すフローチャート。
FIG. 3 is a flowchart showing an overall procedure for creating a cutout mask in the embodiment.

【図4】マンセルの色相環上における対象色(黄色)と
対象外色(肌色)の位置を示す説明図。
FIG. 4 is an explanatory diagram showing positions of a target color (yellow) and a non-target color (skin color) on a Munsell hue circle.

【図5】ステップS4の詳細手順を示すフローチャー
ト。
FIG. 5 is a flowchart showing a detailed procedure of step S4.

【図6】第1と第2の色ベクトルV1,V2を示すグラ
フ。
FIG. 6 is a graph showing first and second color vectors V1 and V2.

【図7】第1ないし第3の色ベクトルV1,V2,V3
とRGB空間の関係を示す説明図。
FIG. 7 shows first to third color vectors V1, V2, and V3.
FIG. 4 is an explanatory diagram showing the relationship between the RGB space.

【図8】HSV空間を示す説明図。FIG. 8 is an explanatory diagram showing an HSV space.

【図9】白色の単位ベクトルVWH以外のベクトルを第3
の色ベクトルV3として設定する方法を示す説明図。
FIG. 9 shows a vector other than the white unit vector VWH as a third vector.
FIG. 5 is an explanatory diagram showing a method of setting a color vector V3.

【図10】多階調マスクの作成手順を示すフローチャー
ト。
FIG. 10 is a flowchart showing a procedure for creating a multi-tone mask.

【図11】2値マスクの作成手順を示すフローチャー
ト。
FIG. 11 is a flowchart showing a procedure for creating a binary mask.

【図12】多階調マスクデータのヒストグラム。FIG. 12 is a histogram of multi-tone mask data.

【図13】多階調マスクデータのヒストグラム。FIG. 13 is a histogram of multi-tone mask data.

【図14】2値マスクで切り抜かれる色の領域を示すグ
ラフ。
FIG. 14 is a graph showing a color region cut out by a binary mask.

【図15】実施例によって作成されたマスクの効果を示
す説明図。
FIG. 15 is an explanatory diagram showing the effect of the mask created by the example.

【符号の説明】[Explanation of symbols]

20…CPU 22…元画像メモリ 24…ベクトル値メモリ 26…マトリクスメモリ 28…多階調マスクメモリ 32…キーボード 34…マウス 36…読取スキャナ 38…カラーCRT 40…ハードディスク装置 50…マトリクス演算部 52…多階調マスク演算部 Cnsub…対象外色 Csub …対象色 DESCRIPTION OF SYMBOLS 20 ... CPU 22 ... Original image memory 24 ... Vector value memory 26 ... Matrix memory 28 ... Multi-tone mask memory 32 ... Keyboard 34 ... Mouse 36 ... Reading scanner 38 ... Color CRT 40 ... Hard disk drive 50 ... Matrix computing unit 52 ... Many Tone mask calculation unit Cnsub: Non-target color Csub: Target color

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平4−61558(JP,A) 特開 平8−153201(JP,A) 特開 平5−197804(JP,A) 特開 平8−7106(JP,A) 特開 平8−96114(JP,A) 特開 平8−115430(JP,A) 特開 平8−115431(JP,A) 特開 平8−272942(JP,A) 富永外,「カラー画像の色分類とその 応用」,日本色彩学会誌,1991年,第15 巻,第1号,p.55−56 (58)調査した分野(Int.Cl.6,DB名) G06T 7/00 ────────────────────────────────────────────────── ─── Continuation of the front page (56) References JP-A-4-61558 (JP, A) JP-A-8-153201 (JP, A) JP-A-5-197804 (JP, A) JP-A-8-183 7106 (JP, A) JP-A-8-96114 (JP, A) JP-A-8-115430 (JP, A) JP-A 8-115431 (JP, A) JP-A 8-272942 (JP, A) Tominaga, G., "Color Classification of Color Images and Its Applications," Journal of the Japan Society of Color Science, 1991, Vol. 15, No. 1, p. 55-56 (58) Field surveyed (Int. Cl. 6 , DB name) G06T 7/00

Claims (6)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 カラー画像内の所望の色部分を示すマス
クを作成する方法であって、 前記カラー画像内において前記マスクの対象色を指定す
る工程と、 前記カラー画像内において前記マスクの対象外色を指定
する工程と、 所定の色空間における前記対象色の第1の色ベクトルを
求める工程と、 前記所定の色空間における前記対象外色の第2の色ベク
トルを求める工程と、 前記第1と第2の色ベクトルとは独立の第3の色ベクト
ルを求める工程と、 前記カラー画像内の各画素の色を、前記第1ないし第3
の色ベクトルの線形結合で表わすときの前記第1ないし
第3の色ベクトルに対する第1ないし第3の係数をそれ
ぞれ求める工程と、 前記カラー画像内の各画素における前記第1の係数の値
に応じて前記マスクを作成する工程と、を備えることを
特徴とするカラー画像のマスク作成方法。
1. A method of creating a mask indicating a desired color portion in a color image, comprising: specifying a target color of the mask in the color image; and excluding a target of the mask in the color image. A step of specifying a color; a step of obtaining a first color vector of the target color in a predetermined color space; a step of obtaining a second color vector of the non-target color in the predetermined color space; Obtaining a third color vector independent of and the second color vector; and calculating the color of each pixel in the color image from the first to third colors.
Obtaining the first to third coefficients for the first to third color vectors when represented by a linear combination of the color vectors of the color image, and according to the value of the first coefficient at each pixel in the color image. Forming the mask by using a color image.
【請求項2】 請求項1記載の方法であって、 前記マスク作成工程は、 前記第1の係数をしきい値で2値化することによって、
前記マスクを表わすマスクデータを作成する工程を含
む、カラー画像のマスク作成方法。
2. The method according to claim 1, wherein the mask forming step includes: binarizing the first coefficient with a threshold value;
A method for creating a mask for a color image, comprising creating mask data representing the mask.
【請求項3】 請求項2記載のカラー画像のマスク作成
方法であって、 前記第1の係数を2値化する工程は、 前記第1の係数の出現頻度を示すヒストグラムを作成す
る工程と、 前記ヒストグラムの極小値における前記第1の係数を前
記しきい値として設定する工程と、を備える、カラー画
像のマスク作成方法。
3. The color image mask creating method according to claim 2, wherein the step of binarizing the first coefficient includes the step of creating a histogram indicating an appearance frequency of the first coefficient; Setting the first coefficient at the minimum value of the histogram as the threshold value.
【請求項4】 請求項1ないし3のいずれかに記載のカ
ラー画像のマスク作成方法であって、前記第3の色ベク
トルは白色を表わすベクトルである、カラー画像のマス
ク作成方法。
4. The method according to claim 1, wherein the third color vector is a vector representing white.
【請求項5】 請求項1ないし3のいずれかに記載のカ
ラー画像のマスク作成方法であって、 前記第3の色ベクトルを求める工程は、 前記第1と第2の色ベクトルを、色相/彩度/明度空間
における第4および第5の色ベクトルにそれぞれ変換す
る工程と、 前記第4と第5の色ベクトルの少なくとも一方の彩度成
分が所定の値を超える場合には、前記所定の色空間にお
いて白色を表わすベクトルを前記第3の色ベクトルとし
て選択し、前記第4と第5の色ベクトルの少なくとも一
方の彩度成分が前記所定の値未満の場合には、前記第4
と第5の色ベクトルのうちで彩度成分のより大きな色ベ
クトルについて前記色相/彩度/明度空間において色相
を所定の角度回転した第6の色ベクトルを生成し、前記
第6の色ベクトルを前記所定の色空間のベクトルに変換
することによって前記第3の色ベクトルを生成する工程
と、を備える、カラー画像のマスク作成方法。
5. The method for producing a color image mask according to claim 1, wherein the step of obtaining the third color vector comprises: converting the first and second color vectors into hue / hue. Converting each of the fourth and fifth color vectors into a fourth and fifth color vector in a saturation / brightness space; and if at least one of the saturation components of the fourth and fifth color vectors exceeds a predetermined value, the predetermined A vector representing white in a color space is selected as the third color vector. If at least one of the fourth and fifth color vectors has a saturation component less than the predetermined value, the fourth color vector is selected.
And a sixth color vector obtained by rotating the hue by a predetermined angle in the hue / saturation / brightness space for a color vector having a larger saturation component among the fifth color vector and the sixth color vector. Generating the third color vector by converting to a vector in the predetermined color space.
【請求項6】 請求項1ないし5のいずれかに記載のカ
ラー画像のマスク作成方法であって、 前記第1ないし第3の色ベクトルは単位ベクトルであ
る、カラー画像のマスク作成方法。
6. The method for producing a color image mask according to claim 1, wherein said first to third color vectors are unit vectors.
JP16592094A 1994-06-23 1994-06-23 How to make a color image mask Expired - Fee Related JP2896311B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP16592094A JP2896311B2 (en) 1994-06-23 1994-06-23 How to make a color image mask
EP95108520A EP0693738A3 (en) 1994-06-23 1995-06-02 Method and apparatus for generating color image mask
US08/466,598 US5659490A (en) 1994-06-23 1995-06-06 Method and apparatus for generating color image mask

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16592094A JP2896311B2 (en) 1994-06-23 1994-06-23 How to make a color image mask

Publications (2)

Publication Number Publication Date
JPH087107A JPH087107A (en) 1996-01-12
JP2896311B2 true JP2896311B2 (en) 1999-05-31

Family

ID=15821531

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16592094A Expired - Fee Related JP2896311B2 (en) 1994-06-23 1994-06-23 How to make a color image mask

Country Status (1)

Country Link
JP (1) JP2896311B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001043376A (en) 1999-07-30 2001-02-16 Canon Inc Image extraction method and device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
富永外,「カラー画像の色分類とその応用」,日本色彩学会誌,1991年,第15巻,第1号,p.55−56

Also Published As

Publication number Publication date
JPH087107A (en) 1996-01-12

Similar Documents

Publication Publication Date Title
JP3400888B2 (en) How to change the color of a color image
US8681380B2 (en) Image processing apparatus, an image processing method, a medium on which an image processing control program is recorded, an image evaluation device, an image evaluation method and a medium on which an image evaluation program is recorded
US5659490A (en) Method and apparatus for generating color image mask
US20060203298A1 (en) Image processing apparatus, image processing method, image processing program recording medium, color adjustment method, color adjustment device, and color adjustment control program recording medium
JP2001126075A (en) Method and device for picture processing, and recording medium
CN111127591B (en) Image hair dyeing processing method, device, terminal and storage medium
JP2000134486A (en) Image processing unit, image processing method and storage medium
JPH04227585A (en) Method and apparatus for forming improved control-data line
WO1999017254A1 (en) Digital redeye removal
CN110248242B (en) Image processing and live broadcasting method, device, equipment and storage medium
Li et al. An adaptive enhancement method for low illumination color images
Pierre et al. Luminance-hue specification in the RGB space
JP2896311B2 (en) How to make a color image mask
JP2896317B2 (en) How to make a color image mask
JP2896319B2 (en) How to make a color image mask
JP2896310B2 (en) How to make a color image mask
JP3557115B2 (en) Image filter determination method and apparatus, and recording medium recording program for executing the processing
JPH06301773A (en) Method and device for color reduction picture processing
JP2896320B2 (en) How to make a color image mask
JP3473832B2 (en) Digital image automatic correction method and system
Liu et al. Self-adaptive single and multi-illuminant estimation framework based on deep learning
CN110751078B (en) Method and equipment for determining non-skin color region of three-dimensional face
US8385634B1 (en) Selecting and applying a color range in an image mask
JP3573143B2 (en) Image processing apparatus, image processing method, medium recording image processing control program
JP2005094452A (en) Method, system, and program for processing image

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees