JPH07129753A - Method and device for setting optimum binarized threshold - Google Patents

Method and device for setting optimum binarized threshold

Info

Publication number
JPH07129753A
JPH07129753A JP5294572A JP29457293A JPH07129753A JP H07129753 A JPH07129753 A JP H07129753A JP 5294572 A JP5294572 A JP 5294572A JP 29457293 A JP29457293 A JP 29457293A JP H07129753 A JPH07129753 A JP H07129753A
Authority
JP
Japan
Prior art keywords
threshold value
binarization threshold
density
optimum
optimum binarization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP5294572A
Other languages
Japanese (ja)
Inventor
Junko Iida
純子 飯田
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
Omron Tateisi Electronics Co
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, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP5294572A priority Critical patent/JPH07129753A/en
Publication of JPH07129753A publication Critical patent/JPH07129753A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Input (AREA)
  • Image Processing (AREA)
  • Closed-Circuit Television Systems (AREA)

Abstract

PURPOSE:To calculate and set an optimum binarized threshold following up the variance of the illumination condition. CONSTITUTION:Before the measurement processing in a visual recognition device, points P0 and P1 are obtained by an average density in a preliminarily determined monitor area and the optimum binarized threshold to determine a line L showing the relational formula between the density and the optimum binarized threshold with respect to the picture obtained in the illumination condition that illuminance is 0 and the picture obtained in the illuminance condition that illuminance capable of stable measurement processing is set. A control part measures the average density in the monitor area at intervals of a prescribed time, and, if the variance of the density is detected, the density is applied to the relational formula of the line L to calculate the optimum binarized threshold.

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 an image processing apparatus for binarizing a grayscale image obtained by picking up an object with a predetermined binarizing threshold value and performing a measuring process of a feature amount or the like. In particular, the present invention relates to an optimum binarization threshold value setting method and apparatus for calculating and setting an optimum binarization threshold value that follows changes in illumination conditions.

【0002】[0002]

【従来の技術】例えば視覚認識装置において、テレビカ
メラにより対象物を撮像する場合、自然光や室内の照明
など周囲の環境の変化により照明条件が変動すると、撮
像により得られた濃淡画像の濃度が変動することがあ
る。この照明条件の変動にともない、濃淡画像を2値化
処理して得られる2値画像は同じ対象物であっても常に
一定とならず、特徴量などの計測処理に支障をきたす。
そこで照明条件の変動に左右されずに常に一定の2値画
像を得るには、照明条件の変動に追随させて2値化しき
い値を補正してやる必要がある。
2. Description of the Related Art In a visual recognition apparatus, for example, when an image of an object is taken by a television camera, if the illumination conditions change due to changes in the surrounding environment such as natural light or indoor lighting, the density of a grayscale image obtained by the image pickup changes. I have something to do. Due to this change in the illumination condition, the binary image obtained by binarizing the grayscale image is not always constant even for the same target object, which hinders the measurement process of the feature amount and the like.
Therefore, in order to always obtain a constant binary image regardless of the change of the illumination condition, it is necessary to correct the binarization threshold value by following the change of the illumination condition.

【0003】従来、2値化しきい値を補正するには、対
象物を撮像して得られた画像について、所定の監視領域
の平均濃度を例えば一定時間毎に計測して照明条件の変
動を監視し、前記濃度の計測値により照明条件の変動を
検出したとき、前平均濃度の変動量だけ2値化しきい値
をシフトさせて補正するようにしている。図6は、従来
の2値化しきい値の補正方法を直線Lで示している。同
図の横軸は濃度、縦軸は2値化しきい値であって、直線
Lは、45度の傾きをもつから、前記2値化しきい値の
シフト量ΔYは濃度の変動量ΔXに一致する。
Conventionally, in order to correct the binarization threshold value, the average density of a predetermined monitoring region of an image obtained by picking up an object is measured, for example, at regular intervals to monitor variations in illumination conditions. However, when a change in the illumination condition is detected from the measured value of the density, the binarization threshold value is shifted by the amount of change in the pre-average density for correction. In FIG. 6, a straight line L indicates the conventional method of correcting the binarized threshold value. In the figure, the horizontal axis is the density and the vertical axis is the binarization threshold value. Since the straight line L has an inclination of 45 degrees, the binarization threshold shift amount ΔY matches the density variation amount ΔX. To do.

【0004】[0004]

【発明が解決しようとする課題】しかしながら前記濃度
の変動量ΔXと2値化しきい値のシフト量ΔYとは必ず
しも同じ値にはならないため、照明条件が変動したと
き、濃度の変動量ΔXだけ2値化しきい値をシフトさせ
て補正しても、照明条件の変動に追随した最適な2値化
しきい値が得られず、その2値化しきい値で生成された
2値画像は、同じ対象物であっても常に一定にならな
い。
However, since the density variation amount ΔX and the binarization threshold shift amount ΔY do not always have the same value, when the illumination condition varies, only the concentration variation amount ΔX becomes 2. Even if the binarization threshold value is shifted and corrected, the optimum binarization threshold value that follows the variation of the illumination condition cannot be obtained, and the binarized image generated by the binarization threshold value is the same object. However, it is not always constant.

【0005】この発明は、上記問題に着目してなされた
もので、照明条件が変動しても、その変動に追随した最
適な2値化しきい値を設定できる最適2値化しきい値設
定方法およびその装置を提供することを目的とする。
The present invention has been made in view of the above problems, and an optimum binarization threshold value setting method capable of setting an optimum binarization threshold value that follows the fluctuations even if the illumination condition changes. The purpose is to provide the device.

【0006】[0006]

【課題を解決するための手段】請求項1の発明は、照明
条件の変動に追随した最適な2値化しきい値を設定する
ための方法であって、照明条件を変えて撮像して得られ
た各画像について、所定の監視領域の濃度をそれぞれ計
測すると共に、各照明条件下での最適な2値化しきい値
を決定して、濃度と最適な2値化しきい値との関係をあ
らかじめ求めておき、計測処理に際し、対象物を撮像し
て得られた画像について、前記監視領域の濃度を計測し
て照明条件の変動を監視し、前記濃度の計測値により照
明条件の変動を検出したとき、前記濃度の計測値をあら
かじめ求められた濃度と最適な2値化しきい値との前記
関係に当てはめることにより、最適な2値化しきい値を
算出して設定するようにしている。
The invention according to claim 1 is a method for setting an optimum binarization threshold value that follows changes in illumination conditions, and is obtained by changing the illumination conditions and imaging. For each image, the density of a predetermined monitoring area is measured, and the optimum binarization threshold value under each illumination condition is determined to obtain the relationship between the density and the optimum binarization threshold value in advance. In the measurement process, when an image obtained by picking up an object is measured, the density of the monitoring area is measured to monitor the variation of the illumination condition, and the variation of the illumination condition is detected by the measured value of the concentration. The optimum binarization threshold value is calculated and set by applying the measured value of the density to the relationship between the density obtained in advance and the optimum binarization threshold value.

【0007】請求項2の発明では、照度がゼロのときの
照明条件下で得られた画像と、安定した計測処理が可能
な照度の照明条件下で得られた画像とについて、所定の
監視領域の濃度をそれぞれ計測すると共に、各照明条件
下での最適な2値化しきい値を決定して、濃度と最適な
2値化しきい値との関係をあらかじめ求めるようにして
いる。
According to the second aspect of the present invention, a predetermined monitoring region is set for the image obtained under the illumination condition when the illuminance is zero and the image obtained under the illumination condition where the stable measurement process is possible. Is measured, the optimum binarization threshold value under each illumination condition is determined, and the relationship between the density and the optimum binarization threshold value is obtained in advance.

【0008】請求項3の発明では、安定した計測処理が
可能な異なる照度の照明条件下で得られた各画像につい
て、所定の監視領域の濃度をそれぞれ計測すると共に、
各照明条件下での最適な2値化しきい値を決定して、濃
度と最適な2値化しきい値との関係をあらかじめ求める
ようにしている。
According to the third aspect of the present invention, the density of a predetermined monitoring region is measured for each image obtained under the illumination condition of different illuminance that enables stable measurement processing.
The optimum binarization threshold value under each illumination condition is determined, and the relationship between the density and the optimum binarization threshold value is obtained in advance.

【0009】請求項4の発明は、照明条件の変動に追随
した最適な2値化しきい値を設定するための装置であっ
て、照明条件を変えて撮像して得られた各画像につい
て、あらかじめ求められた所定の監視領域の濃度と最適
な2値化しきい値との関係を記憶する記憶手段と、計測
処理に際し、対象物を撮像して得られた画像について、
前記監視領域の濃度を計測して照明条件の変動を監視す
る濃度計測手段と、前記濃度計測手段により計測された
濃度の計測値を前記記憶手段に記憶された濃度と最適な
2値化しきい値との関係に当てはめて最適な2値化しき
い値を算出する演算手段と、前記演算手段により算出さ
れた最適な2値化しきい値を設定する2値化しきい値設
定手段とを備えたものである。
According to a fourth aspect of the present invention, there is provided an apparatus for setting an optimum binarization threshold value that follows changes in illumination conditions, wherein each image obtained by capturing images under different illumination conditions is previously set. A storage unit that stores the relationship between the obtained density of the predetermined monitoring region and the optimum binarization threshold value, and an image obtained by capturing an image of an object during the measurement process,
Concentration measuring means for measuring the concentration of the monitoring area to monitor variations in illumination conditions, and the concentration stored in the storage means for the measured value of the concentration measured by the concentration measuring means and the optimum binarization threshold value. And a binarization threshold value setting unit for setting the optimum binarization threshold value calculated by the computation unit. is there.

