JPH06174659A - Scratch inspection method by image processing - Google Patents
Scratch inspection method by image processingInfo
- Publication number
- JPH06174659A JPH06174659A JP4327835A JP32783592A JPH06174659A JP H06174659 A JPH06174659 A JP H06174659A JP 4327835 A JP4327835 A JP 4327835A JP 32783592 A JP32783592 A JP 32783592A JP H06174659 A JPH06174659 A JP H06174659A
- Authority
- JP
- Japan
- Prior art keywords
- area
- label
- image
- data
- contour
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Landscapes
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
(57)【要約】
【目的】 塵や汚れと、小さな傷との識別を確実に行え
る画像処理による傷検査方法を提供することを目的とし
ている。
【構成】 画像処理によって各画像の方向性を求めて傷
か否かを判断する傷検査方法において、被検査物の画像
データを処理して検査対象になる2値画像群を求め、こ
れらの2値画像群の各2値画像を構成する画素2に同一
番号を付けたラベル領域5を作り、前記各ラベル領域5
の輪郭を構成する画素2について各隣接画素間の方向で
ある輪郭方向コード3を算出し、前記輪郭方向コード3
の方向分布から前記ラベル領域5の方向を算出し、算出
された方向が近いラベル領域5のデータを融合してデー
タ融合領域を作り、前記データ融合領域の面積等を示す
特徴量によって前記データ融合領域が傷か否かを判断す
ることを特徴とする。
(57) [Abstract] [Purpose] It is an object of the present invention to provide a flaw inspection method by image processing that can reliably distinguish dust and dirt from small scratches. In a flaw inspection method for determining directionality of each image by image processing to determine whether or not it is a flaw, image data of an object to be inspected is processed to obtain a binary image group to be inspected, and these 2 A label area 5 in which the same number is assigned to each pixel 2 forming each binary image of the value image group is created, and each label area 5 is formed.
The contour direction code 3 which is the direction between adjacent pixels is calculated for the pixels 2 forming the contour of
The direction of the label area 5 is calculated from the distribution of the directions, and the data of the label area 5 whose calculated directions are close to each other is created to form a data fusion area, and the data fusion is performed according to the feature amount indicating the area of the data fusion area. It is characterized by determining whether or not the area is scratched.
Description
【0001】[0001]
【産業上の利用分野】本発明は、機械部品等の傷の検査
方法に関し、特に、画像処理による傷検査方法に関する
ものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for inspecting scratches on mechanical parts and the like, and more particularly to a method for inspecting scratches by image processing.
【0002】[0002]
【従来の技術】画像処理による傷検査方法の従来例を図
1、図2に基づいて説明する。2. Description of the Related Art A conventional example of a flaw inspection method by image processing will be described with reference to FIGS.
【0003】図1は傷検査の対象であるシリンダを示
す。図2はシリンダ表面を拡大した場合の傷の2値画像
1を示す。画像処理による傷検査の場合、滑らかな面に
傷が付くと、傷の部分が乱反射するので、斜めから光を
当てて、直接反射光が撮像装置に入射しないような暗視
野照明を行うと、乱反射する傷部分のみが光った状態の
傷の像が得られる。図2の2値画像1は、このようにし
て得られた傷の像である。FIG. 1 shows a cylinder to be inspected for flaws. FIG. 2 shows a binary image 1 of a scratch when the cylinder surface is enlarged. In the case of a scratch inspection by image processing, if a smooth surface is scratched, the scratched portion will be diffusely reflected, so if the light is obliquely applied and dark field illumination is performed so that the reflected light does not directly enter the imaging device, It is possible to obtain an image of a scratch in which only the scratched portion that is diffusely reflected shines. The binary image 1 in FIG. 2 is an image of the scratch thus obtained.
【0004】前記2値画像1を得るには、先ず、テレビ
カメラの入力を、画像入力装置を用いて、画像記憶回路
に記憶させる。In order to obtain the binary image 1, first, the input of the television camera is stored in the image storage circuit by using the image input device.
【0005】次に、2値化する。この2値化とは、或る
閾値よりも大きな濃度を有する画素を‘1’とおき、前
記と同じ閾値以下の濃度を有する画素を‘0’とおくこ
とである。従って、図2を2値化すると、光っている傷
の部分が‘1’、傷以外の部分が‘0’となる。Next, it is binarized. This binarization means that a pixel having a density larger than a certain threshold is set to "1" and a pixel having a density equal to or less than the same threshold is set to "0". Therefore, when FIG. 2 is binarized, the shining scratched portion becomes "1" and the non-scratched portion becomes "0".
【0006】次に、ラベリング処理とリナンバリング処
理とを行う。ラベリング処理とは、‘1’の濃度を有す
る画素の領域と、‘0’の濃度を有する画素の領域とを
領域分割し、‘1’の領域のうち、画素が縦・横・斜め
隣につながっている部分を一かたまりの連結領域とみ
て、これらの連結領域に通し番号を付け、夫々の連結領
域内の画素にその連結領域の前記通し番号を共通に付け
る処理である。そして、前記通し番号を付けた連結領域
をラベル領域という。リナンバリング処理とは、前記通
し番号に抜けが無いように番号を付け換えることであ
る。Next, a labeling process and a renumbering process are performed. The labeling process divides a region of pixels having a density of “1” and a region of pixels having a density of “0” into pixels, and the pixels in the region of “1” are vertically, horizontally, and diagonally adjacent to each other. This is a process in which the connected portions are regarded as a group of connected areas, serial numbers are assigned to these connected areas, and the serial numbers of the connected areas are commonly assigned to the pixels in each connected area. The connected area with the serial number is called a label area. The renumbering process is to renumber the serial numbers so that there is no omission.
【0007】このラベリング処理とリナンバリング処理
とを、図3〜図8のラベリング処理とリナンバリング処
理とのPADチャートに基づいて説明する。The labeling process and the renumbering process will be described with reference to the PAD charts of the labeling process and the renumbering process shown in FIGS.
【0008】図3は、前記ラベリング処理の全体を示
し、A〜Eのステップでラベリング処理とリナンバリン
グ処理とを行うことを示している。FIG. 3 shows the entire labeling process, and shows that the labeling process and the renumbering process are performed in steps A to E.
【0009】図4は、最も上のラインの処理・ステップ
Aを示し、ラスタ順に、即ち、横書きの文章を書く場合
の順番に、最も上のラインから走査し、最初に出現した
濃度‘1’の画素を着目画素とし、これにラベル番号
「1」を付与し、走査を続け、次の濃度‘1’の着目画
素に進み、左隣の画素のラベル番号を調べ、左隣の画素
の濃度が‘1’でラベル番号が「1」を含めて一般的に
nの場合に、左隣と同じラベル番号nを付け、この着目
画素と左隣の画素とがつながっていることを記憶してお
く。左隣の画素の濃度が‘0’でラベル番号が無い場合
には、新しいラベル番号「2」を含めて一般的にn+1
を付ける。FIG. 4 shows the processing / step A of the uppermost line, which scans from the uppermost line in the raster order, that is, in the order of writing a horizontal writing, and the density "1" that appears first. The pixel of interest is the pixel of interest, the label number "1" is assigned to this pixel, scanning is continued, the pixel of interest advancing to the next density of "1" is checked, the label number of the pixel on the left is checked, and the density of the pixel on the left is Is '1' and the label number is generally n including "1", the same label number n as on the left is given, and it is memorized that the pixel of interest and the pixel on the left are connected. deep. When the density of the pixel on the left side is '0' and there is no label number, generally n + 1 including the new label number "2" is included.
Attach.
【0010】図5、図6は、2ライン目以下のラインの
処理・ステップB、ステップCを示し、2ライン目以下
のラインのラスタ走査を続け、到達した濃度‘1’の画
素を着目画素とし、この着目画素について、縦隣・横隣
・斜め隣の8近傍画素の内でそれまでのラスタ走査で走
査済の左隣・右上隣・上隣・左上隣の4画素のラベル番
号を調べ、1種類だけのラベル番号が付与されていれ
ば、その番号を前記着目画素に付与する。2種類以上の
ラベル番号n、m等が付与されていれば、それらの中の
どれかのラベル番号を前記着目画素に付与し、後で、つ
ながった領域のラベル番号を整理統一するためのデータ
として、ラベル番号n、m等の領域が前記着目画素につ
ながっているという情報を記憶しておく。又、それまで
のラスタ走査で走査済の左隣・右上隣・上隣・左上隣の
4画素のラベル番号を調べ、ラベル番号が付与されてい
なければ、その注目画素に新しいラベル番号n+1を付
ける。FIGS. 5 and 6 show the processing of steps B and C of the second and subsequent lines, and the raster scanning of the second and subsequent lines is continued, and the reached pixel of density '1' is the target pixel. For this pixel of interest, check the label number of the 4 pixels on the left side, the upper right side, the upper side, and the upper left side that have been scanned in the raster scan so far among the 8 neighboring pixels vertically, horizontally, and diagonally. If only one type of label number is given, that number is given to the pixel of interest. If two or more types of label numbers n, m, etc. are given, data for giving any one of the label numbers to the pixel of interest and later rearranging and unifying the label numbers of the connected regions. As information, information that the areas of label numbers n and m are connected to the pixel of interest is stored. Also, the label numbers of the four pixels on the left side, the upper right side, the upper side, and the upper left side, which have been scanned by the raster scanning up to that point, are checked. .
【0011】図7は、ラベル番号の整理・ステップDを
示し、総ての画素について上記のラベリング処理が終了
した後、つながったラベル領域のラベル番号を整理統一
するために、つながった領域の画素に付与されている複
数のラベル番号の中の1つに統一する。FIG. 7 shows label number rearrangement and step D. In order to rearrange and unify the label numbers of the connected label areas after the labeling processing is completed for all the pixels, the pixels of the connected areas are unified. It is unified to one of the plurality of label numbers assigned to.
【0012】図8は、ラベル番号のつけ代え・ステップ
Eを示し、必要に応じて、番号に抜けがないように番号
を付け換えるリナンバリング処理を行う。FIG. 8 shows a step of changing the label number and step E, and if necessary, performs a renumbering process for changing the number so that the numbers are not missing.
【0013】上記のようにして、濃度‘1’の各2値画
像のラベリング処理、リナンバリング処理が終了した
後、夫々の番号が付与された2値画像(以後、ラベル領
域という)について、夫々の面積、即ち、含んでいる画
素数を計算する。この場合、ゴミの反射や滑らかである
部分の僅かな乱反射によって、傷以外の部分が光ること
があるが、これらは小さい面積のものなので、これらを
傷と誤認しないために、小さい面積のものは傷ではない
とみなして、前記ラベル領域の内で、面積が大きなもの
のみを傷として抽出する。After the labeling process and the renumbering process of each binary image of the density '1' are completed as described above, each binary image (hereinafter referred to as a label area) assigned with each number is respectively Area, that is, the number of included pixels is calculated. In this case, parts other than scratches may shine due to dust reflection and slight irregular reflection of smooth parts, but these are small areas, so in order not to misidentify these as scratches, small areas are not Considering that it is not a flaw, only the label area having a large area is extracted as a flaw.
【0014】[0014]
【発明が解決しようとする課題】しかし、上記の従来例
では、次のような問題点がある。即ち、被検査物の滑ら
かな面に衝撃で生成した傷の場合、図2の2値画像1に
示すように、複数の飛び飛びに連なった傷として発生す
るので、鋭い傷の場合、1つ1つの傷のラベル領域を取
ると、大きさが小さく、傷か塵か汚れかの判定が困難な
場合がある。However, the above-mentioned conventional example has the following problems. That is, in the case of scratches generated by impact on the smooth surface of the object to be inspected, as shown in the binary image 1 of FIG. Taking the label area of three scratches is small in size, and it may be difficult to judge whether scratches, dust, or dirt.
【0015】本発明は、上記の問題点を解決し、塵や汚
れと、傷との識別を確実に行える画像処理による傷検査
方法を提供することを課題としている。An object of the present invention is to solve the above problems and to provide a flaw inspection method by image processing capable of surely discriminating dust and dirt from a flaw.
【0016】[0016]
【課題を解決するための手段】本発明の画像処理による
傷検査方法は、上記の課題を解決するために、画像処理
によって各画像の方向性を求めて傷か否かを判断する傷
検査方法において、被検査物の画像データを処理して検
査対象になる2値画像群を求め、これらの2値画像群の
各2値画像を構成する画素に同一番号を付けたラベル領
域を作り、前記各ラベル領域の輪郭を構成する画素につ
いて各隣接画素間の方向である輪郭方向コードを算出
し、前記輪郭方向コードの方向分布から前記ラベル領域
の方向を算出し、算出された方向が近いラベル領域のデ
ータを融合してデータ融合領域を作り、前記データ融合
領域の面積等を示す特徴量によって前記データ融合領域
が傷か否かを判断することを特徴とする。In order to solve the above problems, a flaw inspection method by image processing according to the present invention is a flaw inspection method for determining the directionality of each image by image processing to determine whether or not there is a flaw. In the above, the image data of the object to be inspected is processed to obtain a binary image group to be inspected, and a label area is formed by assigning the same number to the pixels forming each binary image of these binary image groups, A contour direction code which is a direction between adjacent pixels is calculated for pixels forming the contour of each label area, the direction of the label area is calculated from the direction distribution of the contour direction code, and the label area in which the calculated direction is close is calculated. It is characterized in that the data fusion area is created by fusing the data of 1. and whether or not the data fusion area is a scratch is judged by a feature amount indicating the area or the like of the data fusion area.
【0017】[0017]
【作用】本発明の画像処理による傷検査方法は、同一要
因で付いた傷は、その傷が複数個に分かれていても、細
長い形状をして、1つの線上、又は、同一方向に並んで
いるものなので、検査対象画像の形状と方向性を判断し
て、傷か否かを判断するものである。そのために、本発
明での画像処理は、被検査物の画像データを処理して2
値画像群を求め、これらの2値画像群の各2値画像を構
成する画素に同一番号を付けたラベル領域を作るところ
までは、従来例と同様であるが、その後に、各ラべル領
域毎に、その領域の形状と方向性を示す輪郭方向コード
を求め、この輪郭方向コードの方向分布から、ラベル領
域の形状と方向性とを演算して、同一方向に長く伸びて
いるラベル領域を選定し、選定したラベル領域のデータ
を融合し、データを融合したデータ融合領域について、
傷か否かを判断している。According to the flaw inspection method by the image processing of the present invention, the flaws caused by the same factor have a long and narrow shape even if the flaws are divided into a plurality of pieces, and are aligned on one line or in the same direction. Therefore, the shape and directionality of the image to be inspected is determined to determine whether or not it is a scratch. Therefore, the image processing according to the present invention is performed by processing the image data of the inspection object.
Up to the step of obtaining the value image group and creating the label area in which the pixels constituting each binary image of these binary image groups are given the same numbers, the procedure is the same as in the conventional example, but after that, each label For each area, a contour direction code indicating the shape and directionality of the area is obtained, the shape and directionality of the label area are calculated from the direction distribution of this contour direction code, and the label area that extends long in the same direction. , The data of the selected label area is fused, and the data fusion area where the data is fused,
It is judged whether it is a scratch or not.
【0018】前記輪郭方向コードとは、前記各ラベル領
域の輪郭を構成する画素についての各隣接画素間の方向
なので、1つのラベル領域について求められた輪郭方向
コード群が或る方向に揃っている場合には、そのラベル
領域はその或る方向に長く伸びていることになる。Since the contour direction code is the direction between adjacent pixels of the pixels forming the contour of each label area, the contour direction code group obtained for one label area is aligned in a certain direction. In that case, the label area will be elongated in that direction.
【0019】従って、本発明では、前記各ラベル領域の
輪郭方向コードを求め、各ラベル領域毎に輪郭方向コー
ドの方向分布を算出し、この方向分布からそのラベル領
域が長く伸びている方向を算出し、算出された方向が近
いラベル領域を1つの傷を構成している可能性ありとし
て、そのデータを融合してデータ融合領域を作り、この
データ融合領域の面積等の特徴量によって前記データ融
合領域が傷か否かを判断する。Therefore, in the present invention, the contour direction code of each label area is obtained, the direction distribution of the contour direction code is calculated for each label area, and the direction in which the label area extends long is calculated from this direction distribution. Then, assuming that the label areas whose calculated directions are close to each other may constitute one flaw, the data is fused to create a data fusion area, and the data fusion is performed according to the feature amount such as the area of this data fusion area. Determine if the area is scratched.
【0020】[0020]
【実施例】本発明の1実施例方法を図1〜図14に基づ
いて説明する。この場合、図1〜図8は従来例と共通で
ある。DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment method of the present invention will be described with reference to FIGS. In this case, FIGS. 1 to 8 are common to the conventional example.
【0021】本発明の画像処理による傷検査方法は、検
査対象物の画像処理において、従来例と同様にして行わ
れるラベリング処理が終了した2値画像、即ち、ラベル
領域について、各ラベル領域の輪郭方向コードを求め、
この輪郭方向コードの方向分布によって、ラベル領域の
形状がどの方向に伸びているかを算出し、伸びていると
算出された方向が近いラベル領域のデータを融合してデ
ータ融合ラベル領域を作り、前記データ融合ラベル領域
の面積等の特徴量によって前記データ融合ラベル領域が
傷か否かを判断している。In the flaw inspection method by image processing according to the present invention, in the image processing of the inspection object, the labeling processing performed in the same manner as the conventional example is finished, that is, the binary image, that is, the label area, the contour of each label area. Ask for direction code,
The direction distribution of the contour direction code is used to calculate in which direction the shape of the label area extends, and the data of the label area in which the direction that is calculated to be elongated is fused to create a data fusion label area. Whether or not the data fusion label area is scratched is determined based on the feature amount such as the area of the data fusion label area.
【0022】本実施例では、先ず、図1に示すシリンダ
の表面をテレビカメラで撮像し、得られた画像データを
画像入力装置を用いて画像記憶回路に記憶させ、2値化
処理して図2に示すような2値画像1が多数ある画面を
作る。その後に、従来例と同様に、図3〜図8に示すよ
うにして、前記画面内の多数の2値画像をラベリング処
理と、リナンバリング処理して、多数のラベル領域を得
るが、この図3〜図8の処理は、前記の従来例の場合と
同様なので、説明を省略する。In the present embodiment, first, the surface of the cylinder shown in FIG. 1 is imaged by a television camera, the obtained image data is stored in an image storage circuit using an image input device, and binarized. A screen having a large number of binary images 1 as shown in 2 is created. After that, as in the conventional example, as shown in FIGS. 3 to 8, a large number of binary images in the screen are labeled and renumbered to obtain a large number of label areas. The processing of FIGS. 3 to 8 is the same as in the case of the above-described conventional example, and thus the description thereof is omitted.
【0023】次に、上記の多数のラベル領域について、
輪郭方向コードを求めるが、この輪郭方向コードの定義
と求め方は次の通りである。Next, regarding the above-mentioned many label areas,
The contour direction code is obtained. The definition and the method of obtaining the contour direction code are as follows.
【0024】図9は、輪郭方向コード3とその求め方を
説明するものである。画素2はラベル領域5を構成する
画素であり、輪郭方向コード3は、前記画素2の中で、
ラベル領域5の輪郭を構成し且つ隣接する画素2間の特
定方向回りの輪郭ベクトルである。FIG. 9 explains the contour direction code 3 and how to obtain it. Pixel 2 is a pixel that constitutes label area 5, and contour direction code 3 is
The contour vector is a contour vector that constitutes the contour of the label area 5 and that is between adjacent pixels 2 around a specific direction.
【0025】図9に基づいて、前記のラベリング処理が
終了した多数のラベル領域5がある画面から、輪郭方向
コード3を求める方法を説明する。A method for obtaining the contour direction code 3 from a screen having a large number of label areas 5 for which the labeling processing has been completed will be described with reference to FIG.
【0026】図9において、先ず、横書き文章を書くと
きの順序であるラスタ方向に、画面を走査し、最初に到
達したラベル領域5内の画素P1を注目画素として、こ
の注目画素の上下斜め隣の8近傍の近傍画素を左隣から
時計まわりに調べて、これらの近傍画素の画像濃度が
‘0’から‘1’に変化した近傍画素を画素P2とすれ
ば、画素P1を起点とし画素P2を終点とするベクトル
が輪郭方向コード3である。In FIG. 9, first, the screen is scanned in the raster direction, which is the order in which a horizontal writing sentence is written, and the pixel P1 in the label area 5 that has arrived first is set as the target pixel. If eight adjacent pixels in the vicinity of 8 are examined clockwise from the left, and the adjacent pixels whose image densities of these adjacent pixels have changed from “0” to “1” are defined as pixel P2, pixel P1 is set as the starting point and pixel P2 is set as the starting point. The vector whose end point is is the contour direction code 3.
【0027】次に、画素P2を注目画素として、この注
目画素から見て画素P1から時計まわりに近傍画素を調
べて、これらの近傍画素の画像濃度が‘0’から‘1’
に変化した近傍画素を画素P3とする。以下、同様にし
て、画素P4、画素P5・・・・を求め、もとの画素P
1に戻るまで続ける。このようにして、ラベル領域5の
輪郭を、時計まわりに輪郭方向コード3でつなぐことが
できる。Next, with the pixel P2 as the target pixel, the neighboring pixels are examined clockwise from the pixel P1 when viewed from the target pixel, and the image densities of these neighboring pixels are from "0" to "1".
The neighboring pixel that has changed to is referred to as a pixel P3. Similarly, the pixel P4, the pixel P5, ...
Continue until you return to 1. In this way, the contours of the label area 5 can be connected clockwise by the contour direction code 3.
【0028】以上のようにして求めた輪郭方向コードに
は、上下左右斜めの8方向があるが、180°逆の方向
を同じ方向とすると、4方向が存在することになる。The contour direction code obtained as described above has eight directions of up, down, left, right, and diagonal, but if the directions opposite 180 ° are the same direction, there are four directions.
【0029】本実施例では、次に、輪郭方向コード3の
方向分布を求める。図10は、各ラベル領域5毎の、輪
郭方向コード3の方向分布を示す方向分布グラフ4で、
方向分布グラフ4は、各方向の度数で構成される。従っ
て、ラベル領域5は、前記度数が大きい方向に長く伸び
ていることになり、図10のデータから、度数が最大の
方向を求めれば、その方向が、ラベル領域5が伸びてい
る方向になり、図10の方向分布によって、ラベル領域
5の形状と方向性が判る。上記の輪郭方向コード3の演
算結果と、方向分布データを記憶しておく。In the present embodiment, next, the direction distribution of the contour direction code 3 is obtained. FIG. 10 is a direction distribution graph 4 showing the direction distribution of the contour direction code 3 for each label area 5.
The direction distribution graph 4 is composed of frequencies in each direction. Therefore, the label area 5 extends long in the direction in which the frequency is large, and if the direction with the maximum frequency is obtained from the data in FIG. 10, that direction becomes the direction in which the label area 5 extends. , The shape and directionality of the label area 5 can be known. The calculation result of the contour direction code 3 and the direction distribution data are stored.
【0030】本実施例では、次に、上記の記憶されたデ
ータを使用して、伸びていると判断される方向が近いラ
ベル領域5のデータを融合してデータ融合ラベル領域を
作るために、クラスタリング処理を行う。In the present embodiment, next, using the above-mentioned stored data, the data in the label area 5 whose direction is judged to be elongated is fused to create a data fusion label area, Perform clustering processing.
【0031】クラスタリング処理は、図11〜図13の
クラスタリングのPADチャートに示すように行う。The clustering process is performed as shown in the PAD chart of clustering in FIGS.
【0032】図11は、前記クラスタリング処理の全体
を示し、上記の記憶されたデータからなる参照テーブル
から、データを読み出し、A、Bのステップでクラスタ
リングを行うことを示している。FIG. 11 shows the entire clustering process, and shows that the data is read from the reference table composed of the stored data and the clustering is performed in steps A and B.
【0033】図12は、ラベル領域のデータを融合する
ラベル領域のデータ融合処理・ステップAを示し、前記
の輪郭方向コードの方向分布が求められた多数のラベル
領域5の全組合せについて、前記輪郭方向コードの最大
分布方向が同一なラベル領域5の組合せを選定し、選定
したラベル領域のデータを融合する。FIG. 12 shows the label area data merging process / step A for merging the label area data, and the contours of all combinations of the label areas 5 for which the direction distribution of the contour direction code is obtained. A combination of label areas 5 having the same maximum distribution direction of direction codes is selected, and the data of the selected label areas are fused.
【0034】図13は、データ融合ラベル領域の番号に
抜けがないように番号を付け替えるリナンバリング処理
・Bステップを示す。これは、前記の最大分布方向が同
一なラベル領域5が有する複数のラベル番号を、その中
の1つに合わせる処理である。FIG. 13 shows a renumbering process / step B in which the numbers in the data fusion label area are renumbered so that there is no omission. This is a process of matching a plurality of label numbers in the label area 5 having the same maximum distribution direction with one of them.
【0035】この具体的作業を、図14に基づいて説明
する。図14(a)はリナンバリング処理前のデータを
示し、図14(b)は0、1にリナンバリングされた後
を示す。1と5とは同じナンバーが付いているので、1
に統合される。0と2とは同じナンバーが付いているの
で、0に統合され、3、4、5は1、2と異なるナンバ
ーが付いているが、連続しているとの記憶があるので、
0に統合される。This concrete work will be described with reference to FIG. FIG. 14A shows data before the renumbering process, and FIG. 14B shows data after being renumbered to 0 and 1. 1 and 5 have the same number, so 1
Integrated into. Since 0 and 2 have the same number, they are integrated into 0, and 3, 4, 5 have different numbers from 1 and 2, but I remember that they are consecutive,
0 is integrated.
【0036】本実施例では、上記のクラスタリング処理
とリナンバリング処理とを行った後、即ち、その方向性
による判断でデータを融合されたデータ融合ラベル領域
について、その面積の大小によって前記融合ラベル領域
が傷か否かを判断する。In this embodiment, after the above-mentioned clustering process and renumbering process are performed, that is, regarding the data fusion label region in which data is fused by the judgment based on the direction, the fusion label region is determined according to the size of the area. To determine if it is scratched.
【0037】このようにすると、1つの原因で付いた
が、その付いた傷が複数の傷に分離し、1つ1つの傷が
小さな場合にも、これらの分離した小さな傷のデータを
融合し、塵や汚れの付着と区別して判断できるので、正
確な傷の検査を行える。In this way, although it was caused by one cause, the scratches attached to it were separated into a plurality of scratches, and even when each scratch was small, the data of these separated small scratches were merged. Since it can be distinguished from the adhesion of dust or dirt, it can be accurately inspected for scratches.
【0038】[0038]
【発明の効果】従来例の画像処理による傷検査方法で
は、検査対象画像が、衝撃によって付いた傷であるか否
かを判断する場合、検査対象画像の大きさのみを用いて
判断しているので、塵や汚れの付着による小さな画像と
小さな傷の小さな画像との区別が困難であったが、本発
明では、輪郭方向コードによって、画像が長く伸びてい
る方向を認識し、分離している画像の中から、同一方向
に長く伸びた複数の小さな画像を抽出し、これらの画像
のデータを融合して、傷であるか否かを判断するので、
小さく分離した傷について、従来例よりも正確に傷か否
かの判断ができるという効果を奏する。According to the flaw inspection method by image processing of the conventional example, when it is determined whether or not the image to be inspected is a flaw caused by an impact, it is determined using only the size of the image to be inspected. Therefore, it is difficult to distinguish between a small image due to adhesion of dust or dirt and a small image with small scratches, but in the present invention, the direction in which the image is elongated is recognized and separated by the contour direction code. From the images, multiple small images that are elongated in the same direction are extracted, and the data of these images are fused to determine whether or not it is a scratch.
The present invention has an effect that it is possible to more accurately determine whether or not a scratch separated into smaller pieces is a scratch as compared with the conventional example.
【図1】被検査物のシリンダの斜視図である。FIG. 1 is a perspective view of a cylinder of an object to be inspected.
【図2】図1の傷の画像である。FIG. 2 is an image of the scratch of FIG.
【図3】ラベリング処理のPADチャートである。FIG. 3 is a PAD chart of labeling processing.
【図4】ラベリング処理のPADチャートである。FIG. 4 is a PAD chart of labeling processing.
【図5】ラベリング処理のPADチャートである。FIG. 5 is a PAD chart of labeling processing.
【図6】ラベリング処理のPADチャートである。FIG. 6 is a PAD chart of labeling processing.
【図7】ラベリング処理のPADチャートである。FIG. 7 is a PAD chart of labeling processing.
【図8】ラベリング処理のPADチャートである。FIG. 8 is a PAD chart of labeling processing.
【図9】本発明の輪郭方向コードの構成図である。FIG. 9 is a configuration diagram of a contour direction code of the present invention.
【図10】本発明の輪郭方向コードの方向分布図であ
る。FIG. 10 is a direction distribution diagram of contour direction codes according to the present invention.
【図11】本発明の実施例のクラスタリング処理のPA
Dチャートである。FIG. 11 is a PA of clustering processing according to the embodiment of this invention.
It is a D chart.
【図12】本発明の実施例のクラスタリング処理のPA
Dチャートである。FIG. 12 is a PA of clustering processing according to the embodiment of this invention.
It is a D chart.
【図13】本発明の実施例のクラスタリング処理のPA
Dチャートである。FIG. 13 is a PA of clustering processing according to the embodiment of this invention.
It is a D chart.
【図14】本発明の実施例のリナンバリング処理の動作
図である。FIG. 14 is an operation diagram of a renumbering process according to the embodiment of this invention.
1 2値画像 2 画素 3 輪郭方向コード 4 方向分布グラフ 1 Binary image 2 Pixel 3 Contour direction code 4 Direction distribution graph
Claims (1)
て傷か否かを判断する傷検査方法において、被検査物の
画像データを処理して検査対象になる2値画像群を求
め、これらの2値画像群の各2値画像を構成する画素に
同一番号を付けたラベル領域を作り、前記各ラベル領域
の輪郭を構成する画素について各隣接画素間の方向であ
る輪郭方向コードを算出し、前記輪郭方向コードの方向
分布から前記ラベル領域の方向を算出し、算出された方
向が近いラベル領域のデータを融合してデータ融合領域
を作り、前記データ融合領域の面積等を示す特徴量によ
って前記データ融合領域が傷か否かを判断することを特
徴とする画像処理による傷検査方法。1. A flaw inspection method for determining directionality of each image by image processing to determine whether or not there is a flaw, wherein image data of an object to be inspected is processed to obtain a binary image group to be inspected, and A label area in which pixels forming each binary image of the binary image group are assigned the same number, and a contour direction code which is a direction between adjacent pixels is calculated for the pixels forming the contour of each label area. , The direction of the label area is calculated from the direction distribution of the contour direction code, and the data of the label areas whose calculated directions are close to each other is created to create a data fusion area, and the data fusion area is characterized by a feature amount indicating the area or the like. A flaw inspection method by image processing, wherein it is determined whether or not the data fusion area is a flaw.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP4327835A JP3042941B2 (en) | 1992-12-08 | 1992-12-08 | Scratch inspection method by image processing |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP4327835A JP3042941B2 (en) | 1992-12-08 | 1992-12-08 | Scratch inspection method by image processing |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH06174659A true JPH06174659A (en) | 1994-06-24 |
| JP3042941B2 JP3042941B2 (en) | 2000-05-22 |
Family
ID=18203518
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP4327835A Expired - Fee Related JP3042941B2 (en) | 1992-12-08 | 1992-12-08 | Scratch inspection method by image processing |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3042941B2 (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010032332A (en) * | 2008-07-28 | 2010-02-12 | Panasonic Electric Works Co Ltd | Method and device for visual inspection |
| JP2010032334A (en) * | 2008-07-28 | 2010-02-12 | Panasonic Electric Works Co Ltd | Method and device for visual inspection of molded article |
| CN106990119A (en) * | 2017-04-27 | 2017-07-28 | 中科慧远视觉技术(洛阳)有限公司 | The vision detection system and detection method of a kind of white glass surface defect of automatic detection |
-
1992
- 1992-12-08 JP JP4327835A patent/JP3042941B2/en not_active Expired - Fee Related
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010032332A (en) * | 2008-07-28 | 2010-02-12 | Panasonic Electric Works Co Ltd | Method and device for visual inspection |
| JP2010032334A (en) * | 2008-07-28 | 2010-02-12 | Panasonic Electric Works Co Ltd | Method and device for visual inspection of molded article |
| CN106990119A (en) * | 2017-04-27 | 2017-07-28 | 中科慧远视觉技术(洛阳)有限公司 | The vision detection system and detection method of a kind of white glass surface defect of automatic detection |
Also Published As
| Publication number | Publication date |
|---|---|
| JP3042941B2 (en) | 2000-05-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0195161B1 (en) | Apparatus for automatically inspecting objects and identifying or recognizing known and unknown portions thereof, including defects and the like and method | |
| US4876457A (en) | Method and apparatus for differentiating a planar textured surface from a surrounding background | |
| JPH0160767B2 (en) | ||
| JP3409670B2 (en) | Appearance inspection method and apparatus | |
| JP4104213B2 (en) | Defect detection method | |
| JP3042941B2 (en) | Scratch inspection method by image processing | |
| JP3042939B2 (en) | Scratch inspection method by image processing | |
| JP3368644B2 (en) | Wiring pattern inspection apparatus and method | |
| JP2000339462A (en) | Defect inspection method and defect inspection device | |
| JPH05281154A (en) | Pattern defect inspection system | |
| JP3309530B2 (en) | Wiring pattern inspection equipment | |
| JPH08190633A (en) | Defect judging method | |
| KR0130948B1 (en) | Damage checking method by image processing | |
| JP5033077B2 (en) | Method and apparatus for inspecting appearance of molded product | |
| JP2710685B2 (en) | Defect detection method by visual inspection | |
| JP2002267619A (en) | Defect inspection method and device | |
| JP2000046748A (en) | Method and apparatus for inspecting conductive pattern and method for manufacturing multilayer substrate | |
| JPH0723845B2 (en) | Defect detection method | |
| JPH09113467A (en) | Method for deciding defect | |
| JP2676990B2 (en) | Wiring pattern inspection equipment | |
| JP2002083303A (en) | Image processing apparatus and image processing method | |
| JPS59196446A (en) | Defect recognizing device | |
| JP2002314982A (en) | Method for detecting defect | |
| JP2874402B2 (en) | Circular container inner surface inspection device | |
| JPH02187652A (en) | Image processing method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |