Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP3240570B2 - Color image binarization processing device - Google Patents
[go: Go Back, main page]

JP3240570B2 - Color image binarization processing device - Google Patents

Color image binarization processing device

Info

Publication number
JP3240570B2
JP3240570B2 JP12413792A JP12413792A JP3240570B2 JP 3240570 B2 JP3240570 B2 JP 3240570B2 JP 12413792 A JP12413792 A JP 12413792A JP 12413792 A JP12413792 A JP 12413792A JP 3240570 B2 JP3240570 B2 JP 3240570B2
Authority
JP
Japan
Prior art keywords
pixel
hue
binarization
threshold value
binary
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
JP12413792A
Other languages
Japanese (ja)
Other versions
JPH05298433A (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.)
Omron Corp
Original Assignee
Omron Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Omron Corp filed Critical Omron Corp
Priority to JP12413792A priority Critical patent/JP3240570B2/en
Publication of JPH05298433A publication Critical patent/JPH05298433A/en
Application granted granted Critical
Publication of JP3240570B2 publication Critical patent/JP3240570B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Input (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Electric Connection Of Electric Components To Printed Circuits (AREA)
  • Image Analysis (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、はんだ検査機や知能
ロボットなどにおいて、対象物を撮像して得られたカラ
ー入力画像を処理して認識などを行うための技術に関連
し、殊にこの発明は、カラー入力画像を、そのカラー入
力画像より算出した2値化しきい値により2値化処理し
て2値画像を生成するカラー画像の2値化処理装置に関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a technique for processing and recognizing a color input image obtained by imaging an object in a solder inspection machine, an intelligent robot, and the like. The present invention relates to a color image binarization apparatus that generates a binary image by binarizing a color input image with a binarization threshold value calculated from the color input image.

【0002】[0002]

【従来の技術】例えばはんだ付けの良否を検査するはん
だ検査機として、図25に示すように、被検査基板1の
上方位置にカラーテレビカメラ4と、検査位置に対して
異なる仰角の位置に異なる色相光(例えば赤色光,緑色
光,青色光)を発する円環状の光源5R,5G,5Bと
を設置した構成のものが存在する。
2. Description of the Related Art As shown in FIG. 25, for example, as a solder inspection machine for inspecting the quality of soldering, a color television camera 4 is located above a substrate 1 to be inspected, and a different elevation angle with respect to the inspection position. There is a configuration in which annular light sources 5R, 5G, and 5B that emit hue light (for example, red light, green light, and blue light) are installed.

【0003】このはんだ検査機は、被検査基板1に対し
各光源5R,5G,5Bより赤色光,緑色光,青色光を
同時に照射し、部品2のはんだ付け部位3の表面で反射
した各色相光をカラーテレビカメラ4で観測するもので
ある。このテレビカメラ4により得られた画像は画像処
理装置6に取り込まれ、前記はんだ付け部位3の曲面性
状に応じた撮像パターンを色相毎に2値化処理すること
により三原色の色相パターンを求めた後、各色相パター
ンを基準パターンと照合してはんだ付け部位3のはんだ
付けの良否を判別する。
This solder inspection machine simultaneously irradiates the substrate 1 to be inspected with red light, green light and blue light from the light sources 5R, 5G and 5B, and reflects each hue reflected on the surface of the soldering portion 3 of the component 2. The light is observed by the color television camera 4. The image obtained by the television camera 4 is taken into the image processing device 6, and an image pattern corresponding to the curved surface property of the soldering portion 3 is binarized for each hue to obtain a hue pattern of three primary colors. Then, each hue pattern is compared with a reference pattern to determine the quality of the soldering at the soldering portion 3.

【0004】[0004]

【発明が解決しようとする課題】ところで前記被検査基
板1の表面,部品2の表面,部品2の表面に表された文
字などは固有の色を有し、それらの色がはんだ付け部位
3の反射光像と強度は異なるが色相が共通する場合があ
る。またテレビカメラ4からのカラー入力画像に色むら
が生じ、はんだ付け部位3の画像部分以外に、例えば赤
っぽい部分や青っぽい部分などが混在することもある。
By the way, the surface of the substrate 1 to be inspected, the surface of the component 2 and the characters displayed on the surface of the component 2 have unique colors. Although the intensity is different from that of the reflected light image, the hue may be common. Further, the color input image from the television camera 4 may have color unevenness, and for example, a reddish portion, a bluish portion, or the like may be present in addition to the image portion of the soldering portion 3.

【0005】このようなカラー入力画像を色相毎に2値
化処理して各色相パターンを生成したとき、各色相パタ
ーンにはんだ付け部位3だけでなく、それ以外の部位の
パターンが混在する虞があり、はんだ付けの良否を正し
く判別するのが困難となる。またカラー入力画像を2値
化処理する際、従来はカラー入力画像とそのカラー入力
画像を2値化して得た2値画像とを比較しつつ最適な2
値化しきい値を決定しており、これがため最適な2値化
しきい値を得るのに多大の手数と時間とが必要になると
いう問題もある。
When such a color input image is binarized for each hue to generate each hue pattern, there is a possibility that not only the soldering portion 3 but also the patterns of other portions are mixed in each hue pattern. This makes it difficult to correctly determine the quality of soldering. In addition, when a color input image is subjected to a binarization process, conventionally, an optimal binary image is compared while comparing a color input image with a binary image obtained by binarizing the color input image.
The threshold for the binarization is determined, so that it takes a lot of trouble and time to obtain the optimal threshold for the binarization.
There is also a problem that.

【0006】この発明は、上記問題に着目してなされた
もので、カラー入力画像中に対象とする部位と色相が共
通する部位や色むら部分が混在しても、最適な2値化し
きい値を自動設定して対象とする部位のみの色相パター
ンを抽出することが可能なカラー画像の2値化処理装置
を提供することを目的とする。
The present invention has been made in view of the above-mentioned problem. Even when a color input image includes a portion having a common hue and a color hue, the optimum binarization threshold value is obtained. It is an object of the present invention to provide a color image binarization processing device capable of automatically setting a color pattern and extracting a hue pattern of only a target portion.

【0007】[0007]

【課題を解決するための手段】請求項1にかかる発明
は、カラー入力画像を、そのカラー入力画像より算出し
た2値化しきい値により2値化処理して2値画像を生成
する2値化処理装置であって、前記2値化しきい値の算
出対象とするカラー入力画像を構成する画素を抽出する
画素抽出手段と、前記画素抽出手段で抽出された各画素
の画素データから2値化しきい値を算出する2値化しき
い値算出手段と、前記2値化しきい値算出手段で算出さ
れた2値化しきい値によりカラー入力画像を2値化処理
して2値画像を生成する2値画像生成手段とを有する。
前記画素抽出手段は、前記カラー入力画像を構成する各
画素の画素データを入力して画素毎に各色相の強度を計
測する計測手段と、各色相の強度についての条件を設定
するための条件設定手段と、前記計測手段で計測された
各色相の強度が前記条件設定手段により設定された条件
を満たす画素のみを抽出してその画素データを前記2値
化しきい値算出手段へ出力する条件判別手段とを備えて
いる。
According to a first aspect of the present invention, there is provided a binarization process for binarizing a color input image with a binarization threshold value calculated from the color input image to generate a binary image. A processing device, comprising: a pixel extraction unit for extracting pixels constituting a color input image for which the binarization threshold is calculated; and a binarization threshold from pixel data of each pixel extracted by the pixel extraction unit. A binary threshold value calculating means for calculating a value, and a binary image for generating a binary image by subjecting the color input image to a binary processing using the binary threshold value calculated by the binary threshold value calculating means Generating means.
The pixel extraction unit inputs pixel data of each pixel constituting the color input image and measures the intensity of each hue for each pixel, and a condition setting for setting a condition for the intensity of each hue. Means for extracting only pixels whose intensity of each hue measured by the measuring means satisfies the condition set by the condition setting means, and outputting the pixel data to the binary threshold calculating means And

【0008】[0008]

【0009】また請求項2の発明にかかるカラー画像の
2値化処理装置は、前記カラー入力画像を構成する各画
素の画素データを入力して画素毎に各色相の強度を計測
する第1の計測手段と、前記カラー入力画像を構成する
各画素の画素データを入力して画素毎に明るさを計測す
る第2の計測手段と、前記第1の計測手段により計測さ
れた画素毎の色相の強度から第1の2値化しきい値を
出する第1のしきい値算出手段と、前記第2の計測手段
により計測された画素毎の明るさから第2の2値化しき
い値を算出する第2のしきい値算出手段と、2値化処理
の対象とする色相を指定する指定手段と、前記指定手段
により指定された色相にかかる第1の2値化しきい値と
第2の2値化しきい値とを用いて2値化処理を行って2
値画像を生成する2値画像生成手段とを備えている。
According to a second aspect of the present invention, there is provided a color image binarization processing apparatus for inputting pixel data of each pixel constituting the color input image and measuring the intensity of each hue for each pixel. Measuring means, second measuring means for inputting pixel data of each pixel constituting the color input image and measuring brightness for each pixel, and hue of each pixel measured by the first measuring means . First threshold value calculating means for calculating a first binary threshold value from the intensity, and second binary value conversion from the brightness of each pixel measured by the second measuring means. A second threshold value calculating means for calculating a threshold value, a specifying means for specifying a hue to be subjected to the binarization processing, a first binary threshold value for the hue specified by the specifying means, A binarization process is performed using the second binarization threshold value to obtain 2
A binary image generating means for generating a value image.

【0010】[0010]

【作用】請求項1の発明にかかる2値化処理装置では、
各色相の強度につき条件設定を行ってカラー入力画像を
取り込み、そのカラー入力画像を構成する各画素の画素
データより各色相の強度を計測する。その計測値が前記
設定条件を満たす画素のみが抽出され、その抽出された
各画素の画素データのみを用いて2値化しきい値が算出
される。
In the binarization processing device according to the first aspect of the present invention,
A color input image is captured by setting conditions for the intensity of each hue, and the intensity of each hue is measured from pixel data of each pixel constituting the color input image. Only pixels whose measured values satisfy the set conditions are extracted, and a binarization threshold is calculated using only the extracted pixel data of each pixel.

【0011】[0011]

【0012】請求項2の発明にかかる2値化処理装置で
は、カラー入力画像が取り込まれると、そのカラー入力
画像を構成する各画素の画素データより各色相の強度が
計測され、画素毎の色相の強度から第1の2値化しきい
が算出される。またカラー入力画像を構成する各画素
の画素データより画素毎に明るさが計測され、画素毎の
明るさから第2の2値化しきい値が算出される。2値化
処理の対象とする色相が指定されると、その指定された
色相にかかる第1の2値化しきい値と第2の2値化しき
い値とを用いて2値化処理を行われて2値画像が生成さ
れる。
[0012] In the binarization processing apparatus according to a second aspect of the invention, when the color input image is captured, the color intensity than the pixel data of each pixel constituting the color input image is measured, the hue of each pixel Binarization threshold from the intensity of
A value is calculated. Further, the brightness is measured for each pixel from the pixel data of each pixel forming the color input image, and a second binarization threshold is calculated from the brightness for each pixel. When the hue to be binarized is specified, the binarization is performed using the first and second binarization thresholds for the specified hue. Thus, a binary image is generated.

【0013】いずれの2値化処理装置についても、カラ
ー画像中に対象とする部位と色相が共通する部位の画像
部分や色むら部分が混在していても、色相の強度の違い
により、対象とする部位のみの色相パターンが抽出され
る。
In any of the binarization processing devices, even if an image portion and an uneven color portion of a portion having the same hue as the target portion are mixed in the color image, the difference between the target portion and the target portion occurs due to the difference in hue intensity. The hue pattern of only the part to be extracted is extracted.

【0014】[0014]

【実施例】図1は、この発明の第1実施例にかかるカラ
ー画像の2値化処理装置10の概略構成を示す。この2
値化処理装置10は、画素抽出部11としきい値算出部
12と2値画像生成部13とを有し、カラーテレビカメ
ラ14の出力が前記画素抽出部11に、また2値画像生
成部13の出力がCRTなどの表示部15に、それぞれ
接続される。
FIG. 1 shows a schematic configuration of a color image binarization processing apparatus 10 according to a first embodiment of the present invention. This 2
The binarization processing device 10 includes a pixel extraction unit 11, a threshold value calculation unit 12, and a binary image generation unit 13. The output of the color television camera 14 is supplied to the pixel extraction unit 11, and the binary image generation unit 13 Are connected to a display unit 15 such as a CRT.

【0015】前記カラーテレビカメラ14は、所定の光
源による照明下で対象物を撮像してカラー入力画像を生
成する。はんだ検査機であれば、前記対象物は被検査基
板上の部品であり、その照明源は例えば赤色光,緑色
光,青色光を発する円環状光源(図25参照)である。
前記カラー入力画像を構成する各画素の画素データは三
原色、すなわち赤色,緑色,青色の各輝度データR,
G,Bより成る。
The color television camera 14 captures an image of an object under illumination by a predetermined light source to generate a color input image. In the case of a solder inspection machine, the object is a component on a substrate to be inspected, and its illumination source is, for example, an annular light source that emits red light, green light, and blue light (see FIG. 25).
The pixel data of each pixel constituting the color input image is three primary colors, that is, red, green, and blue luminance data R,
G and B.

【0016】前記画素抽出部11は2値化しきい値の算
出対象とするカラー入力画像を構成する画素を抽出す
る。前記しきい値算出部12は画素抽出部11で抽出さ
れた各画素の画素データから最適な2値化しきい値を算
出する。前記2値画像生成部13はしきい値算出部12
で算出された2値化しきい値によりカラー入力画像を2
値化処理して2値画像を生成する。
The pixel extracting section 11 extracts pixels constituting a color input image for which a binarization threshold is to be calculated. The threshold value calculation unit 12 calculates an optimal binarization threshold value from the pixel data of each pixel extracted by the pixel extraction unit 11. The binary image generation unit 13 includes a threshold value calculation unit 12
The color input image is divided into two by the binarization threshold value calculated in
The binarization process is performed to generate a binary image.

【0017】前記画素抽出部11は、色相度計算部1
6,条件設定部17,条件判定部18,ゲート部19を
含む。前記色相度計算部16は、前記カラー入力画像を
走査し、走査に従って読み込まれる各画素の画素データ
(赤色,緑色,青色の各輝度データR,G,B)を用い
てつぎの(1) 〜(3) 式の演算を実行し、各画素毎に各色
相の強度(以下、「色相度」という)r,g,bを算出
する。
The pixel extraction unit 11 includes a hue degree calculation unit 1
6, a condition setting unit 17, a condition determination unit 18, and a gate unit 19. The hue degree calculator 16 scans the color input image, and uses the pixel data (red, green, and blue luminance data R, G, and B) of each pixel read in accordance with the scanning to perform the following (1) to (1). The calculation of equation (3) is executed to calculate the intensity (hereinafter, referred to as “hue degree”) r, g, and b of each hue for each pixel.

【0018】[0018]

【数1】 (Equation 1)

【0019】[0019]

【数2】 (Equation 2)

【0020】[0020]

【数3】 (Equation 3)

【0021】これら色相度r,g,bは人間の視覚にお
ける三原色の認識度合いに比例し、例えば色相度rが0
以下であれば赤は認識されず、同様に色相度gが0以下
であれば緑、色相度bが0以下であれば青は認識されな
い。
The hue degrees r, g, and b are proportional to the degree of recognition of the three primary colors in human vision.
If the hue degree g is 0 or less, green is not recognized, and if the hue degree b is 0 or less, blue is not recognized.

【0022】前記条件設定部17は例えばキーボードに
より構成され、しきい値計算の対象とする各画素の各色
相度r,g,bについての条件、すなわち各色相度r,
g,bの範囲を上限値と下限値とで設定するためのもの
である。なおこの条件の設定はキーボードを操作して値
をキー入力する方式に限らず、例えばファイルから読み
出すような方式であってもよい。
The condition setting section 17 is composed of, for example, a keyboard, and sets conditions for each hue degree r, g, b of each pixel to be subjected to threshold value calculation, that is, each hue degree r,
This is for setting the range of g and b by the upper limit and the lower limit. The setting of the condition is not limited to a method of operating a keyboard to input a value by a key, but may be, for example, a method of reading from a file.

【0023】図2には、条件設定のためのキー入力操作
の手順がステップ1(図中、「ST1」)〜ステップ1
8で示してある。同図のステップ1では、表示部15に
赤色の色相度rの上限値TH(r)1 をキー入力するよ
う案内文字(メッセージ)が表示される。つぎのステッ
プ2で上限値TH(r)1 がキー入力されると、そのキ
ー入力データが取り込まれてRAMなどの記憶手段に記
憶される(ステップ3)。
FIG. 2 shows a procedure of a key input operation for setting a condition from step 1 (“ST1” in the figure) to step 1
The reference numeral 8 is used. In step 1 of the figure, a guidance character (message) is displayed on the display unit 15 so as to input the upper limit value TH (r) 1 of the red hue degree r by key. When the upper limit value TH (r) 1 is inputted by a key in the next step 2, the key input data is fetched and stored in a storage means such as a RAM (step 3).

【0024】つぎにステップ4で表示部15に赤色の色
相度rの下限値TH(r)2 をキー入力するよう案内文
字が表示され、つぎのステップ5でその値がキー入力さ
れると、そのキー入力データが取り込まれて前記記憶手
段に記憶される(ステップ6)。
Next, at step 4, a guide character is displayed on the display unit 15 so as to input a lower limit value TH (r) 2 of the red hue degree r by a key. At step 5, the value is input by a key. The key input data is captured and stored in the storage means (step 6).

【0025】以下、ステップ7〜ステップ12で緑色の
色相度gの上限値TH(g)1 および下限値TH(g)
2 が、ステップ13〜ステップ18で青色の色相度bの
上限値TH(b)1 および下限値TH(b)2 が、同様
の手順でキー入力されかつ記憶される。
The upper limit TH (g) 1 and the lower limit TH (g) of the green hue g in steps 7 to 12 will be described below.
In steps 13 to 18, the upper limit value TH (b) 1 and the lower limit value TH (b) 2 of the blue hue b are key-inputted and stored in the same procedure.

【0026】もし赤色の画像部分を2値化したい場合
は、赤色の色相度rについての上限値TH(r)1
「67」、下限値TH(r)2 を「−33」に、緑色の
色相度gについての上限値TH(g)1 を「0」、下限
値TH(g)2 を「−33」に、青色の色相度bについ
ての上限値TH(b)1 を「0」、下限値TH(b)2
を「−33」に、それぞれ設定する。
If it is desired to binarize the red image portion, the upper limit value TH (r) 1 for the red hue r is set to "67", the lower limit value TH (r) 2 is set to "-33", and The upper limit value TH (g) 1 of the hue degree g is “0”, the lower limit value TH (g) 2 is “−33”, and the upper limit value TH (b) 1 of the blue hue degree b is “0”. , Lower limit value TH (b) 2
Is set to “−33”.

【0027】図1に戻って、条件判定部18は、前記色
相度計算部16で算出された各画素の各色相度r,g,
bが前記条件設定部17で設定された条件を満たすか否
か、すなわち赤色の色相度rが上限値TH(r)1 と下
限値TH(r)2 とで定められる範囲に、緑色の色相度
gが上限値TH(g)1 と下限値TH(g)2 とで定め
られる範囲に、青色の色相度bが上限値TH(b)1
下限値TH(b)2 とで定められる範囲に、それぞれ含
まれるか否かを判定する。
Returning to FIG. 1, the condition judging section 18 calculates the hue degrees r, g, and h of each pixel calculated by the hue degree calculating section 16.
Whether or not b satisfies the condition set by the condition setting unit 17, that is, the green hue falls within a range where the red hue degree r is defined by an upper limit value TH (r) 1 and a lower limit value TH (r) 2. In a range where the degree g is defined by the upper limit value TH (g) 1 and the lower limit value TH (g) 2 , the hue degree b of blue is defined by the upper limit value TH (b) 1 and the lower limit value TH (b) 2. It is determined whether each of the ranges is included.

【0028】もしすべての条件を満たしておれば、条件
判定部18はゲート部19を開き、またもしいずれか条
件を満たしていなければ、ゲート部19を閉じる。この
ゲート部19にはカラー入力画像を構成する各画素の画
素データが入力されており、ゲート部19の開閉により
前記条件を満たす画素のみが抽出され、その画素データ
が前記しきい値算出部12へ出力される。なお上記色相
度計算部16,条件判定部18および,ゲート部19は
ソフト的にその機能を実現してもよく、またハード構成
により実現することもできる。
If all the conditions are satisfied, the condition judging unit 18 opens the gate unit 19, and if any of the conditions is not satisfied, closes the gate unit 19. The pixel data of each pixel constituting the color input image is input to the gate unit 19, and only the pixels satisfying the above conditions are extracted by opening and closing the gate unit 19, and the pixel data is used as the threshold value calculation unit 12 Output to The functions of the hue degree calculation unit 16, the condition determination unit 18, and the gate unit 19 may be realized by software, or may be realized by a hardware configuration.

【0029】図3は、2値画像を生成するための上記2
値化処理装置10の制御手順をステップ1〜ステップ1
7で示す。まずステップ1で条件設定部17により各色
相度r,g,bについての上限値および下限値が設定さ
れると、つぎのステップ2でカラーテレビカメラ14よ
りカラー入力画像が2値化処理装置10に取り込まれ
る。画像抽出部11の色相度計算部16ではそのカラー
入力画像の走査を開始し、まずX=0,Y=0の位置の
画素の画素データがサンプリングされ、赤色,緑色,青
色の各色相度r,g,bが算出される(ステップ3〜
5)。
FIG. 3 is a diagram showing the above-mentioned two steps for generating a binary image.
Step 1 to Step 1
Indicated by 7. First, in step 1, the condition setting unit 17 sets the upper and lower limits for each of the hue degrees r, g, and b. In step 2, the color TV camera 14 converts the color input image from the binary image data into It is taken in. The hue degree calculation unit 16 of the image extraction unit 11 starts scanning the color input image, and first, pixel data of the pixel at the position of X = 0, Y = 0 is sampled, and each of the hue degrees r of red, green, and blue is sampled. , G and b are calculated (steps 3 to 3).
5).

【0030】つぎのステップ6で条件判定部18は、各
色相度r,g,bがTH(r)1 >r>TH(r)2
TH(g)1 >g>TH(g)2 :TH(b)1 >b>
TH(b)2 の各条件を満たすか否かをそれぞれ判定す
る。
In the next step 6, the condition judging section 18 determines that each of the hue degrees r, g, b is TH (r) 1 >r> TH (r) 2 ,
TH (g) 1 >g> TH (g) 2 : TH (b) 1 >b>
It is determined whether each condition of TH (b) 2 is satisfied.

【0031】もしすべの条件を満たしていれば、ステッ
プ7〜ステップ9の各判定が「YES」となってステッ
プ10へ進み、X=0,Y=0の位置の画素の画素デー
タがゲート部19を通過してしきい値算出部12へ出力
される。もしいずれか条件を満たしていなければ、ステ
ップ7〜ステップ9のいずれか判定が「NO」となり、
その画素データはゲート部19を通過せず、ステップ1
0はスキップされる。
If all the conditions are satisfied, the determinations in steps 7 to 9 are "YES" and the process proceeds to step 10, where the pixel data of the pixel at the position of X = 0, Y = 0 is stored in the gate unit. 19, and is output to the threshold value calculation unit 12. If any one of the conditions is not satisfied, one of the determinations in Steps 7 to 9 becomes “NO”, and
The pixel data does not pass through the gate unit 19, and
0 is skipped.

【0032】つぎにステップ11でつぎのX座標位置
(この場合X=1)の画素を指定して上記と同様の手順
を実行するもので、同じ水平走査ライン上の全ての画素
(1水平走査ライン上の画素数を256とする)につい
ての処理が完了すると、ステップ12の判定が「YE
S」となってつぎの行の水平走査ライン上の各画素につ
いての処理へと移行する(ステップ13)。
Next, at step 11, the same procedure as described above is executed by designating the pixel at the next X coordinate position (X = 1 in this case), and all the pixels (one horizontal scan) on the same horizontal scan line are executed. When the processing for (the number of pixels on the line is 256) is completed, the determination in step 12 is “YE
S ", and shifts to processing for each pixel on the next horizontal scanning line (step 13).

【0033】全ての水平走査ライン(水平走査ライン数
を256とする)についての処理が完了すると、ステッ
プ14の判定が「YES」となってステップ15へ進
み、しきい値算出部12が前記画素抽出部11で抽出さ
れた各画素の画素データから最適な2値化しきい値を算
出する。つぎにステップ16で2値画像生成部13がこ
の2値化しきい値を用いてカラー入力画像を2値化処理
して2値画像を生成し、この2値画像が表示部15に表
示される(ステップ17)。
When the processing for all the horizontal scanning lines (the number of horizontal scanning lines is 256) is completed, the determination in step 14 becomes "YES" and the process proceeds to step 15, where the threshold value calculation unit 12 An optimum binarization threshold is calculated from the pixel data of each pixel extracted by the extraction unit 11. Next, in step 16, the binary image generation unit 13 binarizes the color input image using the binarization threshold to generate a binary image, and the binary image is displayed on the display unit 15. (Step 17).

【0034】図4は、前記しきい値算出部12の具体的
な回路構成例を示す。図示例のしきい値算出部12は、
画質の評価値から最適な2値化しきい値を算出する方式
のものであるが、この方式の詳細は特開昭64−515
86号公報に記載されており、ここでは全体構成とその
原理を概説する。
FIG. 4 shows an example of a specific circuit configuration of the threshold value calculator 12. In the illustrated example, the threshold value calculation unit 12
This method calculates an optimal binarization threshold value from an image quality evaluation value. The details of this method are described in JP-A-64-515.
No. 86, here, the overall configuration and its principle are outlined.

【0035】図示例のしきい値算出部12は、マイクロ
コンピュータ20を制御主体とし、ウィンドウ走査部2
1,非合法パターン検出部22,非合法パターンヒスト
グラム生成部23,明るさヒストグラム生成部24,画
質ヒストグラム生成部25,ヒストグラム平滑処理部2
6,最適しきい値探索部27を具備する。
In the illustrated example, the threshold value calculating section 12 is mainly controlled by a microcomputer 20 and has a window scanning section 2.
1, illegal pattern detection unit 22, illegal pattern histogram generation unit 23, brightness histogram generation unit 24, image quality histogram generation unit 25, histogram smoothing processing unit 2
6, an optimum threshold value search unit 27 is provided.

【0036】ウィンドウ走査部21は、マイクロコンピ
ュータ20にCPUバス28を介して接続されたアドレ
スジェネレータ29と、このアドレスジェネレータ29
に画像バス30を介して接続された画像メモリ31と、
前記画像バス30のデータバス33に接続されたFIF
O(first-in first-out )方式の第1のシフトレジス
タ35および第1群のラッチ回路36〜39と、この最
終段のラッチ回路39に接続された同じFIFO方式の
第2のシフトレジスタ40および第2群のラッチ回路4
1〜44とから構成される。
The window scanning unit 21 includes an address generator 29 connected to the microcomputer 20 via a CPU bus 28, and an address generator 29.
An image memory 31 connected to the image bus 30 via an image bus 30;
FIF connected to the data bus 33 of the image bus 30
A first shift register 35 of the O (first-in first-out) system and a first group of latch circuits 36 to 39, and a second shift register 40 of the same FIFO system connected to the last-stage latch circuit 39 And the second group of latch circuits 4
1 to 44.

【0037】図示例のウィンドウ走査部21は、画像メ
モリ31に書き込まれたカラー入力画像、すなわち前記
画素抽出部11のゲート部19を通過したカラー入力画
像上に、図5に示すような矩形状のウィンドウ50を設
定してラスタ走査するためのものであって、このウィン
ドウ50内の画像につき所定の画素A0 〜A7 の画素デ
ータd0 〜d7 が同時に取り出される。なお図中、×印
は処理対象外の画素であり、また画素抽出部11で抽出
されていない画素も処理対象外の画素として取り扱う。
The window scanning unit 21 in the illustrated example forms a rectangular image as shown in FIG. 5 on the color input image written in the image memory 31, that is, the color input image that has passed through the gate unit 19 of the pixel extracting unit 11. set the window 50 be used to raster scan, the pixel data d 0 to d 7 of predetermined pixels a 0 to a 7 per image in the window 50 is taken out at the same time. In the figure, the crosses indicate pixels that are not to be processed, and pixels that have not been extracted by the pixel extraction unit 11 are also treated as pixels that are not to be processed.

【0038】アドレスジェネレータ29は画像メモリ3
1の各画素のアドレスを順次生成して、そのアドレスに
対応する画素の画素データを画像バス30を介して第1
のシフトレジスタ35へ出力させる。なお画像バス30
のうち、アドレスバス31はアドレスを、データバス3
3は画素データを、コントロールバス33はアドレスス
トローブ信号やリード・ライト信号を、それぞれ伝送す
る。
The address generator 29 is an image memory 3
1 is sequentially generated, and the pixel data of the pixel corresponding to the address is first generated via the image bus 30.
To the shift register 35. The image bus 30
Of these, an address bus 31 stores an address and a data bus 3
3 transmits pixel data, and the control bus 33 transmits an address strobe signal and a read / write signal.

【0039】第1のシフトレジスタ35は画像メモリ3
1の横方向の画素数をn(図5参照)とすると、このn
より第1群のラッチ回路36〜39の段数を差し引いた
段数(n−4)をもっており、この段数分だけ画素デー
タの出力を遅延させる。第1群の4段のラッチ回路36
〜39は全体としてシフトレジスタの動作を行い、最終
段のラッチ回路39の出力が第2のシフトレジスタ40
へ出力される。この第2のシフトレジスタ40も(n−
4)の段数を有し、この段数分だけ画素データの出力を
遅延させて第2群の4段のラッチ回路41〜44へ伝え
る。
The first shift register 35 stores the image memory 3
Assuming that the number of pixels in the horizontal direction of 1 is n (see FIG. 5), this n
The number of stages of the first group of latch circuits 36 to 39 is subtracted from the number of stages (n−4), and the output of pixel data is delayed by the number of stages. First group of four-stage latch circuits 36
To 39 perform the operation of the shift register as a whole, and the output of the final-stage latch circuit 39 is the second shift register 40.
Output to This second shift register 40 is also (n-
4) The output of the pixel data is delayed by the number of stages and transmitted to the second group of four-stage latch circuits 41 to 44.

【0040】このようにして第1群および第2群の各ラ
ッチ回路36〜39,41〜44と第2のシフトレジス
タ40とから同時に画素データが取り出されるもので、
第1群のラッチ回路36〜38の各出力により前記ウィ
ンドウ50内の画素A0 〜A2 の画素データd0 〜d2
が与えられ、また第2のシフトレジスタ40および第2
群のラッチ回路41〜44の各出力によりウィンドウ5
0内の画素A3 〜A7の画素データd3 〜d7 が与えら
れる。
In this way, pixel data is simultaneously extracted from the first and second group of latch circuits 36 to 39, 41 to 44 and the second shift register 40.
Pixel data d 0 to d 2 pixels A 0 to A 2 in the window 50 by the outputs of the first group of latch circuits 36 to 38
And second shift register 40 and second shift register 40
The output of each of the group latch circuits 41 to 44 causes a window 5
Pixel data d 3 to d 7 of the pixel A 3 to A 7 in the 0 is given.

【0041】各画素A0 〜A7 の画素データd0 〜d7
は非合法パターン検出部22へ出力されると共に、特定
画素A1 の画素データd1 については非合法パターンヒ
ストグラム生成部23および明るさヒストグラム生成部
24にも出力される。非合法パターン検出部22は、ウ
ィンドウ50内の画像が合法パターンであるのか、非合
法パターンであるのかを判別するためのものであって、
それが非合法パターンである場合には「1」のフラグを
出力し、合法パターンである場合には「0」のフラグを
出力する。
The pixel data d 0 to d 7 of each pixel A 0 to A 7
Together are output to illegal pattern detection unit 22, is also output to the illegal pattern histogram generation unit 23 and the brightness histogram generation unit 24 for the pixel data d 1 specific pixel A 1. The illegal pattern detection unit 22 is for determining whether the image in the window 50 is a legal pattern or an illegal pattern,
If it is an illegal pattern, a flag of "1" is outputted, and if it is a legal pattern, a flag of "0" is outputted.

【0042】この非合法パターン検出部22は、特定の
画素A1 の画素データd1 をしきい値として前記ウィン
ドウ50の各画素A0 およびA2 〜A7 の画素データd
0 およびd2 〜d7 を2値化するためのものであって、
各画素データdi (ただしi=0,2,3,‥‥,7)
がdi ≧d1 のときは「1」、di <d1 のときは
「0」の各2値データをそれぞれ出力する。この場合、
画素データd0 〜d7 として2値化したい色相の輝度デ
ータR,G,Bを用いてもよく、また各輝度データの合
計値(R+G+B)を用いてもよい。なお特定画素A1
の2値データは常に「1」である。
[0042] The illegal pattern detection unit 22, the pixel data d of each pixel A 0 and A 2 to A 7 of the window 50 the pixel data d 1 specific pixel A 1 as a threshold
For binarizing 0 and d 2 to d 7 ,
Each pixel data d i (i = 0, 2, 3, ‥‥, 7)
There "1" when the d i ≧ d 1, when the d i <d 1 output the respective binary data of "0". in this case,
As the pixel data d 0 to d 7 , luminance data R, G, and B of a hue to be binarized may be used, or a total value (R + G + B) of the luminance data may be used. Note that the specific pixel A 1
Is always "1".

【0043】図6は、ウィンドウ50内の各画素A0
7 の画素データd0 〜d7 が2値化されて2値データ
0 〜f7 に変換される過程を示す。この2値データf
i (i=0,2,3,‥‥,7)は論理演算によってウ
ィンドウ50内の画像が非合法パターンであるか否かが
判断され、非合法パターンであれば「1」のフラグを、
合法パターンであれば「0」のフラグを、それぞれ出力
する。ここで合法パターンとは滑らかな画像上に頻繁に
現れる図7(1)〜(6)に示すような2値パターンを
意味し、また非合法パターンとは滑らかでない画像上に
頻繁に現れる図8に示すような2値パターンを意味す
る。なお図7,8中、斜線部は「1」の2値データをも
つ画素を示し、図8の2値パターンでは「1」の画素領
域の内側に「0」の孔部51が生じている。
FIG. 6 shows each of the pixels A 0 to A 0 in the window 50.
Showing a process of pixel data d 0 to d 7 of A 7 is converted is binarized into binary data f 0 ~f 7. This binary data f
i (i = 0, 2, 3,..., 7) is determined by a logical operation whether or not the image in the window 50 is an illegal pattern. If the pattern is an illegal pattern, a flag of “1” is set.
If it is a legal pattern, a flag of "0" is output. Here, the legal pattern means a binary pattern frequently appearing on a smooth image as shown in FIGS. 7 (1) to 7 (6), and the illegal pattern frequently appears on an unsmooth image in FIG. Means a binary pattern as shown in FIG. 7 and 8, hatched portions indicate pixels having binary data of "1". In the binary pattern of FIG. 8, a hole 51 of "0" is formed inside the pixel region of "1". .

【0044】上記により非合法パターンが検出されて
「1」のフラグが出力される都度、非合法パターンヒス
トグラム生成部23はこのフラグの発生度数を計数し
て、非合法パターンのヒストグラムfhist(k)を生成
する。ここでfhist(k)はしきい値kにおける非合法
パターンの発生度数を意味する。
Each time an illegal pattern is detected and a flag of "1" is output as described above, the illegal pattern histogram generator 23 counts the frequency of occurrence of this flag and outputs a histogram f hist (k ). Here, f hist (k) means the frequency of occurrence of illegal patterns at the threshold value k.

【0045】また明るさヒストグラム24は、画素デー
タkの画素の発生度数を表す明るさヒストグラムhist
(k)を生成するもので、非合法パターンヒストグラム
および明るさヒストグラムの生成が完了した後、画質ヒ
ストグラム生成部25は、画質ヒストグラムq
hist(k)を生成する。この画質ヒストグラムq
hist(k)は画質の評価基準、この実施例では画質の悪
さを示す基準を与えるもので、hist(k)=0 のときは
つぎの(4) 式により、hist(k)≠0のときはつぎの
(5) 式により、それぞれ生成される。なお(4)(5)式中、
0 は定数(最大値)である。
The brightness histogram 24 is a brightness histogram hist representing the frequency of occurrence of the pixel of the pixel data k.
(K), and after the generation of the illegal pattern histogram and the brightness histogram is completed, the image quality histogram generation unit 25 sets the image quality histogram q
Generate hist (k). This image quality histogram q
hist (k) gives an image quality evaluation criterion, in this embodiment, a criterion indicating poor image quality. When hist (k) = 0, the following equation (4) is used. of
Each is generated by equation (5). In equations (4) and (5),
Q 0 is a constant (maximum value).

【0046】[0046]

【数4】 (Equation 4)

【0047】[0047]

【数5】 (Equation 5)

【0048】つぎにヒストグラム平滑処理部26は、必
要に応じて画質ヒストグラムqhist(k)を平滑化する
ためのもので、その結果、図9に示すような、平滑化さ
れた画質ヒストグラムsqhist(k)が生成される。図
9において、横軸はk(しきい値)、縦軸sq
hist(k)(画質の悪さ)であって、画質の悪さはしき
い値kopt のとき最小となっている。
[0048] Then the histogram smoothing processing section 26 is for smoothing the image quality histogram q hist (k) optionally, as a result, as shown in FIG. 9, the image quality histogram sq hist smoothed (K) is generated. In FIG. 9, the horizontal axis is k (threshold), and the vertical axis is sq.
hist (k) (bad image quality), and the bad image quality is minimum when the threshold value k opt is used.

【0049】最適しきい値探索部27は、このしきい値
opt を最適しきい値として探索し、その探索結果をC
PUバス28を通じてマイクロコンピュータ20に知ら
せる。
The optimum threshold value search section 27 searches for this threshold value k opt as an optimum threshold value, and
The microcomputer 20 is notified through the PU bus 28.

【0050】図10は、この発明の第2実施例にかかる
カラー画像の2値化処理装置60の概略構成を示す。図
示例の2値化処理装置60は、色相度計算部61,しき
い値算出部62,2値化ターゲット指定部63,しきい
値選択部64,2値画像生成部65を含んでおり、カラ
ーテレビカメラ14の出力が前記色相度計算部61に、
また前記2値画像生成部65の出力が表示部15に、そ
れぞれ接続される。
FIG. 10 shows a schematic configuration of a color image binarization processing device 60 according to a second embodiment of the present invention. The binarization processing device 60 in the illustrated example includes a hue degree calculator 61, a threshold calculator 62, a binarization target designator 63, a threshold selector 64, and a binary image generator 65. The output of the color TV camera 14 is sent to the hue degree calculator 61,
The output of the binary image generation unit 65 is connected to the display unit 15.

【0051】前記色相度計算部61は、カラーテレビカ
メラ14より入力したカラー入力画像を走査し、走査に
従って取り込まれる各画素の画素データ(赤色,緑色,
青色の各輝度データR,G,B)を用いて前記(1) 〜
(3) 式の演算を実行することにより、各画素毎に各色相
度r,g,bを算出する。これら各色相度r,g,bは
しきい値算出部62および2値画像生成部65へ与えら
れる。
The hue degree calculator 61 scans a color input image input from the color television camera 14, and stores pixel data (red, green,
The above (1) to (1) to (5) are used by using each of the blue luminance data R, G, B).
By executing the calculation of equation (3), the hue degrees r, g, and b are calculated for each pixel. These hue degrees r, g, and b are provided to the threshold value calculation unit 62 and the binary image generation unit 65.

【0052】前記しきい値算出部62は、前記色相度計
算部61より入力した画素毎の各色相度r,g,bから
色相毎に最適な2値化しきい値THR ,THG ,THB
を算出するためのもので、第1実施例と同様、画質の評
価値を求めて最適な2値化しきい値を決定する手法が用
いられる。従ってこのしきい値算出部62の構成は、図
4に示すものと同様であって、ここでは図示および説明
を省略する。
The threshold value calculating section 62 calculates optimum binarized threshold values TH R , TH G , TH for each hue from the hue degrees r, g, b for each pixel inputted from the hue degree calculating section 61. B
, And a method of obtaining an evaluation value of image quality and determining an optimal binarization threshold value is used as in the first embodiment. Therefore, the configuration of the threshold value calculation unit 62 is the same as that shown in FIG. 4, and illustration and description thereof are omitted here.

【0053】前記2値化ターゲット指定部63はキーボ
ードやマウスなどで構成され、2値化したい画像領域に
ついて、2値化処理の対象とする色相、すなわち赤色,
緑色,青色のいずれの色相であるのか、或いはそれら色
のいずれの組み合わせであるのかを指定するためのもの
である。
The binarization target designating section 63 is composed of a keyboard, a mouse, and the like, and has a hue to be binarized, that is, red, for an image area to be binarized.
This is for designating which hue of green or blue, or any combination of these colors.

【0054】前記しきい値選択部64は、前記2値化タ
ーゲット指定部63により指定された色相に対応する2
値化しきい値THを、前記しきい値算出部62に算出さ
れた2値化しきい値THR ,THG ,THB のいずれか
より選択すると共に、選択された2値化しきい値THを
2値化処理における上限値として用いるのか、または下
限値として用いるのかを設定する。
The threshold value selecting section 64 stores the two-color image data corresponding to the hue specified by the binarized target specifying section 63.
The binarization threshold TH is selected from any of the binarization thresholds TH R , TH G , and TH B calculated by the threshold calculator 62, and the selected binarization threshold TH is set to 2 Whether to use as the upper limit or the lower limit in the binarization process is set.

【0055】前記2値画像生成部65は、前記色相度計
算部61により算出されたいずれか色相度r,g,b
を、前記しきい値算出部64で選択された2値化しきい
値THで2値化処理して2値画像を生成する。
The binary image generating section 65 calculates any one of the hue degrees r, g, b calculated by the hue degree calculating section 61.
Is binarized with the binarization threshold value TH selected by the threshold value calculation unit 64 to generate a binary image.

【0056】図11は、2値画像を生成するための上記
2値化処理装置60の制御手順をステップ1〜7で示
す。まずステップ1でカラーテレビカメラ14よりカラ
ー入力画像が2値化処理装置60に取り込まれると、ま
ず色相度計算部61がカラー入力画像を走査して各画素
毎に各色相度r,g,bを算出した後、しきい値算出部
62が色相度計算部61より画素毎の各色相度r,g,
bを入力して色相毎に画質ヒストグラムを生成し、さら
に各画質ヒストグラムより最適な2値化しきい値T
R ,THG ,THB を求める(ステップ2,3)。
FIG. 11 shows steps 1 to 7 of the control procedure of the binarization processing device 60 for generating a binary image. First, in step 1, when a color input image is captured by the color television camera 14 into the binarization processing device 60, first, the hue degree calculation unit 61 scans the color input image and scans each hue degree r, g, b for each pixel. Is calculated, the threshold value calculation unit 62 calculates the hue degrees r, g,
b, an image quality histogram is generated for each hue, and an optimum binarization threshold T
H R , TH G , and TH B are obtained (steps 2 and 3).

【0057】つぎのステップ4において、図12に示す
手順に従って2値化ターゲット指定部63より2値化処
理の対象とする色相が指定されると、続くステップ5で
しきい値選択部64が図13に示す制御手順に従ってし
きい値算出部62により算出された2値化しきい値TH
R ,THG ,THB のいずれかを選択する。
In the next step 4, when the hue to be binarized is specified by the binarization target specifying section 63 in accordance with the procedure shown in FIG. 13, the binary threshold value TH calculated by the threshold value calculation unit 62 according to the control procedure shown in FIG.
Select one of R , TH G and TH B.

【0058】つぎにステップ6で2値画像生成部65
は、図14に示す制御手順に従って色相度計算部61に
より算出されたいずれか色相度r,g,bを、前記しき
い値算出部64で選択された2値化しきい値THで2値
化処理して2値画像を生成し、つぎのステップ7で表示
部15はこの2値画像を表示する。
Next, in step 6, the binary image generation unit 65
Is used to binarize any one of the hue degrees r, g, and b calculated by the hue degree calculation unit 61 in accordance with the control procedure shown in FIG. 14 with the binarization threshold value TH selected by the threshold value calculation unit 64. Processing is performed to generate a binary image, and in the next step 7, the display unit 15 displays the binary image.

【0059】図12は、2値化ターゲット指定部63に
よる指定操作の手順をステップ1〜9で示す。同図のス
テップ1では、表示部15に赤色,緑色,青色のいずれ
か色相を指定するよう案内文字が表示される。つぎのス
テップ2でキー操作により所望の色が指定されると、そ
の判定が「YES」となり、ステップ3で指定色にかか
るキー入力データが取り込まれる。
FIG. 12 shows the procedure of the designation operation by the binarized target designation section 63 in steps 1 to 9. In step 1 of the figure, a guide character is displayed on the display unit 15 so as to designate any one of red, green, and blue hues. When a desired color is designated by a key operation in the next step 2, the determination becomes "YES", and in step 3, key input data for the designated color is fetched.

【0060】つぎのステップ4は指定された色相が赤色
か否かを判定しており、その判定が「YES」であれ
ば、赤色の指定を示す赤指定フラグFr がRAMなどの
フラグ設定領域にセットされる。もし緑色が指定されれ
ばステップ6の判定が、また青色が指定されればステッ
プ8の判定が、それぞれ「YES」となり、緑色の指定
を示す緑指定フラグFgや青色の指定を示す青指定フラ
グFb がそれぞれフラグ設定領域にセットされることに
なる(ステップ7,9)。
In the next step 4, it is determined whether or not the designated hue is red. If the determination is "YES", a red designation flag Fr indicating the designation of red is set in a flag setting area such as a RAM. Is set to If it green specifies the determination in Step 6, the blue-designation indicating the determination in step 8 if blue is specified, are "YES", the green indication flag F g or blue designation indicating a green designation The flag Fb is set in the flag setting area (steps 7 and 9).

【0061】図13および図14は、前記しきい値選択
部64におけるしきい値選択の制御手順をステップ1〜
22で示す。同図のステップ1では、まず赤,緑,青の
各指定フラグFr ,Fg ,Fb のセッス数より指定色の
個数sを算出し、続くステップ2,3でその個数sが2
個か、1個か、3個または0個かを判定して、その個数
に応じて以下のステップで2値化しきい値を選択すると
共に、その2値化しきい値を2値化処理のための上限値
とするのか、下限値とするのかを決定する。
FIG. 13 and FIG. 14 show the control procedure for selecting the threshold value in the
Indicated at 22. In step 1 of the figure, first, the number s of designated colors is calculated from the number of sessions of each of the designated flags F r , F g , and F b for red, green, and blue.
, One, three, or zero, and in accordance with the number, a binarization threshold is selected in the following steps, and the binarization threshold is used for binarization processing. Is determined as the upper limit or the lower limit.

【0062】もし指定色の個数sが2個であれば、ステ
ップ2の判定が「YES」となり、ステップ4で2値化
しきい値を上限値とすることを示す上限値フラグFFを
「1」にセットした後、続くステップ5,6で指定外の
色がいずれであるのかを判断する。
If the number s of designated colors is two, the determination in step 2 is “YES”, and in step 4 the upper limit value flag FF indicating that the binarization threshold is set to the upper limit value is set to “1”. After that, in subsequent steps 5 and 6, it is determined which color is not specified.

【0063】もし赤色が指定外であれば、ステップ5の
「Fr =0」の判定が「YES」となってステップ7へ
進み、2値化しきい値THとして赤色についての2値化
しきい値THR を選択し、赤色選択フラグF(R)を
「1」にセットする(ステップ8)。
If the red color is not specified, the determination of "F r = 0" in step 5 becomes "YES" and the routine proceeds to step 7, where the binary threshold value for red is set as the binary threshold value TH. TH R is selected, and the red selection flag F (R) is set to “1” (step 8).

【0064】もし緑色が指定外であれば、ステップ6の
「Fg =0」の判定が「YES」となってステップ9へ
進み、2値化しきい値THとして緑色についての2値化
しきい値THG を選択し、緑色選択フラグF(G)を
「1」にセットする(ステップ10)。
If green is not designated, the determination of "F g = 0" in step 6 becomes "YES" and the routine proceeds to step 9, where the binary threshold for green is set as the binary threshold TH. select TH G, and sets the green selection flag F (G) is "1" (step 10).

【0065】もし青色が指定外であれば、ステップ5,
6のいずれの判定も「NO」となってステップ11へ進
み、2値化しきい値THとして青色についての2値化し
きい値THB を選択し、青色選択フラグF(B)を
「1」にセットする(ステップ12)。
If the blue color is out of the designated range, step 5,
Any determination of 6 also proceeds to step 11 is "NO", select the binary threshold value TH B for blue as binary threshold value TH, blue selection flag F a (B) to "1" Set (step 12).

【0066】つぎに指定色の個数sが1個であれば、ス
テップ2の判定が「NO」、ステップ3の判定が「YE
S」となって図14に示す制御手順へ進み、続くステッ
プ13,14でいずれの色が指定されたのかを判断す
る。
Next, if the number s of designated colors is one, the determination in step 2 is “NO”, and the determination in step 3 is “YE”.
S ", the process proceeds to the control procedure shown in FIG. 14, and in subsequent steps 13 and 14, it is determined which color has been designated.

【0067】もし赤色が指定されていれば、ステップ1
3の「Fr =1」の判定が「YES」となってステップ
15へ進み、2値化しきい値THとして赤色についての
2値化しきい値THR を選択し、赤色選択フラグF
(R)を「1」にセットする(ステップ16)。
If red is designated, step 1
The determination of “F r = 1” of No. 3 becomes “YES” and the routine proceeds to step 15, where the binarization threshold TH R for red is selected as the binarization threshold TH, and the red selection flag F
(R) is set to "1" (step 16).

【0068】もし緑色が指定されていれば、ステップ1
4の「Fg =1」の判定が「YES」となってステップ
17へ進み、2値化しきい値THとして緑色についての
2値化しきい値THG を選択し、緑色選択フラグF
(G)を「1」にセットする(ステップ18)。
If green is designated, step 1
The determination of “F g = 1” of No. 4 is “YES”, the process proceeds to step 17, the binarization threshold TH G for green is selected as the binarization threshold TH, and the green selection flag F
(G) is set to "1" (step 18).

【0069】もし青色が指定されていれば、ステップ1
3,14のいずれの判定も「NO」となってステップ1
9へ進み、2値化しきい値THとして青色についての2
値化しきい値THB を選択し、青色選択フラグF(B)
を「1」にセットする(ステップ20)。
If blue is designated, step 1
Steps 1 and 3 are both "NO".
9 and as the binarization threshold TH, 2 for blue
Select valued threshold TH B, blue selection flag F (B)
Is set to "1" (step 20).

【0070】そしていずれの場合もステップ21で、2
値化しきい値を2値化処理のための上限値とすることを
示す上限値フラグFFを「0」にセットし、2値化しき
い値を2値化処理のための下限値として設定する。なお
指定色の個数sが0または3のときは、指定が適切でな
い旨を表示するなど異常処理を行う(ステップ22)。
In any case, in step 21, 2
An upper limit flag FF indicating that the binarization threshold is set to an upper limit for binarization processing is set to “0”, and the binarization threshold is set as a lower limit for binarization processing. If the number s of designated colors is 0 or 3, abnormal processing such as displaying that the designation is not appropriate is performed (step 22).

【0071】図15〜図17は、前記2値画像生成部6
5による2値化処理の制御手順をステップ1〜22で示
す。同図のステップ1,2ではまずX=0,Y=0の画
像位置の画素が指定され、つぎのステップ2で前記上限
値フラグFFが「1」にセットされているか否かを判定
する。もしその判定が「YES」であれば、RAMの2
値データ記憶領域UPに例えば白画素を表す2値データ
「0」を、他の2値データ記憶領域LOWに例えば黒画
素を表す2値データ「1」を、それぞれセットする。
FIGS. 15 to 17 show the binary image generating section 6.
Steps 1 to 22 show a control procedure of the binarization processing by the step 5. In Steps 1 and 2 of FIG. 3, the pixel at the image position where X = 0 and Y = 0 is specified, and in the next Step 2, it is determined whether or not the upper limit value flag FF is set to “1”. If the determination is “YES”, the RAM 2
For example, binary data “0” representing a white pixel is set in the value data storage area UP, and binary data “1” representing a black pixel is set in the other binary data storage area LOW.

【0072】またもし上限値フラグFFが「0」であれ
ば、ステップ2の判定が「NO」となり、前記記憶領域
UPに例えば黒画素を表す2値データ「1」を、前記記
憶領域LOWに例えば白画素を表す2値データ「0」
を、それぞれセットする。
If the upper limit value flag FF is "0", the determination in step 2 is "NO", and binary data "1" representing, for example, a black pixel is stored in the storage area UP. For example, binary data “0” representing a white pixel
Are set respectively.

【0073】つぎのステップ5は赤色選択フラグF
(R)が「1」にセットされているか否か、続くステッ
プ6は緑色選択フラグF(G)が「1」にセットされて
いるか否かを判定しており、もしステップ5の判定が
「YES」であれば、座標位置(X,Y)の画素につい
て赤色の色相度rをサンプリングして、その色相度rが
赤色の2値化しきい値THR より大きいか否かを判定す
る(ステップ7,8)。
The next step 5 is to set the red selection flag F
(R) is set to “1”, and the following step 6 determines whether or not the green selection flag F (G) is set to “1”. If "YES", the red hue degree r is sampled for the pixel at the coordinate position (X, Y), and it is determined whether or not the hue degree r is larger than the red binarization threshold TH R (step 7, 8).

【0074】もしステップ8の判定が「YES」であれ
ば、記憶領域UPを参照し、その領域にセットされた2
値データを読み出してその画素を2値化し(ステップ
9)、またもし「NO」であれば、記憶領域LOWを参
照し、その領域にセットされた2値データを読み出して
その画素を2値化する(ステップ10)。
If the determination in step 8 is "YES", the storage area UP is referred to and the 2
The value data is read and the pixel is binarized (step 9). If "NO", the storage area LOW is referred to, the binary data set in the area is read, and the pixel is binarized. (Step 10).

【0075】もし緑色選択フラグF(G)が「1」にセ
ットされていれば、ステップ6の判定が「YES」とな
り、座標位置(X,Y)の画素について緑色の色相度g
をサンプリングして、その色相度gが緑色の2値化しき
い値THG より大きいか否かを判定する(ステップ1
1,12)。
If the green selection flag F (G) is set to "1", the determination in step 6 becomes "YES", and the green hue g of the pixel at the coordinate position (X, Y) is set.
Is sampled, and it is determined whether or not the hue degree g is larger than the green binarization threshold value TH G (step 1).
1, 12).

【0076】もしステップ12の判定が「YES」であ
れば、その画素を記憶領域UPにセットされた2値デー
タに2値化し(ステップ13)、またもし「NO」であ
れば、記憶領域LOWにセットされた2値データに2値
化する(ステップ14)。
If the determination in step 12 is "YES", the pixel is binarized into binary data set in the storage area UP (step 13), and if "NO", the pixel is stored in the storage area LOW. (Step 14).

【0077】もし青色選択フラグF(B)が「1」にセ
ットされていれば、ステップ5,6の判定がともに「N
O」となり、座標位置(X,Y)の画素について青色の
色相度bをサンプリングして、その色相度bが青色の2
値化しきい値THB より大きいか否かを判定する(ステ
ップ15,16)。
If the blue selection flag F (B) is set to "1", the determinations at steps 5 and 6 are both "N".
O ", the hue degree b of blue is sampled for the pixel at the coordinate position (X, Y), and the hue degree b is 2
Determines binarization threshold TH B greater than or (step 15, 16).

【0078】もしステップ16の判定が「YES」であ
れば、その画素を記憶領域UPにセットされた2値デー
タに2値化し(ステップ17)、またもし「NO」であ
れば、記憶領域LOWにセットされた2値データに2値
化する(ステップ18)。
If the determination in step 16 is "YES", the pixel is binarized into binary data set in the storage area UP (step 17), and if "NO", the storage area LOW (Step 18).