【0010】[0010]

【作用】照明条件の変動が検出されたとき、所定の監視
領域の濃度の計測値を、あらかじめ求められた濃度と最
適な2値化しきい値との関係に当てはめることにより、
最適な2値化しきい値を算出するので、照明条件の変動
に追随した最適な2値化しきい値が設定できる。
When a change in the illumination condition is detected, the measured value of the density of the predetermined monitoring area is applied to the relationship between the density obtained in advance and the optimum binarization threshold value.
Since the optimum binarization threshold value is calculated, it is possible to set the optimum binarization threshold value that follows changes in illumination conditions.

【0011】[0011]

【実施例】図1は、この発明が実施される視覚認識装置
の全体構成例を示す。図示例において、テレビカメラ1
は図示しない照明装置による照明下で対象物を撮像して
濃淡画像を生成し、そのビデオ信号をA/D変換器2へ
出力する。A/D変換器2は、アナログ量のビデオ信号
をディジタル量の濃淡画像データに変換する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 shows an example of the overall structure of a visual recognition device in which the present invention is implemented. In the illustrated example, the television camera 1
Captures an object under illumination by an illumination device (not shown) to generate a grayscale image, and outputs the video signal to the A / D converter 2. The A / D converter 2 converts an analog video signal into a digital grayscale image data.

【0012】この濃淡画像データは表示制御部9および
画像メモリ3へ出力され、前記画像メモリ3に濃淡画像
が記憶される。濃度計測部4は、画像メモリ3に格納さ
れた濃淡画像について、所定の監視領域内に含まれる全
ての画素の濃度から平均濃度を計測する。ウィンドウメ
モリ5には前記監視領域を設定するためのウィンドウデ
ータが書き込まれる。
The grayscale image data is output to the display controller 9 and the image memory 3, and the grayscale image is stored in the image memory 3. The density measuring unit 4 measures the average density of the grayscale images stored in the image memory 3 from the densities of all the pixels included in the predetermined monitoring area. Window data for setting the monitoring area is written in the window memory 5.

【0013】図2は、対象物を撮像して得られた濃淡画
像20を示すもので、同図中、21は対象物の画像部分
を、22は背景の画像部分を、それぞれ示す。この背景
の画像部分22には前記した監視領域を定めるウィンド
ウ23が設定される。
FIG. 2 shows a grayscale image 20 obtained by picking up an image of an object. In FIG. 2, 21 indicates an image part of the object and 22 indicates an image part of the background. In the background image portion 22, a window 23 defining the above-mentioned monitoring area is set.

【0014】図1に戻って、2値化回路6はA/D変換
器2より濃淡画像データを入力して所定の2値化しきい
値により2値化処理し、2値画像データを生成する。こ
の2値化回路6にはLUT(ルックアップテーブル)が
用いられ、このテーブルデータはCPU12により書き
込まれる。
Returning to FIG. 1, the binarization circuit 6 inputs the grayscale image data from the A / D converter 2 and binarizes it with a predetermined binarization threshold value to generate binary image data. . An LUT (look-up table) is used for the binarization circuit 6, and the table data is written by the CPU 12.

【0015】他の画像メモリ7は、2値化回路6より2
値画像データを入力して2値画像を記憶する。計測処理
部8は、前記画像メモリ7に格納された2値画像につい
て、面積,周囲長など、視覚認識に必要な特徴量などを
計測する。
The other image memory 7 has a binary value from the binarization circuit 6.
Input the value image data and store the binary image. The measurement processing unit 8 measures, for the binary image stored in the image memory 7, a characteristic amount necessary for visual recognition such as an area and a peripheral length.

【0016】表示制御部9は、濃淡画像データ,2値画
像データ,ウィンドウデータ,計測結果などを入力し、
そのいずれかを選択しまたは合成して、D/A変換器1
0へ出力する。D/A変換器10は、入力データをアナ
ログ信号に変換してビデオモニタ11へ出力する。ビデ
オモニタ11は入力したアナログ信号により濃淡画像や
2値画像などを画面に表示する。
The display control unit 9 inputs grayscale image data, binary image data, window data, measurement results, etc.,
Either one of them is selected or combined, and the D / A converter 1
Output to 0. The D / A converter 10 converts the input data into an analog signal and outputs it to the video monitor 11. The video monitor 11 displays a grayscale image, a binary image, or the like on the screen according to the input analog signal.

【0017】CPU12は構成各部を一連に制御する制
御主体であって、後述する濃度と最適な2値化しきい値
との関係式の算出や、この関係式を用いた最適な2値化
しきい値の算出および設定などを行う。CPU12には
CPUバス17を介してROM13,RAM14,I/
Oポート15などが接続され、前記I/Oポート15に
はキーボードやマウスなどの入力装置16が接続され
る。前記ROM13にはプログラムが格納され、またR
AM14には関係式を構成する係数などのデータが記憶
される。
The CPU 12 is a control body that controls each component in series, and calculates the relational expression between the density and the optimum binarization threshold value, which will be described later, and the optimum binarization threshold value using this relational expression. Calculate and set the. The CPU 12, the ROM 13, the RAM 14, the I / O via the CPU bus 17
An O port 15 or the like is connected, and an input device 16 such as a keyboard or a mouse is connected to the I / O port 15. The ROM 13 stores a program, and R
The AM 14 stores data such as coefficients that form a relational expression.

【0018】図3は、実験により求められる2点P0
1 より算出される関係式、すなわち濃度と最適な2値
化しきい値との関係式を直線Lで表したものである。一
方の点P0 は、照度がゼロのときの照明条件下で得られ
た画像について、前記した監視領域内の画像の平均濃度
と、オペレータが調整して決定した最適な2値化しきい
値とから決まる点であり、カメラの種類により異なる。
なおこの実験に際して、濃度の異なる対象物を多数用い
てサンプリングすれば、この点P0 の精度が向上する。
FIG. 3 shows two points P 0 ,
A straight line L represents the relational expression calculated from P 1 , that is, the relational expression between the concentration and the optimum binarization threshold value. On the other hand, the point P 0 is the average density of the image in the above-mentioned monitoring area and the optimum binarization threshold value determined by the operator for the image obtained under the illumination condition when the illuminance is zero. It depends on the type of camera.
In this experiment, if a large number of objects having different concentrations are used for sampling, the accuracy of this point P 0 is improved.

【0019】他方の点P1 は、安定した計測処理が可能
な照度の照明条件下で得られた画像について、前記した
監視領域内の平均濃度と、オペレータが調整して決定し
た最適な2値化しきい値とから決まる点であり、基準と
なる対象物のモデルを用いて認識に必要な基準パターン
を登録する際に求められる。いま最適な2値化しきい値
をy、監視領域内の画像の平均濃度をxとすると、2個
の点P0 ,P1 からつぎの(1)式が得られる。なおこ
の(1)式のa,bは係数である。
On the other hand, the point P 1 is the average density in the above-mentioned monitoring area and the optimum binary value determined by the operator for the image obtained under the illumination condition of the illuminance that enables stable measurement processing. This is a point determined by the threshold value of the conversion and is obtained when the reference pattern required for recognition is registered using the model of the reference object. Assuming that the optimum binarization threshold value is y and the average density of the image in the monitoring area is x, the following equation (1) can be obtained from the two points P 0 and P 1 . In addition, a and b in the equation (1) are coefficients.

【0020】[0020]

【数1】 [Equation 1]

【0021】図4は、他の方法で実験により求められた
2点P2 ,P3 より算出される関係式を直線Lで表した
ものである。
FIG. 4 is a straight line L showing a relational expression calculated from two points P 2 and P 3 obtained by experiments by another method.

【0022】各点P2 ,P3 は、安定した計測処理が可
能な異なる照度の照明条件下で得られた各画像につい
て、前記した監視領域内の画像の平均濃度と、オペレー
タが調整して決定した最適な2値化しきい値とから決ま
る点であり、同様に、基準となる対象物のモデルを用い
て認識に必要な基準パターンを登録する際に求められ
る。いま最適な2値化しきい値をy、監視領域内の画像
の平均濃度をxとすると、2個の点P2 ,P3 から前記
した(1)式が得られる。
The points P 2 and P 3 are adjusted by the operator with the average density of the image in the above-mentioned monitoring area for each image obtained under the illumination condition of different illuminance that enables stable measurement processing. This is a point determined from the determined optimum binarization threshold value, and is similarly obtained when the reference pattern necessary for recognition is registered using the model of the reference object. Assuming that the optimum binarization threshold value is y and the average density of the image in the monitoring area is x, the above-mentioned equation (1) can be obtained from the two points P 2 and P 3 .

【0023】図5は、照明条件の変動に追随した最適な
2値化しきい値の設定手順をステップ1(図中「ST
1」で示す)〜ステップ23で示す。まず同図のステッ
プ1において、照度をゼロに設定するか、または照度を
安定した計測処理が可能な照度に設定し、この照明条件
下で基準となる対象物のモデルをテレビカメラ1により
撮像して、その濃淡画像を画像メモリ3に記憶させる
(ステップ2)。つぎのステップ3でオペレータは、ビ
デオモニタ11に表示された濃淡画像を見ながら入力装
置16を操作し、濃淡画像上にウィンドウ23を設定し
て前記した監視領域を定め、濃度計測部4によりこの監
視領域内の画像の平均濃度を計測する(ステップ4)。
FIG. 5 shows a procedure for setting an optimum binarization threshold value following step 1 (“ST” in the figure) in accordance with variations in illumination conditions.
1 ”) to step 23. First, in step 1 of the figure, the illuminance is set to zero, or the illuminance is set to an illuminance that enables stable measurement processing, and a model of a reference object is imaged by the TV camera 1 under this illumination condition. Then, the grayscale image is stored in the image memory 3 (step 2). In the next step 3, the operator operates the input device 16 while watching the grayscale image displayed on the video monitor 11, sets the window 23 on the grayscale image to define the above-mentioned monitoring area, and the density measuring unit 4 sets the monitoring area. The average density of the image in the monitoring area is measured (step 4).

【0024】つぎにオペレータは、ビデオモニタ11に
濃淡画像および2値画像を交互または同時に表示させ、
その画像を見ながら入力装置16を操作して最適な2値
化しきい値を決定する。この2値化しきい値と前記平均
濃度の計測値とは前記の点P0 またはP2 を規定するデ
ータとしてRAM14に記憶される(ステップ5)。
Next, the operator causes the video monitor 11 to alternately or simultaneously display the grayscale image and the binary image,
While viewing the image, the input device 16 is operated to determine the optimum binarization threshold value. The binarized threshold value and the measured value of the average density are stored in the RAM 14 as data defining the point P 0 or P 2 (step 5).

【0025】つぎに照度を変更して安定した計測処理が
可能な他の照度に設定し、この照明条件下で対象物のモ
デルをテレビカメラ1により撮像して、その濃淡画像を
画像メモリ3に記憶させる(ステップ7)。つぎにステ
ップ8で濃度計測部4は前記監視領域内の画像の平均濃
度を計測する。つぎのステップ9でオペレータは、ビデ
オモニタ11に表示させた濃淡画像や2値画像を確認し
つつ入力装置16を操作して最適な2値化しきい値を決
定する。この2値化しきい値と前記平均濃度の計測値と
は前記の点P1 またはP3 を規定するデータとしてRA
M14に記憶される。つぎにCPU12は、RAM14
に記憶された点P0 ,P1 またはP2 ,P3を規定する
データより前記した関係式(1)を算出し、係数a,b
をRAM14に記憶させる(ステップ10)。
Next, the illuminance is changed and set to another illuminance that allows stable measurement processing, the model of the object is imaged by the television camera 1 under this illumination condition, and the grayscale image thereof is stored in the image memory 3. It is stored (step 7). Next, in step 8, the density measuring unit 4 measures the average density of the image in the monitoring area. In the next step 9, the operator operates the input device 16 while checking the grayscale image and the binary image displayed on the video monitor 11 to determine the optimum binarization threshold value. The binarization threshold value and the measured value of the average density are RA as data defining the point P 1 or P 3.
It is stored in M14. Next, the CPU 12 uses the RAM 14
The relational expression (1) is calculated from the data defining the points P 0 , P 1 or P 2 , P 3 stored in
Is stored in the RAM 14 (step 10).

【0026】このようにして濃度と最適な2値化しきい
値との関係を求めた後、計測処理を開始すると、ステッ
プ11が「YES」となり、つぎのステップ12で安定
した計測処理が可能な照明条件(例えばステップ6で設
定した照明条件)を設定し、2値化回路6に、その照明
条件における最適な2値化しきい値を、手操作によりま
たはCPU12が自動的に初期設定し、以下、特徴量の
自動計測処理へ移行する。
When the measurement process is started after the relationship between the concentration and the optimum binarization threshold value is obtained in this way, step 11 becomes "YES", and stable measurement process is possible in the next step 12. Illumination conditions (for example, the illumination conditions set in step 6) are set, and the binarization circuit 6 initializes an optimum binarization threshold value under the illumination conditions manually or automatically by the CPU 12, and , And shifts to the automatic measurement process of the feature amount.

【0027】この実施例では、装置周辺の環境の変化な
どにより生じる照明条件の変動に対応できるように、あ
らかじめ定められた所定の時間間隔毎(たとえば5分
毎)に照明条件が変動したか否かを自動的にチェックす
るようにしており、ステップ13で、CPU12は内部
のタイマを始動させる。
In this embodiment, whether or not the illumination condition has changed at predetermined time intervals (for example, every 5 minutes) so as to be able to cope with the change in the illumination condition caused by a change in the environment around the device or the like. It is automatically checked, and in step 13, the CPU 12 starts an internal timer.

【0028】つぎのステップ14で認識対象物を撮像し
て得られた画像が入力されると、続くステップ15でC
PU12はタイマが所定の時間だけ計時したか否かをチ
ェックする。その判定が「NO」であれば、画像メモリ
7に格納された入力画像の2値画像について、計測処理
部8は所定の特徴量を計測する(ステップ22)。つぎ
のステップ23は計測処理が完了したか否かを判定して
おり、その判定が「NO」であれば、つぎの認識対象物
を撮像して得られた画像が入力される(ステップ1
4)。
When the image obtained by picking up the object to be recognized is input in the next step 14, C is input in the following step 15.
The PU 12 checks whether or not the timer counts for a predetermined time. If the determination is "NO", the measurement processing unit 8 measures a predetermined feature amount for the binary image of the input image stored in the image memory 7 (step 22). In the next step 23, it is determined whether or not the measurement process is completed. If the determination is “NO”, the image obtained by capturing the next recognition target object is input (step 1
4).

【0029】この計測処理において、タイマが所定の時
間を計時したとき、ステップ15の判定が「YES」と
なり、濃淡画像が画像メモリ3に格納された後、濃度計
測部4により監視領域内の画像の平均濃度が計測される
(ステップ16)。もしこの濃度計測値がRAM14に
記憶された濃度の計測値と一致しないとき、照明条件が
変動したものと判断され、ステップ17の判定が「YE
S」となり、ステップ18へ進む。ステップ18ではC
PU12はこの濃度の計測値を濃度と最適な2値化しき
い値との関係式に当てはめて、最適な2値化しきい値を
算出し、この2値化しきい値を2値化回路6に設定する
(ステップ19)。つぎにステップ20で認識対象物の
画像が再入力され、CPU12は前記タイマをリセット
して再スタートさせる(ステップ21)。
In this measurement process, when the timer counts a predetermined time, the determination in step 15 becomes "YES", the grayscale image is stored in the image memory 3, and then the density measuring unit 4 stores the image in the monitoring area. Is measured (step 16). If this density measurement value does not match the density measurement value stored in the RAM 14, it is determined that the illumination condition has changed, and the determination in step 17 is "YE."
S ”, and the process proceeds to step 18. C in step 18
The PU 12 applies the measured value of the density to the relational expression between the density and the optimum binarization threshold value to calculate the optimum binarization threshold value, and sets this binarization threshold value in the binarization circuit 6. (Step 19). Next, in step 20, the image of the recognition object is re-input, and the CPU 12 resets and restarts the timer (step 21).

【0030】ステップ20で入力された画像は、ステッ
プ19で新たに設定された2値化しきい値により2値化
回路6で2値化処理され、特徴量の計測処理へ移行する
(ステップ22)。もしステップ17で照明変動が検出
されなければ、ステップ17からステップ20へ進み、
画像が再入力されてこれまでの2値化しきい値により2
値化処理され、タイマリセット後、計測処理へと移行す
る(ステップ21,22)。
The image input in step 20 is binarized by the binarization circuit 6 by the binarization threshold value newly set in step 19, and the process proceeds to the feature amount measurement process (step 22). . If no illumination variation is detected in step 17, go from step 17 to step 20,
The image is re-entered, and it is 2 by the binarization threshold so far.
After the value is converted and the timer is reset, the process proceeds to the measurement process (steps 21 and 22).

【0031】同様の手順が繰り返し実行された後、全て
の認識対象物についての計測処理が完了すると、ステッ
プ23の判定が「YES」となる。なお、上記実施例に
おいて設定した照明条件の変動をチェックするための時
間間隔は、装置周辺の環境に応じて自由に設定される。
また照明条件の変動をチェックするための方法として
は、上記の方法に限らず、計測処理が一定回数終了する
毎に照明条件のチェックを行ってもよく、またオペレー
タより外部コマンドが入力される毎に、照明条件のチェ
ックを行ってもよい。
After the measurement procedure for all the recognition objects is completed after the same procedure is repeatedly executed, the determination in step 23 becomes "YES". The time interval for checking the variation of the illumination conditions set in the above embodiment is freely set according to the environment around the device.
Further, the method for checking the fluctuation of the lighting condition is not limited to the above method, and the lighting condition may be checked every time the measurement process is finished a certain number of times, or every time the operator inputs an external command. Then, the lighting condition may be checked.

【0032】[0032]

【発明の効果】この発明は上記の如く、照明条件を変え
て撮像して得られた各画像について、所定の監視領域の
濃度をそれぞれ計測すると共に、各照明条件下での最適
な2値化しきい値を決定して、濃度と最適な2値化しき
い値との関係をあらかじめ求めておき、計測処理に際
し、対象物を撮像して得られた画像について、前記監視
領域の濃度を計測して照明条件の変動を監視し、前記濃
度の計測値により照明条件の変動を検出したとき、前記
濃度の計測値をあらかじめ求められた濃度と最適な2値
化しきい値との前記関係に当てはめることにより、最適
な2値化しきい値を算出して設定するようにしたから、
照明条件の変動に追随した最適な2値化しきい値を容易
に算出して設定できるという効果がある。
As described above, according to the present invention, the density of a predetermined monitoring region is measured for each image obtained by changing the illumination condition and the optimum binarization is performed under each illumination condition. The threshold value is determined, the relationship between the density and the optimum binarization threshold value is obtained in advance, and the density of the monitoring area is measured for the image obtained by imaging the object during the measurement process. By monitoring the fluctuation of the illumination condition and when detecting the fluctuation of the illumination condition from the measured value of the density, by applying the measured value of the density to the relationship between the density obtained in advance and the optimum binarization threshold value, , I tried to calculate and set the optimum binarization threshold,
There is an effect that it is possible to easily calculate and set an optimum binarization threshold value that follows changes in illumination conditions.

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

【図1】この発明が実施された視覚認識装置の全体構成
例を示すブロック図である。
FIG. 1 is a block diagram showing an example of the overall configuration of a visual recognition device in which the present invention is implemented.

【図2】対象物を撮像して得られた濃淡画像を示す説明
図である。
FIG. 2 is an explanatory diagram showing a grayscale image obtained by imaging an object.

【図3】濃度と最適な2値化しきい値との関係を示す説
明図である。
FIG. 3 is an explanatory diagram showing a relationship between a density and an optimum binarization threshold value.

【図4】濃度と最適な2値化しきい値との関係を示す説
明図である。
FIG. 4 is an explanatory diagram showing a relationship between a density and an optimum binarization threshold value.

【図5】最適な2値化しきい値の設定手順を示すフロー
チャートである。
FIG. 5 is a flowchart showing a procedure for setting an optimum binarization threshold value.

【図6】従来の2値化しきい値の設定方法を示す説明図
である。
FIG. 6 is an explanatory diagram showing a conventional method of setting a binarization threshold value.

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

1 テレビカメラ 3 画像メモリ 4 濃度計測部 6 2値化回路 12 CPU 13 ROM 14 RAM 1 TV camera 3 Image memory 4 Density measurement unit 6 Binarization circuit 12 CPU 13 ROM 14 RAM

───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.6 識別記号 庁内整理番号 FI 技術表示箇所 H04N 7/18 W ─────────────────────────────────────────────────── ─── Continuation of the front page (51) Int.Cl. 6 Identification code Internal reference number FI Technical indication H04N 7/18 W

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 照明条件の変動に追随した最適な2値化
しきい値を設定するための方法であって、 照明条件を変えて撮像して得られた各画像について、所
定の監視領域の濃度をそれぞれ計測すると共に、各照明
条件下での最適な2値化しきい値を決定して、濃度と最
適な2値化しきい値との関係をあらかじめ求めておき、 計測処理に際し、対象物を撮像して得られた画像につい
て、前記監視領域の濃度を計測して照明条件の変動を監
視し、前記濃度の計測値により照明条件の変動を検出し
たとき、前記濃度の計測値をあらかじめ求められた濃度
と最適な2値化しきい値との前記関係に当てはめること
により、最適な2値化しきい値を算出して設定すること
を特徴とする最適2値化しきい値設定方法。
1. A method for setting an optimum binarization threshold value that follows changes in illumination conditions, wherein the density of a predetermined monitoring region is obtained for each image obtained by imaging under different illumination conditions. And the optimum binarization threshold under each lighting condition is determined, and the relationship between the concentration and the optimum binarization threshold is obtained in advance, and the object is imaged during the measurement process. For the image obtained by measuring the density of the monitoring region to monitor the variation of the illumination condition, when the variation of the illumination condition is detected by the measured value of the concentration, the measured value of the concentration was previously obtained. An optimum binarization threshold value setting method characterized in that the optimum binarization threshold value is calculated and set by applying the relationship between the density and the optimum binarization threshold value.
【請求項2】 照度がゼロのときの照明条件下で得られ
た画像と、安定した計測処理が可能な照度の照明条件下
で得られた画像とについて、所定の監視領域の濃度をそ
れぞれ計測すると共に、各照明条件下での最適な2値化
しきい値を決定して、濃度と最適な2値化しきい値との
関係をあらかじめ求めるようにした請求項1に記載され
た最適2値化しきい値設定方法。
2. The densities of predetermined monitoring areas are respectively measured for an image obtained under illumination conditions when illuminance is zero and an image obtained under illumination conditions where illuminance allows stable measurement processing. The optimal binarization according to claim 1, wherein the optimal binarization threshold value under each illumination condition is determined, and the relationship between the density and the optimal binarization threshold value is obtained in advance. Threshold setting method.
【請求項3】 安定した計測処理が可能な異なる照度の
照明条件下で得られた各画像について、所定の監視領域
の濃度をそれぞれ計測すると共に、各照明条件下での最
適な2値化しきい値を決定して、濃度と最適な2値化し
きい値との関係をあらかじめ求めるようにした請求項1
に記載された最適2値化しきい値設定方法。
3. The density of a predetermined monitoring region is measured for each image obtained under illumination conditions of different illuminance that enables stable measurement processing, and the optimum binarization threshold under each illumination condition is measured. The value is determined, and the relationship between the density and the optimum binarization threshold value is obtained in advance.
The optimum binarization threshold value setting method described in 1.
【請求項4】 照明条件の変動に追随した最適な2値化
しきい値を設定するための装置であって、 照明条件を変えて撮像して得られた各画像について、あ
らかじめ求められた所定の監視領域の濃度と最適な2値
化しきい値との関係を記憶する記憶手段と、 計測処理に際し、対象物を撮像して得られた画像につい
て、前記監視領域の濃度を計測して照明条件の変動を監
視する濃度計測手段と、 前記濃度計測手段により計測された濃度の計測値を前記
記憶手段に記憶された濃度と最適な2値化しきい値との
関係に当てはめて最適な2値化しきい値を算出する演算
手段と、 前記演算手段により算出された最適な2値化しきい値を
設定する2値化しきい値設定手段とを備えて成る最適2
値化しきい値設定装置。
4. An apparatus for setting an optimum binarization threshold value that follows changes in illumination conditions, wherein a predetermined predetermined value is obtained for each image obtained by imaging under different illumination conditions. A storage unit that stores the relationship between the density of the monitoring area and the optimum binarization threshold value, and the density of the monitoring area of the image obtained by imaging the object during the measurement process is measured to determine the illumination condition. An optimum binarization threshold value is obtained by applying a concentration measurement unit that monitors fluctuations and a measured value of the concentration measured by the concentration measurement unit to the relationship between the concentration stored in the storage unit and the optimum binarization threshold value. Optimal 2 comprising arithmetic means for calculating a value, and binary threshold setting means for setting the optimal binary threshold calculated by the arithmetic means.
Quantization threshold setting device.
JP5294572A 1993-10-29 1993-10-29 Method and device for setting optimum binarized threshold Pending JPH07129753A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5294572A JPH07129753A (en) 1993-10-29 1993-10-29 Method and device for setting optimum binarized threshold

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5294572A JPH07129753A (en) 1993-10-29 1993-10-29 Method and device for setting optimum binarized threshold

Publications (1)

Publication Number Publication Date
JPH07129753A true JPH07129753A (en) 1995-05-19

Family

ID=17809521

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5294572A Pending JPH07129753A (en) 1993-10-29 1993-10-29 Method and device for setting optimum binarized threshold

Country Status (1)

Country Link
JP (1) JPH07129753A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005196398A (en) * 2004-01-06 2005-07-21 Ohara Ika Sangyo Kk Small animal behavior analysis device, small animal behavior analysis method, and behavior diagnosis method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005196398A (en) * 2004-01-06 2005-07-21 Ohara Ika Sangyo Kk Small animal behavior analysis device, small animal behavior analysis method, and behavior diagnosis method
JP4598405B2 (en) * 2004-01-06 2010-12-15 小原医科産業株式会社 Behavioral diagnosis method for small animals

Similar Documents

Publication Publication Date Title
US8150099B2 (en) Image processing device, image processing method, image processing program product, and imaging device
US8134614B2 (en) Image processing apparatus for detecting an image using object recognition
JP2003051017A (en) White line detector
US7340104B2 (en) Correction parameter determining method, correction parameter determining apparatus, computer program, and recording medium
JP2003168103A (en) Method and device for detecting line defect of picture, and method for correcting image data
US4984075A (en) Contour detecting apparatus
JPH07129753A (en) Method and device for setting optimum binarized threshold
JPH0793535A (en) Picture correction processing method
JP3127598B2 (en) Method for extracting density-varying constituent pixels in image and method for determining density-fluctuation block
JP3036103B2 (en) Image processing apparatus and method
JP2841961B2 (en) Visual recognition device
JP2747396B2 (en) Appearance inspection equipment for electronic components
JP3190173B2 (en) Semiconductor device appearance inspection method and appearance inspection device
JP2001175865A (en) Image processing method and its device
JPH0613417A (en) Semiconductor chip recognition device
JPH1153564A (en) Information processor and machine-readable storage medium recorded with rotational angle detection program
JP3216767B2 (en) Image processing device capable of level fluctuation correction
JP2861341B2 (en) Image processing method
JPH10143673A (en) Picture processor
JPH08327541A (en) Frozen road surface detecting device
KR101599810B1 (en) Replaying system for baduk
JPH0552520A (en) Device for measuring perimenter length of digital image
KR100190958B1 (en) Color purity control apparatus and method by using wabbling method
JPH0552767A (en) Image inspecting apparatus
JPS61177018A (en) Method of compensating binary code threshold