JP2010286353A - Image inspection device, and method and program for inspecting image - Google Patents

Image inspection device, and method and program for inspecting image Download PDF

Info

Publication number
JP2010286353A
JP2010286353A JP2009140308A JP2009140308A JP2010286353A JP 2010286353 A JP2010286353 A JP 2010286353A JP 2009140308 A JP2009140308 A JP 2009140308A JP 2009140308 A JP2009140308 A JP 2009140308A JP 2010286353 A JP2010286353 A JP 2010286353A
Authority
JP
Japan
Prior art keywords
image
inspection
mahalanobis distance
divided
dividing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2009140308A
Other languages
Japanese (ja)
Inventor
Naoki Mizuno
直樹 水野
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 JP2009140308A priority Critical patent/JP2010286353A/en
Publication of JP2010286353A publication Critical patent/JP2010286353A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image inspection device precisely inspecting images by few input images and reducing data processing loads. <P>SOLUTION: The image inspection device includes: a first dividing section 104 for dividing a reference image utilized for calculating a reference space into a plurality of divided reference images; a threshold determining section 110 for determining a threshold utilized for deciding whether an inspecting image subjected to an image inspection is appropriate, based on the Mahalanobis distance of each of the divided reference images; a second dividing section 124 for dividing the inspecting image into a plurality of divided inspection images; a representative value determining section 128 for determining a representative value, based on the Mahalanobis distance of each of the divided images to be inspected; and a quality determining section 130 for determining that the inspecting image is abnormal, when the representative value is larger than the threshold. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、製品の画像を利用して製品の検査を行う画像検査装置、画像検査方法およびプログラムに関するものである。   The present invention relates to an image inspection apparatus, an image inspection method, and a program for inspecting a product using an image of the product.

従来、CCDカメラなどのカメラにより撮影した製品外観の画像に対し、フィルタリング処理、2値化処理などの画像処理を施し、処理後の画像を用いて、欠陥候補を検出し、製品の良否を判定する画像検査方法が知られている。このような画像検査方法の1つに、マハラノビス・タグチ法(以下、「MT法」と呼ぶ)がある。   Conventionally, image processing such as filtering processing and binarization processing is performed on the product appearance image taken by a camera such as a CCD camera, and defect candidates are detected using the processed image to determine the quality of the product. There are known image inspection methods. One such image inspection method is the Mahalanobis-Taguchi method (hereinafter referred to as “MT method”).

MT法においては、正常な状態の複数の製品画像(製品の分布において、最も出現頻度の高い製品群とするのが一般的である)から、画像の状態を表す複数の項目にしたがい特徴量を抽出し、基準空間を設定し、基準空間から閾値を決定する。そして、画像検査の対象となる被検査画像、すなわち状態が不明な製品画像のマハラノビス距離を算出する。そして、マハラノビス距離と閾値とを比較することにより異常の有無を判断する。   In the MT method, feature values according to a plurality of items representing the state of an image are obtained from a plurality of product images in a normal state (generally, a product group having the highest appearance frequency in the product distribution). Extract, set a reference space, and determine a threshold from the reference space. Then, the Mahalanobis distance of the image to be inspected, ie, the product image whose state is unknown, is calculated. Then, the presence or absence of an abnormality is determined by comparing the Mahalanobis distance with a threshold value.

このように、MT法は多変量解析の手法を用いて製品の状態を判定するので、作業員が目視で製品の状態を判定する目視検査と同様に、様々な情報(特徴量)を基にした総合的な判定を行うことができる。   As described above, the MT method uses a multivariate analysis method to determine the state of the product, and therefore, based on various information (features) as in the visual inspection in which the worker visually determines the state of the product. Comprehensive judgment can be made.

MT法の問題点の一つに、多重共線性がある。多重共線性を生じると、相関行列の逆行列を求めることができなくなる。つまり、マハラノビス距離を算出することができなくなる。多重共線性の要因としては、i)特徴量間の相関が強すぎる、ii)基準空間を構成するサンプル数が特徴量の総数よりも少ないという2点が上げられる。要因ii)に関し、基準空間を構成するサンプル数は、特徴量の総数の2倍以上が適当であると言われている。   One of the problems of the MT method is multicollinearity. When multicollinearity occurs, the inverse matrix of the correlation matrix cannot be obtained. That is, the Mahalanobis distance cannot be calculated. The factors of multicollinearity include two points: i) the correlation between feature quantities is too strong, and ii) the number of samples constituting the reference space is smaller than the total number of feature quantities. Regarding factor ii), it is said that the number of samples constituting the reference space is appropriate to be at least twice the total number of feature values.

画像検査のように画像を扱う場合、画像データの各ピクセルの情報を使うことが多いが、精度良く検査を行うためには、可能な限り細かい基準で、かつ画像全体から特徴量を抽出する必要がある。このため、特徴量は画像サイズの増加とともに増加する。その結果、基準空間作成のために必要な入力画像の数も増加し、データ処理の負担が非常に重くなるという問題があった。例えば、画像サイズが210×1320ピクセルであり、各データ行から10項目に該当する特徴量を抽出するとした場合、特徴量の総数は2100(210行×10項目)となる。つまり、基準空間作成のために必要な入力画像は、4200枚(特徴量の総数の2倍)以上と膨大な数となってしまう。   When handling images as in image inspection, information on each pixel of image data is often used. However, in order to perform inspection accurately, it is necessary to extract feature values from the entire image on the finest possible standard. There is. For this reason, the feature amount increases as the image size increases. As a result, there is a problem that the number of input images necessary for creating the reference space increases and the burden of data processing becomes very heavy. For example, when the image size is 210 × 1320 pixels and feature amounts corresponding to 10 items are extracted from each data row, the total number of feature amounts is 2100 (210 rows × 10 items). That is, the number of input images necessary for creating the reference space is an enormous number of 4200 sheets (twice the total number of feature amounts) or more.

このような問題を解決するものとして、特許文献1には、画像データから抽出した所定の特徴量分布(輝度分布など)に基づいて、マハラノビス距離を算出することにより、少ない特徴量で画像全体のデータから検査を行う方法が開示されている。   In order to solve such a problem, Patent Document 1 discloses that a Mahalanobis distance is calculated based on a predetermined feature amount distribution (such as a luminance distribution) extracted from image data, so that the entire image can be obtained with a small amount of features. A method for examining from data is disclosed.

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

しかしながら、特許文献1に記載の方法では、項目数を減らすことは出来るが、膨大な数の入力画像が必要なことに変わりはなかった。前述の例で説明すると、項目を10から5に減らすことが出来たとしても、特徴量の総数は1050(210行×5項目)であり、2100枚(特徴量の総数の2倍)以上という、膨大な数の入力画像が必要なことに変わりはなかった。   However, in the method described in Patent Document 1, the number of items can be reduced, but the enormous number of input images is still required. In the above example, even if the number of items can be reduced from 10 to 5, the total number of features is 1050 (210 rows × 5 items), which is 2100 or more (twice the total number of features). The enormous number of input images was still necessary.

本発明は、上記に鑑みてなされたものであって、特徴量を減らすことなく、少ない数の入力画像により高精度に画像検査を行うことができ、かつデータ処理の負担を低減することのできる画像検査装置、画像検査方法およびプログラムを提供することを目的とする。   The present invention has been made in view of the above. It is possible to perform image inspection with high accuracy using a small number of input images without reducing the feature amount, and to reduce the burden of data processing. An object is to provide an image inspection apparatus, an image inspection method, and a program.

上述した課題を解決し、目的を達成するために、本発明は、マハラノビス距離により画像検査を行う画像検査装置であって、基準空間の算出に利用する基準画像を複数の分割基準画像に分割する第1分割手段と、前記第1分割手段により得られた複数の前記分割基準画像それぞれのマハラノビス距離を算出する第1算出手段と、前記第1算出手段により算出された複数の前記マハラノビス距離に基づいて、画像検査の対象となる被検査画像の良否判定に利用する閾値を決定する閾値決定手段と、前記被検査画像を、前記分割基準画像と同一サイズ、同一形状の複数の分割被検査画像に分割する第2分割手段と、前記第2分割手段により得られた複数の前記分割被検査画像それぞれのマハラノビス距離を算出する第2算出手段と、前記第2算出手段により算出された前記マハラノビス距離に基づいて、前記被検査画像のマハラノビス距離の代表値を決定する代表値決定手段と、前記被検査画像の前記マハラノビス距離の前記代表値が前記閾値よりも大きい場合に、前記被検査画像に異常があると判定する良否判定手段とを備えたことを特徴とする。   In order to solve the above-described problems and achieve the object, the present invention is an image inspection apparatus that performs image inspection based on the Mahalanobis distance, and divides a reference image used for calculation of a reference space into a plurality of divided reference images. Based on a first dividing means, a first calculating means for calculating a Mahalanobis distance for each of the plurality of division reference images obtained by the first dividing means, and a plurality of the Mahalanobis distances calculated by the first calculating means. A threshold value determining means for determining a threshold value to be used for pass / fail determination of an image to be inspected, and the image to be inspected into a plurality of divided images to be inspected having the same size and shape as the division reference image. Second dividing means for dividing, second calculating means for calculating the Mahalanobis distance of each of the plurality of divided inspection images obtained by the second dividing means, and the second calculation Representative value determining means for determining a representative value of the Mahalanobis distance of the image to be inspected based on the Mahalanobis distance calculated by a stage, and the representative value of the Mahalanobis distance of the image to be inspected is greater than the threshold value Further, it is characterized in that it includes a quality determination means for determining that the image to be inspected is abnormal.

また、他の形態は、マハラノビス距離により画像検査を行う画像検査方法であって、分割手段が、基準空間の算出に利用する基準画像を複数の分割基準画像に分割する第1分割ステップと、第1算出手段が、前記第1分割ステップで得られた複数の前記分割基準画像それぞれのマハラノビス距離を算出する第1算出ステップと、閾値決定手段が、前記第1算出ステップで算出された複数の前記マハラノビス距離に基づいて、画像検査の対象となる被検査画像の良否判定に利用する閾値を決定する閾値決定ステップと、第2分割手段が、前記被検査画像を、前記基準分割画像と同一サイズ、同一形状の複数の分割被検査画像に分割する第2分割ステップと、第2算出手段が、前記第2分割ステップで得られた複数の前記分割被検査画像それぞれのマハラノビス距離を算出する第2算出ステップと、代表値決定手段が、前記第2算出ステップで算出された前記マハラノビス距離に基づいて、前記被検査画像のマハラノビス距離の代表値を決定する代表値決定ステップと、良否判定手段が、前記被検査画像の前記マハラノビス距離の前記代表値が前記閾値よりも大きい場合に、前記被検査画像に異常があると判定する良否判定ステップとを有することを特徴とする。   According to another aspect, there is provided an image inspection method for performing an image inspection based on a Mahalanobis distance, wherein a dividing unit divides a reference image used for calculation of a reference space into a plurality of divided reference images; A first calculating step for calculating a Mahalanobis distance for each of the plurality of division reference images obtained in the first dividing step; and a threshold determining unit for calculating the plurality of the calculated in the first calculating step. Based on the Mahalanobis distance, a threshold value determining step for determining a threshold value used for pass / fail judgment of an image to be inspected, and a second dividing unit, the image to be inspected have the same size as the reference divided image, A second division step for dividing the image into a plurality of divided inspection images having the same shape; and a plurality of the divided inspection images obtained in the second division step by a second calculation unit. A second calculation step for calculating the Mahalanobis distance, and a representative value determination unit for determining a representative value of the Mahalanobis distance of the image to be inspected based on the Mahalanobis distance calculated by the second calculation step by the representative value determination means. And a pass / fail judgment step for judging that the inspected image is abnormal when the representative value of the Mahalanobis distance of the inspected image is larger than the threshold. .

また、他の形態は、マハラノビス距離による画像検査処理をコンピュータに実行させるための画像検査プログラムであって、基準空間の算出に利用する基準画像を複数の分割基準画像に分割する第1分割ステップと、前記第1分割ステップで得られた複数の前記分割基準画像それぞれのマハラノビス距離を算出する第1算出ステップと、前記第1算出ステップで算出された複数の前記マハラノビス距離に基づいて、画像検査の対象となる被検査画像の良否判定に利用する閾値を決定する閾値決定ステップと、前記被検査画像を、前記基準分割画像と同一サイズ、同一形状の複数の分割被検査画像に分割する第2分割ステップと、前記第2分割ステップで得られた複数の前記分割被検査画像それぞれのマハラノビス距離を算出する第2算出ステップと、前記第2算出ステップで算出された前記マハラノビス距離に基づいて、前記被検査画像のマハラノビス距離の代表値を決定する代表値決定ステップと、前記被検査画像の前記マハラノビス距離の前記代表値が前記閾値よりも大きい場合に、前記被検査画像に異常があると判定する良否判定ステップとを前記コンピュータに実行させるためのプログラムである。   According to another aspect, there is provided an image inspection program for causing a computer to perform image inspection processing based on the Mahalanobis distance, wherein the reference image used for calculating the reference space is divided into a plurality of divided reference images. A first calculation step of calculating a Mahalanobis distance for each of the plurality of division reference images obtained in the first division step, and an image inspection based on the plurality of the Mahalanobis distances calculated in the first calculation step. A threshold value determining step for determining a threshold value used for pass / fail judgment of the target inspection image; and a second division for dividing the inspection image into a plurality of divided inspection images having the same size and the same shape as the reference divided image And a second calculation step for calculating a Mahalanobis distance for each of the plurality of divided inspection images obtained in the second division step. And a representative value determining step for determining a representative value of the Mahalanobis distance of the inspected image based on the Mahalanobis distance calculated in the second calculating step, and the representative value of the Mahalanobis distance of the inspected image Is a program for causing the computer to execute a pass / fail determination step for determining that the image to be inspected has an abnormality when is larger than the threshold.

本発明によれば、特徴量を減らすことなく、少ない数の入力画像により高精度に画像検査を行うことができ、かつデータ処理の負担を低減することができるという効果を奏する。   According to the present invention, it is possible to perform image inspection with high accuracy using a small number of input images without reducing the feature amount, and to reduce the burden of data processing.

図1は、本発明の実施の形態にかかる画像検査装置10の全体構成を示す図である。FIG. 1 is a diagram showing an overall configuration of an image inspection apparatus 10 according to an embodiment of the present invention. 図2は、電子計算機14の構成を示すブロック図である。FIG. 2 is a block diagram showing a configuration of the electronic computer 14. 図3は、分割基準画像を示す図である。FIG. 3 is a diagram illustrating a division reference image. 図4は、基準空間を作成する際の電子計算機14の処理を示すフローチャートである。FIG. 4 is a flowchart showing the processing of the electronic computer 14 when creating the reference space. 図5は、輝度波形を説明するための図である。FIG. 5 is a diagram for explaining the luminance waveform. 図6−1は、輝度波形の微分値および積分値を説明するための図である。FIG. 6A is a diagram for explaining a differential value and an integral value of a luminance waveform. 図6−2は、輝度波形の微分値および積分値を説明するための図である。FIG. 6B is a diagram for explaining the differential value and the integral value of the luminance waveform. 図7は、特徴量Xmnkの行列を示す図である。FIG. 7 is a diagram illustrating a matrix of the feature amount X mnk . 図8は、規準化した特徴量xmnkの行列を示す図である。FIG. 8 is a diagram illustrating a matrix of normalized feature values x mnk . 図9は、マハラノビス距離の算出処理を説明するための図である。FIG. 9 is a diagram for explaining the Mahalanobis distance calculation processing. 図10は、電子計算機14による被検査画像の良否判定処理を示すフローチャートである。FIG. 10 is a flowchart showing the pass / fail determination process for the inspected image by the electronic computer 14. 図11は、マハラノビス距離の算出処理を説明するための図である。FIG. 11 is a diagram for explaining the Mahalanobis distance calculation process. 図12は、第1の変更例を説明するための図である。FIG. 12 is a diagram for explaining a first modification. 図13は、第2の変更例を説明するための図である。FIG. 13 is a diagram for explaining a second modification. 図14は、第3の変更例を説明するための図である。FIG. 14 is a diagram for explaining a third modification.

以下に添付図面を参照して、この発明にかかる画像検査装置、画像検査方法およびプログラムの最良な実施の形態を詳細に説明する。   Exemplary embodiments of an image inspection apparatus, an image inspection method, and a program according to the present invention are explained in detail below with reference to the accompanying drawings.

図1は、本発明の実施の形態にかかる画像検査装置10の全体構成を示す図である。画像検査装置10は、検査対象であるワーク20の概観を撮影し、得られた画像データに基づいて検査を行う。ワーク20は、例えば切削加工した金属部品であり、ワーク20の表面にある、傷、バリ、異物などの欠陥の有無の検査を要するものである。画像検査装置10は、このワーク20を被検査品とし、ワーク20の欠陥の有無の検査を行う。   FIG. 1 is a diagram showing an overall configuration of an image inspection apparatus 10 according to an embodiment of the present invention. The image inspection apparatus 10 captures an overview of the work 20 that is an inspection target, and performs an inspection based on the obtained image data. The workpiece 20 is, for example, a metal part that has been machined, and requires inspection for the presence of defects such as scratches, burrs, and foreign matters on the surface of the workpiece 20. The image inspection apparatus 10 uses the workpiece 20 as an inspected product, and inspects the workpiece 20 for defects.

画像検査装置10は、カメラ12と、照明13と、電子計算機14と、表示装置15とを備えている。カメラ12は、ワーク20の概観を撮影し、ワーク20の画像データである被検査画像を得る。カメラ12は、具体的にはCCDカメラである。なお、他の例としては、カメラ12として、CMOSカメラ、アナログカメラなどを使用してもよい。照明13は、カメラ12によりワーク20の概観を撮像する際に、ワーク20の撮像箇所の明るさを調整する。照明13は、具体的にはLEDリング照明である。他の例としては、照明13として、ファイーバー照明、LED照明、リング照明、同軸落射照明などを使用してもよい。   The image inspection apparatus 10 includes a camera 12, an illumination 13, an electronic calculator 14, and a display device 15. The camera 12 takes an overview of the workpiece 20 and obtains an inspection image that is image data of the workpiece 20. The camera 12 is specifically a CCD camera. As another example, a CMOS camera, an analog camera, or the like may be used as the camera 12. The illumination 13 adjusts the brightness of the imaging location of the workpiece 20 when the camera 12 captures an overview of the workpiece 20. Illumination 13 is specifically LED ring illumination. As another example, fiber illumination, LED illumination, ring illumination, coaxial incident illumination, or the like may be used as the illumination 13.

カメラ12により撮影された被検査画像は、電子計算機14に送られる。電子計算機14は、被検査画像に対する画像処理を施した後、画像処理後の被検査画像に基づいて、ワーク20の欠陥の有無の判定、すなわち良否判定を行い、良否判定の結果を表示装置15に表示させる。   The inspected image taken by the camera 12 is sent to the electronic computer 14. The electronic computer 14 performs image processing on the image to be inspected, and then determines whether there is a defect in the work 20 based on the image to be inspected, that is, quality determination, and displays the result of quality determination on the display device 15. To display.

なお、カメラ12は、良品であることがわかっている製品の撮影も行う。これにより、基準画像を得る。ここで、基準画像は、最も正常な状態にある複数の製品それぞれの画像である。すなわち、出現頻度が最も高くなる良品画像群の画像データであり、マハラノビス基準空間を作成するために利用する画像群である。電子計算機14は、複数の基準画像に基づいて、良品判定の際に利用するマハラノビス基準空間を作成する。   The camera 12 also shoots products that are known to be good. Thereby, a reference image is obtained. Here, the reference image is an image of each of a plurality of products in the most normal state. That is, it is image data of a non-defective image group having the highest appearance frequency, and is an image group used to create a Mahalanobis reference space. The electronic computer 14 creates a Mahalanobis reference space to be used for non-defective product determination based on a plurality of reference images.

図2は、電子計算機14の構成を示すブロック図である。電子計算機14は、基準画像取得部100と、第1画像処理部102と、第1分割部104と、第1マハラノビス距離算出部106と、基準空間記憶部108と、閾値決定部110と、閾値記憶部112と、被検査画像取得部120と、第2画像処理部122と、第2分割部124と、第2マハラノビス距離算出部126と、代表値決定部128と、良否判定部130とを備えている。   FIG. 2 is a block diagram showing a configuration of the electronic computer 14. The electronic computer 14 includes a reference image acquisition unit 100, a first image processing unit 102, a first division unit 104, a first Mahalanobis distance calculation unit 106, a reference space storage unit 108, a threshold value determination unit 110, a threshold value A storage unit 112, an inspected image acquisition unit 120, a second image processing unit 122, a second division unit 124, a second Mahalanobis distance calculation unit 126, a representative value determination unit 128, and a pass / fail determination unit 130 I have.

基準画像取得部100は、カメラ12から複数の基準画像を取得する。第1画像処理部102は、基準画像取得部100が取得した基準画像に対して、フィルタリングやエッジ強調などの画像処理を施す。第1分割部104は、画像処理後の基準画像を複数の分割基準画像に分割する。図3は、分割基準画像を示す図である。このように、第1画像処理部102は、基準画像を横方向に延びる分割線により横方向にn分割し、n個の分割基準画像を得る。例えば、210×1320ピクセルの画像を、10×1320ピクセルの21個の分割基準画像に分割する。   The reference image acquisition unit 100 acquires a plurality of reference images from the camera 12. The first image processing unit 102 performs image processing such as filtering and edge enhancement on the reference image acquired by the reference image acquisition unit 100. The first dividing unit 104 divides the reference image after image processing into a plurality of divided reference images. FIG. 3 is a diagram illustrating a division reference image. As described above, the first image processing unit 102 divides the reference image in the horizontal direction by the dividing lines extending in the horizontal direction to obtain n divided reference images. For example, an image of 210 × 1320 pixels is divided into 21 division reference images of 10 × 1320 pixels.

第1マハラノビス距離算出部106は、第1分割部104により得られた分割基準画像を用いて、マハラノビス距離を算出する。第1マハラノビス距離算出部106は、マハラノビス距離およびマハラノビス距離を算出する際に用いたパラメータを基準空間記憶部108に格納する。閾値決定部110は、第1マハラノビス距離算出部106により得られたマハラノビス距離に基づいて、ワーク20の画像、すなわち被検査画像に異常があるか否かの良否判定に利用する閾値を決定する。閾値決定部110はさらに決定した閾値を閾値記憶部112に格納する。   The first Mahalanobis distance calculation unit 106 calculates the Mahalanobis distance using the division reference image obtained by the first division unit 104. The first Mahalanobis distance calculation unit 106 stores the parameters used when calculating the Mahalanobis distance and the Mahalanobis distance in the reference space storage unit 108. Based on the Mahalanobis distance obtained by the first Mahalanobis distance calculation unit 106, the threshold determination unit 110 determines a threshold used to determine whether or not the image of the workpiece 20, that is, the image to be inspected is abnormal. The threshold value determination unit 110 further stores the determined threshold value in the threshold value storage unit 112.

被検査画像取得部120は、カメラ12から、カメラ12により撮影された被検査品の画像である、被検査画像を取得する。第2画像処理部122は、被検査画像に対して第1画像処理部102と同様の画像処理を施す。このように、画像処理を施すことにより、欠陥の検出を容易にすることができる。なお、基準画像と被検査画像に対し、同一条件化で検査を行うべく、基準画像に対しても画像処理を施すこととしている。   The inspected image acquisition unit 120 acquires from the camera 12 an inspected image that is an image of an inspected product photographed by the camera 12. The second image processing unit 122 performs the same image processing as the first image processing unit 102 on the inspection image. In this way, the defect detection can be facilitated by performing the image processing. Note that image processing is also performed on the reference image in order to inspect the reference image and the image to be inspected under the same conditions.

第2分割部124は、被検査画像を複数の分割被検査画像に分割する。なお、第2分割部124は、第1分割部104と同一形状および同一サイズの複数の画像に分割する。   The second dividing unit 124 divides the inspection image into a plurality of divided inspection images. The second dividing unit 124 divides the image into a plurality of images having the same shape and the same size as the first dividing unit 104.

第2マハラノビス距離算出部126は、基準空間記憶部108が記憶しているパラメータを利用して、第2分割部124により得られた各分割被検査画像のマハラノビス距離を算出する。代表値決定部128は、第2マハラノビス距離算出部126により得られた複数のマハラノビス距離に基づいて、被検査画像のマハラノビス距離の代表値を決定する。良否判定部130は、閾値記憶部112が記憶している閾値と代表値とを比較することにより、被検査画像に対応する製品が良品であるか不良品であるかの判定を行う。具体的には、代表値が閾値よりも大きい場合に異常がある、すなわち不良品であると判定し、代表値が閾値以下である場合に異常なし、すなわち良品であると判定する。   The second Mahalanobis distance calculating unit 126 calculates the Mahalanobis distance of each divided inspection image obtained by the second dividing unit 124 using the parameters stored in the reference space storage unit 108. The representative value determining unit 128 determines a representative value of the Mahalanobis distance of the image to be inspected based on the plurality of Mahalanobis distances obtained by the second Mahalanobis distance calculating unit 126. The pass / fail determination unit 130 determines whether the product corresponding to the image to be inspected is a non-defective product or a defective product by comparing the threshold value stored in the threshold value storage unit 112 with the representative value. Specifically, when the representative value is larger than the threshold value, it is determined that there is an abnormality, that is, a defective product, and when the representative value is equal to or less than the threshold value, it is determined that there is no abnormality, that is, a non-defective product.

図4は、基準空間を作成する際の電子計算機14の処理を示すフローチャートである。基準空間作成処理においては、まず基準画像取得部100は、カメラ12により撮影された、最も正常な状態にある製品の画像、すなわち基準画像を取得する(ステップS100)。基準画像取得部100は、例えばM個の基準画像を取得する。次に、第1画像処理部102は、基準画像に対して画像処理を施す(ステップS102)。次に、第1分割部104は、画像処理後の各基準画像を複数の分割基準画像に分割する(ステップS104)。   FIG. 4 is a flowchart showing the processing of the electronic computer 14 when creating the reference space. In the reference space creation process, first, the reference image acquisition unit 100 acquires an image of a product in the most normal state, which is taken by the camera 12, that is, a reference image (step S100). The reference image acquisition unit 100 acquires, for example, M reference images. Next, the first image processing unit 102 performs image processing on the reference image (step S102). Next, the first dividing unit 104 divides each reference image after image processing into a plurality of divided reference images (step S104).

次に、第1マハラノビス距離算出部106は、各分割基準画像に演算処理を施し、予め規定されている数の項目に基づいて、各分割基準画像の各行(ライン)の特徴量を抽出する(ステップS106)。特徴量は、例えば、輝度波形の微分値、積分値、輝度最大値と輝度最小値の差分など輝度情報に関する情報である。   Next, the first Mahalanobis distance calculation unit 106 performs arithmetic processing on each division reference image, and extracts the feature amount of each row (line) of each division reference image based on a predetermined number of items ( Step S106). The feature amount is information relating to luminance information such as a differential value, an integral value of a luminance waveform, and a difference between a luminance maximum value and a luminance minimum value, for example.

図5は、輝度波形を説明するための図である。図5のグラフの横軸は分割基準画像の所定のラインにおける画素位置を示し、縦軸は各画素の輝度値を示している。グラフ上の曲線が輝度波形である。輝度波形は、画素の行(ライン)毎に各画素の輝度値を波形化したもの、すなわち各行に含まれる各画素と各画素における輝度値との関係を示す波形である。   FIG. 5 is a diagram for explaining the luminance waveform. The horizontal axis of the graph in FIG. 5 indicates the pixel position in a predetermined line of the divided reference image, and the vertical axis indicates the luminance value of each pixel. The curve on the graph is the luminance waveform. The luminance waveform is a waveform obtained by converting the luminance value of each pixel into a waveform for each row (line) of pixels, that is, a relationship between each pixel included in each row and the luminance value in each pixel.

図6−1および図6−2は、輝度波形の微分値および積分値を説明するための図である。第1マハラノビス距離算出部106は、輝度波形に対して任意の輝度値の直線、すなわち横線を引き、横線と輝度波形の交点数を微分値として得る。また、横線よりも上の輝度波形の区間総和を積分値として得る。第1マハラノビス距離算出部106は、例えば所定の行に含まれる複数の輝度値の平均値をμ、標準偏差をσとし、μ±σ、μ±0.8σ、μ±0.6σ、・・・のように等間隔に横線を設定し、各横線に対する微分値、積分値を特徴量として算出する。このようにして、第1マハラノビス距離算出部106は、合計K個の特徴量を抽出する。なお、本実施の形態においては、100の項目(K=100)に対する特徴量を抽出することとする。   FIGS. 6A and 6B are diagrams for explaining the differential value and the integral value of the luminance waveform. The first Mahalanobis distance calculation unit 106 draws a straight line having an arbitrary luminance value, that is, a horizontal line, from the luminance waveform, and obtains the number of intersections of the horizontal line and the luminance waveform as a differential value. Further, the sum of the sections of the luminance waveform above the horizontal line is obtained as an integrated value. For example, the first Mahalanobis distance calculating unit 106 sets μ ± σ, μ ± 0.8σ, μ ± 0.6σ, where μ is an average value of a plurality of luminance values included in a predetermined row, and σ is a standard deviation.・ Set horizontal lines at regular intervals as shown in Fig. 5 and calculate the differential value and integral value for each horizontal line as the feature value. In this way, the first Mahalanobis distance calculation unit 106 extracts a total of K feature values. In the present embodiment, feature amounts for 100 items (K = 100) are extracted.

第1マハラノビス距離算出部106は、さらに図7に示すように、各部分基準画像の特徴量Xmnkを基準画像毎、分割基準画像毎、項目毎に配置し行列とする。ここで、添え字m(I,II,…M)は、基準画像を識別する番号(基準画像No)、添え字n(1,2,・・・N)は、基準画像中の分割基準画像を識別する番号(分割基準画像No)、添え字k(1,2,・・・K)は項目を識別する番号(項目No)を示している。図7は、特徴量Xmnkの行列を示す図である。このように、M個の基準画像それぞれがN個の分割基準画像を有し、すべての分割画像についてK個の項目に対する特徴量が抽出される。 Further, as shown in FIG. 7, the first Mahalanobis distance calculation unit 106 arranges the feature amount X mnk of each partial reference image for each reference image, for each divided reference image, and for each item to form a matrix. Here, the subscript m (I, II,... M) is a number for identifying the reference image (reference image No), and the subscript n (1, 2,... N) is a divided reference image in the reference image. The number identifying the item (division reference image No) and the subscript k (1, 2,... K) indicate the number identifying the item (item No.). FIG. 7 is a diagram illustrating a matrix of the feature amount X mnk . In this way, each of the M reference images has N divided reference images, and feature amounts for K items are extracted for all the divided images.

さらに、第1マハラノビス距離算出部106は、各特徴量を規準化する(ステップS108)。具体的には、項目毎に特徴量の平均値μと、標準偏差σを算出し、(式1)により、規準化した特徴量xmnkを算出し、図8に示すように特徴量xmnkの行列とする。

Figure 2010286353
Further, the first Mahalanobis distance calculation unit 106 normalizes each feature amount (step S108). Specifically, the average value μ k and the standard deviation σ k of the feature amount are calculated for each item, the normalized feature amount x mnk is calculated according to (Equation 1), and the feature amount is as shown in FIG. Let x mnk be a matrix.
Figure 2010286353

次に、第1マハラノビス距離算出部106は、(式2)により項目pと項目qの相関係数rpqを算出し、各相関係数を要素とする相関係数行列Rを得る(ステップS110)。

Figure 2010286353
相関係数行列Rは、(式3)に示すように、相関係数を画像毎、項目毎に並べたものである。
Figure 2010286353
Next, the first Mahalanobis distance calculation unit 106 calculates the correlation coefficient rpq of the item p and the item q by (Equation 2), and obtains a correlation coefficient matrix R having each correlation coefficient as an element (step S110). ).
Figure 2010286353
The correlation coefficient matrix R is obtained by arranging correlation coefficients for each image and for each item, as shown in (Expression 3).
Figure 2010286353

次に、第1マハラノビス距離算出部106は、相関係数行列Rの逆行列Aを算出する(ステップS112)。逆行列Aは、(式4)で表される。

Figure 2010286353
Next, the first Mahalanobis distance calculation unit 106 calculates an inverse matrix A of the correlation coefficient matrix R (step S112). The inverse matrix A is expressed by (Formula 4).
Figure 2010286353

次に、第1マハラノビス距離算出部106は、(式5)により、m番目の基準画像のn番目の分割基準画像のマハラノビス距離MDmnを算出する(ステップS114)。なお、第1マハラノビス距離算出部106は、図9に示すように、すべての基準画像のすべての分割基準画像のマハラノビス距離MDを算出する。

Figure 2010286353
次に、第1マハラノビス距離算出部106は、項目毎の平均値μ、標準偏差σ、逆行列Aを基準空間のパラメータとして基準空間記憶部108に格納する(ステップS116)。 Next, the first Mahalanobis distance calculation unit 106 calculates the Mahalanobis distance MD mn of the nth divided reference image of the mth reference image by (Equation 5) (step S114). The first Mahalanobis distance calculation unit 106 calculates the Mahalanobis distance MD of all the divided reference images of all the reference images as shown in FIG.
Figure 2010286353
Next, the first Mahalanobis distance calculation unit 106 stores the average value μ k , standard deviation σ k , and inverse matrix A for each item in the reference space storage unit 108 as parameters of the reference space (step S116).

次に、閾値決定部110は、第1マハラノビス距離算出部106により算出された複数のマハラノビス距離から、単位空間を代表する1つのマハラノビス距離MDを特定する(ステップS118)。具体的には、複数のマハラノビス距離MDI1〜MDMNの最大値を単位空間を代表するマハラノビス距離MDとする。そして、閾値決定部110は、誤差範囲を考慮し、このマハラノビス距離MDよりもわずかに大きい値を閾値として決定し、これを閾値記憶部112に格納する(ステップS120)。例えば、マハラノビス距離MDTが1.9である場合には、閾値を2.0と決定してもよい。また、他の例としては、マハラノビス距離MDを閾値としてもよい。以上で、基準空間作成処理が完了する。 Next, the threshold determination unit 110, a plurality of Mahalanobis distances calculated by the first Mahalanobis distance calculation unit 106 identifies one of Mahalanobis distance MD T representing the unit space (step S118). Specifically, the Mahalanobis distance MD T representing a unit space maximum value of the plurality of Mahalanobis distance MD I1 ~MD MN. Then, the threshold determination unit 110, in consideration of an error range, determine a value slightly larger than the Mahalanobis distance MD T as the threshold, and stores it in the threshold storage unit 112 (step S120). For example, when the Mahalanobis distance MDT is 1.9, the threshold value may be determined as 2.0. As another example, it may be a threshold the Mahalanobis distance MD T. This completes the reference space creation process.

図10は、電子計算機14による被検査画像の良否判定処理を示すフローチャートである。良否判定処理においては、まず被検査画像取得部120は、カメラ12から被検査画像を取得する(ステップS200)。次に、第2画像処理部122は、被検査画像に対して画像処理を施す(ステップS202)。なお、被検査画像に対して施す画像処理は、基準画像に対して施す画像処理と同様のものである。   FIG. 10 is a flowchart showing the pass / fail determination process for the inspected image by the electronic computer 14. In the quality determination process, first, the inspection image acquisition unit 120 acquires an inspection image from the camera 12 (step S200). Next, the second image processing unit 122 performs image processing on the inspection image (step S202). Note that the image processing performed on the image to be inspected is similar to the image processing performed on the reference image.

次に、第2分割部124は、被検査画像を複数の分割被検査画像に分割する(ステップS204)。なお、第2分割部124は、第1分割部104と同一形状、同一サイズの画像に分割する。具体的には、第2分割部124も第1分割部104と同様に、図3に示すように被検査画像の縦辺を分割し、n個の分割被検査画像を得る。   Next, the second dividing unit 124 divides the inspection image into a plurality of divided inspection images (Step S204). The second dividing unit 124 divides the image into the same shape and the same size as the first dividing unit 104. Specifically, as in the first dividing unit 104, the second dividing unit 124 also divides the vertical side of the inspection image as shown in FIG. 3 to obtain n divided inspection images.

次に、第2マハラノビス距離算出部126は、各分割画像の特徴量を抽出し(ステップS206)、特徴量を規準化する(ステップS208)。なお、規準化においては、基準空間記憶部108が記憶している、単位空間作成時の項目毎の平均値μ、標準偏差σを利用する。 Next, the second Mahalanobis distance calculation unit 126 extracts the feature amount of each divided image (step S206), and normalizes the feature amount (step S208). In normalization, the average value μ k and standard deviation σ k for each item when the unit space is created, which is stored in the reference space storage unit 108, is used.

次に、第2マハラノビス距離算出部126は、図11に示すように、すべての分割被検査画像のマハラノビス距離MD〜MDを算出する(ステップS210)。なお、マハラノビス距離の算出においては、基準空間記憶部108が記憶する逆行列Aを利用する。なお、特徴量の抽出、規準化、およびマハラノビス距離算出の処理は、上記のように一部パラメータが異なる点と対象とする画像が異なる点を除いては、基準空間を作成する際の特徴量の抽出、規準化、およびマハラノビス距離算出の処理と同様である。 Next, as shown in FIG. 11, the second Mahalanobis distance calculation unit 126 calculates the Mahalanobis distances MD 1 to MD n of all the divided inspection images (step S210). In calculating the Mahalanobis distance, the inverse matrix A stored in the reference space storage unit 108 is used. It should be noted that the feature quantity extraction, normalization, and Mahalanobis distance calculation processes are the same as those described above, except that some parameters are different and the target image is different. Extraction, normalization, and Mahalanobis distance calculation processing.

次に、代表値決定部128は、第2マハラノビス距離算出部126により算出された複数のマハラノビス距離MD〜MDから、被検査画像のマハラノビス距離を代表する代表値MDを決定する(ステップS212)。具体的には、複数のマハラノビス距離MD〜MDの最大値を被検査画像のマハラノビス距離の代表値MDとする。 Then, the representative value determining unit 128, a plurality of Mahalanobis distances MD 1 to MD n calculated by the second Mahalanobis distance calculation unit 126 determines a representative value MD H representing the Mahalanobis distance of the inspection image (step S212). Specifically, the maximum value of the plurality of Mahalanobis distances MD 1 to MD n is set as the representative value MD H of the Mahalanobis distance of the inspected image.

次に、良否判定部130は、閾値記憶部112が記憶している閾値と、代表値決定部128が決定した代表値とを比較することにより、被検査画像の良否判定を行う。代表値が閾値よりも大きい場合には(ステップS214,Yes)、被検査画像に異常がある、すなわちワーク20は不良品であると判定する(ステップS216)。一方、代表値が閾値以下である場合には(ステップS214,No)、被検査画像は正常である、すなわちワーク20は良品であると判定する(ステップS218)。次に、良否判定部130は、異常の有無、すなわち良品であるか不良品であるかを示す判定結果を表示装置15に出力し(ステップS220)、表示装置15に判定結果が表示される。以上で、被検査画像の良否判定処理が完了する。   Next, the quality determination unit 130 determines the quality of the image to be inspected by comparing the threshold value stored in the threshold value storage unit 112 with the representative value determined by the representative value determination unit 128. If the representative value is larger than the threshold value (step S214, Yes), it is determined that there is an abnormality in the image to be inspected, that is, the workpiece 20 is a defective product (step S216). On the other hand, when the representative value is equal to or less than the threshold value (No at Step S214), it is determined that the inspected image is normal, that is, the workpiece 20 is a non-defective product (Step S218). Next, the pass / fail judgment unit 130 outputs a judgment result indicating whether there is an abnormality, that is, a non-defective product or a defective product, to the display device 15 (step S220), and the judgment result is displayed on the display device 15. This completes the quality determination process for the image to be inspected.

例えば、閾値が2.0に設定されており、被検査画像の代表値MDが2.3である場合には、代表値が閾値よりも大きいので、被検査画像に異常があり不良品であると判定される。 For example, it is set to the threshold value of 2.0, if the representative value MD H inspection image is 2.3, since the representative value is greater than the threshold value, defective there is abnormality in the inspection image It is determined that there is.

以上のように、本実施の形態にかかる画像検査装置10は、入力画像としての基準画像を複数の分割基準画像に分割し、この分割基準画像毎にマハラノビス距離を算出し、この複数のマハラノビス距離から算出した一つのマハラノビス距離を用いて、良否判定を行うものである。このように、基準空間を構成するサンプルが入力画像ではなく、分割画像となるため、項目数を減らすことなく、少ない入力画像で基準空間を作成し、高精度に画像検査を行うことができる。   As described above, the image inspection apparatus 10 according to the present embodiment divides a reference image as an input image into a plurality of divided reference images, calculates a Mahalanobis distance for each divided reference image, and the plurality of Mahalanobis distances. The pass / fail judgment is performed using one Mahalanobis distance calculated from the above. As described above, since the sample constituting the reference space is not an input image but a divided image, it is possible to create a reference space with a small number of input images and perform image inspection with high accuracy without reducing the number of items.

例えば、項目数が100、画像サイズが210×1320ピクセルであり、入力画像の各行から特徴量を抽出するとした場合、従来の方法では、特徴量の総数は21000(210行×100項目)となるため、42000枚(特徴量の総数の2倍)以上という膨大な数の入力画像が必要である。これに対し、本実施の形態にかかる画像検査装置10においては、入力画像を10×1320ピクセルの画像に分割すれば、特徴量の総数は1000(10行×100項目)となり、2000枚(特徴量の総数の2倍)以上の入力画像が必要となるものの、一つの入力画像から21個(210行÷10行)の分割画像を得ることができるため、必要な入力画像は約100枚(2000枚÷21)と従来の1/20に大幅に削減することができる。   For example, when the number of items is 100, the image size is 210 × 1320 pixels, and feature amounts are extracted from each row of the input image, the total number of feature amounts is 21000 (210 rows × 100 items) in the conventional method. Therefore, an enormous number of input images of 42,000 sheets (twice the total number of feature amounts) or more are required. On the other hand, in the image inspection apparatus 10 according to the present embodiment, if the input image is divided into 10 × 1320 pixel images, the total number of feature amounts is 1000 (10 rows × 100 items), which is 2000 (features). Although more than two input images are required, 21 divided images (210 rows / 10 rows) can be obtained from one input image, so the required input images are about 100 ( 2000 sheets / 21) and can be greatly reduced to 1/20 of the conventional one.

さらに、本実施の形態にかかる画像検査装置10においては、基準空間における複数のマハラノビス距離のうち最大値を閾値とし、また被検査画像の複数のマハラノビス距離のうち最大値を代表値とすることにより、欠陥検出精度を向上させることができる。   Furthermore, in the image inspection apparatus 10 according to the present embodiment, the maximum value among the plurality of Mahalanobis distances in the reference space is set as a threshold value, and the maximum value among the plurality of Mahalanobis distances in the image to be inspected is set as a representative value. , Defect detection accuracy can be improved.

また、実施の形態にかかる画像検査装置10の第1の変更例としては、第1分割部104および第2分割部124は、サイズおよび大きさの異なる複数の画像に分割してもよい。例えば、欠陥が発生する箇所に傾向が見られる場合がある。このような場合には、図12に示すように、欠陥が多発することが予めわかっている多発領域を他の領域に比べて小さい画像に分割することとしてもよい。これにより、異常発生箇所をより細かい精度で特定することができる。このように、処理量を増加させることなく、欠陥の検出精度をより向上させることができる。   As a first modification of the image inspection apparatus 10 according to the embodiment, the first dividing unit 104 and the second dividing unit 124 may be divided into a plurality of images having different sizes and sizes. For example, there is a case where a tendency is observed at a location where a defect occurs. In such a case, as shown in FIG. 12, it is good also as dividing | segmenting the frequent occurrence area | region known that a defect occurs frequently into a smaller image compared with another area | region. Thereby, the abnormality occurrence location can be specified with finer accuracy. Thus, the defect detection accuracy can be further improved without increasing the processing amount.

また、第2の変更例としては、欠陥の形状が予め予想可能な場合には、この形状に応じたサイズおよび形状の画像に分割してもよい。例えば、図13に示すように、画像の横方向に延びる欠陥が多発するとする。この場合には、実施の形態において説明したように画像の横方向に延びる分割線により横方向に分割した場合、ある分割被検査画像に欠陥部分が一様に分布する可能性がある。このように一様に欠陥が含まれると異常として検出されなくなるため好ましくない。そこで、画像の横方向に延びる欠陥が多発する場合には、図13に示すように縦方向に延びる分割線により縦方向に分割し、n個の画像に分割する。このように、欠陥の形状に応じたサイズおよび形状の分割画像に分割することにより、欠陥検出精度をより向上させることができる。   As a second modification, when the shape of the defect can be predicted in advance, the image may be divided into images having a size and shape corresponding to the shape. For example, as shown in FIG. 13, it is assumed that there are many defects extending in the horizontal direction of the image. In this case, as described in the embodiment, when the image is divided in the horizontal direction by the dividing line extending in the horizontal direction of the image, there is a possibility that defective portions are uniformly distributed in a certain divided inspection image. If defects are uniformly included in this way, it will not be detected as abnormal, which is not preferable. Therefore, when a defect extending in the horizontal direction of the image frequently occurs, the image is divided in the vertical direction by a dividing line extending in the vertical direction as shown in FIG. 13 and divided into n images. As described above, the defect detection accuracy can be further improved by dividing the image into divided images having a size and a shape corresponding to the shape of the defect.

また、第3の変更例としては、図14に示すように1つの画像を縦方向の複数の分割画像に分割し、さらに横方向の複数の分割画像に分割してもよい。これにより、例えば横方向に延びる欠陥と縦方向に延びる欠陥とが混在する場合、すなわち縦方向に分割したほうが検出しやすい欠陥と、横方向に分割した方が検出しやすい欠陥とが混在している場合においても、欠陥検出精度を向上させることができる。さらには、画像のうち右半分を縦方向に分割し、左半分を横方向に分割するなど、領域毎に異なる形状およびサイズの画像に分割してもよい。   As a third modification, as shown in FIG. 14, one image may be divided into a plurality of divided images in the vertical direction and further divided into a plurality of divided images in the horizontal direction. Thus, for example, when a defect extending in the horizontal direction and a defect extending in the vertical direction are mixed, that is, a defect that is easier to detect when divided in the vertical direction and a defect that is easier to detect when divided in the horizontal direction are mixed. Even in this case, the defect detection accuracy can be improved. Furthermore, the right half of the image may be divided in the vertical direction, and the left half may be divided in the horizontal direction.

なお、電子計算機14は、CPUなどの制御装置と、ROM(Read Only Memory)やRAMなどの記憶装置と、HDD、CDドライブ装置などの外部記憶装置と、キーボードやマウスなどの入力装置を備えており、通常のコンピュータを利用したハードウェア構成となっている。   The computer 14 includes a control device such as a CPU, a storage device such as a ROM (Read Only Memory) and a RAM, an external storage device such as an HDD and a CD drive device, and an input device such as a keyboard and a mouse. The hardware configuration uses a normal computer.

電子計算機14で実行される画像検査プログラムは、インストール可能な形式又は実行可能な形式のファイルでCD−ROM、フレキシブルディスク(FD)、CD−R、DVD(Digital Versatile Disk)等のコンピュータで読み取り可能な記録媒体に記録されて提供される。   The image inspection program executed by the electronic computer 14 is an installable or executable file and can be read by a computer such as a CD-ROM, flexible disk (FD), CD-R, or DVD (Digital Versatile Disk). Recorded on a simple recording medium.

また、電子計算機14で実行される画像検査プログラムを、インターネット等のネットワークに接続されたコンピュータ上に格納し、ネットワーク経由でダウンロードさせることにより提供するように構成しても良い。また、電子計算機14で実行される画像検査プログラムをインターネット等のネットワーク経由で提供または配布するように構成しても良い。また、画像検査プログラムを、ROM等に予め組み込んで提供するように構成してもよい。   Further, the image inspection program executed by the electronic computer 14 may be provided by being stored on a computer connected to a network such as the Internet and downloaded via the network. Further, the image inspection program executed by the electronic computer 14 may be provided or distributed via a network such as the Internet. Further, the image inspection program may be provided by being incorporated in advance in a ROM or the like.

電子計算機14で実行される画像検査プログラムは、上述した各部を含むモジュール構成となっており、実際のハードウェアとしてはCPU(プロセッサ)が上記記憶媒体から画像検査プログラムを読み出して実行することにより上記各部が主記憶装置上にロードされ、各部が主記憶装置上に生成されるようになっている。   The image inspection program executed by the electronic computer 14 has a module configuration including the above-described units. As actual hardware, the CPU (processor) reads the image inspection program from the storage medium and executes the image inspection program. Each unit is loaded on the main storage device, and each unit is generated on the main storage device.

10 画像検査装置
12 カメラ
13 照明
14 電子計算機
15 表示装置
100 基準画像取得部
102 第1画像処理部
104 第1分割部
106 第1マハラノビス距離算出部
108 基準空間記憶部
110 閾値決定部
112 閾値記憶部
120 被検査画像取得部
122 第2画像処理部
124 第2分割部
126 第2マハラノビス距離算出部
128 代表値決定部
130 良否判定部
DESCRIPTION OF SYMBOLS 10 Image inspection apparatus 12 Camera 13 Illumination 14 Electronic computer 15 Display apparatus 100 Reference | standard image acquisition part 102 1st image processing part 104 1st division | segmentation part 106 1st Mahalanobis distance calculation part 108 Reference | standard space memory | storage part 110 Threshold value determination part 112 Threshold value memory | storage part 120 Inspected Image Acquisition Unit 122 Second Image Processing Unit 124 Second Dividing Unit 126 Second Mahalanobis Distance Calculation Unit 128 Representative Value Determining Unit 130 Pass / Fail Judgment Unit

Claims (10)

マハラノビス距離により画像検査を行う画像検査装置であって、
基準空間の算出に利用する基準画像を複数の分割基準画像に分割する第1分割手段と、
前記第1分割手段により得られた複数の前記分割基準画像それぞれのマハラノビス距離を算出する第1算出手段と、
前記第1算出手段により算出された複数の前記マハラノビス距離に基づいて、画像検査の対象となる被検査画像の良否判定に利用する閾値を決定する閾値決定手段と、
前記被検査画像を、前記分割基準画像と同一サイズ、同一形状の複数の分割被検査画像に分割する第2分割手段と、
前記第2分割手段により得られた複数の前記分割被検査画像それぞれのマハラノビス距離を算出する第2算出手段と、
前記第2算出手段により算出された前記マハラノビス距離に基づいて、前記被検査画像のマハラノビス距離の代表値を決定する代表値決定手段と、
前記被検査画像の前記マハラノビス距離の前記代表値が前記閾値よりも大きい場合に、前記被検査画像に異常があると判定する良否判定手段と
を備えたことを特徴とする画像検査装置。
An image inspection apparatus that performs image inspection by Mahalanobis distance,
First dividing means for dividing a reference image used for calculating a reference space into a plurality of divided reference images;
First calculation means for calculating the Mahalanobis distance of each of the plurality of division reference images obtained by the first division means;
Threshold determining means for determining a threshold to be used for pass / fail judgment of an image to be inspected based on the plurality of Mahalanobis distances calculated by the first calculating means;
Second dividing means for dividing the inspection image into a plurality of divided inspection images having the same size and the same shape as the division reference image;
Second calculation means for calculating the Mahalanobis distance of each of the plurality of divided inspection images obtained by the second dividing means;
Representative value determining means for determining a representative value of the Mahalanobis distance of the image to be inspected based on the Mahalanobis distance calculated by the second calculating means;
An image inspection apparatus comprising: a quality determination unit that determines that the inspection image is abnormal when the representative value of the Mahalanobis distance of the inspection image is greater than the threshold value.
前記閾値決定手段は、前記第1算出手段により算出された複数の前記マハラノビス距離の最大値を前記閾値と決定することを特徴とする請求項1に記載の画像検査装置。   The image inspection apparatus according to claim 1, wherein the threshold value determining unit determines a maximum value of the plurality of Mahalanobis distances calculated by the first calculating unit as the threshold value. 前記閾値決定手段は、前記第1算出手段により算出された複数のマハラノビス距離の平均値を前記閾値として決定することを特徴とする請求項1に記載の画像検査装置。   The image inspection apparatus according to claim 1, wherein the threshold value determination unit determines an average value of a plurality of Mahalanobis distances calculated by the first calculation unit as the threshold value. 前記代表値決定手段は、前記第2算出手段により算出された複数の前記マハラノビス距離の最大値を前記被検査画像の前記代表値と決定することを特徴とする請求項1から3のいずれか一項に記載の画像検査装置。   The representative value determining means determines the maximum value of the plurality of Mahalanobis distances calculated by the second calculating means as the representative value of the image to be inspected. The image inspection apparatus according to item. 前記マハラノビス距離決定手段は、前記第2算出手段により算出された複数の前記マハラノビス距離の平均値を前記被検査画像の前記代表値と決定することを特徴とする請求項1から3のいずれか一項に記載の画像検査装置。   The Mahalanobis distance determining means determines an average value of the plurality of Mahalanobis distances calculated by the second calculating means as the representative value of the inspected image. The image inspection apparatus according to item. 前記第1分割手段は、縦横のサイズが異なる複数の前記基準分割画像に分割することを特徴とする請求項1から5のいずれか一項に記載の画像検査装置。   The image inspection apparatus according to claim 1, wherein the first dividing unit divides the plurality of reference divided images having different vertical and horizontal sizes. 前記第1分割手段は、前記基準画像のうち、前記被検査画像において異常が多発することが予めわかっている多発領域に対応する領域を他の領域に比べて小さいサイズの分割画像に分割することを特徴とする請求項6に記載の画像検査装置。   The first dividing means divides an area corresponding to a frequently-occurring area in the reference image, which is known in advance to frequently generate abnormalities, into a divided image having a smaller size than other areas. The image inspection apparatus according to claim 6. 前記第1分割手段は、前記基準画像のうち、前記被検査画像に発生することが予めわかっている異常の形状に基づいて設定されたサイズの前記分割基準画像に分割することを特徴とする請求項1から5のいずれか一項に記載の画像検査装置。   The first dividing unit divides the reference image into the divided reference images having a size set based on a shape of an abnormality that is known in advance to occur in the inspection image. Item 6. The image inspection apparatus according to any one of Items 1 to 5. マハラノビス距離により画像検査を行う画像検査方法であって、
分割手段が、基準空間の算出に利用する基準画像を複数の分割基準画像に分割する第1分割ステップと、
第1算出手段が、前記第1分割ステップで得られた複数の前記分割基準画像それぞれのマハラノビス距離を算出する第1算出ステップと、
閾値決定手段が、前記第1算出ステップで算出された複数の前記マハラノビス距離に基づいて、画像検査の対象となる被検査画像の良否判定に利用する閾値を決定する閾値決定ステップと、
第2分割手段が、前記被検査画像を、前記基準分割画像と同一サイズ、同一形状の複数の分割被検査画像に分割する第2分割ステップと、
第2算出手段が、前記第2分割ステップで得られた複数の前記分割被検査画像それぞれのマハラノビス距離を算出する第2算出ステップと、
代表値決定手段が、前記第2算出ステップで算出された前記マハラノビス距離に基づいて、前記被検査画像のマハラノビス距離の代表値を決定する代表値決定ステップと、
良否判定手段が、前記被検査画像の前記マハラノビス距離の前記代表値が前記閾値よりも大きい場合に、前記被検査画像に異常があると判定する良否判定ステップと
を有することを特徴とする画像検査方法。
An image inspection method for performing an image inspection by Mahalanobis distance,
A first dividing step in which the dividing unit divides the reference image used for calculating the reference space into a plurality of divided reference images;
A first calculation step in which a first calculation means calculates a Mahalanobis distance of each of the plurality of division reference images obtained in the first division step;
A threshold value determining step, wherein a threshold value determining unit determines a threshold value used for quality determination of an image to be inspected based on the plurality of Mahalanobis distances calculated in the first calculation step;
A second dividing step in which the second dividing means divides the inspection image into a plurality of divided inspection images having the same size and the same shape as the reference divided image;
A second calculating step in which a second calculating means calculates a Mahalanobis distance of each of the plurality of divided inspected images obtained in the second dividing step;
A representative value determining means for determining a representative value of the Mahalanobis distance of the image to be inspected based on the Mahalanobis distance calculated in the second calculating step;
An image inspection comprising: a quality determination unit that determines whether the inspection image is abnormal when the representative value of the Mahalanobis distance of the inspection image is greater than the threshold value. Method.
マハラノビス距離による画像検査処理をコンピュータに実行させるための画像検査プログラムであって、
基準空間の算出に利用する基準画像を複数の分割基準画像に分割する第1分割ステップと、
前記第1分割ステップで得られた複数の前記分割基準画像それぞれのマハラノビス距離を算出する第1算出ステップと、
前記第1算出ステップで算出された複数の前記マハラノビス距離に基づいて、画像検査の対象となる被検査画像の良否判定に利用する閾値を決定する閾値決定ステップと、
前記被検査画像を、前記基準分割画像と同一サイズ、同一形状の複数の分割被検査画像に分割する第2分割ステップと、
前記第2分割ステップで得られた複数の前記分割被検査画像それぞれのマハラノビス距離を算出する第2算出ステップと、
前記第2算出ステップで算出された前記マハラノビス距離に基づいて、前記被検査画像のマハラノビス距離の代表値を決定する代表値決定ステップと、
前記被検査画像の前記マハラノビス距離の前記代表値が前記閾値よりも大きい場合に、前記被検査画像に異常があると判定する良否判定ステップと
を前記コンピュータに実行させるためのプログラム。
An image inspection program for causing a computer to execute image inspection processing based on Mahalanobis distance,
A first division step of dividing a reference image used for calculating a reference space into a plurality of divided reference images;
A first calculation step of calculating a Mahalanobis distance of each of the plurality of division reference images obtained in the first division step;
A threshold value determining step for determining a threshold value used for pass / fail determination of an image to be inspected based on the plurality of Mahalanobis distances calculated in the first calculating step;
A second dividing step of dividing the inspection image into a plurality of divided inspection images having the same size and the same shape as the reference divided image;
A second calculating step of calculating a Mahalanobis distance of each of the plurality of divided inspection images obtained in the second dividing step;
A representative value determining step of determining a representative value of the Mahalanobis distance of the image to be inspected based on the Mahalanobis distance calculated in the second calculating step;
A program for causing the computer to execute a pass / fail determination step for determining that there is an abnormality in the inspected image when the representative value of the Mahalanobis distance of the inspected image is larger than the threshold value.
JP2009140308A 2009-06-11 2009-06-11 Image inspection device, and method and program for inspecting image Pending JP2010286353A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009140308A JP2010286353A (en) 2009-06-11 2009-06-11 Image inspection device, and method and program for inspecting image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009140308A JP2010286353A (en) 2009-06-11 2009-06-11 Image inspection device, and method and program for inspecting image

Publications (1)

Publication Number Publication Date
JP2010286353A true JP2010286353A (en) 2010-12-24

Family

ID=43542159

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009140308A Pending JP2010286353A (en) 2009-06-11 2009-06-11 Image inspection device, and method and program for inspecting image

Country Status (1)

Country Link
JP (1) JP2010286353A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013089064A (en) * 2011-10-19 2013-05-13 Mitsubishi Electric Corp Pattern recognition device and pattern recognition method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0968497A (en) * 1995-06-21 1997-03-11 Dainippon Screen Mfg Co Ltd Method and system for inspecting unevenness
JPH11238099A (en) * 1997-12-19 1999-08-31 Matsushita Electric Ind Co Ltd Character recognition device, method therefor and computer readable recording medium stored with character recognition program
JP2000275757A (en) * 1999-03-24 2000-10-06 Fuji Photo Film Co Ltd Method and device for evaluating image

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0968497A (en) * 1995-06-21 1997-03-11 Dainippon Screen Mfg Co Ltd Method and system for inspecting unevenness
JPH11238099A (en) * 1997-12-19 1999-08-31 Matsushita Electric Ind Co Ltd Character recognition device, method therefor and computer readable recording medium stored with character recognition program
JP2000275757A (en) * 1999-03-24 2000-10-06 Fuji Photo Film Co Ltd Method and device for evaluating image

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013089064A (en) * 2011-10-19 2013-05-13 Mitsubishi Electric Corp Pattern recognition device and pattern recognition method

Similar Documents

Publication Publication Date Title
KR102203112B1 (en) Defect detection and classification based on attributes determined from a standard reference image
KR102062433B1 (en) Defect quantification method, defect quantification device, and defect evaluation value display device
JP4616864B2 (en) Appearance inspection method and apparatus, and image processing evaluation system
US20140119638A1 (en) System, method and computer program product to evaluate a semiconductor wafer fabrication process
EP3591612A1 (en) Defect detection system for aircraft component and defect detection method for aircraft component
JP2006098151A (en) Pattern inspection device and pattern inspection method
JP2007114843A (en) Quality deciding device
JP2006098152A (en) Apparatus and method for detecting defect
JP2017219529A (en) Appearance abnormality inspection device, method, and program
JP2015197396A (en) Image inspection method and image inspection device
JP5419555B2 (en) Image inspection apparatus, image inspection method, and image inspection program
JP5405245B2 (en) Image inspection method and image inspection apparatus
JP5088165B2 (en) Defect detection method and defect detection apparatus
Konovalenko et al. Error analysis of an algorithm for identifying thermal fatigue cracks
KR101929669B1 (en) The method and apparatus for analyzing an image using an entropy
JP6244260B2 (en) Defect analysis apparatus and defect analysis method
US9959482B2 (en) Classifying method, storage medium, inspection method, and inspection apparatus
CN117078679B (en) Automatic assembly line production detection method for cooling fan based on machine vision
JP2006090921A (en) Visual examination device, threshold determining method visual examination method and program for functionalizing computer as visual examination device
JP2011232303A (en) Image inspection method and image inspection device
JP2011232302A (en) Image inspection method and image inspection device
JP2010286353A (en) Image inspection device, and method and program for inspecting image
JP4697328B2 (en) Inspection method for heat exchanger core
JP2014230146A (en) Image evaluation method, image evaluation device and image evaluation program
JP2005252451A (en) Image quality inspection method and image quality inspection apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120522

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130424

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130430

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20130903