JP3501907B2 - Color identification device - Google Patents
Color identification deviceInfo
- Publication number
- JP3501907B2 JP3501907B2 JP25632996A JP25632996A JP3501907B2 JP 3501907 B2 JP3501907 B2 JP 3501907B2 JP 25632996 A JP25632996 A JP 25632996A JP 25632996 A JP25632996 A JP 25632996A JP 3501907 B2 JP3501907 B2 JP 3501907B2
- Authority
- JP
- Japan
- Prior art keywords
- color
- area
- background
- unit
- character
- 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
Links
- 239000003086 colorant Substances 0.000 claims description 21
- 238000006243 chemical reaction Methods 0.000 claims description 6
- 238000000034 method Methods 0.000 description 14
- 238000010606 normalization Methods 0.000 description 14
- 238000010586 diagram Methods 0.000 description 9
- 238000000926 separation method Methods 0.000 description 6
- 238000001514 detection method Methods 0.000 description 3
- 235000012055 fruits and vegetables Nutrition 0.000 description 3
- 239000002131 composite material Substances 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
Landscapes
- Spectrometry And Color Measurement (AREA)
Description
【0001】[0001]
【発明の属する技術分野】本発明は、カラー画像に内在
する対象領域の色を所定の登録色と比較して識別する色
識別装置に関し、特に、カラー画像に含まれる対象領域
の色が背景領域の色と混色した場合に、背景領域の色の
影響を除去しつつ該対象領域の色を正確に識別する色識
別装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a color discriminating apparatus for discriminating a color of a target region existing in a color image by comparing it with a predetermined registered color, and more particularly to a color discriminating device in which the color of the target region contained in the color image is a background region. The present invention relates to a color identification device that accurately identifies the color of the target area while removing the influence of the color of the background area when mixed with the color.
【0002】[0002]
【従来の技術】従来、青果類の選果場などでは、青果の
品質等を表示するための等級文字と階級文字をスタンプ
印字した段ボール箱に青果を収納した後、その等階級文
字を読み取って等階級ごとに選別して出荷される。2. Description of the Related Art Conventionally, in a fruit and vegetable sorting field, after storing fruits and vegetables in a corrugated cardboard box stamped with grade letters and grade letters for indicating the quality of fruits and vegetables, the letters of equal grade are read. It is sorted and shipped by equal rank.
【0003】ここで、この等階級文字は、文字の種類の
みならず文字色によっても等階級を分類しているため、
かかる等階級文字を自動認識する際には文字色について
も識別しなければならない。Here, since the equal rank characters are classified according to not only the type of character but also the character color,
When automatically recognizing such equidistant characters, the character color must also be identified.
【0004】このため、従来は、RGBの値を持つ原画
像の色情報を、合成色の色調をコントロールし易いマン
セル表色系のHSL空間やLa*b*表色系の均等知覚色
空間に変換して、かかる空間上で色の識別を行う技術が
使用される。For this reason, conventionally, the color information of the original image having RGB values is converted into the Munsell color system HSL space or the La * b * color system uniform perceptual color space in which the color tone of the composite color is easily controlled. Techniques are used to convert and identify colors in such a space.
【0005】例えば、RGBの値を持つ原画像の色情報
をHSL変換して、色相(H:hue)、彩度(S:satur
ation)及び明度(L:lightness )の成分に分解し、
分解した各成分と予め登録した登録色のH、S、Lとの
距離をそれぞれ求めて、求めた距離に基づいて識別対象
の原画像の色が登録色と一致するか否かを識別する。For example, color information of an original image having RGB values is HSL-converted to obtain a hue (H: hue) and a saturation (S: satur).
ation) and brightness (L: lightness) components,
The distances between the decomposed components and the registered colors H, S, and L that are registered in advance are obtained, and it is determined whether the color of the original image to be identified matches the registered color based on the obtained distances.
【0006】[0006]
【発明が解決しようとする課題】しかしながら、上記従
来技術は、識別対象となる原画像が良好な状態で色情報
を持つ場合には有効であるが、原画像の色情報が背景色
の影響を受けて劣化した場合には、当然ながらその識別
精度は低下する。However, the above-mentioned conventional technique is effective when the original image to be identified has color information in a good state, but the color information of the original image affects the influence of the background color. When it is received and deteriorated, the identification accuracy is naturally lowered.
【0007】具体的には、段ボール箱に印字された等階
級文字が、段ボール箱自体の色の影響を受けて混色した
ような場合には、この等階級文字の文字色が本来の文字
色とすでに別のものとなっているため、かかる文字色を
HSL空間又は均等知覚色空間に変換したとしても、適
切に文字色を識別することはできない。[0007] Specifically, when the equal-class characters printed on the cardboard box are mixed due to the influence of the color of the cardboard box itself, the character color of the equal-class characters is different from the original character color. Since it is already different, even if such a character color is converted into the HSL space or the uniform perceptual color space, the character color cannot be properly identified.
【0008】特に、スタンプ印字された文字がかすれた
り、インクが薄い場合は、文字の色が背景色の影響で背
景色の方に近くなるため、色の類似度を単にユークリッ
ド距離等で計算するとほとんどの色が背景色に類似し、
判別不能となる。In particular, when a stamp-printed character is faint or the ink is thin, the color of the character is closer to the background color due to the influence of the background color. Therefore, if the color similarity is simply calculated by the Euclidean distance or the like. Most colors are similar to the background color,
It becomes indistinguishable.
【0009】そこで、本発明では上記問題を解決して、
カラー画像に含まれる対象領域の色が背景領域の色と混
色した場合に、背景領域の色の影響を除去しつつ該対象
領域の色を正確に識別することができる色識別装置を提
供することを目的とする。Therefore, the present invention solves the above problems by
To provide a color identification device capable of accurately identifying the color of a target area while removing the influence of the color of the background area when the color of the target area included in a color image is mixed with the color of the background area. With the goal.
【0010】[0010]
【課題を解決するための手段】上記目的を達成するた
め、第1の発明は、所定の色を登録色として予め登録
し、カラー画像に内在する対象領域の色を前記登録色と
比較することにより識別する色識別装置において、前記
対象領域の色および前記対象領域の背景に位置する背景
領域の色を検出する検出手段と、前記検出手段で検出し
た対象領域の色と背景領域の色とが色空間上でなす第1
の角度および前記登録色と前記検出手段で検出した背景
領域の色とが色空間上でなす第2の角度を算定する角度
算定手段と、前記角度算定手段が算定した前記第1の角
度と前記第2の角度との角度差に基づき前記対象領域の
色が前記登録色に対応するかを識別する色識別手段とを
具備したことを特徴とする。To achieve the above object, a first aspect of the present invention is to register a predetermined color in advance as a registered color and compare the color of a target area included in a color image with the registered color. In the color identification device identified by, the detection means for detecting the color of the target area and the color of the background area located on the background of the target area, the color of the target area and the color of the background area detected by the detection means First done in color space
Angle and the registered color and the color of the background area detected by the detection means to calculate a second angle in the color space, the first angle calculated by the angle calculation means and the And a color identification unit for identifying whether the color of the target area corresponds to the registered color based on an angle difference from the second angle.
【0011】 また、第2の発明は、第1の発明におい
て、前記検出手段は、前記カラー画像から対象領域と背
景領域を分離する分離手段と、前記分離手段が分離した
対象領域及び背景領域の各画素が持つ色を明度成分を含
まない単位色にそれぞれ変換する変換手段と、前記変換
手段が変換した対象領域の各画素の単位色のうち出現頻
度が最も高い単位色を該対象領域の色として選択すると
ともに、前記変換手段が変換した背景領域の各画素の単
位色のうち出現頻度が最も高い単位色を該背景領域の色
として選択する色選択手段とを具備することを特徴とす
る。In a second aspect based on the first aspect, the detecting means separates the target area and the background area from the color image, and the target area and the background area separated by the separating means. A conversion unit that converts a color of each pixel into a unit color that does not include a lightness component, and a unit color that has the highest appearance frequency among the unit colors of each pixel of the target region converted by the conversion unit is the color of the target region. And a color selection unit that selects the unit color having the highest appearance frequency among the unit colors of each pixel of the background region converted by the conversion unit as the color of the background region.
【0012】[0012]
【発明の実施の形態】以下、本発明の実施の形態につい
て図面を参照して説明する。なお、本実施の形態では、
カラー画像に含まれる文字の文字色を識別対象とした場
合について説明する。BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described below with reference to the drawings. In the present embodiment,
A case where the character color of the character included in the color image is set as the identification target will be described.
【0013】図1は、本実施の形態で用いる色識別装置
10の構成を示す図である。FIG. 1 is a diagram showing the configuration of a color identification apparatus 10 used in this embodiment.
【0014】図1に示す色識別装置10は、予め登録し
た色(以下「登録色」と言う。)と識別対象となる文字
(以下「識別文字」と言う。)の文字色とを単に比較す
るのではなく、かかる識別文字の文字色と該識別文字の
背景に付された背景色とが色空間上でなす角度と、登録
色及び背景色が色空間上でなす角度との一致度に基づい
て識別文字の文字色が登録色と一致するか否かを識別す
る。The color identification apparatus 10 shown in FIG. 1 simply compares a color registered in advance (hereinafter referred to as "registered color") with a character color of a character to be identified (hereinafter referred to as "identified character"). Instead, the degree of coincidence between the angle formed by the character color of the identification character and the background color attached to the background of the identification character on the color space and the angle formed by the registered color and the background color on the color space Based on this, it is identified whether the character color of the identification character matches the registered color.
【0015】すなわち、識別文字の文字色を単に登録色
と比較したのでは、背景色の影響を除去できないため、
本実施の形態では、背景色を考慮した色識別を行ってい
る。That is, since the influence of the background color cannot be removed by simply comparing the character color of the identification character with the registered color,
In this embodiment, the color identification is performed in consideration of the background color.
【0016】なお、この色識別装置10は、識別文字の
比較の対象となる登録色をあらかじめ登録する色登録モ
ードと、この登録色との比較によって識別文字の識別を
行う識別モードとを有し、図示しない操作部を用いてこ
れらのモード切り替えを行っている。The color identification device 10 has a color registration mode in which a registered color to be compared with the identification characters is registered in advance, and an identification mode in which the identification characters are identified by comparing the registered colors. These modes are switched using an operation unit (not shown).
【0017】図1に示すように、この色識別装置10
は、画像入力部11と、切り出し処理部12と、文字背
景分離部13と、識別処理部14と、正規化処理部15
と、ヒストグラム作成部16と、角度算定部17と、色
登録処理部18と、登録色記憶部19とからなる。As shown in FIG. 1, this color identification apparatus 10
Is an image input unit 11, a cutout processing unit 12, a character background separation unit 13, an identification processing unit 14, and a normalization processing unit 15.
And a histogram creation unit 16, an angle calculation unit 17, a color registration processing unit 18, and a registered color storage unit 19.
【0018】ここで、これらの機能部のうち、画像入力
部11、切り出し処理部12、文字背景分離部13、識
別処理部14、正規化処理部15、ヒストグラム作成部
16、角度算定部17及び登録色記憶部19について
は、上記識別モードにおいて機能し、また、画像入力部
11、正規化処理部15、ヒストグラム作成部16、色
登録処理部18及び登録色記憶部19については、上記
色登録モードにおいて機能する。Here, among these functional units, the image input unit 11, the cutout processing unit 12, the character background separation unit 13, the identification processing unit 14, the normalization processing unit 15, the histogram creation unit 16, the angle calculation unit 17, and the The registered color storage unit 19 functions in the identification mode, and the image input unit 11, the normalization processing unit 15, the histogram creation unit 16, the color registration processing unit 18, and the registered color storage unit 19 perform the color registration. Function in mode.
【0019】なお、第1の発明における角度算定手段及
び色識別手段は、それぞれ上記角度算定部17及び識別
処理部14に対応し、第2の発明における分離手段、変
換手段及び色選択手段は、それぞれ文字背景分離部1
3、正規化処理部15及びヒストグラム作成部16に対
応する。The angle calculating means and the color identifying means in the first invention correspond to the angle calculating section 17 and the identification processing section 14, respectively, and the separating means, the converting means and the color selecting means in the second invention are: Character background separation part 1
3 corresponds to the normalization processing unit 15 and the histogram creation unit 16.
【0020】画像入力部11は、登録色又は識別文字を
有するカラー画像データを光学的に取り込み、それぞれ
色登録処理部18又は切り出し処理部12に出力する入
力部である。The image input unit 11 is an input unit that optically takes in color image data having a registered color or an identification character and outputs it to the color registration processing unit 18 or the cutout processing unit 12, respectively.
【0021】すなわち、この色識別装置10は、色登録
モードで動作する場合には画像データを色登録処理部1
8に出力し、識別モードで動作する場合には画像データ
を切り出し処理部12に出力する。That is, when the color identification apparatus 10 operates in the color registration mode, the color registration processing unit 1 processes the image data.
8 and outputs the image data to the cutout processing unit 12 when operating in the identification mode.
【0022】切り出し処理部12は、画像入力部11か
ら受け取った画像データから識別文字を含む矩形領域
(以下「文字テンプレート領域」と言う。)を切り出し
て、文字背景分離部13に出力する処理部である。The cut-out processing unit 12 cuts out a rectangular area (hereinafter referred to as a “character template area”) containing an identification character from the image data received from the image input unit 11 and outputs it to the character background separation unit 13. Is.
【0023】なお、かかる切り出しを行う場合には、正
規化相関や一般化ハフ変換等のテンプレートマッチング
を用いて位置決めした後、識別文字の文字テンプレート
領域を切り出すことになる。When performing such cutout, the character template region of the identification character is cut out after positioning using template matching such as normalized correlation or generalized Hough transform.
【0024】図2は、画像データから切り出した文字テ
ンプレート領域の一例を示す図であり、同図に示す文字
テンプレート領域20は、アルファベットの’L’を示
す文字領域20aと、該文字領域20a以外の背景領域
20bとからなる。FIG. 2 is a diagram showing an example of a character template area cut out from the image data. The character template area 20 shown in FIG. 2 is a character area 20a indicating the letter "L" and other than the character area 20a. Background area 20b.
【0025】文字背景分離部13は、切り出し処理部1
2が画像データから切り出した文字テンプレート領域を
文字領域及び背景領域に分離して、それぞれ識別処理部
14に出力する処理部である。The character background separating unit 13 is a cutout processing unit 1.
Reference numeral 2 denotes a processing unit that separates the character template region cut out from the image data into a character region and a background region, and outputs them to the identification processing unit 14.
【0026】例えば、この文字背景分離部13が、図2
に示す文字テンプレート領域20を受け付けた場合に
は、アルファベットの’L’を示す文字領域20aと背
景領域20bとを分離することになる。For example, the character background separating unit 13 is shown in FIG.
When the character template area 20 shown in (1) is received, the character area 20a indicating the letter'L 'and the background area 20b are separated.
【0027】識別処理部14は、文字領域及び背景領域
を文字背景分離部13から受け付けた際に、背景領域の
色及び文字領域の色の相互関係と、背景領域の色及び登
録色の相互関係とを求め、それぞれの相互関係を識別指
標とする識別処理を行っている。When the character processing section 14 receives the character area and the background area from the character background separating section 13, the identification processing section 14 correlates the background area color and the character area color with each other and the background area color and the registered color relationship with each other. Is performed, and the identification process is performed using the respective mutual relationships as identification indices.
【0028】具体的には、この識別処理部14は、正規
化処理部15を用いて背景領域及び文字領域の色をそれ
ぞれRGB空間上で正規化した後、ヒストグラム作成部
16を用いて正規化した色の2成分(r,g)を縦軸及
び横軸とした2次元ヒストグラムをそれぞれ作成する。Specifically, the identification processing unit 14 uses the normalization processing unit 15 to normalize the colors of the background area and the character area in the RGB space, and then uses the histogram creation unit 16 to normalize them. A two-dimensional histogram is created with the two components (r, g) of the color as the vertical axis and the horizontal axis.
【0029】そして、背景領域に対応する2次元ヒスト
グラムの最大度数を持つ座標(rb,gb)を背景領域
の特徴量とし、文字領域に対応する2次元ヒストグラム
の最大度数を持つ座標(rc,gc)を文字領域の特徴
量とする。なお、登録色の特徴量(rt,gt)につい
ては、色登録処理部18が予め算定して登録色記憶部1
9に格納している。The coordinates (rb, gb) having the maximum frequency of the two-dimensional histogram corresponding to the background area are set as the feature amount of the background area, and the coordinates (rc, gc) having the maximum frequency of the two-dimensional histogram corresponding to the character area are set. ) Is the feature amount of the character area. The color registration processing unit 18 calculates in advance the feature amount (rt, gt) of the registered color, and the registered color storage unit 1
It is stored in 9.
【0030】次に、角度算定部17を用いて背景領域の
色及び文字領域の色の角度θcと、背景領域の色及び登
録色の角度θtとを算定し、これらの角度が所定の範囲
内にあれば文字領域の色と登録色とが同一であると識別
する。Next, the angle calculator 17 calculates the angle θc of the color of the background area and the color of the character area and the angle θt of the color of the background area and the registered color, and these angles are within a predetermined range. If it is, the color of the character area is identified as the same as the registered color.
【0031】なお、本実施の形態において2次元ヒスト
グラムの最大頻度を用いる理由は、背景がスタンプ等に
より汚れていたりしていても、安定して背景色を検出で
きるためである。The reason why the maximum frequency of the two-dimensional histogram is used in this embodiment is that the background color can be detected stably even if the background is soiled by a stamp or the like.
【0032】正規化処理部15は、識別処理部14又は
色登録処理部18から画像データの画素値(R,G,
B)を受け付けた際に、
r=R/(R+G+B)
g=G/(R+G+B)
を計算し、計算したr及びgを識別処理部14又は色登
録処理部18に対して出力する。The normalization processing section 15 receives the pixel values (R, G, and G) of the image data from the identification processing section 14 or the color registration processing section 18.
When B) is received, r = R / (R + G + B) g = G / (R + G + B) is calculated, and the calculated r and g are output to the identification processing unit 14 or the color registration processing unit 18.
【0033】図3は、かかる正規化処理部15が行う処
理の概念を示す図であり、同図に示すように、この正規
化処理部15では、背景領域又は文字領域の色を示すR
GB空間上の色ベクトルCとRGB空間上の単位面との
交点(r,g,b)を求めることにより、背景領域又は
文字領域の色を正規化している。FIG. 3 is a diagram showing the concept of the processing performed by the normalization processing unit 15. As shown in FIG. 3, the normalization processing unit 15 has R indicating the color of the background area or the character area.
The color of the background area or the character area is normalized by obtaining the intersection (r, g, b) of the color vector C on the GB space and the unit plane on the RGB space.
【0034】すなわち、RGB空間上では、色の違いを
色ベクトル方向の違いとして捉えることができるため、
RGB空間上の単位面との交点を用いて正規化すること
により、背景領域及び文字領域の各画素が持つ色を明度
成分を含まない色(単位色)にそれぞれ変換しているの
である。That is, in the RGB space, the difference in color can be grasped as the difference in the direction of the color vector.
By normalizing using the intersection with the unit plane in the RGB space, the color of each pixel in the background region and the character region is converted into a color (unit color) not including the lightness component.
【0035】ここで、r成分及びg成分という2成分の
みを算定した理由は、単位面上における
r+g+b=1
という関係式からb成分が一意に定まり、色を特定でき
るためである。Here, the reason why only two components of the r component and the g component are calculated is that the b component is uniquely determined from the relational expression of r + g + b = 1 on the unit surface and the color can be specified.
【0036】ヒストグラム作成部16は、R成分を横軸
としG成分を縦軸とした2次元平面を準備し、識別処理
部14から順次受け付けた座標(r,g)の度数をイン
クリメントする処理を繰り返して2次元ヒストグラムを
算定し、作成した2次元ヒストグラムの最大度数を持つ
座標を識別処理部14に出力する処理部である。The histogram creating unit 16 prepares a two-dimensional plane having the R component as the horizontal axis and the G component as the vertical axis, and performs a process of incrementing the frequency of the coordinates (r, g) sequentially received from the identification processing unit 14. It is a processing unit that repeatedly calculates a two-dimensional histogram and outputs the coordinates having the maximum frequency of the created two-dimensional histogram to the identification processing unit 14.
【0037】角度算定部17は、識別処理部14から背
景領域に対応する座標(rb,gb)と、文字領域に対
応する座標(rc,gc)と、登録色に対応する座標
(rt,gt)を受け付け、座標(rb,gb)及び座
標(rc,gc)がなす角度θcと、座標(rb,g
b)及び座標(rt,gt)がなす角度θtを算定して
識別処理部14に出力する。The angle calculation unit 17 receives the coordinates (rb, gb) corresponding to the background region, the coordinates (rc, gc) corresponding to the character region, and the coordinates (rt, gt) corresponding to the registered color from the identification processing unit 14. ) Is received, the angle θc formed by the coordinates (rb, gb) and the coordinates (rc, gc) and the coordinates (rb, g
b) and the angle θt formed by the coordinates (rt, gt) are calculated and output to the identification processing unit 14.
【0038】具体的には、
θc=tan-1((gc−gb)/(rc−rb))
θt=tan-1((gt−gb)/(rt−rb))
という2つの計算式を用いて、かかる角度を算定するこ
とになる。Specifically, two calculation formulas of θc = tan-1 ((gc-gb) / (rc-rb)) θt = tan-1 ((gt-gb) / (rt-rb)) It will be used to calculate such an angle.
【0039】図4は、上記角度算定部17の処理の概念
を示す図であり、同図に示すように、この角度算定部1
7では、単に文字領域に対応する座標(rc,gc)及
び登録色に対応する座標(rt,gt)がそれぞれ原点
となす角度を求めているのではなく、それぞれ背景領域
に対応する座標(rb,gb)となす角度を求めてい
る。FIG. 4 is a diagram showing the concept of the processing of the angle calculating unit 17, and as shown in FIG.
In FIG. 7, the coordinates (rc, gc) corresponding to the character area and the coordinates (rt, gt) corresponding to the registered color are not obtained as the angles with the origin, but the coordinates (rb) corresponding to the background area are obtained. , Gb).
【0040】すなわち、単に原点0となす角度を求め、
背景領域の色を何等考慮しないこととすると、識別文字
の文字色が背景色と混色した際に、識別文字本来の文字
色の識別が事実上不可能となる。That is, the angle formed with the origin 0 is simply obtained,
If no consideration is given to the color of the background area, when the character color of the identification character is mixed with the background color, it is virtually impossible to identify the original character color of the identification character.
【0041】このため、この角度算定部17では、背景
領域の色に対応する座標(rb,gb)を基準とした場
合の角度を求めている。For this reason, the angle calculating unit 17 obtains the angle when the coordinates (rb, gb) corresponding to the color of the background area are used as a reference.
【0042】色登録処理部18は、識別文字の比較の対
象となる登録色を登録する色登録モードにおいて機能す
る処理部であり、具体的には、画像入力部11から登録
する色を含む所定の領域を切り出した後に、識別処理部
14と同様に正規化処理部15及びヒストグラム作成部
16を用いて2次元ヒストグラムの最大度数を持つ座標
(rt,gt)を算出して登録色記憶部19に格納す
る。The color registration processing section 18 is a processing section that functions in a color registration mode for registering a registered color that is a target of comparison of identification characters, and specifically, a predetermined color including a color registered from the image input section 11. After cutting out the region, the normalization processing unit 15 and the histogram creation unit 16 are used to calculate the coordinates (rt, gt) having the maximum frequency of the two-dimensional histogram and the registered color storage unit 19 as in the identification processing unit 14. To store.
【0043】登録色記憶部19は、識別文字の比較の対
象となる登録色に対応する2次元ヒストグラム上の座標
を記憶する記憶部である。The registered color storage unit 19 is a storage unit for storing the coordinates on the two-dimensional histogram corresponding to the registered color to be compared with the identification characters.
【0044】上記構成を有する色識別装置10を用いる
ことにより、背景領域の色及び文字領域の色の相互関係
と、背景領域の色及び登録色の相互関係とを求め、それ
ぞれの相互関係を識別指標とする識別処理を行い、もっ
て識別文字の文字色と背景色との混色の影響を除去して
識別を行うことができる。By using the color identification device 10 having the above-mentioned configuration, the mutual relationship between the color of the background area and the color of the character area and the mutual relationship between the color of the background area and the registered color are obtained, and the mutual relationships are identified. It is possible to perform the identification process by using the index and remove the influence of the color mixture of the character color of the identification character and the background color to perform the identification.
【0045】次に、図1に示す色識別装置10の色登録
モードにおける処理手順について説明する。Next, the processing procedure in the color registration mode of the color identification apparatus 10 shown in FIG. 1 will be described.
【0046】図5は、図1に示す色識別装置10の色登
録モードにおける処理手順を示すフローチャートであ
る。FIG. 5 is a flowchart showing a processing procedure in the color registration mode of the color identification apparatus 10 shown in FIG.
【0047】図5に示すように、この色識別装置10
は、登録色を含むカラー画像(RGB)を画像入力部1
1から取り込んだ後に(ステップ501)、登録する色
を含む領域を指定する(ステップ502)。As shown in FIG. 5, this color identification device 10
Is a color image (RGB) including the registered color,
After importing from 1 (step 501), the area including the color to be registered is designated (step 502).
【0048】次に、指定領域の各画素を
r=R/(R+G+B)
g=G/(R+G+B)
の算定式を用いて(r,g)に変換する正規化処理を行
い(ステップ503)、指定領域内のすべての画素の
(r,g)の2次元ヒストグラムH(r,g)を求める
(ステップ504)。Next, a normalization process is performed to convert each pixel in the designated area into (r, g) using the calculation formula of r = R / (R + G + B) g = G / (R + G + B) (step 503). A two-dimensional histogram H (r, g) of (r, g) of all pixels in the designated area is obtained (step 504).
【0049】そして、この2次元ヒストグラムH(r,
g)の最大度数の(r,g)を(rt,gt)として登
録色記憶部19に登録する(ステップ505)。The two-dimensional histogram H (r,
The maximum frequency (r, g) of g) is registered in the registered color storage unit 19 as (rt, gt) (step 505).
【0050】なお、かかる登録処理を繰り返すことによ
り、識別文字の文字色の比較の対象となる複数の色を登
録できることになる。By repeating this registration process, it is possible to register a plurality of colors to be compared with the character colors of the identification characters.
【0051】次に、図1に示す色識別装置10の識別モ
ードにおける処理手順について説明する。Next, the processing procedure in the identification mode of the color identification apparatus 10 shown in FIG. 1 will be described.
【0052】図6は、図1に示す色識別装置10の識別
モードにおける処理手順を示すフローチャートである。FIG. 6 is a flow chart showing a processing procedure in the identification mode of the color identification apparatus 10 shown in FIG.
【0053】図6に示すように、この色識別装置10
は、識別文字を含むカラー画像(RGB)を画像入力部
11から取り込んだならば(ステップ601)、切り出
し処理部12がテンプレートマッチングにより文字テン
プレート領域を切り出し(ステップ602)、文字背景
分離部13がこの文字テンプレート領域をRGB画像か
ら濃度画像に変換して2値化し、文字領域と背景領域に
分離して識別処理部14に出力する(ステップ60
3)。As shown in FIG. 6, this color identification device 10
When a color image (RGB) including identification characters is captured from the image input unit 11 (step 601), the cutout processing unit 12 cuts out a character template region by template matching (step 602), and the character background separation unit 13 This character template area is converted from an RGB image into a density image, binarized, separated into a character area and a background area, and output to the identification processing unit 14 (step 60).
3).
【0054】そして、この文字領域及び背景領域を受け
取った識別処理部14は、正規化処理部15を用いて
r=R/(R+G+B)
g=G/(R+G+B)
の算定式により背景領域の各画素を正規化して(r,
g)を作成し(ステップ604)、さらにヒストグラム
作成部16を用いて背景領域内の全ての画素の(r,
g)の2次元ヒストグラムH(r,g)を求めた後に
(ステップ605)、該ヒストグラムH(r,g)の最
大度数の(r,g)を(rb,gb)として採用する
(ステップ606)。Then, the identification processing section 14 which has received the character area and the background area uses the normalization processing section 15 to calculate each of the background areas by the calculation formula of r = R / (R + G + B) g = G / (R + G + B). Normalize the pixel (r,
g) is created (step 604), and the histogram creating unit 16 is used to create (r,
After obtaining the two-dimensional histogram H (r, g) of (g) (step 605), the maximum frequency (r, g) of the histogram H (r, g) is adopted as (rb, gb) (step 606). ).
【0055】次に、識別処理部14は、同様にして文字
領域の各画素を正規化して(r,g)を作成し(ステッ
プ607)、文字領域内の全ての画素の(r,g)の2
次元ヒストグラムH(r,g)を求めた後に(ステップ
608)、該ヒストグラムH(r,g)の最大度数の
(r,g)を(rc,gc)として採用する(ステップ
609)。Next, the identification processing unit 14 similarly normalizes each pixel of the character area to create (r, g) (step 607), and (r, g) of all the pixels in the character area. Of 2
After obtaining the dimension histogram H (r, g) (step 608), the maximum frequency (r, g) of the histogram H (r, g) is adopted as (rc, gc) (step 609).
【0056】その後、識別処理部14は、背景の位置
(rb,gb)を中心として文字領域の色(rc,g
c)の角度θcと、あらかじめ登録した登録色(rt,
gt)の角度θtとを角度算定部17を用いて算出し
(ステップ610)、このθcとθtの差の絶対値が一
定値以内であるならば、文字領域の色が登録色であると
識別する(ステップ611)。After that, the identification processing unit 14 centers the background position (rb, gb) on the color (rc, g) of the character area.
c) angle θc and the registered color (rt,
gt) and the angle θt are calculated using the angle calculation unit 17 (step 610), and if the absolute value of the difference between θc and θt is within a certain value, the color of the character area is identified as the registered color. (Step 611).
【0057】上記一連の処理を行うことにより、背景色
を考慮した識別文字の文字色の識別を行うことが可能と
なる。By performing the series of processes described above, it is possible to identify the character color of the identification character in consideration of the background color.
【0058】なお、ここでは説明の便宜上、1つの登録
色と識別文字の文字色とが一致するか否かを識別する場
合を示したが、実際には複数種類の登録色をあらかじめ
準備しておき、識別文字の文字色がいずれの登録色に近
いかを識別指標とすることもできる。Here, for convenience of explanation, the case of identifying whether or not one registered color and the character color of the identification character match is shown, but in reality, a plurality of registered colors are prepared in advance. In addition, it is also possible to use which of the registered colors the color of the identification character is close to as an identification index.
【0059】例えば、図7に示すように3つの登録色t
1(rt1,gt1)、t2(rt2,gt2)及びt
3(rt3,gt3)と背景色bが存在する場合には、
背景色bと各登録色t1、t2及びt3とのなす角度
は、それぞれ
θt1=tan-1((gt1−gb)/(rt1−r
b))
θt2=tan-1((gt2−gb)/(rt2−r
b))
θt3=tan-1((gt3−gb)/(rt3−r
b))
となる。ここで、同図から明らかなように、文字色cと
背景色bのなす角度は、登録色t2に最も近いことか
ら、かかる文字色は登録色t2とみなされることにな
る。For example, as shown in FIG. 7, three registered colors t
1 (rt1, gt1), t2 (rt2, gt2) and t
3 (rt3, gt3) and background color b exist,
The angle formed by the background color b and the registered colors t1, t2, and t3 is θt1 = tan-1 ((gt1-gb) / (rt1-r), respectively.
b)) θt2 = tan-1 ((gt2-gb) / (rt2-r
b)) θt3 = tan-1 ((gt3-gb) / (rt3-r
b)). Here, as is apparent from the figure, since the angle formed by the character color c and the background color b is the closest to the registered color t2, such character color is regarded as the registered color t2.
【0060】上述してきたように、本実施の形態では、
識別処理部14が、正規化処理部15を用いて背景領域
及び文字領域の色をそれぞれRGB空間上で正規化した
後、ヒストグラム作成部16を用いて正規化した色の2
成分(r,g)を縦軸及び横軸とした2次元ヒストグラ
ムをそれぞれ作成し、背景領域に対応する2次元ヒスト
グラムの最大度数を持つ座標(rb,gb)及び文字領
域に対応する2次元ヒストグラムの最大度数を持つ座標
(rc,gc)をそれぞれ背景領域の色及び文字領域の
色とし、角度算定部17を用いて背景領域の色及び文字
領域の色の角度θcと、背景領域の色及び登録色の角度
θtとを算定し、これらの角度が所定の範囲内にあれば
文字領域の色と登録色とが同一であると識別するよう構
成したので、以下に示す効果が得られる。As described above, in this embodiment,
The identification processing unit 14 uses the normalization processing unit 15 to normalize the colors of the background area and the character area in the RGB space, respectively, and then uses the histogram creation unit 16 to normalize the two colors.
A two-dimensional histogram corresponding to a coordinate (rb, gb) and a character area having a maximum frequency of the two-dimensional histogram corresponding to the background area is created by creating a two-dimensional histogram with the components (r, g) as the vertical axis and the horizontal axis, respectively. The coordinates (rc, gc) having the maximum frequency of are the color of the background area and the color of the character area, respectively, and the angle calculating unit 17 is used to determine the angle θc between the color of the background area and the color of the character area, The angles θt of registered colors are calculated, and if these angles are within a predetermined range, it is configured to identify that the color of the character area and the registered color are the same. Therefore, the following effects can be obtained.
【0061】1)カラー画像に含まれる文字領域の色が
背景領域の色と混色した場合に、背景領域の色の影響を
除去しつつ文字領域の色を正確に識別することができ
る。1) When the color of the character area included in the color image is mixed with the color of the background area, the color of the character area can be accurately identified while removing the influence of the color of the background area.
【0062】2)背景領域の色及び文字領域の色の角度
θcと背景領域の色及び登録色の角度θtとを効率良く
算出することができる。2) The angle θc of the color of the background area and the color of the character area and the angle θt of the color of the background area and the registered color can be efficiently calculated.
【0063】なお、本実施の形態では、カラー画像に含
まれる文字の文字色を識別対象とした場合について説明
したが、本発明はこれに限定されるものではなく、各種
識別対象に適用することができる。In the present embodiment, the case has been described in which the character color of the character included in the color image is used as the identification target, but the present invention is not limited to this and can be applied to various identification targets. You can
【0064】[0064]
【発明の効果】以上詳細に説明したように、第1の発明
は、対象領域の色と該対象領域の背景に位置する背景領
域の色が色空間上でなす第1の角度と、あらかじめ登録
した登録色と背景領域の色が色空間上でなす第2の角度
を算定し、算定した第1の角度及び第2の角度の角度差
に基づいて対象領域の色を識別するよう構成したので、
カラー画像に含まれる対象領域の色が背景領域の色と混
色した場合に、背景領域の色の影響を除去しつつ該対象
領域の色を正確に識別することが可能となる。As described above in detail, in the first invention, the color of the target area and the first angle formed by the color of the background area located in the background of the target area on the color space are registered in advance. Since the second angle formed by the registered color and the color of the background area in the color space is calculated, the color of the target area is identified based on the calculated difference between the first angle and the second angle. ,
When the color of the target area included in the color image is mixed with the color of the background area, the color of the target area can be accurately identified while removing the influence of the color of the background area.
【0065】また、第2の発明では、カラー画像から対
象領域と背景領域をそれぞれ分離し、分離した対象領域
及び背景領域の各画素が持つ色を明度成分を含まない単
位色にそれぞれ変換し、変換した対象領域の各画素の単
位色のうち出現頻度が最も高い単位色を該対象領域の色
として選択するとともに、背景領域の各画素の単位色の
うち出現頻度が最も高い単位色を該背景領域の色として
選択する。そして、選択した対象領域の色と背景領域の
色が色空間上でなす第1の角度と、選択した背景領域の
色と登録色が色空間上でなす第2の角度を算定し、算定
した第1の角度及び第2の角度の角度差に基づいて対象
領域の色を識別するよう構成したので、第1及び第2の
角度を効率良く算出することがさらに可能となる。In the second aspect of the invention, the target area and the background area are separated from the color image, and the color of each pixel of the separated target area and background area is converted into a unit color that does not include a lightness component. The unit color having the highest appearance frequency among the unit colors of each pixel of the converted target area is selected as the color of the target area, and the unit color having the highest appearance frequency of the unit colors of each pixel of the background area is the background. Select as the color of the area. Then, the first angle formed by the color of the selected target area and the color of the background area in the color space and the second angle formed by the color of the selected background area and the registered color in the color space are calculated and calculated. Since the color of the target area is identified based on the difference between the first angle and the second angle, it is possible to efficiently calculate the first and second angles.
【図1】本実施の形態で用いる色識別装置の構成を示す
図。FIG. 1 is a diagram showing a configuration of a color identification device used in the present embodiment.
【図2】図1に示す切り出し処理部が画像データから切
り出した文字テンプレート領域の一例を示す図。FIG. 2 is a diagram showing an example of a character template region cut out from image data by a cutout processing unit shown in FIG.
【図3】図1に示す正規化処理部が行う処理の概念を示
す図。FIG. 3 is a diagram showing a concept of processing performed by a normalization processing unit shown in FIG. 1.
【図4】図1に示す角度算定部の処理の概念を示す図。FIG. 4 is a diagram showing a concept of processing of an angle calculation unit shown in FIG. 1.
【図5】図1に示す色識別装置の色登録モードにおける
処理手順を示すフローチャート。5 is a flowchart showing a processing procedure in a color registration mode of the color identification device shown in FIG.
【図6】図1に示す色識別装置の識別モードにおける処
理手順を示すフローチャート。6 is a flowchart showing a processing procedure in an identification mode of the color identification apparatus shown in FIG.
【図7】識別文字の文字色を複数種類の登録色から選択
する場合の説明図。FIG. 7 is an explanatory diagram for selecting a character color of an identification character from a plurality of registered colors.
10…色識別装置、 11…画像入力部、 12…切り
出し処理部、13…文字背景分離部、 14…識別処理
部、 15…正規化処理部、16…ヒストグラム作成
部、 17…角度算定部、18…色登録処理部、 19
…登録色記憶部、20…文字テンプレート領域、 20
a…文字領域、 20b…背景領域10 ... Color identification device, 11 ... Image input unit, 12 ... Clipping processing unit, 13 ... Character background separation unit, 14 ... Identification processing unit, 15 ... Normalization processing unit, 16 ... Histogram creation unit, 17 ... Angle calculation unit, 18 ... Color registration processing unit, 19
... Registered color storage section, 20 ... Character template area, 20
a ... Character area, 20b ... Background area
フロントページの続き (56)参考文献 特開 平8−84962(JP,A) 特開 平5−72040(JP,A) 特開 平5−133809(JP,A) 特開 平5−61974(JP,A) (58)調査した分野(Int.Cl.7,DB名) G01J 3/00 - 3/52 JICSTファイル(JOIS)Continuation of the front page (56) Reference JP-A-8-84962 (JP, A) JP-A-5-72040 (JP, A) JP-A-5-133809 (JP, A) JP-A-5-61974 (JP , A) (58) Fields investigated (Int.Cl. 7 , DB name) G01J 3/00-3/52 JISST file (JOIS)
Claims (2)
ラー画像に内在する対象領域の色を前記登録色と比較す
ることにより識別する色識別装置において、 前記対象領域の色および前記対象領域の背景に位置する
背景領域の色を検出する検出手段と、 前記検出手段で検出した対象領域の色と背景領域の色と
が色空間上でなす第1の角度および前記登録色と前記検
出手段で検出した背景領域の色とが色空間上でなす第2
の角度を算定する角度算定手段と、 前記角度算定手段が算定した前記第1の角度と前記第2
の角度との角度差に基づき前記対象領域の色が前記登録
色に対応するかを識別する色識別手段とを具備したこと
を特徴とする色識別装置。1. A color identification device for identifying a color by registering a predetermined color as a registered color in advance and comparing the color of a target area existing in a color image with the registered color, the color of the target area and the target area. Detecting means for detecting the color of the background area located on the background of the background, the first angle formed by the color of the target area detected by the detecting means and the color of the background area on the color space, the registered color and the detecting means. The color of the background area detected in step 2 in the color space
Angle calculating means for calculating the angle of, and the first angle and the second angle calculated by the angle calculating means.
And a color identification unit that identifies whether the color of the target area corresponds to the registered color based on the angle difference from the angle.
象領域と背景領域を分離する分離手段と、 前記分離手段が分離した対象領域及び背景領域の各画素
が持つ色を明度成分を含まない単位色にそれぞれ変換す
る変換手段と、 前記変換手段が変換した対象領域の各画素の単位色のう
ち出現頻度が最も高い単位色を該対象領域の色として選
択するとともに、前記変換手段が変換した背景領域の各
画素の単位色のうち出現頻度が最も高い単位色を該背景
領域の色として選択する色選択手段とを具備することを
特徴とする請求項1記載の色識別装置。2. The detecting means includes a separating means for separating a target area and a background area from the color image, and a unit which does not include a lightness component in a color of each pixel of the target area and the background area separated by the separating means. A conversion unit that converts each color, and a unit color that has the highest appearance frequency among the unit colors of each pixel of the target region converted by the conversion unit is selected as the color of the target region, and the background converted by the conversion unit The color identification device according to claim 1, further comprising a color selection unit that selects a unit color having the highest appearance frequency among the unit colors of each pixel of the area as a color of the background area.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP25632996A JP3501907B2 (en) | 1996-09-27 | 1996-09-27 | Color identification device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP25632996A JP3501907B2 (en) | 1996-09-27 | 1996-09-27 | Color identification device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH10104075A JPH10104075A (en) | 1998-04-24 |
| JP3501907B2 true JP3501907B2 (en) | 2004-03-02 |
Family
ID=17291168
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP25632996A Expired - Fee Related JP3501907B2 (en) | 1996-09-27 | 1996-09-27 | Color identification device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3501907B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2007110965A1 (en) * | 2006-03-29 | 2007-10-04 | Fujitsu Limited | Color pattern extracting device and color pattern extracting program |
| JP4977189B2 (en) * | 2009-10-28 | 2012-07-18 | 株式会社東芝 | Image processing apparatus and image processing method |
-
1996
- 1996-09-27 JP JP25632996A patent/JP3501907B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH10104075A (en) | 1998-04-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8139852B2 (en) | Color classification method, color recognition method, color classification apparatus, color recognition apparatus, color recognition system, computer program, and recording medium | |
| US9633278B2 (en) | Object identification device, method, and storage medium | |
| CN111898520B (en) | Method, device, computer-readable medium and electronic device for identifying authenticity of certificate | |
| CN109033308A (en) | A kind of image search method and device | |
| US10866984B2 (en) | Sketch-based image searching system using cell-orientation histograms and outline extraction based on medium-level features | |
| JP2002268864A (en) | Precise printing of owner sign patterns and colors | |
| US8023742B2 (en) | Local image descriptors using linear discriminant embedding | |
| CN116778503A (en) | A seal authenticity identification method and system based on OCR recognition | |
| CN109241970B (en) | Urine test method, mobile terminal and computer readable storage medium | |
| WO2018189962A1 (en) | Object recognition device, object recognition system, and object recognition method | |
| Istiadi et al. | Identification of tempe fermentation maturity using principal component analysis and k-nearest neighbor | |
| CN118334672A (en) | Electronic price tag recognition method and device | |
| JP3501907B2 (en) | Color identification device | |
| Graf et al. | Robust recognition of faces and facial features with a multi-modal system | |
| CN113095147A (en) | Skin area detection method, system, image processing terminal and storage medium | |
| JP2012185810A (en) | Image processing system and image processing program | |
| JP3708383B2 (en) | Pattern recognition method and pattern recognition apparatus | |
| JPH07168910A (en) | Document layout analysis device and document format identification device | |
| JP2001014465A (en) | Object recognition method and object recognition device | |
| CN112734767B (en) | Extraction method, device, equipment and medium based on pathological image tissue region | |
| JP2001034763A (en) | Document image processing apparatus, document title extracting method and document tag information providing method | |
| He et al. | Colour map classification for archive documents | |
| Zuraiyah et al. | Quran Tajweed Extraction and Segmentation Based on HSV Color Space Model | |
| CN119889247A (en) | Refreshing method for driving electronic display device image | |
| JP2000242784A (en) | Object recognition method and object recognition device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20031203 |
|
| S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081212 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081212 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20091212 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20091212 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101212 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111212 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111212 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121212 Year of fee payment: 9 |
|
| LAPS | Cancellation because of no payment of annual fees |