JPH03175343A - Method for extracting flaw by inspection appearance - Google Patents

Method for extracting flaw by inspection appearance

Info

Publication number
JPH03175343A
JPH03175343A JP2125071A JP12507190A JPH03175343A JP H03175343 A JPH03175343 A JP H03175343A JP 2125071 A JP2125071 A JP 2125071A JP 12507190 A JP12507190 A JP 12507190A JP H03175343 A JPH03175343 A JP H03175343A
Authority
JP
Japan
Prior art keywords
density
defect candidate
defect
area
pixel
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.)
Granted
Application number
JP2125071A
Other languages
Japanese (ja)
Other versions
JPH06103275B2 (en
Inventor
Satoshi Yamatake
聰 山竹
Mitsuru Shirasawa
満 白澤
Toshinori Inoue
敏範 井上
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 JP2125071A priority Critical patent/JPH06103275B2/en
Publication of JPH03175343A publication Critical patent/JPH03175343A/en
Publication of JPH06103275B2 publication Critical patent/JPH06103275B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PURPOSE:To accurately judge whether a flaw candidate is proper by setting a flaw candidate region and binarizing the density of each pixel in the region. CONSTITUTION:The image of an object to be inspected is taken by an image input apparatus 1 and the densities of respective images are inputted to a predetermined processing part 3 through an A/D conversion part 2 and the original image, a differentiated absolute image, a differential direction value image and an edge image are obtained to be respectively stored in an original image memory 4, a differentiated absolute value image memory 5, a differential direction value image memory 6 and an edge image memory 7. Next, a judging part 8 sets an inspection region A in the contour line l0 of the object to be inspected with respect to the edge image and limits the object to be inspected as the flaw candidate region B of the closed region surrounding the contour line l11 of a flaw candidate X11 within the region A. Standard density is set on the basis of the density of the inside of the contour line l0 of the object to be inspected outside the vicinity of the region B and a threshold value is set on the basis of the standard density and the density of each pixel in the region B is binarized on the basis of the magnitude relation to the threshold value. By this method, the pixel in the flaw candidate is certainly separated from other pixel to judge the quality of the flaw candidate.

Description

【発明の詳細な説明】[Detailed description of the invention] 【産業上の利用分野】[Industrial application field]

本発明は、検査対象物の表面の欠け、ひび、汚れ、異物
等の外観上の欠陥部を画像処理により検査する外観検査
による欠陥抽出方法に関するものである。
The present invention relates to a method for extracting defects by visual inspection, which uses image processing to inspect external defects such as chips, cracks, stains, and foreign objects on the surface of an object to be inspected.

【従来の技術】[Conventional technology]

従来より検査対象物を含む空間領域をTVカメラ等の画
像入力手段で撮像し、原画像の各画素の濃度を適宜しき
い値を用いて2値化し、この2値画像に基づいて欠陥部
を検出する方法が知られている(たとえば、特開昭62
−88946号公報参照)、すなわち、2値画像におい
て検査対象物とみなせる領域の内側に値の反転する部位
が存在すれば欠陥部とみなすようにしている。
Conventionally, a spatial region including the object to be inspected is imaged using an image input means such as a TV camera, the density of each pixel of the original image is binarized using an appropriate threshold value, and defective parts are identified based on this binary image. Detection methods are known (for example, JP-A-62
(Refer to Japanese Patent Application No. 88946), that is, if there is a region whose value is inverted inside a region that can be considered as an inspection object in a binary image, it is regarded as a defective region.

【発明が解決しようとする課題】[Problem to be solved by the invention]

上記従来方法では、原画像の全画面について2値画像を
得ているから、欠陥部の濃度と欠陥部の周辺の濃度とが
しきい値に対して同じ領域に含まれることがあり(たと
えば、どちらの濃度もしきい値以上になることがあり)
、欠陥部を正確に識別できないという問題があった。 本発明は上記問題点の解決を目的とするものであり、欠
陥部の判定対象となる欠陥候補の輪郭線を囲むように欠
陥候補領域を設定することにより、判定対象を限定し、
かつ、検査対象物の輪郭線の内側の濃度に基づいて欠陥
部5補領域内の各画素の濃度を2値化して欠陥候補内の
画素を他の画素から分離することにより、欠陥候補の良
否判定を精度よく行えるようにした外観検査による欠陥
抽出方法を提供しようとするものである。
In the conventional method described above, since a binary image is obtained for the entire screen of the original image, the density of the defective part and the density around the defective part may be included in the same area with respect to the threshold value (for example, (Both concentrations may exceed the threshold)
However, there was a problem in that the defective part could not be identified accurately. The present invention aims to solve the above-mentioned problems, and by setting a defect candidate area so as to surround the outline of the defect candidate to be determined as a defective part, the target for determination is limited,
Furthermore, by binarizing the density of each pixel in the defective five-complement area based on the density inside the contour line of the inspection object and separating pixels in the defect candidate from other pixels, it is possible to determine whether the defect candidate is good or not. The present invention aims to provide a method for extracting defects by visual inspection that enables accurate determination.

【yA題を解決するための手段】[Means to solve yA problem]

請求項1および請求項2の方法は、上記目的の達成のた
めに、検査対象物の輪郭線の内側に欠陥部の判定対象と
なる欠陥候補の輪郭線を囲む閉じた領域内を欠陥候補領
域として設定し、欠陥候補領域の近傍外側で検査対象物
の輪郭線よりも内側の濃度に基づいて基準濃度を設定し
、欠陥候補領域内の各画素の濃度を上記基準濃度に基づ
いて設定されたしきい値との大小関係によって2値化す
ることにより、欠陥候補内の画素と他の画素とを分離す
るようにしているのである。 請求項3の方法では、欠陥候補領域を、画面の縦方向と
横方向とに走る各一対の辺と、上記各辺に対してそれぞ
れ45°の角度で交差する4辺とに囲まれた六角形に設
定している。 請求項4の方法では、複数個の欠陥候補領域の近傍外側
で検査対象物の輪郭線よりも内側にそれぞれ基準値算出
ラインを設定し、異なる欠陥候補領域に対応する基準値
算出ライン同士が交差しないときには、各基準値算出ラ
インの上の各画素の濃度に基づいて基準濃度を算出し、
異なる欠陥候補領域に対応する基準値算出ライン同士が
交差するときには、交差する基準値算出ラインに囲まれ
る全領域を囲むとともに両基準値算出ラインの一部を含
むような新たな基準値算出ラインを設定し、この基準値
算出ラインの上の画素の濃度に基づいて基準濃度を特徴
する 請求項5の方法は、しきい値を、欠陥候補領域内が周囲
よりも暗い暗欠陥のときには、上記基準濃度に負のオフ
セット値を加算して設定し、欠陥候補領域内が周囲より
も明るい明欠陥のときには、上記基準濃度に正のオフセ
ット値を加算して設定するのである。 請求項6の方法では、しきい値との大小関係に基づいて
分離された欠陥候補内の画素が占める面積、および各画
素の濃度と上記しきい値との濃度差の総和である体積を
求め、上記面積と上記体積とに基づいて欠陥候補の良否
を特徴する請求項7の方法では、複数個の欠陥候補の輪
郭線同士の距離をそれぞれ求め、この距離が所定距離以
内である欠陥候補の面積および体積を合計し、合計され
た面積および体積に基づいて欠陥候補の良否を特徴する 請求項8の方法は、基準値算出ラインを多角形状に設定
し、上記基準値算出ラインの各頂点付近の画素の濃度に
基づいて各頂点の基準濃度を算出し、各画素の位置と濃
度との3次元空間において、各頂点の間の濃度勾配に近
似した基準平面を設定し、上記3次元空間において基準
平面を濃度方向に偏移させたしきい平面の各画素の濃度
をそれぞれその位置におけるしきい値とし、上記しきい
値に対応する位置の欠陥候補領域内の各画素の濃度を各
しきい値に基づいて2値化している。 請求項9の方法では、欠陥候補の輪郭線が閉じていると
きには、輪郭線内を欠陥候補領域とし、輪郭線が開いて
いるときには、輪郭線の端同士を直線で結んだ範囲内を
欠陥候補領域とする。
In order to achieve the above object, the methods of claims 1 and 2 provide a defect candidate area within a closed area surrounding the outline of the defect candidate to be determined as a defective part inside the outline of the object to be inspected. The reference density is set based on the density outside the vicinity of the defect candidate area and inside the outline of the object to be inspected, and the density of each pixel in the defect candidate area is set based on the above reference density. By performing binarization based on the magnitude relationship with the threshold value, pixels within the defect candidate are separated from other pixels. In the method of claim 3, the defect candidate area is defined as a six-sided area surrounded by a pair of sides running in the vertical and horizontal directions of the screen, and four sides intersecting each of the sides at an angle of 45°. It is set to a square shape. In the method of claim 4, reference value calculation lines are set outside the vicinity of the plurality of defect candidate areas and inside the outline of the object to be inspected, and the reference value calculation lines corresponding to different defect candidate areas intersect with each other. If not, calculate the reference density based on the density of each pixel on each reference value calculation line,
When reference value calculation lines corresponding to different defect candidate areas intersect, a new reference value calculation line is created that encloses the entire area surrounded by the intersecting reference value calculation lines and also includes a part of both reference value calculation lines. In the method of claim 5, the reference density is characterized based on the density of the pixel above the reference value calculation line. The density is set by adding a negative offset value to the density, and when the inside of the defect candidate area is a bright defect that is brighter than the surrounding area, the reference density is set by adding a positive offset value to the reference density. In the method of claim 6, the area occupied by the pixels in the defect candidate separated based on the magnitude relationship with the threshold value and the volume that is the sum of the density difference between the density of each pixel and the threshold value are determined. In the method according to claim 7, the defect candidate is characterized based on the area and the volume, the distance between the contour lines of a plurality of defect candidates is determined, and the defect candidates whose distances are within a predetermined distance are determined. In the method of claim 8, the area and volume are summed, and the quality of the defect candidate is characterized based on the summed area and volume. The reference density of each vertex is calculated based on the density of the pixel in The density of each pixel on the threshold plane, which is obtained by shifting the reference plane in the density direction, is set as the threshold at that position, and the density of each pixel in the defect candidate area at the position corresponding to the threshold is set as each threshold. It is binarized based on the value. In the method of claim 9, when the contour line of the defect candidate is closed, the inside of the contour line is set as the defect candidate area, and when the contour line is open, the area between the edges of the contour line is set as the defect candidate area. area.

【作用】[Effect]

請求項1および請求項2の方法によれば、欠陥部の判定
対象となる欠陥候補の輪郭線を囲む閉じた領域内を欠陥
候補領域として設定しているから、判定対象を限定する
ことができるのであり、しかも、検査対S、物の輪郭線
の内側で欠陥候補領域の近傍外側の濃度に基づいて設定
されたしきい値との大小関係により欠陥候補領域内の各
画素の濃度を2値化して欠陥候補内の画素を他の画素か
ら分離するから、しきい値として適切な値を設定するこ
とができ、欠陥候補内の画素と他の画素との分離が確実
に行えることになり、欠陥候補の良否判定の精度が高ま
るのである。 請求項3の方法では、欠陥候補領域を六角形に設定して
いるので、欠陥候補の輪郭線にほぼ沿う形で欠陥候補領
域を設定することができ、欠陥候補領域を簡単な形状に
設定しながらも欠陥候補の面積とほぼ同じ程度の面積に
設定できるのであって、欠陥候補領域内でのむだな演算
による演算量の増加が抑制できるのである。 請求項4の方法では、複数個の欠陥候補領域の近傍外側
で検査対象物の輪郭線よりも内側にそれぞれ基準値算出
ラインを設定し、異なる欠陥候補領域に対応する基準値
算出ライン同士が交差しないときには、各基準値算出ラ
インの上の各画素の濃度に基づいて基準濃度を算出し、
異なる欠陥候補領域に対応する基準値算出ライン同士が
交差するときには、交差する基準値算出ラインに囲まれ
る全領域を囲むとともに両基準値算出ラインの一部を含
むような新たな基準値算出ラインを設定し、この基準値
算出ラインの上の画素の濃度に基づいて基準濃度を設定
するようにしているので、複数個の欠陥候補が存在し、
各欠陥候補に対応する基準値算出ライン同士が交差して
いても、基準濃度算出ラインの一部が欠陥候補領域内を
通ることがなく、基準濃度を適切な値に設定することが
できるのである。 請求項5の方法は、しきい値を、欠陥候補領域内が周囲
よりも暗い暗欠陥のときには、上記基準濃度に負のオフ
セット値を加算して設定し、欠陥候補領域内が周囲より
も明るい明欠陥のときには、上記基準濃度に正のオフセ
ット値を加算して設定するので、しきい値を欠陥候補領
域の明るさに応じて適切な値に設定できる。 請求項6の方法では、しきい値との大小関係に基づいて
分離された欠陥候補内の画素が占める面積、および各画
素の濃度と上記しきい値との濃度差の総和である体積を
求め、上記面積と上記体積とに基づいて欠陥候補の良否
を判定するので、面積のみによって欠陥候補の良否を判
定する場合に比較して良否判定の精度が高くなるのであ
る。 請求項7の方法では、複数個の欠陥候補の輪郭線同士の
距離をそれぞれ求め、この距離が所定距離以内である欠
陥候補の面積および体積を合計し、合計された面積およ
び体積に基づいて欠陥候補の良否を判定するから、本来
1つの欠陥候補であるにもかかわらず、輪郭線を求める
際の処理によって分離されていた複数の欠陥候補を1つ
の欠陥候補として扱うことができるのであり、判定精度
の向上が期待できるのである。 請求項8の方法は、基準値算出ラインを多角形状に設定
し、上記基準値算出ラインの各頂点付近の画素の濃度に
基づいて各頂点の基準濃度を算出し、各画素の位置と濃
度との3次元空間番こお1)て、各頂点の間の濃度勾配
に近似した基準平面を設定し、上記3次元空間において
基準平面を濃度方向に偏移させたしきい平面の各画素の
濃度をそれぞれその位置におけるしきい値とし、上記し
き11に対応する位置の欠陥候補領域内の各画素の濃度
を各しきい値に基づいて2値化しているから、光源の位
置などによって欠陥候補領域に照度むら力(生じても、
照度むらの影響を除去すること力(でき、判定精度が向
上するのである。 請求項9の方法では、欠陥候補の輪郭線力τ閉じている
ときには、輪郭線内を欠陥候補領域とし、輪郭線が開い
ているときには、輪郭線の端同士を直線で結んだ範囲内
を欠陥候補領域とするので、欠陥候補領域の設定が非常
に容易になると0う効果がある。
According to the methods of claims 1 and 2, since the closed area surrounding the outline of the defect candidate that is the target of defect determination is set as the defect candidate area, the target of determination can be limited. In addition, the density of each pixel in the defect candidate area is binary-valued based on the magnitude relationship between the inspection pair S and the threshold value set based on the density outside the vicinity of the defect candidate area inside the outline of the object. Since the pixel in the defect candidate is separated from other pixels by using This increases the accuracy of determining the quality of defect candidates. In the method of claim 3, since the defect candidate area is set in a hexagonal shape, the defect candidate area can be set in a shape that almost follows the outline of the defect candidate, and the defect candidate area can be set in a simple shape. However, the area can be set to be approximately the same as the area of the defect candidate, and an increase in the amount of calculations due to wasteful calculations within the defect candidate area can be suppressed. In the method of claim 4, reference value calculation lines are set outside the vicinity of the plurality of defect candidate areas and inside the outline of the object to be inspected, and the reference value calculation lines corresponding to different defect candidate areas intersect with each other. If not, calculate the reference density based on the density of each pixel on each reference value calculation line,
When reference value calculation lines corresponding to different defect candidate areas intersect, a new reference value calculation line is created that encloses the entire area surrounded by the intersecting reference value calculation lines and also includes a part of both reference value calculation lines. Since the standard density is set based on the density of the pixel above this standard value calculation line, there are multiple defect candidates,
Even if the reference value calculation lines corresponding to each defect candidate intersect, part of the reference density calculation line does not pass through the defect candidate area, and the reference density can be set to an appropriate value. . In the method of claim 5, when the inside of the defect candidate area is darker than the surrounding area, the threshold value is set by adding a negative offset value to the reference density, and when the inside of the defect candidate area is brighter than the surrounding area, the threshold value is set. In the case of a bright defect, since a positive offset value is added to the reference density and set, the threshold value can be set to an appropriate value depending on the brightness of the defect candidate area. In the method of claim 6, the area occupied by the pixels in the defect candidate separated based on the magnitude relationship with the threshold value and the volume that is the sum of the density difference between the density of each pixel and the threshold value are determined. Since the quality of the defect candidate is determined based on the area and the volume, the accuracy of the quality determination is higher than when the quality of the defect candidate is determined based only on the area. In the method of claim 7, the distance between the contour lines of a plurality of defect candidates is determined, the areas and volumes of defect candidates within a predetermined distance are summed, and the defect is determined based on the total area and volume. Since the quality of the candidate is determined, multiple defect candidates that were originally one defect candidate but were separated by the process of calculating the contour line can be treated as one defect candidate. An improvement in accuracy can be expected. In the method of claim 8, the reference value calculation line is set in a polygonal shape, the reference density of each vertex is calculated based on the density of pixels near each vertex of the reference value calculation line, and the position and density of each pixel are calculated. 1) Set a reference plane that approximates the density gradient between each vertex, and calculate the density of each pixel on the threshold plane by shifting the reference plane in the density direction in the three-dimensional space. is the threshold value at each position, and the density of each pixel in the defect candidate area at the position corresponding to Threshold 11 is binarized based on each threshold value. uneven illumination (even if it occurs,
In the method of claim 9, when the contour line force τ of a defect candidate is closed, the inside of the contour line is regarded as a defect candidate area, and the determination accuracy is improved. When the contour line is open, the defect candidate area is defined as the area where the edges of the contour lines are connected with straight lines, so that the defect candidate area can be set very easily.

【実施例1] 本発明では、第1図に示すように、検査対象物をテレビ
カメラ等の画像入力装置1により撮像し、各画素の濃度
をアナログ−デジタル変換部2番こおいてデジタル信号
に変換した後、前処理部3Gこおいて以下の前処理を行
うことにより、アナログ−デジタル変換部2より得られ
る原画像のは力IGこ、微分絶対値画像、微分方向値画
像、工・7ジ画像を得る。 すなわち、検査対象物を含む空間領域を撮像して得られ
る原画像P0は濃淡画像であって、第2図(a)に示す
ように、検査対象物0、欠陥xI、異物x2などを含む
画像となっている。この濃淡画像から検査対象物Oの輪
郭線等の工・ンジを抽出する処理は、「エツジは濃度変
化が大きし)部分番こ対応している」という考え方を基
本にしてし)る、したがって、濃度を微分することによ
って工・ンジの抽出を行なう。微分処理は、第3図に示
すよう(こ、原画像P0を3×3画素の局所並列ウィン
ドウWに分割して行なう、つまり、注目する画素Eと、
その画素Eの周囲の8画素(8近傍)A〜D、F〜Iと
で局所並列ウィンドウWを形成し、局所並列ウィンドウ
W内の画素A〜Iの濃度の縦方向の濃度変化ΔVと横方
向の濃度変化ΔHとを次式によって求め、 ΔV=(A+B+C)−(G+H+ 1)ΔH=(A+
D+−G)−(C+F+ I)さらに、微分絶対値1e
17と微分方向値l e zとを次式によって求めるの
である。 e 1t=(AV’+Δ)(2)+7まただし、A〜I
は対応する画素の濃度を示している。上式から明らかな
ように、微分絶対値1eは、原画像の着目する画素の近
傍領域における濃度の変化率を表し、微分方向値le、
は、同近傍領域における濃度変化の方向に直交する方向
を表している0以上の演算を原画像P0の全画素につい
て行なうことにより、検査対象物0の輪郭や欠陥X1、
異物X2等が存在しているような濃度変化が大きい部分
と、その変化の方向とを抽出することができるのである
。欠陥X1や異物X2は、第2図(a)では各1個を示
しているが、さらに多数の欠陥や異物があっても同様で
ある。ここに、各画素の濃度を、微分絶対値te1.で
表現した画像を微分絶対値画像、微分方向値l e t
で表現した画像を微分方向値画像と呼ぶ。 次に細線化処理が施される。細線化処理は、微分絶対値
が大きいほど濃度変化が大きいことを表わしている点に
着目して行なわれる。すなわち、各画素の微分絶対値を
周囲の画素の微分絶対値と。 比較し、周囲の画素よりも大きくなるものを連結してい
くことにより、1画素の幅を有したエツジを抽出するの
である。第4図に示すように、各画素の位置をX−Y座
標で表わし、微分絶対値をZ軸に取った微分絶対値画像
P、を考えれば、細線化処理は、この曲面における稜線
を求めることに相当する。ここまでの処理により、微分
絶対値の大小にかかわらず、すべての稜線が抽出される
。 この段階で得られている稜線には、ノイズ等による不要
な小さな山も含まれているから、第5図に示すように、
適宜しきい値SLを設定し、このしきい値SL以上の値
のみを採用してノイズ成分を除去する。この処理で得ら
れた画像は、原画像のコントラストが不十分であるとき
や、ノイズが多いようなときには、不連続線になりやす
い、そこで、エツジ延長処理を行なう。エツジ延長処理
では、不連続線の端点から始めて、注目する画素とその
周囲の画素とを比較し、次式で表わされる評価関数f(
eJ)がもっとも大きくなる方向に線を延長し、他の線
の端点に衝突するまでこれを続ける。 f (e 、)= ここに、eoは中心画素(局所並列ウィンドウWのEに
相当する)の微分データであり、e、は隣接画素(局所
並列ウィンドウWの8近傍に相当する)の微分データで
あり、j=1.2.・・・・・・、8である。 以上の処理により、第2図(b)に示すように、原画像
において濃度変化が大きい部分をなぞるようなエツジ画
像P4が得られる。エツジ画像P、では、各線が検査対
象物O1欠陥Xl、異物X2等の輪郭線2゜〜12を表
すものとみなせる。以上の前処理により、原画像、微分
絶対値画像、微分方向コード画像、エツジ画像の4種類
の画像が得られ、各画像はそれぞれ原画像メモリ4、微
分絶対値画像メモリ5、微分方向値画像メモリ6、エツ
ジ画像メモリ7に記憶される。以下の説明では、各画像
の画素の位置をX−Y座標で表現するものとし、各画像
における画素の濃度をそれぞれf+(x、y)、f2(
x、y)、f*(x、y)、f<(x、y)とする。 原画像は、濃淡画像であって、濃度は通常8ビツトで表
されるから、各画素における濃度a(=f+(x、y)
)は、0≦a≦255となる。また、微分絶対値画像の
濃度(すなわち、微分絶対値)b(= f z(X 、
 y ))は、たとえば6ビツトで表され、0≦b≦6
3となり、微分方向値画像の濃度(すなわち、微分方向
値)c (−f )(X 、y))は、たとえば16方
向で表され、0≦C≦15となる。エツジ画像について
は、線の有無のみであるから、線となる画素は“1“、
それ以外の画素は“0”として表される。つまり、f<
(x、y)の値域は(0,11となる。なお、以下の説
明においては、濃度という用語は白の濃度を表し、濃度
値が大きいほど明るいものとする。 次に、判定部8では、第6図に示すように、エツジ画像
について、検査対象物0の輪郭線l。の内部に検査領域
Aを適宜設定する。以下の説明では、検査領域A内の2
箇所に欠陥かどうかの判定対象である欠陥候補XI I
 + X + 2が存在し、一方の欠陥候補X11は輪
郭線11.が開いており、他方の欠陥候補X、2は輪郭
線e12が閉じているものとする6検査領域Aが設定さ
れると、第7図に矢印で示すように、エツジ画像内で検
査領域A内をラスク走査することにより、f 4(X、
3/)= 1となる画素を検出しフラグ点とする。この
フラグ点を始点として、8近傍についてf4(X、y)
−1となる画素を抽出しながら輪郭me、、の追跡を行
う、ここに、第8図に示すように輪郭線/IIが開いて
いるときには、始点Pが輪郭線ll+の端点になること
があるが、そのような場合には1方向にのみ追跡し、始
点Pが輪郭li1..の端点でなければ両方向に追跡す
る。こうして輪郭線111を追跡することにより、輪郭
w1111の上の全画素の座標がわかるから、X座標お
よびX座標の最大値と最小値とをそれぞれ求める。X座
標およびX座標の最大値と最小値とを求める方法として
は、輪郭線ll+を追跡して全座標をバッファに格納し
た後に求める方法と、全座標を格納することなく輪郭線
ll+の追跡中に座標の大小関係を比較しながら求める
方法とがある。 以上のようにして、輪郭線1.のX座標およびX座標の
最大値X m * w + Y a・・と最小値X・・
・・Y・・・とを求めることができれば、第9図に示す
ように、輪郭線I11に外接する四角形の欠陥候補領域
Bを設定することができる。こうして欠陥候補領域Bを
設定した後、第10図に示すように、欠陥候補領域Bの
数画素(n画素)だけ外側に基準値算出ラインLを設定
する。基準値算出ラインLは、検査対象物Oの輪郭線1
0の内側に設定する。 次に、基準値算出ラインLの上の全画素の濃度を原画像
より求めてバッファに格納し、バッファ内の濃度を用い
て基準濃度C9を設定する。基準濃度CSは、バッファ
内の濃度の平均値、メジアン、モード、あるいは、上下
数個ずつデータを捨てた後の平均値のいずれかの値とし
、どの値を用いるかは画像の状態に応じて決定する。こ
うして得られた基準濃度Csにオフセット値dを加算し
、しきい値S L 1 (= c g+ d )を設定
する。オフセット値dは、欠陥候補Xllが周囲よりも
低濃度である暗欠陥のときには負の値とし、周囲よりも
高濃度である明欠陥のときには正の値とする。暗欠陥の
場合には、しきい値SLIよりも濃度f、(x。 y)が小さい(すなわち、f +(x、y)  SL 
1 <0となる)画素を欠陥候補点とし、欠陥候補点を
見付けるたびに、面積カウンタに1を加算して、欠陥候
補点が占める総面積に対応した値CAを求める。また同
時に、欠陥候補点における濃度f 、(xy)としきい
値SLIとの差(SL]、  f+(x、y))を求め
、体積カウンタに加算して、欠陥候補点における濃度と
しきい値SLIとの濃度差の総和に対応した値Cvを求
める。ここに、値CAは原画像における欠陥候補の総面
積に相当するから面積と呼び、/iir画像において濃
度を深さとみなした3次元空間を考えれば、値CVは原
画像における欠陥候補の総体積に相当するから体積と呼
ぶことにする。 以上のようにして、欠陥候補領域Bの中に存在する欠陥
候補点の面積OAと体積Cvとを求めたことにより、面
積CAと体積Cvとによって、欠陥候補Xl+の良否が
判定できる。すなわち、面積Cあの大小によって良否の
一次判定を行い、面積CAが所定の範囲内であるときに
は、体積CVによって二次判定を行えばよいのである。 たとえば、次のように面積CAに対する所定の基準値a
、b(a>b)を設定し、体積CVに対しても所定の基
準値Cを設定する。 ■ CA > a ■ a≧cA>b かつCv>c のいずれかの条件を満たすときには、不良と判定し欠陥
候補X、を欠陥であると判定する。また、それ以外のと
きには良品と判定するのである。 欠陥候補X、1が明欠陥のときには、上述したようにオ
フセット値dを正の値とし、fl(x、y)SLI>O
となる画素を、欠陥候補点とする。また、各欠陥候補点
の体積は、fl(X、3/)−3LIとして求める。良
否の判定条件は、暗欠陥と同様である。 以上のようにして欠陥候補Xl+の良否を判定した後、
検査領域A内でのラスク走査を続け、次の欠陥候補X1
2についても同様の処理を行い、良否を判定する。ここ
に、1つの欠陥候補X、の良否判定の後に、次の欠陥候
補−X+2を探索しているが、1つの欠陥候補X11に
対する基準値算出ラインLの設定後、次の欠陥候補X1
□を探索し、すべての欠陥候補に対する基準値算出ライ
ンLを設定した後に、良否判定を行うようにしてもよい
。 上述のように、欠陥候補X + + 、 X +□の輪
郭線1e12に外接する欠陥候補領域Bを設定すること
により、欠陥候補Xz、X、2の輪郭線’ll+112
が閉じていなくても欠陥候補X + + 、 X 1□
の良否判定を行うことができるのである。また、欠陥候
補領域Bを囲む基準値算出ラインLを設定し、基準値算
出ラインB内の各画素の濃度に基づいて欠陥候補領域B
内の画素の濃度を2値化しているから、欠陥候補X11
.X12の輪郭線111+l+2に不要な線が連続して
いても2値化によって良否判定の際には無視されること
になり、判定の精度が高くなるのである。 ところで、欠陥候補領域Bの設定には、エツジ画像を用
いる代わりに微分2値画像を用いることもできる。微分
2値画像は、原画像を微分く微分法は上述した方法には
限定されない)した後、適宜しきい値によって2値化し
た画像であって、背景との境界線が必ず閉じた図形にな
るという性質を有している。したがって、検査領域A内
でラスク走査によって背景との境界線を求め、この境界
線を追跡すればエツジ画像における輪郭線の追跡とほぼ
同様の処理をしたことになる。背景との境界線の追跡を
行った後は、境界線のX座標およびX座標における最大
値と最小値とをそれぞれ求めて、欠陥候補領域Bを設定
することができるのである。その後の処理はエツジ画像
を用いた場合と同じである。 【実施例2】 実施例1では、欠陥候補Xz、X、2の輪郭線1l12
に外接する四角形として欠陥候補領域Bを設定していた
が、欠陥候補領域Bを外接四角形とすると、欠陥候補X
、、、X、2の輪郭線111+l+2で囲まれる面積よ
りも欠陥候補領域Bの面積のほうが、かなり広くなって
しまう、すなわち、欠陥候補領域B内には欠陥候補X、
、、X、2以外の部分が多く含まれているのであり、欠
陥候補X 1+ 、 X +□の形状によってはむだな
演算が多くなることがある。 また、欠陥候補X、、、X、、が複数存在しているとき
には、一つの欠陥候補領域が他の欠陥候補領域に重なり
、判定精度が下がることもある。 本実施例は、実施例1の欠点を補うものであって、第1
1図(、)および第12Q?1(a)に示すように、欠
陥候補領域Bを実施例1の場合よりも狭めるように、四
角形の各辺に対して45°で交差し、かつ欠陥候補X1
の輪郭線11に接する直線を設定しているのである。 このような直線を設定する方法としては、たとえば、次
の方法がある。すなわち、まず実施例1と同様にして輪
郭線11のX座標およびX座標の最大値X II @ 
It l Y * a 11と最小値X s ln *
 Y m r nとを求め、輪郭線11に外接する四角
形を設定する。この四角形の各頂点について、頂点から
始めてX方向(Y方向でもよい)に1画素ずつ探索開始
点を移動し、探索開始点から45°の方向に探索を行う
ようにする。すなわち、1つの探索開始点から探索を開
始して輪郭線IIの上の画素を検出せずに四角形の他辺
に達したときには、探索開始点をX方向(Y方向でもよ
い)に1画素ずらして次の探索を行い、探索中に輪郭線
11の上の画素を検出したときに、この探索線を四角形
の各辺に対して45°で交差し、かつ輪郭線りに接する
直線とみなす。 以上の手順を四角形の各頂点について実行すれば、四角
形の各辺に対して45°で交差するような直線を設定す
ることができ、六角形の欠陥候補領域Bを設定すること
ができるのである。その結果、実施例1に比較すれば、
欠陥候補領域Bを狭めることができる。欠陥候補領域B
を設定した後は実施例1と同様の処理を行い、第11図
(b)および第12図(b)に示すように、欠陥候補類
@Bの外側に基準値算出ラインLを設定し、欠陥候補領
域Bの良否判定を行うのである。 本実施例の方法によれば、欠陥候補領域Bの面積が小さ
くなるから、良否判定の際の演算量が少なくなり、また
、複数の欠陥候補が存在している場合でも、一つの欠陥
候補に対応、する欠陥候補領域Bが他の欠陥候補に重な
る確率が大幅に減少し、正確な良否判定が期待できるの
である。また、上記手順は、計算式を用いずにへ角形の
欠陥候補領域Bを設定することができ、かつ、輪郭線e
lが閉じていない場合でも利用できるのである。 なお、本実施例の応用として欠陥候補領域Bを四角形や
へ角形以外の多角形に設定することも可能であるが、六
角形以上の多角形にしても実用上の効果はほとんどかわ
らず、演算量が増加するのであまり得策ではない。
[Embodiment 1] In the present invention, as shown in FIG. 1, an image of an object to be inspected is captured by an image input device 1 such as a television camera, and the density of each pixel is converted into a digital signal by an analog-to-digital converter 2. By performing the following preprocessing in the preprocessing unit 3G, the original image obtained from the analog-to-digital conversion unit 2 is converted into a differential absolute value image, a differential direction value image, a differential direction value image, a differential direction value image, a differential direction value image, a differential direction value image, 7 images are obtained. That is, the original image P0 obtained by imaging a spatial region including the inspection object is a grayscale image, and as shown in FIG. It becomes. The process of extracting edges such as the contour line of the inspection object O from this grayscale image is based on the idea that ``edges have large density changes and correspond to partial numbers''. , and extracts the concentration by differentiating the concentration. The differential processing is performed by dividing the original image P0 into local parallel windows W of 3×3 pixels, as shown in FIG.
Eight pixels (eight neighbors) A to D and F to I surrounding the pixel E form a local parallel window W, and the vertical density change ΔV of the density of the pixels A to I within the local parallel window W and the horizontal The concentration change ΔH in the direction is determined by the following formula, ΔV=(A+B+C)−(G+H+ 1)ΔH=(A+
D+-G)-(C+F+ I) Furthermore, the differential absolute value 1e
17 and the differential direction value l e z are determined by the following equation. e 1t=(AV'+Δ)(2)+7 However, A~I
indicates the density of the corresponding pixel. As is clear from the above equation, the absolute differential value 1e represents the rate of change in density in the area near the pixel of interest in the original image, and the differential direction value le,
calculates the outline of inspection object 0, defect X1,
It is possible to extract areas with large concentration changes, such as the presence of foreign matter X2, and the direction of the changes. Although one defect X1 and one foreign substance X2 are shown in FIG. 2(a), the same applies even if there are many more defects and foreign substances. Here, the density of each pixel is expressed as the differential absolute value te1. The image expressed by is the differential absolute value image and the differential direction value l e t
The image expressed by is called a differential direction value image. Next, a thinning process is performed. The thinning process is performed by focusing on the fact that the larger the absolute differential value, the larger the density change. That is, the differential absolute value of each pixel is the differential absolute value of the surrounding pixels. By comparing and connecting those that are larger than the surrounding pixels, an edge with a width of one pixel is extracted. As shown in Fig. 4, if we consider a differential absolute value image P in which the position of each pixel is expressed by X-Y coordinates and the differential absolute value is taken on the Z axis, the thinning process calculates the ridge line on this curved surface. It corresponds to that. Through the processing up to this point, all edges are extracted regardless of the magnitude of the absolute differential value. The ridge line obtained at this stage includes unnecessary small peaks due to noise, etc., so as shown in Figure 5,
A threshold value SL is appropriately set, and only values equal to or higher than the threshold value SL are employed to remove noise components. The image obtained by this processing tends to become discontinuous lines when the contrast of the original image is insufficient or there is a lot of noise, so edge extension processing is performed. In edge extension processing, starting from the end point of the discontinuous line, the pixel of interest and its surrounding pixels are compared, and the evaluation function f(
Extend the line in the direction where eJ) is the largest, and continue this until it collides with the end point of another line. f (e,) = Here, eo is the differential data of the central pixel (corresponding to E of the local parallel window W), and e is the differential data of the adjacent pixel (corresponding to the 8 neighbors of the local parallel window W) and j=1.2.・・・・・・It is 8. Through the above processing, as shown in FIG. 2(b), an edge image P4 is obtained that traces a portion of the original image where the density change is large. In the edge image P, each line can be regarded as representing a contour line 2° to 12 degrees of the inspection object O1, defect Xl, foreign object X2, etc. Through the above preprocessing, four types of images are obtained: an original image, a differential absolute value image, a differential direction code image, and an edge image, and each image is stored in the original image memory 4, differential absolute value image memory 5, and differential direction value image. The image is stored in the memory 6 and the edge image memory 7. In the following explanation, the position of a pixel in each image is expressed by X-Y coordinates, and the density of a pixel in each image is f+(x, y), f2(
x, y), f*(x, y), and f<(x, y). The original image is a grayscale image, and the density is usually expressed in 8 bits, so the density at each pixel is a(=f+(x,y)
) is 0≦a≦255. In addition, the density of the differential absolute value image (i.e., the differential absolute value) b(= f z (X,
y )) is represented by 6 bits, for example, and 0≦b≦6
3, and the density of the differential direction value image (that is, the differential direction value) c(-f)(X,y)) is expressed by, for example, 16 directions, and 0≦C≦15. For edge images, since there is only the presence or absence of a line, the pixel that becomes a line is "1",
Other pixels are represented as "0". In other words, f<
The value range of (x, y) is (0, 11). In the following explanation, the term "density" refers to the density of white, and the larger the density value, the brighter it is. , as shown in FIG.
Defect candidate XI I, which is the target of determining whether there is a defect in the location
+X+2 exists, and one defect candidate X11 has a contour line 11. is open, and the outline e12 of the other defect candidate By performing a rask scan inside, f 4(X,
3/)=1 is detected and set as a flag point. Starting from this flag point, f4(X,y) for 8 neighborhoods
The contour me, , is traced while extracting the pixels that become -1. Here, when the contour line /II is open as shown in FIG. 8, the starting point P becomes the end point of the contour line ll However, in such a case, tracking is performed only in one direction, and the starting point P is the contour li1. .. If it is not an end point, it will be tracked in both directions. By tracing the contour line 111 in this manner, the coordinates of all pixels on the contour w1111 are known, and the maximum and minimum values of the X coordinate and the X coordinate are determined, respectively. There are two ways to find the maximum and minimum values of the X-coordinate and Another method is to compare the size relationship of the coordinates. As described above, contour line 1. The maximum value X m * w + Y a... and the minimum value X...
...Y..., it is possible to set a rectangular defect candidate area B circumscribing the contour line I11, as shown in FIG. After setting the defective candidate area B in this manner, as shown in FIG. 10, a reference value calculation line L is set outside the defective candidate area B by several pixels (n pixels). The reference value calculation line L is the contour line 1 of the inspection object O.
Set inside 0. Next, the densities of all pixels on the reference value calculation line L are determined from the original image and stored in a buffer, and the densities in the buffer are used to set the reference density C9. The reference density CS can be either the average value, median, mode, or average value after discarding several pieces of data above and below the density in the buffer. Which value to use depends on the state of the image. decide. The offset value d is added to the reference density Cs thus obtained, and the threshold value S L 1 (=c g+d ) is set. The offset value d is a negative value when the defect candidate Xll is a dark defect with a lower density than the surroundings, and is a positive value when the defect candidate Xll is a bright defect with a higher density than the surroundings. In the case of dark defects, the concentration f, (x. y) is smaller than the threshold SLI (i.e., f + (x, y) SL
1 < 0) as a defective candidate point, and each time a defective candidate point is found, 1 is added to an area counter to obtain a value CA corresponding to the total area occupied by the defective candidate point. At the same time, the difference (SL], f+(x, y)) between the concentration f, (xy) at the defect candidate point and the threshold value SLI is calculated and added to the volume counter to determine the concentration at the defect candidate point and the threshold value SLI. A value Cv corresponding to the sum of the density differences between the two is calculated. Here, the value CA is called the area because it corresponds to the total area of defect candidates in the original image, and if we consider a three-dimensional space in which the density is regarded as depth in the /iir image, the value CV is the total volume of defect candidates in the original image. Since it corresponds to , we call it volume. By determining the area OA and volume Cv of the defect candidate point existing in the defect candidate region B as described above, it is possible to determine whether the defect candidate Xl+ is good or bad based on the area CA and volume Cv. That is, the primary judgment of acceptability is made based on the size of the area C, and when the area CA is within a predetermined range, the secondary judgment is made based on the volume CV. For example, the predetermined reference value a for the area CA is as follows:
, b (a>b), and a predetermined reference value C is also set for the volume CV. ■ CA>a ■ When either of the conditions a≧cA>b and Cv>c is satisfied, it is determined to be defective, and defect candidate X is determined to be defective. In addition, in other cases, the product is determined to be non-defective. When the defect candidate
The pixel that becomes the defect candidate point is defined as the defect candidate point. Further, the volume of each defect candidate point is determined as fl(X, 3/)-3LI. The conditions for determining pass/fail are the same as for dark defects. After determining the quality of defect candidate Xl+ as described above,
Continue rask scanning within the inspection area A and select the next defect candidate X1.
Similar processing is performed for No. 2 to determine whether it is good or bad. Here, after determining the quality of one defect candidate X, the next defect candidate -X+2 is searched for, but after setting the reference value calculation line L for one defect candidate X11, the next defect candidate
After searching for □ and setting the reference value calculation line L for all defect candidates, the quality determination may be performed. As described above, by setting the defect candidate area B that circumscribes the contour line 1e12 of the defect candidates X + +, X +□, the contour line 'll+112 of the defect candidates Xz, X, 2
Even if is not closed, defect candidates X + + , X 1□
It is possible to judge the quality of the product. In addition, a reference value calculation line L surrounding the defect candidate area B is set, and the defect candidate area B is determined based on the density of each pixel within the reference value calculation line B.
Since the density of pixels within is binarized, defect candidate X11
.. Even if unnecessary lines are continuous on the contour line 111+l+2 of X12, they will be ignored during the pass/fail judgment due to binarization, and the accuracy of the judgment will be increased. By the way, for setting the defect candidate area B, a differential binary image can also be used instead of using an edge image. A differential binary image is an image that is obtained by differentiating the original image (the method of differentiation is not limited to the above-mentioned method) and then binarizing it using an appropriate threshold, so that it becomes a figure whose border with the background is always closed. It has the property of becoming. Therefore, if the boundary line with the background is found within the inspection area A by rask scanning and this boundary line is tracked, processing is almost the same as tracing the contour line in an edge image. After tracing the boundary line with the background, the defect candidate area B can be set by finding the maximum and minimum values at the X coordinate and the X coordinate of the boundary line, respectively. The subsequent processing is the same as when using edge images. [Example 2] In Example 1, the contour line 1l12 of defect candidate Xz,
The defect candidate area B was set as a rectangle circumscribing the defect candidate area B, but if the defect candidate area B is a circumscribed rectangle
The area of defect candidate region B is considerably larger than the area surrounded by the contour line 111+l+2 of
, , X, contains many parts other than 2, and depending on the shape of the defect candidates X 1+ , X + □, there may be many unnecessary operations. Further, when a plurality of defect candidates X, . This embodiment compensates for the shortcomings of the first embodiment, and the first
Figure 1 (,) and 12th Q? 1(a), in order to make the defect candidate area B narrower than in the case of Example 1, the defect candidate area
A straight line tangent to the contour line 11 is set. As a method of setting such a straight line, for example, there is the following method. That is, first, as in Example 1, the X coordinate of the contour line 11 and the maximum value of the X coordinate X II @
It l Y * a 11 and the minimum value X s ln *
Y m r n is determined, and a rectangle circumscribing the outline 11 is set. For each vertex of this rectangle, the search starting point is moved pixel by pixel in the X direction (or Y direction) starting from the vertex, and the search is performed in a direction of 45 degrees from the search starting point. In other words, when the search starts from one search starting point and reaches the other side of the quadrangle without detecting any pixels on the contour line II, the search starting point is shifted by one pixel in the X direction (or in the Y direction). When a pixel on the contour line 11 is detected during the search, this search line is regarded as a straight line that intersects each side of the rectangle at 45° and is in contact with the contour line. By performing the above procedure for each vertex of the rectangle, it is possible to set a straight line that intersects each side of the rectangle at an angle of 45 degrees, and it is possible to set a hexagonal defect candidate area B. . As a result, compared to Example 1,
The defect candidate area B can be narrowed. Defect candidate area B
After setting, the same process as in Example 1 is performed, and as shown in FIG. 11(b) and FIG. 12(b), a reference value calculation line L is set outside the defect candidates @B. The quality of the defect candidate area B is determined. According to the method of this embodiment, since the area of the defect candidate region B is reduced, the amount of calculations required for pass/fail determination is reduced, and even when multiple defect candidates exist, only one defect candidate The probability that the corresponding defect candidate area B overlaps with other defect candidates is greatly reduced, and accurate pass/fail determination can be expected. In addition, the above procedure can set the rectangular defect candidate area B without using a calculation formula, and the contour line e
It can be used even if l is not closed. As an application of this embodiment, it is also possible to set the defect candidate area B to a polygon other than a quadrangle or a hexagon, but even if the defect candidate area B is set to a polygon larger than a hexagon, the practical effect will hardly change, and the calculation will be difficult. This is not a good idea as the amount will increase.

【実施例3】 ところで、第13図に示すように、複数の欠陥候補X、
、、X、2が存在するときに、一方の欠陥候補X、、、
X、2の基準値算出ラインL l l * L l 2
が他方の欠陥候補X1llXI2の上を通ることがある
。この場合、基準濃度c3として適切な値が得られない
ことになる。 そこで、本実施例では、基準値算出ラインLL+2同士
が交差するかどうかを判定しくこれには、両基準値算出
ラインL + + + L l 2の頂点の座標を比較
すればよい)、交差している場合には、両基準値算出ラ
インL、、、L、□の各辺のうちで交差していない辺を
延長することによって得られる四角形を基準値算出ライ
ンLとする。こうして得た基準値算出ラインLは、他の
基準値算出ラインに交差することがなく、この基準値算
出ラインLの上の各画素の濃度に基づいて基準濃度C8
を適切な値に設定することができる。以後の処理は実施
例1と同様になる。
[Example 3] By the way, as shown in FIG. 13, a plurality of defect candidates X,
,,X,2 exists, one defect candidate,X,,,
Reference value calculation line for X, 2 L l l * L l 2
may pass over the other defect candidate X1llXI2. In this case, an appropriate value cannot be obtained as the reference density c3. Therefore, in this embodiment, it is necessary to determine whether or not the reference value calculation lines LL+2 intersect with each other (this can be done by comparing the coordinates of the vertices of both reference value calculation lines L + + + L l 2). If so, the reference value calculation line L is a rectangle obtained by extending the sides of the reference value calculation lines L, , L, and □ that do not intersect. The reference value calculation line L obtained in this way does not intersect with other reference value calculation lines, and the reference value calculation line L is based on the density of each pixel on this reference value calculation line L.
can be set to an appropriate value. The subsequent processing is the same as in the first embodiment.

【実施例4】 上記各実施例では、欠陥候補領域Bを、欠陥候補Xz’
、X)zの輪郭線Ll+f12に外接する多角形として
設定していたが、本実施例では、欠陥候補領域Bを以下
のようにして設定している。 すなわち、輪郭線’ll+l+2が閉じているときには
、輪郭線111,112の中を欠陥候補領域Bとし、輪
郭線111+l12が開いているときには、第14図に
示すように、端点同士を直線Sで結ぶことにより、輪郭
線’11+’+2を閉じて輪郭線111 + 112の
中を欠陥候補領域Bとするのである。以後は、基準値算
出ラインLを実施例1と同様に設定した後、実施例1と
同様に処理を行えばよい。 こうして欠陥候補領域Bを設定すれば、欠陥候補領域B
を多角形とする場合に比較して、欠陥候補領域Bに欠陥
候補Xll、X12以外の領域がほとんど含まれなくな
り、演算量の減少が期待できるのである。
[Embodiment 4] In each of the above embodiments, the defect candidate area B is replaced by the defect candidate Xz'
, X) z, but in this embodiment, the defect candidate area B is set as follows. That is, when the contour line 'll+l+2 is closed, the inside of the contour lines 111 and 112 is defined as defect candidate area B, and when the contour line 111+l12 is open, the end points are connected with a straight line S as shown in FIG. As a result, the contour line '11+'+2 is closed and the inside of the contour line 111+112 is designated as the defect candidate area B. Thereafter, the reference value calculation line L may be set in the same manner as in the first embodiment, and then the processing may be performed in the same manner as in the first embodiment. If defect candidate area B is set in this way, defect candidate area B
Compared to the case where is a polygon, the defect candidate area B contains almost no areas other than the defect candidates Xll and X12, and a reduction in the amount of calculation can be expected.

【実施例5】 本実施例では、第15図に示すように、複数の欠陥候補
X l l〜X 15が存在している場合であって、い
くつかの欠陥候補X l l〜×1.が比較的近接して
存在している場合に有効な処理を例示する。 すなわち、各欠陥候補X、1〜XI5の輪郭線l〜Z1
5の上の各画素の座標に基づいて、輪郭線l〜L、の間
の最短距離dl 2 + dl 3 + dl 4 +
・・・・・・、d、5をそれぞれ求める。ここに、最短
路Md1Jは、対の欠陥候補X It 、 X 1 h
の間の距離を示す。こうして得られた最短路Nd1Jが
、あらかじめ設定されているしきい値d IIL、より
も小さい(d、r<dst、)ときには、一対の欠陥候
補X、、、X、、を連続しているとみなすのである。連
続しているとみなされた欠陥候補X I L 、 X 
14については、面積CAおよび体積CVをそれぞれ加
算した値を、全体の面積および体積として良否判定に用
いる。 たとえば、第15図において、欠陥候補X、1〜X+4
が連続しているとみなされたとすれば、各欠陥候補X、
l〜X14ごとに設定されたしきい値によって求めた各
欠陥候補X、l〜x14の面ffcA、〜CA4、およ
び各欠陥候補Xll〜X 14の体積CVl〜Cv4を
それぞれ加算して、連続するとみなされている部分全体
の面積C10および体積Cvoを求める。 すなわち、次式のようになる。 CAo = CA l + CA 2 + CAff+
 CA 4Cv a ” Cv + + CV 2 +
 Cv s + Cv 4以後は、CA:=CA0、C
v:=Cvoとして実施例1と同様の処理を行うことに
より、良否判定が行えるのである。独立しているとみな
される欠陥候補X1.については、実施例1と同様に良
否判定が行われる。
[Embodiment 5] In this embodiment, as shown in FIG. 15, a plurality of defect candidates X l l to X15 exist, and several defect candidates X l l to x1. An example of processing that is effective when the two are located relatively close to each other will be exemplified. That is, the contour lines l to Z1 of each defect candidate X, 1 to XI5
Based on the coordinates of each pixel on 5, the shortest distance between contour lines l to L, dl 2 + dl 3 + dl 4 +
......, d, and 5 are determined respectively. Here, the shortest path Md1J is a pair of defect candidates X It , X 1 h
Indicates the distance between. When the shortest path Nd1J obtained in this way is smaller than the preset threshold value dIIL (d, r < dst,), the pair of defect candidates X, , , X, are considered to be continuous. I regard it as such. Defect candidates X I L , X considered to be continuous
Regarding No. 14, the value obtained by adding the area CA and the volume CV, respectively, is used as the entire area and volume for the quality determination. For example, in FIG. 15, defect candidates X, 1 to X+4
are considered to be continuous, each defect candidate X,
If each defect candidate X, the surface ffcA, ~CA4 of l~x14, and the volume CVl~Cv4 of each defect candidate Xll~X14 are added together, and are continuous The area C10 and volume Cvo of the entire portion being considered are determined. That is, the following equation is obtained. CAo = CA l + CA 2 + CAff+
CA 4Cv a ” Cv + + CV 2 +
After Cv s + Cv 4, CA:=CA0,C
By performing the same processing as in the first embodiment with v:=Cvo, it is possible to determine the quality. Defect candidates considered to be independent X1. The quality determination is made in the same manner as in the first embodiment.

【実施例6】 上記各実施例では、欠陥候補領域B内の画素の濃度を2
値化するためのしきい値を、欠陥候補領域Bの外周を囲
むように設定した基準値算出ラインLの上の画素の濃度
に基づく基準濃度c8により求めていたが、検査対象物
に照射する光源の位置などによって、基準値算出ライン
Lの範囲内でも照度にむらが生じることがある。このよ
うなむらがある場合には、基準濃度C,を一定値に固定
すると、本来は同濃度であるべき画素が異なる濃度にな
り、良否判定の精度に影響が生じる。 そこで、本実施例では、第16図に示すように、基準値
算出ラインLの角部分にそれぞれ基準値算出領域り、〜
D、を設定し、各基準値算出領域り。 〜D、の中の各画素の濃度より求めた各基準値算出領域
り、〜D、の基準濃度をそれぞれ基準値算出ラインLの
各頂点の濃度とし、画素のxY座標と濃度との3次元空
間において、これら4点に基づいて基準平面を設定する
。すなわち、最小二乗法等により、これら4点からの距
離の和がもっとも小さくなるような基準平面を設定する
のである。 この基準平面に対して基準濃度c6と同様にオフセット
値を加算して基準平面を上記3次元空間でシフトさせ、
しきい値に相当するしきい平面を設定する。一般に、光
源による照度のむらは−様な変化をするから、上記3次
元空間において基準平面を設定すれば、むらの変化の傾
向、すなわち、濃度勾配に対応することができるのであ
る。 以上のようにして設定されたしきい平面上の各点と同じ
XY座標を有する原画像上の各画素にっいて濃度差に応
じて濃度を2値化すれば、照度むらの影響を除去するこ
とができ、良否判定が正確に行えるのである。
[Embodiment 6] In each of the above embodiments, the density of pixels in the defect candidate area B is set to 2.
The threshold value for converting into a value was determined using the reference density c8 based on the density of the pixels on the reference value calculation line L set to surround the outer periphery of the defect candidate area B, but the Depending on the position of the light source, etc., the illuminance may vary even within the range of the reference value calculation line L. If such unevenness exists, if the reference density C is fixed to a constant value, pixels that should originally have the same density will have different densities, which will affect the accuracy of the pass/fail determination. Therefore, in this embodiment, as shown in FIG. 16, there are reference value calculation areas at the corner portions of the reference value calculation line L.
D, and each reference value calculation area. Each reference value calculation area is determined from the density of each pixel in ~D, and the reference density of ~D is defined as the density of each vertex of the reference value calculation line L, and the xY coordinates of the pixel and the density are three-dimensional. A reference plane is set in space based on these four points. That is, a reference plane is set such that the sum of the distances from these four points is the smallest using the method of least squares or the like. Adding an offset value to this reference plane in the same manner as the reference density c6 to shift the reference plane in the three-dimensional space,
Set the threshold plane corresponding to the threshold. Generally, the unevenness of illuminance caused by a light source changes in a negative manner, so by setting a reference plane in the three-dimensional space, it is possible to deal with the tendency of change in unevenness, that is, the concentration gradient. By binarizing the density of each pixel on the original image that has the same XY coordinates as each point on the threshold plane set in the above manner according to the density difference, the influence of uneven illuminance can be removed. This allows accurate determination of pass/fail.

【発明の効果】【Effect of the invention】

上述したように、請求項1および請求項2の方法によれ
ば、欠陥部の判定対象となる欠陥候補の輪郭線を囲む閉
じた領域内を欠陥候補領域として設定しているから、判
定対象を限定することができるのであり、しかも、検査
対象物の輪郭線の内側で欠陥候補領域の近傍外側の濃度
に基づいて設定されたしきい値との大小関係により欠陥
候補領域内の各画素の濃度を2値化して欠陥候補内の画
素を他の画素から分離するから、しきい値として適切な
値を設定することができ、欠陥候補内の画素と他の画素
との分離が確実に行えることになり、欠陥候補の良否判
定の精度が高まるという利点がある。 請求項3の方法では、欠陥候補領域を六角形に設定して
いるので、欠陥候補の輪郭線にほぼ沿う形で欠陥候補領
域を設定することができ、欠陥候補領域を簡単な形状に
設定しながらも欠陥候補の面積とほぼ同じ程度の面積に
設定できるのであって、欠陥候補領域内でのむだな演算
による演算量の増加が抑制できるという効果を奏する。 請求項4の方法では、複数個の欠陥候補領域の近傍外側
で検査対象物の輪郭線よりも内側にそれぞれ基準値算出
ラインを設定し、異なる欠陥候補領域に対応する基準値
算出ライン同士が交差しないときには、各基準値算出ラ
インの上の各画素の濃度に基づいて基準濃度を算出し、
異なる欠陥候補領域に対応する基準値算出ライン同士が
交差するときには、交差する基準値算出ラインに囲まれ
る全領域を囲むとともに両基準値算出ラインの一部を含
むような新たな基準値算出ラインを設定し、この基準値
算出ラインの上の画素の濃度に基づいて基準濃度を設定
するようにしているので、複数個の欠陥候補が存在し、
各欠陥候補に対応する基準値算出ライン同士が交差して
いても、基準濃度算出ラインの一部が欠陥候補領域内を
通ることがなく、基準濃度を適切な値に設定することが
できるという利点を有する。 請求項らの方法は、しきい値を、欠陥候補領域内が周囲
よりも暗い暗欠陥のときには、上記基準濃度に負のオフ
セット値を加算して設定し、欠陥候補領域内が周囲より
も明るい明欠陥のときには、上記基準濃度に正のオフセ
ット値を加算して設定するので、しきい値を欠陥候補領
域の明るさに応じて適切な値に設定できるという利点を
有するのである。 請求項6の方法では、しきい値との大小関係に基づいて
分離された欠陥候補内の画素が占める面積、および各画
素の濃度と上記しきい値との濃度差の総和である体積を
求め、上記面積と上記体積とに基づいて欠陥候補の良否
を判定するので、面積のみによって欠陥候補の良否を判
定する場合に比較して良否判定の精度が高くなるという
効果がある。 請求項7の方法では、複数個の欠陥候補の輪郭線同士の
距離をそれぞれ求め、この距離が所定距離以内である欠
陥候補の面積および体積を合計し、合計された面積およ
び体積に基づいて欠陥候補の良否を判定するから、本来
1つの欠陥候補であるにもかかわらず、輪郭線を求める
際の処理によって分離されていた複数の欠陥候補を1つ
の欠陥候補として扱うことができるのであり、判定精度
の向上が期待できるという利点を有する。 請求項8の方法は、基準値算出ラインを多角形状に設定
し、上記基準値算出ラインの各頂点付近の画素の濃度に
基づいて各頂点の基準濃度を算出し、各画素の位置と濃
度との3次元空間において、各頂点の間の濃度勾配に近
似した基準平面を設定し、上゛記3次元空間において基
準平面を濃度方向に偏移させたしきい平面の各画素の濃
度をそれぞれその位置におけるしきい値とし、上記しき
い値に対応する位置の欠陥候補領域内の各画素の濃度を
各しきい値に基づいて2値化しているから、光源の位置
などによって欠陥候補領域に照度むらが生じても、照度
むらの影響を除去することができ、判定精度が向上する
のである。 請求項9の方法では、欠陥候補の輪郭線が閉じていると
きには、輪郭線内を欠陥候補領域とし、輪郭線が開いて
いるときには、輪郭線の端同士を直線で結んだ範囲内を
欠陥候補領域とするので、欠陥候補領域の設定が非常に
容易になるという効果がある。
As described above, according to the methods of claims 1 and 2, the closed area surrounding the outline of the defect candidate to be determined as a defective part is set as the defect candidate area. Moreover, the density of each pixel in the defect candidate area can be determined based on the magnitude relationship with the threshold value set based on the density outside the vicinity of the defect candidate area inside the outline of the inspection object. Since the pixels in the defect candidate are binarized and separated from other pixels, it is possible to set an appropriate value as a threshold value, and it is possible to reliably separate pixels in the defect candidate from other pixels. This has the advantage of increasing the accuracy of determining the quality of defective candidates. In the method of claim 3, since the defect candidate area is set in a hexagonal shape, the defect candidate area can be set in a shape that almost follows the outline of the defect candidate, and the defect candidate area can be set in a simple shape. However, since the area can be set to be approximately the same as the area of the defect candidate, an increase in the amount of calculation due to wasteful calculation within the defect candidate area can be suppressed. In the method of claim 4, reference value calculation lines are set outside the vicinity of the plurality of defect candidate areas and inside the outline of the object to be inspected, and the reference value calculation lines corresponding to different defect candidate areas intersect with each other. If not, calculate the reference density based on the density of each pixel on each reference value calculation line,
When reference value calculation lines corresponding to different defect candidate areas intersect, a new reference value calculation line is created that encloses the entire area surrounded by the intersecting reference value calculation lines and also includes a part of both reference value calculation lines. Since the standard density is set based on the density of the pixel above this standard value calculation line, there are multiple defect candidates,
Even if the reference value calculation lines corresponding to each defect candidate intersect, part of the reference density calculation line does not pass through the defect candidate area, and the reference density can be set to an appropriate value. has. In the method of the claims, the threshold value is set by adding a negative offset value to the reference density when the inside of the defect candidate area is darker than the surrounding area, and the threshold value is set by adding a negative offset value to the above reference density. In the case of a bright defect, a positive offset value is added to the reference density to set the threshold value, which has the advantage that the threshold value can be set to an appropriate value depending on the brightness of the defect candidate area. In the method of claim 6, the area occupied by the pixels in the defect candidate separated based on the magnitude relationship with the threshold value and the volume that is the sum of the density difference between the density of each pixel and the threshold value are determined. Since the quality of the defect candidate is determined based on the area and the volume, the accuracy of the quality determination is improved compared to the case where the quality of the defect candidate is determined based only on the area. In the method of claim 7, the distance between the contour lines of a plurality of defect candidates is determined, the areas and volumes of defect candidates within a predetermined distance are summed, and the defect is determined based on the total area and volume. Since the quality of the candidate is determined, multiple defect candidates that were originally one defect candidate but were separated by the process of calculating the contour line can be treated as one defect candidate. This has the advantage that improved accuracy can be expected. In the method of claim 8, the reference value calculation line is set in a polygonal shape, the reference density of each vertex is calculated based on the density of pixels near each vertex of the reference value calculation line, and the position and density of each pixel are calculated. In the three-dimensional space described above, a reference plane that approximates the concentration gradient between each vertex is set, and the density of each pixel on the threshold plane is determined by shifting the reference plane in the density direction in the three-dimensional space described above. Since the density of each pixel in the defect candidate area at the position corresponding to the above threshold value is binarized based on each threshold value, the illuminance of the defect candidate area can be adjusted depending on the position of the light source, etc. Even if unevenness occurs, the influence of uneven illuminance can be removed, improving determination accuracy. In the method of claim 9, when the contour line of the defect candidate is closed, the inside of the contour line is set as the defect candidate area, and when the contour line is open, the area between the edges of the contour line is set as the defect candidate area. Since the area is defined as a region, there is an effect that setting of the defect candidate area becomes very easy.

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

第1図は本発明の実施例1の方法に対応する処理回路の
ブロック図、第2図(1)(b)はそれぞれ本発明にお
ける原画像、エツジ画像の一例を示す説明図、第3図は
同上における局所並列ウィンドウを示す説明図、第4図
は同上における微分絶対値画像を示す説明図、第5図は
同上において微分絶対値画像からエツジ画像を得る段階
でのノイズ除去を行う処理の説明図、第6図は同上にお
いて検査対象物の輪郭線と検査領域との関係を示す動作
説明図、第7図は同上において検査領域内での欠陥候補
の探索動作を示す動作説明図、第8図は同上において欠
陥候補の輪郭線とフラグ点との関係を示す動作説明図、
第9図は同上における欠陥候補と欠陥候補領域との関係
を示す動作説明図、第10図は同上における欠陥候補領
域と基準値算出ラインとの関係を示す動作説明図、第1
1図および第12図は本発明の実施例2における欠陥候
補領域の設定方法を示す動作説明図、第13図は本発明
の実施例3における基準値算出ラインの設定方法を示す
動作説明図、第14図は本発明の実施例4における欠陥
候補領域の設定方法を示す動作説明図、第15図は本発
明の実施例5を示す動作説明図、第16図は本発明の実
施例6を示す動作説明図である。 A・・・検査領域、B・・・欠陥候補領域、lo〜12
.IZI2・・・輪郭線、L +’ L + + 、 
L +□・・・基準値算出ライン、0・・・検査対象物
、Xl・・・欠陥、X2・・・異物、XX12・・・欠
陥候補。
FIG. 1 is a block diagram of a processing circuit corresponding to the method of Embodiment 1 of the present invention, FIG. is an explanatory diagram showing locally parallel windows in the same as above, FIG. 4 is an explanatory diagram showing a differential absolute value image in the same as above, and FIG. An explanatory diagram, FIG. 6 is an operation explanatory diagram showing the relationship between the outline of the inspection object and the inspection area in the same as above, and FIG. 7 is an operation explanatory diagram showing the search operation for defect candidates within the inspection area in the same as above Figure 8 is an operation explanatory diagram showing the relationship between the contour line of the defect candidate and the flag point in the same as above;
9 is an explanatory diagram of the operation showing the relationship between the defect candidate and the defect candidate area in the same as above, FIG. 10 is an explanatory diagram of the operation showing the relationship between the defect candidate area and the reference value calculation line in the same as the above,
1 and 12 are operation explanatory diagrams showing a method for setting a defect candidate area in Example 2 of the present invention, and FIG. 13 is an operation explanatory diagram showing a method for setting a reference value calculation line in Example 3 of the present invention, FIG. 14 is an operational explanatory diagram showing a defect candidate area setting method in Embodiment 4 of the present invention, FIG. 15 is an operational explanatory diagram showing Embodiment 5 of the present invention, and FIG. FIG. A... Inspection area, B... Defect candidate area, lo~12
.. IZI2...contour line, L +' L + +,
L+□...Reference value calculation line, 0...Inspection object, Xl...Defect, X2...Foreign object, XX12...Defect candidate.

Claims (9)

【特許請求の範囲】[Claims] (1)画像入力手段により検査対象物を含む空間領域を
撮像した後、画像入力手段により得られた原画像の各画
素の濃度の変化に基づいて検査対象物の輪郭線を含むエ
ッジ画像を設定し、原画像とエッジ画像とに基づいて検
査対象物の輪郭線の内側に存在する欠け、ひび、汚れ等
の欠陥部を抽出する外観検査による欠陥抽出方法におい
て、検査対象物の輪郭線の内側に欠陥部の判定対象とな
る欠陥候補の輪郭線を囲む閉じた領域内を欠陥候補領域
として設定し、欠陥候補領域の近傍外側で検査対象物の
輪郭線よりも内側の濃度に基づいて基準濃度を設定し、
欠陥候補領域内の各画素の濃度を上記基準濃度に基づい
て設定されたしきい値との大小関係によって2値化する
ことにより、欠陥候補内の画素と他の画素とを分離する
ことを特徴とする外観検査による欠陥抽出方法。
(1) After capturing an image of a spatial region including the object to be inspected using the image input means, an edge image including the outline of the object to be inspected is set based on the change in density of each pixel of the original image obtained by the image input means. However, in a defect extraction method using visual inspection that extracts defects such as chips, cracks, dirt, etc. that exist inside the outline of the object to be inspected based on the original image and the edge image, The closed area surrounding the outline of the defect candidate that is the target of defect determination is set as the defect candidate area, and the reference density is determined based on the density outside the vicinity of the defect candidate area and inside the outline of the object to be inspected. and set
A feature is that pixels in the defect candidate area are separated from other pixels by binarizing the density of each pixel in the defect candidate area based on the magnitude relationship with a threshold value set based on the reference density. Defect extraction method using visual inspection.
(2)画像入力手段により検査対象物を含む空間領域を
撮像した後、画像入力手段により得られた原画像の各画
素の濃度の変化に基づいて検査対象物の輪郭線を含む微
分2値画像を設定し、原画像と微分2値画像とに基づい
て検査対象物の輪郭線の内側に存在する欠け、ひび、汚
れ等の欠陥部を抽出する外観検査による欠陥抽出方法に
おいて、検査対象物の輪郭線の内側に欠陥部の判定対象
となる欠陥候補の輪郭線を囲む閉じた領域内を欠陥候補
領域として設定し、欠陥候補領域の近傍外側で検査対象
物の輪郭線よりも内側の濃度に基づいて基準濃度を設定
し、欠陥候補領域内の各画素の濃度を上記基準濃度に基
づいて設定されたしきい値との大小関係によって2値化
することにより、欠陥候補内の画素と他の画素とを分離
することを特徴とする外観検査による欠陥抽出方法。
(2) After capturing an image of a spatial region including the object to be inspected by the image input means, a differential binary image containing the outline of the object to be inspected is based on the change in density of each pixel of the original image obtained by the image input means. In the defect extraction method using visual inspection, which extracts defects such as chips, cracks, and stains that exist inside the outline of the object to be inspected based on the original image and the differential binary image, A closed area surrounding the outline of the defect candidate to be determined as a defect is set as the defect candidate area inside the outline, and the density is set inside the outline of the object to be inspected outside the vicinity of the defect candidate area. By setting a reference density based on the above, and binarizing the density of each pixel in the defect candidate area based on the magnitude relationship with the threshold value set based on the reference density, pixels in the defect candidate area and other pixels are A defect extraction method by visual inspection characterized by separating pixels.
(3)上記欠陥候補領域は、画面の縦方向と横方向とに
走る各一対の辺と、上記各辺に対してそれぞれ45゜の
角度で交差する4辺とに囲まれた八角形に設定されて成
ることを特徴とする請求項1または請求項2に記載の外
観検査による欠陥抽出方法。
(3) The defect candidate area is set as an octagon surrounded by a pair of sides running in the vertical and horizontal directions of the screen, and four sides intersecting each of the above sides at an angle of 45 degrees. 3. The defect extraction method by visual inspection according to claim 1 or 2, characterized in that:
(4)複数個の欠陥候補領域の近傍外側で検査対象物の
輪郭線よりも内側にそれぞれ基準値算出ラインを設定し
、異なる欠陥候補領域に対応する基準値算出ライン同士
が交差しないときには、各基準値算出ラインの上の各画
素の濃度に基づいて基準濃度を算出し、異なる欠陥候補
領域に対応する基準値算出ライン同士が交差するときに
は、交差する基準値算出ラインに囲まれる全領域を囲む
とともに両基準値算出ラインの一部を含むような新たな
基準値算出ラインを設定し、この基準値算出ラインの上
の画素の濃度に基づいて基準濃度を設定することを特徴
とする請求項1または請求項2に記載の外観検査による
欠陥抽出方法。
(4) Set reference value calculation lines outside the vicinity of multiple defect candidate areas and inside the outline of the object to be inspected, and when the reference value calculation lines corresponding to different defect candidate areas do not intersect, each A reference density is calculated based on the density of each pixel on the reference value calculation line, and when reference value calculation lines corresponding to different defect candidate areas intersect, the entire area surrounded by the intersecting reference value calculation lines is enclosed. According to claim 1, a new reference value calculation line that includes part of both reference value calculation lines is set, and the reference density is set based on the density of the pixel above this reference value calculation line. Or the defect extraction method by visual inspection according to claim 2.
(5)上記しきい値は、欠陥候補領域内が周囲よりも暗
い暗欠陥のときには、上記基準濃度に負のオフセット値
を加算して設定され、欠陥候補領域内が周囲よりも明る
い明欠陥のときには、上記基準濃度に正のオフセット値
を加算して設定されることを特徴とする請求項1または
請求項2に記載の外観検査による欠陥抽出方法。
(5) The above threshold value is set by adding a negative offset value to the above reference density for a dark defect where the inside of the defect candidate area is darker than the surrounding area, and for a bright defect where the inside of the defect candidate area is brighter than the surrounding area. 3. The defect extraction method by visual inspection according to claim 1, wherein the reference density is sometimes set by adding a positive offset value to the reference density.
(6)しきい値との大小関係に基づいて分離された欠陥
候補内の画素が占める面積、および各画素の濃度と上記
しきい値との濃度差の総和である体積を求め、上記面積
と上記体積とに基づいて欠陥候補の良否を判定すること
を特徴とする請求項1または請求項2に記載の外観検査
による欠陥抽出方法。
(6) Calculate the area occupied by the pixels in the defect candidate separated based on the magnitude relationship with the threshold value and the volume that is the sum of the density difference between the density of each pixel and the above threshold value, and 3. The defect extraction method by visual inspection according to claim 1, wherein the quality of the defect candidate is determined based on the volume.
(7)複数個の欠陥候補の輪郭線同士の距離をそれぞれ
求め、この距離が所定距離以内である欠陥候補の面積お
よび体積を合計し、合計された面積および体積に基づい
て欠陥候補の良否を判定することを特徴とする請求項6
記載の外観検査による欠陥抽出方法。
(7) Find the distance between the contour lines of multiple defect candidates, total the area and volume of the defect candidates whose distance is within a predetermined distance, and evaluate the quality of the defect candidate based on the total area and volume. Claim 6 characterized in that it determines
Defect extraction method using visual inspection as described.
(8)基準値算出ラインを多角形状に設定し、上記基準
値算出ラインの各頂点付近の画素の濃度に基づいて各頂
点の基準濃度を算出し、各画素の位置と濃度との3次元
空間において、各頂点の間の濃度勾配に近似した基準平
面を設定し、上記3次元空間において基準平面を濃度方
向に偏移させたしきい平面の各画素の濃度をそれぞれそ
の位置におけるしきい値とし、上記しきい値に対応する
位置の欠陥候補領域内の各画素の濃度を各しきい値に基
づいて2値化することを特徴とする請求項1または請求
項2に記載の外観検査による欠陥抽出方法。
(8) Set the reference value calculation line in a polygonal shape, calculate the reference density of each vertex based on the density of pixels near each vertex of the reference value calculation line, and create a three-dimensional space between the position and density of each pixel. , a reference plane that approximates the density gradient between each vertex is set, and the density of each pixel on the threshold plane, which is obtained by shifting the reference plane in the density direction in the three-dimensional space, is set as the threshold value at that position. , wherein the density of each pixel in the defect candidate area at a position corresponding to the threshold is binarized based on each threshold. Extraction method.
(9)欠陥候補の輪郭線が閉じているときには、輪郭線
内を欠陥候補領域とし、輪郭線が開いているときには、
輪郭線の端同士を直線で結んだ範囲内を欠陥候補領域と
することを特徴とする請求項1または請求項2に記載の
外観検査による欠陥抽出方法。
(9) When the contour line of the defect candidate is closed, the inside of the contour line is the defect candidate area, and when the contour line is open,
3. The method for extracting defects by visual inspection according to claim 1 or 2, characterized in that the area defined by connecting the edges of the contour lines with straight lines is defined as a defect candidate area.
JP2125071A 1989-09-14 1990-05-15 Defect extraction method by visual inspection Expired - Lifetime JPH06103275B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2125071A JPH06103275B2 (en) 1989-09-14 1990-05-15 Defect extraction method by visual inspection

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP1-239079 1989-09-14
JP23907989 1989-09-14
JP2125071A JPH06103275B2 (en) 1989-09-14 1990-05-15 Defect extraction method by visual inspection

Publications (2)

Publication Number Publication Date
JPH03175343A true JPH03175343A (en) 1991-07-30
JPH06103275B2 JPH06103275B2 (en) 1994-12-14

Family

ID=26461604

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2125071A Expired - Lifetime JPH06103275B2 (en) 1989-09-14 1990-05-15 Defect extraction method by visual inspection

Country Status (1)

Country Link
JP (1) JPH06103275B2 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005241304A (en) * 2004-02-24 2005-09-08 Matsushita Electric Works Ltd Appearance inspection method
JP2007057441A (en) * 2005-08-25 2007-03-08 Matsushita Electric Works Ltd Method of inspecting microcircuit
JP2007114073A (en) * 2005-10-21 2007-05-10 Dainippon Screen Mfg Co Ltd Stylus trace detecting device and method
JP2010197176A (en) * 2009-02-24 2010-09-09 Panasonic Electric Works Co Ltd Method and device for inspecting defect
JP2012112951A (en) * 2010-11-20 2012-06-14 Koh Young Technology Inc Inspection method
CN113592775A (en) * 2021-06-29 2021-11-02 深圳市锦瑞生物科技有限公司 Sucker image processing method and device and sucker image processing equipment
CN114324038A (en) * 2021-09-26 2022-04-12 中国海洋石油集团有限公司 Erosion measurement system and detection method thereof

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5390754B2 (en) * 2007-06-28 2014-01-15 パナソニック株式会社 Appearance inspection method and apparatus using image processing

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005241304A (en) * 2004-02-24 2005-09-08 Matsushita Electric Works Ltd Appearance inspection method
JP4581424B2 (en) * 2004-02-24 2010-11-17 パナソニック電工株式会社 Appearance inspection method and image processing apparatus
JP2007057441A (en) * 2005-08-25 2007-03-08 Matsushita Electric Works Ltd Method of inspecting microcircuit
JP2007114073A (en) * 2005-10-21 2007-05-10 Dainippon Screen Mfg Co Ltd Stylus trace detecting device and method
JP2010197176A (en) * 2009-02-24 2010-09-09 Panasonic Electric Works Co Ltd Method and device for inspecting defect
JP2012112951A (en) * 2010-11-20 2012-06-14 Koh Young Technology Inc Inspection method
US9092843B2 (en) 2010-11-20 2015-07-28 Koh Young Technology Inc. Inspection method
CN113592775A (en) * 2021-06-29 2021-11-02 深圳市锦瑞生物科技有限公司 Sucker image processing method and device and sucker image processing equipment
CN113592775B (en) * 2021-06-29 2023-09-12 深圳市锦瑞生物科技股份有限公司 Suction head image processing method and device and suction head image processing equipment
CN114324038A (en) * 2021-09-26 2022-04-12 中国海洋石油集团有限公司 Erosion measurement system and detection method thereof

Also Published As

Publication number Publication date
JPH06103275B2 (en) 1994-12-14

Similar Documents

Publication Publication Date Title
US7200259B1 (en) Optical inspection system
CN114140679B (en) Defect fusion method, device, recognition system and storage medium
CN109472271B (en) Printed circuit board image contour extraction method and device
JPH03160349A (en) Device for detecting crack
CN110060239B (en) Defect detection method for bottle opening of bottle
JPH03175343A (en) Method for extracting flaw by inspection appearance
CN111833350A (en) Machine vision detection method and system
JP3890844B2 (en) Appearance inspection method
JP3508518B2 (en) Appearance inspection method
JP2001028059A (en) Method and device for color unevenness inspection
JPH02242382A (en) Defect checking method
JP2007017214A (en) Inspection device and inspection method
JP5346304B2 (en) Appearance inspection apparatus, appearance inspection system, and appearance inspection method
JP2686053B2 (en) Defect inspection method by visual inspection
JPH10208066A (en) Method for extracting edge line of check object and appearance check method using this method
JP2710685B2 (en) Defect detection method by visual inspection
JP5033077B2 (en) Method and apparatus for inspecting appearance of molded product
JP3753234B2 (en) Defect detection method
JPH09161056A (en) Inspecting method for inner surface of circular container
JPH06160289A (en) Inner face inspection equipment for circular vessel
JPH01273181A (en) Visual inspecting method
CN117495846B (en) Image detection method, device, electronic equipment and storage medium
JPH0772909B2 (en) Welding condition judgment method by visual inspection
JPH02187651A (en) Image processing method
JP2514727B2 (en) Defect inspection method by visual inspection