【0079】つぎにステップ19でつぎのX座標位置
(この場合X=1)の画素を指定して上記と同様の手順
を実行するもので、同じ水平走査ライン上の全ての画素
(1水平走査ライン上の画素数を256とする)につい
ての処理が完了すると、ステップ20の判定が「YE
S」となってつぎの行の水平走査ライン上の各画素につ
いての処理へと移行する(ステップ21)。
Next, in step 19, the same procedure as described above is executed by designating the pixel at the next X coordinate position (X = 1 in this case), and all the pixels (1 horizontal scan) on the same horizontal scan line are executed. When the processing for the number of pixels on the line is 256) is completed, the determination in step 20 is “YE
S ", and shifts to processing for each pixel on the next horizontal scanning line (step 21).

【0080】全ての水平走査ライン(水平走査ライン数
を256とする)についての処理が繰り返し実行される
と、ステップ22の判定が「YES」となって2値化処
理が完了し、その2値画像が表示部15に表示される。
When the processing for all the horizontal scanning lines (the number of horizontal scanning lines is 256) is repeatedly executed, the determination in step 22 becomes “YES”, and the binarization processing is completed. The image is displayed on the display unit 15.

【0081】図18は、この発明の第3実施例にかかる
カラー画像の2値化処理装置70の概略構成を示す。図
示例の2値化処理装置70は、色相度計算部71,色相
しきい値算出部72,明度計算部73,明度しきい値
算出部74,抽出対象指定部75,2値画像生成部76
を含んでおり、カラーテレビカメラ14の出力が前記色
相度計算部71,明度計算部72および,2値画像生成
部76に、2値画像生成部76の出力が表示部15に、
それぞれ接続されている。
FIG. 18 shows a schematic configuration of a color image binarization processing apparatus 70 according to the third embodiment of the present invention. The binarization processing device 70 in the illustrated example includes a hue degree calculation unit 71, a hue degree threshold value calculation unit 72, a brightness calculation unit 73, a brightness threshold value calculation unit 74, an extraction target designation unit 75, and a binary image generation unit. 76
The output of the color television camera 14 is output to the hue calculation unit 71, the brightness calculation unit 72, and the binary image generation unit 76, and the output of the binary image generation unit 76 is output to the display unit 15.
Each is connected.

【0082】前記色相度計算部71は、カラーテレビカ
メラ14より入力したカラー入力画像を抽出対象指定部
75により指定された対象領域内について走査し、走査
に従って取り込まれる各画素の画素データ(赤色,緑
色,青色の各輝度データR,G,B)を用いてつぎの
(6) 〜(8) 式の演算を実行することにより各画素毎に各
色相度r,g,bを算出する。これら色相度r,g,b
は色相度しきい値算出部72へ与えられる。なお(6) 〜
(8) 式で算出される各色相度r,g,bは前記した(1)
〜(3) 式で算出されるものと実質的に差異はない。
The hue degree calculating section 71 scans the color input image input from the color television camera 14 within the target area specified by the extraction target specifying section 75, and captures pixel data (red, red, Using the green and blue luminance data R, G, and B),
The hue degrees r, g, and b are calculated for each pixel by executing the calculations of the equations (6) to (8). These hue degrees r, g, b
Is given to the hue degree threshold value calculation unit 72. (6) ~
Each hue degree r, g, b calculated by the equation (8) is obtained by the above (1)
There is no substantial difference from the value calculated by the formula (3).

【0083】[0083]

【数6】 (Equation 6)

【0084】[0084]

【数7】 (Equation 7)

【0085】[0085]

【数8】 (Equation 8)

【0086】前記色相度しきい値算出部72は、前記色
相度計算部71より入力した画素毎の各色相度r,g,
bから色相毎に最適な2値化しきい値THR ,THG
THB を算出するためのもので、第1,第2の各実施例
と同様、画質の評価値を求めて最適な2値化しきい値を
求める手法が用いられる。
The hue degree threshold value calculator 72 calculates the hue degrees r, g, and h for each pixel input from the hue degree calculator 71.
b, the optimum binarization threshold values TH R , TH G ,
This is for calculating TH B, and employs a method of obtaining an evaluation value of image quality and obtaining an optimal binarization threshold value, as in the first and second embodiments.

【0087】前記明度計算部73は、カラーテレビカメ
ラ14より入力したカラー入力画像を抽出対象指定部7
5により指定された対象領域内について走査し、走査に
従って取り込まれる各画素の画素データ(赤色,緑色,
青色の各輝度データR,G,B)を用いてつぎの(9) 式
の演算を実行することにより各画素毎に明度Lを算出す
る。この明度Lは明度しきい値算出部74へ与えられ
る。
The brightness calculating section 73 extracts the color input image input from the color television camera 14 into the extraction target specifying section 7.
5 is scanned within the target area designated by 5, and the pixel data (red, green,
The brightness L is calculated for each pixel by executing the following equation (9) using the blue luminance data R, G, and B). This lightness L is provided to the lightness threshold value calculation unit 74.

【0088】[0088]

【数9】 (Equation 9)

【0089】前記明度しきい値算出部74は、各色相度
r,g,bをそれぞれの各色相度の2値化しきい値TH
R THG ,THB と比較し、後述する条件を満たす画素
のみを対象として各対象画素の明度Lから色相毎の最適
な2値化しきい値THLR,THLG,THLBを算出するた
めのもので、画質の評価値を求めて最適な2値化しきい
値を求める手法を用いることは第1,第2の各実施例と
同様である。
The lightness threshold value calculating section 74 converts each of the hue degrees r, g, b into a binary threshold value TH for each of the hue degrees.
R TH G and TH B are compared with each other to calculate optimal binarization thresholds TH LR , TH LG and TH LB for each hue from the brightness L of each target pixel only for pixels satisfying the conditions described later. In this case, the method of finding the optimum binarization threshold value by finding the evaluation value of the image quality is the same as in the first and second embodiments.

【0090】前記抽出対象指定部75は、キーボードや
マウスなどで構成され、カラー入力画像中の2値化した
い対象領域を指定し、また2値化処理の対象または対象
外とする色相、すなわち赤色,緑色,青色のいずれかを
指定するためのものである。
The extraction target specifying section 75 is constituted by a keyboard, a mouse, and the like, specifies a target area in the color input image to be binarized, and sets a hue to be binarized or excluded from the binarization processing, ie, a red hue. , Green, or blue.

【0091】前記2値画像生成部75は、前記明度しき
い値算出部74で算出されたいずれか2値化しきい値を
用いて2値化処理を行って2値画像を生成する。
The binary image generating section 75 generates a binary image by performing a binarizing process using one of the binary threshold values calculated by the brightness threshold value calculating section 74.

【0092】図19は、2値画像を生成するための上記
2値化処理装置70の制御手順をステップ1〜10で示
す。まずステップ1でカラーテレビカメラ14よりカラ
ー入力画像が2値化処理装置70に取り込まれると、そ
のカラー入力画像は図示しない画像メモリに格納され
る。つぎのステップ2では後記する図21〜図23に示
す手順に従って抽出対象指定部75により2値化したい
対象領域が指定されると共に、2値化処理の対象または
対象外とする色相が指定される。
FIG. 19 shows the control procedure of the binarization processing unit 70 for generating a binary image in steps 1 to 10. First, in step 1, when a color input image is taken into the binarization processing device 70 from the color television camera 14, the color input image is stored in an image memory (not shown). In the next step 2, a target area to be binarized is specified by the extraction target specifying unit 75 according to the procedure shown in FIGS. 21 to 23 described later, and a hue to be binarized or not to be binarized is specified. .

【0093】つぎにステップ3において、色相度計算部
71が対象領域内のカラー入力画像を走査して各画素毎
に各色相度r,g,bを算出した後、色相度しきい値算
出部72が前記色相度計算部71より画素毎の各色相度
r,g,bを入力して色相毎に画質ヒストグラムを生成
し、さらに各画質ヒストグラムより色相毎に最適な2値
化しきい値THR ,THG ,THB を求める(ステップ
4,5)。
Next, in step 3, the hue degree calculation section 71 scans the color input image in the target area to calculate the hue degrees r, g, and b for each pixel, and then calculates the hue degree threshold value calculation section. Reference numeral 72 inputs the respective hue degrees r, g, and b for each pixel from the hue degree calculator 71, generates an image quality histogram for each hue, and further obtains an optimum binarization threshold TH R for each hue from each image quality histogram. , TH G and TH B are obtained (steps 4 and 5).

【0094】つぎにステップ6において、明度計算部7
3が対象領域内のカラー入力画像を走査して各画素毎に
明度Lを算出した後、明度しきい値算出部74が各色相
度r,g,bをそれぞれの色相度の2値化しきい値TH
R ,THG ,THB と比較し、後述する条件を満たす画
素のみを対象として各対象画素の明度Lを明度計算部7
3より入力して色相毎に画質ヒストグラムを生成し、さ
らに各画質ヒストグラムより色相毎に最適な2値化しき
い値THLR,THLG,THLBを求める(ステップ7,
8)。
Next, at step 6, the brightness calculation section 7
3 scans the color input image in the target area and calculates the lightness L for each pixel, and then the lightness threshold value calculation unit 74 converts each of the hue degrees r, g, b into a binary value of the respective hue degree. Value TH
R , TH G , and TH B are compared with each other, and the brightness L of each target pixel is calculated only for the pixels that satisfy a condition described later.
3, an image quality histogram is generated for each hue, and optimum binarization thresholds TH LR , TH LG , and TH LB are determined for each hue from each image quality histogram (step 7,
8).

【0095】つぎにステップ9で2値画像生成部76
は、前記明度しきい値算出部74で算出された2値化し
きい値THLR,THLG,THLBの中から指定された色に
対応する2値化しきい値を用いて画素データを2値化処
理して2値画像を生成し、つぎのステップ10で表示部
15はこの2値画像を表示する。
Next, in step 9, the binary image generation unit 76
The pixel data is binarized by using a binarization threshold corresponding to a designated color from the binarization thresholds TH LR , TH LG , and TH LB calculated by the brightness threshold calculator 74. Then, the display unit 15 displays the binary image in the next step 10.

【0096】図20は、前記抽出対象指定部75からの
キー入力に基づいて作成されかつ2値化処理に際して参
照されるしきい値テーブルTBを示す。同図中、T
LR,THLG,THLBは色相毎の明度の2値化しきい値
であり、THR THG ,THB は色相毎の色相度の2値
化しきい値である。またFFL ,FFr ,FFg ,FF
b は各2値化しきい値を2値化処理のための上限値とす
るか否かを示す上限値フラグであって、これらフラグが
「1」であれば上限値であることを、「0」であれば下
限値であることを、それぞれ示す。さらにSr ,Sg
b は各色相が2値化処理の対象であるか、或いは対象
外であるかを示す色指定識別データであり、その値が
「1」であればその色相が2値化処理の対象であること
を、「0」であればその色相が対象外であることを、そ
れぞれ示す。
FIG. 20 shows a threshold value table TB created based on a key input from the extraction target designation section 75 and referred to in the binarization processing. In the figure, T
H LR, TH LG, TH LB is binarization threshold of luminance for each hue, TH R TH G, TH B is binary threshold value of the hue of the each hue. Also, FF L , FF r , FF g , FF
b is an upper limit flag indicating whether or not each of the binarization thresholds is to be an upper limit for the binarization process. If these flags are "1", it indicates that the upper limit is "0". "Indicates the lower limit. Further, S r , S g ,
S b or is the hue of the binarization processing target, or a color designated identification data indicating which covered, with the value thereof hue if "1" is binarized processed A value of "0" indicates that the hue is out of target.

【0097】かくして2値化処理による2値データq
(q=1または0)は、指定された色相が赤色であれ
ば、つぎの(10)式で示す論理式により、また緑色であれ
ば、(11)式で示す論理式により、さらに青色であれば、
(12)式で示す論理式により、それぞれ決定される。
Thus, the binary data q by the binarization process
(Q = 1 or 0) indicates that the designated hue is red by the following logical expression (10), and if the designated hue is green, by the logical expression of the following expression (11): if there is,
Each is determined by the logical expression shown in Expression (12).

【0098】[0098]

【数10】 (Equation 10)

【0099】[0099]

【数11】 [Equation 11]

【0100】[0100]

【数12】 (Equation 12)

【0101】図21〜図23は、図19のステップ2の
詳細、すなわち前記抽出対象指定部75による指定操作
の手順をステップ1〜27で示したものである。まず同
図のステップ1で、表示部15に対象領域を指定するよ
う案内文字(メッセージ)が表示され、続くステップ2
て対象領域を規定する端点(始点および終点)の座標を
入力するよう案内文字が表示される。
FIGS. 21 to 23 show the details of step 2 in FIG. 19, that is, the steps of the designation operation by the extraction target designation unit 75 in steps 1 to 27. First, at step 1 of the figure, a guide character (message) is displayed on the display unit 15 so as to specify a target area, and then at step 2
A guide character is displayed to input the coordinates of the end points (start point and end point) defining the target area.

【0102】図24は、カラー入力画像80を示すもの
で、始点Pの座標(x1,y1)と終点Qの座標(x
2,y2)とを抽出対象指定部75よりキー入力するこ
とより矩形状の対象領域81が指定されることになる。
FIG. 24 shows a color input image 80, in which the coordinates (x1, y1) of the starting point P and the coordinates (x, y) of the ending point Q are shown.
2, y2) by the key input from the extraction target specifying unit 75, the rectangular target area 81 is specified.

【0103】図21のステップ3〜ステップ7は対象領
域の指定手順を示すもので、この手順が完了すると、表
示部15には対象領域の指定についての確認表示が行わ
れた後、赤色,緑色,青色のいずれか色相を指定するよ
う案内文字が表示される(ステップ8,9)。
Steps 3 to 7 in FIG. 21 show a procedure for specifying the target area. When this procedure is completed, a confirmation display for specifying the target area is displayed on the display unit 15, and then red and green are displayed. , Blue are designated (steps 8 and 9).

【0104】つぎのステップ10でキー操作により所望
の色が指定されると、その判定が「YES」となり、続
くステップ11〜15で2値化処理の対象または対象外
とする色相として赤色,緑色,青色のいずれが指定され
たのかを判断する。
When a desired color is designated by key operation in the next step 10, the determination is "YES", and in steps 11 to 15, red and green are set as hues to be subjected to the binarization processing or not to be subjected to the binarization processing. , Blue are designated.

【0105】もし2値化処理の対象とする色相として赤
色が指定されたとき、ステップ11の判定が「YES」
となり、赤色指定の識別データSr として「1」が、ま
た上限値フラグFFr として「0」が、それぞれ前記し
きい値テーブルTBにセットされる(ステップ16,1
7)。
If red is specified as the hue to be subjected to the binarization processing, the determination in step 11 is "YES".
Becomes "1" as the identification data S r red designation, also is "0" as the upper limit flag FF r, are respectively set in the threshold value table TB (Step 16, 1
7).

【0106】もし2値化処理の対象とする色相として緑
色が指定されたときは、ステップ12の判定が、青色が
指定されたときは、ステップ13の判定が、それぞれ
「YES」となり、同様の色指定識別データSg ,Sb
および上限値フラグFFg ,FFb の設定がそれぞれ行
われる(ステップ18,19およびステップ20,2
1)。
If green is specified as the hue to be subjected to the binarization processing, the determination in step 12 is made, and if blue is specified, the determination in step 13 becomes "YES". Color designation identification data S g , S b
And the upper limit value flags FF g and FF b are set (steps 18 and 19 and steps 20 and 2).
1).

【0107】またもし2値化処理の対象外とする色相と
して赤色が指定されたとき、ステップ14の判定が「Y
ES」となり、赤色指定の識別データSr として「0」
が、また上限値フラグFFr として「1」が、それぞれ
前記しきい値テーブルTBにセットされる(ステップ2
2,23)。
If red is specified as a hue to be excluded from the binarization processing, the determination in step 14 is “Y
ES ”and“ 0 ”as the identification data Sr for red designation.
But also it is "1" as the upper limit flag FF r, are respectively set in the threshold value table TB (Step 2
2, 23).

【0108】もし2値化処理の対象外とする色相として
緑色が指定されたときは、ステップ15の判定が「YE
S」となり、青色が指定されたときは、ステップ15の
判定が「NO」となり、同様の色指定識別データSg
b および上限値フラグFFg ,FFb の設定がそれぞ
れ行われる(ステップ24,25およびステップ26,
27)。
If green is specified as a hue to be excluded from the binarization processing, the determination in step 15 is “YE
S ”, and when blue is designated, the determination in step 15 is“ NO ”, and the same color designation identification data S g ,
S b and upper limit value flags FF g and FF b are set (steps 24 and 25 and steps 26 and 26, respectively).
27).

【0109】つぎのステップ28では、2値化したい画
像部分が指定された色相のうち明るい方であるのか、暗
い方であるのかを指定するよう表示部15に案内文字が
表示される。
In the next step 28, a guide character is displayed on the display unit 15 so as to designate whether the image portion to be binarized is the brighter or the darker of the designated hues.

【0110】つぎのステップ29でキー操作によりこの
明るさの指定が行われると、その判定が「YES」とな
り、つぎのステップ30で明るい方が指定されたか否か
を判定し、もしステップ30の判定が「YES」であれ
ば上限値フラグFFL として「0」が、もしステップ3
0の判定が「NO」であれば上限値フラグFFL として
「1」が、それぞれしきい値テーブルTBにセットされ
る。
When the brightness is designated by a key operation in the next step 29, the determination is "YES", and in the next step 30, it is determined whether or not the brighter one is designated. if the determination is "YES" as the upper limit flag FF L "0", if step 3
0 of the determination is "1" as the upper limit value and if "NO" flag FF L, is set to the threshold value table TB, respectively.

【0111】このようにしてしきい値テーブルTBが設
定され、さらに色相毎の色相度の2値化しきい値T
R ,THG ,THB が算出されてしきい値テーブルT
Bにセットされた後に、明度計算部73により対象領域
内の各画素毎に明度Lが算出されると、いま仮に赤色が
2値化処理の対象とする色相に指定されている場合、明
度しきい値算出部74は、各画素の色相度rが2値化し
きい値THR 以上である画素のみを対象として各対象画
素の明度から画質ヒストグラムを生成し、その画質ヒス
トグラムより最適な2値化しきい値THLRを求める。
The threshold value table TB is set as described above, and the binarization threshold value T of the hue degree for each hue is set.
H R, TH G, TH B is calculated threshold value table T
After the brightness is set to B, the brightness calculation unit 73 calculates the brightness L for each pixel in the target area. If red is specified as the hue to be subjected to the binarization processing, the brightness calculation is performed. The threshold value calculation unit 74 generates an image quality histogram from the brightness of each target pixel only for pixels whose hue degree r of each pixel is greater than or equal to the binarization threshold TH R , and converts the image quality histogram into an optimal binary image. determine the threshold value TH LR.

【0112】そして赤色の明るい方が指定されている場
合は、2値画像生成部76は各画素の明度Lが2値化し
きい値THLR以上の画素について抽出し、またもし赤色
の暗い方が指定されている場合は、各画素の明度Lが2
値化しきい値THLRより小さい画素について抽出し、そ
れぞれ2値画像を生成することになる。なお緑色や青色
が指定されている場合も上記と同様であり、ここではそ
の説明を省略する。
If the brighter red color is designated, the binary image generator 76 extracts pixels whose lightness L is greater than or equal to the binarization threshold TH LR. If specified, the brightness L of each pixel is 2
Extracting the binarization threshold TH LR smaller pixels, so that each produce a binary image. Note that the same applies to the case where green or blue is designated, and a description thereof will be omitted here.

【0113】なお上記した各実施例では、画質ヒストグ
ラムを生成するのに図4に示す回路構成のものを用いた
が、これに限らず、ファジイ推論を利用した回路構成の
ものを用いてもよい。
In each of the embodiments described above, the circuit configuration shown in FIG. 4 is used to generate the image quality histogram. However, the present invention is not limited to this, and a circuit configuration using fuzzy inference may be used. .

【0114】[0114]

【発明の効果】この発明は上記の如く、カラー入力画像
を構成する各画素の画素データを入力して画素毎に各色
相の強度を計測し、各画素毎の各色相の強度から2値化
しきい値を算出してカラー入力画像の2値化処理を行う
ようにしたから、カラー入力画像中に対象とする部位と
色相が共通する部位の画像部分や色むら部分が混在して
いても、色相の強度の違いにより、対象とする部位のみ
の色相パターンを抽出できるという、顕著な効果を奏す
る。
As described above, according to the present invention, the pixel data of each pixel constituting the color input image is input, the intensity of each hue is measured for each pixel, and the intensity of each hue is binarized for each pixel. Since the threshold value is calculated and the binarization process of the color input image is performed, even if the image portion and the color unevenness portion of the portion having the same hue as the target portion are mixed in the color input image, There is a remarkable effect that a hue pattern of only a target portion can be extracted due to a difference in hue intensity.

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

【図1】この発明の第1実施例にかかる2値化処理装置
の回路構成を示すブロック図である。
FIG. 1 is a block diagram showing a circuit configuration of a binarization processing device according to a first embodiment of the present invention.

【図2】条件設定のための操作手順を示すフローチャー
トである。
FIG. 2 is a flowchart showing an operation procedure for setting conditions.

【図3】第1実施例にかかる2値化処理装置の制御手順
を示すフローチャートである。
FIG. 3 is a flowchart illustrating a control procedure of the binarization processing device according to the first embodiment.

【図4】しきい値算出部の具体例を示す回路ブロック図
である。
FIG. 4 is a circuit block diagram illustrating a specific example of a threshold value calculation unit.

【図5】ウィンドウ走査部の原理を示す説明図である。FIG. 5 is an explanatory diagram illustrating the principle of a window scanning unit.

【図6】ウィンドウ内の各画素データの2値データへの
変換過程を示す説明図である。
FIG. 6 is an explanatory diagram showing a process of converting each pixel data in a window into binary data.

【図7】合法パターンの例を示す説明図である。FIG. 7 is an explanatory diagram showing an example of a legal pattern.

【図8】非合法パターンの例を示す説明図である。FIG. 8 is an explanatory diagram showing an example of an illegal pattern.

【図9】画質ヒストグラムを示す説明図である。FIG. 9 is an explanatory diagram showing an image quality histogram.

【図10】この発明の第2実施例にかかる2値化処理装
置の回路構成を示すブロック図である。
FIG. 10 is a block diagram showing a circuit configuration of a binarization processing device according to a second embodiment of the present invention.

【図11】第2実施例にかかる2値化処理装置の制御手
順を示すフローチャートである。
FIG. 11 is a flowchart illustrating a control procedure of the binarization processing device according to the second embodiment.

【図12】2値化ターゲット部による操作手順を示すフ
ローチャートである。
FIG. 12 is a flowchart illustrating an operation procedure performed by a binarization target unit.

【図13】しきい値選択部におけるしきい値選択の制御
手順を示すフローチャートである。
FIG. 13 is a flowchart illustrating a control procedure of threshold selection in a threshold selector.

【図14】しきい値選択部におけるしきい値選択の制御
手順を示すフローチャートである。
FIG. 14 is a flowchart illustrating a control procedure of threshold selection in a threshold selection unit.

【図15】2値化生成部による2値化処理の制御手順を
示すフローチャートである。
FIG. 15 is a flowchart illustrating a control procedure of a binarization process performed by a binarization generation unit;

【図16】2値化生成部による2値化処理の制御手順を
示すフローチャートである。
FIG. 16 is a flowchart illustrating a control procedure of a binarization process performed by a binarization generation unit;

【図17】2値化生成部による2値化処理の制御手順を
示すフローチャートである。
FIG. 17 is a flowchart illustrating a control procedure of a binarization process performed by a binarization generation unit;

【図18】この発明の第3実施例にかかる2値化処理装
置の回路構成を示すブロック図である。
FIG. 18 is a block diagram showing a circuit configuration of a binarization processing device according to a third embodiment of the present invention.

【図19】第3実施例にかかる2値化処理装置の制御手
順を示すフローチャートである。
FIG. 19 is a flowchart illustrating a control procedure of the binarization processing device according to the third embodiment.

【図20】しきい値テーブルを示す説明図である。FIG. 20 is an explanatory diagram showing a threshold value table.

【図21】抽出対象指定部による指定操作の手順を示す
フローチャートである。
FIG. 21 is a flowchart illustrating a procedure of a designation operation by an extraction target designation unit.

【図22】抽出対象指定部による指定操作の手順を示す
フローチャートである。
FIG. 22 is a flowchart illustrating a procedure of a designation operation by an extraction target designation unit.

【図23】抽出対象指定部による指定操作の手順を示す
フローチャートである。
FIG. 23 is a flowchart illustrating a procedure of a designation operation by an extraction target designation unit.

【図24】対象領域の指定方法を示す説明図である。FIG. 24 is an explanatory diagram showing a method of specifying a target area.

【図25】はんだ検査機の構成を示す説明図である。FIG. 25 is an explanatory diagram showing a configuration of a solder inspection machine.

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

10,60,70 2値化処理装置 11 画素抽出部 12,62 しきい値算出部 13,65,76 2値画像生成部 14 カラーテレビカメラ 16,61,71 色相度計算部 17 条件設定部 18 条件判定部 19 ゲーム部 63 2値化ターゲット指定部 64 しきい値選択部 72 色相度しきい値算出部 73 明度計算部 74 明度しきい値算出部 10, 60, 70 Binarization processing device 11 Pixel extraction unit 12, 62 Threshold value calculation unit 13, 65, 76 Binary image generation unit 14 Color television camera 16, 61, 71 Hue degree calculation unit 17 Condition setting unit 18 Condition determination unit 19 Game unit 63 Binary target designation unit 64 Threshold value selection unit 72 Hue degree threshold value calculation unit 73 Lightness calculation unit 74 Lightness threshold value calculation unit

フロントページの続き (72)発明者 石羽 正人 京都市下京区中堂寺南町17番地 サイエ ンスセンタービル 株式会社オムロンラ イフサイエンス研究所内 (72)発明者 石田 勉 京都市右京区花園土堂町10番地 オムロ ン株式会社内 (56)参考文献 特開 平3−190469(JP,A) 特開 平1−66781(JP,A) 特開 平1−51586(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06T 5/00 200 G06T 1/00 305 G06T 1/00 460 H04N 1/46 Continued on the front page (72) Inventor Masato Ishiba 17 Science Center Building, Chudo-ji Minamimachi, Shimogyo-ku, Kyoto Inside OMRONLA IF Science Research Institute Inc. In-company (56) References JP-A-3-190469 (JP, A) JP-A-1-66781 (JP, A) JP-A-1-51586 (JP, A) (58) Fields investigated (Int. . 7, DB name) G06T 5/00 200 G06T 1/00 305 G06T 1/00 460 H04N 1/46

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 カラー入力画像を、そのカラー入力画像
より算出した2値化しきい値により2値化処理して2値
画像を生成する2値化処理装置であって、 前記2値化しきい値の算出対象とするカラー入力画像を
構成する画素を抽出する画素抽出手段と、 前記画素抽出手段で抽出された各画素の画素データから
2値化しきい値を算出する2値化しきい値算出手段と、 前記2値化しきい値算出手段で算出された2値化しきい
値によりカラー入力画像を2値化処理して2値画像を生
成する2値画像生成手段とを有し、 前記画素抽出手段は、 前記カラー入力画像を構成する各画素の画素データを入
力して画素毎に各色相の強度を計測する計測手段と、 各色相の強度についての条件を設定するための条件設定
手段と、 前記計測手段で計測された各色相の強度が前記条件設定
手段により設定された条件を満たす画素のみを抽出して
その画素データを前記2値化しきい値算出手段へ出力す
る条件判別手段とを備えて成るカラー画像の2値化処理
装置。
1. A binarization processing device for binarizing a color input image with a binarization threshold value calculated from the color input image to generate a binary image, wherein the binarization threshold value Pixel extraction means for extracting pixels constituting a color input image to be calculated, and binarization threshold value calculation means for calculating a binarization threshold value from pixel data of each pixel extracted by the pixel extraction means. A binary image generating unit that generates a binary image by performing a binarization process on the color input image based on the binary threshold value calculated by the binary threshold calculating unit; Measuring means for inputting pixel data of each pixel constituting the color input image and measuring the intensity of each hue for each pixel; condition setting means for setting a condition regarding the intensity of each hue; Each color measured by means Binarization processing of a color image, comprising: a condition determination unit that extracts only pixels whose intensity satisfies the condition set by the condition setting unit and outputs the pixel data to the binarization threshold calculation unit. apparatus.
【請求項2】 カラー入力画像を、そのカラー入力画像
より算出した2値化しきい値により2値化処理して2値
画像を生成する2値化処理装置であって、 前記カラー入力画像を構成する各画素の画素データを入
力して画素毎に各色相の強度を計測する第1の計測手段
と、 前記カラー入力画像を構成する各画素の画素データを入
力して画素毎に明るさを計測する第2の計測手段と、 前記第1の計測手段により計測された画素毎の色相の強
度から第1の2値化しきい値を算出する第1のしきい値
算出手段と、 前記第2の計測手段により計測された画素毎の明るさか
ら第2の2値化しきい値を算出する第2のしきい値算出
手段と、 2値化処理の対象とする色相を指定する指定手段と、 前記指定手段により指定された色相にかかる第1の2値
化しきい値と第2の2値化しきい値とを用いて2値化処
理を行って2値画像を生成する2値画像生成手段とを備
えて成るカラー画像の2値化処理装置。
2. A binarization processing apparatus for binarizing a color input image with a binarization threshold value calculated from the color input image to generate a binary image, wherein the binarization processing apparatus comprises: First measuring means for inputting pixel data of each pixel to be measured and measuring the intensity of each hue for each pixel; and inputting pixel data of each pixel constituting the color input image and measuring brightness for each pixel A second measuring unit that performs hue intensity measurement for each pixel measured by the first measuring unit.
A first threshold value calculating means for calculating a first binary threshold value from the degree; and a second binary threshold value based on the brightness of each pixel measured by the second measuring means. A second threshold value calculating unit; a specifying unit that specifies a hue to be subjected to the binarization processing; a first binary threshold value and a second binary value related to the hue specified by the specifying unit A binarization processing apparatus for a color image, comprising: a binary image generating means for performing a binarization process using a binarization threshold to generate a binary image.
JP12413792A 1992-04-16 1992-04-16 Color image binarization processing device Expired - Fee Related JP3240570B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP12413792A JP3240570B2 (en) 1992-04-16 1992-04-16 Color image binarization processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP12413792A JP3240570B2 (en) 1992-04-16 1992-04-16 Color image binarization processing device

Publications (2)

Publication Number Publication Date
JPH05298433A JPH05298433A (en) 1993-11-12
JP3240570B2 true JP3240570B2 (en) 2001-12-17

Family

ID=14877841

Family Applications (1)

Application Number Title Priority Date Filing Date
JP12413792A Expired - Fee Related JP3240570B2 (en) 1992-04-16 1992-04-16 Color image binarization processing device

Country Status (1)

Country Link
JP (1) JP3240570B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3028126B2 (en) * 1993-11-25 2000-04-04 日本航空電子工業株式会社 Specific color region extraction method and extraction device
JPH09154025A (en) * 1995-11-29 1997-06-10 Ricoh Co Ltd Image processing device
JPH09154028A (en) * 1995-11-30 1997-06-10 Ricoh Co Ltd Image processing device
JP4507785B2 (en) * 2004-09-17 2010-07-21 オムロン株式会社 Substrate inspection device, parameter setting method and parameter setting device

Also Published As

Publication number Publication date
JPH05298433A (en) 1993-11-12

Similar Documents

Publication Publication Date Title
JP3545506B2 (en) Specific color area extraction method and specific color area removal method
EP2264671B1 (en) Image processing apparatus and method, medium storing program for image processing, and inspection apparatus
TW200301817A (en) A surface conduction examination method and a subtrate examination device
US7599553B2 (en) Image processing apparatus and method that perform color matching using detected uniformity
KR102853085B1 (en) Method and apparatus for detecting defects on substrate
US7751610B2 (en) Image recognition method and image recognition apparatus
JP3240570B2 (en) Color image binarization processing device
JP3265595B2 (en) Image processing method and apparatus
JP4354173B2 (en) Appearance inspection equipment for electronic circuit components
JP3250335B2 (en) Mounted parts inspection device
JP2001028059A (en) Method and device for color unevenness inspection
JP3505496B2 (en) Image processing method and image processing apparatus
JPH0718812B2 (en) Foreign object detection method
JP3963156B2 (en) Image processing apparatus and method, medium storing program for image processing, and inspection apparatus
JP3461143B2 (en) Color image target position detection device
JP2528929B2 (en) Automatic white uniformity evaluation method for color cathode ray tubes
JP2002140695A (en) Inspection method and apparatus
US12249103B2 (en) Beam profiling enhancement by automatic grayscale and color adjustment
JPH11351835A (en) Method for extracting contour line of cutting edge by processing taken image of tool
JP3783881B2 (en) Vehicle detection method and vehicle detection apparatus using the same
JPH10143673A (en) Image processing device
JPH0797410B2 (en) Image processing method
JP3356926B2 (en) Image bicoloring method
JP3135731B2 (en) Pattern recognition method and apparatus
JPH05210737A (en) Method for recognizing pattern

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071019

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081019

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees