[go: up one dir, main page]

JP2001175865A - Image processing method and its device - Google Patents

Image processing method and its device

Info

Publication number
JP2001175865A
JP2001175865A JP36362899A JP36362899A JP2001175865A JP 2001175865 A JP2001175865 A JP 2001175865A JP 36362899 A JP36362899 A JP 36362899A JP 36362899 A JP36362899 A JP 36362899A JP 2001175865 A JP2001175865 A JP 2001175865A
Authority
JP
Japan
Prior art keywords
difference
image
pixel
processing
teaching
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
JP36362899A
Other languages
Japanese (ja)
Inventor
Yoshihito Hashimoto
良仁 橋本
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.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works Ltd
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 Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP36362899A priority Critical patent/JP2001175865A/en
Publication of JP2001175865A publication Critical patent/JP2001175865A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an image processing method and its device which can perform a difference process corresponding to the importance of inspection and make an accurate nondefective/defective decision. SOLUTION: When a program stored in a program storage memory 4 is executed, a CPU 6 performs a difference process for calculating a luminance difference by putting a previously registered instruction image over a picked-up image of an object of inspection obtained by a TV camera 1, and performs multiplication by previously registered values of weight (deviation data) by pixels of the instruction image of the object to recalculate a difference value. The recalculated value is compared with a threshold to judge whether the object of inspection is nondefective or defective.

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 method and apparatus for performing inspection processing on an image obtained by imaging an object to be inspected and determining whether the object is good or defective. .

【0002】[0002]

【従来の技術】画像処理装置を用いて検査対象物(対象
ワーク)の良/不良判定を検査を行う場合、予め登楼し
てある対象物(ワーク)の画像パターン(教示画像)を
検査対象物を撮像して得られた検査画像に重ね合わせ、
対応する画素毎に両者の輝度差の絶対値を計算し、オペ
レータが別途設定した輝度の差分閾値を越えた領域の総
面積を計算し、その面積値と差分面積閾値とを比較して
良/不良を行う方法が従来とられていた。
2. Description of the Related Art When inspecting the quality of an inspection object (object work) by using an image processing apparatus, an image pattern (teaching image) of the object (work) that has been climbed in advance is inspected. Is superimposed on the inspection image obtained by imaging
The absolute value of the luminance difference between the two is calculated for each corresponding pixel, the total area of the region exceeding the luminance difference threshold separately set by the operator is calculated, and the area value is compared with the difference area threshold to determine whether the area is good or bad. Conventionally, a method of performing the defect has been adopted.

【0003】[0003]

【発明が解決しようとする課題】上記の従来方法の場
合、上記輝度の差分閾値が教示画像中の全画素に対して
一定値で設定されており、良/不良の判定に対する重要
度にかかわらず、差分閾値を超えた全ての画素の総面積
が計算されていた。また対象物の輪郭付近の画像は、撮
像系の不安定さによって輝度が微妙に変化し良品に対す
る処理結果に対してもこの部分の差が出やすいという問
題があった。
In the case of the above-mentioned conventional method, the above-mentioned luminance difference threshold value is set to a constant value for all pixels in the teaching image, regardless of the importance for good / bad judgment. , The total area of all pixels exceeding the difference threshold has been calculated. Further, the brightness of an image near the contour of the object slightly changes due to the instability of the imaging system, and there is a problem that a difference in this portion is likely to occur even in a processing result for a good product.

【0004】この問題を解消するために上記の部分にマ
スク処理を施し、検査対象から完全に外す手法もある
が、この付近は検査部位としては重要な部分であって、
輪郭形状の大きな違いに対しては差分を出力する必要が
あり、完全に処理対象から外すことはできなかった。
[0004] In order to solve this problem, there is a method of performing a masking process on the above-mentioned portion to completely remove the portion from the inspection target. However, this area is an important portion as an inspection portion.
It was necessary to output a difference for a large difference in the outline shape, and it could not be completely excluded from the processing target.

【0005】また、対象物によっては、部位により判定
の重要度がまちまちで、重要度が高い部分はわずかな差
でも差分と認識する必要があり、逆に重要でない部分
は、かなり大きな差が出るまで差分と認識しないほうが
望ましい場合もある。
[0005] In addition, depending on the object, the importance of the judgment is different depending on the part, and it is necessary to recognize a part having a high importance as a difference even if a slight difference is obtained. In some cases, it is desirable not to recognize the difference as a difference.

【0006】しかしながら、従来方法では全画素に対し
て一定の閾値を設定するため、上述のような条件を満た
す差分閾値及び差分面積閾値をオペレータが決定するの
は困難あるいは不可能であった。
However, in the conventional method, since a fixed threshold value is set for all pixels, it is difficult or impossible for an operator to determine a difference threshold value and a difference area threshold value that satisfy the above-described conditions.

【0007】本発明は、上記の点に鑑みて為されたもの
で、その目的とするところは、教示画像内の部位で重要
度が異なる場合や、撮像系の影響で輪郭が微妙に変化す
る場合でも、その影響を取り除き、検査上の重要度に応
じた差分処理が実行でき、正確に良/不良の判定が行え
る画像処理方法及びその装置を提供することにある。
SUMMARY OF THE INVENTION The present invention has been made in view of the above points, and has as its object the case where the contours are subtly changed due to the difference in importance between portions in a teaching image or the influence of an imaging system. Even in such a case, it is an object of the present invention to provide an image processing method and an image processing method capable of removing the influence thereof, executing a difference process according to the degree of importance in inspection, and accurately determining good / bad.

【0008】[0008]

【課題を解決するための手段】請求項1の発明では、予
め登楼してある対象物の教示画像と検査対象物を撮像し
て得られ撮像画像との各画素間の輝度の差を計算する差
分処理を行い、計算して得られる差分結果が予め設定さ
れている差分閾値を超えた画素の総面積を出力する画像
処理方法において、教示画像の各画素毎に重みを設定
し、重要度の低い画素に対しては差分結果を差分閾値に
等しくして当該画素の面積を、差分閾値を越えた画素の
面積にカウントせず差分と認識しないようにすることを
特徴とする。
According to the first aspect of the present invention, a difference in luminance between each pixel is calculated between a teaching image of an object which has been climbed in advance and an inspection image obtained by imaging an inspection object. In an image processing method of performing a difference process and outputting a total area of pixels whose difference result obtained by calculation exceeds a preset difference threshold, a weight is set for each pixel of the teaching image, For a low pixel, the difference result is made equal to the difference threshold, and the area of the pixel is not counted as the area of the pixel exceeding the difference threshold, so that the difference is not recognized as a difference.

【0009】請求項2の発明では、請求項1の発明にお
いて、上記教示画像の各画素毎に重みの設定は、教示画
像と、良品であることが既知である検査対象物の複数の
撮像画像との間において差分処理を行い、差分閾値を超
えた画素に対しては、差分結果が閾値以下となるように
重みを0〜1.0の範囲で自動計算する処理により行う
ことを特徴とする。
According to a second aspect of the present invention, in the first aspect of the present invention, the setting of the weight for each pixel of the teaching image includes the teaching image and a plurality of picked-up images of the inspection object known to be good. , And for pixels exceeding the difference threshold, the weight is automatically calculated in a range of 0 to 1.0 so that the difference result is equal to or smaller than the threshold. .

【0010】請求項3の発明では、請求項1の発明にお
いて、上記教示画像の各画素毎に重みの設定は、手動に
より行うことを特徴とする。
According to a third aspect of the present invention, in the first aspect of the present invention, the setting of the weight for each pixel of the teaching image is manually performed.

【0011】請求項4の発明では、請求項1乃至3の何
れかの発明において、上記差分処理の実行前に、予め上
記教示画像を用いて上記撮像画像のパターンマッチング
処理を行って、パターンマッチング処理によって得られ
た一致度が所定の閾値を超えた位置及び回転角度を複数
候補検出し、その複数候補を差分処理の対象箇所とし
て、夫々の対象箇所に上記差分処理を実行することを特
徴とする。
According to a fourth aspect of the present invention, in any one of the first to third aspects of the present invention, before the execution of the difference processing, a pattern matching process of the captured image is performed by using the teaching image in advance. Detecting a plurality of candidates for a position and a rotation angle at which the degree of coincidence obtained by the processing exceeds a predetermined threshold, performing the above-described difference processing on each of the plurality of candidates as a target of the difference processing; I do.

【0012】請求項5の発明では、請求項1乃至3の何
れかの発明において、上記差分処理の実行前に、予め上
記教示画像を用いて上記撮像画像のパターンマッチング
処理を行って、パターンマッチング処理によって得られ
た一致度が所定の閾値を超えた位置及び回転角度を複数
候補検出し、これらの複数候補の位置近傍領域で位置及
び回転角度を変えながら上記差分処理を実行し、各候補
の位置毎に差分面積値が最小となった場合の結果を最終
結果として出力することを特徴とする。
According to a fifth aspect of the present invention, in any one of the first to third aspects of the present invention, before the execution of the difference processing, a pattern matching process of the captured image is performed by using the teaching image in advance. A plurality of positions and rotation angles at which the degree of coincidence obtained by the processing exceeds a predetermined threshold are detected, and the above-described difference processing is performed while changing the positions and rotation angles in the vicinity of the positions of the plurality of candidates, and each candidate is detected. It is characterized in that a result when the difference area value becomes minimum for each position is output as a final result.

【0013】請求項6の発明では、TVカメラで検査対
象物の撮像画像と、予めメモリに登録しておいた対象物
の教示画像との各画素間の輝度の差を計算する差分処理
を行う処理手段をを備え、これら検出した複数候補を差
分処理の対象箇所として、夫々の対象箇所に対して上記
差分処理を実行する備え、計算して得られる差分結果が
予め設定されている差分閾値を超えた画素の総面積を出
力する画像処理装置において、教示画像の各画素毎に重
みを設定し、重要度の低い画素に対しては差分結果を差
分閾値に等しくする処理を行う手段をを備え、これら検
出した複数候補を差分処理の対象箇所として、夫々の対
象箇所に対して上記差分処理を実行する備え、当該画素
の面積を、差分閾値を越えた画素の面積にカウントせず
差分と認識しないようにすることを特徴とする。
According to the sixth aspect of the present invention, a difference process for calculating a difference in luminance between each pixel between a captured image of the inspection object by the TV camera and a teaching image of the object registered in the memory in advance is performed. Processing means, the plurality of detected candidates are set as target portions of the difference processing, and the difference processing is performed on each of the target portions, and a difference result obtained by calculation is set to a predetermined difference threshold value. The image processing apparatus for outputting the total area of the exceeded pixels includes a means for setting a weight for each pixel of the teaching image, and performing a process of making a difference result equal to a difference threshold value for a pixel of low importance. Preparing the detected plurality of candidates as target positions for the difference processing and executing the above-described difference processing on each target portion, and recognizes the area of the pixel as a difference without counting the area of the pixel exceeding the difference threshold. do not do And wherein the Unisuru.

【0014】請求項7の発明では、請求項6の発明にお
いて、上記教示画像の各画素毎に重みの設定は、教示画
像と、良品であることが既知である検査対象物の複数の
撮像画像との間において差分処理を行い、差分閾値を超
えた画素に対しては、差分結果が閾値以下となるように
重みを0〜1.0の範囲で自動計算する計算手段により
行うことを特徴とする。
According to a seventh aspect of the present invention, in the sixth aspect of the present invention, the setting of the weight for each pixel of the teaching image includes the teaching image and a plurality of picked-up images of the inspection object known to be good. The difference processing is performed between pixels, and for a pixel exceeding the difference threshold, the weight is automatically calculated in a range of 0 to 1.0 so that the difference result is equal to or less than the threshold, and the calculation is performed by calculation means. I do.

【0015】請求項8の発明では、請求項6の発明にお
いて、上記教示画像の各画素毎に重みの設定は、手動操
作手段による入力設定であることを特徴とする。
According to an eighth aspect of the present invention, in the sixth aspect of the present invention, the setting of the weight for each pixel of the teaching image is an input setting by manual operation means.

【0016】請求項9の発明では、請求項6乃至8の何
れかの発明において、上記差分処理の実行前に、予め上
記教示画像を用いて上記撮像画像のパターンマッチング
処理を行って、パターンマッチング処理によって得られ
た一致度が所定の閾値を超えた位置及び回転角度を複数
候補を自動検出する手段をを備え、これら検出した複数
候補を差分処理の対象箇所として、夫々の対象箇所に対
して上記差分処理を実行することを特徴とする。
According to a ninth aspect of the present invention, in any one of the sixth to eighth aspects, a pattern matching process of the captured image is performed in advance using the teaching image before the execution of the difference process. A means for automatically detecting a plurality of candidates for a position and a rotation angle at which the degree of coincidence obtained by the processing exceeds a predetermined threshold value, and using these detected plurality of candidates as target places for difference processing, for each target place The difference processing is performed.

【0017】請求項10の発明では、請求項6乃至8の
何れかの発明において、上記差分処理の実行前に、予め
上記教示画像を用いて上記撮像画像のパターンマッチン
グ処理を行って、パターンマッチング処理によって得ら
れた一致度が所定の閾値を超えた位置及び回転角度を複
数候補を自動検出する手段を備えるとともに、これら検
出した複数候補の位置近傍領域で位置及び回転角度を変
えながら上記差分処理を実行し、各候補の位置毎に差分
面積値が最小となった場合の結果を最終結果として出力
する手段を備えたことを特徴とする。
According to a tenth aspect of the present invention, in any one of the sixth to eighth aspects of the present invention, before the execution of the difference processing, a pattern matching process of the captured image is performed in advance by using the teaching image to perform pattern matching. Means for automatically detecting a plurality of candidates for the position and the rotation angle at which the degree of coincidence obtained by the processing exceeds a predetermined threshold value, and performing the difference processing while changing the position and the rotation angle in a region near the position of the detected plurality of candidates. And outputting a result when the difference area value becomes minimum for each position of each candidate as a final result.

【0018】[0018]

【発明の実施の形態】以下本発明を実施形態により説明
する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described below with reference to embodiments.

【0019】(実施形態1)図1は本発明の画像処理装
置の全体構成を示しており、本装置は、検査対象物を撮
像するTVカメラ1と、撮像して得られたアナログの画
像データをデジタル画像データに変換するA/Dコンバ
ータ2と、A/Dコンバータ2でデジタル化された画像
データを記録する画像メモリ3と、画像処理方法のプロ
グラムや画像処理用のデータを格納したプログラム格納
用メモリ4と、処理実行用のメインメモリ5と、画像処
理等の処理実行を行うCPU6と、検査対象物の撮像画
像や、画像処理中の処理画像などを映し出すためのモニ
タ7と、モニタ7に映し出すためのアナログ画像データ
をデジタル画像データよりD/A変換して得るためのD
/Aコンバータ8と、TVカメラ1から画像メモリ3
へ、画像メモリ3からD/Aコンバータ7を介してモニ
タ8へ,CPU6から画像メモリ3へという接続の制御
を行うコントローラPLDとから構成される。尚TVカ
メラ1から画像メモリ3へ、画像メモリ3からD/Aコ
ンバータ7を介してモニタ8へ,CPU6から画像メモ
リ3へという接続は2つ以上同時に行われないように制
御される。
(Embodiment 1) FIG. 1 shows an overall configuration of an image processing apparatus according to the present invention. The apparatus comprises a TV camera 1 for imaging an inspection object, and analog image data obtained by imaging. A / D converter 2 for converting image data into digital image data, image memory 3 for storing image data digitized by A / D converter 2, and a program storing a program for an image processing method and data for image processing Memory 4, a main memory 5 for executing processing, a CPU 6 for executing processing such as image processing, a monitor 7 for displaying a captured image of an inspection object, a processed image during image processing, and the like, and a monitor 7 D / A conversion for obtaining analog image data to be projected on
/ A converter 8, TV camera 1 to image memory 3
And a controller PLD for controlling connection from the image memory 3 to the monitor 8 via the D / A converter 7 and from the CPU 6 to the image memory 3. The connection from the TV camera 1 to the image memory 3, from the image memory 3 to the monitor 8 via the D / A converter 7, and from the CPU 6 to the image memory 3 is controlled so that two or more connections are not made simultaneously.

【0020】而して装置をスタートさせると、CPU6
はプログラム格納用メモリ4から本実施形態の画像処理
方法のプログラム及び処理用のデータを読み出してメイ
ンメモリ5上で本実施形態の画像処理方法の処理を実行
する。
When the apparatus is started, the CPU 6
Reads the program and the data for processing of the image processing method of the present embodiment from the program storage memory 4 and executes the processing of the image processing method of the present embodiment on the main memory 5.

【0021】次に本実施形態の画像処理方法について説
明する。
Next, an image processing method according to the present embodiment will be described.

【0022】まず本実施形態では対象物の教示画像の各
画素毎に重み(偏差データ)を設定しておき、教示画像
と、検査対象物の撮像画像の輝度差にこの重みの値を乗
じて差分値を再計算し、その計算結果と、閾値とを比較
する処理を行う。ここで重みは重要度の低い、或いは大
きい輝度差まで許容可能な画素に対しては重みを小さく
して、輝度差に対する感度を小さくし、差として認識さ
れにくくする。
First, in the present embodiment, a weight (deviation data) is set for each pixel of the teaching image of the object, and the luminance difference between the teaching image and the captured image of the inspection object is multiplied by the value of the weight. The difference value is recalculated, and a process of comparing the calculation result with the threshold value is performed. Here, the weight is set to a small value for a pixel that can accept a luminance difference with a low importance or a large luminance, thereby reducing the sensitivity to the luminance difference and making it difficult to recognize the difference.

【0023】例えば図2(a)に示すように基準となる
対象物Wの教示画像Aに対して、検査対象物W’が撮像
された画像A’では検査対象物W’の画像が図2(b)
に示すように教示画像Aの対象物Wの画像よりも細くな
っているだけでは、不良と判断したくなく、図2(c)
(d)に示すように検査対象物W外の異物Xのみを差と
して認識したい場合には、輪郭付近の輝度差は差としな
い処理を行うのである。
For example, as shown in FIG. 2A, an image A 'of the inspection object W' is taken as an image of the inspection object W 'with respect to the teaching image A of the object W as a reference. (B)
As shown in FIG. 2, if the teaching image A is thinner than the image of the target object W, the user does not want to judge that the object is defective.
As shown in (d), when it is desired to recognize only the foreign matter X outside the inspection object W as a difference, a process is performed in which the luminance difference near the contour is not regarded as a difference.

【0024】つまり教示画像Aに検査対象物W’の撮像
画像A’を重ねて各画素の輝度差を求める差分処理によ
り得られた結果に対して各画素毎に重みの値(偏差デー
タ)を乗じ、差分結果として認識したくない部分(図2
(b)のような検査対象物W’の輪郭部分)を閾値と等
しく(或いはそれより小さく)となるように差分結果に
対してCPU6は修正処理を行う。
That is, a weight value (deviation data) is calculated for each pixel with respect to the result obtained by superimposing the captured image A 'of the inspection object W' on the teaching image A and calculating the luminance difference of each pixel. The part that you do not want to recognize as the result of multiplication and difference (Fig. 2
The CPU 6 performs a correction process on the difference result so that the contour portion of the inspection object W ′ as in (b) becomes equal to (or smaller than) the threshold value.

【0025】このときの計算式は以下の式(1)の通り
である。
The calculation formula at this time is as the following formula (1).

【0026】 diff(x,y)=|f(x,y)−g(x,y)|×h(x,y) …(1) diff(x,y) :座標(x,y)の差分結果 f(x,y) :座標(x,y)の検査画像輝度値 g(x,y) :座標(x,y)の教示画像輝度値 h(x,y) :座標(x,y)の偏差データ 但し、座標は画素単位 図3(a)は輪郭部分で輝度値が変動する領域(黒塗り
部分)を示し、同図(b)は偏差データの設定状態を示
しており、図示例では対象物の画像の輪郭部分に対して
0.75を、またその他の部分に対して1.0を設定し
ている。
Diff (x, y) = | f (x, y) −g (x, y) | × h (x, y) (1) diff (x, y): coordinates (x, y) F (x, y): Inspection image luminance value at coordinates (x, y) g (x, y): Teach image luminance value at coordinates (x, y) h (x, y): Coordinates (x, y) y) Deviation data where coordinates are in pixel units. FIG. 3A shows an area where the luminance value fluctuates in the outline portion (black portion), and FIG. 3B shows a setting state of the deviation data. In the illustrated example, 0.75 is set for the contour portion of the image of the target object, and 1.0 is set for other portions.

【0027】さて図2(b)の検査対象物W’の撮像画
像A’についての処理過程を図4により説明する。
Now, the processing procedure for the picked-up image A 'of the inspection object W' in FIG. 2B will be described with reference to FIG.

【0028】まず図4(a)に示すように得られた検査
対象物W’の撮像画像A’(図2(b)の画像A’に相
当)と、教示画像A(図2(a)の画像)とを重ねると
図4(b)のように輪郭部分に輝度差が大きく現れ(黒
く塗った部分)、差分処理によりこの輝度差の値が計算
される。この差分結果が128であったすると、良、不
良の判定の差分閾値が例えば96である場合には差分結
果が閾値を越えることになるが、本実施形態の処理では
上記の偏差データを各画素に設定してあるため、輪郭部
分の差分結果(128)に対し偏差データの値0.75
が乗じられ、その乗じた結果と閾値との比較を行う(図
4(c))。ここで128×0.75≦閾値であ
るため、閾値を基準に2値化して得られる画像は図4
(d)のようになり、検査は(良品)と判断される。
First, a captured image A '(corresponding to the image A' in FIG. 2B) of the inspection object W 'obtained as shown in FIG. 4A and a teaching image A (FIG. 2A) 4 (b), a large luminance difference appears in the outline portion (the portion painted black), and the value of this luminance difference is calculated by the difference processing. If the difference result is 128, the difference result exceeds the threshold if the difference threshold value for good / bad judgment is, for example, 96. However, in the processing of the present embodiment, the above-described deviation data is calculated for each pixel. , The deviation data value of 0.75
Is multiplied, and the result of the multiplication is compared with a threshold value (FIG. 4C). Here, since 128 × 0.75≤threshold, an image obtained by binarization based on the threshold is shown in FIG.
As shown in (d), the inspection is determined to be (non-defective).

【0029】次に図2(c)の検査対象物W’の撮像画
像A’についての処理過程を図5により説明する。
Next, the processing procedure for the picked-up image A 'of the inspection object W' in FIG. 2C will be described with reference to FIG.

【0030】まず図5(a)に示すように得られた検査
対象物W’の撮像画像A’(図2(c)の対象物の画像
A’に相当)と、教示画像Aとを重ねると図5(b)の
ように輪郭部分と、異物Xの部分とに輝度差が大きく現
れ(黒く塗った部分)、差分処理によりこの輝度差の値
が計算される。この差分結果が夫々128であったする
と、差分閾値の96を越えることになるが、本実施形態
の処理では上記の偏差データを各画素に設定してあるた
め、輪郭部分の差分結果(128)に対し偏差データの
値0.75が乗じられ、また異物Xの部分の差分結果
(128)に偏差データの値1が乗じられ、その乗じた
結果と閾値との比較を行う(図5(c))。ここで輪郭
部分では128×0.75≦閾値であるが、異物
Xの部分では128×1>閾値となるため、閾値
を基準にして2値化して得られる画像には図5(d)の
ように異物X部分が抽出される結果となり、この抽出さ
れた画素の面積のカウントが行われ、カウント値と差分
面積値との比較により良/不良が判断される。この場合
は予め設定している差分面積値よりも大きいため(不良
品)と判断される。
First, the captured image A ′ of the inspection object W ′ (corresponding to the image A ′ of the object in FIG. 2C) obtained as shown in FIG. 5A and the teaching image A are superimposed. 5 (b), a large luminance difference appears between the contour portion and the portion of the foreign matter X (the portion painted black), and the value of the luminance difference is calculated by the difference processing. If each of the difference results is 128, it exceeds the difference threshold value of 96. However, in the processing of this embodiment, since the above-described deviation data is set for each pixel, the difference result (128) Is multiplied by the deviation data value 0.75, the difference result (128) of the portion of the foreign matter X is multiplied by the deviation data value 1, and the result of the multiplication is compared with a threshold value (FIG. 5C )). Here, 128 × 0.75≤threshold in the contour portion, but 128 × 1 > threshold in the portion of the foreign matter X. Therefore, an image obtained by binarization based on the threshold value is shown in FIG. As a result, the foreign matter X portion is extracted, the area of the extracted pixel is counted, and the pass / fail is determined by comparing the count value with the difference area value. In this case, since it is larger than the difference area value set in advance, it is determined to be (defective).

【0031】また図2(d)の検査対象物W’の撮像画
像A’についての処理過程を図6により説明する。
Further, the processing procedure for the picked-up image A 'of the inspection object W' in FIG. 2D will be described with reference to FIG.

【0032】まず図6(a)に示すように得られた検査
対象物W’の撮像画像A’(図2(c)の対象物の画像
A’に相当)と、教示画像Aとを重ねると、撮像画像
A’の検査対象物W’と教示画像Aの対象物Wの輪郭の
位置が一致するため、両者の輝度差は0であるが、異物
Xが撮像画像A’には撮像されているため図6(b)の
ように異物Xの部分に輝度差が大きく現れ(黒く塗った
部分)、差分処理によりこの輝度差の値が計算される。
この差分結果が128であったすると、偏差データの値
1を乗じても差分閾値の96を越えることになる(図6
(c))。そのため偏差データの値を乗じても差分閾値
を基準にして2値化して得られる画像には図5(d)の
ように異物X部分が抽出される結果となり、上記と同様
に検査は(不良品)と判断される。
First, a captured image A ′ of the inspection object W ′ (corresponding to the image A ′ of the object in FIG. 2C) obtained as shown in FIG. And the position of the contour of the inspection object W 'in the captured image A' matches the position of the contour of the object W in the teaching image A, so that the luminance difference between the two is 0, but the foreign matter X is captured in the captured image A ' Therefore, as shown in FIG. 6B, a large luminance difference appears in the portion of the foreign matter X (a portion painted black), and the value of the luminance difference is calculated by the difference processing.
If the difference result is 128, even if multiplied by the value 1 of the deviation data, it exceeds the difference threshold value of 96 (FIG. 6).
(C)). Therefore, even if multiplied by the value of the deviation data, the image obtained by binarization based on the difference threshold value results in the extraction of the foreign matter X portion as shown in FIG. 5D. Good).

【0033】ところで本実施形態では上述した各画素毎
の偏差データはCPU6の計算処理により自動に決定す
る。つまり良品であることが既知である検査対象物W’
の複数の撮像画像A’と教示画像Aとの間の差分処理を
行い、差分閾値を超えた画素に対しては、輝度差の値が
閾値が等しく(或いはそれより小さく)なるように重み
を0〜1.0の範囲で自動的に調整する。
In the present embodiment, the above-described deviation data for each pixel is automatically determined by calculation processing of the CPU 6. In other words, the inspection object W 'that is known to be good
Is performed between the plurality of captured images A ′ and the teaching image A, and weighting is performed on the pixels exceeding the difference threshold so that the luminance difference value becomes equal to (or smaller than) the threshold value. Automatic adjustment within the range of 0 to 1.0.

【0034】つまり最初に、偏差データ(h_o1d)を全て
1.0に設定し、差分処理を実行する。この実行結果を
基に、差分閾値による2値化処理で”1”になった画素
に以下の式(2)で偏差データ(h_new)の計算を行う。
図7にこの結果を示す。この図7(a)は差分閾値によ
り2値化処理で”1”でなった部位を黒く塗りつぶして
示しており、図7(b)は偏差データの計算結果を示し
ており、例えば白色部分が値が1、斜線部分の値が0・
75と設定される。
That is, first, all the deviation data (h_o1d) are set to 1.0, and the difference processing is executed. Based on this execution result, the deviation data (h_new) is calculated by the following equation (2) for the pixel that has become “1” in the binarization processing using the difference threshold.
FIG. 7 shows the result. FIG. 7A shows a portion which has become “1” in the binarization process using a difference threshold by blacking it out, and FIG. 7B shows a calculation result of the deviation data. The value is 1 and the value in the shaded area is 0
75 is set.

【0035】 diff(x,y)=|f(x,y)−g(x,y)|×h_o1d(x,y) h_new(x,y)=threshold/diff(x,y) if diff(x,y)>threshold …(2) h_new(x,y)=h_old (x,y) othewrwise h_new(x,y) :新規に計算された座標(x,y)の偏差データ h_old(x,y) :前回の座標(x,y)の偏差データ diff (x,y) :座標(x,y)の差分結果 threshold :差分閾値 f(x,y) :座標(x,y)の検査画像輝度値 g(x,y) :座標(X,y)の教示画像輝度値 但し、座標は画素単位 2回目以降は前回の偏差データを基に差分値を計算し、
式(2)の処理を行う。この処理を用意した撮像画像
A’の分だけ繰り返す。検査を続けていくなかで、設定
した重みで十分対応できない検査対象物W’が現れた場
合は、同様の処理を行い偏差データにさらに修正を加え
る。
Diff (x, y) = | f (x, y) −g (x, y) | × h_o1d (x, y) h_new (x, y) = threshold / diff (x, y) if diff (x, y)> threshold (2) h_new (x, y) = h_old (x, y) othewrwise h_new (x, y): Deviation data of newly calculated coordinates (x, y) h_old (x, y): Deviation data of previous coordinates (x, y) diff (x, y): Difference result of coordinates (x, y) threshold: Difference threshold f (x, y): Inspection image of coordinates (x, y) Luminance value g (x, y): luminance value of the teaching image at coordinates (X, y) where the coordinates are pixel units. From the second time on, the difference value is calculated based on the previous deviation data.
The processing of equation (2) is performed. This process is repeated for the prepared image A '. When the inspection object W ′ that cannot be sufficiently dealt with by the set weight appears while the inspection is continued, the same processing is performed to further correct the deviation data.

【0036】以上のようにして本実施形態では、各画素
毎に偏差データの値を自動的に設定するである。
As described above, in this embodiment, the value of the deviation data is automatically set for each pixel.

【0037】(実施形態2)実施形態1の場合には、偏
差データの値を自動設定するに当たり、複数の検査対象
物を用意しなければならない。また、予め偏差データの
値を変更する部位が既知である場合、余分な手間がかか
る。
(Embodiment 2) In the case of Embodiment 1, in automatically setting the value of the deviation data, a plurality of inspection objects must be prepared. In addition, when the part where the value of the deviation data is changed is known in advance, extra time is required.

【0038】そこで、本実施形態では、画像処理装置を
取り扱うオペレータが直接各画素の重みを設定する。こ
れにより、設定前に複数の撮像画像を用意する必要がな
く画素間の重要度の違いがはっきりしている場合や、熟
練のオペレータが操作する場合は、設定時の作業を軽減
することができる。また検査を続けていくなかで、設定
した重みで十分対応できない検査対象物が現れた場合
は、実施形態1の処理を行い偏差データにさらに修正を
加えることができる。
Therefore, in this embodiment, the operator handling the image processing apparatus directly sets the weight of each pixel. Accordingly, when there is no need to prepare a plurality of captured images before setting and the difference in importance between pixels is clear, or when a skilled operator operates, the work at the time of setting can be reduced. . In the case where an inspection object that cannot be sufficiently dealt with with the set weight appears during the continuation of the inspection, the processing of the first embodiment can be performed to further correct the deviation data.

【0039】尚本実施形態ではオペレータが重み付けの
操作を行う手段としてキーボードやポインティングデバ
イスなどを画像処理装置に具備し、それらの入力操作の
データをCPU6が処理するのは言うまでもない。
In this embodiment, it is needless to say that a keyboard, a pointing device and the like are provided in the image processing device as means for the operator to perform the weighting operation, and the data of the input operation is processed by the CPU 6.

【0040】(実施形態3)上記の実施形態1,2の差
分処理では、何らかの方法によって教示画像と検査画像
を重ね合わせる位置及び回転角度を決定しなければなら
ない。そこで、本実施形態では、実施形態1,2の差分
処理に用いる教示画像Aを用いたパターンマッチング処
理によって位置・角度を検出し、一致度が最高であった
場所のみならず、一致度が閾値(パターンマッチングの
ための閾値)を超えた場所を複数候補自動検出する機能
をCPU6に持たせるプログラムを設定し、装置がスタ
ートすると、CPU6は該機能により一致度が閾値を越
えた場所の複数候補を自動検出し、その自動検出後その
複数箇所に対して実施形態1(或いは実施形態2)の処
理を実行する。
(Embodiment 3) In the difference processing of Embodiments 1 and 2, the position and the rotation angle at which the teaching image and the inspection image are superimposed must be determined by some method. Therefore, in the present embodiment, the position and angle are detected by the pattern matching processing using the teaching image A used for the difference processing in the first and second embodiments. When a program is set to provide the CPU 6 with a function of automatically detecting a plurality of locations that exceed a (threshold for pattern matching) in the CPU 6 and the apparatus is started, the CPU 6 sets a plurality of candidates for locations where the degree of coincidence exceeds the threshold by the function. Is automatically detected, and after the automatic detection, the processing of the first embodiment (or the second embodiment) is performed on the plurality of locations.

【0041】つまり撮像画像A’内に検査したい検査対
象物W’が複数存在する場合、差分処理と同じ教示画像
Aを用いたパターンマッチング処理により一致度が閾値
以上の位置・角度を複数検出し、各々の位置・角度に対
して教示画像Aを重ね合わせることで、実施形態1で説
明した差分処理を実行する。
That is, when there are a plurality of inspection objects W 'to be inspected in the picked-up image A', a plurality of positions and angles whose coincidence is equal to or larger than the threshold are detected by the pattern matching processing using the same teaching image A as the difference processing. By superimposing the teaching image A on each position and angle, the difference processing described in the first embodiment is executed.

【0042】このように複数の位置・回転角度候補に対
して差分処理を行うことで、撮像画像A’内の検査対象
物W’の数を1つにすると言った前処理が不要となり、
印字文字列の品質検査のように検査すべき対象が複数存
在する場合に、一度に処理を行うことができ画像処理装
置全体の処理時間を短縮できる。
By performing the difference processing on a plurality of position / rotation angle candidates in this manner, the preprocessing such as reducing the number of inspection objects W ′ in the captured image A ′ to one becomes unnecessary.
When there are a plurality of objects to be inspected, such as a quality inspection of a print character string, processing can be performed at once, and the processing time of the entire image processing apparatus can be reduced.

【0043】また、検査対象物W’の回転角度もパター
ンマッチングで検出するため、検査対象物W’は任意に
回転することが許され、これに対する前処理や、撮像装
置に回転を補正する機能を付加する必要がなくなり、装
置や手法を簡略化できる。
Further, since the rotation angle of the inspection object W 'is also detected by pattern matching, the inspection object W' is allowed to rotate arbitrarily. Need not be added, and the apparatus and method can be simplified.

【0044】更にパターンマッチング処理で位置・回転
角度の検出を行うことで、教示画像Aの対象物と大きく
かけ離れた検査対象物は差分処理の実行を行う前に不良
と判断することができ、処理時間を短縮できる。パター
ンマッチング処理では、まず、教示画像Aを撮像画像
A’の左上端からら右下端までラスタ走査させ、各々の
位置で一致度を計算し、閾値以上のものを候補として複
数選択する。選択された各々の位置で教示画像Aを回転
し、各々の角度に対して一致度を計算。一致度が最大と
なった角度をその位置での回転角度とする。この時点
で、一致度が閾値に満たないものは、候補から除外す
る。この位置・回転角度に対して実施形態1で説明した
差分処理を実行する。
Further, by detecting the position and the rotation angle by the pattern matching processing, the inspection object largely separated from the object of the teaching image A can be determined to be defective before executing the difference processing. You can save time. In the pattern matching processing, first, the teaching image A is raster-scanned from the upper left end to the lower right end of the captured image A ', the degree of coincidence is calculated at each position, and a plurality of images having a threshold or more are selected as candidates. The teaching image A is rotated at each selected position, and the degree of coincidence is calculated for each angle. The angle at which the degree of coincidence is maximum is defined as the rotation angle at that position. At this point, those whose degree of coincidence is less than the threshold are excluded from the candidates. The difference processing described in the first embodiment is performed on the position / rotation angle.

【0045】(実施形態4)本実施形態では、実施形態
1(或いは実施形態2)において差分処理に用いる教示
画像Aをテンプレートとして用いたパターンマッチング
処理によってその一致度が閾値(パターンマッチングの
閾値)を超えた位置及び回転角度を複数候補検出し、さ
らに検出位置近傍領域で位置及び回転角度を変えながら
実施形態1(或いは実施形態2)の差分処理を実行し、
各候補の位置毎に差分面積値が最小となった場合の結果
を最終結果として出力する。
(Embodiment 4) In this embodiment, the pattern matching processing using the teaching image A used for the difference processing in Embodiment 1 (or Embodiment 2) as a template makes the matching degree a threshold (pattern matching threshold). , A plurality of candidates are detected for the position and the rotation angle exceeding the range, and the difference processing of the first embodiment (or the second embodiment) is executed while changing the position and the rotation angle in the vicinity of the detected position.
The result when the difference area value becomes minimum for each candidate position is output as the final result.

【0046】撮像画像A’の検査対象物W’は教示画像
Aに対して何らかの差異を有している場合があり、この
ためパターンマッチング処理のみではその位置・角度が
正確に検出できない場合がある。この差が大きいと、実
際に差分処理を行った場合に、必要以上の差を出力する
ことになり、良品を不良として誤判断する危険がある。
The inspection object W 'of the picked-up image A' may have some difference from the teaching image A, so that its position and angle may not be accurately detected only by the pattern matching processing. . If the difference is large, an unnecessary difference is output when the difference processing is actually performed, and there is a risk that a non-defective product is erroneously determined to be defective.

【0047】よって、パターンマッチングによって検出
された位置・回転角度をそのまま使用せず、オペレータ
がその近傍の位置・角度範囲を指定してその指定された
範囲内で差分処理を実行し、差分面積値が最小になった
位置・回転角度に対する処理結果を、その位置・回転角
度での処理結果とする。
Accordingly, the position / rotation angle detected by the pattern matching is not used as it is, but the operator designates a position / angle range in the vicinity thereof, executes the difference processing within the designated range, and obtains the difference area value. The processing result for the position and rotation angle at which is minimized is regarded as the processing result for that position and rotation angle.

【0048】これにより、パターンマッチングの位置・
回転角度検出誤差による良/不良の誤判定を軽減するこ
とができる。
Thus, the position of pattern matching
The erroneous determination of good / bad due to the rotation angle detection error can be reduced.

【0049】[0049]

【発明の効果】請求項1の発明は、予め登楼してある対
象物の教示画像と検査対象物を撮像して得られ撮像画像
との各画素間の輝度の差を計算する差分処理を行い、計
算して得られる差分結果が予め設定されている差分閾値
を超えた画素の総面積を出力する画像処理方法におい
て、教示画像の各画素毎に重みを設定し、重要度の低い
画素に対しては差分結果を差分閾値に等しくして当該画
素の面積を、差分閾値を越えた画素の面積にカウントせ
ず差分と認識しないようにするので、教示画像内の部位
で重要度が異なる場合や、撮像系の影響で輪郭が微妙に
変化する場合でも、その影響を取り除き、検査上の重要
度に応じた差分処理が実行でき、正確に良/不良の判定
が行えるという効果がある。
According to the first aspect of the present invention, a difference process is performed for calculating a difference in luminance between each pixel of a teaching image of an object which has been climbed in advance and an image of an inspection object. In an image processing method for outputting the total area of pixels in which a difference result obtained by calculation exceeds a preset difference threshold, a weight is set for each pixel of the teaching image, and a pixel having a low importance is set. In other words, the difference result is made equal to the difference threshold, and the area of the pixel is not counted as the area of the pixel exceeding the difference threshold and is not recognized as a difference. In addition, even when the contour slightly changes due to the influence of the imaging system, the influence is removed, and the difference processing according to the degree of importance in the inspection can be executed.

【0050】請求項2の発明は、請求項1の発明におい
て、上記教示画像の各画素毎に重みの設定は、教示画像
と、良品であることが既知である検査対象物の複数の撮
像画像との間において差分処理を行い、差分閾値を超え
た画素に対しては、差分結果が閾値以下となるように重
みを0〜1.0の範囲で自動計算する処理により行うの
で、請求項1の発明の効果に加えて重みを自動的設定す
ることができる。
According to a second aspect of the present invention, in the first aspect of the present invention, the setting of the weight for each pixel of the teaching image includes the teaching image and a plurality of picked-up images of the inspection object known to be good. 2. A difference process is performed between pixels and a pixel having a difference threshold value is automatically calculated in a range of 0 to 1.0 so that a difference result is equal to or smaller than the threshold value. The weight can be automatically set in addition to the effect of the present invention.

【0051】請求項3の発明は、請求項1の発明におい
て、上記教示画像の各画素毎に重みの設定は、手動によ
り行うので、設定前に複数の撮像画像を用意する必要が
なく、画素間の重要度の違いがはっきりしている場合
や、熟練のオペレータが操作する場合は、設定時の作業
を軽減することができるという効果がある。
According to a third aspect of the present invention, in the first aspect of the present invention, the weight is set manually for each pixel of the teaching image, so that it is not necessary to prepare a plurality of captured images before setting. When the difference in importance is clear or when a skilled operator operates, there is an effect that the work at the time of setting can be reduced.

【0052】請求項4の発明は、請求項1乃至2の何れ
かの発明において、上記差分処理の実行前に、予め上記
教示画像を用いて上記撮像画像のパターンマッチング処
理を行って、パターンマッチング処理によって得られた
一致度が所定の閾値を超えた位置及び回転角度を複数候
補検出し、その複数候補を差分処理の対象箇所として、
夫々の対象箇所に上記差分処理を実行するので、前処理
や装置に対する制限を軽減でき、また処理全体の高速化
が可能となるという効果がある。
According to a fourth aspect of the present invention, in any one of the first and second aspects of the present invention, a pattern matching process of the picked-up image is performed by using the teaching image in advance before the execution of the difference processing. The position and the rotation angle at which the degree of coincidence obtained by the processing exceeds a predetermined threshold are detected as a plurality of candidates, and the plurality of candidates are subjected to difference processing as target portions.
Since the above-described difference processing is executed for each target location, there is an effect that restrictions on pre-processing and devices can be reduced, and the entire processing can be speeded up.

【0053】請求項5の発明は、請求項1乃至3の何れ
かの発明において、上記差分処理の実行前に、予め上記
教示画像を用いて上記撮像画像のパターンマッチング処
理を行って、パターンマッチング処理によって得られた
一致度が所定の閾値を超えた位置及び回転角度を複数候
補検出し、これらの複数候補の位置近傍領域で位置及び
回転角度を変えながら上記差分処理を実行し、各候補の
位置毎に差分面積値が最小となった場合の結果を最終結
果として出力するので、教示画像と撮像画像でのワーク
の差異によるパターンマッチングの位置・回転角度検出
誤差の影響を取り除き、良/不良の誤判定を回避するこ
とができるという効果がある。
According to a fifth aspect of the present invention, in any one of the first to third aspects of the present invention, before the execution of the difference processing, a pattern matching process of the captured image is performed in advance by using the teaching image to perform pattern matching. A plurality of positions and rotation angles at which the degree of coincidence obtained by the processing exceeds a predetermined threshold are detected, and the above-described difference processing is performed while changing the positions and rotation angles in the vicinity of the positions of the plurality of candidates, and each candidate is detected. Since the result when the difference area value is minimized for each position is output as the final result, the influence of the position / rotation angle detection error of pattern matching due to the difference in the work between the teaching image and the captured image is eliminated, and the pass / fail is determined. There is an effect that erroneous determination of can be avoided.

【0054】請求項6の発明は、TVカメラで検査対象
物の撮像画像と、予めメモリに登録しておいた対象物の
教示画像との各画素間の輝度の差を計算する差分処理を
行う処理手段をを備え、これら検出した複数候補を差分
処理の対象箇所として、夫々の対象箇所に対して上記差
分処理を実行する備え、計算して得られる差分結果が予
め設定されている差分閾値を超えた画素の総面積を出力
する画像処理装置において、教示画像の各画素毎に重み
を設定し、重要度の低い画素に対しては差分結果を差分
閾値に等しくする処理を行う手段をを備え、これら検出
した複数候補を差分処理の対象箇所として、夫々の対象
箇所に対して上記差分処理を実行する備え、当該画素の
面積を、差分閾値を越えた画素の面積にカウントせず差
分と認識しないようにするので、請求項1の発明の効果
が得られる装置を実現できる。
According to a sixth aspect of the present invention, a difference process for calculating a difference in luminance between each pixel between a captured image of an inspection object by a TV camera and a teaching image of the object registered in a memory in advance is performed. Processing means, the plurality of detected candidates are set as target portions of the difference processing, and the difference processing is performed on each of the target portions, and a difference result obtained by calculation is set to a predetermined difference threshold value. The image processing apparatus for outputting the total area of the exceeded pixels includes a means for setting a weight for each pixel of the teaching image, and performing a process of making a difference result equal to a difference threshold value for a pixel of low importance. Preparing the detected plurality of candidates as target positions for the difference processing and executing the above-described difference processing on each target portion, and recognizes the area of the pixel as a difference without counting the area of the pixel exceeding the difference threshold. I will not do it Because it is possible to realize a device which effects of the invention of claim 1 is obtained.

【0055】請求項7の発明では、請求項6の発明にお
いて、上記教示画像の各画素毎に重みの設定は、教示画
像と、良品であることが既知である検査対象物の複数の
撮像画像との間において差分処理を行い、差分閾値を超
えた画素に対しては、差分結果が閾値以下となるように
重みを0〜1.0の範囲で自動計算する計算手段により
行うので、請求項2の発明の効果が得られる装置を実現
できる。
According to a seventh aspect of the present invention, in the sixth aspect of the present invention, the setting of the weight for each pixel of the teaching image includes the teaching image and a plurality of picked-up images of the inspection object known to be good. Difference processing is performed between pixels, and for a pixel exceeding a difference threshold, calculation is performed by a calculation unit that automatically calculates a weight in a range of 0 to 1.0 so that the difference result is equal to or smaller than the threshold. A device that can achieve the effects of the second invention can be realized.

【0056】請求項8の発明では、請求項6の発明にお
いて、上記教示画像の各画素毎に重みの設定は、手動操
作手段による入力設定であるので、請求項3の発明の効
果が得られる装置を実現できる。
According to an eighth aspect of the present invention, in the sixth aspect of the invention, since the setting of the weight for each pixel of the teaching image is an input setting by manual operation means, the effect of the third aspect of the invention is obtained. The device can be realized.

【0057】請求項9の発明では、請求項6乃至8の何
れか記載の発明において、上記差分処理の実行前に、予
め上記教示画像を用いて上記撮像画像のパターンマッチ
ング処理を行って、パターンマッチング処理によって得
られた一致度が所定の閾値を超えた位置及び回転角度を
複数候補を自動検出する手段をを備え、これら検出した
複数候補を差分処理の対象箇所として、夫々の対象箇所
に対して上記差分処理を実行するので、請求項4の発明
の効果が得られる装置を実現できる。
According to a ninth aspect of the present invention, in the invention according to any one of the sixth to eighth aspects, before executing the difference processing, a pattern matching process of the captured image is performed by using the teaching image in advance. A means for automatically detecting a plurality of candidates for a position and a rotation angle at which the degree of coincidence obtained by the matching process exceeds a predetermined threshold is provided. Since the above-described difference processing is executed in this way, it is possible to realize an apparatus that can achieve the effects of the invention of claim 4.

【0058】請求項10の発明は、請求項6乃至8の何
れかの発明において、上記差分処理の実行前に、予め上
記教示画像を用いて上記撮像画像のパターンマッチング
処理を行って、パターンマッチング処理によって得られ
た一致度が所定の閾値を超えた位置及び回転角度を複数
候補を自動検出する手段を備えるとともに、これら検出
した複数候補の位置近傍領域で位置及び回転角度を変え
ながら上記差分処理を実行し、各候補の位置毎に差分面
積値が最小となった場合の結果を最終結果として出力す
る手段を備えたので、請求項5の発明の効果が得られる
装置を実現できる。
According to a tenth aspect of the present invention, in accordance with any one of the sixth to eighth aspects, the pattern matching of the captured image is performed in advance using the teaching image before the execution of the difference processing. Means for automatically detecting a plurality of candidates for the position and the rotation angle at which the degree of coincidence obtained by the processing exceeds a predetermined threshold value, and performing the difference processing while changing the position and the rotation angle in a region near the position of the detected plurality of candidates. And a means for outputting, as a final result, a result when the difference area value is minimized for each position of each candidate, so that an apparatus that can achieve the effects of the invention of claim 5 can be realized.

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

【図1】本発明に用いる画像処理装置の構成図である。FIG. 1 is a configuration diagram of an image processing apparatus used in the present invention.

【図2】(a)は本発明の実施形態1で用いる教示画像
例図である。(b)は同上においてて良品判断とする検
査対象物の撮像画像例図である。(c)は同上において
不良品判断とする検査対処物の撮像画像例図である。
(d)は同上において不良品判断とする検査対象物の別
の撮像画像例図である。
FIG. 2A is a diagram illustrating an example of a teaching image used in the first embodiment of the present invention. FIG. 3B is a diagram illustrating an example of a captured image of the inspection target object determined to be non-defective in the above. FIG. 3C is a diagram illustrating an example of a captured image of an inspection target object that is determined to be defective in the above.
(D) is another example of a picked-up image of the inspection object to be determined to be defective in the above.

【図3】(a)は同上におけるの説明図である。(b)
は同上に用いる偏差データの設定図である。
FIG. 3A is an explanatory diagram of the above. (B)
FIG. 3 is a setting diagram of deviation data used in the embodiment.

【図4】同上の検査処理の説明図である。FIG. 4 is an explanatory diagram of an inspection process according to the first embodiment.

【図5】同上の検査処理の説明図である。FIG. 5 is an explanatory diagram of an inspection process according to the embodiment.

【図6】同上の検査処理の説明図である。FIG. 6 is an explanatory diagram of an inspection process according to the embodiment.

【図7】同上の重みの自動設定の説明図である。FIG. 7 is an explanatory diagram of automatic setting of weights according to the embodiment.

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

1 TVカメラ 2 A/Dコンバータ 3 画像メモリ 4 プログラム格納用メモリ 5 メインメモリ 6 CPU 7 モニタ 8 D/Aコンバータ PLD コントローラ Reference Signs List 1 TV camera 2 A / D converter 3 Image memory 4 Program storage memory 5 Main memory 6 CPU 7 Monitor 8 D / A converter PLD controller

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】予め登録してある対象物の教示画像と検査
対象物を撮像して得られた撮像画像との各画素間の輝度
の差を計算する差分処理を行い、計算して得られる差分
結果が予め設定されている差分閾値を超えた画素の総面
積を出力する画像処理方法において、教示画像の各画素
毎に重みを設定し、重要度の低い画素に対しては差分結
果を差分閾値に等しくして当該画素の面積を、差分閾値
を越えた画素の面積にカウントせず差分と認識しないよ
うにすることを特徴とする画像処理方法。
1. A difference process for calculating a difference in luminance between pixels between a pre-registered teaching image of a target object and a picked-up image obtained by picking up an image of an inspection target object, and calculating the difference. In an image processing method for outputting a total area of pixels whose difference results exceed a preset difference threshold, a weight is set for each pixel of the teaching image, and the difference result is subtracted for pixels of low importance. An image processing method characterized in that an area of the pixel is not counted as an area of a pixel exceeding a difference threshold and is not recognized as a difference by making the area of the pixel equal to a threshold.
【請求項2】上記教示画像の各画素毎に重みの設定は、
教示画像と、良品であることが既知である検査対象物の
複数の撮像画像との間において差分処理を行い、差分閾
値を超えた画素に対しては、差分結果が差分閾値以下と
なるように0〜1.0範囲の重みを計算により求めるこ
とで行うことを特徴とする請求項1記載の画像処理方
法。
2. A method for setting a weight for each pixel of the teaching image, comprising:
A difference process is performed between the teaching image and a plurality of captured images of the inspection target object that is known to be good, and for pixels that have exceeded the difference threshold, the difference result is equal to or smaller than the difference threshold. 2. The image processing method according to claim 1, wherein the weighting is performed by calculating a weight in a range of 0 to 1.0.
【請求項3】上記教示画像の各画素毎に重みの設定は、
手動により行うことを特徴とする請求項1記載の画像処
理方法。
3. The setting of weight for each pixel of the teaching image is as follows:
The image processing method according to claim 1, wherein the image processing is performed manually.
【請求項4】上記差分処理の実行前に、予め上記教示画
像を用いて上記撮像画像のパターンマッチング処理を行
い、該パターンマッチング処理によって得られた一致度
が所定の閾値を超えた位置及び回転角度を複数候補検出
し、これらの複数候補を差分処理の対象箇所として、夫
々の対象箇所に上記差分処理を実行することを特徴とす
る請求項1乃至3の何れか記載の画像処理方法。
4. A pattern matching process of the captured image is performed using the teaching image before execution of the difference process, and the position and rotation of the position where the coincidence obtained by the pattern matching process exceeds a predetermined threshold value. 4. The image processing method according to claim 1, wherein a plurality of angles are detected, and the plurality of candidates are set as target portions of the difference processing, and the difference processing is performed on each of the target portions.
【請求項5】上記差分処理の実行前に、予め上記教示画
像を用いて上記撮像画像のパターンマッチング処理を行
って、パターンマッチング処理によって得られた一致度
が所定の閾値を超えた位置及び回転角度を複数候補検出
し、これらの複数候補の位置近傍領域で位置及び回転角
度を変えながら上記差分処理を実行し、各候補の位置毎
に差分面積値が最小となった場合の結果を最終結果とし
て出力することを特徴とする請求項1乃至3の何れか記
載の画像処理方法。
5. A method according to claim 1, wherein a pattern matching process of the captured image is performed in advance using the teaching image before the execution of the difference process, and the position and rotation of the position where the degree of coincidence obtained by the pattern matching process exceeds a predetermined threshold value. A plurality of angles are detected, and the above-described difference processing is executed while changing the position and the rotation angle in a region near the position of the plurality of candidates, and the result when the difference area value is minimized for each position of the candidate is a final result. The image processing method according to any one of claims 1 to 3, wherein the image is output as (1).
【請求項6】TVカメラで撮像した検査対象物の撮像画
像と、予めメモリに登録しておいた対象物の教示画像と
の各画素間の輝度の差を計算する差分処理を行う処理手
段を備え、計算して得られる差分結果が予め設定されて
いる差分閾値を超えた画素の総面積を出力する画像処理
装置において、教示画像の各画素毎に重みを設定し、重
要度の低い画素に対しては差分結果を差分閾値に等しく
する処理を行う手段を備え、当該画素の面積を、差分閾
値を越えた画素の面積にカウントせず差分と認識しない
ようにすることを特徴とする画像処理装置。
6. A processing means for performing a difference process for calculating a difference in brightness between each pixel between a captured image of an inspection object captured by a TV camera and a teaching image of the object registered in a memory in advance. In an image processing apparatus that outputs a total area of pixels in which a difference result obtained by calculation exceeds a preset difference threshold, a weight is set for each pixel of the teaching image, and a pixel having a low importance is set. Image processing characterized by comprising means for performing a process for making a difference result equal to a difference threshold, so that an area of the pixel is not counted as an area of a pixel exceeding the difference threshold and is not recognized as a difference. apparatus.
【請求項7】上記教示画像の各画素毎に重みの設定は、
教示画像と、良品であることが既知である検査対象物の
複数の撮像画像との間において差分処理を行い、差分閾
値を超えた画素に対しては、差分結果が閾値以下となる
ように重みを0〜1.0の範囲で計算設定する計算手段
により行うことを特徴とする請求項6記載の画像処理装
置。
7. The method of setting weights for each pixel of the teaching image,
Difference processing is performed between the teaching image and a plurality of captured images of the inspection object that is known to be non-defective, and for pixels exceeding the difference threshold, weighting is performed so that the difference result is equal to or smaller than the threshold. 7. The image processing apparatus according to claim 6, wherein the calculation is performed by calculating and setting in a range of 0 to 1.0.
【請求項8】上記教示画像の各画素毎に重みの設定は、
手動操作手段による入力設定であることを特徴とする請
求項6記載の画像処理装置。
8. A method for setting a weight for each pixel of the teaching image,
7. The image processing apparatus according to claim 6, wherein the input setting is performed by manual operation means.
【請求項9】る上記差分処理の実行前に、予め上記教示
画像を用いて上記撮像画像のパターンマッチング処理を
行って、パターンマッチング処理によって得られた一致
度が所定の閾値を超えた位置及び回転角度を複数候補を
自動検出する手段をを備え、これら検出した複数候補を
差分処理の対象箇所として、夫々の対象箇所に対して上
記差分処理を実行すことを特徴とする請求項6乃至8の
何れか記載の画像処理装置。
9. Before executing the difference processing, a pattern matching process of the captured image is performed in advance using the teaching image, and a position where the degree of coincidence obtained by the pattern matching process exceeds a predetermined threshold value. 9. A method according to claim 6, further comprising a step of automatically detecting a plurality of candidates for the rotation angle, performing the difference processing on each of the plurality of candidates detected as a target of the difference processing. The image processing device according to any one of the above.
【請求項10】上記差分処理の実行前に、予め上記教示
画像を用いて上記撮像画像のパターンマッチング処理を
行って、パターンマッチング処理によって得られた一致
度が所定の閾値を超えた位置及び回転角度を複数候補を
自動検出する手段を備えるとともに、これら検出した複
数候補の位置近傍領域で位置及び回転角度を変えながら
上記差分処理を実行し、各候補の位置毎に差分面積値が
最小となった場合の結果を最終結果として出力する手段
を備えたことを特徴とする請求項6乃至8の何れか記載
の画像処理装置。
10. A pattern matching process of the captured image is performed using the teaching image before execution of the difference process, and the position and rotation of the position and rotation where the degree of coincidence obtained by the pattern matching process exceeds a predetermined threshold value. A means for automatically detecting a plurality of angles is provided, and the difference processing is executed while changing the position and the rotation angle in a region near the position of the detected plurality of candidates, and the difference area value is minimized for each position of each candidate. 9. The image processing apparatus according to claim 6, further comprising: a unit that outputs a result in the case of a final result.
JP36362899A 1999-12-22 1999-12-22 Image processing method and its device Pending JP2001175865A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP36362899A JP2001175865A (en) 1999-12-22 1999-12-22 Image processing method and its device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP36362899A JP2001175865A (en) 1999-12-22 1999-12-22 Image processing method and its device

Publications (1)

Publication Number Publication Date
JP2001175865A true JP2001175865A (en) 2001-06-29

Family

ID=18479787

Family Applications (1)

Application Number Title Priority Date Filing Date
JP36362899A Pending JP2001175865A (en) 1999-12-22 1999-12-22 Image processing method and its device

Country Status (1)

Country Link
JP (1) JP2001175865A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1430446B1 (en) * 2002-07-26 2006-08-30 Matsushita Electric Works, Ltd. Image processing method for appearance inspection
JP2008139074A (en) * 2006-11-30 2008-06-19 Rozefu Technol:Kk Method for detecting defect in image
US8086023B2 (en) 2008-02-07 2011-12-27 Keyence Corporation Defect detection apparatus, defect detection method and computer program
JP2013122455A (en) * 2011-12-12 2013-06-20 Focke & Co (Gmbh & Co Kg) Method and device for optically testing object to be tested during production and/or packing of cigarette
JP2022012668A (en) * 2020-07-02 2022-01-17 株式会社ジェイテクト Inspection system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1430446B1 (en) * 2002-07-26 2006-08-30 Matsushita Electric Works, Ltd. Image processing method for appearance inspection
JP2008139074A (en) * 2006-11-30 2008-06-19 Rozefu Technol:Kk Method for detecting defect in image
US8086023B2 (en) 2008-02-07 2011-12-27 Keyence Corporation Defect detection apparatus, defect detection method and computer program
JP2013122455A (en) * 2011-12-12 2013-06-20 Focke & Co (Gmbh & Co Kg) Method and device for optically testing object to be tested during production and/or packing of cigarette
CN103177457A (en) * 2011-12-12 2013-06-26 佛克有限及两合公司 Method and apparatus for optically testing of objects to be tested in the production and/or packaging of cigarettes
CN103177457B (en) * 2011-12-12 2018-05-15 佛克有限及两合公司 The method and apparatus of optical check object to be checked in cigarette produces and/or packs
JP2022012668A (en) * 2020-07-02 2022-01-17 株式会社ジェイテクト Inspection system

Similar Documents

Publication Publication Date Title
JP3741672B2 (en) Image feature learning type defect detection method, defect detection apparatus, and defect detection program
JPH0891543A (en) Image processing method and apparatus thereof
JP2001188906A (en) Automatic image classification method and automatic image classification device
JP3265595B2 (en) Image processing method and apparatus
KR20200126921A (en) A method for inspecting a skeleton wafer
US6320977B1 (en) Method and apparatus for positional detection using pattern matching process
JP2001175865A (en) Image processing method and its device
JP2002140693A (en) Image processing parameter determining apparatus, image processing parameter determining method, and recording medium storing image processing parameter determining program
JPH05149728A (en) Visual recognition device
JP2006252400A (en) Image processor and method of generating registration data in image processing
JP2000003436A (en) ISAR image identification device and ISAR image identification method
JP2002008029A (en) Image inspection device
JPH09128550A (en) Image processing method and apparatus
JP3427230B2 (en) Image processing device
JP2001314374A (en) Corneal endothelial cell measuring device
JP2004240909A (en) Image processing apparatus and image processing method
JP2910706B2 (en) LSI image alignment method
JP3622439B2 (en) Image processing apparatus for print inspection, machine-readable recording medium on which rotation angle detection program for print inspection is recorded, and image processing method for print inspection
JPH0735699A (en) Method and apparatus for detecting surface defect
JPH0310107A (en) Inspecting method utilizing gradation pattern matching
JP2001258054A (en) Image quality inspection apparatus and luminance center of gravity detection apparatus used therefor
JP2747396B2 (en) Appearance inspection equipment for electronic components
JP2002140695A (en) Inspection method and apparatus
JPH10307110A (en) Image processing device
JPH10143673A (en) Image processing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20041208

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070220

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070423

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070529