JP2710685B2 - Defect detection method by visual inspection - Google Patents

Defect detection method by visual inspection

Info

Publication number
JP2710685B2
JP2710685B2 JP13771290A JP13771290A JP2710685B2 JP 2710685 B2 JP2710685 B2 JP 2710685B2 JP 13771290 A JP13771290 A JP 13771290A JP 13771290 A JP13771290 A JP 13771290A JP 2710685 B2 JP2710685 B2 JP 2710685B2
Authority
JP
Japan
Prior art keywords
pixel
value
image
differential
defect candidate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP13771290A
Other languages
Japanese (ja)
Other versions
JPH0431751A (en
Inventor
智治 中原
新治 畑澤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP13771290A priority Critical patent/JP2710685B2/en
Publication of JPH0431751A publication Critical patent/JPH0431751A/en
Application granted granted Critical
Publication of JP2710685B2 publication Critical patent/JP2710685B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION 【産業上の利用分野】[Industrial applications]

本発明は、検査対象物の表面の欠け、ひび、汚れ等の
外観上の欠陥部を画像処理によって自動検出するように
した外観検査による欠陥検出方法に関するものである。
The present invention relates to a defect detection method based on an appearance inspection that automatically detects an external defect such as a chip, a crack, or a stain on the surface of an inspection object by image processing.

【従来の技術】[Prior art]

従来より、検査対象物の表面に存在する欠け、ひび、
汚れ等の外観上の欠陥部を自動検出する方法として、検
査対象物を含む空間領域をITVカメラ等の画像入力手段
で撮像して作成された濃淡画像である原画像の各画素の
濃度値に基づく欠陥検出方法が知られている。たとえ
ば、欠陥部と背景とのコントラストが明確な場合には、
濃淡画像を適宜しきい値を用いて2値画像に変えるしき
い値処理を行うことによって欠陥部を背景から分離する
方法がある。 一方、欠け、ひび、汚れ等の検査対象物の表面に存在
する欠陥部は、背景とのコントラストが明確ではないこ
とが多く、画像内の場所によってコントラストが異なる
こともある。したがって、しきい値処理では大きな欠陥
部しか検出できないのであって、小さな欠陥部まで検出
する必要があるような欠陥検出方法には、しきい値処理
は不向きである。そこで、この種の欠陥検出方法には、
画素の濃度値の変化率や濃度値の最大変化の方向を求め
る微分処理が用いられている。 微分処理では、各画素の値をその画素の近傍の濃度値
の変化率である微分絶対値とした微分絶対値画像と、各
画素の値をその画素の近傍の濃度値の最大変化の方向を
表す微分方向値とした微分方向値画像とに基づいて、1
画素幅を有する線画像であるエッジ画像を求める。エッ
ジ画像を求める処理では、まず微分絶対値画像を適宜し
きい値を用いて2値画像に変える。このとき、コントラ
ストの小さい部分では微分絶対値も小さくなるから、2
値画像では欠陥部の輪郭線などの連続線となるべき部分
でも不連続線になる場合があり、不連続箇所の周辺の微
分絶対値および微分方向値を用いて不連続線を延長して
連結するように延長処理を行い、エッジ画像を生成す
る。その後、エッジ画像内の画素を順に走査することに
よってエッジを検出し、検出したエッジの周辺の微分絶
対値や微分方向値、エッジの形状などに基づいて、欠陥
部を検出するのである。
Conventionally, chips, cracks,
As a method of automatically detecting a defect in appearance such as dirt, a density area of each pixel of an original image, which is a grayscale image created by capturing an image of a spatial area including an inspection object with image input means such as an ITV camera, is used. A defect detection method based on such a method is known. For example, if the contrast between the defect and the background is clear,
There is a method of separating a defective portion from a background by performing threshold processing for changing a grayscale image into a binary image using a threshold value as appropriate. On the other hand, a defect existing on the surface of an inspection object such as a chip, a crack, or a stain often has a poor contrast with the background, and the contrast may be different depending on a position in an image. Therefore, the threshold processing can detect only a large defective portion, and the threshold processing is not suitable for a defect detection method that needs to detect even a small defective portion. Therefore, this type of defect detection method includes:
Differential processing for obtaining the rate of change of the density value of the pixel and the direction of the maximum change of the density value is used. In the differentiation process, a differential absolute value image in which the value of each pixel is a differential absolute value that is a change rate of a density value in the vicinity of the pixel, and the direction of the maximum change in the density value in the vicinity of the pixel are defined as values of each pixel. 1 based on the differential direction value image
An edge image which is a line image having a pixel width is obtained. In the process of obtaining an edge image, first, the differential absolute value image is changed to a binary image using an appropriate threshold value. At this time, the differential absolute value also becomes small in the portion where the contrast is small, so that 2
In the value image, even a part that should be a continuous line such as the outline of a defective part may be discontinuous, and the discontinuous line is extended and connected using the differential absolute value and differential direction value around the discontinuous point Is performed to generate an edge image. Then, the edge is detected by sequentially scanning the pixels in the edge image, and the defective portion is detected based on the differential absolute value and differential direction value around the detected edge, the shape of the edge, and the like.

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

上述した微分処理を用いる欠陥検出方法では、エッジ
画像を生成する際に、延長処理を行うのであるが、不連
続部分の周辺での微分絶対値が小さいときには、欠陥部
の輪郭に対応するように線を延長するのが難しく、たと
えば、欠陥部がひびであるような場合には、欠陥部の輪
郭を正しく表現したエッジ画像を得るのが困難であると
いう問題があった。 本発明は上記問題点の解決を目的とするものであり、
欠陥部がひびである場合のように、欠陥部と背景とのコ
ントラストが小さく、エッジ画像に欠陥部の輪郭が正し
く反映されないような場合でも、欠陥部の形状を正しく
認識し高い検出精度で欠陥部が検出できるようにした外
観検査による欠陥検出方法を提供しようとするものであ
る。
In the defect detection method using the above-described differential processing, when an edge image is generated, the extension processing is performed.However, when the absolute value of the differential around the discontinuous portion is small, the differential processing is performed so as to correspond to the contour of the defective portion. It is difficult to extend the line. For example, when the defect is cracked, there is a problem that it is difficult to obtain an edge image that correctly represents the contour of the defect. The present invention is aimed at solving the above problems,
Even when the contrast between the defect and the background is low, such as when the defect is cracked, and the outline of the defect is not correctly reflected in the edge image, the defect shape can be correctly recognized and the defect can be detected with high detection accuracy. It is an object of the present invention to provide a defect detection method by visual inspection in which a part can be detected.

【課題を解決するための手段】[Means for Solving the Problems]

本発明は、上記目的の達成のために、検査対象物を含
む空間領域を撮像して作成された濃淡画像である原画像
に基づいて、各画素の近傍領域内の濃度値の変化率を表
す微分絶対値を各画素に対応させた微分絶対値画像と、
各画素の近傍領域内の濃度値の最大変化の方向を複数値
で表した微分方向値を各画素に対応させ微分方向値画像
とを作成し、さらに微分絶対値画像における所定値以上
の画素を1画素幅に細線化してエッジ画像を作成するこ
とを前提にしており、以下の方法によって欠陥部の検出
を行うようにしている。 すなわち、請求項1の方法では、エッジ画像内の線上
の画素を微分方向値が一定範囲内の微分方向値ごとに分
類して複数個の部分エッジ画像を作成し、1つの部分エ
ッジ画像内について検査対象物に対応する領域内であら
かじめ設定した検査領域を走査して部分エッジ画像内の
線上の画素を欠陥候補点として検出し、欠陥候補点に隣
接する画素のうちに部分エッジ画像内の線上の画素があ
れば次の欠陥候補点とし、線上の画素がなければ欠陥候
補点の微分方向値を含む一定範囲内の微分方向値を有す
る画素のうちで微分絶対値が最大となる画素を次の欠陥
候補点とし、いずれかの部分エッジ画像内で欠陥候補点
が規定数以上連続して検出されたときに欠陥部が存在す
ると判定するのである。 請求項2の方法では、エッジ画像内の線上の画素を微
分方向値が一定範囲内の微分方向値ごとに分類して複数
個の部分エッジ画像を作成し、1つの部分エッジ画像内
について検査対象物に対応する領域内であらかじめ設定
した検査領域を走査して部分エッジ画像内の線上の画素
を欠陥候補点として検出し、欠陥候補点に隣接する画素
のうちに部分エッジ画像内の線上の画素があれば次の欠
陥候補点として、線上の画素がなければ欠陥候補点の微
分方向値を含む一定範囲内の微分方向値を有する画素の
うちで微分絶対値が最大となる画素を次の欠陥候補点と
し、いずれかの部分エッジ画像内で欠陥候補点が規定数
以上連続して検出されたときに、連続する欠陥候補点を
含む周辺領域を設定するとともに、その部分エッジ画像
とは微分方向値が180度異なる部分エッジ画像について
周辺領域内で欠陥候補点が規定数以上連続して検出され
たときに欠陥部が存在すると判定するのである。 請求項3の方法では、エッジ画像内について検査対象
物に対応する領域内であらかじめ設定した検査領域を走
査してエッジ画像内の線上の画素を欠陥候補点として検
出し、欠陥候補点に隣接する画素のうちで、欠陥候補点
および隣接する画素のうちの最大の微分絶対値を有した
画素の微分方向値を含む一定範囲内の微分方向値を有す
る画素を求め、この画素がエッジ画像内の線上の画素で
あれば次の欠陥候補点とし、線上の画素でなければ微分
絶対値が最大となる画素を次の欠陥候補点とし、エッジ
画像内で欠陥候補点が規定数以上連続して検出されたと
きに欠陥部が存在すると判定するのである。 請求項4の方法では、エッジ画像内について検査対象
物に対応する領域内であらかじめ設定した検査領域を走
査してエッジ画像内の線上の画素を欠陥候補点として検
出し、欠陥候補点に隣接する画素のうちで、欠陥候補点
および隣接する画素のうちの最大の微分絶対値を有した
画素の微分方向値を含む一定範囲内の微分方向値を有す
る画素を求め、この画素がエッジ画像内の線上の画素で
あれば次の欠陥候補点とし、線上の画素でなければ微分
絶対値が最大となる画素を次の欠陥候補点とし、エッジ
画像内で欠陥候補点が規定数以上連続して検出されたと
きに、連続する欠陥候補点を含む周辺領域を設定すると
ともに、連続する欠陥候補点とは微分方向値が180度異
なる欠陥候補点が周辺領域内で規定数以上連続して検出
されたときに欠陥部が存在すると判定するのである。
In order to achieve the above object, the present invention represents a change rate of a density value in a region near each pixel based on an original image which is a grayscale image created by imaging a spatial region including an inspection object. A differential absolute value image in which the differential absolute value corresponds to each pixel,
A differential direction value image is created by associating each pixel with a differential direction value in which the direction of the maximum change in the density value in the vicinity area of each pixel is represented by a plurality of values, and further, pixels having a predetermined value or more in the differential absolute value image are created. It is assumed that an edge image is created by thinning to one pixel width, and a defective portion is detected by the following method. That is, according to the method of the first aspect, a plurality of partial edge images are created by classifying pixels on a line in the edge image for each differential direction value in which the differential direction value is within a certain range. A predetermined inspection area is scanned in an area corresponding to the inspection object, and pixels on a line in the partial edge image are detected as defect candidate points, and pixels on the line in the partial edge image among pixels adjacent to the defect candidate point are detected. If there is no pixel, the next defect candidate point is determined.If there is no pixel on the line, the pixel having the maximum differential absolute value among the pixels having the differential direction value within a certain range including the differential direction value of the defect candidate point is determined next. It is determined that there is a defective portion when a predetermined number or more of defect candidate points are continuously detected in any of the partial edge images. In the method according to the second aspect, a plurality of partial edge images are created by classifying pixels on a line in the edge image for each differential direction value in which the differential direction value is within a certain range, and an inspection object is inspected in one partial edge image. In the area corresponding to the object, a predetermined inspection area is scanned to detect a pixel on a line in the partial edge image as a defect candidate point, and a pixel on a line in the partial edge image among pixels adjacent to the defect candidate point If there is a pixel, the pixel having the maximum differential absolute value among the pixels having a differential direction value within a certain range including the differential direction value of the defect candidate point is determined as the next defect candidate point if there is no pixel on the line. As a candidate point, when a defect candidate point is continuously detected by a specified number or more in any of the partial edge images, a peripheral area including the continuous defect candidate point is set, and the partial edge image is differentiated in the differential direction. Value is 180 It is to determine a defective portion exists when a defect candidate points in the peripheral region different parts edge image is detected continuously more than the specified number. In the method according to the third aspect, a predetermined inspection area is scanned in an area corresponding to the inspection object in the edge image, and a pixel on a line in the edge image is detected as a defect candidate point. Among the pixels, a pixel having a differential direction value within a certain range including the differential direction value of the pixel having the maximum differential absolute value among the defect candidate points and the adjacent pixels is obtained, and this pixel is included in the edge image. If it is a pixel on the line, it is the next defect candidate point.If it is not a pixel on the line, the pixel with the largest differential absolute value is the next defect candidate point. Then, it is determined that a defective portion exists. In the method according to the fourth aspect, a predetermined inspection area is scanned in an area corresponding to the inspection object in the edge image, and a pixel on a line in the edge image is detected as a defect candidate point. Among the pixels, a pixel having a differential direction value within a certain range including the differential direction value of the pixel having the maximum differential absolute value among the defect candidate points and the adjacent pixels is obtained, and this pixel is included in the edge image. If it is a pixel on the line, it is the next defect candidate point.If it is not a pixel on the line, the pixel with the largest differential absolute value is the next defect candidate point. When a peripheral area including a continuous defect candidate point is set, a defect candidate point whose derivative direction value differs from the continuous defect candidate point by 180 degrees is continuously detected in the peripheral area by a specified number or more. Sometimes defective parts It is to determine that the standing.

【作用】[Action]

請求項1の方法によれば、エッジ画像を微分方向値に
よって複数個の部分エッジ画像に分割し、1つの部分エ
ッジ画像内で線上の欠陥候補点として検出し、欠陥候補
点に隣接する画素のうちの線上の画素、または欠陥候補
点の微分方向値を含む一定範囲内の微分方向値を有しか
つ微分絶対値が最大となる画素を次の欠陥候補点とし、
いずれかの部分エッジ画像内で欠陥候補点が規定数以上
連続して検出されたときに欠陥部が存在すると判定する
ので、原画像のコントラストが小さいエッジ画像におい
て欠陥部の輪郭線などが不連続線になるような場合であ
っても線を延長する処理を施さずに微分方向値と微分絶
対値とを用いて線を追跡することができ、ひびのような
コントラストの小さい欠陥部でも精度よく検出すること
ができるのである。 請求項2の方法によれば、請求項1の方法に加えてい
ずれかの部分エッジ画像内で欠陥候補点が規定数以上連
続して検出されたときに、連続する欠陥候補点を含む周
辺領域を設定するとともに、その部分エッジ画像とは微
分方向値が180度異なる部分エッジ画像について周辺領
域内で欠陥候補点が規定数以上連続して検出されたとき
に欠陥部が存在すると判定するので、請求項1の判定を
2度繰り返すことになり、とくに、ひびのように欠陥部
の輪郭線が並行して形成されている場合には検出精度が
一層高くなるのである。 請求項3の方法によれば、エッジ画像内の線上の画素
を欠陥候補点として検出し、欠陥候補点に隣接する画素
のうちで、欠陥候補点および隣接する画素のうちの最大
の微分絶対値を有した画素の微分方向値を含む一定範囲
内の微分方向値を有する画素を求め、この画素がエッジ
画像内の線上の画素であれば次の欠陥候補点とし、線上
の画素でなければ微分絶対値が最大となる画素を次の欠
陥候補点とし、エッジ画像内で欠陥候補点が規定数以上
連続して検出されたときに欠陥部が存在すると判定する
ので、請求項1の方法と同様に、線を延長する処理を施
さずに線を追跡することができ、ひびのようなコントラ
ストの小さい欠陥部でも精度よく検出することができる
のである。また、請求項1の方法に比較して部分エッジ
画像を作成しないから、ハードウェアの規模が縮小化さ
れ、しかも、複数の部分エッジ画像内での走査が不要で
あるから高速な判定が期待できるものである。 請求項4の方法によれば、請求項3の方法に加えてエ
ッジ画像内で欠陥候補点が規定数以上連続して検出され
たときに、連続する欠陥候補点を含む周辺領域を設定す
るとともに、連続する欠陥候補点とは微分方向値が180
度異なる欠陥候補点が周辺領域内で規定数以上連続して
検出されたときに欠陥部が存在すると判定するようにし
ているので、請求項3の判定を2度繰り返すことにな
り、検出精度が一層高くなるのである。
According to the method of the first aspect, the edge image is divided into a plurality of partial edge images by a differential direction value, detected as a defect candidate point on a line in one partial edge image, and a pixel adjacent to the defect candidate point is detected. The pixel on the line, or the pixel having the differential direction value within a certain range including the differential direction value of the defect candidate point and the pixel whose differential absolute value is the maximum is the next defect candidate point,
When a defect candidate point is detected continuously in a certain number of partial edge images for a specified number or more, it is determined that a defective portion exists. Therefore, in an edge image having a small contrast of the original image, a contour line of the defective portion is discontinuous. Even if it becomes a line, the line can be traced using the differential direction value and the differential absolute value without performing the process of extending the line, and even a defect part with a small contrast such as a crack can be accurately detected. It can be detected. According to the method of the second aspect, in addition to the method of the first aspect, when a defect candidate point is continuously detected in any one of the partial edge images by a predetermined number or more, the peripheral area including the continuous defect candidate point With the partial edge image, the differential direction value is different from the partial edge image by 180 degrees, and it is determined that the defective portion exists when the defect candidate points are continuously detected in the peripheral area for the specified number or more in the peripheral area. The determination of claim 1 is repeated twice, and particularly when the contours of the defective portion are formed in parallel like a crack, the detection accuracy is further improved. According to the method of claim 3, a pixel on the line in the edge image is detected as a defect candidate point, and among the pixels adjacent to the defect candidate point, the maximum differential absolute value of the defect candidate point and the adjacent pixel. A pixel having a differential direction value within a certain range including the differential direction value of a pixel having a is determined.If this pixel is a pixel on a line in the edge image, it is determined as the next defect candidate point. The pixel having the maximum absolute value is taken as the next defect candidate point, and when the defect candidate points are continuously detected in the edge image for a specified number or more, it is determined that a defective portion is present. In addition, the line can be tracked without performing the process of extending the line, and a defect portion having a small contrast such as a crack can be detected with high accuracy. Further, compared to the method of claim 1, since a partial edge image is not created, the scale of hardware is reduced, and high-speed determination can be expected since scanning within a plurality of partial edge images is unnecessary. Things. According to the method of claim 4, in addition to the method of claim 3, when the defect candidate points are continuously detected in the edge image for a specified number or more, the peripheral area including the continuous defect candidate points is set. , The derivative direction value is 180
When the defect candidate points having different degrees are continuously detected in the peripheral area for a specified number or more, it is determined that the defective part exists. Therefore, the determination of claim 3 is repeated twice, and the detection accuracy is reduced. It will be even higher.

【実施例1】 第1図に示すように、検査対象物1の表面に光源2か
らの光が照射される。光源2は、点灯用電源3の出力に
よって点灯し、検査対象物1の表面に光軸が斜交するよ
うに配置される。検査対象物1の表面は、中心線が検査
対象物1の表面に対して略直交するように配置されたIT
Vカメラ等の画像入力装置4により撮像される。画像入
力装置4の出力は、アナログ−ディジタル変換部5にお
いてディジタル信号に変換され、各画素の濃度がディジ
タル値となった原画像が得られる。したがって、原画像
内では検査対象物1の表面に対する凹凸である欠陥部15
が濃度の相違による陰影として表現されるのである。 すなわち、原画像P0は濃淡画像であって、第2図
(a)に示すように、検査対象物1や欠陥部15に対応す
る像O,Xを含む画像となっている(以下では、画像内の
検査対象物1および欠陥部15の像O,Xを、検査対象物
O、欠陥部Xとして説明する。)原画像P0から検査対象
物Oや欠陥部Xの輪郭線等のエッジを抽出する処理は、
「エッジは濃度変化が大きい部分に対応している」とい
う考え方を基本にしている。したがって、まず原画像P0
を空間微分部6に入力し、原画像P0の各画素の濃度値に
対する空間微分を行う。空間微分を行うには、第3図
(a)に示すように、まず原画像P0の中に3×3画素よ
りなる局所並列ウインドウWを設定する。すなわち、第
3図(b)に示すように、局所並列ウインドウWの中心
の画素Eを注目する画素とし、画素Eに隣接する8画素
(以後、8近傍と呼称する)A〜D,F〜Iに基づいて局
所並列ウインドウWの中の画素A〜Iの濃度の縦方向の
濃度変化ΔVと横方向の濃度変化ΔHとを次式によって
求め、 ΔV=(A+B+C)−(G+H+I) ΔH=(A+D+G)−(C+F+I) さらに、微分絶対値abs(E)と微分方向値dir(E)
とを次式によって求める。 ただし、A〜Iは対応する画素の濃度を示している。
上式から明らかなように、微分絶対値abs(E)は、原
画像P0の着目する画素Eの近傍領域における濃度値の変
化率を表し、微分方向値dir(E)は、同近傍領域にお
ける濃度値の最大変化の方向に直交する方向、すなわ
ち、エッジに平行な方向を表している。局所並列ウイン
ドウWを第3図(a)に矢視するように左から右に移動
し、また上から下に移動させて、原画像P0値の全画素に
ついて上記演算を行なうことにより、検査対象物Oや欠
陥部Xの輪郭線を含む可能性のある濃度変化が大きい部
分と変化の方向とを抽出することができるのである。各
画素pの濃度を、微分絶対値abs(p)で表現した画像
を微分絶対値画像、微分方向値dir(p)で表現した画
像を微分方向値画像と呼ぶ。ここでは、微分絶対値画像
の濃度は64階調であり、微分方向値画像は16方向である
ものとする。微分絶対値画像および微分方向値画像は、
それぞれ微分絶対値画像フレームメモリ11、微分方向値
画像フレームメモり12に格納される。 一方、エッジ画像を得るために、微分絶対値画像を2
値化部7に入力し、適宜しきい値を用いて2値化して微
分絶対値の大きい部分を取り出す。さらに、微分絶対値
画像より得た2値画像を細線化部8に入力して1画素幅
を有した線画像に変える。 以上の処理により、第2図(b)に示すように、原画
像P0において濃度変化が大きい部分をなぞるような線
(以下、エッジと呼称する)エッジ画像P4が得られる。
ここに、原画像P0のコントラストが不十分であるときや
ノイズが多いようなときには、不連続なエッジが生成さ
れやすい。そこで、細線化部8で得られたエッジ画像P4
を、微分方向値とともに微分方向値2値化部9に入力
し、エッジ画像P4の中のエッジ上の各画素の微分方向値
に基づいてエッジ画像P4を16分類する。すなわち、微分
方向値は16方向で表現されるから、微分方向値が一定範
囲内の画素同士をまとめた16個の部分エッジ画像を生成
して、各部分エッジ画像をそれぞれ部分エッジ画像フレ
ームメモリ131〜1316に格納するのである。 以上の処理によって、微分絶対値画像、微分方向コー
ド画像、部分エッジ画像が、それぞれ微分絶対値画像フ
レームメモリ11、微分方向値画像フレームメモリ12、部
分エッジ画像フレームメモリ131〜1316に格納され、各
フレームメモリ11,12,131〜1316に格納された画像に基
づいて、欠陥部の存否が判定処理部10において判定され
る。 部分エッジ画像を求めるまでの処理と、判定処理部10
における処理とをまとめて第4図に示す。判定処理部10
では、部分エッジ画像において検査対象物Oの中であら
かじめ設定された検査領域内の各画素を順に走査し、エ
ッジを検出する。たとえば、部分エッジ画像の中でエッ
ジが“1"、他の部分が“0"で表現されているとすれば、
走査によって“1"である画素の有無を検出するのであ
る。エッジが検出されると、その点を欠陥候補点とし、
判定処理部10に内蔵された個数カウンタを1にセットす
る(j=1)。次に、欠陥候補点の8近傍の画素がエッ
ジかどうかを判定する。この判定によって、以下のよう
に場合分けされる。 エッジが存在する場合 エッジとして検出された画素を次の欠陥候補点とし、
個数カウンタの値を1だけ増加させる。 エッジが存在しない場合 a.8近傍に今探索している部分エッジ画像の持つ微分方
向値と同じ微分方向値を持つ画素が存在するならば、そ
のうよな画素のうち微分絶対値が最大になる画素を次の
欠陥候補点とし、個数カウンタの値を1だけ増加させ
る。 b.8近傍に今探索している部分エッジ画像の持つ微分方
向値と同じ微分方向値を持つ画素が存在しないならば、
検査領域内の画素の走査を続ける。次のエッジを検出す
ると個数カウンタを1にセットする。 以上のような処理によって個数カウンタの値が規定数
以上になれば、検査領域内に欠陥部が存在すると判定す
るのである。一方、1つの部分エッジ画像について、個
数カウンタの値が規定数以上になることがない場合に
は、次の部分エッジ画像についても同様の処理を行い、
すべてのエッジ画像について個数カウンタの値が規定数
以上になることがなかった場合には、検査領域内には欠
陥部が存在しないと判定するのである。 すなわち、ひびのような欠陥部では、微分方向値が一
定範囲内の微分方向値を持つ画素が連続すると考えられ
るから、エッジが不連続になっている部分でも8近傍に
微分方向値が一定範囲内の画素が存在すれば、エッジの
一部であるとみなし、1つの部分エッジ画像内でエッジ
とみなせる画素数が規定数以上連続して存在していれ
ば、欠陥があると判定するのである。その結果、従来は
コントラストの小さい部分での欠陥部の検出が困難であ
ったのに対して、本実施例ではコントラストが小さい部
分でも微分方向値によって欠陥部を検出することがで
き、従来よりも検出精度が高まるのである。
Embodiment 1 As shown in FIG. 1, light from a light source 2 is applied to the surface of an inspection object 1. The light source 2 is turned on by the output of the lighting power supply 3, and is arranged so that the optical axis is oblique to the surface of the inspection object 1. The surface of the inspection object 1 is an IT in which the center line is arranged so that the center line is substantially perpendicular to the surface of the inspection object 1.
An image is captured by an image input device 4 such as a V camera. The output of the image input device 4 is converted into a digital signal by the analog-digital converter 5 to obtain an original image in which the density of each pixel becomes a digital value. Therefore, in the original image, the defect 15 which is unevenness relative to the surface of the inspection object 1
Is represented as a shadow due to the difference in density. That is, the original image P 0 is a grayscale image, as shown in FIG. 2 (a), image O corresponding to the inspection object 1 and the defect portion 15, which is an image including the X (hereinafter, image O of the inspection object 1 and the defect 15 in the image, the X, test object O, is described as a defect section X.) test object from the original image P 0 O or defect edge of the contour line or the like of the X The process of extracting
It is based on the idea that "the edge corresponds to a portion where the density change is large". Therefore, first, the original image P 0
The input to the spatial differential unit 6 performs spatial derivative with respect to the density value of each pixel of the original image P 0. To perform spatial differentiation, as shown in FIG. 3 (a), first, set the local parallel window W formed of 3 × 3 pixels in the original image P 0. That is, as shown in FIG. 3 (b), a pixel E at the center of the local parallel window W is set as a pixel of interest, and eight pixels (hereinafter referred to as eight neighbors) A to D, F to A vertical density change ΔV and a horizontal density change ΔH of the density of the pixels A to I in the local parallel window W are obtained by the following equation based on I, and ΔV = (A + B + C) − (G + H + I) ΔH = ( A + D + G)-(C + F + I) Further, the differential absolute value abs (E) and the differential direction value dir (E)
Are obtained by the following equation. Here, A to I indicate the density of the corresponding pixel.
As is apparent from the above equation, the differential absolute value abs (E) represents the rate of change of the density value in the area near the pixel E of interest in the original image P 0 , and the differential direction value dir (E) is Represents a direction orthogonal to the direction of the maximum change of the density value in the above, that is, a direction parallel to the edge. Moving from left to coconut local parallel window W in FIG. 3 (a) to the right, also move from top to bottom, by performing the calculation for all pixels of the original image P 0 values, test It is possible to extract a portion having a large density change that may include the outline of the object O or the defective portion X and the direction of the change. An image in which the density of each pixel p is expressed by a differential absolute value abs (p) is called a differential absolute value image, and an image that is expressed by a differential direction value dir (p) is called a differential direction value image. Here, it is assumed that the density of the differential absolute value image is 64 gradations and the differential direction value image is in 16 directions. The differential absolute value image and differential direction value image are
These are stored in a differential absolute value image frame memory 11 and a differential direction value image frame memory 12, respectively. On the other hand, to obtain an edge image,
It is input to the value conversion unit 7 and binarized using a threshold value as appropriate to extract a portion having a large differential absolute value. Further, the binary image obtained from the differential absolute value image is input to the thinning unit 8 to be changed to a line image having one pixel width. With the above processing, as shown in FIG. 2 (b), the line that traces the portions density change is large in the original image P 0 (hereinafter, referred to as edge) edge image P 4 is obtained.
Here, when the contrast of the original image P 0 is or when such noise is often insufficient, discontinuous edge is generated easily. Therefore, the edge image P 4 obtained by the thinning unit 8
And with the differential direction value input to the differential direction value binarization section 9, the edge image P 4 to 16 classified based on the differential direction value of each pixel on the edge in the edge image P 4. That is, since the differential direction value is expressed in 16 directions, 16 partial edge images in which the pixels in which the differential direction value is within a certain range are generated, and each partial edge image is respectively stored in the partial edge image frame memory 13 than it is stored in 1-13 16. Through the above processing, the absolute value image differentiation, the differential direction code image, partial edge image, respectively stored differentiation absolute value image frame memory 11, the differential direction value image frame memory 12, partial edge image frame memory 131-134 16 , based on the image stored in the frame memories 11, 12 and 13 1 to 13 16, presence of the defect portion it is determined in the determination processing section 10. Processing up to obtaining a partial edge image and a judgment processing unit 10
4 are collectively shown in FIG. Judgment processing unit 10
Then, in the partial edge image, each pixel in the inspection area set in advance in the inspection object O is sequentially scanned to detect an edge. For example, if the edge is expressed as “1” and the other parts are expressed as “0” in the partial edge image,
The presence or absence of a pixel that is "1" is detected by scanning. When an edge is detected, that point is set as a defect candidate point,
The number counter incorporated in the judgment processing unit 10 is set to 1 (j = 1). Next, it is determined whether or not pixels near the defect candidate point 8 are edges. According to this determination, the cases are classified as follows. When an edge exists The pixel detected as an edge is set as the next defect candidate point,
The value of the number counter is increased by one. If there is no edge a.If there is a pixel near the partial edge image currently searched for that has the same differential direction value as that of the partial edge image that is currently being searched for, the differential absolute value of such a pixel is maximized. Is set as the next defect candidate point, and the value of the number counter is increased by one. b.If there is no pixel near the 8 with the same differential direction value as the partial edge image currently searched for,
Continue scanning the pixels in the inspection area. When the next edge is detected, the number counter is set to 1. If the value of the number counter becomes equal to or more than the specified number by the above processing, it is determined that a defective portion exists in the inspection area. On the other hand, if the value of the number counter does not exceed the specified number for one partial edge image, the same processing is performed for the next partial edge image.
If the value of the number counter does not exceed the specified number for all edge images, it is determined that no defect exists in the inspection area. In other words, in a defective portion such as a crack, it is considered that pixels having a differential direction value within a certain range are continuous. Therefore, even in a portion where the edge is discontinuous, the differential direction value has a certain range near 8 If there is a pixel within, it is regarded as a part of the edge, and if the number of pixels that can be regarded as an edge in one partial edge image exists continuously for a specified number or more, it is determined that there is a defect. . As a result, while it has been difficult to detect a defective portion in a portion having a small contrast in the related art, a defective portion can be detected by a differential direction value even in a portion having a small contrast in the present embodiment. This increases the detection accuracy.

【実施例2】 本実施例は、実施例1における欠陥部の判定条件にさ
らに制限を加えるようにしたものであって、原画像では
第2図(a)のような欠陥部Xが、エッジ画像では第2
図(b)のような2本のエッジe1,e2になり、かつ両エ
ッジe1,e2における平行部分の微分方向値が互いに180
度異なることを利用しているのである。 すなわち、第5図に示すように、実施例1と同様にし
て1つの部分エッジ画像について、エッジとみなせる画
素が規定数以上連続して存在しているかどうかを判定す
る。ただし、エッジとみなせる画素を検出するたびに、
その画素の位置(画面上の座標をXY座標で表現するとす
れば、(xn,yn)となる)を記憶する。 次に、エッジとみなせる画素が規定数以上連続してい
た部分エッジ画像について記憶した画素を含む周辺領域
を設定し、微分方向値が180度異なる部分エッジ画像に
ついて、上記周辺領域内での走査を行いエッジの存否を
検出する。エッジが検出されれば、実施例1と同様にし
てエッジとみなせる画素が規定数以上連続して存在して
いるかどうかを調べ、この条件を満たせば欠陥部が存在
すると判定する。一方、この部分エッジ画像について、
エッジとみなせる画素が規定数未満であれば、元の部分
エッジ画像に戻り、検査領域内での走査を続ける。 以上の処理をすべての部分エッジ画像について行い、
いずれについても欠陥部の存在が認められない場合に
は、欠陥部が存在しないものとみなすのである。
Embodiment 2 In this embodiment, the conditions for judging a defective portion in Embodiment 1 are further restricted. In the original image, a defective portion X as shown in FIG. Second in the image
The two edges e 1 and e 2 as shown in FIG. 9B are obtained, and the differential direction values of the parallel portions at both edges e 1 and e 2 are mutually 180 degrees.
They use different things. That is, as shown in FIG. 5, it is determined whether the number of pixels that can be regarded as an edge is present continuously for a specified number of edges in one partial edge image in the same manner as in the first embodiment. However, every time a pixel that can be regarded as an edge is detected,
The position of the pixel (if the coordinates on the screen are represented by XY coordinates, it is (x n , y n )) is stored. Next, a peripheral region including pixels stored for a partial edge image in which pixels that can be regarded as edges are continuous for a specified number or more is set, and scanning in the peripheral region is performed for a partial edge image whose differential direction value differs by 180 degrees. The presence or absence of an edge is detected. If an edge is detected, it is checked whether a predetermined number or more of pixels that can be regarded as an edge are present continuously as in the first embodiment, and if this condition is satisfied, it is determined that a defective portion exists. On the other hand, regarding this partial edge image,
If the number of pixels that can be regarded as edges is less than the specified number, the process returns to the original partial edge image and scanning in the inspection area is continued. Perform the above processing for all partial edge images,
If no defective portion is found in any of the cases, it is determined that no defective portion exists.

【実施例3】 本実施例では、第6図に示すように、細線化部8の出
力として得られたエッジ画像をエッジ画像フレームメモ
リ14に格納し、微分絶対値画像フレームメモリ11、微分
方向値画像フレームメモリ12、エッジ画像フレームメモ
リ14の内容に基づいて判定処理部10での処理を行うよう
にしている。 検査対象物Oに対して検査領域があらかじめ設定して
あり、エッジ画像に対して検査領域内での走査を行うこ
とによりエッジを検出する。第7図に示すように、エッ
ジを検出するとその点を欠陥候補点とし、8近傍を含め
た9画素のうちで微分絶対値が最大になる画素の微分方
向値を求める。また、個数カウンタを1にセットする。
次に、欠陥候補点の8近傍について、以下のような処理
を行う。 求めた微分方向値を含む一定範囲内の微分方向値を有
した画素が検出された場合 a.検出された画素のうちエッジである画素があれば、エ
ッジである画素を次の欠陥候補点として個数カウンタの
値を1だけ増加させる。 b.検出された画素のうちにエッジである画素がなけれ
ば、検出された画素のうちで微分絶対値が最大である画
素を次の欠陥候補点として個数カウンタの値を1だけ増
加させる。 求めた微分方向値を含む一定範囲内の微分方向値を有
する画素が検出されない場合 検査領域内での走査を継続する。 以上のような処理によって個数カウンタの値が規定数
以上になれば、検査領域内に欠陥歩が存在すると判定す
る。また、検査領域内を走査が終了しても個数カウンタ
の値が規定数未満であれば、欠陥部は存在しないと判定
する。要するに、同じ微分方向値を有する画素が規定数
以上連続して存在している場合に、欠陥部が存在してい
ると判定するのである。
Third Embodiment In this embodiment, as shown in FIG. 6, an edge image obtained as an output of the thinning unit 8 is stored in an edge image frame memory 14, and a differential absolute value image frame memory 11, a differential direction The processing in the determination processing unit 10 is performed based on the contents of the value image frame memory 12 and the edge image frame memory 14. An inspection area is set in advance for the inspection object O, and an edge is detected by scanning the edge image in the inspection area. As shown in FIG. 7, when an edge is detected, the point is set as a defect candidate point, and a differential direction value of a pixel having a maximum differential absolute value among nine pixels including eight neighbors is obtained. Further, the number counter is set to 1.
Next, the following processing is performed on the eight neighborhoods of the defect candidate point. When a pixel having a differential direction value within a certain range including the calculated differential direction value is detected a.If there is a pixel that is an edge among the detected pixels, the pixel that is an edge is set as the next defect candidate point. The value of the number counter is increased by one. b. If there is no edge pixel among the detected pixels, the value of the number counter is increased by 1 with the pixel having the largest differential absolute value among the detected pixels as the next defect candidate point. When a pixel having a differential direction value within a certain range including the obtained differential direction value is not detected, scanning in the inspection area is continued. If the value of the number counter becomes equal to or more than the specified number by the above processing, it is determined that a defective step exists in the inspection area. Further, if the value of the number counter is less than the specified number even after the scanning in the inspection area is completed, it is determined that there is no defective portion. In short, when pixels having the same differential direction value exist continuously for a specified number or more, it is determined that a defective portion exists.

【実施例4】 本実施例では、実施例3における欠陥部の判定条件に
さらに制限を加えるようにしたものであって、実施例2
と同様に、エッジ画像において隣接して並行する2本の
エッジe1,e2における平行部分の微分方向値が互いに18
0度異なることを利用している。 すなわち、第8図に示すように、実施例3と同様にし
てエッジ画像について欠陥候補点となる画素が規定数以
上連続して存在しているかどうかを判定する。ただし、
欠陥候補点となる画素を検出するたびに、その画素の位
置(画面上の座標をXY座標で表現するとすれば、(xn
yn)となる)を記憶する。欠陥候補点となる画素が規定
数未満であるときには、それまでに記憶した画素の位置
を消去して、次のエッジが検出されるまで走査を続け
る。 欠陥候補点となる画素が規定数以上連続している部分
が検出されると、その部分について記憶している画素の
位置を含むように周辺領域を設定し、周辺領域内を走査
して微分方向値が180度異なるエッジの存否を検出す
る。エッジが検出されれば、実施例3と同様にして欠陥
候補点となる画素が規定数以上連続して存在しいるかど
うを調べ、この条件を満たせば欠陥部が存在すると判定
する。一方、欠陥候補点となる画素が規定数未満であれ
ば、検査領域内での走査を続ける。検査領域内の終端に
達しても欠陥部の存在が認められないときには、欠陥部
が存在しないものとみなすのである。
Fourth Embodiment In a fourth embodiment, the conditions for determining a defective portion in the third embodiment are further restricted.
Similarly, in the edge image, the differential direction values of the parallel portions of two adjacent parallel edges e 1 and e 2 are 18
It uses the difference of 0 degrees. That is, as shown in FIG. 8, similarly to the third embodiment, it is determined whether or not pixels serving as defect candidate points in the edge image continuously exist for a prescribed number or more. However,
Each time a pixel serving as a defect candidate point is detected, the position of that pixel (if coordinates on the screen are represented by XY coordinates, (x n ,
y n ) is stored. If the number of pixels serving as defect candidate points is less than the specified number, the positions of the pixels stored so far are erased, and scanning is continued until the next edge is detected. When a portion where a pixel serving as a defect candidate point is continuous for a specified number or more is detected, a peripheral region is set so as to include the position of the pixel stored in the portion, and the peripheral region is scanned and differentiated. Detects the presence or absence of an edge whose value differs by 180 degrees. If an edge is detected, it is checked whether or not a predetermined number of pixels as defect candidate points are present continuously as in the third embodiment. If this condition is satisfied, it is determined that a defective portion exists. On the other hand, if the number of pixels serving as defect candidate points is less than the specified number, scanning within the inspection area is continued. If the presence of a defective portion is not recognized even after reaching the end of the inspection area, it is determined that no defective portion exists.

【発明の効果】【The invention's effect】

上述したように、請求項1の方法によれば、エッジ画
像を微分方向値によって複数個の部分エッジ画像に分割
し、1つの部分エッジ画像内で線上の点を欠陥候補点と
して検出し、欠陥候補点に隣接する画素のうちの線上の
画素、または欠陥候補点の微分方向値を含む一定範囲内
の微分方向値を有しかつ微分絶対値が最大となる画素を
次の欠陥候補点とし、いずれかの部分エッジ画像内での
欠陥候補点が規定数以上連続して検出されたときに欠陥
部が存在すると判定するので、原画像のコントラストが
小さくエッジ画像において欠陥部の輪郭線などの不連続
線になるような場合であっても微分方向値と微分絶対値
とを用いて線を追跡することができ、ひびのようなコン
トラストの小さい欠陥部でも精度よく検出することがで
きるという利点がある。 請求項2の方法によれば、請求項1の方法に加えてい
ずれかの部分エッジ画像内で欠陥候補点が規定数以上連
続して検出されたときに、連続する欠陥候補点を含む周
辺領域を設定するとともに、その部分エッジ画像とは微
分方向値が180度異なる部分エッジ画像について周辺領
域内で欠陥候補点が規定数以上連続して検出されたとき
に欠陥部が存在すると判定するので、請求項1の判定を
2度繰り返すことになり、とくに、ひびのように欠陥部
の輪郭線が並行して形成されている場合には検出精度が
一層高くなるという効果を奏するのである。 請求項3の方法によれば、エッジ画像内の線上の画素
を欠陥候補点として検出し、欠陥候補点に隣接する画素
のうちで、欠陥候補点および隣接する画素のうちの最大
の微分絶対値を有した画素の微分方向値を含む一定範囲
内の微分方向値を有する画素を求め、この画素がエッジ
画像内の線上の画素であれば次の欠陥候補点とし、線上
の画素でなければ微分絶対値が最大となる画素を次の欠
陥候補点とし、エッジ画像内で欠陥候補点が規定数以上
連続して検出されたときに欠陥部が存在すると判定する
ので、請求項1の方法と同様に、線を追跡することがで
き、ひびのようなコントラストの小さい欠陥部でも精度
よく検出することができるのである。また、請求項1の
方法に比較して部分エッジ画像を作成しないから、ハー
ドウェアの規模が縮小化され、しかも、複数の部分エッ
ジを走査する必要がないから高速な判定が期待できると
いう利点がある。 請求項4の方法によれば、請求項3の方法に加えてエ
ッジ画像内で欠陥候補点が規定数以上連続して検出され
たときに、連続する欠陥候補点を含む周辺領域を設定す
るとともに、連続する欠陥候補点とは微分方向値が180
度異なる欠陥候補点が周辺領域内で規定数以上連続して
検出されたときに欠陥部が存在すると判定するようにし
ているので、請求項3の判定を2度繰り返すことにな
り、検出精度が一層高くなるという効果がある。
As described above, according to the method of the first aspect, the edge image is divided into a plurality of partial edge images according to the differential direction value, and a point on a line in one partial edge image is detected as a defect candidate point. Pixels having a differential direction value within a certain range including the differential direction value of the defect candidate point, and pixels having the maximum differential absolute value as the next defect candidate point, When the defect candidate points in any of the partial edge images are detected continuously for a specified number or more, it is determined that a defective portion exists. Therefore, the contrast of the original image is small, and the edge image has a defect such as a contour line of the defective portion. Even in the case of a continuous line, the line can be traced using the differential direction value and the differential absolute value, and the advantage that a defect portion with a small contrast such as a crack can be accurately detected. Ah . According to the method of the second aspect, in addition to the method of the first aspect, when a defect candidate point is continuously detected in any one of the partial edge images by a predetermined number or more, the peripheral area including the continuous defect candidate point With the partial edge image, the differential direction value is different from the partial edge image by 180 degrees, and it is determined that the defective portion exists when the defect candidate points are continuously detected in the peripheral area for the specified number or more in the peripheral area. The determination of claim 1 is repeated twice, and particularly when the contours of the defective portion are formed in parallel like a crack, the effect that the detection accuracy is further improved is exerted. According to the method of claim 3, a pixel on the line in the edge image is detected as a defect candidate point, and among the pixels adjacent to the defect candidate point, the maximum differential absolute value of the defect candidate point and the adjacent pixel. A pixel having a differential direction value within a certain range including the differential direction value of a pixel having a is determined.If this pixel is a pixel on a line in the edge image, it is determined as the next defect candidate point. The pixel having the maximum absolute value is taken as the next defect candidate point, and when the defect candidate points are continuously detected in the edge image for a specified number or more, it is determined that a defective portion is present. In addition, the line can be traced, and a defect portion having a small contrast such as a crack can be detected with high accuracy. Further, compared with the method of the first aspect, since a partial edge image is not created, the scale of hardware is reduced, and furthermore, since it is not necessary to scan a plurality of partial edges, high-speed determination can be expected. is there. According to the method of claim 4, in addition to the method of claim 3, when the defect candidate points are continuously detected in the edge image for a specified number or more, the peripheral area including the continuous defect candidate points is set. , The derivative direction value is 180
When the defect candidate points having different degrees are continuously detected in the peripheral area for a specified number or more, it is determined that the defective part exists. Therefore, the determination of claim 3 is repeated twice, and the detection accuracy is reduced. This has the effect of being even higher.

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

第1図は本発明の実施例1および実施例2の方法に対応
する構成のブロック図、第2図(a)(b)はそれぞれ
同上における原画像、原画像に対応するエッジ画像の一
例を示す説明図、第3図(a)(b)は同上における局
所並列ウインドウを示す説明図、第4図は実施例1の動
作説明図、第5図は本発明の実施例2の動作説明図、第
6図は本発明の実施例3および実施例4の方法に対応す
る構成のブロック図、第7図は同上の実施例3の動作説
明図、第8図は本発明の実施例4を示す動作説明図であ
る。 1…検査対象物、2…光源、3…点灯用電源、4…画像
入力装置、5…アナログ−ディジタル変換部、6…空間
微分部、7…2値化部、8…細線化部、9…微分方向値
2値化部、10…判定処理部、11…微分絶対値画像フレー
ムメモリ、12…微分方向値画像フレームメモリ、131〜1
316…部分エッジ画像フレームメモリ。
FIG. 1 is a block diagram of a configuration corresponding to the methods of the first and second embodiments of the present invention, and FIGS. 2 (a) and 2 (b) are examples of an original image and an edge image corresponding to the original image, respectively. FIGS. 3 (a) and 3 (b) are explanatory diagrams showing a local parallel window in the above, FIG. 4 is an explanatory diagram of the operation of the first embodiment, and FIG. 5 is an explanatory diagram of the operation of the second embodiment of the present invention. FIG. 6 is a block diagram of a configuration corresponding to the method of the third and fourth embodiments of the present invention, FIG. 7 is an explanatory diagram of the operation of the third embodiment, and FIG. FIG. DESCRIPTION OF SYMBOLS 1 ... Inspection object, 2 ... Light source, 3 ... Power supply for lighting, 4 ... Image input device, 5 ... Analog-digital conversion part, 6 ... Spatial differentiation part, 7 ... Binarization part, 8 ... Thinning part, 9 ... Differential direction value binarization unit, 10 ... Judgment processing unit, 11 ... Differential absolute value image frame memory, 12 ... Differential direction value image frame memory, 13 1 to 1
3 16 … Partial edge image frame memory.

フロントページの続き (56)参考文献 特開 平2−134548(JP,A) 特開 平2−133885(JP,A) 特開 昭61−120002(JP,A) 特開 平2−242382(JP,A) 特開 昭61−126455(JP,A) 特開 平2−187651(JP,A) 特開 昭61−126437(JP,A) 特開 平1−253639(JP,A)Continuation of front page (56) References JP-A-2-134548 (JP, A) JP-A-2-133885 (JP, A) JP-A-61-120002 (JP, A) JP-A-2-242382 (JP) JP-A-61-126455 (JP, A) JP-A-2-186765 (JP, A) JP-A-61-126437 (JP, A) JP-A 1-253639 (JP, A)

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】検査対象物を含む空間領域を撮像して作成
された濃淡画像である原画像に基づいて、各画素の近傍
領域内の濃度値の変化率を表す微分絶対値を各画素に対
応させた微分絶対値画像と、各画素の近傍領域内の濃度
値の最大変化の方向を複数値で表した微分方向値を各画
素に対応させた微分方向値画像とを作成し、さらに微分
絶対値画像における所定値以上の画素を1画素幅に細線
化してエッジ画像を作成し、エッジ画像内の線上の画素
を微分方向値が一定範囲内の微分方向値ごとに分類して
複数個の部分エッジ画像を作成し、1つの部分エッジ画
像内について検査対象物に対応する領域内であらかじめ
設定した検査領域を走査して部分エッジ画像内の線上の
画素を欠陥候補点として検出し、欠陥候補点に隣接する
画素のうちに部分エッジ画像内の線上の画素があれば次
の欠陥候補点とし、線上の画素がなければ欠陥候補点の
微分方向値を含む一定範囲内の微分方向値を有する画素
のうちで微分絶対値が最大となる画素を次の欠陥候補点
とし、いずれかの部分エッジ画像内で欠陥候補点が規定
数以上連続して検出されたときに欠陥部が存在すると判
定することを特徴とする外観検査による欠陥検出方法。
1. A differential absolute value indicating a rate of change of a density value in a region near each pixel based on an original image which is a grayscale image created by imaging a spatial region including an inspection object. A differential absolute value image corresponding to each of the pixels and a differential direction value image corresponding to each pixel corresponding to a differential direction value in which the direction of the maximum change of the density value in the vicinity of each pixel is represented by a plurality of values are created. An edge image is created by thinning pixels having a predetermined value or more in the absolute value image to a width of one pixel, and pixels on a line in the edge image are classified for each differential direction value in which the differential direction value is within a certain range. A partial edge image is created, a predetermined inspection area is scanned in an area corresponding to the inspection object in one partial edge image, and a pixel on a line in the partial edge image is detected as a defect candidate point. Part of the pixel adjacent to the point If there is a pixel on the line in the edge image, the next defect candidate point is determined.If there is no pixel on the line, the differential absolute value of the pixels having a differential direction value within a certain range including the differential direction value of the defect candidate point is determined. The pixel having the maximum value is determined as the next defect candidate point, and when a defect candidate point is continuously detected in a partial edge image for a specified number or more, it is determined that a defective portion exists. Defect detection method.
【請求項2】検査対象物を含む空間領域を撮像して作成
された濃淡画像である原画像に基づいて、各画素の近傍
領域内の濃度値の変化率を表す微分絶対値を各画素に対
応させた微分絶対値画像と、各画素の近傍領域内の濃度
値の最大変化の方向を複数値で表した微分方向値を各画
素に対応させた微分方向値画像とを作成し、さらに微分
絶対値画像における所定値以上の画素を1画素幅に細線
化してエッジ画像を作成し、エッジ画像内の線上の画素
を微分方向値が一定範囲内の微分方向値ごとに分類して
複数個の部分エッジ画像を作成し、1つの部分エッジ画
像内について検査対象物に対応する領域内であらかじめ
設定した検査領域を走査して部分エッジ画像内の線上の
画素を欠陥候補点として検出し、欠陥候補点に隣接する
画素のうちに部分エッジ画像内の線上の画素があれば次
の欠陥候補点とし、線上の画素がなければ欠陥候補点の
微分方向値を含む一定範囲内の微分方向値を有する画素
のうちで微分絶対値が最大となる画素を次の欠陥候補点
とし、いずれかの部分エッジ画像内で欠陥候補点が規定
数以上連続して検出されたときに、連続する欠陥候補点
を含む周辺領域を設定するとともに、その部分エッジ画
像とは微分方向値が180度異なる部分エッジ画像につい
て周辺領域内で欠陥候補点が規定数以上連続して検出さ
れたときに欠陥部が存在すると判定することを特徴とす
る外観検査による欠陥検出方法。
2. A differential absolute value representing a rate of change of a density value in an area near each pixel is assigned to each pixel based on an original image which is a grayscale image created by imaging a spatial area including an inspection object. A differential absolute value image corresponding to each of the pixels and a differential direction value image corresponding to each pixel corresponding to a differential direction value in which the direction of the maximum change of the density value in the vicinity of each pixel is represented by a plurality of values are created. An edge image is created by thinning pixels having a predetermined value or more in the absolute value image to a width of one pixel, and pixels on a line in the edge image are classified for each differential direction value in which the differential direction value is within a certain range. A partial edge image is created, a predetermined inspection area is scanned in an area corresponding to the inspection object in one partial edge image, and a pixel on a line in the partial edge image is detected as a defect candidate point. Part of the pixel adjacent to the point If there is a pixel on the line in the edge image, the next defect candidate point is determined.If there is no pixel on the line, the differential absolute value of the pixels having a differential direction value within a certain range including the differential direction value of the defect candidate point is determined. The largest pixel is set as the next defect candidate point, and when a defect candidate point is continuously detected in any one of the partial edge images for a specified number or more, a peripheral area including the continuous defect candidate point is set, A visual inspection characterized by determining that a defective portion is present when a defect candidate point is continuously detected in a peripheral area for a specified number or more in a peripheral area for a partial edge image having a derivative direction value different from the partial edge image by 180 degrees. Defect detection method.
【請求項3】検査対象物を含む空間領域を撮像して作成
された濃淡画像である原画像に基づいて、各画素の近傍
領域内の濃度値の変化率を表す微分絶対値を各画素に対
応させた微分絶対値画像と、各画素の近傍領域内の濃度
値の最大変化の方向を複数値で表した微分方向値を各画
素に対応させた微分方向値画像とを作成し、さらに微分
絶対値画像における所定値以上の画素を1画素幅に細線
化してエッジ画像を作成し、エッジ画像内について検査
対象物に対応する領域内であらかじめ設定した検査領域
を走査してエッジ画像内の線上の画素を欠陥候補点とし
て検出し、欠陥候補点に隣接する画素のうちで、欠陥候
補点および隣接する画素のうちの最大の微分絶対値を有
した画素の微分方向値を含む一定範囲内の微分方向値を
有する画素を求め、この画素がエッジ画像内の線上の画
素であれば次の欠陥候補点とし、線上の画素でなければ
微分絶対値が最大となる画素を次の欠陥候補点とし、エ
ッジ画像内で欠陥候補点が規定数以上連続して検出され
たときに欠陥部が存在すると判定することを特徴とする
外観検査による欠陥検出方法。
3. A differential absolute value indicating a rate of change of a density value in a region near each pixel is assigned to each pixel based on an original image which is a grayscale image created by imaging a spatial region including an inspection object. A differential absolute value image corresponding to each of the pixels and a differential direction value image corresponding to each pixel corresponding to a differential direction value in which the direction of the maximum change of the density value in the vicinity of each pixel is represented by a plurality of values are created. An edge image is created by thinning pixels having a predetermined value or more in the absolute value image to a width of one pixel, and a predetermined inspection area is scanned within a region corresponding to the inspection object in the edge image, and a line on the edge image is scanned. Is detected as a defect candidate point, and among pixels adjacent to the defect candidate point, a value within a certain range including the differential direction value of the pixel having the maximum differential absolute value among the defect candidate point and the adjacent pixel Find pixel with differential direction value If this pixel is a pixel on the line in the edge image, it is determined as the next defect candidate point. If not, the pixel having the maximum differential absolute value is determined as the next defect candidate point. A defect detection method by visual inspection, wherein it is determined that a defective portion exists when a predetermined number or more are detected continuously.
【請求項4】検査対象物を含む空間領域を撮像して作成
された濃淡画像である原画像に基づいて、各画素の近傍
領域内の濃度値の変化率を表す微分絶対値を各画素に対
応させた微分絶対値画像と、各画素の近傍領域内の濃度
値の最大変化の方向を複数値で表した微分方向値を各画
素に対応させた微分方向値画像とを作成し、さらに微分
絶対値画像における所定値以上の画素を1画素幅に細線
化してエッジ画像を作成し、エッジ画像内について検査
対象物に対応する領域内であらかじめ設定した検査領域
を走査してエッジ画像内の線上の画素を欠陥候補点とし
て検出し、欠陥候補点に隣接する画素のうちで、欠陥候
補点および隣接する画素のうちの最大の微分絶対値を有
した画素の微分方向値を含む一定範囲内の微分方向値を
有する画素を求め、この画素がエッジ画像内の線上の画
素であれば次の欠陥候補点とし、線上の画素でなければ
微分絶対値が最大となる画素を次の欠陥候補点とし、エ
ッジ画像内で欠陥候補点が規定数以上連続して検出され
たときに、連続する欠陥候補点を含む周辺領域を設定す
るとともに、連続する欠陥候補点とは微分方向値が180
度異なる欠陥候補点が周辺領域内で規定数以上連続して
検出されたときに欠陥部が存在すると判定することを特
徴とする外観検査による欠陥検出方法。
4. A differential absolute value representing a rate of change of a density value in an area near each pixel is assigned to each pixel based on an original image which is a grayscale image created by imaging a spatial area including an inspection object. A differential absolute value image corresponding to each of the pixels and a differential direction value image corresponding to each pixel corresponding to a differential direction value in which the direction of the maximum change of the density value in the vicinity of each pixel is represented by a plurality of values are created. An edge image is created by thinning pixels having a predetermined value or more in the absolute value image to a width of one pixel, and a predetermined inspection area is scanned within a region corresponding to the inspection object in the edge image, and a line on the edge image is scanned. Is detected as a defect candidate point, and among pixels adjacent to the defect candidate point, a value within a certain range including the differential direction value of the pixel having the maximum differential absolute value among the defect candidate point and the adjacent pixel Find pixel with differential direction value If this pixel is a pixel on the line in the edge image, it is determined as the next defect candidate point. If not, the pixel having the maximum differential absolute value is determined as the next defect candidate point. When a predetermined number or more are continuously detected, a peripheral area including continuous defect candidate points is set, and the differential direction value is 180
A defect detection method based on visual inspection, wherein a defect portion is determined to be present when defect candidate points having different degrees are continuously detected in a peripheral area for a prescribed number or more.
JP13771290A 1990-05-28 1990-05-28 Defect detection method by visual inspection Expired - Lifetime JP2710685B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13771290A JP2710685B2 (en) 1990-05-28 1990-05-28 Defect detection method by visual inspection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13771290A JP2710685B2 (en) 1990-05-28 1990-05-28 Defect detection method by visual inspection

Publications (2)

Publication Number Publication Date
JPH0431751A JPH0431751A (en) 1992-02-03
JP2710685B2 true JP2710685B2 (en) 1998-02-10

Family

ID=15205063

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13771290A Expired - Lifetime JP2710685B2 (en) 1990-05-28 1990-05-28 Defect detection method by visual inspection

Country Status (1)

Country Link
JP (1) JP2710685B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06118026A (en) * 1992-10-01 1994-04-28 Toyo Seikan Kaisha Ltd Method for inspecting vessel inner surface
US10983198B2 (en) * 2015-06-24 2021-04-20 Konica Minolta, Inc. Objective sensor, objective sensor dirt determination method, and object detection device
CN112198685B (en) * 2020-10-30 2023-10-03 成都京东方显示科技有限公司 COA substrate detection method and device

Also Published As

Publication number Publication date
JPH0431751A (en) 1992-02-03

Similar Documents

Publication Publication Date Title
CN111179243A (en) Small-size chip crack detection method and system based on computer vision
JP5086789B2 (en) Optical inspection system
JP4776308B2 (en) Image defect inspection apparatus, image defect inspection system, defect classification apparatus, and image defect inspection method
JP5351673B2 (en) Appearance inspection device, appearance inspection method
JP3706051B2 (en) Pattern inspection apparatus and method
JP2745764B2 (en) Position recognition device
JP4230880B2 (en) Defect inspection method
JP2710685B2 (en) Defect detection method by visual inspection
JPH06103275B2 (en) Defect extraction method by visual inspection
JP3456096B2 (en) Shape inspection method
JP3508518B2 (en) Appearance inspection method
JPH02242382A (en) Defect checking method
JP3042939B2 (en) Scratch inspection method by image processing
JP2686053B2 (en) Defect inspection method by visual inspection
JP5346304B2 (en) Appearance inspection apparatus, appearance inspection system, and appearance inspection method
JPH09161056A (en) Inspecting method for inner surface of circular container
JP5033077B2 (en) Method and apparatus for inspecting appearance of molded product
JPH0772909B2 (en) Welding condition judgment method by visual inspection
JPH02187651A (en) Image processing method
JPH1114317A (en) Appearance inspection method and device
JP2009145161A (en) Method and apparatus for detecting defect
JP2874402B2 (en) Circular container inner surface inspection device
JP2514727B2 (en) Defect inspection method by visual inspection
JP2024047879A (en) Dirt Detection System
JP2959017B2 (en) Circular image discrimination method

Legal Events

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

Free format text: PAYMENT UNTIL: 20071024

Year of fee payment: 10

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

Year of fee payment: 11

Free format text: PAYMENT UNTIL: 20081024

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

Year of fee payment: 11

Free format text: PAYMENT UNTIL: 20081024

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

Year of fee payment: 12

Free format text: PAYMENT UNTIL: 20091024

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

Year of fee payment: 12

Free format text: PAYMENT UNTIL: 20091024

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

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

Year of fee payment: 12

Free format text: PAYMENT UNTIL: 20091024

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20101024

Year of fee payment: 13

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 13

Free format text: PAYMENT UNTIL: 20101024