JP5405245B2 - Image inspection method and image inspection apparatus - Google Patents

Image inspection method and image inspection apparatus Download PDF

Info

Publication number
JP5405245B2
JP5405245B2 JP2009208135A JP2009208135A JP5405245B2 JP 5405245 B2 JP5405245 B2 JP 5405245B2 JP 2009208135 A JP2009208135 A JP 2009208135A JP 2009208135 A JP2009208135 A JP 2009208135A JP 5405245 B2 JP5405245 B2 JP 5405245B2
Authority
JP
Japan
Prior art keywords
image
divided
defective
images
reference value
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.)
Active
Application number
JP2009208135A
Other languages
Japanese (ja)
Other versions
JP2011058926A (en
Inventor
直樹 水野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ricoh Elemex Corp
Original Assignee
Ricoh Elemex Corp
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 Ricoh Elemex Corp filed Critical Ricoh Elemex Corp
Priority to JP2009208135A priority Critical patent/JP5405245B2/en
Publication of JP2011058926A publication Critical patent/JP2011058926A/en
Application granted granted Critical
Publication of JP5405245B2 publication Critical patent/JP5405245B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、例えば検査対象とされる製品の欠陥の有無を判定するために、その製品の外観を示した被検査画像の良否の判定を行う画像検査方法及び画像検査装置に関する。   The present invention relates to an image inspection method and an image inspection apparatus for determining whether or not an image to be inspected that shows the appearance of a product in order to determine whether there is a defect in the product to be inspected, for example.

従来、検査対象とされる製品の欠陥の有無を、その製品の外観を撮影して、その撮影画像である被検査画像から判定する方法が知られている。その方法の一つとして、マハラノビス・タグチ法を用いて被検査画像の良否を検査する方法がある。このマハラノビス・タグチ法による画像検査の基本的な進め方は以下の通りである。   2. Description of the Related Art Conventionally, a method is known in which the presence or absence of defects in a product to be inspected is determined from an image to be inspected by photographing the appearance of the product. As one of the methods, there is a method for inspecting the quality of an inspected image using the Mahalanobis Taguchi method. The basic procedure for image inspection by the Mahalanobis Taguchi method is as follows.

1)最も正常な状態にある複数の製品画像から、その状態を表す複数の項目に従い特徴量を抽出する。このように、正常品や良品のデータ群を基準空間と呼び、マハラノビス・タグチ法で判定、診断、予測を行う際の基準となる。
2)各項目ごとに算出した特徴量の平均値と標準偏差を用いて各特徴量を規準化する。
3)規準化した特徴量間の全ての相関を算出して、相関行列を作成する。
4)規準化した特徴量と、相関行列の逆行列を用いて、最も正常な状態にある製品の集団である基準空間のマハラノビス距離を算出する。なお、この基準空間のマハラノビス距離の平均値は約1となる。
5)状態が不明である製品画像(被検査画像)に対して、上記と同様の手順を用いて、マハラノビス距離を算出する。
6)予め設定したハマラノビス距離の閾値(良否判定基準値)に基づき、状態が不明な製品の状態を判定する。マハラノビス・タグチ法では、異常の程度が大きくなるほどマハラノビス距離が大きくなるので、基準値よりマハラノビス距離が大きくなる場合、その製品は異常な状態(不良)にあると判定をする。このように、基準空間に属さないもののデータを信号空間と呼び、そのマハラノビス距離の大小で、そのものの状態を判定、診断、予測する。
1) Feature values are extracted from a plurality of product images in the most normal state according to a plurality of items representing the state. In this way, a data group of normal products and non-defective products is referred to as a reference space, and becomes a reference when performing determination, diagnosis, and prediction by the Mahalanobis Taguchi method.
2) Each feature value is normalized using the average value and standard deviation of the feature values calculated for each item.
3) Calculate all correlations between the standardized feature quantities and create a correlation matrix.
4) The Mahalanobis distance of the reference space, which is a group of products in the most normal state, is calculated using the normalized feature quantity and the inverse matrix of the correlation matrix. The average value of the Mahalanobis distance in this reference space is about 1.
5) The Mahalanobis distance is calculated using the same procedure as above for the product image (inspected image) whose state is unknown.
6) Based on a preset threshold value of hamaranobis distance (good / bad determination reference value), the state of the product whose state is unknown is determined. In the Mahalanobis Taguchi method, the Mahalanobis distance increases as the degree of abnormality increases. Therefore, if the Mahalanobis distance becomes larger than the reference value, it is determined that the product is in an abnormal state (defective). In this way, data that does not belong to the reference space is called a signal space, and its state is determined, diagnosed, and predicted based on the Mahalanobis distance.

このように、マハラノビス・タグチ法は多変量解析の手法を用いて製品の状態を判定するので、作業員が目視で製品の状態を判定する目視検査と同様に、様々な情報(特徴量)を基にした総合的な判定を行うことができる。そして、その良否を精度よく検査するために、各種方法が提案されている(例えば、特許文献1、2参照)。   In this way, the Mahalanobis-Taguchi method uses a multivariate analysis method to determine the state of a product, so that various information (features) can be obtained in the same manner as a visual inspection in which an operator visually determines the state of a product. Comprehensive judgment based on this can be made. Various methods have been proposed in order to accurately inspect the quality (for example, see Patent Documents 1 and 2).

例えば特許文献1には、被検査画像全体の良否を精度良く検査するために、マハラノビス距離の算出に使用する画像特徴量として、輝度、濃度等の一次パラメータや、一次パラメータの平均値や標準偏差等の二次パラメータではなく、被検査画像全体の輝度分布などの特徴量分布を用いている。これは、被検査画像全体の情報を含んだ特徴量に基づいてマハラノビス距離を算出することにより、被検査画像の一部の特徴量で検査するときよりも、被検査画像全体の良否を精度良く検査できることを狙ったものである。   For example, Patent Document 1 discloses that primary parameters such as luminance and density, average values of primary parameters, and standard deviations are used as image feature amounts used for calculation of Mahalanobis distance in order to accurately inspect the quality of the entire image to be inspected. A feature quantity distribution such as a luminance distribution of the entire image to be inspected is used instead of a secondary parameter such as. This is because the Mahalanobis distance is calculated based on the feature amount including the information on the entire image to be inspected, so that the quality of the entire image to be inspected can be determined more accurately than when inspecting with some feature amounts of the image to be inspected. The aim is to be able to inspect.

また、特許文献2には、被検査画像を小領域に分割し、各小領域から特徴量を抽出し、抽出した特徴量と所定の特徴量基準値との統計的距離尺度(マハラノビス距離等)を用いて被検査画像の良否を検査する方法であって、分割する小領域の大きさを複数レベル設ける方法が記載されている。これによって、局所的な欠陥だけでなく大域的な欠陥も精度よく検出できることを狙ったものである。   Patent Document 2 discloses that an image to be inspected is divided into small regions, feature amounts are extracted from each small region, and a statistical distance measure (Mahalanobis distance, etc.) between the extracted feature amount and a predetermined feature amount reference value. Describes a method for inspecting the quality of an image to be inspected by using a plurality of sizes of small areas to be divided. This aims at accurately detecting not only local defects but also global defects.

特開2005−252451号公報JP-A-2005-252451 特開2007−132757号公報JP 2007-132757 A

しかしながら、特許文献1に記載の方法は、輝度分布を基にマハラノビス距離を算出するため、この方法を製品の外観検査、特に外観の変動が大きい製品中の欠陥や、外観中で特徴量の急峻な変化がある製品中の欠陥の外観検査に使用した場合、欠陥が持つ特徴量がノイズに隠れてしまい、精度良く検査できないという問題点があった。   However, since the method described in Patent Document 1 calculates the Mahalanobis distance based on the luminance distribution, this method is used for the appearance inspection of products, particularly defects in products with a large change in appearance and steep feature amounts in the appearance. When used for the appearance inspection of defects in products with various changes, there is a problem that the feature quantity of the defects is hidden in the noise and cannot be inspected with high accuracy.

また、特許文献2に記載の方法は、欠陥があるにも関わらず、マハラノビス距離が小さいために欠陥の判定がされない場合があり、そのために、マハラノビス距離による判定の他に第2の判定を追加している。そのために、検査の効率が低下するという問題点があった。   In addition, although the method described in Patent Document 2 has a defect, the Mahalanobis distance may not be determined because the Mahalanobis distance is small. Therefore, a second determination is added in addition to the determination based on the Mahalanobis distance. doing. For this reason, there is a problem that the efficiency of the inspection is lowered.

本発明は上記問題点に鑑みてなされたものであり、被検査画像の良否を精度よく、かつ効率的に検査することができる画像検査方法及び画像検査装置を提供することを課題とする。   The present invention has been made in view of the above problems, and an object thereof is to provide an image inspection method and an image inspection apparatus capable of inspecting the quality of an image to be inspected accurately and efficiently.

上記課題を解決するために、本発明は、画像の良否の判定を行う画像検査方法であって、
良品画像を複数の画像に分割する良品画像分割ステップと、
その良品画像分割ステップで分割した画像である良品分割画像ごとにマハラノビス距離を算出する算出ステップと、
その算出ステップで算出したマハラノビス距離に基づいて、被検査画像の良否判定の基準となるマハラノビス距離である良否判定基準値を前記良品分割画像ごとに設定する基準値設定ステップと、
被検査画像を前記良品画像の分割と同じ分割となるように複数の画像に分割する分割ステップと、
その分割ステップで分割した画像である被検査分割画像ごとに、マハラノビス距離からなる信号空間を作成する作成ステップと、
前記被検査分割画像のマハラノビス距離を、該被検査分割画像に対応する前記良品分割画像に設定された前記良否判定基準値と比較することによって、前記被検査分割画像ごとで良否判定を行う良否判定ステップと、を含み、
前記良品画像分割ステップでは、複数の前記良品画像を互いに異なるサイズに分割することで、複数種のサイズの前記良品分割画像を得るようにし、
前記基準値設定ステップでは、前記複数種のサイズごとに、前記良品分割画像ごとの前記良否判定基準値を設定し、
前記良否判定ステップは、前記良否判定として、前記比較結果に応じて、前記被検査分割画像を良/不良と判定する他に、良又は不良と確定しないで前記被検査分割画像に欠陥が存在する可能性があるとする暫定不良と判定するステップであり、
前記暫定不良と判定された前記被検査分割画像があった場合、その被検査分割画像を前記複数種のサイズの一つと同じサイズとなるように更に複数の画像に分割する再分割ステップと、
その再分割ステップで分割した画像である暫定不良分割画像の各々に対して、再度、マハラノビス距離からなる信号空間を作成する再作成ステップと、
前記暫定不良分割画像のマハラノビス距離を、該暫定不良分割画像に対応する前記良品分割画像に設定された前記良否判定基準値と比較することによって、前記暫定不良分割画像ごとで前記良否判定を再度行う再良否判定ステップと、
を含み、
その再良否判定ステップにて新たに前記暫定不良と判定された前記暫定不良分割画像があった場合には、良又は不良と確定できるまで、その暫定不良分割画像に対して、前記再分割ステップ、前記再作成ステップ及び前記再良否判定ステップを繰り返し実行することを特徴とする。
In order to solve the above problems, the present invention is an image inspection method for determining whether an image is good or bad,
A non-defective image dividing step for dividing the non-defective image into a plurality of images;
A calculation step of calculating a Mahalanobis distance for each good product divided image that is an image divided in the good product image dividing step;
Based on the Mahalanobis distance calculated in the calculation step, a reference value setting step for setting a pass / fail determination reference value that is a Mahalanobis distance that is a reference for pass / fail determination of an image to be inspected for each of the non-defective product divided images;
A division step of dividing the image to be inspected into a plurality of images so as to be the same division as the division of the non-defective image ;
A creation step for creating a signal space consisting of Mahalanobis distances for each inspected divided image that is an image divided in the division step;
The Mahalanobis distance of the object to be inspected divided picture images, by comparing with the non-defective dividing the quality determination reference value set in the image corresponding to said inspection image segment quality performing quality determination in each of the inspection divided images and the determination step, only including,
In the non-defective image dividing step, the non-defective product divided images having a plurality of sizes are obtained by dividing the non-defective images into different sizes.
In the reference value setting step, for each of the plurality of types of sizes, the pass / fail judgment reference value for each non-defective product divided image is set,
In the pass / fail judgment step, as the pass / fail judgment, in addition to determining the inspected divided image as good / bad according to the comparison result, a defect exists in the inspected divided image without being determined as good or bad. It is a step of determining that there is a possibility of provisional failure,
A subdivision step for further dividing the inspected divided image into a plurality of images so as to be the same size as one of the plurality of sizes, when there is the inspected divided image determined to be the provisional failure;
Re-creating step for creating a signal space consisting of Mahalanobis distance again for each provisional defective divided image that is an image divided in the re-dividing step;
The Mahalanobis distance of the tentative defect divided picture images, by comparing the said quality determination reference value set in the non-defective divided images corresponding to the provisional failure divided image, the quality determination in each of the interim defect divided images again A re-defective determination step to be performed;
Including
If there is the temporary defective divided image newly determined as the provisional defect in the re-defective determination step, the re-dividing step is performed on the temporary defective divided image until it can be determined as good or defective. The re-creation step and the re-quality determination step are repeatedly executed.

これによれば、被検査画像を分割した分割画像ごとで良否判定をしているので、欠陥が持つ特徴量がノイズに隠れてしまうことを低減でき精度良く検査するこができる。また、良否判定ステップにおいて、良又は不良と確定しないで被検査分割画像に欠陥が存在する可能性があるとする暫定不良と判定する場合を設けているので、不良であるにもかかわらず良と判定したり、良であるにもかかわらず不良であると判定したりする誤判定を防止できる。そして、暫定不良と判定された場合には、その判定された分割画像について、良又は不良と確定できるまで、小さなサイズに画像を分割して良否判定を繰り返し行っているので、元の画像サイズでの良否判定のときよりも、精度良く良否判定をすることができる。また、暫定不良と判定された分割画像について、再分割をして良否判定を再度行っているので、被検査分割画像のサイズを当初から小さなサイズにする必要がない。さらに、マハラノビス距離で精度良く良否判定ができるので、マハラノビス距離による判定の他に第2の判定を追加する必要がない。そのため、被検査画像の良否を効率良く検査することができる。   According to this, since the pass / fail determination is performed for each divided image obtained by dividing the image to be inspected, it is possible to reduce that the feature amount of the defect is hidden in the noise and to inspect with high accuracy. In addition, in the pass / fail judgment step, there is provided a case in which it is determined that there is a possibility that a defect exists in the inspected divided image without being determined to be good or bad. It is possible to prevent a misjudgment such as a judgment or a judgment that the judgment is bad despite being good. Then, when it is determined that the provisional failure, the image is divided into small sizes and the pass / fail determination is repeated until the determined divided image is determined to be good or bad. Therefore, it is possible to perform the quality determination with higher accuracy than in the quality determination. Further, since the divided image determined to be provisional defective is re-divided and the pass / fail determination is performed again, it is not necessary to reduce the size of the divided image to be inspected from the beginning. Furthermore, since the quality determination can be made with high accuracy based on the Mahalanobis distance, it is not necessary to add a second determination in addition to the determination based on the Mahalanobis distance. Therefore, it is possible to efficiently inspect the quality of the inspected image.

また、本発明の画像検査方法において、前記基準値設定ステップでは、前記良否判定基準値として、第一の基準値とその第一の基準値よりも大きな第二の基準値の2つの基準値を前記良品分割画像ごとに設定し、
前記良否判定ステップ及び前記再良否判定ステップは、前記良否判定の対象となる分割画像のマハラノビス距離が、対応する前記良品分割画像に設定された前記第一の基準値よりも小さい場合にはその分割画像は良として判定し、その分割画像のマハラノビス距離が、対応する前記良品分割画像に設定された前記第二の基準値よりも大きい場合にはその分割画像は不良として判定し、その分割画像のマハラノビス距離が、前記第一の基準値よりも大きく前記第二の基準値よりも小さい場合には、その分割画像は前記暫定不良として判定するステップである。
In the image inspection method of the present invention, in the reference value setting step, two reference values, a first reference value and a second reference value larger than the first reference value, are used as the pass / fail judgment reference value. Set for each non-defective product split image,
The pass / fail determination step and the re-pass / fail determination step are performed when the Mahalanobis distance of the divided image to be the pass / fail determination target is smaller than the first reference value set in the corresponding non- defective product split image. The image is determined to be good, and when the Mahalanobis distance of the divided image is larger than the second reference value set for the corresponding non- defective divided image, the divided image is determined to be defective. When the Mahalanobis distance is larger than the first reference value and smaller than the second reference value, the divided image is determined as the provisional defect.

このように、2つの基準値を設けることによって、分割画像の良、不良の他に、暫定不良も判定することができる。そして、その2つの基準値は、被検査分割画像及び暫定不良分割画像ごとに設けられているので、それら分割画像ごとで、正確に、良否判定をすることができる。   In this way, provision of two reference values makes it possible to determine provisional defects in addition to good and bad divided images. The two reference values are provided for each of the inspected divided image and the provisional defective divided image, so that the pass / fail judgment can be made accurately for each of the divided images.

また、本発明の画像検査方法において、前記良品画像分割ステップでは、複数の前記良品画像を互いに同じ分割となるように分割するステップを、前記良品画像の分割サイズを変えて複数回実行することで、前記複数種のサイズごとに、前記良品画像における位置が同じとなる複数の前記良品分割画像を得るようにし、
前記基準値設定ステップでは、前記複数種のサイズごとに、前記良品画像における位置が同じとなる複数の前記良品分割画像のマハラノビス距離のうち最大値を基準として前記良否判定基準値を設定する
Further, in the image inspection method of the present invention, in the non- defective image dividing step, the step of dividing the non-defective images so as to be divided into the same division is executed a plurality of times while changing the non-defective image division size. , For each of the plurality of sizes, so as to obtain a plurality of non-defective product divided images having the same position in the non-defective product image,
In the reference value setting step, the pass / fail judgment reference value is set based on the maximum value among the Mahalanobis distances of the plurality of good product divided images having the same position in the good product image for each of the plurality of sizes .

このように、良否判定基準値は、複数の良品分割画像のマハラノビス距離のうちの最大値を基準として定められるので、一層精度良く良否判定をすることができる。 Thus, good determination reference value, so determined maximum value of the Mahalanobis distance of a plurality of non-defective divided image as a reference, it is possible to further accurately quality decision.

本発明は、画像の良否の判定を行う画像検査装置であって、
良品画像を複数の画像に分割する良品画像分割手段と、
その良品画像分割手段が分割した画像である良品分割画像ごとにマハラノビス距離を算出する算出手段と、
その算出手段が算出したマハラノビス距離に基づいて、被検査画像の良否判定の基準となるマハラノビス距離である良否判定基準値を前記良品分割画像ごとに設定する基準値設定手段と、
被検査画像を前記良品画像の分割と同じ分割となるように複数の画像に分割する分割手段と、
その分割手段が分割した画像である被検査分割画像ごとに、マハラノビス距離からなる信号空間を作成する作成手段と、
前記被検査分割画像のマハラノビス距離を、該被検査分割画像に対応する前記良品分割画像に設定された前記良否判定基準値と比較することによって、前記被検査分割画像ごとで良否判定を行う良否判定手段と、を備え
前記良品画像分割手段は、複数の前記良品画像を互いに異なるサイズに分割することで、複数種のサイズの前記良品分割画像を得るようにし、
前記基準値設定手段は、前記複数種のサイズごとに、前記良品分割画像ごとの前記良否判定基準値を設定し、
前記良否判定手段は、前記良否判定として、前記比較結果に応じて、前記被検査分割画像を良/不良と判定する他に、良又は不良と確定しないで前記被検査分割画像に欠陥が存在する可能性があるとする暫定不良と判定するものであり、
前記暫定不良と判定された前記被検査分割画像があった場合、その被検査分割画像を前記複数種のサイズの一つと同じサイズとなるように更に複数の画像に分割する再分割手段と、
その再分割手段が分割した画像である暫定不良分割画像の各々に対して、再度、マハラノビス距離からなる信号空間を作成する再作成手段と、
前記暫定不良分割画像のマハラノビス距離を、該暫定不良分割画像に対応する前記良品分割画像に設定された前記良否判定基準値と比較することによって、前記暫定不良分割画像ごとで前記良否判定を再度行う再良否判定手段と、を備え、
その再良否判定手段にて新たに前記暫定不良と判定された前記暫定不良分割画像があった場合には、良又は不良と確定できるまで、その暫定不良分割画像に対して、前記再分割手段、前記再作成手段及び前記再良否判定手段による処理を繰り返し実行することを特徴とする。
The present invention is an image inspection apparatus for determining the quality of an image,
A non-defective image dividing means for dividing a non-defective image into a plurality of images;
Calculating means for calculating the Mahalanobis distance for each good divided image that is an image divided by the good image dividing means;
Based on the Mahalanobis distance calculated by the calculation means, a reference value setting means for setting a pass / fail judgment reference value that is a Mahalanobis distance serving as a reference for pass / fail judgment of the image to be inspected for each non-defective product divided image;
A dividing means for dividing the image to be inspected into a plurality of images so as to be the same division as the division of the non-defective image ;
Creating means for creating a signal space consisting of Mahalanobis distance for each divided image to be examined, which is an image divided by the dividing means;
The Mahalanobis distance of the object to be inspected divided picture images, by comparing with the non-defective dividing the quality determination reference value set in the image corresponding to said inspection image segment quality performing quality determination in each of the inspection divided images Determination means ,
The non-defective image dividing means divides a plurality of non-defective images into different sizes so as to obtain the non-defective product divided images of a plurality of sizes,
The reference value setting means sets the pass / fail judgment reference value for each non-defective product divided image for each of the plurality of sizes.
The pass / fail judgment means determines whether the test divided image is good / bad according to the comparison result as the pass / fail judgment, and there is a defect in the test divided image without being determined to be good or bad. It is determined as a provisional defect that there is a possibility,
When there is the inspected divided image determined to be the provisional failure, a re-dividing unit that further divides the inspected divided image into a plurality of images so as to be the same size as one of the plurality of sizes ;
Re-creating means for creating a signal space consisting of Mahalanobis distance again for each provisional defective divided image that is an image divided by the re-dividing means,
The Mahalanobis distance of the tentative defect divided picture images, by comparing the said quality determination reference value set in the non-defective divided images corresponding to the provisional failure divided image, the quality determination in each of the interim defect divided images again Re-pass / fail judgment means to perform,
In the case where there is the provisional defect divided image newly determined as the provisional defect by the re-defective / non-defective determination unit, the re-segmentation unit is applied to the provisional defect divided image until it can be determined as good or defective. The processing by the re-creation unit and the re-defectiveness determination unit is repeatedly executed.

これによれば、本発明の画像検査方法と同じ効果が得られる。   According to this, the same effect as the image inspection method of the present invention can be obtained.

画像検査装置1の外観図である。1 is an external view of an image inspection apparatus 1. FIG. ワーク4の表面を示した図である。FIG. 4 is a view showing a surface of a work 4. 基準空間を作成するための一般的なフローチャートである。It is a general flowchart for creating a reference space. 被検査画像のマハラノビス距離を算出し、良否判定を行うための一般的なフローチャートである。It is a general flowchart for calculating the Mahalanobis distance of an image to be inspected and performing pass / fail judgment. 基準空間を作成するための詳細なフローチャートである。It is a detailed flowchart for creating a reference space. 良品画像41の分割方法を説明するための図である。It is a figure for demonstrating the division | segmentation method of the good quality image 41. FIG. 複数の良品画像41間で同じ位置にある良品分割画像411を示した図である。It is the figure which showed the good quality division | segmentation image 411 in the same position between the some good quality images 41. FIG. 被検査画像のマハラノビス距離を算出し、良否判定を行うための詳細なフローチャートである。It is a detailed flowchart for calculating the Mahalanobis distance of the image to be inspected and performing pass / fail judgment. 被検査画像の例示として、被検査画像42〜44を示した図である。It is the figure which showed the to-be-inspected images 42-44 as an illustration of to-be-inspected image. 誤差81が含まれている被検査分割画像431(1)、暫定不良分割画像431(1−1)を更に分割したことを示した図である。It is the figure which showed having further divided | segmented the to-be-inspected division | segmentation image 431 (1) and the temporary defect division | segmentation image 431 (1-1) containing the error 81. FIG. 小さな欠陥72が含まれている被検査分割画像441(5)を更に分割したことを示した図である。It is the figure which showed having further divided | segmented the to-be-inspected divided image 441 (5) in which the small defect 72 was included.

以下、図面を参照しつつ、この発明の実施の最良形態につき説明する。図1に、本発明の画像検査装置1の外観図を示す。その画像検査装置1は、図1に示すワーク4の欠陥の有無を判定して、ワーク4の良否判定をする装置である。その画像検査装置1は、図1に示すように、カメラ2、照明3、電子計算機5及び表示装置6を備えている。   The best mode for carrying out the present invention will be described below with reference to the drawings. In FIG. 1, the external view of the image inspection apparatus 1 of this invention is shown. The image inspection apparatus 1 is an apparatus that determines the quality of the workpiece 4 by determining whether the workpiece 4 shown in FIG. As shown in FIG. 1, the image inspection apparatus 1 includes a camera 2, an illumination 3, an electronic calculator 5, and a display device 6.

カメラ2はワーク4の外観を撮像するものであり、CCDカメラ、CMOSカメラ、アナログカメラなどを使用することができる。この例では、カメラ2として、CCDカメラを使用している。   The camera 2 images the external appearance of the work 4, and a CCD camera, a CMOS camera, an analog camera, or the like can be used. In this example, a CCD camera is used as the camera 2.

照明3は、カメラ2によりワーク4の外観を撮像する際に、ワーク4の撮像箇所の明るさを調整するものであり、ファイーバー照明、LED照明、リング照明、同軸落射照明などを使用することができる。この例では、照明3として、LEDリング照明を使用している。カメラ2で撮像された画像データは、電子計算機5に送られ、電子計算機5でデータ処理を施した後に良否判定が行われ、その結果が表示装置6に表示される。   The illumination 3 is used to adjust the brightness of the imaged portion of the workpiece 4 when the camera 2 captures the appearance of the workpiece 4, and fiber illumination, LED illumination, ring illumination, coaxial epi-illumination, or the like can be used. it can. In this example, LED ring illumination is used as the illumination 3. The image data picked up by the camera 2 is sent to the electronic computer 5, and after the data processing is performed by the electronic computer 5, pass / fail judgment is performed, and the result is displayed on the display device 6.

一方、ワーク4は検査対象となる製品である。この例では、ワーク4は切削加工した金属部品であり、ワーク4表面にある、傷、バリ、異物などの欠陥の有無を検査するものである。図2は、ワーク4の表面を示した図である。図2に示すように、ここで例示する検査対象ワーク4は様々な特徴450(例えば、模様、形状)を持った部位が外観中に存在する。そのため、外観中でその特徴450で示される特徴量の急峻な変化があるワークである。   On the other hand, the workpiece 4 is a product to be inspected. In this example, the workpiece 4 is a cut metal part, and is used to inspect the surface of the workpiece 4 for defects such as scratches, burrs, and foreign matters. FIG. 2 is a view showing the surface of the workpiece 4. As shown in FIG. 2, the inspection target workpiece 4 exemplified here includes portions having various characteristics 450 (for example, patterns and shapes) in the appearance. Therefore, the work has a sharp change in the feature amount indicated by the feature 450 in the appearance.

そして、画像検査装置1は、ワーク4の良否判定を、マハラノビス・タグチ法を用いて判定する。ここで、図3、図4に、マハラノビス・タグチ法を用いて判定する方法を示した一般的なフローチャートを示す。図3は、最も正常な状態にある複数の製品画像、つまり出現頻度が最も高くなる良品画像群のマハラノビス距離を算出する、つまり基準空間を作成するためのフローチャートである。まず、良品の原画像を入力して、必要に応じて、入力した画像に対してフィルタリングやエッジ強調などの画像処理を施す(S11)。そして、入力画像を分割して後(S12)、各分割画像から特徴量を抽出し(S13)、複数の画像間で同じ位置にある分割画像ごとにマハラノビス距離を算出する(S14)。   Then, the image inspection apparatus 1 determines the quality of the workpiece 4 using the Mahalanobis Taguchi method. Here, FIG. 3 and FIG. 4 show general flowcharts showing a method of determination using the Mahalanobis-Taguchi method. FIG. 3 is a flowchart for calculating the Mahalanobis distance of a plurality of product images in the most normal state, that is, a non-defective image group having the highest appearance frequency, that is, for creating a reference space. First, a good original image is input, and image processing such as filtering and edge enhancement is performed on the input image as necessary (S11). Then, after the input image is divided (S12), the feature amount is extracted from each divided image (S13), and the Mahalanobis distance is calculated for each divided image at the same position among the plurality of images (S14).

一方図4は、被検査画像のマハラノビス距離を算出し、良否判定を行うためのフローチャートである。まず、検査品の被検査画像を入力して、必要に応じて、入力した画像に対してフィルタリングやエッジ強調などの画像処理を施し、欠陥を検出しやすくする(S21)。そして、被検査画像を分割して(S22)、各分割画像から特徴量を抽出(S23)、マハラノビス距離を算出する(S24)。算出されたマハラノビス距離を良否判定の基準値と比較し(S25)、算出されたマハラノビス距離が基準値よりも小さければ良品と判定し、結果を表示装置6に表示をする(S26)。その後、図4のフローチャートの処理を終了する。一方、算出されたマハラノビス距離が基準値よりも大きければ不良品と判定し、欠陥が存在する位置を特定して、その情報を電子計算機5の記憶装置(不図示)に格納すると共に、結果を表示装置6に表示する(S27)。その後、図4のフローチャートの処理を終了する。   On the other hand, FIG. 4 is a flowchart for calculating the Mahalanobis distance of the image to be inspected and making a pass / fail judgment. First, an inspected image of an inspection product is input, and if necessary, image processing such as filtering and edge enhancement is performed on the input image to facilitate detection of defects (S21). Then, the image to be inspected is divided (S22), the feature amount is extracted from each divided image (S23), and the Mahalanobis distance is calculated (S24). The calculated Mahalanobis distance is compared with a reference value for pass / fail determination (S25). If the calculated Mahalanobis distance is smaller than the reference value, it is determined to be a non-defective product, and the result is displayed on the display device 6 (S26). Then, the process of the flowchart of FIG. 4 is complete | finished. On the other hand, if the calculated Mahalanobis distance is larger than the reference value, it is determined as a defective product, the position where the defect exists is specified, the information is stored in a storage device (not shown) of the electronic computer 5, and the result is displayed. The data is displayed on the display device 6 (S27). Then, the process of the flowchart of FIG. 4 is complete | finished.

このように、本発明は分割画像ごとで良否判定をするものである。さらに、本発明は、良否判定の基準値を2つ設けて、良又は不良と確定しないで被検査分割画像に欠陥が存在する可能性があるとする暫定不良と判定する場合を設けている。そして、暫定不良と判定された場合には、その判定された分割画像について、良又は不良と確定できるまで、小さなサイズに画像を分割して良否判定を繰り返し行うものである。以下、その詳細を説明する。   As described above, the present invention determines pass / fail for each divided image. Furthermore, the present invention provides a case in which two reference values for pass / fail determination are provided and it is determined that there is a possibility that a defect exists in the inspected divided image without being determined to be good or bad. When it is determined that the provisional failure is detected, the image is divided into small sizes and the pass / fail determination is repeated until the determined divided image is determined to be good or bad. Details will be described below.

最初に、図5に示すフローチャート及び図6、図7を参照して、基準空間の作成方法を説明する。先ず、最も正常な状態にある複数のワーク4の製品画像をカメラ2で撮像し、その画像データを電子計算機5の記憶装置(不図示)に格納する(S31)。ここで、最も正常な状態にある製品画像とは、画像検査の場合は、最も出現頻度が高くなる良品群の画像とする。出現頻度が高ければ、ワーク4は、正常、良品である確率が高いといえるからである。また、入力する良品画像の数をして、n個の良品画像を入力している。   First, a reference space creation method will be described with reference to the flowchart shown in FIG. 5 and FIGS. 6 and 7. First, product images of a plurality of workpieces 4 in the most normal state are captured by the camera 2, and the image data is stored in a storage device (not shown) of the electronic computer 5 (S31). Here, the product image in the most normal state is an image of a good product group having the highest appearance frequency in the case of image inspection. This is because if the appearance frequency is high, it can be said that the probability that the work 4 is normal and non-defective is high. In addition, the number of non-defective images to be inputted is inputted and n pieces of non-defective images are inputted.

そして、S31で入力した個々の良品画像に対してフィルタリング、エッジ強調などの画像処理を施す(S32)。ここでは、エッジ強調処理を施している。本来、この画像処理は被検査画像に欠陥がある場合、その欠陥を検出しやすくするためのものであるが、良品、不良品に関わらず、同じ条件下で検査を行う必要があるため、欠陥がないと判っている良品画像に対しても画像処理を施している。   Then, image processing such as filtering and edge enhancement is performed on each non-defective image input in S31 (S32). Here, edge enhancement processing is performed. Originally, this image processing is intended to make it easier to detect defects when there is a defect in the image to be inspected, but it is necessary to perform inspection under the same conditions regardless of whether the product is non-defective or defective. Image processing is also applied to non-defective images that are known not to exist.

次いで、図6に示すように、画像処理を施した個々の良品画像41を、任意の方向に、任意のサイズで分割する(S33)。分割方向は欠陥の発生方向、分割サイズは検出対象となる欠陥のサイズを加味して決めれば良いが、ここでは、420×1320ピクセルの原画像41を、42×1320ピクセルの良品分割画像411(1)〜411(N)に分割する。すなわち、良品画像41を、その縦幅をN分割する。   Next, as shown in FIG. 6, the individual non-defective images 41 subjected to the image processing are divided into arbitrary sizes and arbitrary sizes (S33). The division direction may be determined in consideration of the defect occurrence direction and the division size in consideration of the size of the defect to be detected. Here, the original image 41 of 420 × 1320 pixels is converted into the non-defective product divided image 411 (42 × 1320 pixels) ( 1) to 411 (N). That is, the non-defective image 41 is divided into N parts in the vertical width.

次いで、個々の良品分割画像411(1)〜411(N)に演算処理を施し、予め規定した項目に基づいて特徴量を抽出する(S34)。この項目はワーク4の状態を表している必要があるが、ここでは、各良品分割画像411(1)〜411(N)の輝度波形に対して任意の横線を引いた時に、横線と輝度波形の交点数である微分値、横線よりも上に来る輝度波形の区間総和である積分値、輝度最大値と輝度最小値の差分など、輝度情報をもととした特徴量を使用している。   Next, each of the non-defective product divided images 411 (1) to 411 (N) is subjected to arithmetic processing, and a feature amount is extracted based on a predetermined item (S34). This item needs to represent the state of the work 4, but here, when an arbitrary horizontal line is drawn with respect to the luminance waveforms of the respective non-defective product divided images 411 (1) to 411 (N), the horizontal line and the luminance waveform are displayed. The feature amount based on the luminance information is used, such as a differential value that is the number of intersections of, an integral value that is the sum of the sections of the luminance waveform that are above the horizontal line, and a difference between the maximum luminance value and the minimum luminance value.

ここで、横線と輝度波形との交点数である微分値は、画像の特徴量の変動の回数の指標とすることができる。すなわち、微分値が大きいほど、画像中に、特徴量が変動する部位が多く含まれているといえる。よって、この微分値を特徴量として用いることにより、特徴量が変動する部位が多く含まれている画像でも、その特徴量が精度よく反映された基準空間や信号空間を作成することができるので、被検査画像の良否を精度良く判定することができると考えられる。   Here, the differential value, which is the number of intersections between the horizontal line and the luminance waveform, can be used as an index of the number of changes in the image feature amount. In other words, it can be said that the larger the differential value, the more portions in the image where the feature amount varies. Therefore, by using this differential value as a feature value, even in an image that includes many parts where the feature value varies, it is possible to create a reference space or a signal space that accurately reflects the feature value. It is considered that the quality of the inspected image can be determined with high accuracy.

また、横線よりも上の輝度波形の区間である積分値は、画像において一定以上の特徴量を有している部位が占める割合の指標とすることができる。すなわち、積分値が大きいほど、画像中に、一定以上の特徴量を有している部位が多く含まれているといえる。よって、この積分値を特徴量として用いることにより、一定以上の特徴量を有している部位が多く含まれている画像でも、その特徴量が精度よく反映された基準空間や信号空間を作成することができるので、被検査画像の良否を精度良く判定することができると考えられる。   Further, the integral value, which is the section of the luminance waveform above the horizontal line, can be used as an index of the ratio of the portion having a certain feature amount or more in the image. In other words, it can be said that the larger the integral value, the more parts in the image that have a certain or larger feature amount. Therefore, by using this integral value as a feature amount, even in an image including many parts having a feature amount above a certain level, a reference space or signal space in which the feature amount is accurately reflected is created. Therefore, it is considered that the quality of the inspected image can be determined with high accuracy.

また、輝度最大値と輝度最小値の差分は、画像中の特徴量の変動の大きさの指標とすることができる。すなわち、輝度最大値と輝度最小値の差分が大きいほど、画像中に特徴量が大きく変動する部位が含まれているといえる。よって、この差分を特徴量として用いることにより、特徴量が大きく変動する部位が含まれている画像でも、その特徴量が精度よく反映された基準空間や信号空間を作成することができるので、被検査画像の良否を精度良く判定することができると考えられる。   Further, the difference between the maximum luminance value and the minimum luminance value can be used as an indicator of the magnitude of the variation of the feature amount in the image. In other words, it can be said that as the difference between the maximum luminance value and the minimum luminance value is larger, a portion where the feature amount fluctuates greatly is included in the image. Therefore, by using this difference as a feature value, a reference space or signal space in which the feature value is accurately reflected can be created even for an image including a part where the feature value greatly varies. It is considered that the quality of the inspection image can be determined with high accuracy.

また、S34において、上記横線の位置を可変として、特徴量を抽出している。これにより、複雑に特徴量が変動する画像でも、その特徴量が精度よく抽出することができる。   In S34, the feature amount is extracted with the position of the horizontal line being variable. As a result, even in an image in which the feature amount fluctuates in a complicated manner, the feature amount can be accurately extracted.

そして、S34において各良品分割画像411(1)〜411(N)より特徴量Xgijを抽出した結果、表1に示す通りになった。 Then, as a result of extracting the feature quantity X gij from the respective non-defective product divided images 411 (1) to 411 (N) in S34, the result is as shown in Table 1.

Figure 0005405245
Figure 0005405245

なお、表1には、n個の良品画像41ごとの、各良品分割画像411(1)〜411(N)の特徴量Xgijを示している。また、抽出した特徴量Xgijの項目はk種類(輝度波形の微分値、輝度波形の積分値、輝度最大値と輝度最小値の差分等)であり、表1には各項目ごとの特徴量Xgijを示している。例えば、良品画像41の画像Noが「b」で、分割画像のNoが「1」、項目Noが「2」の特徴量は、表1に示すように、「Xb12」である。つまり、表1において、特徴量Xgijに付された下付文字のうち、一番左の文字gは良品画像41の画像Noを示し、真ん中の文字iは良品分割画像411のNoを示し、一番右の文字jは項目Noを示している。なお、以下、文字gを良品画像41の画像No、文字iを良品分割画像411のNo、文字jを項目Noとして使用する。 Table 1 shows the feature values X gij of the respective non-defective product divided images 411 (1) to 411 (N) for each of the n non-defective products 41. The extracted feature amount X gij has k types (the luminance waveform differential value, the luminance waveform integral value, the difference between the maximum luminance value and the minimum luminance value, etc.), and Table 1 shows the characteristic amount for each item. X gij is shown. For example, as shown in Table 1, the feature quantity of the non-defective image 41 having the image No. “b”, the divided image No. “1”, and the item No. “2” is “X b12 ”. That is, in Table 1, among the subscripts attached to the feature amount X gij , the leftmost character g indicates the image No. of the non-defective image 41, and the middle character i indicates the No of the non-defective product divided image 411, The rightmost character j indicates item No. Hereinafter, the character g is used as the image No. of the non-defective image 41, the character i is used as the No of the non-defective product divided image 411, and the character j is used as the item No.

次いで、各良品分割画像411(1)〜411(N)のマハラノビス距離を算出して、基本空間を作成する(S35)。具体的には、良品画像41ごとの項目jごとに特徴量Xgijの平均値xgjと標準偏差σgjを算出する。例えば、画像Noがg=「b」の良品画像41で、項目Noがj=「1」の特徴量Xbi1の平均値xgj、標準偏差σgjは、表1の画像No「b」、項目No「1」の特徴量Xb11〜Xbn1を用いて算出する。 Next, the Mahalanobis distance of each of the non-defective product divided images 411 (1) to 411 (N) is calculated to create a basic space (S35). Specifically, the average value x gj and the standard deviation σ gj of the feature amount X gij are calculated for each item j for each good product image 41. For example, the average value x gj and the standard deviation σ gj of the feature amount X bi1 of the non-defective image 41 with the image No. g = “b” and the item No. j = “1” are the image No. “b”, Table 1 Calculation is performed using the feature amounts X b11 to X bn1 of the item No “1”.

そして、算出した平均値xgjと標準偏差σgjを下記の式(1)に代入して、特徴量Xgijを規準化する(S35)。 Then, the calculated average value x gj and standard deviation σ gj are substituted into the following equation (1) to normalize the feature amount X gij (S35).

Figure 0005405245
Figure 0005405245

その規準化した特徴量xgijは、表2に示す通りになった。なお、表2では、複数の良品画像41間で同じ位置にある分割画像411(1)〜411(N)ごとに規準化した特徴量xgijを並べている。 The normalized feature amount x gij is as shown in Table 2. In Table 2, the feature quantities x gij normalized for each of the divided images 411 (1) to 411 (N) at the same position among the plurality of non-defective images 41 are arranged.

Figure 0005405245
Figure 0005405245

例えば、各良品画像41の分割画像Noが「1」で、項目「1」の特徴量xgijは、表2に示すように、xa11、xb11、・・・、xn11となる。 For example, the divided image No of each good product image 41 is “1”, and the feature quantity x gij of the item “1” is x a11 , x b11 ,..., X n11 as shown in Table 2.

そして、図7に示すように複数の良品画像41間で同じ位置にある良品分割画像411(1)〜411(N)ごとに、下記の式(2)により、項目pと項目qの相関係数rpqを算出する(S35)。そして、その相関係数rpqを下記式(3)のように、行列化して相関係数行列Rを算出する(S35)。 Then, as shown in FIG. 7, for each of the non-defective product divided images 411 (1) to 411 (N) in the same position among the non-defective product images 41, the relationship between the item p and the item q is expressed by the following equation (2). The number r pq is calculated (S35). Then, the correlation coefficient r pq is matrixed as in the following equation (3) to calculate a correlation coefficient matrix R (S35).

Figure 0005405245
Figure 0005405245

Figure 0005405245
Figure 0005405245

例えば、良品分割画像411(1)における項目1(p=1)と項目2(q=2)の相関係数r12は、上記式(2)より、下記式(4)により算出することになる。つまり、この場合、表2の分割画像No「1」で、項目No「1」、「2」の特徴量xgijを用いて相関係数r12を算出することになる。 For example, the correlation coefficient r 12 scores 1 in good divided image 411 (1) (p = 1) and Item 2 (q = 2), the above equation (2), to be calculated by the following equation (4) Become. That is, in this case, the correlation coefficient r 12 is calculated using the feature amounts x gij of the items No. “1” and “2” in the divided image No. “1” in Table 2.

Figure 0005405245
Figure 0005405245

このように、良品分割画像411(1)〜411(N)ごとで相関係数rpqを算出して、良品分割画像411(1)〜411(N)ごとで式(3)に示す相関係数行列Rを算出する。そして、下記式(5)のような良品分割画像411(i)ごとの相関係数行列Rの逆行列Aを算出する。 Thus, non-defective divided image 411 (1) ~411 (N) each at by calculating the correlation coefficient r pq, good divided image 411 (1) ~411 (N) per the formula (3) shows a phase relationship A number matrix R is calculated. Then, an inverse matrix A of the correlation coefficient matrix R for each non-defective product divided image 411 (i) as shown in the following equation (5) is calculated.

Figure 0005405245
Figure 0005405245

そして、下記の式(6)により、i番目の良品分割画像411(i)の、g番目の良品画像41のマハラノビス距離MDigを算出する。 Then, the Mahalanobis distance MD ig of the g-th non-defective product image 41 of the i-th non-defective product divided image 411 (i) is calculated by the following equation (6).

Figure 0005405245
Figure 0005405245

そして、式6により、全ての良品画像41の全ての良品分割画像411に対してマハラノビス距離MDigを算出する(S35)。全ての良品分割画像411に対してマハラノビス距離MDigを算出した結果、ここでは表3に示す通りになった。なお、表3には、各良品分割画像411におけるマハラノビス距離MDigの最大値も示しており、例えば、良品分割画像411(1)のマハラノビス距離MDigの最大値は「1.1」となっている。 Then, the Mahalanobis distance MD ig is calculated with respect to all the non-defective product divided images 411 of all the non-defective products images 41 using Equation 6 (S35). As a result of calculating the Mahalanobis distance MD ig for all the non-defective product divided images 411, the results are as shown in Table 3 here. In Table 3, the maximum value of the Mahalanobis distance MD ig of each non-defective divided image 411 is also shown, for example, the maximum value of the Mahalanobis distance MD ig non-defective divided image 411 (1) is "1.1" ing.

Figure 0005405245
Figure 0005405245

次いで、S35で算出したマハラノビス距離MDigに基づいて、被検査画像の良否判定の基準となるマハラノビス距離基準値(良品判定基準値)を良品分割画像411ごとで設定する(S36)。この際、マハラノビス距離基準値として、良品分割画像411ごとで2つの基準値(第一の基準値と第二の基準値)を設定する。具体的には、各良品分割画像411におけるマハラノビス距離MDigの最大値を基準に、第一の基準値を設定するとともに、その第一の基準値よりも大きな第二の基準値を設定する。ここでは、下記表4に示すように、第一の基準値=マハラノビス距離MDigの最大値(表3参照)+0.3、第二の基準値=第一の基準値+0.2となるように設定した。 Next, based on the Mahalanobis distance MD ig calculated in S35, a Mahalanobis distance reference value (non-defective product determination reference value) that serves as a reference for determining pass / fail of the inspected image is set for each non-defective product divided image 411 (S36). At this time, two reference values (first reference value and second reference value) are set for each non-defective product divided image 411 as Mahalanobis distance reference values. Specifically, the first reference value is set based on the maximum value of the Mahalanobis distance MD ig in each good product divided image 411, and a second reference value larger than the first reference value is set. Here, as shown in Table 4 below, the first reference value = the maximum value of the Mahalanobis distance MD ig (see Table 3) +0.3, and the second reference value = first reference value + 0.2. Set to.

Figure 0005405245
Figure 0005405245

続いて、再度、上記ステップS33を実行して、良品画像41を、42×1320ピクセルと異なる他のサイズ(21×1320ピクセル、7×1320ピクセル、・・・)に分割する。そして、分割した他のサイズの各良品分割画像に対して、上記ステップS34〜S36の処理を実行して、良品分割画像ごとに第一、第二の基準値を設定する。すなわち、ステップS33〜S36の処理を繰り返して、各種サイズごとに、良品分割画像ごとの第一、第二の基準値を設定する。その後、設定した第一、第二の基準値を電子計算機5の記憶装置(不図示)に格納し、図5のフローチャートの処理を終了する。   Subsequently, the above step S33 is executed again to divide the non-defective image 41 into other sizes (21 × 1320 pixels, 7 × 1320 pixels,...) Different from 42 × 1320 pixels. And the process of said step S34-S36 is performed with respect to each non-defective product divided image of the other size, and the first and second reference values are set for each good product divided image. That is, the processes of steps S33 to S36 are repeated to set the first and second reference values for each non-defective product divided image for each size. Thereafter, the set first and second reference values are stored in a storage device (not shown) of the electronic computer 5, and the processing of the flowchart of FIG.

次に、被検査画像のマハラノビス距離を算出して良否判定をする方法を説明する。ここで、図8は、被検査画像の良否判定をするときの電子計算機5が実行する処理を示したフローチャートである。この、被検査画像のマハラノビス距離を算出する方法は、入力画像は一つである点と、規準化に用いる項目ごとの平均値、標準偏差と、マハラノビス距離の算出に用いる相関係数行列Rの逆行列Aは基準空間作成時の値を使用する点を除いては、基準空間の作成方法と同様である。この点を踏まえて、以下、図8のフローチャートを参照して、被検査画像の良否判定の方法を説明する。   Next, a method for determining pass / fail by calculating the Mahalanobis distance of the image to be inspected will be described. Here, FIG. 8 is a flowchart showing the processing executed by the electronic computer 5 when determining the quality of the inspected image. The method for calculating the Mahalanobis distance of the image to be inspected is that there is one input image, the average value for each item used for normalization, the standard deviation, and the correlation coefficient matrix R used for calculating the Mahalanobis distance. The inverse matrix A is the same as the method for creating the reference space except that the value at the time of creating the reference space is used. Based on this point, a method for determining pass / fail of an inspected image will be described below with reference to the flowchart of FIG.

先ず、検査対象のワーク4の製品画像を被検査画像としてカメラ2で撮像し、その画像データを電子計算機5の記憶装置(不図示)に格納する(S41)。そして、S41で入力した被検査画像に対してフィルタリング、エッジ強調などの画像処理を施す(S42)。   First, a product image of the workpiece 4 to be inspected is picked up by the camera 2 as an image to be inspected, and the image data is stored in a storage device (not shown) of the electronic computer 5 (S41). Then, image processing such as filtering and edge enhancement is performed on the inspection image input in S41 (S42).

次いで、画像処理を施した被検査画像を、良品画像41と同じ方向に、同じサイズで分割する(S43)。ここで、先に説明した図5のS33では、良品画像41は複数のサイズに分割していたが、このS43では、そのサイズのうちの最も大きなサイズ、すなわち42×1320ピクセルのサイズで、被検査画像を分割する。なお、ステップS43が本発明の「分割ステップ」に相当し、ステップS43を実行する電子計算機5が本発明の「分割手段」に相当する。   Next, the inspected image subjected to the image processing is divided in the same direction as the non-defective image 41 with the same size (S43). Here, in S33 of FIG. 5 described above, the non-defective image 41 is divided into a plurality of sizes. However, in S43, the largest size among them, that is, a size of 42 × 1320 pixels, is used. Divide the inspection image. Step S43 corresponds to the “dividing step” of the present invention, and the electronic computer 5 executing step S43 corresponds to the “dividing means” of the present invention.

次いで、個々の被検査分割画像に演算処理を施し、基準空間を作成したときと同じ項目に基づいて特徴量Yijを抽出する(S44)。つまり、被検査分割画像の輝度波形に対して任意の横線を引いた時に、横線と輝度波形の交点数である微分値、横線よりも上に来る輝度波形の区間総和である積分値、輝度最大値と輝度最小値の差分など、輝度情報をもととした特徴量Yijを抽出する。 Next, an arithmetic process is performed on each divided image to be inspected, and a feature amount Y ij is extracted based on the same items as when the reference space is created (S44). That is, when an arbitrary horizontal line is drawn on the luminance waveform of the divided image to be inspected, the differential value that is the number of intersections of the horizontal line and the luminance waveform, the integral value that is the sum of the intervals of the luminance waveform that is above the horizontal line, and the maximum luminance A feature amount Y ij based on luminance information such as a difference between the value and the minimum luminance value is extracted.

次いで、基準空間を作成したときと同じ方法(S35)で、各被検査分割画像のマハラノビス距離を算出して、信号空間を作成する(S45)。具体的には、下記の式(7)により、被検査分割画像ごとの項目jごとの特徴量Yijを規準化(被検査規準特徴量)する(S45)。この際、基準空間を作成したときの平均値xと標準偏差σを使用する。 Next, the Mahalanobis distance of each divided image to be inspected is calculated by the same method (S35) as that for creating the reference space, and a signal space is created (S45). Specifically, the feature value Y ij for each item j for each divided image to be inspected is normalized (inspected reference feature value) by the following equation (7) (S45). At this time, the average value x j and the standard deviation σ j when the reference space is created are used.

Figure 0005405245
Figure 0005405245

そして、下記の式(8)により、i番目の被検査分割画像のマハラノビス距離MD‘を算出する。この際、相関係数行列Rの逆行列Aは、基準空間を作成したときのものを使用する。 Then, the Mahalanobis distance MD ′ i of the i-th inspection divided image is calculated by the following equation (8). At this time, the inverse matrix A of the correlation coefficient matrix R is the one used when the reference space is created.

Figure 0005405245
Figure 0005405245

なお、ステップS44及びS45が本発明の「作成ステップ」に相当する。また、ステップS44及びS45を実行する電子計算機5が本発明の「作成手段」に相当する。   Steps S44 and S45 correspond to the “creation step” of the present invention. The computer 5 that executes steps S44 and S45 corresponds to the “creating unit” of the present invention.

次いで、算出されたマハラノビス距離MD‘ごとに、被検査分割画像と同一サイズに対応する良否判定の基準値のうち、各被検査分割画像に対応する第二の基準値より大きいか否かを判断する(S46)。すなわち、被検査分割画像のサイズは、42×1320ピクセルであるので、表4の第二の基準値を用いる。そして、例えば、分割画像Noが「1」の被検査分割画像に対しては、そのマハラノビス距離MD‘と表4の分割画像No.1の第二の基準値「1.6」とを比較する。 Then, for each calculated Mahalanobis distance MD ′ i , it is determined whether or not the reference value for pass / fail judgment corresponding to the same size as the inspected divided image is larger than the second reference value corresponding to each inspected divided image. Judgment is made (S46). That is, since the size of the inspected divided image is 42 × 1320 pixels, the second reference value in Table 4 is used. For example, for the inspection divided image whose divided image No. is “1”, the Mahalanobis distance MD ′ 1 and the divided image No. 1 is compared with the second reference value “1.6”.

ここで、算出されたマハラノビス距離MD‘が一つでも第二の基準値よりも大きければ(S46:YES)、不良品と判定し、欠陥が存在する位置を特定して、その情報を電子計算機5の記憶装置(不図示)に格納すると共に、結果を表示装置6に表示する(S54)。その後、図8のフローチャートの処理を終了する。 Here, if even one calculated Mahalanobis distance MD ′ i is larger than the second reference value (S46: YES), it is determined as a defective product, the position where the defect exists is specified, and the information is electronic The data is stored in a storage device (not shown) of the computer 5 and the result is displayed on the display device 6 (S54). Then, the process of the flowchart of FIG. 8 is complete | finished.

一方、マハラノビス距離MD‘が第二の基準値よりも小さければ(S46:NO)、次に、そのマハラノビス距離MD‘が、表4の第一の基準値よりも大きいか否かを判断する(S47)。例えば、分割画像Noが「1」の被検査分割画像に対しては、そのマハラノビス距離MD‘と表4の分割画像No.1の第一の基準値「1.4」とを比較する。そして、全ての被検査分割画像において、マハラノビス距離MD‘が第一の基準値よりも小さければ(S47:NO)、被検査画像は良品と判定し、結果を表示装置6に表示をする(S53)。その後、図8のフローチャートの処理を終了する。なお、ステップS46及びS47が本発明の「良否判定ステップ」に相当し、ステップS46及びS47を実行する電子計算機5が本発明の「良否判定手段」に相当する。 On the other hand, if the Mahalanobis distance MD ′ i is smaller than the second reference value (S46: NO), it is then determined whether the Mahalanobis distance MD ′ i is larger than the first reference value in Table 4. (S47). For example, for the inspected divided image having the divided image No. “1”, the Mahalanobis distance MD ′ 1 and the divided image No. The first reference value “1.4” of 1 is compared. If the Mahalanobis distance MD ′ i is smaller than the first reference value in all the inspected divided images (S47: NO), the inspected image is determined to be non-defective and the result is displayed on the display device 6 ( S53). Then, the process of the flowchart of FIG. 8 is complete | finished. Steps S46 and S47 correspond to the “good / bad determination step” of the present invention, and the computer 5 that executes steps S46 and S47 corresponds to the “good / bad determination unit” of the present invention.

一方、マハラノビス距離MD‘が一つでも第一の基準値よりも大きければ(S47:YES)、そのマハラノビス距離MD‘の被検査分割画像は、欠陥が存在する可能性があるとする暫定不良と判定して、ステップS48以下の処理を実行する。すなわち、先ず、その被検査分割画像を更に小さなサイズの分割画像に分割する(S48)。具体的には、予め作成された基準空間の良品分割画像と複数種類のサイズのうち、元の42×1320ピクセルの次に小さなサイズでサイズである21×1320ピクセルの分割画像に分割する(S48)。したがって、被検査分割画像を更に2つの分割画像に分割することになる。なお、ステップS48が本発明の「再分割ステップ」に相当し、ステップS48を実行する電子計算機5が本発明の「再分割手段」に相当する。 On the other hand, if at least one Mahalanobis distance MD ′ i is larger than the first reference value (S47: YES), the inspection divided image having the Mahalanobis distance MD ′ i is provisionally assumed to have a defect. It determines with it being inferior and performs the process after step S48. That is, first, the inspected divided image is divided into smaller-sized divided images (S48). Specifically, among the non-defective divided image of the reference space created in advance and a plurality of sizes, the image is divided into divided images of 21 × 1320 pixels, which is the next smaller size than the original 42 × 1320 pixels (S48). ). Therefore, the inspected divided image is further divided into two divided images. Step S48 corresponds to the “re-dividing step” of the present invention, and the electronic computer 5 that executes step S48 corresponds to the “re-dividing means” of the present invention.

次いで、新たに分割した分割画像を暫定不良分割画像として、それら暫定不良分割画像ごとに、再度、マハラノビス距離を算出して信号空間を作成する。すなわち、暫定不良分割画像ごとに、先のステップS44と同じようにして、特徴量Yijを再度抽出する(S49)。次いで、先のステップS45と同じようにして、各暫定不良分割画像のマハラノビス距離MD‘を算出して、信号空間を再度作成する(S50)。なお、ステップS49及びS50が本発明の「再作成ステップ」に相当し、ステップS49及びS50を実行する電子計算機5が本発明の「再作成手段」に相当する。 Next, the newly divided divided image is used as a temporary defective divided image, and the Mahalanobis distance is calculated again for each temporary defective divided image to create a signal space. That is, for each provisional defective divided image, the feature amount Y ij is extracted again in the same manner as in the previous step S44 (S49). Next, as in the previous step S45, the Mahalanobis distance MD ′ i of each provisional defective divided image is calculated, and a signal space is created again (S50). Steps S49 and S50 correspond to the “re-creation step” of the present invention, and the electronic computer 5 that executes steps S49 and S50 corresponds to the “re-creation unit” of the present invention.

次いで、算出されたマハラノビス距離MD‘ごとに、暫定不良分割画像と同一サイズに対応する良否判定の基準値のうち、各暫定不良分割画像に対応する第二の基準値より大きいか否かを判断する(S51)。すなわち、今回の暫定不良分割画像のサイズは21×1320ピクセルであるので、その21×1320ピクセルに対応する第二の基準値のうち、暫定不良分割画像と同じ位置に対応する第二の基準値を用いる。 Next, for each calculated Mahalanobis distance MD ′ i , it is determined whether or not it is greater than a second reference value corresponding to each provisional defective divided image among the reference values for quality determination corresponding to the same size as the temporary defective divided image. Judgment is made (S51). That is, since the size of the temporary defective divided image this time is 21 × 1320 pixels, the second reference value corresponding to the same position as the temporary defective divided image among the second reference values corresponding to the 21 × 1320 pixels. Is used.

ここで、新たに算出されたマハラノビス距離MD‘が一つでも第二の基準値よりも大きければ(S51:YES)、不良品と判定し、欠陥が存在する位置を特定して、その情報を電子計算機5の記憶装置(不図示)に格納すると共に、結果を表示装置6に表示する(S54)。その後、図8のフローチャートの処理を終了する。 If at least one newly calculated Mahalanobis distance MD ′ i is larger than the second reference value (S51: YES), it is determined as a defective product, the position where the defect exists is specified, and the information Is stored in a storage device (not shown) of the electronic computer 5 and the result is displayed on the display device 6 (S54). Then, the process of the flowchart of FIG. 8 is complete | finished.

一方、新たなマハラノビス距離MD‘が第二の基準値よりも小さければ(S51:NO)、次に、そのマハラノビス距離MD‘が、対応する第一の基準値よりも大きいか否かを判断する(S52)。そして、全ての暫定不良分割画像において、マハラノビス距離MD‘が第一の基準値よりも小さければ(S52:NO)、被検査画像は良品と判定し、結果を表示装置6に表示をする(S53)。その後、図8のフローチャートの処理を終了する。なお、ステップS51及びS52が本発明の「再良否判定ステップ」に相当し、ステップS51及びS52を実行する電子計算機5が本発明の「再良否判定手段」に相当する。 On the other hand, if the new Mahalanobis distance MD ′ i is smaller than the second reference value (S51: NO), then whether or not the Mahalanobis distance MD ′ i is larger than the corresponding first reference value is determined. Judgment is made (S52). If the Mahalanobis distance MD ′ i is smaller than the first reference value in all the provisional defective divided images (S52: NO), the image to be inspected is determined to be non-defective, and the result is displayed on the display device 6 ( S53). Then, the process of the flowchart of FIG. 8 is complete | finished. Steps S51 and S52 correspond to the “re-defective / non-defective determination step” of the present invention, and the computer 5 that executes steps S51 and S52 corresponds to the “re-defective / non-defective determination unit” of the present invention.

一方、マハラノビス距離MD‘が一つでも第一の基準値よりも大きければ(S52:YES)、そのマハラノビス距離MD‘の暫定不良分割画像は、欠陥が存在する可能性があるとする暫定不良と再度判定して、ステップS48に戻って、ステップS48以下の処理を再度実行する。すなわち、その暫定不良分割画像を更に小さなサイズの分割画像に分割する(S48)。具体的には、予め作成された基準空間の良品分割画像と複数種類のサイズのうち、元の21×1320ピクセルの次に小さなサイズでサイズである7×1320ピクセルの分割画像に分割する(S48)。したがって、暫定不良分割画像を更に3つの分割画像に分割することになる。その後、再分割された3つの暫定不良分割画像に対して、マハラノビス距離を再度算出して、再度良否判定を行う(S49〜S52)。 On the other hand, if at least one Mahalanobis distance MD ′ i is larger than the first reference value (S52: YES), the provisional defect divided image of the Mahalanobis distance MD ′ i is provisionally assumed to have a defect. It is determined again as defective, and the process returns to step S48, and the processes after step S48 are executed again. That is, the provisional defective divided image is divided into smaller divided images (S48). Specifically, among the non-defective divided image of the reference space created in advance and the plurality of sizes, the image is divided into divided images of 7 × 1320 pixels, which is the next smaller size than the original 21 × 1320 pixels (S48). ). Therefore, the provisional defective divided image is further divided into three divided images. Thereafter, the Mahalanobis distance is calculated again for the three sub-provisional defective divided images, and the pass / fail determination is performed again (S49 to S52).

そして、新たに算出されたマハラノビス距離MD‘が一つでも第二の基準値よりも大きければ(S51:YES)、不良品と判定し(S54)、全てのマハラノビス距離MD‘が第一の基準値よりも小さければ(S52:NO)、被検査画像は良品と判定する。一方、マハラノビス距離MD‘が一つでも第一の基準値よりも大きければ(S52:YES)、再度、ステップS48〜S52の処理を実行する。すなわち、暫定不良と判定した場合には、その判定した暫定不良分割画像に対して、良又は不良と確定できるまで、小さなサイズに画像を分割して良否判定を繰り返し行う。このようにして、最終的に、被検査画像が良又は不良であるかを判定する。 If at least one newly calculated Mahalanobis distance MD ′ i is larger than the second reference value (S51: YES), it is determined as a defective product (S54), and all Mahalanobis distances MD ′ i are first. If it is smaller than the reference value (S52: NO), the image to be inspected is determined to be non-defective. On the other hand, if at least one Mahalanobis distance MD ′ i is larger than the first reference value (S52: YES), the processes of steps S48 to S52 are executed again. That is, when it is determined as a temporary defect, the image is divided into small sizes and the pass / fail determination is repeated until it is determined that the determined temporary defect divided image is good or defective. In this way, it is finally determined whether the inspected image is good or bad.

ここで、良否を検査する被検査画像が、図9に示す、被検査画像42〜44の場合の良否判定結果について説明する。図9(a)に示す被検査画像42には、大きな欠陥71が存在しており、不良品である。そして、その欠陥71は、図9(a)に示すように、被検査画像42の被検査分割画像421(1)〜(N)に含まれることとなり、特に、被検査分割画像421(5)に多く含まれるとする。   Here, the quality determination result when the images to be inspected are inspected images 42 to 44 shown in FIG. 9 will be described. The inspection image 42 shown in FIG. 9A has a large defect 71 and is a defective product. Then, as shown in FIG. 9A, the defect 71 is included in the inspected divided images 421 (1) to (N) of the inspected image 42, and in particular, the inspected divided image 421 (5). It is assumed that many are included.

また、図9(b)に示す被検査画像43には、欠陥ではないが、良品画像41には含まれていない誤差81(例えば、被検査品に付着した埃など)が含まれている。したがって、欠陥は含まれていないので、良品と判定されるべきものである。そして、その誤差81は、図9(b)に示すように、被検査画像43の被検査分割画像431(1)〜(N)に含まれることとなり、特に、被検査分割画像431(1)に多く含まれるとする。   Further, the inspected image 43 shown in FIG. 9B includes an error 81 (for example, dust attached to the inspected product) that is not a defect but is not included in the non-defective product image 41. Therefore, since no defect is included, it should be determined as a non-defective product. Then, the error 81 is included in the inspected divided images 431 (1) to (N) of the inspected image 43 as shown in FIG. 9B, and in particular, the inspected divided image 431 (1). It is assumed that many are included.

また、図9(c)に示す被検査画像44には、小さな欠陥72が存在しており、不良品である。そして、その欠陥72は、図9(c)に示すように、被検査画像44の被検査分割画像441(1)〜(N)に含まれることとなり、特に、被検査分割画像441(5)に多く含まれるとする。   In addition, the inspected image 44 shown in FIG. 9C has a small defect 72 and is a defective product. Then, as shown in FIG. 9C, the defect 72 is included in the inspected divided images 441 (1) to (N) of the inspected image 44, and in particular, the inspected divided image 441 (5). It is assumed that many are included.

この被検査画像42〜44に対して、被検査分割画像421、431、441ごとにマハラノビス距離を算出したところ、表5に示す通りとなった。   When the Mahalanobis distance was calculated for each of the inspected divided images 421, 431, and 441 for the inspected images 42 to 44, the results shown in Table 5 were obtained.

Figure 0005405245
Figure 0005405245

表5に示すように、被検査画像42では、分割画像No.5内の位置に欠陥71があるため、分割画像No.5のマハラノビス距離が、表4に示す分割画像No.5の第二の基準値2.1よりも大きくなっている。よって、被検査画像42は不良品であると判定された(S46:YES→S54)。   As shown in Table 5, in the inspected image 42, the divided image No. Since there is a defect 71 at a position in FIG. The Mahalanobis distance of the divided image No. 5 is larger than the second reference value 2.1. Therefore, it was determined that the inspected image 42 is a defective product (S46: YES → S54).

一方、被検査画像43は、被検査分割画像431(1)に誤差81が含まれているために、分割画像No.1のマハラノビス距離が、表4の分割画像No.1の第一の基準値1.4よりも大きく、第二の基準値1.6よりも小さくなった。なお、他の被検査分割画像431(2)〜431(N)は、各マハラノビス距離が第一の基準値よりも小さく、良と判定された。よって、被検査分割画像431(1)には欠陥が存在する可能性があるとして暫定不良と判定し(S47:YES)、検査処理を継続した。つまり、図10(a)に示すように、42×1320ピクセルの被検査分割画像431(1)を21×1320ピクセルのサイズの暫定不良分割画像431(1−1)、431(1−2)に分割した(S48)。この際、誤差81は、暫定不良分割画像431(1−1)に含まれることになった。そして、暫定不良分割画像431(1−1)、431(1−2)ごとにマハラノビス距離を算出した(S49、S50)。   On the other hand, the inspected image 43 includes the divided image No. 1 because the inspected divided image 431 (1) includes the error 81. The Mahalanobis distance of 1 is divided image No. It was larger than the first reference value 1.4 of 1 and smaller than the second reference value 1.6. The other inspected divided images 431 (2) to 431 (N) were determined to be good because each Mahalanobis distance was smaller than the first reference value. Therefore, it is determined that there is a possibility that a defect exists in the inspected divided image 431 (1) (S47: YES), and the inspection process is continued. That is, as shown in FIG. 10A, the inspected divided image 431 (1) having 42 × 1320 pixels is converted into the provisional defective divided images 431 (1-1) and 431 (1-2) having a size of 21 × 1320 pixels. (S48). At this time, the error 81 is included in the provisional defective divided image 431 (1-1). Then, the Mahalanobis distance was calculated for each of the provisional defective divided images 431 (1-1) and 431 (1-2) (S49, S50).

その結果、暫定不良分割画像431(1−1)のマハラノビス距離が、第一の基準値よりも大きく、第二の基準値よりも小さくなった。なお、暫定不良分割画像431(1−2)は、そのマハラノビス距離が第一の基準値よりも小さく、良と判定された。よって、暫定不良分割画像431(1−1)には欠陥が存在する可能性があるとして暫定不良と判定し(S47:YES)、検査処理をさらに継続した。つまり、図10(b)に示すように、21×1320ピクセルの暫定不良分割画像431(1−1)を7×1320ピクセルのサイズの暫定不良分割画像431(1−1−1)、431(1−1−2)、431(1−1−3)に分割した(S48)。この際、誤差81は、暫定不良分割画像431(1−1−2)に含まれることになった。そして、暫定不良分割画像431(1−1−1)、431(1−1−2)、431(1−1−3)ごとにマハラノビス距離を算出した(S49、S50)。その結果、全ての暫定不良分割画像431(1−1−1)、431(1−1−2)、431(1−1−3)のマハラノビス距離が、第一の基準値以下であったため、この被検査画像43は良品であると判定し検査を終了した。   As a result, the Mahalanobis distance of the provisional defective divided image 431 (1-1) is larger than the first reference value and smaller than the second reference value. The provisional defective divided image 431 (1-2) was determined to be good because its Mahalanobis distance was smaller than the first reference value. Therefore, the provisional defect divided image 431 (1-1) is determined as a provisional defect because there is a possibility that a defect exists (S47: YES), and the inspection process is further continued. That is, as shown in FIG. 10B, the provisional defective divided image 431 (1-1) of 21 × 1320 pixels is converted into the provisional defective divided images 431 (1-1-1), 431 (7 × 1320 pixels in size. It was divided into 1-1-2) and 431 (1-1-3) (S48). At this time, the error 81 is included in the provisional defective divided image 431 (1-1-2). Then, the Mahalanobis distance was calculated for each of the provisional defective divided images 431 (1-1-1), 431 (1-1-2), and 431 (1-1-3) (S49, S50). As a result, the Mahalanobis distances of all the provisional defective divided images 431 (1-1-1), 431 (1-1-2), and 431 (1-1-3) were equal to or less than the first reference value. The inspected image 43 was determined to be a non-defective product and the inspection was completed.

また、被検査画像44は、被検査分割画像441(5)に小さな欠陥72が含まれているために、分割画像No.5のマハラノビス距離が、表4の第一の基準値1.9よりも大きく、第二の基準値2.1よりも小さくなった。なお、他の被検査分割画像441(1)〜441(N)は、各マハラノビス距離が第一の基準値よりも小さく、良と判定された。よって、被検査分割画像441(5)には欠陥が存在する可能性があるとして暫定不良と判定し(S47:YES)、検査処理を継続した。つまり、図11に示すように、42×1320ピクセルの被検査分割画像441(5)を21×1320ピクセルのサイズの暫定不良分割画像441(5−1)、441(5−2)に分割した(S48)。この際、欠陥72は、暫定不良分割画像441(5−1)に含まれることになった。そして、暫定不良分割画像441(5−1)、441(5−2)ごとにマハラノビス距離を算出した(S49、S50)。その結果、暫定不良分割画像441(5−1)のマハラノビス距離が、第二の基準値よりも大きくなったので(S46:YES)、暫定不良分割画像441(5−1)には欠陥があるものとし、被検査画像44は不良であると判定し(S54)、検査を終了した。   In addition, since the inspected image 44 includes the small defect 72 in the inspected divided image 441 (5), the divided image No. The Mahalanobis distance of 5 was larger than the first reference value 1.9 in Table 4 and smaller than the second reference value 2.1. The other inspected divided images 441 (1) to 441 (N) were determined to be good because each Mahalanobis distance was smaller than the first reference value. Therefore, the inspection divided image 441 (5) is determined as a provisional defect because there is a possibility that a defect exists (S47: YES), and the inspection process is continued. That is, as shown in FIG. 11, the inspected divided image 441 (5) of 42 × 1320 pixels is divided into provisional defective divided images 441 (5-1) and 441 (5-2) having a size of 21 × 1320 pixels. (S48). At this time, the defect 72 is included in the provisional defective divided image 441 (5-1). Then, the Mahalanobis distance was calculated for each of the provisional defective divided images 441 (5-1) and 441 (5-2) (S49, S50). As a result, since the Mahalanobis distance of the provisional defective divided image 441 (5-1) is larger than the second reference value (S46: YES), the provisional defective divided image 441 (5-1) has a defect. Assume that the inspected image 44 is defective (S54), and the inspection is completed.

以上説明したように、本発明では、被検査画像を分割した分割画像ごとで良否判定をしているので、欠陥が持つ特徴量がノイズに隠れてしまうことを低減でき精度良く検査するこができる。また、良否判定において、良又は不良と確定しないで被検査分割画像に欠陥が存在する可能性があるとする暫定不良と判定する場合を設けているので、不良であるにもかかわらず良と判定したり、良であるにもかかわらず不良であると判定したりする誤判定を防止できる。そして、暫定不良と判定された場合には、その判定された分割画像について、良又は不良と確定できるまで、小さなサイズに画像を分割して良否判定を繰り返し行っているので、元の画像サイズでの良否判定のときよりも、精度良く良否判定をすることができる。また、暫定不良と判定された分割画像について、再分割をして良否判定を再度行っているので、被検査分割画像のサイズを当初から小さなサイズにする必要がない。そのため、被検査画像の良否を効率良く検査することができる。   As described above, in the present invention, since the pass / fail determination is performed for each divided image obtained by dividing the image to be inspected, it is possible to reduce the feature amount of the defect hidden in the noise and to inspect with high accuracy. . In addition, in the pass / fail judgment, there is a case where it is determined that the defect is present in the inspected divided image without being determined to be good or bad, so it is determined to be good despite being defective. Or misjudgment that it is judged to be bad despite being good can be prevented. Then, when it is determined that the provisional failure, the image is divided into small sizes and the pass / fail determination is repeated until the determined divided image is determined to be good or bad. Therefore, it is possible to perform the quality determination with higher accuracy than in the quality determination. Further, since the divided image determined to be provisional defective is re-divided and the pass / fail determination is performed again, it is not necessary to reduce the size of the divided image to be inspected from the beginning. Therefore, it is possible to efficiently inspect the quality of the inspected image.

また、良否判定基準値として、2つの基準値を設けているので、分割画像の良、不良の他に、暫定不良も判定することができる。そして、その2つの基準値は、被検査分割画像及び暫定不良分割画像ごとに設けられているので、それら分割画像ごとで、正確に、良否判定をすることができる。   In addition, since two reference values are provided as the pass / fail judgment reference values, provisional failures can be determined in addition to the pass / fail of the divided image. The two reference values are provided for each of the inspected divided image and the provisional defective divided image, so that the pass / fail judgment can be made accurately for each of the divided images.

また、基準空間は予め作成されているので、効率的に良否判定をすることができる。そして、その基準空間は、複数の良品画像間で同じ位置にある分割画像から作成され、良否判定基準値は、基準空間のマハラノビス距離のうちの最大値を基準として定められるので、一層精度良く良否判定をすることができる。   In addition, since the reference space is created in advance, it is possible to efficiently determine whether it is good or bad. Then, the reference space is created from divided images at the same position among a plurality of non-defective images, and the pass / fail judgment reference value is determined based on the maximum value among the Mahalanobis distance of the reference space, so that pass / fail is more accurate. Judgment can be made.

なお、本発明の画像検査装置、画像検査方法は上記実施形態に限定されず、特許請求の範囲の記載を逸脱しない範囲で種々変形することができる。例えば、良品画像や被検査画像を分割する画像サイズは、上記実施形態に限定されるわけではなく、製品の特徴量や、想定される欠陥の種類、大きさ等を考慮して、適宜設定することができる。また、第一の基準値、第二の基準値も上記実施形態には限定されず、品質の要求レベル等を考慮して適宜設定することができる。例えば、高い品質の要求する場合には、第一、第二の基準値を小さくする。   The image inspection apparatus and the image inspection method of the present invention are not limited to the above-described embodiment, and can be variously modified without departing from the scope of the claims. For example, the image size for dividing the non-defective image or the image to be inspected is not limited to the above-described embodiment, and is appropriately set in consideration of the feature amount of the product, the assumed defect type, size, and the like. be able to. Also, the first reference value and the second reference value are not limited to the above-described embodiment, and can be set as appropriate in consideration of the required level of quality. For example, when high quality is required, the first and second reference values are reduced.

また、マハラノビス・タグチ法では項目選択と呼ばれる方法があり、本発明にこの方法を適用して、検査精度に寄与する項目を選択するようにしてもよい。これにより、より一層、検査精度を向上できる。なお、この項目選択は、品質工学の考え方であるSN比(機能がばらつかない程度)に基づいて、検査精度に寄与する項目を選択するものである。項目選択の基本的な進め方は以下の通りである。   The Mahalanobis-Taguchi method has a method called item selection, and this method may be applied to the present invention to select items that contribute to inspection accuracy. Thereby, the inspection accuracy can be further improved. This item selection is to select an item that contributes to the inspection accuracy based on the SN ratio (the degree that the function does not vary), which is the concept of quality engineering. The basic procedure for selecting items is as follows.

1)予め規定した複数の項目を、水準1:項目を使用する、水準2:項目を使用しないとして直交表に割付ける。
2)直交表の各条件に基づいて、被検査画像から特徴量を抽出する。
3)抽出した特徴量から、直交表の各条件のマハラノビス距離を算出する。
4)算出したマハラノビス距離から、各項目のSN比を算出する。
5)水準2のSN比よりも、水準1のSN比の方が大きくなる項目を、検査精度に寄与する項目として選択する。必要に応じて(検査仕様に合わせて)選択した項目の中から、さらに項目を選択する。
1) Assign a plurality of pre-defined items to the orthogonal table as Level 1: Use item, Level 2: Do not use item.
2) A feature amount is extracted from the inspected image based on each condition of the orthogonal table.
3) The Mahalanobis distance of each condition of the orthogonal table is calculated from the extracted feature quantity.
4) The SN ratio of each item is calculated from the calculated Mahalanobis distance.
5) The item whose level 1 SN ratio is larger than the level 2 SN ratio is selected as an item contributing to the inspection accuracy. Further items are selected from the selected items as required (according to the inspection specification).

1 画像検査装置
2 カメラ
3 照明
4 ワーク
5 電子計算機
6 表示装置
41 良品画像
411 良品分割画像
42、43、44 被検査画像
421、431、441 被検査分割画像
431(1−1)、431(1−2)、431(1−1−1)、431(1−1−2)、431(1−1−3)、441(5−1)、441(5−2) 暫定不良分割画像
71、72 欠陥
81 誤差
S43 分割ステップ、分割手段
S44、S45 作成ステップ、作成手段
S46、S47 良否判定ステップ、良否判定手段
S48 再分割ステップ、再分割手段
S49、S50 再作成ステップ、再作成手段
S51、S52 再良否判定ステップ、再良否判定手段
DESCRIPTION OF SYMBOLS 1 Image inspection apparatus 2 Camera 3 Illumination 4 Work 5 Electronic computer 6 Display apparatus 41 Non-defective image 411 Non-defective product divided image 42, 43, 44 Inspected image 421, 431, 441 Inspected divided image 431 (1-1), 431 (1 -2), 431 (1-1-1), 431 (1-1-2), 431 (1-1-3), 441 (5-1), 441 (5-2) provisional defective divided image 71, 72 Defect 81 Error S43 Division step, division means S44, S45 Creation step, creation means S46, S47 Pass / fail judgment step, pass / fail judgment means S48 Re-segmentation step, re-segmentation means S49, S50 Re-creation step, re-creation means S51, S52 Pass / fail judgment step, re-pass / fail judgment means

Claims (4)

画像の良否の判定を行う画像検査方法であって、
良品画像を複数の画像に分割する良品画像分割ステップと、
その良品画像分割ステップで分割した画像である良品分割画像ごとにマハラノビス距離を算出する算出ステップと、
その算出ステップで算出したマハラノビス距離に基づいて、被検査画像の良否判定の基準となるマハラノビス距離である良否判定基準値を前記良品分割画像ごとに設定する基準値設定ステップと、
被検査画像を前記良品画像の分割と同じ分割となるように複数の画像に分割する分割ステップと、
その分割ステップで分割した画像である被検査分割画像ごとに、マハラノビス距離からなる信号空間を作成する作成ステップと、
前記被検査分割画像のマハラノビス距離を、該被検査分割画像に対応する前記良品分割画像に設定された前記良否判定基準値と比較することによって、前記被検査分割画像ごとで良否判定を行う良否判定ステップと、を含み、
前記良品画像分割ステップでは、複数の前記良品画像を互いに異なるサイズに分割することで、複数種のサイズの前記良品分割画像を得るようにし、
前記基準値設定ステップでは、前記複数種のサイズごとに、前記良品分割画像ごとの前記良否判定基準値を設定し、
前記良否判定ステップは、前記良否判定として、前記比較結果に応じて、前記被検査分割画像を良/不良と判定する他に、良又は不良と確定しないで前記被検査分割画像に欠陥が存在する可能性があるとする暫定不良と判定するステップであり、
前記暫定不良と判定された前記被検査分割画像があった場合、その被検査分割画像を前記複数種のサイズの一つと同じサイズとなるように更に複数の画像に分割する再分割ステップと、
その再分割ステップで分割した画像である暫定不良分割画像の各々に対して、再度、マハラノビス距離からなる信号空間を作成する再作成ステップと、
前記暫定不良分割画像のマハラノビス距離を、該暫定不良分割画像に対応する前記良品分割画像に設定された前記良否判定基準値と比較することによって、前記暫定不良分割画像ごとで前記良否判定を再度行う再良否判定ステップと、
を含み、
その再良否判定ステップにて新たに前記暫定不良と判定された前記暫定不良分割画像があった場合には、良又は不良と確定できるまで、その暫定不良分割画像に対して、前記再分割ステップ、前記再作成ステップ及び前記再良否判定ステップを繰り返し実行することを特徴とする画像検査方法。
An image inspection method for determining the quality of an image,
A non-defective image dividing step for dividing the non-defective image into a plurality of images;
A calculation step of calculating a Mahalanobis distance for each good product divided image that is an image divided in the good product image dividing step;
Based on the Mahalanobis distance calculated in the calculation step, a reference value setting step for setting a pass / fail determination reference value that is a Mahalanobis distance that is a reference for pass / fail determination of an image to be inspected for each of the non-defective product divided images;
A division step of dividing the image to be inspected into a plurality of images so as to be the same division as the division of the non-defective image ;
A creation step for creating a signal space consisting of Mahalanobis distances for each inspected divided image that is an image divided in the division step;
The Mahalanobis distance of the object to be inspected divided picture images, by comparing with the non-defective dividing the quality determination reference value set in the image corresponding to said inspection image segment quality performing quality determination in each of the inspection divided images and the determination step, only including,
In the non-defective image dividing step, the non-defective product divided images having a plurality of sizes are obtained by dividing the non-defective images into different sizes.
In the reference value setting step, for each of the plurality of types of sizes, the pass / fail judgment reference value for each non-defective product divided image is set,
In the pass / fail judgment step, as the pass / fail judgment, in addition to determining the inspected divided image as good / bad according to the comparison result, a defect exists in the inspected divided image without being determined as good or bad. It is a step of determining that there is a possibility of provisional failure,
A subdivision step for further dividing the inspected divided image into a plurality of images so as to be the same size as one of the plurality of sizes, when there is the inspected divided image determined to be the provisional failure;
Re-creating step for creating a signal space consisting of Mahalanobis distance again for each provisional defective divided image that is an image divided in the re-dividing step;
The Mahalanobis distance of the tentative defect divided picture images, by comparing the said quality determination reference value set in the non-defective divided images corresponding to the provisional failure divided image, the quality determination in each of the interim defect divided images again A re-defective determination step to be performed;
Including
If there is the temporary defective divided image newly determined as the provisional defect in the re-defective determination step, the re-dividing step is performed on the temporary defective divided image until it can be determined as good or defective. An image inspection method, wherein the re-creation step and the re-defectiveness determination step are repeatedly executed.
前記基準値設定ステップでは、前記良否判定基準値として、第一の基準値とその第一の基準値よりも大きな第二の基準値の2つの基準値を前記良品分割画像ごとに設定し、
前記良否判定ステップ及び前記再良否判定ステップは、前記良否判定の対象となる分割画像のマハラノビス距離が、対応する前記良品分割画像に設定された前記第一の基準値よりも小さい場合にはその分割画像は良として判定し、その分割画像のマハラノビス距離が、対応する前記良品分割画像に設定された前記第二の基準値よりも大きい場合にはその分割画像は不良として判定し、その分割画像のマハラノビス距離が、前記第一の基準値よりも大きく前記第二の基準値よりも小さい場合には、その分割画像は前記暫定不良として判定するステップであることを特徴とする請求項1に記載の画像検査方法。
In the reference value setting step, two reference values of a first reference value and a second reference value larger than the first reference value are set as the pass / fail judgment reference value for each of the non-defective product divided images.
The pass / fail determination step and the re-pass / fail determination step are performed when the Mahalanobis distance of the divided image to be the pass / fail determination target is smaller than the first reference value set in the corresponding non- defective product split image. The image is determined to be good, and when the Mahalanobis distance of the divided image is larger than the second reference value set for the corresponding non- defective divided image, the divided image is determined to be defective. 2. The step according to claim 1, wherein when the Mahalanobis distance is larger than the first reference value and smaller than the second reference value, the divided image is determined as the provisional defect. Image inspection method.
前記良品画像分割ステップでは、複数の前記良品画像を互いに同じ分割となるように分割するステップを、前記良品画像の分割サイズを変えて複数回実行することで、前記複数種のサイズごとに、前記良品画像における位置が同じとなる複数の前記良品分割画像を得るようにし、
前記基準値設定ステップでは、前記複数種のサイズごとに、前記良品画像における位置が同じとなる複数の前記良品分割画像のマハラノビス距離のうち最大値を基準として前記良否判定基準値を設定することを特徴とする請求項1又は2に記載の画像検査方法。
In the non-defective image dividing step, the step of dividing the plurality of non-defective images so as to be the same as each other is performed a plurality of times while changing the division size of the non-defective images, so that So as to obtain a plurality of the non-defective product divided images having the same position in the non-defective product image,
In the reference value setting step, for each of the plurality of sizes, the pass / fail judgment reference value is set with reference to a maximum value among Mahalanobis distances of the plurality of good product divided images having the same position in the good product image. The image inspection method according to claim 1 or 2 , characterized in that
画像の良否の判定を行う画像検査装置であって、
良品画像を複数の画像に分割する良品画像分割手段と、
その良品画像分割手段が分割した画像である良品分割画像ごとにマハラノビス距離を算出する算出手段と、
その算出手段が算出したマハラノビス距離に基づいて、被検査画像の良否判定の基準となるマハラノビス距離である良否判定基準値を前記良品分割画像ごとに設定する基準値設定手段と、
被検査画像を前記良品画像の分割と同じ分割となるように複数の画像に分割する分割手段と、
その分割手段が分割した画像である被検査分割画像ごとに、マハラノビス距離からなる信号空間を作成する作成手段と、
前記被検査分割画像のマハラノビス距離を、該被検査分割画像に対応する前記良品分割画像に設定された前記良否判定基準値と比較することによって、前記被検査分割画像ごとで良否判定を行う良否判定手段と、を備え
前記良品画像分割手段は、複数の前記良品画像を互いに異なるサイズに分割することで、複数種のサイズの前記良品分割画像を得るようにし、
前記基準値設定手段は、前記複数種のサイズごとに、前記良品分割画像ごとの前記良否判定基準値を設定し、
前記良否判定手段は、前記良否判定として、前記比較結果に応じて、前記被検査分割画像を良/不良と判定する他に、良又は不良と確定しないで前記被検査分割画像に欠陥が存在する可能性があるとする暫定不良と判定するものであり、
前記暫定不良と判定された前記被検査分割画像があった場合、その被検査分割画像を前記複数種のサイズの一つと同じサイズとなるように更に複数の画像に分割する再分割手段と、
その再分割手段が分割した画像である暫定不良分割画像の各々に対して、再度、マハラノビス距離からなる信号空間を作成する再作成手段と、
前記暫定不良分割画像のマハラノビス距離を、該暫定不良分割画像に対応する前記良品分割画像に設定された前記良否判定基準値と比較することによって、前記暫定不良分割画像ごとで前記良否判定を再度行う再良否判定手段と、を備え、
その再良否判定手段にて新たに前記暫定不良と判定された前記暫定不良分割画像があった場合には、良又は不良と確定できるまで、その暫定不良分割画像に対して、前記再分割手段、前記再作成手段及び前記再良否判定手段による処理を繰り返し実行することを特徴とする画像検査装置。
An image inspection apparatus that performs image quality determination,
A non-defective image dividing means for dividing a non-defective image into a plurality of images;
Calculating means for calculating the Mahalanobis distance for each good divided image that is an image divided by the good image dividing means;
Based on the Mahalanobis distance calculated by the calculation means, a reference value setting means for setting a pass / fail judgment reference value that is a Mahalanobis distance serving as a reference for pass / fail judgment of the image to be inspected for each non-defective product divided image;
A dividing means for dividing the image to be inspected into a plurality of images so as to be the same division as the division of the non-defective image ;
Creating means for creating a signal space consisting of Mahalanobis distance for each divided image to be examined, which is an image divided by the dividing means;
The Mahalanobis distance of the object to be inspected divided picture images, by comparing with the non-defective dividing the quality determination reference value set in the image corresponding to said inspection image segment quality performing quality determination in each of the inspection divided images Determination means ,
The non-defective image dividing means divides a plurality of non-defective images into different sizes so as to obtain the non-defective product divided images of a plurality of sizes,
The reference value setting means sets the pass / fail judgment reference value for each non-defective product divided image for each of the plurality of sizes.
The pass / fail judgment means determines whether the test divided image is good / bad according to the comparison result as the pass / fail judgment, and there is a defect in the test divided image without being determined to be good or bad. It is determined as a provisional defect that there is a possibility,
When there is the inspected divided image determined to be the provisional failure, a re-dividing unit that further divides the inspected divided image into a plurality of images so as to be the same size as one of the plurality of sizes ;
Re-creating means for creating a signal space consisting of Mahalanobis distance again for each provisional defective divided image that is an image divided by the re-dividing means,
The Mahalanobis distance of the tentative defect divided picture images, by comparing the said quality determination reference value set in the non-defective divided images corresponding to the provisional failure divided image, the quality determination in each of the interim defect divided images again Re-pass / fail judgment means to perform,
In the case where there is the provisional defect divided image newly determined as the provisional defect by the re-defective / non-defective determination unit, the re-segmentation unit is applied to the provisional defect divided image until it can be determined as good or defective. An image inspection apparatus that repeatedly executes processing by the re-creating unit and the re-defective / non-defective determining unit.
JP2009208135A 2009-09-09 2009-09-09 Image inspection method and image inspection apparatus Active JP5405245B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009208135A JP5405245B2 (en) 2009-09-09 2009-09-09 Image inspection method and image inspection apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009208135A JP5405245B2 (en) 2009-09-09 2009-09-09 Image inspection method and image inspection apparatus

Publications (2)

Publication Number Publication Date
JP2011058926A JP2011058926A (en) 2011-03-24
JP5405245B2 true JP5405245B2 (en) 2014-02-05

Family

ID=43946736

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009208135A Active JP5405245B2 (en) 2009-09-09 2009-09-09 Image inspection method and image inspection apparatus

Country Status (1)

Country Link
JP (1) JP5405245B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5403180B1 (en) * 2013-05-23 2014-01-29 富士ゼロックス株式会社 Image evaluation method, image evaluation apparatus, and image evaluation program
WO2018235266A1 (en) * 2017-06-23 2018-12-27 株式会社Rist Inspection device, inspection method, and inspection program
JP6922539B2 (en) * 2017-08-09 2021-08-18 日立金属株式会社 Surface defect determination method and surface defect inspection device
WO2020026341A1 (en) * 2018-07-31 2020-02-06 オリンパス株式会社 Image analysis device and image analysis method
WO2020183734A1 (en) * 2019-03-14 2020-09-17 株式会社Fuji Quality determination device and quality determination method
WO2024062854A1 (en) * 2022-09-20 2024-03-28 パナソニックIpマネジメント株式会社 Image processing device and image processing method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000275757A (en) * 1999-03-24 2000-10-06 Fuji Photo Film Co Ltd Method and device for evaluating image
JP4366758B2 (en) * 1999-05-27 2009-11-18 コニカミノルタホールディングス株式会社 Region extraction apparatus, region extraction method, and recording medium recording region extraction program
EP1367546B1 (en) * 2002-05-22 2013-06-26 MEI, Inc. Currency Validator
JP2005309878A (en) * 2004-04-23 2005-11-04 Hitachi Zosen Corp Image inspection condition deciding apparatus and image inspecting apparatus

Also Published As

Publication number Publication date
JP2011058926A (en) 2011-03-24

Similar Documents

Publication Publication Date Title
KR101704325B1 (en) Defect observation method and defect observation device
JP5405245B2 (en) Image inspection method and image inspection apparatus
US8041443B2 (en) Surface defect data display and management system and a method of displaying and managing a surface defect data
TW202105549A (en) Method of defect detection on a specimen and system thereof
KR20010093674A (en) Apparatus for testing semiconductor, for analizing defects in semiconductor, for correcting semiconductor design data, and method trherefor, and computer readable recording media
JP2006098151A (en) Pattern inspection device and pattern inspection method
JP2006098152A (en) Apparatus and method for detecting defect
JP2013224833A (en) Visual inspection device, visual inspection method and computer program
JPWO2012057198A1 (en) Image processing apparatus and computer program
JP4250931B2 (en) Appearance inspection apparatus and appearance inspection method
KR101615843B1 (en) Semiconductor measurement device and recording medium
TW201512649A (en) Method of chip detects inspecting, system therefor, and computer program product thereof
TWI783400B (en) Device and method for estimating error factor
JP5419555B2 (en) Image inspection apparatus, image inspection method, and image inspection program
CN113016023B (en) Information processing method and computer-readable non-transitory recording medium
CN115360116B (en) Wafer defect detection method and system
JPH1187446A (en) Apparatus and method for inspection of defect of pattern
JP4166247B2 (en) Semiconductor design data correction method
JP5155938B2 (en) Pattern contour detection method
JP2011232302A (en) Image inspection method and image inspection device
JP2005252451A (en) Image quality inspection method and image quality inspection apparatus
JP4459945B2 (en) Extraction color range setting method
JP6114559B2 (en) Automatic unevenness detector for flat panel display
JP2011058925A (en) Method and device for inspecting image
JP4494424B2 (en) Program and inspection device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120905

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20121016

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130725

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130731

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130906

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20131008

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20131030

R150 Certificate of patent or registration of utility model

Ref document number: 5405245

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250