JPH10208066A - Method for extracting edge line of check object and appearance check method using this method - Google Patents

Method for extracting edge line of check object and appearance check method using this method

Info

Publication number
JPH10208066A
JPH10208066A JP9014405A JP1440597A JPH10208066A JP H10208066 A JPH10208066 A JP H10208066A JP 9014405 A JP9014405 A JP 9014405A JP 1440597 A JP1440597 A JP 1440597A JP H10208066 A JPH10208066 A JP H10208066A
Authority
JP
Japan
Prior art keywords
edge
inspection
line
pixel
point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP9014405A
Other languages
Japanese (ja)
Inventor
Mitsuru Shirasawa
満 白澤
Takeshi Masuda
剛 増田
Hajime Naohara
肇 直原
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 JP9014405A priority Critical patent/JPH10208066A/en
Publication of JPH10208066A publication Critical patent/JPH10208066A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

PROBLEM TO BE SOLVED: To obtain an edge line of high precision by specifying an edge point based on an edge trace start candidate point in accordance with peripheral picture elements, their density changes, directions of these changes, etc. SOLUTION: A scan window W1 is scanned to find a picture element having an edge flag point; and if a differential absolute value |e| which this picture element has is larger than a preliminarily set threshold Z1, this point is taken as an edge trace start candidate element Q1. A window for trace of n×m picture elements is set with this edge trace start candidate point Q1 as the center, and a total sum N1 of differential absolute values |e| which edge flag points existing in this window for trace have is obtained; and if this total sum N1 is larger than a preliminarily set threshold Z2, this point is judged to be an edge of a check object, and this edge trace start candidate point is regarded as an edge point. The next edge point is traced based on this edge point Q2.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、画像入力装置によ
って撮像された被検査物の画像を、特殊な方法で画像処
理して正確なエッジラインを抽出する方法と、この抽出
方法を用いて、特にコーナー部等の識別が容易でないエ
ッジ周辺部に発生する欠け、ひび、汚れ、異物等の欠陥
を検出する外観検査方法に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for extracting an accurate edge line by processing an image of an object to be inspected taken by an image input device by a special method. In particular, the present invention relates to a visual inspection method for detecting a defect such as a chip, a crack, a dirt, or a foreign matter that occurs in an edge portion where it is not easy to identify a corner or the like.

【0002】[0002]

【従来の技術】被検査物の外観を撮影して得た2値画像
を処理を用いてエッジラインを検出し、そのエッジライ
ンをもとにして、被検査物の欠陥を検出する方法は、従
来より公知である。しかしながら、このような2値画像
を用いた方法では、2値画像を得るためのしきい値の設
定が困難であり、撮影条件によって、正確なエッジライ
ンが得難く、したがって、高い精度の検査は不可能であ
った。
2. Description of the Related Art A method of detecting an edge line by using a binary image obtained by photographing the appearance of an inspection object by using a process and detecting a defect of the inspection object based on the edge line is as follows. It is conventionally known. However, in such a method using a binary image, it is difficult to set a threshold value for obtaining a binary image, and it is difficult to obtain an accurate edge line depending on photographing conditions. It was impossible.

【0003】そこで、本出願人は、特公平7−1881
1号などにおいて、多階調のデジタル画像を微分処理し
て得たエッジラインをもとにした欠陥検査方法を提案し
た。この提案に係る欠陥検査方法は、被検査物の外観画
像情報を多階調に変換したデジタル画像をもとにして、
デジタル画像処理の各画素の微分絶対値をもとにしてエ
ッジ画像を得てから、更に探索ラインSを設定し、その
探索ラインSとエッジ画像に含まれる輪郭線L1とが交
差するエッジフラグ点(画素)Fを見付け、そのエッジ
フラグ点Fの前後の複数画素S1、S2、R1、R2をステ
ィックマスクとして抽出し、所定の演算処理を行って、
被検査物の内部に設定された探索ライン上に欠けや異物
などの欠陥部があるかどうかを検出するものである。
[0003] The applicant of the present invention has proposed Japanese Patent Publication No. Hei 7-1881.
No. 1 proposed a defect inspection method based on an edge line obtained by differentiating a multi-tone digital image. The defect inspection method according to this proposal is based on a digital image obtained by converting appearance image information of an inspection object into multiple gradations,
After obtaining an edge image based on the differential absolute value of each pixel in the digital image processing, a search line S is further set, and an edge flag point at which the search line S intersects with the contour line L1 included in the edge image. (Pixel) F, and a plurality of pixels S1, S2, R1, R2 before and after the edge flag point F are extracted as a stick mask, and predetermined arithmetic processing is performed.
This is to detect whether or not there is a defective portion such as a chip or a foreign substance on a search line set inside the inspection object.

【0004】図23は、上記画像処理における基本手順
を示すフローチャート、図24(a),(b)は、この
手法を説明するもので、(a)において、P4はエッジ
画像、Sは探索ライン、L1は欠陥の輪郭線、L0は被検
査物の輪郭線を示しており、(b)はスティックマスク
の原理説明図である。
FIG. 23 is a flowchart showing a basic procedure in the image processing, and FIGS. 24 (a) and 24 (b) explain this method. In FIG. 24 (a), P4 is an edge image and S is a search line. , L1 indicate the outline of the defect, L0 indicates the outline of the object to be inspected, and FIG.

【0005】[0005]

【発明が解決しようとする課題】このスティックマスク
を用いた外観検査方法では、それ以前の2値画像に基づ
いて欠陥部を判定する方法が有していた欠陥部の濃度と
その周辺の濃度がしきい値に対して同じ領域に含まれて
いる場合に欠陥の識別ができないという問題を、欠陥部
近傍の濃度変化を解析することによって解決し、欠陥の
検出精度を向上させることが出来た。
In the appearance inspection method using the stick mask, the density of the defective portion and the density of the peripheral portion, which are provided in the method of determining the defective portion based on the previous binary image, are reduced. The problem that the defect cannot be identified when the defect is included in the same region with respect to the threshold value was solved by analyzing the density change near the defect part, and the defect detection accuracy could be improved.

【0006】しかしながら、この方法では、同一品種で
あるが、金型や成形条件の違いで被検査物の輪郭が微妙
に相違する場合や、また被検査物の輪郭がコーナー部等
のように急激に方向の変化する部分については、画像処
理によって得られたエッジフラグ画像(上記従来例で
は、エッジ画像としている。)そのものが、被検査物の
実際の輪郭線を正確に反映していない場合が生じるた
め、被検査物の外観形状が小さくなり、更に外観に小さ
いバリがあったり、外観の輪郭に丸みを帯びているよう
な場合には、やはり安定した精度の高い欠陥の検出がで
きず、更に精度の高い外観検査方法が望まれていた。
However, according to this method, the contour of the inspection object is slightly different due to the difference in the mold and the molding conditions, or the contour of the inspection object is sharp, such as a corner portion, even though they are of the same kind. For the portion where the direction changes, the edge flag image itself obtained by the image processing (in the above-described conventional example, the edge image is used) may not accurately reflect the actual contour of the inspection object. As a result, the external shape of the inspection object becomes smaller, and furthermore, if there is a small burr in the external appearance or if the outline of the external appearance is rounded, it is still impossible to detect a stable and highly accurate defect, A more accurate appearance inspection method has been desired.

【0007】本発明は、上記問題点の解決を目的とし、
本発明者らによって鋭意検討の結果到達したものであ
り、被検査物を撮像し処理して得た原画像をもとにし
て、微分絶対値画像、微分方向値画像、エッジフラグ画
像をもとにして、画像の濃度の変化、その変化の方向な
どに注目してエッジ点を探索するという新規な手法を見
い出すことによって、より精度の高いエッジラインを得
ることのできる新しい被検査物のエッジライン抽出方法
と、その方法によって得られたエッジラインを基本とし
て、様々な検査ライン、検査領域、演算処理等を用い、
デジタル画像解析を施すことによって、精度が高く、か
つ安定した外観検査方法を提供するものである。
[0007] The present invention aims to solve the above problems,
The present inventors have arrived as a result of intensive studies, and based on the original image obtained by imaging and processing the inspection object, based on the differential absolute value image, the differential direction value image, and the edge flag image. By finding a new method of searching for edge points by focusing on the change in the density of the image and the direction of the change, the new edge line of the inspection object that can obtain a more accurate edge line Based on the extraction method and the edge line obtained by the method, various inspection lines, inspection areas, arithmetic processing, etc.
By performing digital image analysis, it is possible to provide a highly accurate and stable appearance inspection method.

【0008】[0008]

【課題を解決するための手段】本発明では、上記目的を
達成するために、被検査物を撮像し処理して得られた原
画像、その原画像を前処理して得られた微分絶対値画
像、あるいは微分方向値画像、及びその微分絶対値画像
をもとにして細線化処理、エッジフラグ延長処理により
得られたエッジフラグ画像をもとにして、さらに新しい
方法を用いることによってエッジラインを抽出する。
According to the present invention, in order to achieve the above object, an original image obtained by imaging and processing an object to be inspected, and a differential absolute value obtained by preprocessing the original image. Based on the image or the differential direction value image, and the edge flag image obtained by the thinning processing and the edge flag extension processing based on the differential absolute value image, the edge line can be formed by using a further new method. Extract.

【0009】その新しいエッジライン抽出の第1の方法
(請求項1)は、エッジフラグ画像において選んだエッ
ジフラグ点をエッジ追跡開始候補点とし、その周囲のエ
ッジフラグ点の微分絶対値の総和によりそのエッジ追跡
開始候補点をエッジ点とみなし、そのエッジ点を基準と
して、それに隣接しかつ微分絶対値が所定のしきい値を
越えている画素をつぎのエッジ点とし、さらにそのエッ
ジ点を基準として同様の処理を繰り返すことによりエッ
ジラインを抽出するものである。
In the first method of extracting a new edge line (claim 1), an edge flag point selected in an edge flag image is set as an edge tracking start candidate point, and the edge absolute value of the surrounding edge flag points is calculated by summing the differential absolute values of the surrounding edge flag points. The edge tracking start candidate point is regarded as an edge point, and a pixel adjacent to the edge point and having a differential absolute value exceeding a predetermined threshold value is set as a next edge point, and the edge point is set as a reference. The edge line is extracted by repeating the same processing.

【0010】その新しいエッジライン抽出の第2の方法
(請求項2)は、エッジフラグ画像において微分絶対値
と微分方向値により選んだエッジフラグ点をエッジ点と
し、そのエッジ点を基準として、それに隣接し、微分絶
対値が所定のしきい値を越え、かつ微分方向値が所定の
範囲にあるる画素をつぎのエッジ点とし、さらにそのエ
ッジ点を基準として同様の処理を繰り返すことによりエ
ッジラインを抽出するものである。
A second method of extracting a new edge line (claim 2) is to use an edge flag point selected in the edge flag image based on a differential absolute value and a differential direction value as an edge point, and with the edge point as a reference, An adjacent pixel whose absolute differential value exceeds a predetermined threshold value and whose differential direction value is within a predetermined range is set as the next edge point, and the same processing is repeated with the edge point as a reference to repeat the edge line. Is extracted.

