JP6614658B2 - Color recognition apparatus, color recognition method, and program - Google Patents
Color recognition apparatus, color recognition method, and program Download PDFInfo
- Publication number
- JP6614658B2 JP6614658B2 JP2015252481A JP2015252481A JP6614658B2 JP 6614658 B2 JP6614658 B2 JP 6614658B2 JP 2015252481 A JP2015252481 A JP 2015252481A JP 2015252481 A JP2015252481 A JP 2015252481A JP 6614658 B2 JP6614658 B2 JP 6614658B2
- Authority
- JP
- Japan
- Prior art keywords
- value
- array
- hue
- saturation
- target image
- 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.)
- Active
Links
Images
Landscapes
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
- Color Image Communication Systems (AREA)
Description
本発明は、特定の色を認識するための色認識装置及び色認識方法に関し、更には、これらを実現するためのプログラムに関する。 The present invention relates to a color recognition apparatus and a color recognition method for recognizing a specific color, and further relates to a program for realizing these.
近年、種々の分野で、画像から、特定の色の部分を抽出することが行われている。例えば、人の手又は顔を検出するために、画像から、領域を抽出することが行われている(例えば、特許文献1参照)。 In recent years, extraction of a specific color portion from an image has been performed in various fields. For example, in order to detect a human hand or face, a region is extracted from an image (see, for example, Patent Document 1).
具体的には、特許文献1は、画面上の肌色の領域を抽出することによって人の手の認識を行う、手形状認識装置を開示している。特許文献1に開示された手形状認識装置は、入力された画像に対して、予め作成された肌色のテンプレート値との相関値を算出し、相関値に基づいて、入力された画像から肌色の領域を抽出する。
Specifically,
また、特許文献1に開示された手形状認識装置では、テンプレート値は、RGBデータで与えられており、適宜更新される。テンプレート値の更新は、抽出された肌色領域の平均値と、テンプレート値との平均を求め、求めた値を、最新のテンプレート値とすることによって行われる。このため、特許文献1に開示された手形状認識装置によれば、システムの負担を軽減しつつ、正確に肌色の領域を抽出できると考えられる。
Further, in the hand shape recognition device disclosed in
しかしながら、画像の手段となるカメラには、通常、オートホワイトバランス機能が付加されているため、画像中の肌色の領域の明るさは、撮影された環境に応じて大きく変化してしまう。このため、上記特許文献1に開示された手形状認識装置では、テンプレート値が適宜実行されるにもかかわらず、例えば、被写体が日向から日陰に移動するような状況下で検出精度が大きく低下してしまう場合がある。
However, since an auto white balance function is usually added to a camera serving as an image means, the brightness of a skin color region in an image greatly varies depending on the environment where the image is taken. For this reason, in the hand shape recognition device disclosed in
本発明の目的の一例は、上記問題を解消し、撮影環境に左右されることなく、特定の色を精度良く検出し得る、色認識装置、色認識方法、及びプログラムを提供することにある。 An object of the present invention is to provide a color recognition device, a color recognition method, and a program capable of solving the above-described problem and detecting a specific color with high accuracy without being influenced by a shooting environment.
上記目的を達成するため、本発明の一側面における色認識装置は、対象画像における特定の色の領域を認識するための装置であって、
前記特定の色の領域を有するキャリブレーション画像から、それを構成する画素毎に、R値、G値、及びB値を特定し、各値に、段階的に設定された複数の係数を乗算して、前記キャリブレーション画像の拡張配列を作成する、拡張配列作成部と、
前記キャリブレーション画像の前記拡張配列を、色相、彩度、及び明度によって規定される配列に変換する、配列変換部と、
変換後の前記キャリブレーション画像の拡張配列から、一方の軸を色相とし、他方の軸を彩度とした、2次元のヒストグラムを作成する、ヒストグラム作成部と、
前記対象画像を構成する各画素のR値、G値、及びB値から、色相、彩度、及び明度に
よって規定された前記対象画像の配列を作成し、作成した前記対象画像の配列と前記ヒストグラムとを用いて、前記対象画像における前記特定の色の領域を認識する、色認識部と、
を備えていることを特徴とする。
In order to achieve the above object, a color recognition apparatus according to one aspect of the present invention is an apparatus for recognizing a specific color region in a target image,
From the calibration image having the specific color area, the R value, the G value, and the B value are specified for each pixel constituting the area, and each value is multiplied by a plurality of coefficients set in stages. An extended array creating unit for creating an extended array of the calibration images;
An array conversion unit that converts the extended array of the calibration image into an array defined by hue, saturation, and brightness;
A histogram creation unit that creates a two-dimensional histogram from the expanded array of the calibration images after conversion, with one axis as hue and the other axis as saturation;
An array of the target image defined by hue, saturation, and brightness is created from the R value, G value, and B value of each pixel constituting the target image, and the created array of the target image and the histogram And a color recognition unit for recognizing the specific color region in the target image,
It is characterized by having.
また、上記目的を達成するため、本発明の一側面における色認識方法は、対象画像における特定の色の領域を認識するための方法であって、
(a)前記特定の色の領域を有するキャリブレーション画像から、それを構成する画素毎に、R値、G値、及びB値を特定し、各値に、段階的に設定された複数の係数を乗算して、前記キャリブレーション画像の拡張配列を作成する、ステップと、
(b)前記キャリブレーション画像の前記拡張配列を、色相、彩度、及び明度によって規定される配列に変換する、ステップと、
(c)変換後の前記キャリブレーション画像の拡張配列から、一方の軸を色相とし、他方の軸を彩度とした、2次元のヒストグラムを作成する、ステップと、
(d)前記対象画像を構成する各画素のR値、G値、及びB値から、色相、彩度、及び明度によって規定された前記対象画像の配列を作成し、作成した前記対象画像の配列と前記ヒストグラムとを用いて、前記対象画像における前記特定の色の領域を認識する、ステップと、
を有することを特徴とする。
In order to achieve the above object, a color recognition method according to one aspect of the present invention is a method for recognizing a specific color region in a target image,
(A) A R value, a G value, and a B value are specified for each pixel constituting the calibration image having the specific color region, and a plurality of coefficients set in stages for each value. Multiplying to create an expanded array of the calibration images; and
(B) converting the expanded array of the calibration images into an array defined by hue, saturation, and brightness;
(C) creating a two-dimensional histogram from the expanded array of the converted calibration images, with one axis as hue and the other axis as saturation;
(D) An array of the target image defined by hue, saturation, and brightness is created from the R value, G value, and B value of each pixel constituting the target image, and the created target image array Recognizing a region of the specific color in the target image using the histogram and the histogram; and
It is characterized by having.
更に、上記目的を達成するため、本発明の一側面におけるプログラムは、コンピュータによって、対象画像における特定の色の領域を認識するためのプログラムであって、
前記コンピュータに、
(a)前記特定の色の領域を有するキャリブレーション画像から、それを構成する画素毎に、R値、G値、及びB値を特定し、各値に、段階的に設定された複数の係数を乗算して、前記キャリブレーション画像の拡張配列を作成する、ステップと、
(b)前記キャリブレーション画像の前記拡張配列を、色相、彩度、及び明度によって規定される配列に変換する、ステップと、
(c)変換後の前記キャリブレーション画像の拡張配列から、一方の軸を色相とし、他方の軸を彩度とした、2次元のヒストグラムを作成する、ステップと、
(d)前記対象画像を構成する各画素のR値、G値、及びB値から、色相、彩度、及び明度によって規定された前記対象画像の配列を作成し、作成した前記対象画像の配列と前記ヒストグラムとを用いて、前記対象画像における前記特定の色の領域を認識する、ステップと、
を実行させることを特徴とする。
Furthermore, in order to achieve the above object, a program according to one aspect of the present invention is a program for recognizing a specific color region in a target image by a computer,
In the computer,
(A) R value, G value, and B value are specified for each pixel constituting the calibration image having the specific color area, and a plurality of coefficients set stepwise for each value Multiplying to create an expanded array of the calibration images; and
(B) converting the expanded array of the calibration images into an array defined by hue, saturation, and brightness;
(C) creating a two-dimensional histogram from the expanded array of the converted calibration images, with one axis as hue and the other axis as saturation;
(D) An array of the target image defined by hue, saturation, and brightness is created from the R value, G value, and B value of each pixel constituting the target image, and the created target image array Recognizing a region of the specific color in the target image using the histogram and the histogram; and
Is executed.
以上のように、本発明によれば、撮影環境に左右されることなく、特定の色を精度良く検出することができる。 As described above, according to the present invention, it is possible to accurately detect a specific color without being influenced by the shooting environment.
(実施の形態)
以下、本発明の実施の形態における、色認識装置、色認識方法、及びプログラムについて、図1〜図8を参照しながら説明する。
(Embodiment)
Hereinafter, a color recognition device, a color recognition method, and a program according to an embodiment of the present invention will be described with reference to FIGS.
[装置構成]
最初に、本発明の実施の形態における色認識装置の構成について図1を用いて説明する。図1は、本発明の実施の形態における色認識装置の概略構成を示すブロック図である。
[Device configuration]
First, the configuration of the color recognition apparatus according to the embodiment of the present invention will be described with reference to FIG. FIG. 1 is a block diagram showing a schematic configuration of a color recognition apparatus according to an embodiment of the present invention.
図1に示す本実施の形態における色認識装置100は、対象画像における特定の色の領域を認識するための装置である。図1に示すように、色認識装置は、拡張配列作成部10と、配列変換部20と、ヒストグラム作成部30と、色認識部40とを備えている。
A
拡張配列作成部10は、特定の色の領域を有するキャリブレーション画像から、それを構成する画素毎に、R値、G値、及びB値を特定し、各値に、段階的に設定された複数の係数を乗算して、キャリブレーション画像の拡張配列を作成する。
The extended
配列変換部20は、拡張配列作成部10によって作成されたキャリブレーション画像の拡張配列を、色相、彩度、及び明度によって規定される配列に変換する。ヒストグラム作成部30は、変換後のキャリブレーション画像の拡張配列から、一方の軸を色相とし、他方の軸を彩度とした、2次元のヒストグラムを作成する。
The
色認識部40は、まず、対象画像を構成する各画素のR値、G値、及びB値から、色相、彩度、及び明度によって規定された対象画像の配列を作成する。続いて、色認識部40は、作成した対象画像の配列と、ヒストグラム作成部30によって作成されたヒストグラムとを用いて、対象画像における特定の色の領域を認識する。
First, the
このように、本実施の形態では、まず、ヒストグラムは、キャリブレーション画像から作成されているので、そのビンは特定の色を強調したものとなっている。また、ヒストグラムの作成に際して、キャリブレーション画像のRGB値が拡張され、その上で色空間の変換が行なわれるので、ヒストグラムは、特定の色の環境による変化に対応したものとなる。このため、本実施の形態によれば、撮影環境に左右されることなく、特定の色を精度良く認識することが可能となる。 As described above, in this embodiment, first, since the histogram is created from the calibration image, the bin emphasizes a specific color. Further, when the histogram is created, the RGB values of the calibration image are expanded and the color space is converted thereon, so that the histogram corresponds to a change due to a specific color environment. For this reason, according to the present embodiment, it is possible to accurately recognize a specific color without being influenced by the shooting environment.
続いて、図2を用いて、本発明の実施の形態における色認識装置の構成を更に具体的に説明する。図2は、本発明の実施の形態における色認識装置の具体的構成を示すブロック図である。また、以降では、認識対象となる特定の色が肌色である場合を例に挙げて説明する。 Next, the configuration of the color recognition apparatus in the embodiment of the present invention will be described more specifically with reference to FIG. FIG. 2 is a block diagram showing a specific configuration of the color recognition apparatus according to the embodiment of the present invention. Further, hereinafter, a case where the specific color to be recognized is a skin color will be described as an example.
図2に示すように、本実施の形態における色認識装置100は、上述した、拡張配列作成部10、配列変換部20、ヒストグラム作成部30、及び色認識部40に加えて、キャリブレーション処理部50と、記憶部60と、画像取得部70とを備えている。
As shown in FIG. 2, the
このうち、画像取得部70は、外部から、対象画像の画像データ(以下「対象画像データ」と表記する。)、及びキャリブレーション画像の元となる画像データが入力されてくると、これらを取得する。また、画像取得部70は、対象画像データを取得した場合は、これを色認識部40に入力する。
Among these, the
更に、画像取得部70は、キャリブレーション画像の元となる画像データが入力されてくると、画像データから、キャリブレーション画像となる部分の画像データのみを抽出する。そして、画像取得部70は、取り出した画像データ(以下「キャリブレーション用画像データ」と表記する。)を、拡張配列作成部10に入力する。
Furthermore, when the image data that is the basis of the calibration image is input, the
また、本実施の形態では、例えば、図3に示すように、画像取得部70は、キャリブレーション画像の元となる画像データが入力されてくると、この画像データによって特定される画像71を、表示装置(図2において図示せず)の画面に表示することもできる。この場合、図3に示すように、画像取得部70は、更に、キャリブレーション画像72となる部分の指定を受け付け、指定された部分(キャリブレーション画像72)の画像データを抽出し、これをキャリブレーション画像データとして拡張配列作成部10に入力する。
In the present embodiment, for example, as shown in FIG. 3, when image data that is the basis of a calibration image is input, the
図3は、本発明の実施の形態で用いられるキャリブレーション画像の一例を示す図である。図3の例では、特定の色が肌色であるため、画像71としては、人の手が被写体となった画像が用いられている。また、キャリブレーション画像72としては、手のひらの一部分の画像が用いられている。
FIG. 3 is a diagram showing an example of a calibration image used in the embodiment of the present invention. In the example of FIG. 3, since the specific color is a skin color, the
また、拡張配列作成部10は、キャリブレーション画像データが入力されると、キャリブレーション画像データから画素毎に、R値、G値、及びB値を特定し、特定した各値に、段階的に設定された係数を乗算する。具体的には、本実施の形態では、図4に示すように、拡張配列作成部10は、R値、G値、B値のそれぞれに、0.7〜1.3の範囲内にある係数を0.05刻みで乗算して、拡張配列を作成する。
Further, when the calibration image data is input, the extended
図4は、本発明の実施の形態で作成される拡張配列の一例を示す図である。図4の例では、1画素分の拡張配列のみを示している。例えば、キャリブレーション画像の画素数が50×50であるとすると、拡張配列の大きさは、50×50×3×13となる。また、上述の係数は、肌色を認識する場合の一例であるが、係数間の間隔、係数の数は、色認識装置100の性能に応じて適宜設定される。
FIG. 4 is a diagram showing an example of the extended array created in the embodiment of the present invention. In the example of FIG. 4, only the extended array for one pixel is shown. For example, if the number of pixels of the calibration image is 50 × 50, the size of the expanded array is 50 × 50 × 3 × 13. Moreover, although the above-mentioned coefficient is an example when skin color is recognized, the interval between coefficients and the number of coefficients are appropriately set according to the performance of the
更に、本実施の形態では、乗算される係数は、認識対象となる色に応じて設定される。例えば、各係数の設定は、波長成分の組成に応じて、特定の値に乗算する係数のみとしたり、特定の値に乗算する係数の値を大きくしたりすることによって、行なわれる。具体的には、赤の波長成分が多い色が認識対象となる場合であれば、R値に乗算される係数の値が大きくなるように、又はR値に乗算される係数のみとなるように、各係数の設定が行なわれる。 Furthermore, in the present embodiment, the coefficient to be multiplied is set according to the color to be recognized. For example, each coefficient is set by setting only a coefficient to be multiplied by a specific value or increasing the value of the coefficient to be multiplied by the specific value according to the composition of the wavelength component. Specifically, if a color with many red wavelength components is to be recognized, the coefficient value multiplied by the R value is increased, or only the coefficient multiplied by the R value is provided. Each coefficient is set.
配列変換部20は、本実施の形態では、一般的なRGB空間からHSV空間への変換処理を用いることで、拡張配列を、色相、彩度、及び明度によって規定される配列に変換することができる。
In the present embodiment, the
また、ヒストグラム作成部30は、本実施の形態では、変換後の配列から、明度の成分を除去し、残った成分を用いて、2次元のヒストグラムを作成する。更に、このとき、ヒストグラム作成部30は、ノイズの除去のため、作成したヒストグラムから、色相の値が閾値以下又は閾値未満となるビンを除去することができる。具体的には、ヒストグラム作成部30は、色相の値が閾値以下又は閾値未満となるビンを特定し、特定したビンの色相
の値をゼロに設定する。
In the present embodiment, the
キャリブレーション処理部50は、ヒストグラムを用いて共分散行列を求め、求めた共分散行列を用いて、キャリブレーション画像における、色相の値と彩度の値との組合せ毎のマハラノビス距離を算出する。
The
具体的には、ヒストグラムの各ビンにおける色相の値をHi、彩度の値をSjとするとき、Hi、Sjで示されるHS平面上の座標(極座標系)を直交座標系に変換した値を入力ベクトルxk、入力ベクトルの数をn、入力ベクトルの平均ベクトルをμとすると、キャリブレーション処理部50は、下記の数1を用いて、共分散行列Σを求め、更に、求めた共分散行列Σを下記数2に適用することで、HiとSjとの組合せ(Hi,Sj)毎のマハラノビス距離Dを算出することができる。なお、i及びjは、ぞれぞれ、0から255の任意の整数である。
Specifically, when the hue value in each bin of the histogram is H i and the saturation value is S j , the coordinates (polar coordinate system) on the HS plane indicated by H i and S j are orthogonal coordinates. When the converted value is an input vector x k , the number of input vectors is n, and the average vector of the input vectors is μ, the
また、キャリブレーション処理部50は、算出した各マハラノビス距離を、色相及び彩度によって規定される2次元配列(以下「ルックアップテーブル」と表記する。)に格納する。本実施の形態では、マハラノビス距離が格納されたルックアップテーブルは、テーブル格納部60に記憶される。図5は、本発明の実施の形態で用いられるルックアップテーブルの一例を示す図である。
The
色認識部40は、本実施の形態では、上述した配列変換部20と同様に、RGB空間からHSV空間への変換処理を用いて、対象画像の配列を作成する。また、色認識部40は、本実施の形態では、作成した対象画像の配列を、上述のルックアップテーブルに照合して、対象画像を構成する画素毎のマハラノビス距離を特定する。続いて、色認識部40は、特定したマハラノビス距離に基づいて、対象画像における特定の色の領域を認識する。
In the present embodiment, the
具体的には、色認識部40は、対象画像の画素毎に、対象画像の配列から、色相の値Hと彩度の値Sとを特定し、更に、特定した値(H,S)をルックアップテーブルに照合し、特定した値(H,S)が対応しているマハラノビス距離を特定する。続いて、色認識部40は、画素毎に、特定したマハラノビス距離と設定された閾値とを対比して、マハラノビス距離が閾値以下となる画素を特定し、特定した画素で構成される領域を特定の色の領域と判断する。
Specifically, the
[装置動作]
次に、本発明の実施の形態における色認識装置100の動作について図6及び図7を用いて説明する。また、以下の説明においては、適宜図1〜図5を参酌する。また、本実施の形態では、色認識装置100を動作させることによって、色認識方法が実施される。よって、本実施の形態における色認識方法の説明は、以下の色認識装置100の動作説明に代える。
[Device operation]
Next, the operation of the
まず、図6を用いて、色認識装置100がキャリブレーション処理を実行する際の動作について説明する。図6は、本発明の実施の形態における色認識装置のキャリブレーション処理時の動作を示すフロー図である。
First, the operation when the
図6に示すように、最初に、画像取得部70は、キャリブレーション画像の元となる画像データを取得する(ステップA1)。具体的には、本実施の形態では、外部の装置(図示せず)から、人の手の画像データ、又は顔の画像データが送信されてくると、画像取得部70は、送信されてきた画像データを取得する。
As shown in FIG. 6, first, the
次に、画像取得部70は、ステップA1で取得した画像データから、キャリブレーション画像となる部分の画像データを抽出する(ステップA2)。具体的には、図3に示すように、画像取得部70は、ステップA1で取得した画像データによって特定される画像71を、表示装置の画面に表示し、キャリブレーション画像72となる部分の指定を受け付け、指定が行なわれると、指定された部分の画像データを抽出する。
Next, the
次に、拡張配列作成部10は、ステップA2で抽出した画像データの各画素のR値、G値、B値を取得する(ステップA3)。続いて、拡張配列作成部10は、各画素のR値、G値、B値のそれぞれに、段階的に設定された係数を乗算して、拡張配列を作成する(ステップA4)。
Next, the extended
次に、配列変換部20は、拡張配列の色空間を、RGB空間からHSV空間へと変換し、色素、彩度、及び明度で規定される配列を作成する(ステップA5)。
Next, the
次に、ヒストグラム作成部30は、色空間が変換された配列から、明度の成分を除去して、色相及び彩度による2次元のヒストグラムを算出する(ステップA6)。また、ステップA6では、ヒストグラム作成部30は、ノイズを除去するために、色相の値が閾値以下又は閾値未満となるビンを特定し、特定したビンの色相の値をゼロに設定する。
Next, the
次に、キャリブレーション処理部50は、ステップA6で作成されたヒストグラムを用いて、共分散行列を求める(ステップA7)。ステップA7により、肌色に相当する色空間が特定されることになる。
Next, the
その後、キャリブレーション処理部50は、色相の値と彩度の値との組合せ毎に、マハラノビス距離を算出し、得られた各マハラノビス距離を、ルックアップテーブルに格納する(ステップA8)。ステップA8の実行により、ルックアップテーブルが完成するので、キャリブレーション処理は終了する。
Thereafter, the
続いて、図7を用いて、色認識装置100が認識処理を実行する際の動作について説明する。図7は、本発明の実施の形態における色認識装置の認識処理時の動作を示すフロー図である。
Next, an operation when the
図7に示すように、最初に、画像取得部70は、認識対象となる画像の画像データ(対象画像データ)を取得する(ステップB1)。具体的には、本実施の形態では、外部の装置(図示せず)から、対象画像データが送信されてくると、画像取得部70は、送信されてきた画像データを取得する。
As shown in FIG. 7, first, the
次に、色認識部40は、ステップB1で取得した画像データの各画素のR値、G値、B値を取得する(ステップB2)。続いて、色認識部40は、取得したR値、G値、B値を元に、RGB空間からHSV空間への変換処理を行なって、色相、彩度、及び明度によっ
て規定された、対象画像の配列を作成する。(ステップB3)。
Next, the
次に、色認識部40は、ステップB3で得られた配列から、対象画像の画素毎に、色相の値Hと彩度の値Sとを特定する。続いて、色認識部40は、特定した値(H,S)を、ステップA8で得られたルックアップテーブルに照合し、特定した値(H,S)が対応しているマハラノビス距離を特定する(ステップB4)。
Next, the
次に、色認識部40、画素毎に、ステップB4で特定したマハラノビス距離と設定された閾値とを対比して、マハラノビス距離が閾値以下となる画素を特定し、特定した画素で構成される領域を特定の色の領域と判断する(ステップB5)。
Next, the
以上のように本実施の形態では、キャリブレーション画像のRGB空間が拡張され、拡張されたRGB空間から、特定の色の認識に必要なヒストグラムが生成されているので、撮影環境に左右されることなく、特定の色を精度良く認識することが可能となる。 As described above, in the present embodiment, the RGB space of the calibration image is expanded, and a histogram necessary for recognition of a specific color is generated from the expanded RGB space. Therefore, it becomes possible to recognize a specific color with high accuracy.
また、本実施の形態では、予め、色相及び彩度の組毎のマハラノビス距離がルックアップテーブルに登録されており、認識時には、各画素の色相及び彩度を求めるだけで、画素毎のマハラノビス距離が特定され、直ぐに各画素が特定の色かどうかを判断できる。このため、特定の色の認識処理における負荷の軽減も可能となる。 In the present embodiment, the Mahalanobis distance for each set of hue and saturation is registered in the lookup table in advance, and at the time of recognition, the Mahalanobis distance for each pixel is obtained simply by obtaining the hue and saturation of each pixel. Is immediately determined, and it can be immediately determined whether each pixel has a specific color. For this reason, it is possible to reduce the load in the recognition process of a specific color.
なお、本実施の形態では、キャリブレーション処理は、ステップA1〜A6までで終了していても良い。この場合は、認識処理において、ステップB3の実行後に、ステップA7及びA8が実行され、その後に、ステップB4及びB5が実行される。 In the present embodiment, the calibration process may be completed in steps A1 to A6. In this case, in the recognition process, after execution of step B3, steps A7 and A8 are executed, and thereafter steps B4 and B5 are executed.
[プログラム]
本発明の実施の形態におけるプログラムは、コンピュータに、図6に示すステップA1〜A8、図7に示すステップB1〜B5を実行させるプログラムであれば良い。このプログラムをコンピュータにインストールし、実行することによって、本実施の形態における色認識装置と色認識方法とを実現することができる。この場合、コンピュータのCPU(Central Processing Unit)は、拡張配列作成部10、配列変換部20、ヒストグラム作成部30、色認識部40、キャリブレーション処理部50及び画像取得部70として機能し、処理を行なう。
[program]
The program in the embodiment of the present invention may be a program that causes a computer to execute steps A1 to A8 shown in FIG. 6 and steps B1 to B5 shown in FIG. By installing and executing this program on a computer, the color recognition apparatus and the color recognition method in the present embodiment can be realized. In this case, a central processing unit (CPU) of the computer functions as an extended
なお、本実施の形態におけるプログラムは、複数のコンピュータによって構築されたコンピュータシステムによって実行されても良い。この場合は、例えば、各コンピュータが、それぞれ、拡張配列作成部10、配列変換部20、ヒストグラム作成部30、色認識部40、キャリブレーション処理部50及び画像取得部70として機能しても良い。また、記憶部60は、本実施の形態におけるプログラムを実行するコンピュータとは別のコンピュータ上に構築されていても良い。
Note that the program in the present embodiment may be executed by a computer system constructed by a plurality of computers. In this case, for example, each computer may function as the extended
ここで、本実施の形態におけるプログラムを実行することによって、色認識装置100を実現するコンピュータについて図8を用いて説明する。図8は、本発明の実施の形態における色認識装置を実現するコンピュータの一例を示すブロック図である。
Here, a computer that realizes the
図8に示すように、コンピュータ110は、CPU111と、メインメモリ112と、記憶装置113と、入力インターフェイス114と、表示コントローラ115と、データリーダ/ライタ116と、通信インターフェイス117とを備える。これらの各部は、バス121を介して、互いにデータ通信可能に接続される。
As shown in FIG. 8, the
CPU111は、記憶装置113に格納された、本実施の形態におけるプログラム(コ
ード)をメインメモリ112に展開し、これらを所定順序で実行することにより、各種の演算を実施する。メインメモリ112は、典型的には、DRAM(Dynamic Random Access Memory)等の揮発性の記憶装置である。また、本実施の形態におけるプログラムは、コンピュータ読み取り可能な記録媒体120に格納された状態で提供される。なお、本実施の形態におけるプログラムは、通信インターフェイス117を介して接続されたインターネット上で流通するものであっても良い。
The
また、記憶装置113の具体例としては、ハードディスクドライブの他、フラッシュメモリ等の半導体記憶装置が挙げられる。入力インターフェイス114は、CPU111と、キーボード及びマウスといった入力機器118との間のデータ伝送を仲介する。表示コントローラ115は、ディスプレイ装置119と接続され、ディスプレイ装置119での表示を制御する。
Specific examples of the
データリーダ/ライタ116は、CPU111と記録媒体120との間のデータ伝送を仲介し、記録媒体120からのプログラムの読み出し、及びコンピュータ110における処理結果の記録媒体120への書き込みを実行する。通信インターフェイス117は、CPU111と、他のコンピュータとの間のデータ伝送を仲介する。
The data reader /
また、記録媒体120の具体例としては、CF(Compact Flash(登録商標))及びSD(Secure Digital)等の汎用的な半導体記憶デバイス、フレキシブルディスク(Flexible Disk)等の磁気記憶媒体、又はCD−ROM(Compact Disk Read Only Memory)などの光学記憶媒体が挙げられる。
Specific examples of the
以上のように、本発明によれば、撮影環境に左右されることなく、特定の色、例えば、肌色を精度良く検出することができる。本発明は、特定の色を認識することが必要なシステム、例えば、手認識による入力が行なわれるシステム、人の顔を認識するシステム等に有用である。 As described above, according to the present invention, it is possible to accurately detect a specific color, for example, a skin color, regardless of the shooting environment. The present invention is useful for a system that needs to recognize a specific color, for example, a system that performs input by hand recognition, a system that recognizes a human face, and the like.
10 拡張配列作成部
20 配列変換部
30 ヒストグラム作成部
40 色認識部
50 キャリブレーション処理部
60 記憶部
70 画像取得部
100 色認識装置
110 コンピュータ
111 CPU
112 メインメモリ
113 記憶装置
114 入力インターフェイス
115 表示コントローラ
116 データリーダ/ライタ
117 通信インターフェイス
118 入力機器
119 ディスプレイ装置
120 記録媒体
121 バス
DESCRIPTION OF
112
Claims (12)
前記特定の色の領域を有するキャリブレーション画像から、それを構成する画素毎に、R値、G値、及びB値を特定し、各値に、段階的に設定された複数の係数を乗算して、前記キャリブレーション画像の拡張配列を作成する、拡張配列作成部と、
前記キャリブレーション画像の前記拡張配列を、色相、彩度、及び明度によって規定される配列に変換する、配列変換部と、
変換後の前記キャリブレーション画像の拡張配列から、一方の軸を色相とし、他方の軸を彩度とした、2次元のヒストグラムを作成する、ヒストグラム作成部と、
前記対象画像を構成する各画素のR値、G値、及びB値から、色相、彩度、及び明度によって規定された前記対象画像の配列を作成し、作成した前記配列から、前記画素毎に、色相の値と彩度の値とを特定し、前記画素毎に特定した前記色相の値及び前記彩度の値と前記2次元のヒストグラムとを用いて、前記対象画像における前記特定の色の領域を認識する、色認識部と、
を備えていることを特徴とする色認識装置。 A device for recognizing a specific color area in a target image,
From the calibration image having the specific color area, the R value, the G value, and the B value are specified for each pixel constituting the area, and each value is multiplied by a plurality of coefficients set in stages. An extended array creating unit for creating an extended array of the calibration images;
An array conversion unit that converts the extended array of the calibration image into an array defined by hue, saturation, and brightness;
A histogram creation unit that creates a two-dimensional histogram from the expanded array of the calibration images after conversion, with one axis as hue and the other axis as saturation;
An array of the target image defined by hue, saturation, and brightness is created from the R value, G value, and B value of each pixel that constitutes the target image, and from the created array, for each pixel Identifying a hue value and a saturation value, and using the hue value and the saturation value specified for each pixel and the two-dimensional histogram, the specific color of the target image A color recognition unit that recognizes an area;
A color recognition apparatus comprising:
前記色認識部が、前記画素毎に特定した前記色相の値及び前記彩度の値を、前記2次元配列に照合して、前記対象画像を構成する画素毎のマハラノビス距離を特定し、特定したマハラノビス距離に基づいて、前記対象画像における前記特定の色の領域を認識する、
請求項1に記載の色認識装置。 A covariance matrix is obtained using the two-dimensional histogram, and a Mahalanobis distance for each combination of a hue value and a saturation value in the calibration image is calculated using the obtained covariance matrix. A calibration processing unit for storing each Mahalanobis distance in a two-dimensional array defined by hue and saturation;
The color recognition unit collates the hue value and the saturation value specified for each pixel with the two-dimensional array, specifies the Mahalanobis distance for each pixel constituting the target image, and specifies Recognizing the specific color region in the target image based on Mahalanobis distance;
The color recognition apparatus according to claim 1.
前記キャリブレーション処理部が、前記ビンが除去された前記2次元のヒストグラムを用いて共分散行列を求める、
請求項2に記載の色認識装置。 The histogram creation unit removes bins whose hue values are less than or less than a threshold value from the two-dimensional histogram,
The calibration processing unit obtains a covariance matrix using the two-dimensional histogram from which the bins have been removed;
The color recognition apparatus according to claim 2.
(a)前記特定の色の領域を有するキャリブレーション画像から、それを構成する画素毎に、R値、G値、及びB値を特定し、各値に、段階的に設定された複数の係数を乗算して、前記キャリブレーション画像の拡張配列を作成する、ステップと、
(b)前記キャリブレーション画像の前記拡張配列を、色相、彩度、及び明度によって規定される配列に変換する、ステップと、
(c)変換後の前記キャリブレーション画像の拡張配列から、一方の軸を色相とし、他方の軸を彩度とした、2次元のヒストグラムを作成する、ステップと、
(d)前記対象画像を構成する各画素のR値、G値、及びB値から、色相、彩度、及び明度によって規定された前記対象画像の配列を作成し、作成した前記配列から、前記画素毎に、色相の値と彩度の値とを特定し、前記画素毎に特定した前記色相の値及び前記彩度の値と前記2次元のヒストグラムとを用いて、前記対象画像における前記特定の色の領域を認識する、ステップと、
を有することを特徴とする色認識方法。 A method for recognizing a specific color area in a target image,
(A) A R value, a G value, and a B value are specified for each pixel constituting the calibration image having the specific color region, and a plurality of coefficients set in stages for each value. Multiplying to create an expanded array of the calibration images; and
(B) converting the expanded array of the calibration images into an array defined by hue, saturation, and brightness;
(C) creating a two-dimensional histogram from the expanded array of the converted calibration images, with one axis as hue and the other axis as saturation;
(D) creating an array of the target image defined by hue, saturation, and brightness from the R value, G value, and B value of each pixel constituting the target image, and from the created array, For each pixel, specify a hue value and a saturation value, and use the hue value and the saturation value specified for each pixel and the two-dimensional histogram to specify the specification in the target image. Recognizing the color region of the step,
A color recognition method characterized by comprising:
前記(d)のステップにおいて、前記画素毎に特定した前記色相の値及び前記彩度の値を、前記(e)のステップで得られた前記2次元配列に照合して、前記対象画像を構成する画素毎のマハラノビス距離を特定し、特定したマハラノビス距離に基づいて、前記対象画像における前記特定の色の領域を認識する、
請求項5に記載の色認識方法。 (E) A covariance matrix is obtained using the two-dimensional histogram, and a Mahalanobis distance for each combination of hue value and saturation value in the calibration image is calculated using the obtained covariance matrix. And storing each calculated Mahalanobis distance in a two-dimensional array defined by hue and saturation,
In the step (d), the hue value and the saturation value specified for each pixel are collated with the two-dimensional array obtained in the step (e) to construct the target image. Identifying the Mahalanobis distance for each pixel to be recognized, and recognizing the specific color region in the target image based on the identified Mahalanobis distance;
The color recognition method according to claim 5.
前記(e)のステップにおいて、前記ビンが除去された前記2次元のヒストグラムを用いて共分散行列を求める、
請求項6に記載の色認識方法。 In the step (c), bins whose hue values are less than or less than a threshold value are removed from the two-dimensional histogram,
In the step (e), a covariance matrix is obtained using the two-dimensional histogram from which the bin has been removed.
The color recognition method according to claim 6.
前記コンピュータに、
(a)前記特定の色の領域を有するキャリブレーション画像から、それを構成する画素毎に、R値、G値、及びB値を特定し、各値に、段階的に設定された複数の係数を乗算して、前記キャリブレーション画像の拡張配列を作成する、ステップと、
(b)前記キャリブレーション画像の前記拡張配列を、色相、彩度、及び明度によって規定される配列に変換する、ステップと、
(c)変換後の前記キャリブレーション画像の拡張配列から、一方の軸を色相とし、他方の軸を彩度とした、2次元のヒストグラムを作成する、ステップと、
(d)前記対象画像を構成する各画素のR値、G値、及びB値から、色相、彩度、及び明度によって規定された前記対象画像の配列を作成し、作成した前記配列から、前記画素毎に、色相の値と彩度の値とを特定し、前記画素毎に特定した前記色相の値及び前記彩度の値と前記2次元のヒストグラムとを用いて、前記対象画像における前記特定の色の領域を認識する、ステップと、
を実行させるプログラム。 A program for recognizing a specific color area in a target image by a computer,
In the computer,
(A) A R value, a G value, and a B value are specified for each pixel constituting the calibration image having the specific color region, and a plurality of coefficients set in stages for each value. Multiplying to create an expanded array of the calibration images; and
(B) converting the expanded array of the calibration images into an array defined by hue, saturation, and brightness;
(C) creating a two-dimensional histogram from the expanded array of the converted calibration images, with one axis as hue and the other axis as saturation;
(D) creating an array of the target image defined by hue, saturation, and brightness from the R value, G value, and B value of each pixel constituting the target image, and from the created array, For each pixel, specify a hue value and a saturation value, and use the hue value and the saturation value specified for each pixel and the two-dimensional histogram to specify the specification in the target image. Recognizing the color region of the step,
A program that executes
(e)前記2次元のヒストグラムを用いて共分散行列を求め、求めた前記共分散行列を用いて、前記キャリブレーション画像における、色相の値と彩度の値との組合せ毎のマハラノビス距離を算出し、算出した各マハラノビス距離を、色相及び彩度によって規定される2次元配列に格納する、ステップを更に実行させ、
前記(d)のステップにおいて、前記画素毎に特定した前記色相の値及び前記彩度の値を、前記(e)のステップで得られた前記2次元配列に照合して、前記対象画像を構成する画素毎のマハラノビス距離を特定し、特定したマハラノビス距離に基づいて、前記対象画像における前記特定の色の領域を認識する、
請求項9に記載のプログラム。 In the computer,
(E) A covariance matrix is obtained using the two-dimensional histogram, and a Mahalanobis distance for each combination of hue value and saturation value in the calibration image is calculated using the obtained covariance matrix. And storing each calculated Mahalanobis distance in a two-dimensional array defined by hue and saturation,
In the step (d), the hue value and the saturation value specified for each pixel are collated with the two-dimensional array obtained in the step (e) to construct the target image. Identifying the Mahalanobis distance for each pixel to be recognized, and recognizing the specific color region in the target image based on the identified Mahalanobis distance;
The program according to claim 9.
前記(e)のステップにおいて、前記ビンが除去された前記2次元のヒストグラムを用いて共分散行列を求める、
請求項10に記載のプログラム。 In the step (c), bins whose hue values are less than or less than a threshold value are removed from the two-dimensional histogram,
In the step (e), a covariance matrix is obtained using the two-dimensional histogram from which the bin has been removed.
The program according to claim 10.
The program according to any one of claims 9 to 11, wherein the plurality of coefficients are set according to the specific color.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015252481A JP6614658B2 (en) | 2015-12-24 | 2015-12-24 | Color recognition apparatus, color recognition method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015252481A JP6614658B2 (en) | 2015-12-24 | 2015-12-24 | Color recognition apparatus, color recognition method, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2017118363A JP2017118363A (en) | 2017-06-29 |
JP6614658B2 true JP6614658B2 (en) | 2019-12-04 |
Family
ID=59232381
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2015252481A Active JP6614658B2 (en) | 2015-12-24 | 2015-12-24 | Color recognition apparatus, color recognition method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6614658B2 (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3459950B2 (en) * | 1997-04-30 | 2003-10-27 | 学校法人立命館 | Face detection and face tracking method and apparatus |
KR100499130B1 (en) * | 2001-11-27 | 2005-07-04 | 삼성전자주식회사 | Image retrieval method and apparatus independent of the illumination change |
JP2004246424A (en) * | 2003-02-10 | 2004-09-02 | Masahide Kaneko | Method for extracting skin color area |
JP2005174247A (en) * | 2003-12-15 | 2005-06-30 | Canon Inc | Image processor, image processing method, and program |
JP5070116B2 (en) * | 2008-04-16 | 2012-11-07 | 株式会社ニコンシステム | Table data generation apparatus and table data generation method |
-
2015
- 2015-12-24 JP JP2015252481A patent/JP6614658B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2017118363A (en) | 2017-06-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10388018B2 (en) | Image processing apparatus, image processing method, and storage medium | |
JP5297530B2 (en) | Image processing apparatus and interface apparatus | |
US10216979B2 (en) | Image processing apparatus, image processing method, and storage medium to detect parts of an object | |
JP4372051B2 (en) | Hand shape recognition apparatus and method | |
US20160154469A1 (en) | Mid-air gesture input method and apparatus | |
US9262690B2 (en) | Method and device for detecting glare pixels of image | |
JP5870598B2 (en) | Image white balance processing method and apparatus | |
US10692215B2 (en) | Image processing apparatus, image processing method, and storage medium | |
JP5656768B2 (en) | Image feature extraction device and program thereof | |
JP5887264B2 (en) | Object recognition apparatus, method, program, and computer-readable medium storing the software | |
JP6261199B2 (en) | Information processing apparatus, information processing method, and computer program | |
CN109871249B (en) | Remote desktop operation method and device, readable storage medium and terminal equipment | |
JP6388507B2 (en) | Image processing device | |
US9270883B2 (en) | Image processing apparatus, image pickup apparatus, image pickup system, image processing method, and non-transitory computer-readable storage medium | |
JP6202938B2 (en) | Image recognition apparatus and image recognition method | |
JP6614658B2 (en) | Color recognition apparatus, color recognition method, and program | |
US11580620B2 (en) | Image processing apparatus, image processing method, and non-transitory computer-readable medium | |
KR20150094108A (en) | Method for generating saliency map based background location and medium for recording the same | |
KR101796551B1 (en) | Speedy calculation method and system of depth information strong against variable illumination | |
US20170213103A1 (en) | Image retrieving device, image retrieving method, and recording medium | |
JP2015176252A (en) | Image processor and image processing method | |
JP6798690B2 (en) | Image processing equipment, image processing methods, and programs | |
KR101937859B1 (en) | System and Method for Searching Common Objects in 360-degree Images | |
KR101491334B1 (en) | Apparatus and method for detecting color chart in image | |
KR20160060121A (en) | Method for determining local differentiating color for image feature detectors |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20180913 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20190705 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20190716 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20190911 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20191008 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20191031 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6614658 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |