JPH05342356A - Picture processor - Google Patents

Picture processor

Info

Publication number
JPH05342356A
JPH05342356A JP17019092A JP17019092A JPH05342356A JP H05342356 A JPH05342356 A JP H05342356A JP 17019092 A JP17019092 A JP 17019092A JP 17019092 A JP17019092 A JP 17019092A JP H05342356 A JPH05342356 A JP H05342356A
Authority
JP
Japan
Prior art keywords
value
window
values
minimum
judgment
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
JP17019092A
Other languages
Japanese (ja)
Inventor
Hiroko Hirai
裕子 平井
Hiroshi Nonaka
博 野中
Tsuneo Adachi
恒夫 安達
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.)
Bosch Corp
Original Assignee
Zexel 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 Zexel Corp filed Critical Zexel Corp
Priority to JP17019092A priority Critical patent/JPH05342356A/en
Publication of JPH05342356A publication Critical patent/JPH05342356A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To surely detect the position of a recognition object with a simple method by setting a window to the position where the existence of the recognition object is estimated and scanning the window picture to detect a one- dimensional density distribution. CONSTITUTION:An arithmetic processor 18 reads out the picture signal stored in a picture memory 13 and sets a window to at least two right and left parts where the existence of the recognition object is estimated. Each window picture is scanned in the horizontal direction and the vertical direction to detect the one-dimensional density distribution. Plural minimum values existing in respective one-dimensional density distributions are obtained, and maximum values before and after arrival at these minimum values and maximum values of inter-picture element differences between these minimum values are defined as likelihood values of respective minimum values. Discrimination values of right and left windows are caluclated in accordance with the width between the minimum value having the maximum value of likelihood values and the minimum value having the second maximum value, and it is judged that the recognition object exists in the window having the discrimination value approximately equal to the diameter of the recognition object.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】この発明は、自動組付け装置に使
用される画像処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing apparatus used in an automatic assembling apparatus.

【0002】[0002]

【従来の技術】従来の自動組付け装置等に使用される画
像処理装置は、検出対象物(具体的には、孔の挿入され
た所定の径を有するピンの溝や刻印マーク等)を撮像手
段により撮影し、この撮像手段から出力された画像信号
に2値化等の処理を行って検出対象物の位置を検出し、
自動組付け装置に位置信号を出力するもので、これによ
って自動組付け装置等を正確に動作させることができる
ものである。特に、燃料噴射ポンプの自動組付け装置に
おいては、カムディスクをドライブシャフトに装着され
た連結子に装着する場合、カムディスクのピン位置とド
ライブシャフトのキー溝側を同一側に組付けなくてはな
らないため、カムディスクのピン位置を確実に検出する
必要があった。
2. Description of the Related Art An image processing apparatus used in a conventional automatic assembling apparatus or the like picks up an image of an object to be detected (specifically, a groove of a pin having a predetermined diameter into which a hole is inserted or a marking mark). The image signal output from the image capturing unit is subjected to processing such as binarization to detect the position of the detection target,
A position signal is output to the automatic assembling device, which allows the automatic assembling device and the like to operate accurately. Particularly, in the automatic assembly device for a fuel injection pump, when the cam disc is mounted on the connector mounted on the drive shaft, the pin position of the cam disc and the key groove side of the drive shaft must be mounted on the same side. Therefore, it is necessary to reliably detect the pin position of the cam disc.

【0003】しかし、従来の画像処理においては、検出
対象物の構造、検出環境等により、(1)入力画像のコ
ントラストが弱く2値化処理を行う際の閾値の決定が難
しく、良好な2値化画像が得られない、(2)金属表面
に荒い凹凸(表面の乱れ)がある場合、刻印と表面の乱
れを区別するのが難しい、(3)金属表面に油滴や厚い
油膜がある場合、ピン溝画像にコントラスト低下やぎら
つき(グレア)が生じる、等の問題点があった。
However, in the conventional image processing, due to the structure of the object to be detected, the detection environment, etc., (1) the contrast of the input image is weak and it is difficult to determine the threshold value when performing the binarization processing, so that good binary Image cannot be obtained, (2) When the metal surface has rough irregularities (surface irregularity), it is difficult to distinguish the marking and the surface irregularity. (3) When there are oil drops or thick oil film on the metal surface However, there are problems such as deterioration of contrast and glare in the pin groove image.

【0004】低コントラスト画像の画像強調手法として
は、ラプラシアン演算などの空間フィルタリング処理を
行った後に2値化処理をする手法があるが、画像中のノ
イズが強調されたり、誤認識の発生などの問題点があ
る。
As an image enhancement method for a low-contrast image, there is a method of performing binarization processing after performing spatial filtering processing such as Laplacian calculation. However, noise in the image is emphasized or erroneous recognition occurs. There is a problem.

【0005】また、適切な2値化閾値の決定に関して
は、画像の濃度ヒストグラムに着目する判別分析2値化
法(「画像認識の基礎〔I〕,オーム社)や、特開平3
−154976号公報に示される画像処理装置のように
閾値を検出環境に従って動的に変更させる処理方法が開
示されているが、金属表面の乱れと刻印の完全な区別を
することが難しいという問題点がある。
Further, regarding the determination of an appropriate binarization threshold value, a discriminant analysis binarization method focusing on the density histogram of an image (“Basic of image recognition [I], Ohmsha Co., Ltd.”), and
A processing method in which a threshold value is dynamically changed according to a detection environment like the image processing device disclosed in Japanese Patent No. 154976 is disclosed, but it is difficult to completely discriminate between the disorder of the metal surface and the marking. There is.

【0006】[0006]

【発明が解決しようとする課題】このために、この発明
は、カムディスクのピン位置を簡単な手法で確実に検出
できる画像処理装置を提供することにある。
Therefore, the present invention is to provide an image processing apparatus capable of surely detecting the pin position of a cam disk by a simple method.

【0007】[0007]

【課題を解決するための手段】しかして、第1のこの発
明は、撮像手段により撮影された画像信号を入力してA
/D変換し、記憶装置に記憶させた後、画像認識を行う
画像処理装置において、前記撮像手段によって撮影され
た画像上の認識対象物があると推定される少なくとも左
右2個所にウィンドを設定するウィンド設定手段と、こ
のウィンド設定手段によって設定された左右のウィンド
画像上を、所定の二方向に走査し、この走査線上にあた
る画素の濃度を検出して各々の走査線の1次元濃度分布
を検出する1次元濃度分布検出手段と、この各々の1次
元濃度分布に存在する複数の極小値を検出する極小値検
出手段と、この各々の極小値からこの極小値以前及び以
後の極大値に至る各画素間の差分を求め、この差分の最
大値をこの極小値の尤度値とする尤度値演算手段と、こ
の尤度値演算手段によって演算された各極小値の尤度値
から、最大の尤度値と2番目の尤度値を有する極小値を
検出し、この2つの極小値の幅を演算してこの走査線の
判定値とし、この走査線の判定値から左右のウィンドの
判定値を演算する判定値演算手段と、少なくとも左ウィ
ンドの判定値及び右ウィンドの判定値と認識対象物の径
とを比較し、認識対象物の径と略等しい判定値を有する
ウィンドに認識対象物があることを判定する認識対象位
置判定手段とを具備することにあり、また第2の発明に
よれば、撮像手段により撮影された画像信号を入力して
A/D変換し、記憶装置に記憶させた後、画像認識を行
う画像処理装置において、前記撮像手段によって撮影さ
れた画像上の認識対象物があると推定される少なくとも
左右2個所にウィンドを設定するウィンド設定手段と、
このウィンド設定手段によって設定された左右のウィン
ド画像上を、所定の二方向に走査し、この走査線上にあ
たる画素の濃度を検出して各々の走査線の1次元濃度分
布を検出する1次元濃度分布検出手段と、この各々の1
次元濃度分布に存在する複数の極小値を検出する極小値
検出手段と、この各々の極小値からこの極小値以前及び
以後の極大値に至る各画素間の差分を求め、この差分の
最大値をこの極小値の尤度値とする尤度値演算手段と、
この尤度値演算手段によって演算された各極小値の尤度
値から、最大の尤度値と2番目の尤度値を有する極小値
を検出し、この2つの極小値の濃度値から走査線の判定
値を演算し、さらに各ウィンドを走査する2本の走査線
の判定値から左右のウィンドの判定値を演算する判定値
演算手段と、少なくとも左ウィンドの判定値及び右ウィ
ンドの判定値を比較して、低い判定値を有するウィンド
に認識対象物があることを判定する認識対象位置判定手
段とを具備することにある。
SUMMARY OF THE INVENTION In the first aspect of the present invention, however, an image signal picked up by the image pickup means is inputted to
In an image processing device for performing image recognition after D / D conversion and storing in a storage device, windows are set at at least two left and right positions where it is estimated that there is a recognition target object on the image captured by the imaging unit. The window setting means and the left and right window images set by the window setting means are scanned in two predetermined directions, and the densities of pixels on the scanning lines are detected to detect the one-dimensional density distribution of each scanning line. A one-dimensional concentration distribution detecting means, a minimum value detecting means for detecting a plurality of minimum values existing in each one-dimensional concentration distribution, and a minimum value from each minimum value to a maximum value before and after this minimum value. The difference between pixels is calculated, and the maximum value of this difference is used as the likelihood value of this minimum value, and the maximum value is calculated from the likelihood value of each minimum value calculated by this likelihood value calculation means. Likelihood And the minimum value having the second likelihood value is detected, the width of these two minimum values is calculated to be the judgment value of this scanning line, and the judgment values of the left and right windows are calculated from the judgment value of this scanning line. The judgment value calculating means compares at least the judgment value of the left window and the judgment value of the right window with the diameter of the recognition object, and confirms that the recognition object is present in the window having the judgment value substantially equal to the diameter of the recognition object. According to the second aspect of the invention, the recognition target position determining means is provided, and after the image signal captured by the image capturing means is input, A / D converted and stored in the storage device, In an image processing apparatus for performing image recognition, window setting means for setting windows at at least two left and right positions where it is estimated that there is a recognition target object on the image captured by the image capturing means,
A one-dimensional density distribution in which the left and right window images set by the window setting means are scanned in predetermined two directions, the densities of pixels on the scanning lines are detected, and the one-dimensional density distribution of each scanning line is detected. Detection means and one of each
A minimum value detecting means for detecting a plurality of local minimum values existing in the three-dimensional density distribution, and a difference between each local pixel from each local minimum value to a local maximum value before and after this local minimum value is obtained, and a maximum value of this difference is calculated. Likelihood value calculating means for setting the likelihood value of this minimum value,
The minimum value having the maximum likelihood value and the second likelihood value is detected from the likelihood values of the respective minimum values calculated by the likelihood value calculation means, and the scanning line is calculated from the density values of these two minimum values. And a judgment value calculation means for calculating the judgment values of the left and right windows from the judgment values of the two scanning lines for scanning each window, and at least the judgment value of the left window and the judgment value of the right window. In comparison, a recognition target position determining means for determining that a recognition target object is present in a window having a low determination value is provided.

【0008】[0008]

【作用】したがってこの第1の発明によれば、認識対象
物が孔に挿入されたピンの場合、認識対象物があると推
定される少なくとも左右2ヵ所にウィンドを設定し、こ
の各々のウィンド画像内を所定の二方向、例えば水平方
向と垂直方向に走査して各々の1次元濃度分布を検出す
る。さらに、この各々の1次元濃度分布に存在する複数
の極小値を求め、この極小値に至る以前及び以後の極大
値とこの極小値との間の各画素間の差分の最大値を各々
の極小値の尤度値とし、この尤度値の最大及び第2番目
を有する極小値の位置の幅を求め、これを走査線の判定
値とする。この走査線の判定値から各ウィンドの判定値
を演算し、この演算結果を各ウィンドの判定値とする。
この各ウィンドの判定値と認識対象物の径を比較して略
等しい判定値を有するウィンドを認識対象物を有するウ
ィンドであると判定するために、上記課題が達成できる
ものである。
According to the first aspect of the present invention, therefore, when the recognition target object is a pin inserted into a hole, windows are set at at least two left and right positions where the recognition target object is presumed to exist, and the respective window images are set. The inside is scanned in a predetermined two directions, for example, in the horizontal direction and the vertical direction, and each one-dimensional density distribution is detected. Further, a plurality of local minimum values existing in each one-dimensional density distribution are obtained, and the maximum value of the difference between pixels between the local maximum value before and after reaching the local minimum value and the local minimum value is set to the local minimum value. As the likelihood value of the value, the width of the position of the minimum value having the maximum value and the second value of this likelihood value is obtained, and this is set as the determination value of the scanning line. The judgment value of each window is calculated from the judgment value of this scanning line, and the calculation result is used as the judgment value of each window.
The above problem can be achieved in order to compare the judgment value of each window with the diameter of the recognition target object and to judge that the window having the substantially equal judgment value is the window having the recognition target object.

【0009】また、第2の発明によれば、前記走査線に
判定値を最大及び第2番目の尤度値を有する極小値の濃
度から求め、この走査線の判定値から各ウィンドの判定
値を演算し、この演算結果を各ウィンドの判定値とす
る。この各ウィンドの判定値を比較して低い判定値を有
するウィンドを認識対象物を有するウィンドであると判
定するために、上記課題が達成できるものである。
According to the second aspect of the invention, the determination value for the scanning line is obtained from the density of the minimum value having the maximum and second likelihood values, and the determination value for each window is determined from the determination value for this scanning line. Is calculated, and the calculation result is used as the judgment value of each window. The above problems can be achieved in order to compare the determination values of the respective windows and determine that the window having the lower determination value is the window having the recognition object.

【0010】[0010]

【実施例】以下、この発明の実施例について図面により
説明する。図1(a)に示される自動組付け装置は、レ
ール1上を送られる移動台2に固定された組付け対象部
材(例えば燃料噴射ポンプ)3が所定位置に移動到達し
た場合に、ビデオカメラ4によって組付け部品(例え
ば、カムディスク)5を撮影し、この映像信号を画像処
理装置6によって処理して組付け部品5の位置を検出
し、この検出結果をロボット制御装置7に出力すること
によって、ロボット8を駆動して組付け部品を組付け対
象物3に組みつけるものである。
Embodiments of the present invention will be described below with reference to the drawings. The automatic assembling apparatus shown in FIG. 1A is a video camera when an assembling target member (for example, a fuel injection pump) 3 fixed to a moving table 2 sent on a rail 1 moves and reaches a predetermined position. 4 is used to photograph an assembly component (for example, a cam disk) 5, the image signal is processed by the image processing device 6 to detect the position of the assembly component 5, and the detection result is output to the robot controller 7. By this, the robot 8 is driven to assemble the assembly parts to the assembly target object 3.

【0011】画像処理装置6は、図1(b)に示すよう
に、クロック信号発生部9、A/D変換器10、バスバ
ッファ11、データバス12、画像メモリ13、列アド
レスレジスタ14、行アドレスレジスタ15、バッファ
16,17、及び演算処理装置18によって少なくとも
構成されるもので、クロック信号発生部9から出力され
たクロック信号に基づいてビデオカメラ4から出力され
た映像信号を入力するものである。この映像信号は、A
/D変換器10によってデジタル信号に変換され、バス
バッファ11を介してデータバス12に送られ、バッフ
ァ16,17を介してカスケードに接続された列アドレ
スレジスタ14及び行アドレスレジスタ15によって画
像メモリ13内に記憶される。
As shown in FIG. 1B, the image processing device 6 includes a clock signal generator 9, an A / D converter 10, a bus buffer 11, a data bus 12, an image memory 13, a column address register 14, and a row. At least the address register 15, the buffers 16 and 17, and the arithmetic processing unit 18, which inputs the video signal output from the video camera 4 based on the clock signal output from the clock signal generation unit 9. is there. This video signal is A
The image memory 13 is converted into a digital signal by the / D converter 10, sent to the data bus 12 via the bus buffer 11, and cascaded via the buffers 16 and 17 by the column address register 14 and the row address register 15. Be stored in.

【0012】この画像メモリ13内に記憶された画像信
号は、適宜演算処理装置18に読み出されて処理される
もので、この演算処理装置18は、例えば図示しない中
央演算処理装置(CPU)、読出専用メモリ(RO
M)、ランダムアクセスメモリ(RAM)、入出力ポー
ト(I/O)等によって構成されたそれ自体公知のもの
で、所定のプログラムに基づいて前記画像信号を処理し
て、前記ロボット制御装置7に画像処理による結果を出
力するものである。
The image signal stored in the image memory 13 is appropriately read out by the arithmetic processing unit 18 for processing, and the arithmetic processing unit 18 is, for example, a central processing unit (CPU) (not shown), Read-only memory (RO
M), a random access memory (RAM), an input / output port (I / O) and the like, which is known per se, processes the image signal based on a predetermined program, and causes the robot controller 7 to process the image signal. The result of image processing is output.

【0013】本発明に係る実施例の画像処理は、具体的
には図2に示すカムディスク20を分配型燃料噴射ポン
プの図示しないドライブシャフトに装着された連結子に
装着する工程において、カムディスク20の向きを検出
するために使用されるものである。
In the image processing of the embodiment according to the present invention, specifically, in the step of mounting the cam disk 20 shown in FIG. 2 on the connector mounted on the drive shaft (not shown) of the distributed fuel injection pump, the cam disk 20 is mounted. It is used to detect the orientation of 20.

【0014】カムディスク20は、頭部に形成されたプ
ランジャの一端が挿入されるプランジャ挿入孔21と、
このプランジャ挿入孔21の所定位置に突出するように
連通孔に挿入され、プランジャの一端に形成された噛合
溝に挿入されるピン22と、下方に延設され、図示しな
いドライブシャフトに装着された連結子に噛合する噛合
突起23,24と、図示しないハウジングに保持された
ローラ上を回動するカム面25とによって構成されてい
る。このカム面には、この実施例のカムディスク20が
4気筒対応であるために、4つの山部26と底部27を
有しており、この山部26から底部27に至る間がプラ
ンジャの吸入工程、底部27から山部26に至る間がプ
ランジャの圧送工程となるものである。
The cam disk 20 has a plunger insertion hole 21 into which one end of a plunger formed on the head is inserted,
A pin 22 that is inserted into the communication hole so as to project to a predetermined position of the plunger insertion hole 21 and that is inserted into a meshing groove formed at one end of the plunger and that extends downward and is attached to a drive shaft (not shown) It is composed of meshing projections 23 and 24 that mesh with the connector and a cam surface 25 that rotates on a roller held by a housing (not shown). Since the cam disk 20 of this embodiment is compatible with four cylinders, the cam surface has four crests 26 and a bottom 27, and the interval between the crest 26 and the bottom 27 is the suction of the plunger. In the process, the process from the bottom 27 to the peak 26 is the plunger pressure feeding process.

【0015】このカムディスク20をビデオカメラ4で
撮影した画像は、図3に示すもので、カム面25の山部
26、底部27、噛合突起23,24、及びピン22の
輝度が高く写し出されるもので、この画像は、例えば垂
直方向(y座標:上から下方向)に2m 画素、水平方向
(χ座標:左から右方向)に2n 画素で構成される2次
元画像で表され、各画素の階調値(濃度値)は画像信号
(画像データ)として画像メモリ13に記憶されるもの
である。
An image of the cam disk 20 taken by the video camera 4 is shown in FIG. 3, and the peaks 26, the bottom 27, the engaging projections 23 and 24, and the pin 22 of the cam surface 25 are projected with high brightness. but, this image is for example vertical: 2 m pixels (y-coordinate downward from above), the horizontal direction: is represented by 2-dimensional image composed of 2 n pixels (chi coordinates from left to right direction), The gradation value (density value) of each pixel is stored in the image memory 13 as an image signal (image data).

【0016】以下、前記画像処理装置6において実行さ
れる画像処理を図4に示すフローチャートに従って説明
する。
Image processing executed in the image processing apparatus 6 will be described below with reference to the flowchart shown in FIG.

【0017】ステップ100から開始される画像処理プ
ログラムは、ステップ110において、前記画像メモリ
13に記憶された各画素の画像データが入力される。
In the image processing program started from step 100, the image data of each pixel stored in the image memory 13 is input in step 110.

【0018】ステップ120においては、図5で示すよ
うに、各ウィンド30〜33の位置は固定であり、各ウ
ィンド30〜33においてある階調値以上の群を検出
し、その群の重心からカムディスク20の中心を求め
る。具体的には、所定以上の面積を有する所定以上の階
調値の群(カム面25の底部27)を検出し、ここにこ
の場合は4つのウィンド30〜33を設定する。次にこ
の設定された各ウィンド30〜33の重心G30,G31
32,G33を求め、さらにG30及びG32、G31及びG33
を通過する直線L1 及びL2 を求める。この直線L1
びL2 の交点をカムディスク20の中心CCTとするもの
である。
At step 120, as shown in FIG. 5, the positions of the windows 30 to 33 are fixed, a group having a certain gradation value or more is detected in each of the windows 30 to 33, and the cam is calculated from the center of gravity of the group. Find the center of the disk 20. Specifically, a group of gradation values of a predetermined value or more (bottom portion 27 of the cam surface 25) having an area of a predetermined value or more is detected, and in this case, four windows 30 to 33 are set. Next, the center of gravity G 30 , G 31 , of each of the set windows 30 to 33 is set.
G 32 , G 33 are obtained, and further G 30 and G 32 , G 31 and G 33
The straight lines L 1 and L 2 passing through are obtained. The intersection of these straight lines L 1 and L 2 is the center C CT of the cam disk 20.

【0019】ステップ130においては、図6で示すよ
うに、左右2ヵ所にピン位置判定ウィンドの設定が成さ
れる。具体的には、カムディスク20の中心CCTから、
直線L1 若しくはL2 の傾きから所定角度を有して設定
された左右方向に所定位置離れた位置にピン位置判定用
の円ウィンド40,41を設定するものである。尚、円
ウィンド40を左ウィンド40、円ウィンド41を右ウ
ィンド41とする。
In step 130, as shown in FIG. 6, the pin position determination windows are set at two places on the left and right. Specifically, from the center C CT of the cam disk 20,
The circular windows 40 and 41 for pin position determination are set at positions separated by a predetermined position in the left-right direction set at a predetermined angle from the inclination of the straight line L 1 or L 2 . The circular window 40 is referred to as the left window 40, and the circular window 41 is referred to as the right window 41.

【0020】ステップ200から実行される第1の発明
に係る実施例によるピン位置検出処理は、円ウィンドの
中にピン22が存在する場合には一定距離を隔てて2つ
のくぼみ(空間分布の谷間)が存在するという事実に基
づいて、ピン位置を検出するもので、このフローチャー
トを図7乃至図13に示し、以下このフローチャートに
従って説明する。
The pin position detection processing according to the first embodiment of the present invention which is executed from step 200 includes two depressions (valleys of the spatial distribution) spaced apart by a certain distance when the pin 22 exists in the circular window. ) Exists, the pin position is detected. This flowchart is shown in FIGS. 7 to 13 and will be described below with reference to this flowchart.

【0021】先ず図7のステップ210において、図1
4に示す左ウィンド40を水平(χ方向)に走査する走
査線50、左ウィンド40を垂直(y方向)に走査する
走査線51、右ウィンド41を水平(χ方向)に走査す
る走査線53、及び右ウィンド41を垂直(y方向)に
走査する走査線54のアドレスが計算される。具体的に
は、各ウィンド40,41の中心から上下左右にそれぞ
れz画素を設定するものである。
First, in step 210 of FIG.
4, a scanning line 50 for scanning the left window 40 horizontally (in the χ direction), a scanning line 51 for scanning the left window 40 in the vertical direction (y direction), and a scanning line 53 for scanning the right window 41 in the horizontal direction (χ direction). , And the address of the scan line 54 that scans the right window 41 vertically (y direction) is calculated. Specifically, z pixels are set in the vertical and horizontal directions from the center of each window 40, 41.

【0022】ステップ220においては、前記走査線5
0(左ウィンド40の中心から左右にそれぞれz画素)
上の各画素の階調度を読み込み、図15に示す左ウィン
ドχ方向空間分布GLX(N)を検出するものである。同
様にステップ230においては、前記走査線51(左ウ
ィンド40の中心から上下にそれぞれz画素)から図1
5に示す左ウィンドy方向空間分布GLY(N)を検出す
る。
In step 220, the scan line 5
0 (z pixels to the left and right from the center of the left window 40)
The gradation level of each pixel above is read to detect the spatial distribution G LX (N) in the left window χ direction shown in FIG. 15. Similarly, in step 230, from the scanning line 51 (z pixels vertically from the center of the left window 40) to FIG.
The left window y direction spatial distribution G LY (N) shown in 5 is detected.

【0023】ステップ240においては、前記走査線5
3(右ウィンド41の中心から左右にそれぞれz画素)
上の各画素の階調度を読み込み、図16に示す右ウィン
ドχ方向空間分布GRX(N)を検出するものである。同
様にステップ250においては、前記走査線54(右ウ
ィンド41の中心から上下にそれぞれz画素)から図1
6に示す右ウィンドy方向空間分布GRY(N)を検出す
る。尚、上記空間分布GLX(N),GLY(N),G
RX(N),GRY(N)は、各走査線の所謂1次元濃度分
布を指すものである。
In step 240, the scan line 5
3 (z pixels to the left and right from the center of the right window 41)
The gradation degree of each pixel above is read and the right window χ direction spatial distribution G RX (N) shown in FIG. 16 is detected. Similarly, in step 250, from the scanning line 54 (z pixels above and below the center of the right window 41), as shown in FIG.
The right window y direction spatial distribution G RY (N) shown in 6 is detected. The spatial distributions G LX (N), G LY (N), G
RX (N) and G RY (N) indicate so-called one-dimensional density distribution of each scanning line.

【0024】次に、図8で示すステップ260におい
て、判定処理を行う空間分布の指定を行うフラッグF1
を初期値“0”に戻し、ステップ270においてこのフ
ラッグF1 が“0”か否かの判定を行う。この判定にお
いて、フラッグF1 が“0”の場合(Y)は、ステップ
280に進んで左ウィンドχ方向空間分布GLX(N)を
演算用空間分布G(N)とし、“0”でない場合(N)
は、ステップ290に進んでフラッグF1 が“1”か否
かの判定を行う。この判定において“1”である場合に
は、ステップ300において演算用空間分布G(N)に
左ウィンドy方向空間分布GLY(N)を設定し、また
“1”でない場合にはステップ310に進んで、フラッ
グF1 が“2”か否かの判定を行う。
Next, at step 260 shown in FIG. 8, the flag F 1 for designating the spatial distribution for which the determination process is to be performed.
The return to the initial value "0", it is determined whether the flag F 1 is "0" or in step 270. In this determination, if the flag F 1 is “0” (Y), the process proceeds to step 280 and the left window χ direction spatial distribution G LX (N) is set as the calculation spatial distribution G (N), and it is not “0”. (N)
Goes to step 290 to determine whether the flag F 1 is "1". If it is "1" in this judgment, the spatial distribution for calculation G (N) is set to the left window y direction spatial distribution GLY (N) in step 300, and if it is not "1", it is moved to step 310. Then, it is determined whether the flag F 1 is "2".

【0025】ステップ310において、フラッグF1
“2”に場合には、ステップ320に進んで演算用空間
分布G(N)に右ウィンドχ方向空間分布GRX(N)を
設定し、“2”でない場合には演算用空間分布G(N)
に右ウィンドy方向空間分布GRY(N)を設定するもの
である。
If the flag F 1 is "2" in step 310, the flow advances to step 320 to set the right window χ direction spatial distribution G RX (N) to the calculation spatial distribution G (N), and "2" is set. Otherwise, the calculation spatial distribution G (N)
The right window y direction spatial distribution G RY (N) is set to.

【0026】これによって、演算用空間分布G(N)が
設定された後、ステップ340において画素判別用フラ
ッグFP (N)を全てクリア(“0”)にすると共に、
ステップ350において、極小値指定変数nに初期値
“1”を設定する。
As a result, after the calculation spatial distribution G (N) is set, all the pixel discrimination flags F P (N) are cleared (“0”) in step 340, and
In step 350, the initial value "1" is set in the minimum value designation variable n.

【0027】その後、ステップ360に進んで、画素位
置を示す変数Nに初期値“1”を設定し、濃度比較値S
に所定値α(具体的には256)を設定し、さらに極小
値“1”を示す変数aに“0”を設定する。
After that, the routine proceeds to step 360, where an initial value "1" is set to the variable N indicating the pixel position, and the density comparison value S
Is set to a predetermined value α (specifically 256), and a variable a indicating the minimum value “1” is set to “0”.

【0028】ステップ370においては、フラッグFP
(N)が“0”か否かの判定を行う。この判定は、極小
値探索において、Nで指定された画素がすでに使用され
たものか否かを判定するもので、“0”の場合には、ま
だ使用されていないためにステップ380に進んで濃度
比較値SとNで指定される画素の階調値G(N)の大き
さを比較するものである。尚、濃度比較値Sは初回時に
おいては所定値αであり、2回目以降は下記するステッ
プ390において設定されたG(N)の階調値が代入さ
れるものである。
In step 370, the flag F P
It is determined whether (N) is "0". This determination is to determine whether or not the pixel designated by N has already been used in the minimum value search. In the case of "0", the pixel has not been used yet and therefore the process proceeds to step 380. The density comparison value S and the gradation value G (N) of the pixel designated by N are compared. The density comparison value S is a predetermined value α at the first time, and the gradation value of G (N) set in step 390 described below is substituted for the second time and thereafter.

【0029】初回においてN=1であるために、G
(1)と所定値αが設定されたSが比較され、G(1)
が小さい場合には、ステップ390に進んで、比較値S
にこのG(1)を設定し、さらに変数aに“1”を設定
し、ステップ400において次のN(この場合は
“2”)を設定し、ステップ410においてこのNが所
定値βに達するまで、ステップ370に回帰するように
してある。尚、所定値βは、この実施例においてウィン
ドの中心から左右上下にそれぞれz画素を設定したため
に、中心を含んで2z+1画素となる(β=2z+
1)。
Since N = 1 at the first time, G
(1) is compared with S for which the predetermined value α is set, and G (1)
If is smaller, the process proceeds to step 390 and the comparison value S
Is set to G (1), the variable a is set to "1", the next N (in this case, "2") is set in step 400, and this N reaches a predetermined value β in step 410. Up to step 370. Note that the predetermined value β is 2z + 1 pixels including the center because β pixels are set to the left, right, top, and bottom from the center of the window in this embodiment (β = 2z +).
1).

【0030】また、ステップ370の判定において、既
にこの画素に“0”以外のフラッグFP が立てられてい
る場合は、ステップ380及び390の処理を回避して
ステップ400に進むもので、またステップ380の判
定において濃度比較値Sより画素の階調値G(N)が大
きい場合には、ステップ390の処理を回避し、濃度比
較値Sを保持するものである。
If the flag F P other than "0" is already set in this pixel in the determination in step 370, the processing in steps 380 and 390 is avoided and the processing proceeds to step 400. When the gradation value G (N) of the pixel is larger than the density comparison value S in the determination of 380, the processing of step 390 is avoided and the density comparison value S is held.

【0031】この処理は所定値βまで繰り返し実行され
て常に階調値の低い画素値S及び画素位置aが更新さ
れ、これによって極小値指定変数nが“1”の場合(初
回時)において、処理されたいない画素の中で最も階調
値の低い極小値q1 (a,S)が得られるものである。
This process is repeatedly executed up to the predetermined value β, and the pixel value S and the pixel position a having a low gradation value are constantly updated, whereby the minimum value designation variable n is "1" (first time), The minimum value q 1 (a, S) having the lowest gradation value among the unprocessed pixels is obtained.

【0032】次に、図10に示すステップ420に進ん
で、画素位置Nにaを設定し、左側差分slに初期値
“0”を設定する。これによって設定された極小値qn
(a,S)の左右の差分の最大値sln ,srn を以下
のステップ430乃至600によって演算するものであ
る。
Next, proceeding to step 420 shown in FIG. 10, a is set to the pixel position N, and the initial value "0" is set to the left side difference sl. The minimum value q n set by this
(A, S) is intended for calculating the maximum value sl n, step 430 or 600 follows sr n the left and right difference of.

【0033】ステップ430において、処理される画素
にフラッグFP (N)(FP (a))の値が“0”が否
かの判定を行い、“0”の場合は未処理としてステップ
440に、“0”以外の値の場合にはステップ440乃
至490を回避してステップ500に進むものである。
In step 430, it is judged whether or not the value of the flag F P (N) (F P (a)) of the pixel to be processed is "0". If it is a value other than "0", steps 440 to 490 are bypassed and step 500 is proceeded to.

【0034】ステップ440においては、G(N−1)
とG(N)との階調値を比較する。これは、極小値とし
て設定されたqn (N,G(N))から図17で示す演
算用空間分布G(N)の左方向(極小値以前)の極大値
L1までの各画素間の差分を検出するためのもので、G
(N−1)がG(N)よりも大きい場合には、空間分布
が左上がりの特性を示していることとなるために、ステ
ップ450に進んでkにG(N−1)とG(N)との差
分を代入すると共に、このNに対するフラッグF
P (N)にnを代入する。具体的には、図17において
最初に検出される極小値q1 (a,G(a))のaが2
5であることから極小値q1 は(25,G(25))で
表されることとなり、この極小値q1 に対して、ステッ
プ440の判定においてG(24)≧G(25)となる
ために、ステップ450においてkにG(24)−G
(25)を代入し、さらにフラッグFP (25)に
“1”(初回時においてn=1であるため)を立てるも
のである。
In step 440, G (N-1)
And G (N) are compared. This is between each pixel from q n (N, G (N)) set as the minimum value to the maximum value P L1 in the left direction (before the minimum value) of the spatial distribution G (N) for calculation shown in FIG. To detect the difference between
If (N-1) is larger than G (N), it means that the spatial distribution has a characteristic of rising to the left, and therefore the process proceeds to step 450, where G (N-1) and G ( N) and the flag F for this N
Substitute n for P (N). Specifically, the minimum value q 1 (a, G (a)) a detected first in FIG.
Since it is 5, the minimum value q 1 is represented by (25, G (25)), and for this minimum value q 1 , G (24) ≧ G (25) in the determination of step 440. In step 450, G (24) −G
(25) is substituted, and the flag F P (25) is set to "1" (since n = 1 at the first time).

【0035】ステップ460においては、前記ステップ
450において設定されたkと、sln の比較を行い、
kが大きい場合にはステップ470においてこのkをs
nに代入する。また、kが小さい場合にはステップ4
70を回避して画素間の差分sln は保持されるもので
ある。この後、ステップ480において、NにN−1を
代入して、図面左方向にひとつずれた画素を処理基準に
設定し、ステップ490において、画素位置Nが“1”
以上である場合には、ステップ430に回帰して同様に
処理を行うものである。具体的には、初期時において
は、ステップ460の判定は、sl1 がステップ420
の設定において“0”であるために、sl1 がkよりも
小さいためにステップ470においてkの値(G(2
4)−G(25))をsl1 に設定し、ステップ480
においてNを24に設定する(25−1)。
In step 460, sl n is compared with k set in step 450,
If k is large, this k is set to s in step 470.
Substitute for l n . If k is small, step 4
The difference sl n between pixels is retained by avoiding 70. After that, in step 480, N-1 is substituted for N to set a pixel shifted by one to the left in the drawing as a processing reference, and in step 490, the pixel position N is "1".
In the case of the above, the process returns to step 430 and the same process is performed. Specifically, at the initial stage, sl 1 is determined to be 420 in step 420.
Since sl 1 is smaller than k because it is “0” in the setting of, the value of k (G (2
4) -G (25)) is set to sl 1 and step 480
Then, N is set to 24 (25-1).

【0036】上記処理は、ステップ430及びステップ
440において、フラッグFP が“0”以外の値である
と判定された場合(既に処理された画素である場合)、
又はG(N−1)がG(N)より小さくなった場合(極
大値を通過した場合)には、ステップ450〜490の
処理を回避してステップ500に進み、最後の画素位置
のフラッグFP (N)にnを立てるものである。
The above processing is executed when it is determined in step 430 and step 440 that the flag F P is a value other than "0" (when the pixel is already processed).
Alternatively, when G (N-1) becomes smaller than G (N) (when it passes the maximum value), the process of steps 450 to 490 is avoided and the process proceeds to step 500, where the flag F of the last pixel position is set. N is set in P (N).

【0037】これによって、図17で示すように、極小
値q1 から左方向に極大値PL1に至る各画素間の差分が
検出され、その最大のものがsl1 として残されるもの
である。尚、n=2の場合には、第2の極小値q2 につ
いてsl2 が求められ、各画素のフラッグFP (N)に
は“2”が設定されるものである。以下、n=εまで同
様の処理がなされるものである。
As a result, as shown in FIG. 17, the difference between each pixel from the minimum value q 1 to the maximum value P L1 in the left direction is detected, and the maximum difference is left as sl 1 . In the case of n = 2, sl 2 is obtained for the second minimum value q 2 , and the flag F P (N) of each pixel is set to “2”. Hereinafter, similar processing is performed until n = ε.

【0038】さらに、極小値q1 の右方向(極小値以
後)の各画素の差分sr1 を求めるために、ステップ5
10においては、前記極小値のフラッグFP (a)に再
び“0”を設定し、さらにステップ520において画素
位置Nに再びaを設定し、右方向差分srn に初期値
“0”を設定するものである。
Further, in order to obtain the difference sr 1 of each pixel to the right of the minimum value q 1 (after the minimum value), step 5
In step 10, the flag F P (a) having the minimum value is set to “0” again, and in step 520, the pixel position N is set to a again and the rightward difference sr n is set to the initial value “0”. To do.

【0039】ステップ530において、処理される画素
にフラッグFP (N)(FP (a))の値が“0”が否
かの判定を行い、“0”の場合は未処理としてステップ
540に、“0”以外の値の場合にはステップ540乃
至590を回避してステップ600に進むものである。
In step 530, it is judged whether or not the value of the flag F P (N) (F P (a)) is “0” for the pixel to be processed. If the value is other than "0", steps 540 to 590 are bypassed and step 600 is proceeded to.

【0040】ステップ540においては、G(N+1)
とG(N)との階調値を比較する。これは、極小値とし
て設定されたqn (N,G(N))から図17で示す演
算用空間分布G(N)の右方向(極小値以後)の極大値
R1までの各画素間の差分を検出するためのもので、G
(N+1)がG(N)よりも大きい場合には、空間分布
が右上がりの特性を示していることとなるために、ステ
ップ550に進んでkにG(N+1)とG(N)との差
分を代入すると共に、このNに対するフラッグF
P (N)にnを代入する。具体的には、図17において
最初に検出される極小値q1 (a,G(a))のaが2
5であることから極小値q1 は(25,G(25))で
表されることとなり、この極小値q1 に対して、ステッ
プ540の判定においてG(26)≧G(25)となる
ために、ステップ550においてkにG(26)−G
(25)を代入し、さらにフラッグFP (25)に
“1”(初回時においてn=1であるため)を立てるも
のである。
In step 540, G (N + 1)
And G (N) are compared. This is between each pixel from q n (N, G (N)) set as the minimum value to the maximum value P R1 in the right direction (after the minimum value) of the spatial distribution G (N) for calculation shown in FIG. To detect the difference between
If (N + 1) is larger than G (N), it means that the spatial distribution has a characteristic of rising to the right. Therefore, the process proceeds to step 550, where k (G + 1) and G (N) are combined. Substitute the difference and flag F for this N
Substitute n for P (N). Specifically, the minimum value q 1 (a, G (a)) a detected first in FIG.
Since it is 5, the minimum value q 1 is represented by (25, G (25)), and for this minimum value q 1 , G (26) ≧ G (25) in the determination of step 540. In step 550, G (26) −G
(25) is substituted, and the flag F P (25) is set to "1" (since n = 1 at the first time).

【0041】ステップ560においては、前記ステップ
550において設定されたkと、srn の比較を行い、
kが大きい場合にはステップ570においてこのkをs
nに代入する。また、kが小さい場合にはステップ5
70を回避して画素間の差分srn は保持されるもので
ある。この後、ステップ580において、NにN+1を
代入して、図面右方向にひとつずれた画素を処理基準に
設定し、ステップ590において、画素位置Nがγ以下
である場合には、ステップ530に回帰して同様に処理
を行うものである。具体的には、初期時においては、ス
テップ560の判定は、sr1 がステップ520の設定
において“0”であるために、sr1 がkよりも小さい
ためにステップ570においてkの値(G(26)−G
(25))をsr1 に設定し、ステップ580において
Nを26に設定する(25+1)。
In step 560, k set in step 550 is compared with sr n ,
If k is large, this k is set to s in step 570.
It is assigned to r n. If k is small, step 5
The difference sr n between pixels is retained by avoiding 70. After that, in step 580, N + 1 is substituted for N to set a pixel shifted by one to the right in the drawing as a processing reference. In step 590, when the pixel position N is γ or less, the process returns to step 530. Then, the same processing is performed. Specifically, in the initial stage, the determination in step 560, in order sr 1 is "0" in the setting of step 520, the value of k in step 570 in order sr 1 is smaller than k (G ( 26) -G
(25)) is set to sr 1 and N is set to 26 in step 580 (25 + 1).

【0042】上記処理は、ステップ530及びステップ
540において、フラッグFP が“0”以外の値である
と判定された場合(既に処理された画素である場合)、
又はG(N+1)がG(N)より小さくなった場合(極
大値を通過した場合)には、ステップ550〜590の
処理を回避してステップ600に進み、最後の画素位置
のフラッグFP (N)にnを立てるものである。
In the above processing, if it is determined in step 530 and step 540 that the flag F P has a value other than "0" (if the pixel has already been processed),
Alternatively, when G (N + 1) becomes smaller than G (N) (when it passes the maximum value), the process of steps 550 to 590 is avoided and the process proceeds to step 600, where the flag F P ( N is set in N).

【0043】これによって、図17で示すように、極小
値q1 から左方向に極大値PR1に至る各画素間の差分が
検出され、その最大のものがsr1 として残されるもの
である。尚、n=2の場合には、第2の極小値q2 につ
いてsr2 が求められ、各画素のフラッグFP (N)に
は“2”が設定されるものである。以下、n=εまで同
様の処理がなされるものである。
As a result, as shown in FIG. 17, the difference between each pixel from the minimum value q 1 to the maximum value P R1 in the left direction is detected, and the maximum difference is left as sr 1 . In the case of n = 2, sr 2 is obtained for the second minimum value q 2 and “2” is set to the flag F P (N) of each pixel. Hereinafter, similar processing is performed until n = ε.

【0044】ステップ610においては、画素位置配列
P(n)に前記極小値qn の位置を示す値aを代入す
る。具体的には、初回に検出される極小値q1 の位置a
(25)がP(1)に代入されるものである。
At step 610, the value a indicating the position of the minimum value q n is substituted into the pixel position array P (n). Specifically, the position a of the minimum value q 1 detected first time
(25) is substituted into P (1).

【0045】次に、ステップ620乃至670におけて
極小値qn の尤度値の設定が行われる。ステップ620
及びステップ630において、左側差分sln 及び右側
差分srn の一方が“0”である場合には、ステップ6
40に進んで、尤度値配列C(n)に“0”を設定す
る。また、ステップ620及び630において左側差分
sln 及び右側差分srn が共に“0”でない場合に
は、ステップ650において左側差分sln 及び右側差
分srn の大きさを比較し、左側差分sln が大きい場
合には、ステップ660に進んでC(n)にsln を代
入し、また右側差分srn が大きい場合には、C(n)
にsrn を代入するものである。
Next, in steps 620 to 670, the likelihood value of the minimum value q n is set. Step 620
And in step 630, if one of the left side difference sl n and the right side difference sr n is “0”, step 6
In step 40, "0" is set in the likelihood value array C (n). If the left-side difference sl n and the right-side difference sr n are not both “0” in steps 620 and 630, the magnitudes of the left-side difference sl n and the right-side difference sr n are compared in step 650 to determine that the left-side difference sl n is If it is large, the process proceeds to step 660, substituting sl n for C (n), and if the right difference sr n is large, C (n)
Sr n is substituted into

【0046】これによって、尤度値配列C(n)、初回
時においてはC(1)が設定され、ステップ680にお
いて次の極小値を探索すべく極小値指定変数nにn+1
を設定して、ステップ690において、このこの極小値
指定変数nが所定値εに到達したか否かの判定を行っ
て、所定値εに到達していない場合には、ステップ36
0に回帰して、上述されたステップ360乃至680の
処理を行い、第2の極小値q2 の探索並びに尤度値の設
定を行うものである。尚、所定値εは、通常5に設定さ
れるもので、5つの極小値q1 〜q5 が検出されるもの
である。
As a result, the likelihood value array C (n) and C (1) are set at the first time, and in step 680, n + 1 is set to the minimum value designating variable n to search for the next minimum value.
Is set, and it is determined in step 690 whether or not this minimum value designating variable n has reached a predetermined value ε. If it has not reached the predetermined value ε, step 36
By returning to 0, the processes of steps 360 to 680 described above are performed to search for the second minimum value q 2 and set the likelihood value. The predetermined value ε is normally set to 5, and five minimum values q 1 to q 5 are detected.

【0047】これによって尤度値配列C(n)(C
(1)〜C(ε))及び画素位置配列P(n)(P
(1)〜P(ε))が設定されるものである。
As a result, the likelihood value array C (n) (C
(1) to C (ε)) and pixel position array P (n) (P
(1) to P (ε)) are set.

【0048】次に、図12で示すフローチャートによっ
て各空間分布の判定値の設定が行われる。ステップ71
0において、前記尤度値配列C(n)を値の大きい順に
並べ変える処理が行われ、ステップ720において一番
大きい(最大の)尤度値C(n)に対応する画素位置配
列P(n)をP1 に代入し、ステップ730において二
番目に大きい尤度値C(n)に対応する画素位置配列P
(n)をP2 に代入する。これによって、ステップ74
0において、2つの極小値qJ1(P1 ,G(P1 ))及
び極小値qJ2(P2 ,G(P2 ))が設定されるもので
ある。
Next, the judgment value of each spatial distribution is set according to the flow chart shown in FIG. Step 71
In step 0, the likelihood value array C (n) is rearranged in the descending order of values, and in step 720, the pixel position array P (n) corresponding to the largest (maximum) likelihood value C (n). ) Is substituted for P 1 and the pixel position array P corresponding to the second largest likelihood value C (n) is obtained in step 730.
Substitute (n) into P 2 . This results in step 74
At 0, two local minimum values q J1 (P 1 , G (P 1 )) and local minimum value q J2 (P 2 , G (P 2 )) are set.

【0049】その後、ステップ750において、フラッ
グF1 が“0”か否かの判定を行い、“0”の場合は、
ステップ760において左ウィンドχ方向空間分布判定
値DLXを、前記2つの極小値q1 ,q2 の画素位置
1 ,P2 の差(|P1 −P2 |)により設定し、ステ
ップ770において、フラッグF1 に“1”を設定す
る。これにより、ステップ860の判定によってステッ
プ270に回帰し、ステップ290の判定によって演算
用空間分布G(N)に左ウィンドy方向空間分布G
LY(N)を設定し、上記同様の処理を行うものである。
これによって、次にはステップ750の判定において
は、F1 が“1”に設定されていることから、ステップ
780に進み、この判定においてステップ790に進
む。
Thereafter, in step 750, it is judged whether the flag F 1 is "0". If it is "0",
In step 760, the left wind χ direction spatial distribution judgment value D LX is set by the difference (| P 1 −P 2 |) between the pixel positions P 1 and P 2 of the two local minimum values q 1 and q 2 , and step 770. At 1 , the flag F 1 is set to "1". As a result, the determination in step 860 returns to step 270, and the determination in step 290 changes the calculation spatial distribution G (N) into the left window y-direction spatial distribution G.
LY (N) is set and the same processing as above is performed.
Accordingly, next, in the determination of step 750, since F 1 is set to “1”, the process proceeds to step 780, and the process proceeds to step 790 in this determination.

【0050】このステップ790において、前記画素位
置P1,2 の差は、左ウィンドy方向空間分布判定値D
LYに設定され、ステップ800においてF1 に“2”を
設定する。これによってステップ860から再度ステッ
プ270に回帰し、次はステップ750、780を通過
してステップ810の判定に至る。この判定においてF
1 =2である場合には、ステップ820に進んで右ウィ
ンドχ方向空間分布判定値DRXに画素位置P1,2 の差
を設定し、ステップ830においてF1 に“3”を設定
する。F1 =3の場合は、ステップ810の判定におい
てステップ840に進むこととなり、このステップ84
0において右ウィンドy方向空間分布判定値DRYに画素
位置P1,2 の差を設定し、ステップ850においてF
1 に“4”を設定する。これによって、ステップ860
の判定において、図13で示す次のステップに進むもの
である。
At this step 790, the difference between the pixel positions P 1 and P 2 is determined by the left window y direction spatial distribution judgment value D.
Is set to LY, sets "2" to F 1 in step 800. As a result, the process returns from step 860 to step 270 again, and then passes through steps 750 and 780 to reach the determination of step 810. F in this judgment
1 = a if 2, sets the difference between the pixel positions P 1, P 2 in the right window χ direction spatial distribution determining value D RX proceeds to step 820, and sets "3" to F 1 in step 830 .. If F 1 = 3, the process proceeds to step 840 in the determination of step 810, and this step 84
At 0, the difference between the pixel positions P 1 and P 2 is set to the right window y direction spatial distribution determination value D RY , and at step 850, F
Set “4” to 1 . This results in step 860
In the determination of, the process proceeds to the next step shown in FIG.

【0051】図13に示されるステップ870におい
て、前記左ウィンドχ方向空間分布判定値DLXが所定範
囲内(λ1 <DLX<λ2 )であるか否かの判定を行う。
この判定において、DLXが所定範囲内にない場合は、ス
テップ880に進んで、判定結果LX に“0”を設定
し、所定範囲内の場合は、ステップ890に進んで判定
結果LX に“1”を設定するものである。尚、このλ1
及びλ2 は、ピン22の径λに対して許容範囲は有して
設定されたものである。
In step 870 shown in FIG. 13, it is determined whether or not the left window χ direction spatial distribution determination value D LX is within a predetermined range (λ 1 <D LX2 ).
In this determination, if D LX is not within the predetermined range, the process proceeds to step 880, and the determination result L X is set to “0”. If it is within the predetermined range, the process proceeds to step 890 and the determination result L X is set. "1" is set. This λ 1
And λ 2 are set with an allowable range with respect to the diameter λ of the pin 22.

【0052】次に、ステップ900においては、前記左
ウィンドy方向空間分布判定値DLYの判定を行い、所定
範囲外である場合はステップ910において判定結果L
Y に“0”を設定し、所定範囲内にある場合にはステッ
プ920において判定結果LY に“1”を設定するもの
である。
Next, in step 900, the left window y-direction spatial distribution judgment value D LY is judged, and if it is outside the predetermined range, the judgment result L is judged in step 910.
"0" is set to Y, and if it is within the predetermined range, the determination result L Y is set to "1" in step 920.

【0053】同様にステップ930乃至980におい
て、前記右ウィンドχ方向空間分布判定値DRX及び前記
右ウィンドy方向空間分布判定値DRYを判定して、判定
結果RX 及びRY を設定するものである。
Similarly, in steps 930 to 980, the determination results R X and R Y are set by determining the right window χ direction spatial distribution determination value D RX and the right window y direction spatial distribution determination value D RY. Is.

【0054】これにより、ステップ990において、左
ウィンドの走査線の判定結果LX 及びLY が“1”であ
り、右ウィンドの走査線の判定結果RX 及びRY の少な
くとも一方若しくは両方が“0”である場合には、ピン
22の位置が左ウィンドにあると判定できるために、ピ
ン位置出力t(0)に“1”を設定する。
As a result, in step 990, the determination results L X and L Y of the scanning lines in the left window are "1" and at least one or both of the determination results R X and R Y of the scanning lines in the right window are "1". If it is "0", it can be determined that the position of the pin 22 is in the left window, so "1" is set to the pin position output t (0).

【0055】また、ステップ1000において、左ウィ
ンドの走査線の判定結果LX 及びLY の少なくとも一方
若しくは両方が“0”であり、右ウィンドの走査線の判
定結果RX 及びRY が共に“1”である場合には、ピン
22の位置が右ウィンドにあると判定できるために、ピ
ン位置出力t(0)に“2”を設定する。
In step 1000, at least one or both of the left window scanning line determination results L X and L Y are "0", and the right window scanning line determination results R X and R Y are both "0". If it is "1", it can be determined that the position of the pin 22 is in the right window, so "2" is set to the pin position output t (0).

【0056】さらに、ステップ1010において、各走
査線の判定結果が上記以外の場合には、認識不可能とし
てピン位置出力t(0)に“0”を設定し、ステップ1
020からメイン制御ルーチンに回帰するものである。
Further, in step 1010, if the determination result of each scanning line is other than the above, the pin position output t (0) is set to "0" as unrecognizable, and step 1
The routine returns from 020 to the main control routine.

【0057】そして、図4に示すステップ1060にお
いて、前記ピン位置出力t(0)をロボット制御装置7
に出力して、ステップ1070において処理を終了する
ものである。
Then, in step 1060 shown in FIG. 4, the pin position output t (0) is set to the robot controller 7
To the end of the process in step 1070.

【0058】したがって、以上のピン位置検出手法にお
いては、図17に示すように極小値q1 及びq2 を検出
し、この幅とピン幅とを比較して、このピン幅と略等し
い幅を有する空間分布が存在するウィンドを認識対象物
(この場合はピン)を有する側と判定するために、画像
全体の画素を対象としないために、処理データを少なく
することができ、処理速度を速くすることができるもの
である。また、この手法によれば、従来の手法(2値化
処理等による手法)において認識不可能と判定されたも
のでも検出することが可能となるものである。
Therefore, in the above-described pin position detecting method, the minimum values q 1 and q 2 are detected as shown in FIG. 17, the width is compared with the pin width, and the width substantially equal to the pin width is determined. Since the window in which the spatial distribution has exists is determined as the side having the recognition target (in this case, the pin), the pixels of the entire image are not targeted, so that the processing data can be reduced and the processing speed can be increased. Is what you can do. In addition, according to this method, it is possible to detect even those which are determined to be unrecognizable by the conventional method (method by binarization processing or the like).

【0059】また、第2の発明によるピン位置検出方法
は、ピン22が存在する円ウィンドは2つのくぼみ(空
間分布の谷間)を有するためにくぼみを有する円ウィン
ドの階調度は低くなるという事実に基づいてピン位置を
検出するもので、このフローチャートを図18に示し、
以下このフローチャートに従って説明する。尚、第1の
発明と同様のステップは省略し、また同様の番号を付し
て説明を省略する。
Further, in the pin position detecting method according to the second aspect of the invention, since the circular window in which the pin 22 exists has two depressions (valleys in the spatial distribution), the gradation of the circular window having the depressions becomes low. The pin position is detected based on
This will be described below according to this flowchart. The same steps as those in the first aspect of the invention are omitted, and the same numbers are assigned to omit the description.

【0060】前述の第1の発明の場合、前記ステップ7
40において、2つの極小値qJ1(P1 ,G(P1 ))
及びqJ2(P2 ,G(P2 ))が設定された後、フラッ
グF1 の値によってステップ760,790,820,
840において判定値DLX,DLY,DRX,DRYが設定さ
れた。しかし、第2の発明においては、ステップ76
0’において、χ方向空間分布の極小値qJ1(P1 ,G
(P1 ))及びqJ2(P2 ,G(P2 ))から階調値G
(P1 )とG(P2 )の和を求めて、これを左ウィンド
χ方向空間分布判定値JLXと設定し(JLX←G(P1
+G(P2 ))、同様にステップ790’,820’,
840’において、左ウィンドy方向空間分布判定値J
LY,右ウィンドχ方向空間分布判定値JRX,及び右ウィ
ンドy方向空間分布判定値JRYを設定するものである。
In the case of the above-mentioned first invention, the step 7
At 40, two local minimum values q J1 (P 1 , G (P 1 ))
, And q J2 (P 2 , G (P 2 )) are set, steps 760, 790, 820, depending on the value of the flag F 1 .
At 840, the judgment values D LX , D LY , D RX , and D RY are set. However, in the second invention, step 76
At 0 ′, the minimum value of the χ-direction spatial distribution q J1 (P 1 , G
(P 1 )) and q J2 (P 2 , G (P 2 )) from the gradation value G
The sum of (P 1 ) and G (P 2 ) is calculated and set as the left window χ direction spatial distribution judgment value J LX (J LX ← G (P 1 ).
+ G (P 2 )), similarly steps 790 ′, 820 ′,
840 ′, the left window y-direction spatial distribution determination value J
LY , the right wind χ direction spatial distribution judgment value J RX , and the right window y direction spatial distribution judgment value J RY are set.

【0061】次に、ステップ2010において左ウィン
ド判定値LJ をJLXとJLYの和を求めて設定し(LJ
LX+JLY)、さらにステップ2020において右ウィ
ンド判定値RJ も同様に求める(RJ ←JRX+JRY)。
Next, at step 2010, the left window judgment value L J is set by calculating the sum of J LX and J LY (L J
J LX + J LY ), and in step 2020, the right window determination value R J is similarly obtained (R J ← J RX + J RY ).

【0062】ステップ2030においては、前記LJ
J の値が等しいか否かの判定を行い、等しい(LJ
J )場合にはステップ2040に進んで認識不可能と
してピン位置出力t(1)に“0”を設定する。また、
前記ステップ2030の判定において等しくない(LJ
≠RJ )場合には、ステップ2050に進んでLJ とR
J の大きさを比較し、LJ が大きい場合(LJ >RJ
には、ステップ2060に進んで、ピン位置が左ウィン
ド側にあるとしてピン位置出力t(1)に“1”を設定
し、RJ が大きい場合(LJ <RJ )には、ステップ2
070においてピン位置出力t(1)に“2”を設定す
るものである。
In step 2030, it is determined whether or not the values of L J and R J are equal, and they are equal (L J =
In the case of R J ), the process proceeds to step 2040 and it is determined that the pin position output t (1) cannot be recognized and “0” is set. Also,
In the determination of step 2030, they are not equal (L J
≠ R J ), go to step 2050 and proceed to L J and R
When the size of J is compared and L J is large (L J > R J ).
To step 2060, the pin position output t (1) is set to "1" assuming that the pin position is on the left window side, and if R J is large (L J <R J ), step 2
At 070, "2" is set to the pin position output t (1).

【0063】この第2の発明の手法においては、第1の
発明よりも簡単なプログラムで実行できると共に、実験
の結果として誤検出及び判定不可能の割合がほとんどな
いために、ほぼ完全な正常判定率を達成できるものであ
る。
The method of the second invention can be executed by a program simpler than that of the first invention, and as a result of the experiment, there is almost no false detection or undecidable ratio. The rate can be achieved.

【0064】また、第1及び第2の発明による手法と同
時に従来の手法を実行することにより、さらに信頼性を
向上させることもできるものである。
Further, the reliability can be further improved by executing the conventional method at the same time as the method according to the first and second inventions.

【0065】[0065]

【発明の効果】以上説明したように、第1の発明及び第
2の発明によれば、認識対象物が存在すると推定される
少なくとも2ヵ所の画像位置にウィンドを設定し、この
ウィンドの水平方向及び垂直方向に走査線を走査して1
次元濃度分布(空間分布)を検出し、この空間分布を処
理対象とするために、データ処理量を大幅に減少させる
ことができるために、処理速度を速くすることができる
と共に、認識対象物の特徴、言い換えれば第1の発明に
おいてはピンの幅、第2の発明においては階調値の低さ
を判定基準とするために、認識対象物を的確に検出する
ことができるものである。
As described above, according to the first invention and the second invention, windows are set at at least two image positions where the recognition object is estimated to exist, and the windows are set in the horizontal direction. And scan the scan line in the vertical direction to 1
Since the three-dimensional density distribution (spatial distribution) is detected and this spatial distribution is the processing target, the data processing amount can be greatly reduced, so that the processing speed can be increased and the recognition target object The feature, in other words, the width of the pin in the first aspect of the invention and the low gradation value in the second aspect of the invention are used as the determination criteria, so that the recognition target can be accurately detected.

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

【図1】(a)は画像処理装置が組み込まれた自動組立
装置の概略説明図であり、(b)は画像処理装置の構成
を示した概略説明図である。
FIG. 1A is a schematic explanatory view of an automatic assembly apparatus in which an image processing apparatus is incorporated, and FIG. 1B is a schematic explanatory view showing a configuration of the image processing apparatus.

【図2】(a)は認識対象物としてのカムディスクの一
例を示した正面図であり、(b)は平面図である。
FIG. 2A is a front view showing an example of a cam disk as an object to be recognized, and FIG. 2B is a plan view.

【図3】ビデオカメラで撮影されたカムディスクの画像
を示した説明図である。
FIG. 3 is an explanatory diagram showing an image of a cam disc taken by a video camera.

【図4】本発明の実施例に係る画像処理のメインプログ
ラムのフローチャート図である。
FIG. 4 is a flowchart of a main program for image processing according to an embodiment of the present invention.

【図5】カムディスクの中心を検出するウィンドを設定
状況を示した説明図である。
FIG. 5 is an explanatory diagram showing a setting situation of a window for detecting the center of the cam disc.

【図6】左右の円ウィンドの設定状況を示した説明図で
ある。
FIG. 6 is an explanatory diagram showing a setting situation of left and right circle windows.

【図7】第1の発明の実施例に係るピン位置検出のフロ
ーチャートの空間分布検出部分のフローチャート図であ
る。
FIG. 7 is a flowchart diagram of a spatial distribution detecting portion of the flowchart of pin position detection according to the embodiment of the first invention.

【図8】各空間分布を演算用空間分布に置換する部分の
フローチャート図である。
FIG. 8 is a flowchart of a part for replacing each spatial distribution with a calculation spatial distribution.

【図9】極小値検出部分のフローチャート図である。FIG. 9 is a flowchart of a local minimum value detecting portion.

【図10】各々の極小値以前及び以後の各画素間の差分
の最大値を求める部分のフローチャート図である。
FIG. 10 is a flowchart of a portion for obtaining a maximum value of a difference between pixels before and after each minimum value.

【図11】各極小値の尤度値を求める配列を求める部分
のフローチャート図である。
FIG. 11 is a flowchart of a portion for obtaining an array for obtaining the likelihood value of each minimum value.

【図12】各走査線の判定値を求める部分のフローチャ
ート図である。
FIG. 12 is a flowchart of a portion for obtaining a determination value for each scanning line.

【図13】ピン位置の判定を行う部分のフローチャート
図である。
FIG. 13 is a flowchart of a portion that determines a pin position.

【図14】左右の円ウィンドの走査線を設定した場合に
説明図である。
FIG. 14 is an explanatory diagram when the scanning lines of the left and right circular windows are set.

【図15】左ウィンドχ方向空間分布及び左ウィンドy
方向空間分布の特性線図である。
FIG. 15: Left wind χ direction spatial distribution and left window y
It is a characteristic diagram of directional space distribution.

【図16】右ウィンドχ方向空間分布及び右ウィンドy
方向空間分布の特性線図である。
FIG. 16: Right wind χ direction spatial distribution and right window y
It is a characteristic diagram of directional space distribution.

【図17】演算用空間分布と各極小値を示した説明図で
ある。
FIG. 17 is an explanatory diagram showing a spatial distribution for calculation and each minimum value.

【図18】第2の発明に係る実施例のピン位置検出の特
徴を示した部分フローチャート図である。
FIG. 18 is a partial flowchart showing the features of pin position detection of the embodiment according to the second invention.

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

4 ビデオカメラ 8 ロボット 20 カムディスク 22 ピン 4 Video camera 8 Robot 20 Cam disk 22 pin

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 撮像手段により撮影された画像信号を入
力してA/D変換し、記憶装置に記憶させた後、画像認
識を行う画像処理装置において、 前記撮像手段によって撮影された画像上の認識対象物が
あると推定される少なくとも左右2個所にウィンドを設
定するウィンド設定手段と、 このウィンド設定手段によって設定された左右のウィン
ド画像上を、所定の二方向に走査し、この走査線上にあ
たる画素の濃度を検出して各々の走査線の1次元濃度分
布を検出する1次元濃度分布検出手段と、 この各々の1次元濃度分布に存在する複数の極小値を検
出する極小値検出手段と、 この各々の極小値からこの極小値以前及び以後の極大値
に至る各画素間の差分を求め、この差分の最大値をこの
極小値の尤度値とする尤度値演算手段と、 この尤度値演算手段によって演算された各極小値の尤度
値から、最大の尤度値と2番目の尤度値を有する極小値
を検出し、この2つの極小値の幅を演算してこの走査線
の判定値とし、この走査線の判定値から左右のウィンド
の判定値を演算する判定値演算手段と、 少なくとも左ウィンドの判定値及び右ウィンドの判定値
と認識対象物の径とを比較し、認識対象物の径と略等し
い判定値を有するウィンドに認識対象物があることを判
定する認識対象位置判定手段とを具備することを特徴と
する画像処理装置。
1. An image processing apparatus for performing image recognition after inputting an image signal captured by an image capturing unit, performing A / D conversion, storing in a storage device, and an image on an image captured by the image capturing unit. A window setting means for setting windows at at least two left and right positions where it is presumed that there is a recognition object, and left and right window images set by the window setting means are scanned in predetermined two directions and hit the scanning line. A one-dimensional density distribution detecting means for detecting a density of a pixel to detect a one-dimensional density distribution of each scanning line; and a minimum value detecting means for detecting a plurality of minimum values existing in each one-dimensional density distribution, Likelihood value calculation means for obtaining the difference between each pixel from each of these local minimum values to the local maximum values before and after this local minimum value, and using the maximum value of this difference as the likelihood value of this local minimum value; The minimum value having the maximum likelihood value and the second likelihood value is detected from the likelihood value of each minimum value calculated by the calculating means, and the width of these two minimum values is calculated to calculate the width of this scanning line. The judgment value is used as a judgment value, and the judgment value calculating means for calculating the judgment values of the left and right windows from the judgment value of this scanning line is compared with the judgment value of at least the judgment value of the left window and the judgment value of the right window and the diameter of the recognition target to recognize An image processing apparatus, comprising: a recognition target position determination unit that determines that a recognition target object is present in a window having a determination value substantially equal to the diameter of the target object.
【請求項2】 撮像手段により撮影された画像信号を入
力してA/D変換し、記憶装置に記憶させた後、画像認
識を行う画像処理装置において、 前記撮像手段によって撮影された画像上の認識対象物が
あると推定される少なくとも左右2個所にウィンドを設
定するウィンド設定手段と、 このウィンド設定手段によって設定された左右のウィン
ド画像上を、所定の二方向に走査し、この走査線上にあ
たる画素の濃度を検出して各々の走査線の1次元濃度分
布を検出する1次元濃度分布検出手段と、 この各々の1次元濃度分布に存在する複数の極小値を検
出する極小値検出手段と、 この各々の極小値からこの極小値以前及び以後の極大値
に至る各画素間の差分を求め、この差分の最大値をこの
極小値の尤度値とする尤度値演算手段と、 この尤度値演算手段によって演算された各極小値の尤度
値から、最大の尤度値と2番目の尤度値を有する極小値
を検出し、この2つの極小値の濃度値から走査線の判定
値を演算し、さらに各ウィンドを走査する2本の走査線
の判定値から左右のウィンドの判定値を演算する判定値
演算手段と、 少なくとも左ウィンドの判定値及び右ウィンドの判定値
を比較して、低い判定値を有するウィンドに認識対象物
があることを判定する認識対象位置判定手段とを具備す
ることを特徴とする画像処理装置。
2. An image processing apparatus for performing image recognition after inputting an image signal photographed by the image pickup means, A / D converting it, and storing it in a storage device. A window setting means for setting windows at at least two left and right positions where it is presumed that there is a recognition object, and left and right window images set by the window setting means are scanned in predetermined two directions and hit the scanning line. A one-dimensional density distribution detecting means for detecting a density of a pixel to detect a one-dimensional density distribution of each scanning line; and a minimum value detecting means for detecting a plurality of minimum values existing in each one-dimensional density distribution, Likelihood value calculation means for obtaining the difference between each pixel from each of these local minimum values to the local maximum values before and after this local minimum value, and using the maximum value of this difference as the likelihood value of this local minimum value; The minimum value having the maximum likelihood value and the second likelihood value is detected from the likelihood value of each minimum value calculated by the calculating means, and the determination value of the scanning line is obtained from the density value of these two minimum values. Comparing at least the judgment value of the left window and the judgment value of the right window with the judgment value calculating means for calculating the judgment values of the left and right windows from the judgment values of the two scanning lines for scanning each window. An image processing apparatus, comprising: a recognition target position determination unit that determines that a recognition target object is present in a window having a low determination value.
JP17019092A 1992-06-04 1992-06-04 Picture processor Pending JPH05342356A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17019092A JPH05342356A (en) 1992-06-04 1992-06-04 Picture processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17019092A JPH05342356A (en) 1992-06-04 1992-06-04 Picture processor

Publications (1)

Publication Number Publication Date
JPH05342356A true JPH05342356A (en) 1993-12-24

Family

ID=15900351

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17019092A Pending JPH05342356A (en) 1992-06-04 1992-06-04 Picture processor

Country Status (1)

Country Link
JP (1) JPH05342356A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6148097A (en) * 1995-06-07 2000-11-14 Asahi Kogaku Kogyo Kabushiki Kaisha Optical member inspecting apparatus and method of inspection thereof
JP2010097435A (en) * 2008-10-16 2010-04-30 Fujitsu Ltd Analysis apparatus, analysis method and analysis program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6148097A (en) * 1995-06-07 2000-11-14 Asahi Kogaku Kogyo Kabushiki Kaisha Optical member inspecting apparatus and method of inspection thereof
JP2010097435A (en) * 2008-10-16 2010-04-30 Fujitsu Ltd Analysis apparatus, analysis method and analysis program

Similar Documents

Publication Publication Date Title
US7729516B2 (en) Ranging device utilizing image processing
US6298157B1 (en) Locating and aligning embedded images
US6549644B1 (en) Face-image processing apparatus
US7330592B2 (en) Method and apparatus for detecting the location and luminance transition range of slant image edges
KR101236223B1 (en) Method for detecting traffic lane
KR101397905B1 (en) Apparatus and method for media image detection, and system with the same
JP3164003B2 (en) Mounted parts inspection device
JPH05342356A (en) Picture processor
US7027637B2 (en) Adaptive threshold determination for ball grid array component modeling
JP2001307017A (en) Character plate recognizing device
JP2006047077A (en) Method and device for detecting line defects of screen
JP2007272785A (en) Image processing type vehicle detector and image processing type vehicle detection method
JP3507857B2 (en) Traffic flow detector
JPH10283478A (en) Method for extracting feature and and device for recognizing object using the same method
JPH08101139A (en) Defect inspection method and device
JPH07280746A (en) Apparatus for extracting flaw from metal plate surface
JP2654294B2 (en) Edge detection method
JPH0883390A (en) Vehicle recognizing device
JPH08272933A (en) Line recognizing method
JP4532972B2 (en) Same target judging device, same target judging method and program
JP2949089B2 (en) Image processing device
JPH05334436A (en) Image processor
JPH07141465A (en) Method for detecting inclination of document image
JPH0797410B2 (en) Image processing method
JP4691644B2 (en) Medium position detection method and medium recognition apparatus