【0011】こうして得られたエッジラインを基本とし
て、そのエッジラインと同形状の検査ライン、エッジラ
インの内部の一方向あるいは直交する方向の複数の等間
隔の検査ラインを用い、検査ライン上の画素あるいはそ
の周りの画素の濃度、平均濃度、微分絶対値、微分方向
値、あるいはそれらの総和を適宜用い、また抽出された
エッジラインが一定間隔をもって互いに近接する2本の
エッジラインの場合には、その2本のエッジラインの間
に適宜検査領域を設定して、被検査物の欠陥を検出する
ものである。
Based on the edge line thus obtained, an inspection line having the same shape as the edge line, a plurality of equally spaced inspection lines in one direction or a direction perpendicular to the inside of the edge line are used. Alternatively, the density of the surrounding pixels, the average density, the differential absolute value, the differential direction value, or the sum of them is used as appropriate. If the extracted edge lines are two edge lines that are close to each other at a fixed interval, An inspection area is appropriately set between the two edge lines to detect a defect of the inspection object.

【0012】本発明として同時に提案される被検査物の
外観検査方法は、上記した第1、第2のエッジライン抽
出方法を用いて抽出されたエッジラインを基準として検
査ラインが設定された後、種々の手法が用いられ、被検
査物の欠陥が検出される。請求項3〜6は、第1、第2
のエッジライン抽出方法によって抽出されたエジライン
が1本である場合に適用され、請求項3では、抽出され
たエッジラインをもとにして設定した検査ライン上、あ
るいはその近隣画素を、公知の手法をもって解析し、欠
陥の有無が判断される。また、請求項4では、抽出され
たエッジラインを同じ形状の検査ラインを設定し、その
検査ライン上の近隣画素を公知の手法をもって解析し、
欠陥の有無が判断され、更に請求項5では、被検査物の
欠陥は、画素の濃度差、微分絶対値をもとに判断され
る。
A method for inspecting the appearance of an object to be inspected, which is proposed at the same time as the present invention, comprises: setting an inspection line on the basis of an edge line extracted using the first and second edge line extraction methods described above; Various methods are used to detect defects of the inspection object. Claims 3 to 6 are first and second.
The method is applied to the case where the number of edge lines extracted by the edge line extraction method is one, and the method according to claim 3, wherein a pixel on an inspection line set based on the extracted edge line or a pixel adjacent thereto is determined by a known method. And the presence or absence of a defect is determined. In claim 4, an inspection line having the same shape is set for the extracted edge line, and neighboring pixels on the inspection line are analyzed by a known method.
The presence or absence of a defect is determined. Further, in the fifth aspect, the defect of the inspection object is determined based on the density difference of the pixel and the differential absolute value.

【0013】一方、請求項7〜10は、第1、第2のエ
ッジライン抽出方法によって抽出されたエジラインが2
本になる場合に適用され、請求項7では、抽出された2
本のエッジラインの間に存在するすくなくとも1以上の
画素を、欠陥有無の判断にあたっての解析対象とするも
の、請求項8では、2本のエッジラインに含まれる領域
の画素のすべてを解析対象とするもの、請求項9では、
2本のエッジラインの間に中点検査ラインを設定し、そ
の中点検査ライン上の画素を解析対象とするもの、請求
項10では、2本のエッジラインの間に、複数の検査ラ
インを設定して、その検査ライン上の画素を解析対象と
する手法を、それぞれ提案している。
On the other hand, according to claims 7 to 10, the edge lines extracted by the first and second edge line extraction methods are two or more.
This method is applied to a case where a book is used.
At least one pixel existing between the two edge lines is to be analyzed in determining whether or not there is a defect. In claim 8, all the pixels in the region included in the two edge lines are analyzed. In claim 9,
A midpoint inspection line is set between two edge lines, and pixels on the midpoint inspection line are to be analyzed. In the tenth aspect, a plurality of inspection lines are set between two edge lines. Each of the methods proposes a method of setting and analyzing pixels on the inspection line.

【0014】更に、請求項11〜請求項15は、第1、
第2のエッジライン抽出方法によって、抽出されたエッ
ジラインを基準にして、本発明者らの鋭意検討の結果、
知見した欠陥検出方法を提案している。すなわち、請求
項11、12は、被検査物のエッジライン上の欠陥と、
そのエッジラインを越えた外方の欠陥を同時に検出する
方法、請求項13,14は位相ずらしを用いた外観検査
方法、請求項15は検査ライン上の画素を中心にして、
ウインドウを設定し、そのウインドウの平均濃度を相互
に比較して、欠陥を検出する方法を、それぞれ提案して
いる。
Further, claim 11 to claim 15 are the first,
Based on the edge line extracted by the second edge line extraction method, as a result of the inventor's earnest study,
The proposed defect detection method is proposed. That is, Claims 11 and 12 describe a defect on the edge line of the inspection object,
A method for simultaneously detecting external defects beyond the edge line, claims 13 and 14 are appearance inspection methods using phase shift, and claims 15 are based on pixels on the inspection line.
A method of setting a window and comparing the average densities of the windows with each other to detect a defect has been proposed.

【0015】本発明者によれば、以上に提案する方法で
被検査物の外観検査を行った結果、被検査物の欠陥の検
出精度が従来に比べ3〜5倍と格段に向上したことを知
見し、本発明方法を提案するに至ったものである。
According to the present inventor, as a result of performing the appearance inspection of the object to be inspected by the method proposed above, the detection accuracy of the defect of the object to be inspected is remarkably improved to 3 to 5 times as compared with the conventional method. They have found out and have proposed the method of the present invention.

【0016】[0016]

【発明の実施の形態】BEST MODE FOR CARRYING OUT THE INVENTION

[実施例1]実施例1では、第1のエッジライン抽出方
法を説明する。この方法では、図3に示すように、検査
対象物をテレビカメラ等の画像入力装置1により撮像
し、各画素の濃度をアナログ−デジタル変換部2におい
てデジタル信号に変換した後、前処理部3において以下
の前処理を行うことにより、アナログ−デジタル変換部
2により得られる原画像のほかに、微分絶対値画像、微
分方向値画像、エッジフラグ画像を得る。
[Embodiment 1] In Embodiment 1, a first edge line extraction method will be described. In this method, as shown in FIG. 3, an object to be inspected is imaged 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, a differential absolute value image, a differential direction value image, and an edge flag image are obtained in addition to the original image obtained by the analog-digital converter 2.

【0017】すなわち、検査対象物を含む空間領域を撮
像して得られる原画像P0は濃淡画像であって、図4
(a)に示すように、検査対象物O、欠陥X1、異物X2
などを含む画像となっている。この濃淡画像から検査対
象物Oの輪郭線等のエッジフラグを抽出する処理は、
「エッジは濃度変化が大きい部分に対応している」とい
う考え方を基本にしている。したがって、濃度を微分す
ることによってエッジフラグの抽出を行う。微分処理
は、図5に示すように、原画像P0を3×3画素の局所
並列ウインドウWによって走査して行う。つまり、注目
する画素Eと、その画素Eの周囲の8画素(8近傍)A
〜D,F〜Iとで局所並列ウインドウWを形成し、局所
並列ウインドウW内の画素A〜Iの濃度の縦方向の濃度
変化ΔVと横方向の濃度変化ΔHとを次式によって求
め、 ΔV=(Da+Db+Dc)−(Dg+Dh+Di) ΔH=(Da+Dd+Dg)−(Dc+Df+Di) さらに、微分絶対値|e|と微分方向値∠eとを次式によ
って求めるのである。
That is, the original image P0 obtained by imaging the spatial region including the inspection object is a grayscale image,
As shown in (a), the inspection object O, defect X1, foreign matter X2
It is an image including such. The process of extracting the edge flag such as the contour line of the inspection object O from the grayscale image is as follows.
It is based on the idea that "the edge corresponds to a portion where the density change is large". Therefore, the edge flag is extracted by differentiating the density. The differentiation process is performed by scanning the original image P0 with a local parallel window W of 3 × 3 pixels as shown in FIG. That is, a pixel E of interest and eight pixels (near eight) A around the pixel E
To D and F to I, a local parallel window W is formed, and 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. = (Da + Db + Dc)-(Dg + Dh + Di) ΔH = (Da + Dd + Dg)-(Dc + Df + Di) Further, the differential absolute value | e | and the differential direction value ∠e are obtained by the following equations.

【0018】[0018]

【数1】 (Equation 1)

【0019】[0019]

【数2】 (Equation 2)

【0020】ただし、Da〜Diは対応する画素の濃度を
示している。また、ここでは濃度と言う場合、白の濃度
を表し、濃度が大きいほど明るいものとする。微分方向
値は、濃度の変化の方向、ここでは白から黒への変化の
方向を図6(a)に示すような16進数の値によってき
めると、その値に「4」(角度では90度)を加えた値
となる。たとえば、図6(b)のような例の場合、この
図での濃度の変化方向は「0」であり、この図を処理す
ると図6(c)のようなエッジフラグQが得られ、その
エッジフラグQの有する微分方向値は「4」となる。ま
た、図6(d)の場合は、濃度の変化方向は「4」であ
り、微分方向値は「8」となる。
Here, Da to Di indicate the density of the corresponding pixel. In addition, when the density is referred to here, it indicates the density of white, and the higher the density, the brighter it is. When the direction of the density change, here the direction of the change from white to black, is determined by a hexadecimal value as shown in FIG. 6A, the value of the differential direction is “4” (90 degrees in angle). ) Is added. For example, in the case of the example shown in FIG. 6B, the change direction of the density in this figure is “0”, and when this figure is processed, an edge flag Q as shown in FIG. 6C is obtained. The differential direction value of the edge flag Q is “4”. In the case of FIG. 6D, the change direction of the density is “4” and the differential direction value is “8”.

【0021】「数1」「数2」の式から明らかなよう
に、微分絶対値|e| は、原画像の注目する画素の近傍
領域における濃度の最大変化率を表し、微分方向値∠e
は、同近傍領域における濃度の最大変化の方向に直交
する方向を表している。以上の演算を原画像P0 の全画
素について行うことにより、検査対象物Oの輪郭や欠陥
X1 、異物X2 等が存在しているような濃度変化が大き
い部分と、その変化の方向とを抽出することができる。
ここに、各画素の微分絶対値|e|を表した画像を微分絶
対値画像P1、微分方向値∠eを表した画像を微分方向
値画像P2と呼ぶ。
As is apparent from the equations (1) and (2), the differential absolute value | e | represents the maximum change rate of the density in the vicinity of the pixel of interest in the original image, and the differential direction value {e
Represents a direction orthogonal to the direction of the maximum change in density in the vicinity region. By performing the above operation on all the pixels of the original image P0, a portion having a large density change such as the contour of the inspection object O, the defect X1, the foreign matter X2, etc., and the direction of the change are extracted. be able to.
Here, an image representing the differential absolute value | e | of each pixel is referred to as a differential absolute value image P1, and an image representing the differential direction value ∠e is referred to as a differential direction value image P2.

【0022】次に、細線化処理が施される。細線化処理
は、微分絶対値が大きいほど濃度変化が大きいことを表
している点に着目して行われる。すなわち、各画素の微
分絶対値を周囲の画素の微分絶対値と比較し、周囲の画
素よりも大きくなるものを連結していくことにより、1
画素の幅を有したエッジフラグを抽出する。 図7に示
すように、各画素の位置をX−Y座標で表し、微分絶対
値をZ軸に取った微分絶対値立体模式像P5を考えれ
ば、細線化処理は、この曲面における稜線を求めること
に相当する。ここまでの処理により、微分絶対値の大小
にかかわらず、すべての稜線が抽出される。この段階で
得られている稜線には、ノイズ等による不要な小さな山
も含まれているから、図8に示すように、適宜しきい値
ZLを設定し、このしきい値ZL以上の値のみを採用し
てノイズ成分を除去する。この処理で得られた画像は、
原画像のコントラストが不十分であるときや、ノイズが
多いようなときには、不連続線になりやすい。そこで、
エッジフラグ延長処理を行う。
Next, a thinning process is performed. The thinning process is performed while paying attention to the fact that the larger the absolute differential value, the larger the density change. That is, the differential absolute value of each pixel is compared with the differential absolute values of the surrounding pixels, and those that are larger than the surrounding pixels are connected, whereby 1
An edge flag having a pixel width is extracted. As shown in FIG. 7, considering the differential absolute value three-dimensional schematic image P5 in which the position of each pixel is represented by XY coordinates and the differential absolute value is taken on the Z axis, the thinning processing calculates the ridge line on this curved surface. It is equivalent to By the processing so far, all edges are extracted regardless of the magnitude of the differential absolute value. Since the ridgeline obtained at this stage includes unnecessary small peaks due to noise or the like, a threshold value ZL is appropriately set as shown in FIG. To remove noise components. The image obtained by this process is
When the contrast of the original image is insufficient or when there is much noise, discontinuous lines are likely to occur. Therefore,
Perform edge flag extension processing.

【0023】このエッジフラグ延長処理では、不連続線
の端点から始めて、注目する画素とその周囲の画素とを
比較し、次式で表される評価関数f(ej)が最も大き
くなる方向に線を延長し、他の線の端点に衝突するまで
これを続ける。
In this edge flag extension processing, starting from the end point of the discontinuous line, the pixel of interest is compared with the surrounding pixels, and the line is drawn in the direction in which the evaluation function f (ej) expressed by the following equation is the largest. And continue this until it hits another line endpoint.

【0024】[0024]

【数3】 (Equation 3)

【0025】ここに、∠e0は中心画素(局所並列ウイ
ンドウWのEに相当する)の微分方向値であり、|ej|
、∠ej(j=1,2,3,4,5,6,7,8)は隣接画素(局所並列
ウインドウWの8近傍に相当する)の微分絶対値、微分
方向値である。以上の処理により、図4(b)に示すよ
うに、原画像において濃度変化が大きい部分をなぞるよ
うなエッジフラグ画像P3 が得られる。エッジフラグ画
像P3では、各線が検査対象物O、欠陥X1 、異物X2
等の輪郭線に相当するエッジフラグラインL0〜L2 を
表すものとみなせる。
Here, ∠e0 is the differential direction value of the center pixel (corresponding to E of the local parallel window W), and | ej |
, ∠ej (j = 1,2,3,4,5,6,7,8) are differential absolute values and differential direction values of adjacent pixels (corresponding to 8 neighborhoods of the local parallel window W). By the above processing, as shown in FIG. 4B, an edge flag image P3 which traces a portion where the density change is large in the original image is obtained. In the edge flag image P3, each line is the inspection object O, the defect X1, the foreign matter X2.
Can be regarded as representing the edge flag lines L0 to L2 corresponding to the contour lines.

【0026】以上の前処理により、原画像P0、微分絶
対値画像P1(不図示)、微分方向値画像P2(不図
示)、エッジフラグ画像P3の4種類の画像が得られ、
各画像はそれぞれ原画像メモリ4、微分絶対値画像メモ
リ5、微分方向値画像メモリ6、エッジフラグ画像メモ
リ7に記憶される。原画像は、濃淡画像であって、濃度
は通常8ビットで表されるから、各画素における濃度a
は、0≦a≦255となる。また、微分絶対値画像の各
画素の値(すなわち、微分絶対値)bは、たとえば6ビ
ットで表され、0≦b≦63となり、微分方向値画像の
各画素の値(すなわち、微分方向値)cは、16方向を
16進数で表わしているので、0≦c≦15となる。エ
ッジフラグ画像については、線の有無のみであるから、
線となる画素は“1”、それ以外の画素は“0”として
表される。つまり、その値域は、{0,1}となる。
By the above preprocessing, four types of images are obtained: an original image P0, a differential absolute value image P1 (not shown), a differential direction value image P2 (not shown), and an edge flag image P3.
Each image is stored in an original image memory 4, a differential absolute value image memory 5, a differential direction value image memory 6, and an edge flag image memory 7, respectively. The original image is a gray-scale image, and the density is usually represented by 8 bits.
Is 0 ≦ a ≦ 255. The value b of each pixel of the differential absolute value image (that is, the differential absolute value) is represented by, for example, 6 bits, and 0 ≦ b ≦ 63, and the value of each pixel of the differential direction value image (that is, the differential direction value) Since c) represents 16 directions by hexadecimal notation, 0 ≦ c ≦ 15. For the edge flag image, it is only the presence or absence of a line,
Pixels serving as lines are represented as “1”, and other pixels are represented as “0”. That is, the value range is {0, 1}.

【0027】本発明では、以上のような手順で生成され
たエッジフラグ画像をもとにして、以下のような手順に
よってデジタル画像解析を行い、エッジラインを抽出す
る。図1は第1の方法の処理の流れを示すフローチャー
トである。前処理についてはすでに説明したので省略す
る。まずエッジフラグ画像P3において、任意に走査ウ
インドウW1(図9参照)を設定する。ついで、この走
査ウインドウW1内を走査して、エッジフラグ点を有す
る画素を見つけ出し、かつその画素の有する微分絶対値
|e|が予め設定したしきい値Z1よりも大きい場合に、
その点をエッジ追跡開始候補点Q1とする。
In the present invention, based on the edge flag image generated by the above procedure, digital image analysis is performed by the following procedure to extract an edge line. FIG. 1 is a flowchart showing the flow of the process of the first method. The pre-processing has already been described, and will not be described. First, a scanning window W1 (see FIG. 9) is set arbitrarily in the edge flag image P3. Next, the scanning window W1 is scanned to find a pixel having an edge flag point, and the differential absolute value of the pixel is found.
If | e | is greater than a preset threshold Z1,
This point is defined as an edge tracking start candidate point Q1.

【0028】ついで、このエッジ追跡開始候補点Q1を
中心としてn×m画素の追跡用ウインドウW2を設定し
(図10参照)、この追跡用ウインドウW2内に存在す
るエッジフラグ点の有する微分絶対値|e|の総和N1を
求め、この総和N1が予め設定されたしきい値Z2より
も大きい場合には、その点を被検査物のエッジと判断
し、このエッジ追跡開始候補点Q1をエッジ点Q2とみな
す。
Next, a tracking window W2 of n × m pixels is set around the edge tracking start candidate point Q1 (see FIG. 10), and the differential absolute value of the edge flag point existing in the tracking window W2 is set. The sum N1 of | e | is determined. If the sum N1 is larger than a predetermined threshold value Z2, the point is determined to be the edge of the inspection object, and this edge tracking start candidate point Q1 is determined as an edge point. Regarded as Q2.

【0029】ついで、このエッジ点Q2を基準にして、
次のエッジ点の追跡を行う(図11参照)。エッジ点Q
2を中心として追跡用ウインドウW2を設定し、このエッ
ジ点Q2と隣接し、かつ所定のしきい値Z1より大きい
微分絶対値|e|を有する画素を求めて探索を行う。上記
条件に合う画素が探索されたら、その点を次の基準とな
るエッジ点とし、その基準エッジ点を中心として再び追
跡用ウインドウW2を設定し、同様な方法でその次のエ
ッジ点を追跡する。この追跡は、得られたエッジ点が予
め設定されている検査領域(不図示)から外に出るか、
また追跡用ウインドウW2内に上記条件に合う画素が探
索できなかった場合に終了する。
Next, based on the edge point Q2,
The next edge point is tracked (see FIG. 11). Edge point Q
A tracking window W2 is set centered at 2, and a search is performed to find a pixel adjacent to the edge point Q2 and having a differential absolute value | e | greater than a predetermined threshold value Z1. When a pixel that satisfies the above condition is found, that point is set as the next reference edge point, the tracking window W2 is set again around the reference edge point, and the next edge point is tracked in the same manner. . In this tracking, the obtained edge point goes out of a predetermined inspection area (not shown), or
The process is terminated when a pixel meeting the above condition cannot be found in the tracking window W2.

【0030】エッジ点を追跡していく過程で、基準のエ
ッジ点に隣接する画素のなかに上記条件を満たす画素が
ない場合は、エッジ接続処理をおこなう。図11に示す
エッジ点Q3がかかるエッジ点であり、その場合、エッ
ジ点Q3から1画素離れた画素について探索を行い、上
記条件を満たす画素がない場合には2画素離れた画素、
ついで3画素離れた画素と順に範囲を広げながら、上記
条件を満たす画素がないかどうかの探索を行う。この探
索は、探索点の画素が、上記追跡用ウインドウW2の外
に出るまで続ける。その結果、上記条件を満たす画素が
探索されたら、その点を次の基準となるエッジ点Q4と
し、エッジ点Q3とQ4の間を、その間にエッジがあるも
のとみなして接続する。上記条件を満たす画素が探索さ
れなかったら、追跡は終了する。
In the process of tracking the edge points, if there is no pixel that satisfies the above condition among the pixels adjacent to the reference edge point, edge connection processing is performed. The edge point Q3 shown in FIG. 11 is such an edge point. In this case, a search is performed for a pixel that is one pixel away from the edge point Q3.
Next, a search is made to see if there is any pixel that satisfies the above condition, while expanding the range in order of pixels three pixels away. This search is continued until the pixel at the search point goes out of the tracking window W2. As a result, when a pixel that satisfies the above condition is found, that point is set as the next reference edge point Q4, and the connection is made between the edge points Q3 and Q4 assuming that there is an edge therebetween. If no pixel satisfying the above condition is found, the tracking ends.

【0031】このような追跡によって得られたエッジ点
を順次連結し、被検査物のエッジラインとして抽出す
る。以上の方法では、エッジ点は隣接する画素のしきい
値を順次判別しながら、特定しているが、必ずしも隣接
した画素を、エッジ点として優先的に特定する必要はな
く、エッジ点の特定途中において、特定が容易な画素を
先にエッジ点として特定してもよい。
The edge points obtained by such tracking are sequentially connected and extracted as an edge line of the inspection object. In the above method, the edge point is identified while sequentially determining the threshold value of the adjacent pixel. However, it is not always necessary to preferentially identify the adjacent pixel as the edge point, and the edge point is identified during the identification. In, a pixel that is easy to specify may be specified as an edge point first.

【0032】[実施例2]実施例2では、第2のエッジ
ラインの抽出方法(請求項2に記載の方法に相当)につ
いて説明する。図2は第2の方法の処理の流れを示すフ
ローチャートである。その内、前処理については実施例
1において、すでに説明したものである。この第2の方
法では、以下のような手順によってデジタル画像解析を
行い、エッジラインを抽出する。
[Second Embodiment] In a second embodiment, a second method of extracting an edge line (corresponding to the method described in claim 2) will be described. FIG. 2 is a flowchart showing the flow of the process of the second method. Among them, the pre-processing has already been described in the first embodiment. In the second method, digital image analysis is performed by the following procedure to extract an edge line.

【0033】まずエッジフラグ画像P3において、任意
に走査ウインドウW1(図9参照)を設定する。この走
査ウインドウW1内を走査して、エッジフラグ点であ
り、かつその画素の有する微分絶対値|e|が予め設定し
たしきい値Z1よりも大きい場合で、なおかつその画素
の有する微分方向値∠eが予め設定した範囲内にある場
合、その点をエッジ点Q2とする。
First, in the edge flag image P3, a scanning window W1 (see FIG. 9) is arbitrarily set. The scanning window W1 is scanned to find the edge flag point, and when the differential absolute value | e | of the pixel is larger than a predetermined threshold value Z1, and the differential direction value ∠ When e is within a preset range, that point is set as an edge point Q2.

【0034】ついで、このエッジ点Q2を基準にして、
次のエッジ点の追跡を行う(図11参照)。すなわち、
エッジ点Q2を中心として追跡用ウインドウW2を設定
し、このエッジ点Q2と隣接し、かつ所定のしきい値Z
1より大きい微分絶対値|e|を有し、なおかつ予め設定
した範囲内にある微分方向値∠eを有する画素を求めて
探索を行う。上記条件に合う画素が探索されたら、その
点を次の基準となるエッジ点とし、その基準エッジ点を
中心としてまた追跡用ウインドウW2を設定し、同様な
方法でまたその次のエッジ点を追跡する。この追跡は、
得られたエッジ点が予め設定されている検査領域(不図
示)から外にでるか、また追跡用ウインドウW2内に上
記条件を満たす画素が探索できなかった場合に終了す
る。
Next, based on the edge point Q2,
The next edge point is tracked (see FIG. 11). That is,
A tracking window W2 is set around the edge point Q2, and a predetermined threshold value Z adjacent to the edge point Q2 is set.
A search is performed to find a pixel that has a differential absolute value | e | greater than 1 and that has a differential direction value ∠e within a preset range. When a pixel that satisfies the above condition is found, that point is set as the next reference edge point, a tracking window W2 is set around the reference edge point, and the next edge point is tracked in the same manner. I do. This tracking
The process ends when the obtained edge point goes out of the inspection area (not shown) set in advance or when a pixel satisfying the above condition cannot be searched in the tracking window W2.

【0035】エッジ点を追跡していく過程で、基準のエ
ッジ点に隣接する画素のなかに上記条件を満たす画素が
ない場合は、エッジ接続処理をおこなう。図11に示す
エッジ点Q3がかかるエッジ点であり、その場合、エッ
ジ点Q3から1画素離れた画素について探索を行い、上
記条件を満たす画素がない場合には2画素離れた画素、
ついで3画素離れた画素と順に範囲を広げながら、上記
条件を満たす画素がないかどうかの探索を行う。この探
索は、探索点の画素が、上記追跡用ウインドウW2の外
に出るまで続ける。その結果、上記条件を満たす画素が
探索されたら、その点を次の基準となるエッジ点Q4と
し、エッジ点Q3とQ4の間を、その間にエッジがあるも
のとみなして接続する。上記条件を満たす画素が探索さ
れなかったら、追跡は終了する。
In the process of tracking the edge points, if there is no pixel that satisfies the above condition among the pixels adjacent to the reference edge point, edge connection processing is performed. The edge point Q3 shown in FIG. 11 is such an edge point. In this case, a search is performed for a pixel that is one pixel away from the edge point Q3.
Next, a search is made to see if there is any pixel that satisfies the above condition, while expanding the range in order of pixels three pixels away. This search is continued until the pixel at the search point goes out of the tracking window W2. As a result, when a pixel that satisfies the above condition is found, that point is set as the next reference edge point Q4, and the connection is made between the edge points Q3 and Q4 assuming that there is an edge therebetween. If no pixel satisfying the above condition is found, the tracking ends.

【0036】このような追跡によって得たエッジ点を順
次連結し、被検査物のエッジラインとして抽出する。 [実施例3]ついで、第1、第2のエッジライン抽出方
法によって抽出された被検査物のエッジラインを基準と
して、そのエッジラインと同形状の検査ライン、または
エッジラインの内部の一方向あるいは直交する方向の複
数の等間隔の検査ラインを用い、検査ライン上の画素あ
るいはその周りの画素の濃度、平均濃度、微分絶対値、
微分方向値、あるいはそれらの総和を適宜用いて、被検
査物の欠陥を検出する外観検査方法を以下に説明する。
Edge points obtained by such tracking are sequentially connected and extracted as an edge line of the inspection object. Third Embodiment Next, with reference to the edge line of the inspection object extracted by the first and second edge line extraction methods, an inspection line having the same shape as the edge line or one direction inside the edge line or Using a plurality of equally spaced inspection lines in the orthogonal direction, the density, average density, differential absolute value,
An appearance inspection method for detecting a defect of an inspection object by appropriately using the differential direction values or the sum of the values will be described below.

【0037】第1の外観検査方法(請求項3、4に記載
の方法に相当)においては、まず第1、第2のエッジラ
イン抽出方法によって抽出したエッジラインは被検査物
の輪郭線を表すものであるから、そのエッジラインの内
外の画素のもつ濃度を比較し、濃度の濃い側を被検査物
の外側、濃度の薄い側を被検査物の内側と判断する。つ
いで、図12、13に示すように、抽出されたエッジラ
インR1、R2上を追跡しながら、被検査物内部に予め設
定された画素dだけ離れた箇所に検査ラインS1、S2を
設定していく。この検査ラインS1、S2は等間隔で複数
本設定することも可能である。
In the first appearance inspection method (corresponding to the third and fourth aspects), first, the edge lines extracted by the first and second edge line extraction methods represent the contours of the inspection object. Therefore, the densities of the pixels inside and outside the edge line are compared, and the side with the higher density is determined as the outside of the test object, and the side with the lower density is determined as the inside of the test object. Next, as shown in FIGS. 12 and 13, while tracing the extracted edge lines R1 and R2, the inspection lines S1 and S2 are set at locations separated by a predetermined pixel d inside the inspection object. Go. A plurality of inspection lines S1 and S2 can be set at equal intervals.

【0038】この検査ラインS1、S2は、図12のよう
に曲線の場合や、図13のように直線の場合があり、任
意の形状の輪郭線をもつ被検査物に応じて、かつ同一品
種であるが、金型や成形条件の違いで被検査物の輪郭線
が微妙に相違する場合や、またコーナー部等のように急
激に方向の変化する輪郭線を被検査物が有する場合で
も、その輪郭線を忠実に反映したエッジラインR1、R2
に合わせて設定できるものである。
The inspection lines S1 and S2 may be curved as shown in FIG. 12 or straight as shown in FIG. 13, and may be of the same type according to the inspection object having an arbitrary contour. However, even if the contour of the inspection object is slightly different due to differences in the mold and molding conditions, or even if the inspection object has a contour line that changes direction rapidly, such as a corner portion, Edge lines R1 and R2 that faithfully reflect the outline
It can be set according to.

【0039】このようにして被検査物のエッジラインR
1、R2と同形状の検査ラインS1、S2を設定し、その検
査ラインS1、S2上の画素を解析する公知の方法で欠陥
の有無を判別する。この検査ラインS1、S2をもとにす
る場合で、特に欠陥の検出方法として、図14に示すよ
うな濃度値測定用ウインドウW3を用いる方法(請求項
3、5に記載の方法に相当)を説明する。
Thus, the edge line R of the inspection object is
1, inspection lines S1 and S2 having the same shape as R2 are set, and the presence or absence of a defect is determined by a known method for analyzing pixels on the inspection lines S1 and S2. In the case where the inspection lines S1 and S2 are used as the basis, a method using a density value measurement window W3 as shown in FIG. 14 (corresponding to the method described in claims 3 and 5) is particularly used as a defect detection method. explain.

【0040】図15に示すように、検査ラインS1、S2
上を濃度値測定用ウインドウW3を走査して、この濃度
値測定用ウインドウW3内にある中心画素C0、それを基
準にして対象で任意の等距離の位置にある濃度測定用画
素A1、A2、B1、B2間の濃度差を求め、それを所定の
しきい値Z3と比較する。つまり、濃度値測定用画素A
1、A2、B1、B2の有する濃度をDa1、Da2、Db1、D
b2とすると |Da1−Db1|+|Da2−Db2|>Z3 の式が成立した場合は、その中心画素C0を欠陥候補部
X0にある欠陥候補点としてカウントKに、「1」を加
算する。この処理を検査ラインS1、S2上を走査しなが
ら行い、最終的にカウントKが所定のしきい値Z4より
も大きい場合は、欠陥があると判断する。
As shown in FIG. 15, the inspection lines S1, S2
By scanning the density value measurement window W3 above, the central pixel C0 in the density value measurement window W3, and the density measurement pixels A1, A2, A density difference between B1 and B2 is obtained and compared with a predetermined threshold value Z3. That is, the pixel A for density value measurement
The concentrations of 1, A2, B1, and B2 are Da1, Da2, Db1, and D2.
Assuming that b2, when the equation | Da1-Db1 | + | Da2-Db2 |> Z3 holds, "1" is added to the count K with the center pixel C0 as a defect candidate point in the defect candidate portion X0. This process is performed while scanning the inspection lines S1 and S2. When the count K is finally larger than the predetermined threshold value Z4, it is determined that there is a defect.

【0041】上記の濃度測定用画素を用いる方法におい
て、上記の濃度差に加えて、濃度測定用画素A1、A2、
B1、B2の有する微分絶対値|e|の総和N2が所定のし
きい値Z5よりも大きい場合に、欠陥があると判断する
方法(請求項3、6に記載の方法に相当)も欠陥検出に
有効である。 [実施例4]ついで、第1のエッジライン抽出方法によ
って抽出されたエッジラインが一定間隔をもって互いに
近接する2本のエッジラインとして抽出される場合に有
効な外観検査方法(請求項7、8、9、10に記載の方
法に相当)を説明する。
In the above-described method using the density measurement pixels, in addition to the density difference, the density measurement pixels A1, A2,
When the sum N2 of the differential absolute values | e | of B1 and B2 is larger than a predetermined threshold value Z5, a method of determining that there is a defect (corresponding to the method of claim 3 or 6) is also defect detection. It is effective for [Embodiment 4] Next, a visual inspection method effective when the edge lines extracted by the first edge line extraction method are extracted as two edge lines that are close to each other at a constant interval. 9 and 10).

【0042】図16(a)に示すように被検査物Oの輪
郭線付近が濃度が特に高い場合、つまり背景Yと被検査
物Oの濃度に比べて、エッジ部Q5が高輝度の場合、実
施例1の方法で抽出したエッジラインが図16(b)に
示すように、一定間隔をもって互いに近接する2本のエ
ッジラインRWとして抽出されることがある。この場合
には、このエッジラインRW間に、欠陥が発生する場合
を考えて、図16(c)に示すような検査ウインドウW
4を設定し、その中で、エッジラインRWに挟まれる領域
を検査領域W5として、欠陥X5を検出する(請求項7、
8に記載の方法に相当)。
As shown in FIG. 16 (a), when the density is particularly high near the contour of the object O, that is, when the edge portion Q5 has a higher luminance than the density of the background Y and the object O, As shown in FIG. 16B, the edge lines extracted by the method of the first embodiment may be extracted as two edge lines RW adjacent to each other at a certain interval. In this case, considering a case where a defect occurs between the edge lines RW, the inspection window W as shown in FIG.
4, and a defect X5 is detected by setting a region sandwiched between the edge lines RW as an inspection region W5.
8).

【0043】実施例3の方法では、かかる場合、エッジ
ライン間に検査ラインをきれいに設定することができ
ず、ここに提案する方法がとくに有効である。また、エ
ッジラインRW間の間隔が広い場合には、図17に示す
ように、エッジラインRWの中心に中点検査ラインS3を
設定して、その検査ラインS3を、実施例3の図14で
示した濃度値測定用ウインドウW3を用いて、実施例3
と同様な方法で欠陥X6を検出をする方法(請求項7、
9に記載の方法に相当)がとられる。
In the method of the third embodiment, in such a case, the inspection line cannot be set clearly between the edge lines, and the method proposed here is particularly effective. When the interval between the edge lines RW is wide, as shown in FIG. 17, a midpoint inspection line S3 is set at the center of the edge line RW, and the inspection line S3 is set as shown in FIG. Example 3 using the indicated density value measurement window W3
A method for detecting the defect X6 in the same manner as described above.
9).

【0044】エッジラインRW間の間隔がさらに広い場
合には、図18に示すように、エッジラインRWの間に
複数の検査ラインS4を設定して、その検査ラインS4
を、実施例3の図14で示した濃度値測定用ウインドウ
W3を用いて、実施例3と同様な方法で欠陥X7を検出を
する方法(請求項7、10に記載の方法に相当)がとら
れる。
If the interval between the edge lines RW is even wider, a plurality of inspection lines S4 are set between the edge lines RW, as shown in FIG.
The method of detecting the defect X7 in the same manner as in the third embodiment using the density value measurement window W3 shown in FIG. 14 of the third embodiment (corresponding to the method described in claims 7 and 10). Be taken.

【0045】[実施例5]第1、第2のエッジライン抽
出方法によって抽出されたエッジラインをもとにして、
検査ラインを設定して、被検査物内部およびエッジライ
ン周辺に発生する欠陥の検出を行う外観検査方法を説明
する。この方法(請求項11に記載の方法に相当)にお
いては、図19(a)に示すように、抽出されたエッジ
ラインR3を含む予め設定した検査領域W6において、エ
ッジラインR3の内部に一方向に等間隔の検査ラインS5
を複数本設定する。
[Embodiment 5] Based on the edge lines extracted by the first and second edge line extraction methods,
An appearance inspection method for setting an inspection line and detecting a defect occurring inside the inspection object and around the edge line will be described. In this method (corresponding to the method described in claim 11), as shown in FIG. 19A, in a predetermined inspection area W6 including the extracted edge line R3, one direction is provided inside the edge line R3. Inspection line S5 at equal intervals
Set multiple lines.

【0046】ついで、この検査領域W6内において、そ
の検査ラインS5上を走査して、実施例3で使用した濃
度値測定用ウインドウW3をもちいる欠陥検出方法によ
り欠陥の検出をする。この場合に、検査ラインS5とエ
ッジラインR3が交差する点においては、図19(a)
のようにエッジラインR3付近に欠陥がない場合には、
その検査ラインS5はその交差点で終了するが、図19
(b)にしめすようにエッジラインR3付近に欠陥X8が
ある場合には、その点の微分絶対値|e|または微分方向
値∠eが、その付近のエッジラインR3上の点の微分絶
対値|e|または微分方向値∠eと相違する。そこで、そ
の交差点での微分絶対値|e|が所定のしきい値より小さ
く、または微分方向値∠eが所定の範囲にない場合は、
図19(c)に示すように、検査ラインS5を、エッジ
ラインR3を越えて、検査領域W6の他の一辺まで延長し
て、その検査ラインS5上を検査する。
Next, in this inspection area W6, the inspection line S5 is scanned and a defect is detected by the defect detection method using the density value measurement window W3 used in the third embodiment. In this case, at the point where the inspection line S5 and the edge line R3 intersect, FIG.
When there is no defect near the edge line R3 as in
Although the inspection line S5 ends at the intersection, FIG.
(B) When the defect X8 is present near the edge line R3 as shown in FIG. 7B, the differential absolute value | e | | e | or the differential direction value ∠e. Therefore, if the differential absolute value | e | at the intersection is smaller than a predetermined threshold value or the differential direction value ∠e is not in a predetermined range,
As shown in FIG. 19C, the inspection line S5 is extended beyond the edge line R3 to another side of the inspection area W6, and inspection is performed on the inspection line S5.

【0047】この方法は、被検査物内部およびエッジラ
イン周辺部の欠陥の検出に適している。また、被検査物
のエッジラインの形状によっては、図20(a)、
(b)、(c)に示すように、上述の検査ラインS5を
一方向だけでなく、直交する二方向に設定する方法(請
求項12に記載の方法に相当)が採られる。この図にお
いて、W7、R4、S6、X9は、この場合の検査領域、エ
ッジライン、検査ライン、欠陥を示すものである。
This method is suitable for detecting defects inside the inspection object and around the edge line. Further, depending on the shape of the edge line of the inspection object, FIG.
As shown in (b) and (c), a method of setting the inspection line S5 not only in one direction but also in two orthogonal directions (corresponding to the method according to claim 12) is adopted. In this figure, W7, R4, S6, and X9 indicate the inspection area, edge line, inspection line, and defect in this case.

【0048】[実施例6]第1、第2方法のエッジライ
ン抽出方法によって抽出されたエッジラインをもとにし
て検査ラインを、位相ずらしさせることによって被検査
物に発生する欠陥の検出を行う外観検査方法を説明す
る。この方法(請求項13に記載の方法に相当)は、実
施例3と同様にエッジラインと同形状の検査ラインを設
定するのであるが、この検査ラインを位相ずらしさせる
ことを特徴とする。
[Embodiment 6] Defects occurring in an inspection object are detected by shifting the phase of an inspection line based on the edge lines extracted by the edge line extraction methods of the first and second methods. The appearance inspection method will be described. This method (corresponding to the method according to claim 13) sets an inspection line having the same shape as the edge line as in the third embodiment, but is characterized in that the inspection line is shifted in phase.

【0049】まず、図21(a)に示すように、エッジ
ラインR5の内側に任意の画素だけ間隔をおいた検査ラ
インS7を設定する。つぎに、この検査ラインS7の位相
ずらしを行う。位相ずらしとは、注目するエッジライン
R5のラインの方向に対して前または後に、所定の画素
の数の分だけ検査ラインS7を移動させることをいう。
たとえば、図21(a)に示すようにエッジラインR5
が円弧形状の場合には、その円弧の曲率中心を中心とし
て回転移動させることになる。また、エッジラインが直
線の場合は、平行移動することになる。その後、この移
動後の検査ライン上を走査することによって、欠陥の検
出を行う。
First, as shown in FIG. 21A, an inspection line S7 is set inside the edge line R5 at an arbitrary pixel interval. Next, the phase of the inspection line S7 is shifted. The phase shift refers to moving the inspection line S7 by a predetermined number of pixels before or after the direction of the target edge line R5.
For example, as shown in FIG.
Is circular-shaped, it is rotated about the center of curvature of the circular arc. When the edge line is a straight line, it moves in parallel. Thereafter, by scanning the inspection line after the movement, a defect is detected.

【0050】この方法は、図21(a)のようにエッジ
ラインR5上に欠陥がない場合には有効ではなく、図2
1(b)のようにエッジラインR5a上に欠陥X10がある
場合に採用される。この場合、位相ずらしをしないで、
単に検査ラインS7a上を走査するだけでは、そのライン
上では、欠陥を示す濃度の変化、微分絶対値|e|や微分
方向値∠eの特徴が得られないので、欠陥を検出するこ
とが困難である。そこで、図21(c)に示すように位
相ずらしを行うと、エッジラインR5aと移動後の検査ラ
インS7bの交点であるエッジ点Q6、Q7が得られ、この
図で明かなように、これらのエッジ点Q6、Q7の前後で
は、欠陥X10のために濃度差が有るので、この移動後の
検査ラインS7aを走査し、実施例3で使用した濃度値測
定用ウインドウW3を用いる方法によって、欠陥の検出
をすることができる。
This method is not effective when there is no defect on the edge line R5 as shown in FIG.
This is adopted when there is a defect X10 on the edge line R5a as shown in FIG. In this case, do not shift the phase,
It is difficult to detect a defect simply by scanning on the inspection line S7a, since a change in density indicating a defect, a characteristic of a differential absolute value | e | or a differential direction value 得 e cannot be obtained on the line. It is. Therefore, when the phase is shifted as shown in FIG. 21C, edge points Q6 and Q7, which are the intersections of the edge line R5a and the inspection line S7b after the movement, are obtained. As is clear from FIG. Since there is a density difference before and after the edge points Q6 and Q7 due to the defect X10, the inspection line S7a after the movement is scanned, and the defect is detected by the method using the density value measurement window W3 used in the third embodiment. Can be detected.

【0051】このように、位相ずらしを行うことによっ
て、エッジライン周辺に発生する微小欠陥の検出が可能
になった。また、上記の方法において、エッジラインの
内側だけでなく、エッジラインの外側にも検査ラインを
設けて、同様の方法により位相ずらしを行って、欠陥の
検出を行う方法(請求項14に記載の方法に相当)は、
エッジラインの外側に欠陥がある場合、例えばバリ等が
存在する場合であるが、有効である。
As described above, by performing the phase shift, it is possible to detect a minute defect occurring around the edge line. Further, in the above method, an inspection line is provided not only inside the edge line but also outside the edge line, and the phase is shifted by the same method to detect a defect (claim 14). Method)
It is effective when there is a defect outside the edge line, for example, when there is a burr or the like.

【0052】[実施例7]最後に、第1、第2のエッジ
ライン抽出方法で抽出したエッジラインをもとにして設
定した検査ライン上を平均濃度測定ウインドウを走査し
て、欠陥を検出する外観検査方法(請求項15に記載の
方法に相当)を説明する。この方法は、実施例3と同様
にエッジラインと同形状の検査ラインを設定し、その検
査ライン上を走査して欠陥の検出をする外観検査方法で
あるが、この検査ラインを走査するにあたり、平均濃度
測定ウインドウを用いることを特徴とする。
[Embodiment 7] Finally, a defect is detected by scanning the average density measurement window on the inspection line set based on the edge lines extracted by the first and second edge line extraction methods. The appearance inspection method (corresponding to the method according to claim 15) will be described. This method is an appearance inspection method in which an inspection line having the same shape as an edge line is set as in the third embodiment, and a defect is detected by scanning the inspection line. An average density measurement window is used.

【0053】図22(a)に示すように、n×m画素の
平均濃度測定ウインドウW9を用い、図22(b)に示
すように、エッジラインR6と同形状の検査ラインS8上
を平均濃度測定ウインドウW9を順次移動させながら、
検査ラインS8上の画素について、それを中心とする平
均濃度測定ウインドウW9内にある画素の有する濃度の
平均値である平均濃度DWを順次求め、所定の画素離れ
た画素についての平均濃度DWの相対的な差DSが、所
定のしきい値Z6より大きい場合に欠陥があると判断す
る。
As shown in FIG. 22A, an average density measurement window W9 of n × m pixels is used, and as shown in FIG. 22B, the average density is measured on the inspection line S8 having the same shape as the edge line R6. While sequentially moving the measurement window W9,
With respect to the pixels on the inspection line S8, the average density DW, which is the average value of the densities of the pixels in the average density measurement window W9 centered on the inspection line S8, is sequentially obtained. If the actual difference DS is larger than a predetermined threshold value Z6, it is determined that there is a defect.

【0054】この方法によると、平均濃度測定ウインド
ウW9が欠陥X11を含む画素にある場合は、その欠陥X1
1の部分では、被検査物外部の濃度が高い白い部分が含
まれることにより平均濃度DWが高くなり、平均濃度の
相対的な差DSが欠陥のない部分に比べて大きくなる点
を利用して、欠陥の検出をすることができる。この方法
によると、検査ライン上だけでなく、一定の広がりをも
った範囲内の欠陥候補部の情報も検知することができ
る。なお、本発明が提案する、被検査物の原画像、微分
絶対値画像、微分方向値画像、エッジフラグ画像をもと
にするエッジラインの抽出方法は、実施例1に記載した
ようにエッジ点Q2の特定に、微分絶対値|e|の総和N
1を用いる方法以外に濃度の平均値や、微分絶対値|e|
の平均値などを用いる方法も可能である。
According to this method, when the average density measurement window W9 is located at a pixel including the defect X11, the defect X1
In the part 1, the average density DW is increased by including a white part having a high density outside the inspection object, and the relative difference DS of the average density is increased compared to the part without defects. , Defect detection. According to this method, it is possible to detect information not only on the inspection line but also on a defect candidate portion within a range having a certain extent. The method of extracting an edge line based on an original image, a differential absolute value image, a differential direction value image, and an edge flag image of the inspection object, which is proposed by the present invention, is described in the first embodiment. To specify Q2, sum N of differential absolute values | e |
In addition to the method using 1, the average value of the concentration and the differential absolute value | e |
It is also possible to use a method using the average value of the above.

【0055】また、実施例2に記載したようにエッジ点
Q2の特定に、微分絶対値|e|の総和N1と微分方向値
∠eを用いる方法以外に濃度の平均値や、微分絶対値|
e|の平均値などを用いる方法も可能である。また、本
発明において提案した様々な検査ライン、検査領域、微
分絶対値、微分方向値、濃度、これらの総和や平均値を
適宜組み合わせた他の欠陥検知方法も可能である。
As described in the second embodiment, the method of using the sum N1 of the differential absolute values | e | and the differential direction value ∠e to specify the edge point Q2, other than the method of using the average value of the density and the differential absolute value |
A method using an average value of e | is also possible. Further, other defect detection methods that appropriately combine various inspection lines, inspection areas, differential absolute values, differential direction values, densities, and sums and averages of these, which are proposed in the present invention, are also possible.

【0056】[0056]

【発明の効果】第1、第2のエッジライン抽出方法(請
求項1、2)によれば、被検査物の原画像、微分絶対値
画像、微分方向値画像、エッジフラグ画像をもとにし
て、更にエッジフラグ画像の画素のうちから、エッジ追
跡開始候補点を特定し、そのエッジ追跡開始候補点をも
とにして、周囲の画素との濃度変化や変化の方向などか
らエッジ点を特定するので、同一品種であるが、金型や
成形条件の違いで輪郭が微妙に相違している被検査物
や、コーナー部等のように急激に方向の変化する部分に
ついても、より精度の高いエッジラインを得ることがで
きる。
According to the first and second edge line extraction methods (claims 1 and 2), an original image, a differential absolute value image, a differential direction value image, and an edge flag image of an inspected object are used. Then, from the pixels of the edge flag image, an edge tracking start candidate point is specified, and based on the edge tracking start candidate point, an edge point is specified from a density change with respect to surrounding pixels or a direction of change. Therefore, it is possible to improve the accuracy even for the inspection object that has the same type, but the contour is slightly different due to the difference in the mold and the molding conditions, and the part where the direction changes rapidly such as the corner. An edge line can be obtained.

【0057】また、同時に提案される本発明の外観検査
方法(請求項3〜15)によれば、上記した第1、第2
のエッジライン抽出方法によって抽出された正確なエッ
ジラインをもとにして、そのエッジラインにもとづいて
設定した検査ラインあるいは、その検査ラインの近傍の
画素を解析して、欠陥の有無を判別しているので、被検
査物のエッジライン周辺部の形状が崩れずに、内部に発
生する剥離カケなどの微小欠陥の検出をすることができ
る。
Further, according to the appearance inspection method (claims 3 to 15) of the present invention proposed at the same time, the first and second appearance inspection methods described above are provided.
Based on the accurate edge line extracted by the edge line extraction method, the inspection line set based on the edge line or the pixels near the inspection line are analyzed to determine whether there is a defect. Therefore, it is possible to detect minute defects such as peeling chips generated inside without inspecting the shape of the peripheral portion of the edge line of the inspection object.

【0058】特に、請求項3〜6において提案された外
観検査方法によれば、第1、第2のエッジライン抽出方
法によって抽出されたエッジラインにもとづいて、検査
ラインを特定し、公知の手法を用いて欠陥を検出するの
で、高い精度でかつ容易に欠陥の検出をすることができ
る。また、請求項7〜10において提案された外観検査
方法によれば、第1、第2のエッジライン抽出方法によ
って抽出されたエッジラインが、エッジ部が高輝度で太
いために、一定間隔をもって互いに近接する2本のエッ
ジラインとして抽出された場合でも、安定した検査が可
能となる。
In particular, according to the appearance inspection method proposed in claims 3 to 6, an inspection line is specified based on the edge lines extracted by the first and second edge line extraction methods, and a known method is used. Is used to detect a defect, so that the defect can be detected easily with high accuracy. Also, according to the appearance inspection method proposed in claims 7 to 10, the edge lines extracted by the first and second edge line extraction methods are mutually spaced at a certain interval because the edge portions are high in brightness and thick. Even when two adjacent edge lines are extracted, stable inspection can be performed.

【0059】また、請求項11、12において提案され
た外観検査方法によれば、第1、第2のエッジライン抽
出方法によって抽出されたエッジラインにもとづいて被
検査物の内部に設定された検査ラインを、エッジライン
付近に欠陥が有る場合には、そのエッジラインを越えて
被検査物の外側まで延長して検査するので、被検査物エ
ッジラインの内、外(被検査物の内、外側)の欠陥も高
い精度で検出することができる。
According to the appearance inspection method proposed in claims 11 and 12, the inspection set inside the inspection object based on the edge lines extracted by the first and second edge line extraction methods. If there is a defect near the edge line, the line is extended beyond the edge line to the outside of the object to be inspected, so that the inside and outside of the edge line of the object (inside and outside of the object) are inspected. ) Can also be detected with high accuracy.

【0060】また、請求項13、14において提案され
た外観検査方法によれば、第1、第2のエッジライン抽
出方法によって抽出されたエッジラインと同じ形状でエ
ッジラインの内部あるいは外部に設定した検査ラインを
位相ずらしさせることによって検査するので、エッジラ
イン上及びその周辺に発生する剥離カケなどの微小欠陥
の検出をすることができる。
According to the appearance inspection method proposed in claims 13 and 14, the same shape as the edge line extracted by the first and second edge line extraction methods is set inside or outside the edge line. Since the inspection is performed by shifting the phase of the inspection line, it is possible to detect minute defects such as peeling chips generated on and around the edge line.

【0061】また、請求項15において提案された外観
検査方法によれば、第1、第2のエッジライン抽出方法
によって抽出されたエッジラインにもとづいて被検査物
の内部に設定された検査ライン上を所定の範囲を有する
濃度値測定用ウインドウを走査させながら欠陥の検査を
行うので、検査ライン上のみならず、その周辺の欠陥も
検出をすることができる。
Further, according to the appearance inspection method proposed in claim 15, the inspection line set inside the inspection object based on the edge lines extracted by the first and second edge line extraction methods. Is inspected while scanning the density value measurement window having a predetermined range, so that not only the inspection line but also the peripheral defects can be detected.

【0062】また、本発明によれば、被検査物の形状、
エッジラインの特性に応じて提案された検査方法から適
切な方法を選ぶこともできるので、全体として欠陥の検
出精度が従来方法に比べて3〜5倍と格段に向上した。
Further, according to the present invention, the shape of the inspection object,
Since an appropriate method can be selected from the proposed inspection methods according to the characteristics of the edge line, the accuracy of defect detection as a whole is remarkably improved to 3 to 5 times as compared with the conventional method.

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

【図1】本発明のエッジライン抽出方法(請求項1)に
おける処理手順を説明するフローチャート。
FIG. 1 is a flowchart illustrating a processing procedure in an edge line extraction method (claim 1) of the present invention.

【図2】本発明のエッジライン抽出方法(請求項2)に
おける処理手順を説明するフローチャート。
FIG. 2 is a flowchart illustrating a processing procedure in the edge line extraction method (claim 2) of the present invention.

【図3】本発明方法を実施するための処理回路のブロッ
ク図。
FIG. 3 is a block diagram of a processing circuit for implementing the method of the present invention.

【図4】(a),(b)は、それぞれ原画像、エッジフ
ラグ画像の一例を示す説明図。
FIGS. 4A and 4B are explanatory diagrams showing examples of an original image and an edge flag image, respectively.

【図5】微分処理において使用される局所並列ウインド
ウの概念説明図。
FIG. 5 is a conceptual explanatory diagram of a local parallel window used in differential processing.

【図6】(a)は微分方向値の概念説明図、(b)は濃
度変化の一例を示す説明図、(c)は同様の場合の画像
処理後の説明図、(d)は別の場合の画像処理後の説明
6A is a conceptual explanatory diagram of a differential direction value, FIG. 6B is an explanatory diagram showing an example of a density change, FIG. 6C is an explanatory diagram after image processing in a similar case, and FIG. Illustration after image processing in case

【図7】微分絶対値を立体的に表した模式図。FIG. 7 is a schematic diagram showing a differential absolute value three-dimensionally.

【図8】微分絶対値画像を得るためのノイズ除去処理の
概念的な説明図。
FIG. 8 is a conceptual explanatory diagram of a noise removal process for obtaining a differential absolute value image.

【図9】本発明方法において使用されるエッジ追跡開始
候補点の説明図。
FIG. 9 is an explanatory diagram of an edge tracking start candidate point used in the method of the present invention.

【図10】追跡用ウインドウの説明図。FIG. 10 is an explanatory diagram of a tracking window.

【図11】エッジ接続処理の説明図。FIG. 11 is an explanatory diagram of edge connection processing.

【図12】本発明方法によって抽出したエッジラインに
対して設定される検査ライン(円孤形状)の一例を示す
図。
FIG. 12 is a diagram showing an example of an inspection line (circular shape) set for an edge line extracted by the method of the present invention.

【図13】本発明方法によって抽出したエッジラインに
対して設定される検査ライン(直線形状)の一例を示す
図。
FIG. 13 is a diagram showing an example of an inspection line (linear shape) set for an edge line extracted by the method of the present invention.

【図14】欠陥を判別するために使用される濃度値測定
用ウインドウの説明図。
FIG. 14 is an explanatory diagram of a density value measurement window used to determine a defect.

【図15】濃度値測定用ウインドウと欠陥との関係を示
す説明図。
FIG. 15 is an explanatory diagram showing a relationship between a density value measurement window and a defect.

【図16】(a)〜(c)は、一定間隔をもって互いに
近接する2本のエッジラインが抽出された場合における
本発明方法の処理手順(請求項7,8)を説明する図。
FIGS. 16A to 16C are diagrams for explaining processing procedures (claims 7 and 8) of the method of the present invention when two edge lines that are close to each other at a fixed interval are extracted;

【図17】一定間隔をもって互いに近接する2本のエッ
ジラインが抽出された場合における本発明方法の検査ラ
イン(請求項7,9)を説明する図。
FIG. 17 is a diagram for explaining an inspection line (claims 7 and 9) of the method of the present invention when two edge lines that are close to each other at a fixed interval are extracted.

【図18】一定間隔をもって互いに近接する2本のエッ
ジラインが抽出された場合における本発明方法の検査ラ
イン(請求項7,10)を説明する図。
FIG. 18 is a view for explaining an inspection line (claims 7 and 10) of the method of the present invention when two edge lines which are close to each other at a fixed interval are extracted.

【図19】(a)〜(c)は、請求項11において提案
した本発明の外観検査方法を説明する図。
19 (a) to 19 (c) are views for explaining an appearance inspection method according to the present invention proposed in claim 11. FIG.

【図20】(a)〜(c)は、請求項12において提案
した本発明の外観検査方法を説明する図。
FIGS. 20A to 20C are diagrams for explaining the appearance inspection method of the present invention proposed in claim 12;

【図21】(a)〜(c)は、請求項13,14におい
て提案した本発明の外観検査方法(位相ズラシを用いた
外観検査方法)を説明する図。
FIGS. 21A to 21C are diagrams for explaining an appearance inspection method (an appearance inspection method using a phase shift) of the present invention proposed in claims 13 and 14;

【図22】(a),(b)は、請求項15において提案
した本発明の外観検査方法において使用される検査ウイ
ンドウと検査ラインを説明する図。
FIGS. 22A and 22B are diagrams illustrating an inspection window and an inspection line used in the appearance inspection method of the present invention proposed in claim 15;

【図23】スティックマスクを用いた外観検査方法(特
公平7−18811号)の基本処理手順を説明するフロ
ーチャート。
FIG. 23 is a flowchart illustrating a basic processing procedure of an appearance inspection method using a stick mask (Japanese Patent Publication No. 7-18811).

【図24】(a),(b)は、スティックマスクを用い
た外観検査方法(特公平7−18811号)の基本概念
の説明図。
24 (a) and (b) are explanatory diagrams of a basic concept of an appearance inspection method using a stick mask (Japanese Patent Publication No. 7-18811).

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

P0・・・原画像 P3・・・エッジフラグ画像 P5・・・微分絶対値立体模式像 X、X0〜X11・・・ゴミ、欠陥候補部、欠陥、異物 L0〜L2・・・輪郭線 O・・・被検査物 W、W1〜W9・・・ウインドウまたは検査領域 Q・・・エッジフラグ R・・・エッジライン S・・・検査ライン Y・・・背景 P0: Original image P3: Edge flag image P5: Differential absolute value stereoscopic image X, X0 to X11: Dust, defect candidate part, defect, foreign matter L0 to L2: Outline line O. ..Inspection object W, W1 to W9: window or inspection area Q: edge flag R: edge line S: inspection line Y: background

Claims (15)

【特許請求の範囲】[Claims] 【請求項1】被検査物を撮像し処理して得られた原画像
と、この原画像に含まれる各画素を処理して得られた微
分絶対値画像をもとにして、被検査物のエッジラインを
抽出する方法であって、 微分絶対値画像をもとにして、細線化処理を行って求め
たエッジフラグを、エッジフラグ画像として生成した
後、 このエッジフラグ画像において、所定の走査ウインドウ
を設定し、その走査ウインドウ内において、微分絶対値
が所定のしきい値を越えたエッジフラグ点をエッジ追跡
開始候補点として特定し、 ついで、このエッジ追跡開始候補点を中心にして所定の
追跡用ウインドウを設定し、そのウインドウ内に含まれ
るエッジフラグ点の有する微分絶対値の総和を算出し、
その総和が所定のしきい値を越えた場合に、そのエッジ
追跡開始候補点をエッジ点として特定し、 このようにしてエッジ点が特定された後は、そのエッジ
点を基準として、そのエッジ点に隣接する画素のうち、
微分絶対値が所定のしきい値を越えた画素を、次のエッ
ジ点として特定し、更に、そのエッジ点を基準にして、
次のエッジ点を特定する処理を順次繰り返し行うことに
よって、エッジラインを抽出することを特徴とする被検
査物のエッジライン抽出方法。
An image of an object to be inspected is obtained based on an original image obtained by imaging and processing an object to be inspected and a differential absolute value image obtained by processing each pixel included in the original image. A method for extracting an edge line, comprising: generating an edge flag obtained by performing a thinning process based on a differential absolute value image as an edge flag image; Is set, and within the scanning window, an edge flag point whose differential absolute value exceeds a predetermined threshold value is specified as an edge tracking start candidate point. Then, a predetermined tracking is performed around this edge tracking start candidate point. A window for calculating the sum of the differential absolute values of the edge flag points included in the window.
When the sum exceeds a predetermined threshold, the edge tracking start candidate point is specified as an edge point. After the edge point is specified in this manner, the edge point is determined based on the edge point. Of the pixels adjacent to
A pixel whose differential absolute value exceeds a predetermined threshold value is specified as the next edge point, and further, based on the edge point,
An edge line extraction method for an object to be inspected, wherein an edge line is extracted by sequentially and repeatedly performing a process of specifying a next edge point.
【請求項2】被検査物を撮像し処理して得られた原画像
と、この原画像に含まれる各画素を処理して得られた微
分絶対値画像、微分方向値画像をもとにして、被検査物
のエッジラインを抽出する方法であって、 微分絶対値画像をもとにして、細線化処理を行って求め
たエッジフラグを、エッジフラグ画像として生成した
後、 このエッジフラグ画像において、所定の走査ウインドウ
を設定し、その走査ウインドウ内において、微分絶対値
が所定のしきい値を越え、かつ微分方向値が所定の範囲
内にあるエッジフラグ点をエッジ点として特定し、 このようにしてエッジ点が特定された後は、そのエッジ
点を基準として、そのエッジ点に隣接する画素のうち、
微分絶対値が所定のしきい値を越え、かつ微分方向値が
所定の設定範囲内にある画素を、次のエッジ点として特
定し、更に、そのエッジ点を基準にして、次のエッジ点
を特定する処理を順次繰り返し行うことによって、エッ
ジラインを抽出することを特徴とする被検査物のエッジ
ライン抽出方法。
2. An original image obtained by imaging and processing an object to be inspected, and a differential absolute value image and a differential direction value image obtained by processing each pixel included in the original image. A method for extracting an edge line of the inspection object, wherein an edge flag obtained by performing a thinning process based on the differential absolute value image is generated as an edge flag image, and , A predetermined scanning window is set, and an edge flag point whose differential absolute value exceeds a predetermined threshold value and whose differential direction value is within a predetermined range is specified as an edge point in the scanning window. After the edge point is specified, the pixel adjacent to the edge point is determined based on the edge point.
A pixel whose differential absolute value exceeds a predetermined threshold value and whose differential direction value is within a predetermined setting range is specified as the next edge point, and further, the next edge point is determined based on the edge point. An edge line extraction method for an object to be inspected, wherein an edge line is extracted by sequentially and repeatedly performing a specifying process.
【請求項3】請求項1または2において抽出したエッジ
ラインを基準として、所定の検査ラインを設定し、その
検査ライン上の、あるいはその検査ラインを含む近隣画
素を解析することによって、被検査物の欠陥を検出する
ことを特徴とする被検査物の外観検査方法。
3. An object to be inspected by setting a predetermined inspection line based on the edge line extracted in claim 1 or 2, and analyzing neighboring pixels on the inspection line or adjacent pixels including the inspection line. A method for inspecting the appearance of an object to be inspected, comprising detecting a defect of the object.
【請求項4】請求項1または2において抽出したエッジ
ラインをもとにして識別された被検査物の内部に、その
エッジラインの少なくとも一部と同じ形状をした検査ラ
インを設定し、その検査ライン上の画素を解析すること
によって、被検査物の欠陥を検出することを特徴とする
被検査物の外観検査方法。
4. An inspection line having the same shape as at least a part of the edge line is set inside the inspection object identified based on the edge line extracted in claim 1 or 2, and the inspection is performed. A method for inspecting an appearance of an object to be inspected, wherein a defect on the object to be inspected is detected by analyzing pixels on a line.
【請求項5】請求項4において、 上記検査ライン上にあって、検査画素に近接する画素の
有する濃度の差にもとづいて、被検査物の欠陥を検出す
ることを特徴とする被検査物の外観検査方法。
5. The inspection object according to claim 4, wherein a defect of the inspection object is detected on the inspection line based on a difference in density of pixels adjacent to the inspection pixel. Appearance inspection method.
【請求項6】請求項4において、 上記検査ライン上にあって、検査画素に近接する画素の
有する濃度の差、及び微分絶対値の総和にもとづいて、
被検査物の欠陥を検出することを特徴とする被検査物の
外観検査方法。
6. The method according to claim 4, wherein, based on a difference between densities of pixels adjacent to the inspection pixel on the inspection line and a sum of differential absolute values,
A method for inspecting an appearance of an inspection object, comprising detecting a defect of the inspection object.
【請求項7】請求項1において抽出した被検査物のエッ
ジラインが、一定間隔をもって互いに近接する2本のエ
ッジラインとして抽出された場合において、 その2本のエッジライン間の画素を解析することによっ
て、被検査物の欠陥を検出することを特徴とする被検査
物の外観検査方法。
7. In a case where the edge lines of the object to be inspected extracted in claim 1 are extracted as two edge lines that are close to each other at a fixed interval, a pixel between the two edge lines is analyzed. A defect of the inspection object is detected by the inspection method.
【請求項8】請求項7において、 上記2本のエッジラインの間に存在する領域を検査領域
として、この検査領域内の画素を解析することによっ
て、被検査物の欠陥を検出することを特徴とする被検査
物の外観検査方法。
8. The inspection apparatus according to claim 7, wherein a defect existing in the inspection object is detected by analyzing a pixel in the inspection area using an area existing between the two edge lines as an inspection area. Inspection method for the object to be inspected.
【請求項9】請求項7において、 上記2本のエッジラインの間に、中点検査ラインを設定
して、その中点検査ライン上の画素を解析することによ
って、被検査物の欠陥を検出することを特徴とする被検
査物の外観検査方法。
9. The defect of an object to be inspected according to claim 7, wherein a midpoint inspection line is set between the two edge lines, and pixels on the midpoint inspection line are analyzed. A method for inspecting the appearance of an object to be inspected.
【請求項10】請求項7において、 上記2本のエッジラインの間に、複数の検査ラインを設
定して、その複数の検査ライン上の画素を解析すること
によって、被検査物の欠陥を検出することを特徴とする
被検査物の外観検査方法。
10. A defect of an object to be inspected according to claim 7, wherein a plurality of inspection lines are set between the two edge lines, and pixels on the plurality of inspection lines are analyzed. A method for inspecting the appearance of an object to be inspected.
【請求項11】予め設定された検査領域内で、請求項1
または2において抽出されたエッジラインをもとにして
識別された被検査物の内部に、所定の間隔を有する同じ
方向の複数の検査ラインを設定し、その検査ライン上の
画素を解析することによって欠陥を検出する場合に、 その検査ラインと上記エッジラインが交差する画素にお
いて、その画素の微分絶対値が所定のしきい値より小さ
く、またはその画素の微分方向値が所定の範囲にないと
きは、その検査ラインを上記エッジラインを越え、上記
検査領域の一辺まで延長させ、その延長された検査ライ
ン上の画素を解析することによって被検査物の欠陥を検
出することを特徴とする被検査物の外観検査方法。
11. The method according to claim 1, wherein a predetermined inspection area is set.
Or, by setting a plurality of inspection lines in the same direction having a predetermined interval in the inspection object identified based on the edge line extracted in 2, and analyzing pixels on the inspection line When detecting a defect, at a pixel where the inspection line intersects with the edge line, when the differential absolute value of the pixel is smaller than a predetermined threshold value or the differential direction value of the pixel is not in a predetermined range, An inspection object which extends the inspection line beyond the edge line to one side of the inspection area, and detects a defect of the inspection object by analyzing pixels on the extended inspection line. Appearance inspection method.
【請求項12】予め設定された検査領域内で、請求項1
または2において抽出されたエッジラインをもとにして
識別された被検査物の内部に、ある方向およびその方向
と直交する方向で所定の間隔を有する複数の検査ライン
を格子状に設定し、その検査ライン上の画素を解析する
ことによって欠陥を検出する場合に、 その検査ラインと上記エッジラインが交差する画素にお
いて、その画素の微分絶対値が所定のしきい値より小さ
く、またはその画素の微分方向値が所定の範囲にないと
きは、その検査ラインを上記エッジラインを越え、上記
検査領域の一辺まで延長させ、その延長された検査ライ
ン上の画素を解析することによって被検査物の欠陥を検
出することを特徴とする被検査物の外観検査方法。
12. The method according to claim 1, wherein a predetermined inspection area is set.
Or a plurality of inspection lines having a predetermined interval in a certain direction and a direction orthogonal to the direction are set in a grid inside the inspection object identified based on the edge line extracted in or 2, When a defect is detected by analyzing a pixel on an inspection line, at a pixel where the inspection line and the edge line intersect, the absolute value of the differential of the pixel is smaller than a predetermined threshold value or the differential of the pixel. When the direction value is not within the predetermined range, the inspection line is extended beyond the edge line to one side of the inspection area, and a pixel on the extended inspection line is analyzed to determine a defect of the inspection object. A method for inspecting the appearance of an object to be inspected, characterized by detecting.
【請求項13】請求項1または2において抽出されたエ
ッジラインをもとにして識別された被検査物の内部に、
そのエッジラインと同じ形状の検査ラインを設定し、そ
の検査ラインを位相ずらしさせた後、その位相ずらしさ
せた検査ライン上の画素を解析することによって、被検
査物の欠陥を検出することを特徴とする被検査物の外観
検査方法。
13. An inspection object identified on the basis of the edge line extracted in claim 1 or 2,
After setting an inspection line having the same shape as the edge line, shifting the phase of the inspection line, and analyzing pixels on the inspection line shifted in phase, a defect of the inspection object is detected. Inspection method for the object to be inspected.
【請求項14】請求項1または2において抽出されたエ
ッジラインをもとにして識別された被検査物の内部及び
外部に、そのエッジラインと同じ形状の検査ラインを設
定し、その検査ラインを位相ずらしさせた後、その位相
ずらしさせた検査ライン上の画素を解析することによっ
て、被検査物の欠陥を検出することを特徴とする被検査
物の外観検査方法。
14. An inspection line having the same shape as the edge line is set inside and outside the inspection object identified based on the edge line extracted in claim 1 or 2, and the inspection line is set. A visual inspection method for an object to be inspected, comprising: detecting a defect of the object to be inspected by analyzing pixels on the inspection line shifted in phase after the phase is shifted.
【請求項15】請求項1または2において抽出されたエ
ッジラインもとにして識別された被検査物の内部に、そ
のエッジラインと同じ形状の検査ラインを設定し、その
検査ライン上の画素を中心とした所定のウインドウ内に
ある画素の平均濃度を順次もとめ、その検査ライン上で
所定画素分だけ離隔した画素の平均濃度を比較すること
により、被検査物の欠陥を検出することを特徴とする被
検査物の外観検査方法。
15. An inspection line having the same shape as the edge line is set inside the inspection object identified based on the edge line extracted in claim 1 or 2, and pixels on the inspection line are set. The method is characterized in that the average density of the pixels in a predetermined window centered is sequentially obtained, and the average density of the pixels separated by a predetermined pixel on the inspection line is compared to detect a defect of the inspection object. Inspection method of the inspected object to be inspected.
JP9014405A 1997-01-28 1997-01-28 Method for extracting edge line of check object and appearance check method using this method Pending JPH10208066A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9014405A JPH10208066A (en) 1997-01-28 1997-01-28 Method for extracting edge line of check object and appearance check method using this method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9014405A JPH10208066A (en) 1997-01-28 1997-01-28 Method for extracting edge line of check object and appearance check method using this method

Publications (1)

Publication Number Publication Date
JPH10208066A true JPH10208066A (en) 1998-08-07

Family

ID=11860149

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9014405A Pending JPH10208066A (en) 1997-01-28 1997-01-28 Method for extracting edge line of check object and appearance check method using this method

Country Status (1)

Country Link
JP (1) JPH10208066A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002133424A (en) * 2000-08-29 2002-05-10 Eastman Kodak Co Detecting method of inclination angle and boundary of document
JP2003242482A (en) * 2002-02-14 2003-08-29 Hitachi High-Technologies Corp Inspection method and inspection device for circuit pattern
JP2006138814A (en) * 2004-11-15 2006-06-01 Matsushita Electric Works Ltd Liquid level detection method
JP2008026186A (en) * 2006-07-21 2008-02-07 Matsushita Electric Works Ltd Method and apparatus for detecting gaps by image processing
JP2008261696A (en) * 2007-04-11 2008-10-30 Shibuya Kogyo Co Ltd Measuring method of liquid level
JP2020076606A (en) * 2018-11-06 2020-05-21 Tdk株式会社 Appearance inspection method and manufacturing method of electronic component

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002133424A (en) * 2000-08-29 2002-05-10 Eastman Kodak Co Detecting method of inclination angle and boundary of document
JP2003242482A (en) * 2002-02-14 2003-08-29 Hitachi High-Technologies Corp Inspection method and inspection device for circuit pattern
JP2006138814A (en) * 2004-11-15 2006-06-01 Matsushita Electric Works Ltd Liquid level detection method
JP4517826B2 (en) * 2004-11-15 2010-08-04 パナソニック電工株式会社 Liquid level detection method
JP2008026186A (en) * 2006-07-21 2008-02-07 Matsushita Electric Works Ltd Method and apparatus for detecting gaps by image processing
JP2008261696A (en) * 2007-04-11 2008-10-30 Shibuya Kogyo Co Ltd Measuring method of liquid level
JP2020076606A (en) * 2018-11-06 2020-05-21 Tdk株式会社 Appearance inspection method and manufacturing method of electronic component

Similar Documents

Publication Publication Date Title
JP5086789B2 (en) Optical inspection system
US5537490A (en) Line image processing method
KR20090066212A (en) Defect detection method and defect detection apparatus
CN111539927B (en) Detection method of automobile plastic assembly fastening buckle missing detection device
JP2005121546A (en) Defect inspection method
JP2006113073A (en) System and method for pattern defect inspection
JP3324699B2 (en) Method and apparatus for measuring fiber diameter distribution
JPH10208066A (en) Method for extracting edge line of check object and appearance check method using this method
JP3752849B2 (en) Pattern defect inspection apparatus and pattern defect inspection method
JP2002140713A (en) Image processing method and image processor
JP2000339462A (en) Defect inspection method and defect inspection device
JPH03175343A (en) Method for extracting flaw by inspection appearance
JP3508518B2 (en) Appearance inspection method
JP2686053B2 (en) Defect inspection method by visual inspection
JPH02242382A (en) Defect checking method
JP2710685B2 (en) Defect detection method by visual inspection
JPH1038543A (en) Shape inspection method
KR0130958B1 (en) Line image processing method
JP5346304B2 (en) Appearance inspection apparatus, appearance inspection system, and appearance inspection method
JP2002277409A (en) Inspection device for pattern of printed board
JPH0624014B2 (en) Gray image processing method
JPH0772909B2 (en) Welding condition judgment method by visual inspection
JPH02187651A (en) Image processing method
JP2514727B2 (en) Defect inspection method by visual inspection
JP3048718B2 (en) Vertex detector

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20030401