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

Image inspection method and image inspection apparatus Download PDF

Info

Publication number
JP6410459B2
JP6410459B2 JP2014087947A JP2014087947A JP6410459B2 JP 6410459 B2 JP6410459 B2 JP 6410459B2 JP 2014087947 A JP2014087947 A JP 2014087947A JP 2014087947 A JP2014087947 A JP 2014087947A JP 6410459 B2 JP6410459 B2 JP 6410459B2
Authority
JP
Japan
Prior art keywords
pixel
feature amount
image
value
defective
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
JP2014087947A
Other languages
Japanese (ja)
Other versions
JP2015206702A (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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2014087947A priority Critical patent/JP6410459B2/en
Publication of JP2015206702A publication Critical patent/JP2015206702A/en
Application granted granted Critical
Publication of JP6410459B2 publication Critical patent/JP6410459B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

被検査物の外観を撮像して得た画像データに対する画像処理を介して被検査物の欠陥判定を行う画像検査方法、および画像検査装置に関するものである。   The present invention relates to an image inspection method and an image inspection apparatus for performing defect determination of an inspection object through image processing on image data obtained by imaging the appearance of the inspection object.

従来より、各種工業製品の製造において、被検査物を撮像して取得した画像データに対する画像処理に基づき、欠陥判定(良否判定)を行う検査技術が知られている。   2. Description of the Related Art Conventionally, in manufacturing various industrial products, an inspection technique for performing defect determination (good / bad determination) based on image processing on image data acquired by imaging an inspection object is known.

この種の画像検査(光学検査、外観検査などとも呼ばれる)における画像処理は、被検査物を撮像して取得した画像(濃淡画像)から欠陥(キズや変形)を抽出して良否判定を行う。例えば、被検査物の画像データ中の例えば画素の何らかの特性を表現する特徴量(輝度、濃淡値、エッジ強度など)を算出する一方、欠陥を弁別可能な特徴量に対応する閾値を作成しておき、この閾値を外れた特徴量を有する画素を欠陥部として抽出する。   Image processing in this type of image inspection (also referred to as optical inspection, appearance inspection, etc.) makes a pass / fail determination by extracting defects (scratches and deformation) from an image (grayscale image) acquired by imaging the inspection object. For example, while calculating a feature amount (luminance, gray value, edge strength, etc.) that expresses some characteristic of, for example, a pixel in the image data of the inspection object, a threshold value corresponding to the feature amount that can distinguish a defect is created. Then, a pixel having a feature amount outside this threshold is extracted as a defective portion.

しかし、実際に被検査物を撮像して取得した濃淡画像には、被検査物の外形や照明の写り込みなどの外乱情報が背景として存在する。このような外乱情報の誤抽出を抑制しつつ欠陥抽出感度を維持するには、例えば画素ごとに適切な閾値を設定することが重要となる。   However, disturbance information such as the external shape of the inspection object and the reflection of illumination is present in the grayscale image obtained by actually imaging the inspection object. In order to maintain the defect extraction sensitivity while suppressing such erroneous extraction of disturbance information, it is important to set an appropriate threshold value for each pixel, for example.

この課題を解決する方法として、例えば、下記の特許文献1は、被検査物を撮像して得た濃淡値の統計量を利用して画素ごとの閾値を生成する技術を開示している。特許文献1では、まず、予め用意した複数の良品サンプルの濃淡画像から同一座標の画素ごとに濃淡値の平均値および標準偏差を算出し、算出した平均値および標準偏差をパラメータとして画素ごとの閾値を算出する。そして、検査の際は、被検査物の濃淡画像の濃淡値を画素ごとに閾値と比較し、閾値外となった画素を欠陥部として抽出する。特許文献1では、このような画像処理によって背景の濃淡値の統計的な挙動に即した閾値を設定しようとしている。   As a method for solving this problem, for example, the following Patent Document 1 discloses a technique for generating a threshold value for each pixel by using a statistic of gray value obtained by imaging an object to be inspected. In Patent Document 1, first, an average value and a standard deviation of shade values are calculated for each pixel having the same coordinate from a plurality of non-defective sample gray images prepared in advance, and a threshold value for each pixel is calculated using the calculated average value and standard deviation as parameters. Is calculated. At the time of inspection, the gray value of the gray image of the inspection object is compared with a threshold value for each pixel, and pixels that are outside the threshold value are extracted as defective portions. In Patent Literature 1, an attempt is made to set a threshold value according to the statistical behavior of the background gray value by such image processing.

特許文献1に開示された技術を、濃淡値以外の特徴量を用いるものとし、一般化すると、次のような検査手法が考えられる。まず、複数の良品サンプルの濃淡画像から欠陥部を強調し検出することができる特徴量として、例えば輝度、エッジ強度などの特徴量を画素ごとに算出する。次に、同一座標の画素ごとに算出された特徴量に対して統計量演算を行い、所定の統計量(例えば上記の平均値や標準偏差)を算出する。次に、それら統計量をパラメータとして欠陥部を強調する特徴量に対する閾値を画素ごとに生成する。そして、生成した閾値を用いて実際の被検査物を撮像した画像の画素を検査し、欠陥部位を検出する。   When the technique disclosed in Patent Document 1 uses feature values other than gray values and is generalized, the following inspection method can be considered. First, for example, feature quantities such as luminance and edge strength are calculated for each pixel as feature quantities that can be detected by emphasizing a defective portion from gray images of a plurality of non-defective samples. Next, a statistic calculation is performed on the feature amount calculated for each pixel having the same coordinates, and a predetermined statistic amount (for example, the above average value or standard deviation) is calculated. Next, a threshold for a feature amount that emphasizes a defective portion is generated for each pixel using these statistics as parameters. And the pixel of the image which imaged the actual to-be-inspected object is test | inspected using the produced | generated threshold value, and a defect site | part is detected.

このような画像処理によれば、背景の特徴量の統計的な挙動に即した閾値を画素ごとに設定することが可能となり、閾値精度が向上する。その結果、背景の誤抽出を抑制しつつ、その他の画素では欠陥抽出能力を維持することができ、検査精度を向上できる、と考えられる。   According to such image processing, it is possible to set a threshold value corresponding to the statistical behavior of the background feature amount for each pixel, and the threshold accuracy is improved. As a result, it is considered that defect extraction capability can be maintained in other pixels while erroneous background extraction is suppressed, and inspection accuracy can be improved.

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

しかしながら、実際には、特許文献1で開示された技術の実施には、以下のような困難がある。すなわち、個体差や位置合わせ公差の影響で、同一座標の画素であっても、良品サンプルの濃淡画像ごとに濃淡値は異なる値となり、また異なる空間分布を示す。また、同じ理由から、同一座標の画素から算出される特徴量も異なる値となる。つまり、欠陥部を強調する特徴量に関する統計量(ないしはこれに基づき生成される閾値)に信頼性を持たせるためには、十分多い数の良品サンプルを撮像した濃淡画像が必要となる。しかし、例えば被検査物を撮像した画像の全画素領域に対して信頼性の閾値を生成するためには極めて多数の良品サンプルの濃淡画像を準備しなければならない、という問題がある。   However, in practice, the implementation of the technique disclosed in Patent Document 1 has the following difficulties. That is, due to the influence of individual differences and alignment tolerances, even for pixels with the same coordinates, the gray value differs for each gray image of a good sample and shows a different spatial distribution. For the same reason, feature values calculated from pixels having the same coordinates also have different values. That is, in order to give reliability to the statistical amount (or the threshold value generated based on the statistical amount) that emphasizes the defective portion, a grayscale image obtained by capturing a sufficiently large number of non-defective samples is required. However, for example, in order to generate a reliability threshold value for all pixel regions of an image obtained by imaging an inspection object, there is a problem that gray images of a very large number of non-defective samples must be prepared.

本発明の課題は、上記の問題を解決し、複数の良品サンプルから欠陥判定を行うための特徴量閾値を生成するに際して、大量の良品サンプルを必要とせず、比較的少量の良品サンプルのみを用いて特徴量閾値を生成できるようにすることにある。   An object of the present invention is to solve the above-described problem and use a relatively small amount of non-defective samples without generating a large amount of non-defective samples when generating a feature amount threshold value for performing defect determination from a plurality of non-defective samples. The feature amount threshold value can be generated.

上記課題を解決するため、本発明においては、被検査物の画像データを取得して前記被検査物の欠陥判定を行う画像検査方法において、複数の良品サンプルの画像データの同一座標の画素の画素値と、前記同一座標の画素の周囲に位置する複数の画素の画素値とに対する統計量演算によって取得した第1の特徴量に基づき、画素ごとの特徴量閾値を生成する閾値生成工程と、前記被検査物の画像データを取得し、画素ごとに取得した第2の特徴量に基づいて、前記閾値生成工程で画素ごとに生成された前記特徴量閾値を補正する補正工程と、前記被検査物の画像データから取得した第1の特徴量と、前記補正工程にて補正された前記特徴量閾値とを比較して閾値を超えた画素を欠陥部位として抽出する欠陥抽出工程と、前記欠陥抽出工程により抽出された画素が構成する欠陥部位の特性に基づき前記被検査物の欠陥の有無を判定する欠陥判定工程と、を含むことを特徴とする。 To solve the above problems, the present invention, in the image inspecting method acquires image data of the object determining the defect of the inspection object, the pixels of the pixels in the same coordinates of the image data of a plurality of non-defective samples and values, based on the first feature amount acquired by the statistical amount calculation for the pixel values of a plurality of pixels located around the pixel of the same coordinate, and a threshold generation step of generating a feature value threshold for each pixel, the A correction step of acquiring image data of the object to be inspected, and correcting the feature amount threshold value generated for each pixel in the threshold value generation step based on a second feature amount acquired for each pixel; and the inspection object a first feature amount acquired from the image data of the defect extraction step of extracting a pixel exceeding the threshold value by comparing the corrected the feature amount threshold in said correction step as a defect site, the defect extraction step By Extracted pixels is characterized in that it comprises a determining defect determination step the presence or absence of a defect of the inspection object based on characteristics of the defect site configuration.

また、本発明においては、被検査物の画像データを取得して前記被検査物の欠陥判定を行う画像検査装置において、撮像対象物の画像データを取得する撮像手段と、前記撮像手段により撮像した複数の良品サンプルの画像データの同一座標の画素の画素値と、前記同一座標の画素の周囲に位置する複数の画素の画素値とに対する統計量演算によって取得した第1の特徴量に基づき、画素ごとの特徴量閾値を生成する制御装置と、前記特徴量閾値を記憶する記憶部と、を備え、前記制御装置は、前記撮像手段により撮像された被検査物の画像データより、画素ごとに取得した第2の特徴量に基づいて、前記記憶部に記憶された画素ごとの前記特徴量閾値を補正し、被検査物の画像データより取得した第1の特徴量と、前記補正された特徴量閾値とを比較して閾値を超えた画素を欠陥部位として抽出し、抽出された画素が構成する欠陥部位の特性に基づき前記被検査物の欠陥の有無を判定することを特徴とする。 In the present invention, an image inspection apparatus which performs defect determination acquired by the inspection object image data of the object to be inspected, imaging means for obtaining image data of an imaged object, captured by the image pickup means Based on the first feature amount acquired by the statistic calculation for the pixel value of the pixel at the same coordinate in the image data of the plurality of non-defective samples and the pixel value of the plurality of pixels located around the pixel at the same coordinate , and a control unit for generating a feature value threshold of each, and a storage unit for storing the feature amount threshold value, the control device, from the image data of the object imaged by the imaging means, obtained for each pixel Based on the second feature value, the feature value threshold value for each pixel stored in the storage unit is corrected, the first feature value obtained from the image data of the inspection object, and the corrected feature value Threshold By comparing the extracted pixels exceeding the threshold value as a defective portion, the extracted pixels and judging the presence or absence of a defect of the inspection object based on characteristics of the defect site configuration.

上記構成によれば、欠陥判定に必要な特徴量閾値の算出に必要な第1の特徴量に関する統計量は、複数の良品サンプルの画像の同一座標の画素および位置合わせ公差内の画素から算出された第1の特徴量を用いて算出される。すなわち、特定の画素に対して用いられる特徴量閾値は、当該画素の他、位置合わせ公差内の画素の第1の特徴量を参照して算出される。その結果、1枚の良品サンプルの画像の特定画素についての第1の特徴量に関する統計量に、従来手法で複数の良品サンプルの画像から算出していた値と同程度の信頼性を確保できる。従って、従来と同程度の信頼性を得るに充分な特徴量閾値を生成するために必要な良品サンプルの画像数を著しく減少させることができ、必要とする良品サンプル数を低減できる。   According to the above configuration, the statistical amount related to the first feature amount necessary for calculating the feature amount threshold necessary for defect determination is calculated from the pixels at the same coordinates and the pixels within the alignment tolerance of the images of the non-defective samples. It is calculated using the first feature amount. That is, the feature amount threshold value used for a specific pixel is calculated with reference to the first feature amount of the pixel within the alignment tolerance in addition to the pixel. As a result, it is possible to ensure the same degree of reliability as the value calculated from the images of a plurality of non-defective samples by the conventional method, for the statistical amount related to the first feature amount for the specific pixel of the image of the single non-defective sample. Therefore, it is possible to remarkably reduce the number of non-defective sample images necessary for generating a feature amount threshold sufficient to obtain the same level of reliability as in the past, and to reduce the number of required non-defective samples.

本発明に係る画像処理を実施可能な画像検査装置の構成例を示したブロック図である。1 is a block diagram illustrating a configuration example of an image inspection apparatus capable of performing image processing according to the present invention. 本発明による画像処理の第1実施形態を機能ブロック構成で示した説明図である。It is explanatory drawing which showed 1st Embodiment of the image processing by this invention by the functional block structure. 本発明による画像処理の第1実施形態における特徴量閾値生成の流れを示したフローチャート図である。It is the flowchart figure which showed the flow of the feature-value threshold value generation in 1st Embodiment of the image processing by this invention. 本発明による画像処理の第1実施形態における画像検査手順を示したフローチャート図である。It is the flowchart figure which showed the image test | inspection procedure in 1st Embodiment of the image processing by this invention. 本発明による画像処理の第1実施形態において処理される画像データを示した説明図である。It is explanatory drawing which showed the image data processed in 1st Embodiment of the image processing by this invention. 本発明による画像処理の第1実施形態において処理される画像データで、特に背景近傍における濃淡値を示した説明図である。It is explanatory drawing which showed the shading value in the background vicinity especially in the image data processed in 1st Embodiment of the image processing by this invention. 本発明による画像処理の第2実施形態における特徴量閾値生成の流れを示したフローチャート図である。It is the flowchart figure which showed the flow of the feature-value threshold value generation in 2nd Embodiment of the image processing by this invention. 本発明による画像処理の第3実施形態を機能ブロック構成で示した説明図である。It is explanatory drawing which showed 3rd Embodiment of the image processing by this invention by the functional block structure. 本発明による画像処理の第3実施形態における画像検査手順を示したフローチャート図である。It is the flowchart figure which showed the image test | inspection procedure in 3rd Embodiment of the image processing by this invention. 本発明による画像処理の第3実施形態において処理される画像データを示した説明図である。It is explanatory drawing which showed the image data processed in 3rd Embodiment of the image processing by this invention. 本発明による画像処理の特徴量閾値生成の流れを詳細に示したフローチャート図である。It is the flowchart figure which showed the flow of the feature-value threshold value generation of the image processing by this invention in detail. 本発明による画像処理の特徴量閾値生成の様子を詳細に示した説明図である。It is explanatory drawing which showed the mode of the feature-value threshold value generation of the image processing by this invention in detail. 本発明による画像処理の特徴量閾値生成の様子を詳細に示した説明図である。It is explanatory drawing which showed the mode of the feature-value threshold value generation of the image processing by this invention in detail. 本発明による画像処理の特徴量閾値生成の様子を詳細に示した説明図である。It is explanatory drawing which showed the mode of the feature-value threshold value generation of the image processing by this invention in detail.

以下、添付図面を参照して本発明を実施するに好適な実施の形態につき説明する。   DESCRIPTION OF EXEMPLARY EMBODIMENTS Hereinafter, preferred embodiments for carrying out the invention will be described with reference to the accompanying drawings.

[第1実施形態]
<全体構成>
図1は、本発明を採用した画像処理を実施可能な画像検査装置の構成例を示している。画像処理を実行する演算部の後述の機能ブロック(図2)は、それぞれ専用のハードウェアで構成してもよいが、例えば図1に示すようにCPU(中央演算処理装置)などの演算制御手段で画像処理装置の各ハードウェアを構成することができる。図1の画像処理装置は、例えばPC(パーソナルコンピュータ)の構成を利用して構成することができ、全体として演算部1300(図2)のハードウェア構成に相当する。
[First Embodiment]
<Overall configuration>
FIG. 1 shows a configuration example of an image inspection apparatus capable of performing image processing employing the present invention. Functional blocks (FIG. 2), which will be described later, of the arithmetic unit that executes image processing may be configured by dedicated hardware, but for example, arithmetic control means such as a CPU (Central Processing Unit) as shown in FIG. Thus, each hardware of the image processing apparatus can be configured. The image processing apparatus in FIG. 1 can be configured using, for example, the configuration of a PC (personal computer), and corresponds to the hardware configuration of the arithmetic unit 1300 (FIG. 2) as a whole.

図1の画像処理装置は、内部バス2000を介して接続されたCPU2100、メモリ2200を含む。メモリ2200は、CPU2100のワークエリアなどとして用いられるRAM、ファームウェア、ブートローダや基本IOプログラムなどを格納したROMなどの記憶領域を含む。   The image processing apparatus shown in FIG. 1 includes a CPU 2100 and a memory 2200 connected via an internal bus 2000. The memory 2200 includes a storage area such as a RAM that stores RAM, firmware, a boot loader, a basic IO program, and the like used as a work area of the CPU 2100.

図1では、特に記憶装置2300を図示してあるが、この記憶装置2300は後述の記憶部1400(図2)のハードウェア構成に相当する。記憶装置2300の記憶領域は、例えば後述の取得された画像データを記憶する画像データ記憶部1401、算出した特徴量閾値を記憶する特徴量閾値記憶部1402、閾値を記憶する良否判定基準記憶部1403を構成する。また、記憶装置2300には、後述の画像検査(画像処理)プログラムをCPU2100が実行可能なデータ形式によって格納しておくことができる。記憶装置2300は、例えばHDD、SSDのようないわゆる外部記憶装置(内蔵式か着脱式かを問わない)や、各種フラッシュメモリデバイス、あるいはこの種の記憶デバイスの任意の組合せによって構成することができる。   In FIG. 1, the storage device 2300 is particularly illustrated, but this storage device 2300 corresponds to a hardware configuration of a storage unit 1400 (FIG. 2) described later. The storage area of the storage device 2300 includes, for example, an image data storage unit 1401 that stores acquired image data, which will be described later, a feature amount threshold storage unit 1402 that stores the calculated feature amount threshold, and a pass / fail judgment reference storage unit 1403 that stores the threshold. Configure. The storage device 2300 can store an image inspection (image processing) program, which will be described later, in a data format that the CPU 2100 can execute. The storage device 2300 can be configured by a so-called external storage device (whether built-in or detachable) such as HDD and SSD, various flash memory devices, or any combination of this type of storage device. .

後述の画像検査プログラムは、CPU2100が実行可能なデータ形式で構成し、例えば記憶装置2300に記憶しておき、必要に応じてメモリ2200にロードし、CPU2100で実行される。これによって後述の演算部1300(図2)の画像処理が実行される。   An image inspection program to be described later is configured in a data format that can be executed by the CPU 2100, for example, stored in the storage device 2300, loaded into the memory 2200 as necessary, and executed by the CPU 2100. As a result, image processing of an arithmetic unit 1300 (FIG. 2) described later is executed.

また、図1の画像処理装置は、外部通信ポート2400、を介して接続された外部接続機器2500を含む。外部接続機器2500には、例えば後述の被検査物を濃淡画像として撮像するカメラ1200(図2)、被検査物の位置を調整する位置調整機構1100(同)が含まれる。外部通信ポート2400は、例えばUSBインターフェースやGPIBインターフェースなど、外部接続機器2500の接続に必要な任意の汎用インターフェースから構成される。   The image processing apparatus of FIG. 1 includes an external connection device 2500 connected via an external communication port 2400. The externally connected device 2500 includes, for example, a camera 1200 (FIG. 2) that captures a later-described inspection object as a grayscale image, and a position adjustment mechanism 1100 (same) that adjusts the position of the inspection object. The external communication port 2400 is configured by an arbitrary general-purpose interface necessary for connection of the external connection device 2500 such as a USB interface or a GPIB interface.

外部接続機器2500のうち、カメラ1200は、たとえばデジタルカメラ構成であり、画像検査を受ける被検査物の画像、また、画像検査のための閾値生成のために用いられる良品サンプルの画像を撮像するために用いられる。位置調整機構1100は、たとえばコンベヤベルトやロボットアームのような任意の搬送機構から構成され、カメラ1200前方の撮像可能領域中の所定位置に被検査物を位置決めすることができるよう構成される。   Among the externally connected devices 2500, the camera 1200 has, for example, a digital camera configuration, and captures an image of an object to be inspected for image inspection and an image of a non-defective sample used for generating a threshold for image inspection. Used for. The position adjustment mechanism 1100 is composed of an arbitrary transport mechanism such as a conveyor belt or a robot arm, for example, and is configured to be able to position an object to be inspected at a predetermined position in an imageable area in front of the camera 1200.

なお、図1の画像処理装置ハードウェアは、後述の第2および第3実施形態においても用いられる。特に、第2実施形態において、位置調整機構1100はカメラ1200前方の撮像可能領域中で同一の被検査物を摂動させて例えば同一の良品サンプルに対して異なる撮影条件で複数回の撮像を行うために利用される。   Note that the image processing apparatus hardware in FIG. 1 is also used in second and third embodiments described later. In particular, in the second embodiment, the position adjustment mechanism 1100 perturbs the same inspection object in the imageable area in front of the camera 1200 and, for example, performs multiple imaging on the same good sample under different imaging conditions. Used for

また、本実施形態(後述の第2、第3実施例においても同様)において、良品サンプルとは、被検査物と同じ物品を被検査物と同じように製造ないし組み上げ、目視検査などを経て良品と判定されたものを指す。また、ここでいう良品サンプルは、撮影した時に治具や原器などのように被検査物と同じ光学的特徴を有するが、材質や工作精度などが必ずしも被検査物と一致しないものも含む。本実施形態(後述の第2、第3実施例においても同様)の画像検査は上記のような良品サンプルのいずれにおいても好適に実施することができる。なお、以下では、簡略化のため上記の「良品サンプル」を指すものとして「良品」の略称も用いるものとする。また、「良品を撮像した濃淡画像」を指すものとして「良品画像」の略称も用いるものとする。   In this embodiment (the same applies to the second and third examples described later), the non-defective sample refers to a non-defective product that has been manufactured or assembled in the same manner as the inspected object and subjected to visual inspection. It is determined that. In addition, the non-defective sample herein includes the same optical characteristics as the object to be inspected, such as a jig or an original instrument, when the image is taken, but also includes a material or work accuracy that does not necessarily match the object to be inspected. The image inspection of the present embodiment (the same applies to the second and third examples described later) can be preferably performed on any of the above-mentioned non-defective samples. In the following, for the sake of simplicity, the abbreviation “non-defective product” is also used to indicate the above “non-defective sample”. In addition, the abbreviation “non-defective image” is also used to indicate “a gray-scale image obtained by capturing non-defective products”.

また、図1の画像処理装置には、表示部1500、およびキーボードや任意のポインティングデバイスなどから構成された入力部1600が設けられる。表示部1500はLCDパネルなどから構成されたディスプレイデバイスなどから構成される。これら表示部1500、および入力部1600は作業者(検査者)のためのユーザーインターフェース手段を構成する。   In addition, the image processing apparatus in FIG. 1 includes a display unit 1500 and an input unit 1600 configured from a keyboard, an arbitrary pointing device, and the like. The display unit 1500 is composed of a display device composed of an LCD panel or the like. The display unit 1500 and the input unit 1600 constitute user interface means for an operator (inspector).

図2は、図1に示した画像処理装置ハードウェアを用いて画像検査(外観検査、光学検査)を行う場合の演算機能をブロック構成で示したものである。図2の構成は図1のハードウェアを用いた画像検査(外観検査、光学検査)装置の構成を示すものと考えてよい。また、図2の構成は図1のハードウェアを用いて実施される画像検査(外観検査、光学検査)方法の構成をブロック構成で示したものと考えてもよい。図2中では、既に図1において説明した部材(主にハードウェア)も図示してあるが、それらについては同一の参照符号を付してある。   FIG. 2 is a block diagram showing an arithmetic function when performing image inspection (appearance inspection, optical inspection) using the image processing apparatus hardware shown in FIG. The configuration of FIG. 2 may be considered to indicate the configuration of an image inspection (appearance inspection, optical inspection) apparatus using the hardware of FIG. The configuration of FIG. 2 may be considered as a block configuration of an image inspection (appearance inspection, optical inspection) method implemented using the hardware of FIG. In FIG. 2, the members (mainly hardware) already described in FIG. 1 are also shown, but these are denoted by the same reference numerals.

図2の機能構成は、被検査物1900の位置を調整する位置調整機構1100と、被検査物を濃淡画像として撮像するカメラ1200を含む。また、図2の機能構成は、画像データを演算処理する演算部1300と、画像データないし制御データを記憶する記憶部1400から構成される。演算部1300と記憶部1400は、ハードウェア的には前述の図1の構成により実現される。   2 includes a position adjustment mechanism 1100 that adjusts the position of the inspection object 1900 and a camera 1200 that captures the inspection object as a grayscale image. The functional configuration of FIG. 2 includes an arithmetic unit 1300 that performs arithmetic processing on image data, and a storage unit 1400 that stores image data or control data. The arithmetic unit 1300 and the storage unit 1400 are realized in hardware by the configuration shown in FIG.

本実施形態では、演算部1300と記憶部1400には、次のような演算処理ブロックが含まれる。画像データ取得部1301は、カメラ1200で撮像された濃淡画像を画像データとして取得する。具体的には、画像データ取得部1301は、カメラ1200から入力した所定形式の画像データを画像データ記憶部1401に転送する処理を行う。画像データ記憶部1401は画像データ取得部1301を介して取得した画像データを記憶する。   In the present embodiment, the calculation unit 1300 and the storage unit 1400 include the following calculation processing blocks. The image data acquisition unit 1301 acquires a grayscale image captured by the camera 1200 as image data. Specifically, the image data acquisition unit 1301 performs processing for transferring image data in a predetermined format input from the camera 1200 to the image data storage unit 1401. The image data storage unit 1401 stores the image data acquired via the image data acquisition unit 1301.

位置決め処理部1311は位置調整機構1100と連動して被検査物1900の位置調整を行う。位置決め処理部1311と位置調整機構1100は後述の第2実施形態で利用される被検査物1900の摂動制御も行えるよう構成される。この摂動制御の機能ブロックは図2では位置摂動部1312として示してある。   The positioning processing unit 1311 adjusts the position of the inspection object 1900 in conjunction with the position adjustment mechanism 1100. The positioning processing unit 1311 and the position adjusting mechanism 1100 are configured to perform perturbation control of the inspection object 1900 used in the second embodiment described later. The functional block of this perturbation control is shown as a position perturbation unit 1312 in FIG.

また、第1の特徴量選択受付部1321は、ユーザ(作業者ないし検査者)の選択操作を入力部1600を介して入力する。本実施形態に係る画像処理では、閾値生成ないし閾値比較による画像検査において用いられる画像データの特徴量としては濃淡値の他、輝度やエッジ強度、高周波(ないし低周波)成分、などが考えられる。本実施形態では、ユーザ(作業者ないし検査者)は、これらのうちいずれの特徴量を用いるかを特徴量選択受付部1321を介して指定できるよう構成してある。   The first feature quantity selection receiving unit 1321 inputs a user (worker or inspector) selection operation via the input unit 1600. In the image processing according to the present embodiment, as a feature value of image data used in image inspection by threshold generation or threshold comparison, brightness, edge strength, high frequency (or low frequency) components, etc. can be considered in addition to the gray value. In the present embodiment, the user (worker or inspector) is configured to be able to specify which of these feature quantities is to be used via the feature quantity selection receiving unit 1321.

特徴量閾値算出部1322は、複数の良品の濃淡画像から第1の特徴量選択受付部1321を介して指定された第1の特徴量に対する閾値を画素ごとに生成する。特徴量閾値算出部1322により生成された特徴量閾値は特徴量閾値記憶部1402に記憶される。   The feature value threshold value calculation unit 1322 generates a threshold value for the first feature value designated via the first feature value selection reception unit 1321 for each pixel from a plurality of non-defective gray images. The feature value threshold value generated by the feature value threshold value calculation unit 1322 is stored in the feature value threshold value storage unit 1402.

また、被検査物の画像検査において、第1の特徴量算出部1331は、カメラ1200で撮像し、画像データ取得部1301を介して画像データ記憶部1401に記憶された被検査物の濃淡画像から第1の特徴量を画素ごとに算出する。   Further, in the image inspection of the inspection object, the first feature amount calculation unit 1331 is captured from the grayscale image of the inspection object captured by the camera 1200 and stored in the image data storage unit 1401 via the image data acquisition unit 1301. The first feature amount is calculated for each pixel.

そして、比較抽出部1332は、第1の特徴量算出部1331で被検査物の濃淡画像から算出された第1の特徴量と、複数の良品の濃淡画像の画像処理に基づき特徴量閾値記憶部1402に記憶された特徴量閾値を画素ごとに比較する。この特徴量閾値は、上記の通り、予め複数の良品の濃淡画像の画像処理に基づき特徴量閾値算出部1322で生成し、特徴量閾値記憶部1402に記憶させておく。これにより、比較抽出部1332は閾値外であった画素を欠陥部として抽出することができる。   Then, the comparison extraction unit 1332 includes a feature amount threshold storage unit based on the first feature amount calculated from the gray image of the inspection object by the first feature amount calculation unit 1331 and image processing of a plurality of non-defective gray images. The feature amount threshold value stored in 1402 is compared for each pixel. As described above, the feature value threshold value is generated in advance by the feature value threshold value calculation unit 1322 based on image processing of a plurality of non-defective gray images, and is stored in the feature value threshold value storage unit 1402. Thereby, the comparison extraction unit 1332 can extract pixels that are outside the threshold as defective portions.

欠陥特徴量算出部1333は、比較抽出部1332により抽出された欠陥部から欠陥特徴量を算出する。例えば、欠陥特徴量算出部1333はラベリング処理などを行って、比較抽出部1332により抽出された欠陥部に相当する画素群の連続性を解析する処理を行う。これにより、欠陥特徴量算出部1333は、例えば、1塊りの欠陥部として同定可能な欠陥候補画素群を単位として、その欠陥部を代表する欠陥特徴量を算出する。この特徴量は、基本的には、上述の特徴量閾値記憶部1402や比較抽出部1332などで記憶、ないし演算の対象とされた特徴量と同じ特徴量(濃淡値の他、輝度やエッジ強度など)が用いられる。   The defect feature amount calculation unit 1333 calculates a defect feature amount from the defect portion extracted by the comparison extraction unit 1332. For example, the defect feature quantity calculation unit 1333 performs a labeling process and the like, and performs a process of analyzing the continuity of the pixel group corresponding to the defect part extracted by the comparison extraction unit 1332. Thereby, the defect feature amount calculation unit 1333 calculates, for example, a defect feature amount representing the defect portion, with a defect candidate pixel group that can be identified as a single defect portion as a unit. This feature quantity is basically the same as the feature quantity stored in the above-described feature quantity threshold value storage unit 1402 or the comparison extraction unit 1332 or the target of computation (in addition to the gray value, the luminance and edge strength). Etc.) are used.

一方、良否判定基準記憶部1403には、欠陥特徴量算出部1333が算出した欠陥特徴量と比較可能な欠陥特徴量の種類とそれに対する閾値を記憶する。   On the other hand, the pass / fail judgment reference storage unit 1403 stores the types of defect feature amounts that can be compared with the defect feature amounts calculated by the defect feature amount calculation unit 1333 and the threshold values for the types.

そして、判定部1334は、特徴量閾値算出部1322が算出した欠陥特徴量と、良否判定基準記憶部1403に記憶されている対応する種類の欠陥特徴量閾値(良否判定基準)を比較する。これにより、判定部1334は被検査物1900の良否判定を行うことができる。この良否判定の結果は、例えば表示部1500などを用いて出力することができる。表示部1500における良否判定結果の表示フォーマットは任意である。例えば、表示部1500で、検出された欠陥部位を他の部分と異なる色や濃度によって可視表示したり、演算に係る閾値や画素(群)の特徴量を数値表示により出力したりすることが考えられる。   Then, the determination unit 1334 compares the defect feature amount calculated by the feature amount threshold calculation unit 1322 with the corresponding type of defect feature amount threshold (quality determination criterion) stored in the quality determination criterion storage unit 1403. As a result, the determination unit 1334 can determine whether the inspection object 1900 is good or bad. The result of the quality determination can be output using the display unit 1500, for example. The display format of the pass / fail judgment result on the display unit 1500 is arbitrary. For example, the display unit 1500 may visually display a detected defective portion with a color or density different from that of other portions, or may output a threshold value for calculation or a feature amount of a pixel (group) by numerical display. It is done.

以下、上記のように構成された本実施形態の動作につき、説明する。なお、本実施形態において、以上までの説明では、第1の特徴量(ないし特徴量閾値)しか登場していないが、これは、第1の特徴量以外に第2の特徴量(ないし特徴量閾値)を用いるよう構成された後述の第3実施形態の構成と区別するためである。   Hereinafter, the operation of the present embodiment configured as described above will be described. In the present embodiment, in the above description, only the first feature amount (or feature amount threshold value) appears, but this is not limited to the first feature amount but the second feature amount (or feature amount). This is for the purpose of distinguishing from the configuration of a later-described third embodiment configured to use (threshold).

図3は、画像検査の準備として、欠陥特徴量の検出に作用させる(第1の)特徴量閾値を生成する処理の流れを示している。   FIG. 3 shows a flow of processing for generating a (first) feature amount threshold value that acts on detection of a defect feature amount as preparation for image inspection.

図3のステップS301では、まずカメラ1200によって複数の良品を撮像する。このとき、位置調整機構1100および位置決め処理部1311によって被検査物である良品は位置合わせ済みであるものとする。複数の良品の濃淡画像は画像データ取得部1301によって取得され、画像データ記憶部1401に記憶される。なお、このとき用いられる複数の良品は、例えば熟練検査者による目視検査などによって予め選定されているものとする。   In step S301 in FIG. 3, first, a plurality of non-defective products are imaged by the camera 1200. At this time, it is assumed that the non-defective product, which is an inspection object, has already been aligned by the position adjustment mechanism 1100 and the positioning processing unit 1311. A plurality of non-defective gray images are acquired by the image data acquisition unit 1301 and stored in the image data storage unit 1401. Note that the plurality of non-defective products used at this time are selected in advance by, for example, visual inspection by a skilled inspector.

ここで図5は、カメラ1200により撮像された画像を(例えばある走査線に沿って)1次元形式で表示したものである。図5において(A)、(C)は濃淡表示によりカメラ1200により撮像された画像を表示している。また、図5において(B)、(D)は(A)、(C)に対応するスケールで横軸を座標(空間)方向に取ってカメラ1200により撮像された画像を表示している(濃淡値断面図)。   Here, FIG. 5 shows an image captured by the camera 1200 in a one-dimensional format (for example, along a certain scanning line). 5A and 5C, images captured by the camera 1200 are displayed in grayscale. 5B and 5D display images captured by the camera 1200 with the horizontal axis in the coordinate (space) direction on the scales corresponding to (A) and (C). Value sectional view).

そして、図5(A)、(B)は図3の(第1の)特徴量閾値の生成において撮像された良品の濃淡画像の一例である。また、後述の図5(C)、(D)は、画像検査において撮像された被検査物の濃淡画像の一例である。   5A and 5B are examples of non-defective gray images captured in the generation of the (first) feature amount threshold value in FIG. Further, FIGS. 5C and 5D described later are examples of gray images of the inspection object captured in the image inspection.

図5(A)は、良品の濃淡画像の一例であり被検査物の外形や照明の写り込みなどの外乱情報である背景510aが存在している(以下、簡略化のため被検査物の外形や照明の写り込みなどの外乱情報を総称して単に「背景」という)。座標501の画素は、背景510aに位置する画素、また、座標502、503、504の画素は、背景510aの近傍に位置する画素である。また、座標505の画素は背景510aが存在しない画素である。図5(B)520は、図5(A)の濃淡値断面を表している。   FIG. 5A is an example of a non-defective gray image, and there is a background 510a which is disturbance information such as the outer shape of the inspection object and the reflection of illumination (hereinafter, the outer shape of the inspection object for simplification). Disturbance information such as lighting reflections and lighting are collectively referred to as “background”). A pixel at coordinates 501 is a pixel located in the background 510a, and pixels at coordinates 502, 503, and 504 are pixels located near the background 510a. The pixel at the coordinate 505 is a pixel for which the background 510a does not exist. FIG. 5 (B) 520 represents a gray value cross section of FIG. 5 (A).

次に、図3のステップS302において、第1の特徴量選択受付部1321は、欠陥部を強調する第1の特徴量としてユーザ(作業者ないし検査者)が入力部1600を通して入力した選択情報を受け付ける。ここで選択される第1の特徴量は、欠陥部の強調に適した特徴量を任意に設定してよい。例えばFIRフィルタを用いて算出される高周波成分でもよい。以下では、簡略化のため、第1の特徴量として濃淡値を選択した場合につき説明する。   Next, in step S302 in FIG. 3, the first feature quantity selection receiving unit 1321 receives selection information input by the user (operator or inspector) through the input unit 1600 as the first feature quantity that emphasizes the defective part. Accept. As the first feature value selected here, a feature value suitable for emphasizing a defective portion may be arbitrarily set. For example, a high frequency component calculated using an FIR filter may be used. Hereinafter, for simplification, a case where a gray value is selected as the first feature amount will be described.

次に、ステップS303では、予めステップS301において取得した複数の良品の濃淡画像から、特徴量閾値算出部1322は画像データ記憶部1401に記憶させる特徴量閾値を画素ごとに算出する。ここで算出された特徴量閾値は、特徴量閾値記憶部1402に記憶する。このステップS303における特徴量閾値を生成する画像処理については後で詳述する。   Next, in step S303, the feature value threshold value calculation unit 1322 calculates the feature value threshold value to be stored in the image data storage unit 1401 for each pixel from the plurality of non-defective gray images acquired in step S301 in advance. The feature amount threshold value calculated here is stored in the feature amount threshold storage unit 1402. The image processing for generating the feature amount threshold value in step S303 will be described in detail later.

次に、ステップS304では、良否判定基準記憶部1403に、抽出された欠陥部が基準内か否かを判定するための欠陥特徴量の種類と閾値を設定、記憶する。ここで記憶させる欠陥特徴量の種類と閾値は例えば、面積が20画素以上の欠陥部は不良とするといったものであるが、これに限定するものではない。被検査物ごとに適したものを任意に設定してよい。以上で、画像検査開始の準備が終了する。   In step S304, the defect feature quantity type and threshold value for determining whether or not the extracted defect part is within the reference are set and stored in the pass / fail judgment reference storage unit 1403. The type and threshold value of the defect feature amount stored here is, for example, that a defective portion having an area of 20 pixels or more is regarded as defective, but is not limited thereto. You may set arbitrarily what is suitable for every to-be-inspected object. Thus, the preparation for starting the image inspection is completed.

<ステップS303の詳細な説明>
図11は、図3のステップS303における特徴量閾値を生成する画像処理の流れを示している。
<Detailed Description of Step S303>
FIG. 11 shows a flow of image processing for generating a feature amount threshold value in step S303 of FIG.

図11の画像処理においては、まずステップS3031において、複数の良品の濃淡画像から、第1の特徴量を画素ごとに算出する。ここでは、上記の通り、第1の特徴量として濃淡値を用いる。   In the image processing of FIG. 11, first, in step S3031, a first feature amount is calculated for each pixel from a plurality of non-defective gray images. Here, as described above, the gray value is used as the first feature amount.

次に、ステップS3032において、複数の良品画像から算出された第1の特徴量から、特徴量閾値の算出時に使用するパラメータを画素ごとに取得する。このとき、複数の良品画像において、注目画素と同一座標の画素から算出された第1の特徴量だけでなく、その周囲に存在する位置合わせ範囲内の画素から算出された第1の特徴量も考慮する。この位置合わせ範囲は、装置の位置決め精度やカメラの分解能に応じて設定される。   Next, in step S3032, a parameter used when calculating a feature amount threshold value is acquired for each pixel from the first feature amount calculated from a plurality of non-defective images. At this time, in the plurality of non-defective images, not only the first feature amount calculated from the pixel having the same coordinate as the target pixel but also the first feature amount calculated from the pixels within the alignment range existing around the target feature amount. Consider. This alignment range is set according to the positioning accuracy of the apparatus and the resolution of the camera.

次に、ステップS3032において画素ごとに取得したパラメータを用いて予め設定された計算式に基づき統計量演算を行ない、特徴量閾値を画素ごとに算出する(ステップS3033)。   Next, a statistic calculation is performed based on a preset formula using the parameters acquired for each pixel in step S3032, and a feature amount threshold value is calculated for each pixel (step S3033).

以上のようにして、良品サンプルの画像データの同一座標の画素の画素値と、同一座標の画素の位置決めの公差範囲内の画素の画素値とに対する統計量演算によって画素ごとに取得した第1の特徴量の統計量に基づき特徴量閾値を画素ごとに生成する。以下、上記のステップS3033において、特徴量閾値を生成するための統計量演算に用いる計算式の例をいくつか例示する。   As described above, the first value obtained for each pixel by the statistic calculation on the pixel value of the pixel at the same coordinate of the image data of the non-defective sample and the pixel value of the pixel within the positioning tolerance range of the pixel at the same coordinate. A feature amount threshold value is generated for each pixel based on the feature amount statistics. Hereinafter, in the above step S3033, some examples of calculation formulas used for the statistic calculation for generating the feature amount threshold are exemplified.

<特徴量閾値を算出する計算式の例1>
特徴量閾値Pは、例えばパラメータに平均値Mと標準偏差σを用い、次式(1)によって算出することができる。
<Example 1 of calculation formula for calculating the feature amount threshold>
The feature amount threshold P can be calculated by the following equation (1) using, for example, the average value M and the standard deviation σ as parameters.

Figure 0006410459
式(1)の演算によって、画素ごとの第1の特徴量に対する上限閾値を設定することができる。このときkは0以上の整数であれば適当な数でよいが、統計上、k≧3とすることが望ましい。
Figure 0006410459
The upper limit threshold for the first feature value for each pixel can be set by the calculation of Expression (1). At this time, k may be an appropriate number as long as it is an integer of 0 or more, but it is desirable that k ≧ 3 in terms of statistics.

以上の演算により、例えば図5(A)の画像から、画素ごとに図5(B)に示すような閾値530を取得することができる。この計算を以下の具体例1で説明する。   Through the above calculation, for example, a threshold value 530 as shown in FIG. 5B can be acquired for each pixel from the image in FIG. This calculation will be described in the following specific example 1.

<具体例1>
図12は、具体的な計算例を説明する。図12(A)は、良品(A)の画像例、また図12(B)は、別の良品(B)の画像例で、いずれも第1の特徴量に対応する画素値(例えば濃淡値)を1桝を1画素に対応させた方眼の形式で示している。以下では、簡略化のため、図12(A)、図12(B)の2枚の良品画像から特徴量閾値Pを画素ごとに算出する例を示す。ここでは、第1の特徴量は画素値(例えば濃淡値)である。また、被検査物の位置合わせ範囲は、例えば注目画素からチェス盤距離で1画素の範囲とする。なお、このチェス盤距離で1画素の範囲は、図中の方眼において注目画素を距離1画素で取り囲む範囲で、斜め方向の距離1画素も含む全部で9画素の範囲である。
<Specific example 1>
FIG. 12 illustrates a specific calculation example. 12A is an image example of a non-defective product (A), and FIG. 12B is an image example of another good product (B), both of which are pixel values (for example, gray values) corresponding to the first feature amount. ) Is shown in the form of a grid in which 1 桝 corresponds to one pixel. In the following, for simplification, an example in which the feature amount threshold value P is calculated for each pixel from the two non-defective images in FIGS. 12A and 12B will be described. Here, the first feature amount is a pixel value (for example, a gray value). Further, the alignment range of the object to be inspected is, for example, a range of one pixel at a chessboard distance from the target pixel. It should be noted that the range of one pixel at this chessboard distance is a range that surrounds the pixel of interest with a distance of one pixel in the grid in the figure, and a total of nine pixels including a diagonal distance of one pixel.

閾値Pを算出する計算式としては、例えば平均値Mのみをパラメータとして用いた下記の式(2)を用いることが考えられる。   As a calculation formula for calculating the threshold value P, for example, the following formula (2) using only the average value M as a parameter may be used.

Figure 0006410459
Figure 0006410459

図12(A)、(B)では、注目する画素が左上から4行5列目の注目画素131a、131bである場合につき、閾値Pを算出する計算を考える。   In FIGS. 12A and 12B, calculation for calculating the threshold value P is considered when the pixel of interest is the pixel of interest 131a and 131b in the fourth row and the fifth column from the upper left.

図12(A)において、注目画素131aと、それを囲む位置合わせ範囲内の画素132aの9個の画素値は、左から右に、また上から下の順で(0,1,1,1,2,2,2,3,3)となっている。   In FIG. 12A, the nine pixel values of the pixel of interest 131a and the pixel 132a within the alignment range surrounding it are (0, 1, 1, 1) from left to right and from top to bottom. , 2, 2, 2, 3, 3).

また、図12(B)において、注目画素131bと位置合わせ範囲内の画素132bの画素値は、左上から順に(2,2,1,3,3,2,3,3,2)となっている。   In FIG. 12B, the pixel values of the target pixel 131b and the pixel 132b within the alignment range are (2, 2, 1, 3, 3, 2, 3, 3, 2) in order from the upper left. Yes.

図12(A)、(B)の18画素の画素値の平均値は2であるので、式(2)より注目画素131cの閾値Pは2となる。この操作を全画素について行った結果は図12(C)のようになる。図12(C)は、上記の式(2)により、各画素ごとに算出した特徴量閾値Pの値を示している。   Since the average value of the pixel values of the 18 pixels in FIGS. 12A and 12B is 2, the threshold value P of the pixel of interest 131c is 2 from Expression (2). The result of performing this operation for all pixels is as shown in FIG. FIG. 12C shows the value of the feature amount threshold value P calculated for each pixel by the above equation (2).

<特徴量閾値を算出する計算式の例2>
なお、特徴量閾値Pを算出する式は、上記の式(1)、(2)に限定されるものではない。例えば、パラメータとして平均値Mと標準偏差σを用い、次式(3)によって算出してもよい。
<Example 2 of calculation formula for calculating the feature amount threshold value>
Note that the formula for calculating the feature amount threshold P is not limited to the above formulas (1) and (2). For example, the average value M and the standard deviation σ may be used as parameters, and may be calculated by the following equation (3).

Figure 0006410459
この式(3)によれば、画素ごとの第1の特徴量に対する上下限閾値を設定することができる。
Figure 0006410459
According to this equation (3), the upper and lower thresholds for the first feature value for each pixel can be set.

<特徴量閾値を算出する計算式の例3>
あるいは、特徴量閾値Pは、例えば最大値をパラメータとして次式(4)のようにして算出してもよい。
<Example 3 of calculation formula for calculating the feature amount threshold value>
Alternatively, the feature amount threshold value P may be calculated as in the following equation (4), for example, using the maximum value as a parameter.

Figure 0006410459
この式(4)において、Aは、位置合わせ範囲内の画素から算出された第1の特徴量の集合である。これは式(1)においてkを大きくした場合は最大値で近似できる性質を利用したものであり、暗視野検査など上限閾値のみを設定する場合に有効である。
Figure 0006410459
In Expression (4), A is a set of first feature values calculated from pixels within the alignment range. This utilizes the property that can be approximated by the maximum value when k is increased in Equation (1), and is effective when only the upper threshold is set, such as in dark field inspection.

<具体例2>
図13を用いて、上記の式(4)を用いて特徴量閾値Pを生成した場合の具体的な計算例を説明する。図13(A)は、良品Aの画像例、また図13(B)は、別の良品Bの画像例で、いずれも第1の特徴量に対応する画素値(例えば濃淡値)を1桝を1画素に対応させた方眼の形式で示している。以下では、簡略化のため、図13(A)、図13(B)の2枚の良品画像から第1の特徴量閾値Pを画素ごとに算出する例を示す。ここでは、第1の特徴量は画素値(例えば濃淡値)である。また、被検査物の位置合わせ範囲は、例えば注目画素から市街地距離で1画素の範囲とする。なお、この市街地距離で1画素の範囲は、図中の方眼において注目画素を1画素の距離で取り囲む範囲で、斜め方向の1画素は含まない十字型の5画素の範囲である。
<Specific example 2>
A specific calculation example when the feature amount threshold value P is generated using the above equation (4) will be described with reference to FIG. 13A shows an image example of the non-defective product A, and FIG. 13B shows another image example of the non-defective product B. Each of the pixel values (for example, the gray value) corresponding to the first feature amount is 1 桝. Is shown in a grid format corresponding to one pixel. In the following, for simplification, an example in which the first feature amount threshold value P is calculated for each pixel from the two non-defective images in FIGS. 13A and 13B will be described. Here, the first feature amount is a pixel value (for example, a gray value). In addition, the alignment range of the object to be inspected is, for example, a range of one pixel from the target pixel to the city distance. Note that the range of one pixel at this urban distance is a range of five cross-shaped pixels that do not include one pixel in the oblique direction, and is a range that surrounds the target pixel at a distance of one pixel in the grid in the figure.

図13では、注目する画素が左上から4行5列目の注目画素141aである場合につき、閾値Pを算出する計算を考える。   In FIG. 13, a calculation for calculating the threshold value P is considered when the pixel of interest is the pixel of interest 141a in the fourth row and the fifth column from the upper left.

図13(A)において、注目画素141aと位置合わせ範囲内画素142aの画素値は、上から下に、また左から右の順で(1,1,2,2,3)となっている。   In FIG. 13A, the pixel values of the target pixel 141a and the in-alignment range pixel 142a are (1, 1, 2, 2, 3) from top to bottom and from left to right.

また、図12(B)において、注目画素141bと位置合わせ範囲内画素142bの画素値は、上から下に、また左から右の順で(0,0,0,1,1)となっている。   In FIG. 12B, pixel values of the target pixel 141b and the in-alignment range pixel 142b are (0, 0, 0, 1, 1) from top to bottom and from left to right. Yes.

図13(A)、(B)の10画素の画素値の最大値は3であるので、式(4)より注目画素141cの閾値Pは3となる。この操作を全画素について行った結果は図13(C)のようになる。   Since the maximum value of the pixel values of the 10 pixels in FIGS. 13A and 13B is 3, the threshold value P of the pixel of interest 141c is 3 from Equation (4). The result of performing this operation for all pixels is as shown in FIG.

<特徴量閾値を算出する計算式の例3の別形態>
特徴量閾値Pを、式(4)により第1の特徴量の最大値とする場合は、画素ごとの最大値合成処理とモルフォロジ処理で算出することができる。最大値合成処理とは、複数の画像間で同一座標の画素値を比較し、その最大値を出力する処理である。
<Another Form of Example 3 of Calculation Formula for Calculating Feature Threshold Value>
When the feature amount threshold P is set to the maximum value of the first feature amount according to the equation (4), it can be calculated by the maximum value synthesis process and the morphology process for each pixel. The maximum value composition processing is processing for comparing pixel values at the same coordinates between a plurality of images and outputting the maximum value.

また、モルフォロジ処理とは、注目画素とその近傍にある比較対象の画素に基づいた値が出力される画像処理方法の一つである。この注目画素とその近傍にある比較対象画素の位置関係を構造化要素と呼ぶ。例えば、構造化要素内の最大値を出力すれば多値膨張処理となり、最小値を出力すれば多値収縮処理となる。このような画素値の処理によって、小さな計算コスト(ないし計算資源)により式(4)の計算を実現することができる。   Morphology processing is one of image processing methods in which a value based on a pixel of interest and a comparison target pixel in the vicinity thereof is output. The positional relationship between the target pixel and the comparison target pixel in the vicinity thereof is called a structuring element. For example, if the maximum value in the structuring element is output, multi-value expansion processing is performed, and if the minimum value is output, multi-value contraction processing is performed. By processing such pixel values, the calculation of Expression (4) can be realized with a small calculation cost (or calculation resource).

<具体例3>
図14は、図13(A)、(B)の場合と同じ2枚の良品画像(図14(A)、(B))を用い、画素ごとの最大値合成処理とモルフォロジ処理により特徴量閾値Pを生成した場合の具体的な計算例を説明する。図13(A)は、良品Aの画像例、また図13(B)は、別の良品Bの画像例で、いずれも第1の特徴量に対応する画素値(例えば濃淡値)を1桝を1画素に対応させた方眼の形式で示している。ここでは、図13の場合と同様に図14(A)、図14(B)の2枚の良品画像(図13(A)、(B)のものと同じ)から第1の特徴量閾値Pを画素ごとに算出する例を示す。ここでは、第1の特徴量は画素値(例えば濃淡値)である。また、位置合わせ範囲は、図13の場合と同様、注目画素から市街地距離で1画素の範囲とし、閾値Pを算出する計算式は上記の式(4)とする。
<Specific example 3>
14 uses the same two non-defective images (FIGS. 14A and 14B) as in FIGS. 13A and 13B, and the feature amount threshold value by the maximum value synthesis process and the morphology process for each pixel. A specific calculation example when P is generated will be described. 13A shows an image example of the non-defective product A, and FIG. 13B shows another image example of the non-defective product B. Each of the pixel values (for example, the gray value) corresponding to the first feature amount is 1 桝. Is shown in a grid format corresponding to one pixel. Here, as in the case of FIG. 13, the first feature value threshold P is obtained from the two non-defective images in FIGS. 14A and 14B (the same as those in FIGS. 13A and 13B). An example of calculating for each pixel is shown. Here, the first feature amount is a pixel value (for example, a gray value). Similarly to the case of FIG. 13, the alignment range is a range of one pixel from the target pixel to the city distance, and the calculation formula for calculating the threshold value P is the above formula (4).

ここでは、まず良品画像(A)と良品画像(B)を画素ごとに最大値合成した図14(C)の画像を作成する。例えば左上から4行5列目の画素に注目した場合は、画素151aと151bの画素値の最大値は2であるため、画素151cの画素値として2が出力されている。   Here, first, an image shown in FIG. 14C is created by synthesizing the maximum values of the good image (A) and the good image (B) for each pixel. For example, when attention is paid to the pixel in the fourth row and the fifth column from the upper left, since the maximum value of the pixel values of the pixels 151a and 151b is 2, 2 is output as the pixel value of the pixel 151c.

次に、最大値合成した図14(C)の画像にモルフォロジ処理を行う。このときの構造化要素は位置合わせ範囲にあわせて設定される。この場合は図14(E)のように、注目画素153eに対して比較対象画素154eを設定する。比較対象画素154eは、注目画素153eに対して市街地距離で1画素の範囲にある4つの画素である。ここで、例えば画素151cを構造化要素の注目画素とした場合は、その周囲の範囲152cが比較対象の画素となる。この構造化要素を用いてモルフォロジ処理を行い最大値を出力すると図14(D)のような閾値分布が得られ、画素151dには閾値「3」が出力される。この図14(D)の演算結果は図13(C)と等価である。   Next, morphology processing is performed on the image of FIG. The structuring element at this time is set according to the alignment range. In this case, as shown in FIG. 14E, the comparison target pixel 154e is set for the target pixel 153e. The comparison target pixel 154e is four pixels in the range of one pixel at a city distance with respect to the target pixel 153e. Here, for example, when the pixel 151c is the target pixel of the structuring element, the surrounding range 152c is a pixel to be compared. When the morphological process is performed using this structuring element and the maximum value is output, a threshold distribution as shown in FIG. 14D is obtained, and the threshold value “3” is output to the pixel 151d. The calculation result of FIG. 14D is equivalent to that of FIG.

なお、以上では、簡略化のため1つの構造化要素を用いて1段階のモルフォロジ処理を行う例を示したが、モルフォロジ処理の中身は単独の多値膨張処理である必要はない。また、位置合わせ範囲に応じて複数の構造化要素と複数の条件の異なるモルフォロジ処理を組み合わせるようにしてもよい。   In the above, for the sake of simplification, an example in which one-stage morphological process is performed using one structuring element has been shown, but the contents of the morphological process need not be a single multi-value expansion process. Further, a plurality of structured elements and a plurality of morphological processes under different conditions may be combined according to the alignment range.

<特徴量閾値生成に必要な良品画像数の低減>
さて、位置合わせ範囲内の画素から算出される第1の特徴量は、別の良品画像の同一座標の画素から算出される第1の特徴量の近似値として考えることができる。このことを図6を用いて説明する。以下では、簡略化のため位置合わせ範囲を±1画素とする。
<Reduction of the number of non-defective images necessary for generating the feature threshold value>
Now, the first feature value calculated from the pixels within the alignment range can be considered as an approximate value of the first feature value calculated from the pixel of the same coordinate in another non-defective product image. This will be described with reference to FIG. In the following, the alignment range is set to ± 1 pixel for simplification.

図6(A)は、例えば1走査線上の1次元形式を空間方向(横軸)に取り、ある良品の画像の濃淡値断面を示している。ここでは、横軸の中央付近にある座標503とその近傍画素の位置に相当する座標502、504を示してある。また、図6(B)は、図6(A)を右方向に1画素変位させた濃淡値断面、図6(C)は、図6(A)を左方向に1画素変位させた濃淡値断面である。ここで、座標503の位置合わせ公差内に位置する座標502および504の画素から算出される濃淡値は、また別の良品濃淡画像で座標503の画素から算出される濃淡値の近似値と考えることができる。   FIG. 6A shows a grayscale cross section of a good product image by taking a one-dimensional format on one scanning line in the spatial direction (horizontal axis), for example. Here, coordinates 503 near the center of the horizontal axis and coordinates 502 and 504 corresponding to the positions of the neighboring pixels are shown. 6B is a gray value cross section obtained by shifting one pixel in the right direction in FIG. 6A, and FIG. 6C is a gray value obtained by shifting one pixel in the left direction in FIG. 6A. It is a cross section. Here, the gray value calculated from the pixels of the coordinates 502 and 504 located within the alignment tolerance of the coordinate 503 is considered as an approximate value of the gray value calculated from the pixel of the coordinate 503 in another good quality gray image. Can do.

なぜなら図6(A)の良品は、位置合わせ公差に起因して、図6(B)または図6(C)のように撮像される可能性があるためである。つまり、位置合わせ公差内の画素から算出される第1の特徴量を近似値として利用することで、1枚の良品画像からある画素から算出され得る第1の特徴量として複数の値を取得することができる。これにより、第1の特徴量に関する画素ごとの統計量に従来と同程度の信頼性を持たせることができ、例えば画素ごとの閾値生成のために読み取らなければならない濃淡画像数を従来方式よりも著しく減少させることができる。   This is because the non-defective product in FIG. 6A may be imaged as shown in FIG. 6B or FIG. 6C due to the alignment tolerance. That is, by using the first feature amount calculated from the pixels within the alignment tolerance as an approximate value, a plurality of values are acquired as the first feature amount that can be calculated from a certain pixel from a single good image. be able to. As a result, the statistics for each pixel relating to the first feature amount can be given the same level of reliability as in the past. For example, the number of grayscale images that must be read to generate a threshold value for each pixel is more than in the conventional method. Can be significantly reduced.

図4は、上記のようにして生成した特徴量閾値を用いた画像検査の制御手順の流れを示している。図4の処理では、予め図3、図11〜図14で説明した生成処理により生成した特徴量閾値が特徴量閾値記憶部1402が格納されているものとする。   FIG. 4 shows a flow of a control procedure of image inspection using the feature amount threshold generated as described above. In the process of FIG. 4, it is assumed that the feature amount threshold value storage unit 1402 stores the feature amount threshold value generated in advance by the generation processing described with reference to FIGS. 3 and 11 to 14.

図4のステップS401では、位置合わせの後、カメラ1200で被検査物を撮像し、画像データ取得部1301を介してその被検査物の濃淡画像を取得する。ステップS402では、第1の特徴量算出部1331によって、被検査物の濃淡画像から第1の特徴量を画素ごとに算出する。   In step S401 of FIG. 4, after alignment, the inspection object is imaged by the camera 1200, and a grayscale image of the inspection object is acquired via the image data acquisition unit 1301. In step S402, the first feature amount calculation unit 1331 calculates a first feature amount for each pixel from the grayscale image of the inspection object.

次にステップS403では、比較抽出部1332で特徴量閾値記憶部1402に格納されている閾値と、第1の特徴量算出部1331で算出された被検査物の第1の特徴量を画素ごとに比較する。これにより、閾値外であった画素を欠陥部(欠陥画素)として抽出する。   Next, in step S403, the threshold value stored in the feature value threshold value storage unit 1402 by the comparison extraction unit 1332 and the first feature value of the inspected object calculated by the first feature value calculation unit 1331 for each pixel. Compare. As a result, pixels that are outside the threshold are extracted as defective portions (defective pixels).

ここで、図5(C)は被検査物の濃淡画像の一例を示している。この画像では、背景510cと欠陥部511cが存在している。また、図5(D)は図5(C)は被検査物の濃淡値断面を1次元的に示している。   Here, FIG. 5C shows an example of a grayscale image of the inspection object. In this image, a background 510c and a defective portion 511c exist. FIG. 5D is a one-dimensional view of the gray value cross section of the inspection object.

この図5(C)、(D)は、図4のステップS402で第1の特徴量として画素ごとに算出された濃淡値の断面540に対して、ステップS303で算出された特徴量閾値530(破線で表示)を重ねて表示したもの、と考えてよい。この例では、図5(D)の背景510dの部位は閾値内であるため抽出されないが、欠陥部511dは閾値外となっており、欠陥部位として抽出することができる。具体的には、欠陥部511dに相当する座標505の画素は、その特徴量、および特徴量閾値530の比較(ステップS403)によって、欠陥画素であると判定される。   FIGS. 5C and 5D show the feature value threshold value 530 (calculated in step S303 with respect to the cross-section 540 of the gray value calculated for each pixel as the first feature value in step S402 in FIG. It may be considered that the display is displayed in a superimposed manner. In this example, the portion of the background 510d in FIG. 5D is not extracted because it is within the threshold, but the defective portion 511d is outside the threshold and can be extracted as a defective portion. Specifically, the pixel at the coordinate 505 corresponding to the defective portion 511d is determined to be a defective pixel by comparing the feature amount and the feature amount threshold value 530 (step S403).

図4のステップS404以降では、上記のようにして抽出される欠陥部位を予め良否判定基準記憶部1403に記憶させておいた良否判定基準を用いて解析し、その被検査物(全体)を良品または不良品のいずれであるかを判定する。   In step S404 and subsequent steps in FIG. 4, the defective part extracted as described above is analyzed using the pass / fail judgment criteria stored in the pass / fail judgment reference storage unit 1403 in advance, and the inspection object (the whole) is non-defective. Or, it is determined whether it is a defective product.

ステップS404では、欠陥特徴量算出部1333によって、比較抽出部1332で抽出された各欠陥部について、良否判定基準記憶部1403に記憶された種類の欠陥特徴量を算出する。例えば、欠陥部位は欠陥部位と判定された画素の集合と考えることができ、その欠陥部位を代表する欠陥特徴量を求め、良否判定基準との比較に用いることができる。欠陥特徴量としては、例えば欠陥部の面積を用いることができる。この欠陥部の面積は、例えば閾値判定により欠陥画素と判定された画素に対してラベリング処理などを行い、空間的に連続する欠陥部位を識別し、その欠陥部位の画素の数などを単位として求めることができる。   In step S <b> 404, the defect feature quantity calculation unit 1333 calculates the type of defect feature quantity stored in the pass / fail judgment reference storage unit 1403 for each defect part extracted by the comparison extraction unit 1332. For example, a defective part can be considered as a set of pixels determined to be a defective part, and a defect feature amount representative of the defective part can be obtained and used for comparison with a quality criterion. As the defect feature amount, for example, the area of the defect portion can be used. The area of the defective portion is obtained, for example, by performing a labeling process on a pixel determined as a defective pixel by threshold determination, identifying a spatially continuous defective portion, and determining the number of pixels in the defective portion as a unit. be able to.

ステップS405では、判定部1334によって、各欠陥部について欠陥特徴量算出部1333で算出した欠陥特徴量を良否判定基準記憶部1403に記憶された基準と比較し、致命的な欠陥の有無を判定する。そして、基準内であればその被検査物を良品と判定し(ステップS406a)、基準外の欠陥部が存在すれば不良品と判定する(ステップS406b)。   In step S405, the determination unit 1334 compares the defect feature amount calculated by the defect feature amount calculation unit 1333 for each defective portion with the reference stored in the pass / fail determination reference storage unit 1403 to determine the presence or absence of a fatal defect. . Then, if it is within the reference, the inspection object is determined to be a non-defective product (step S406a), and if there is a defective part outside the reference, it is determined to be a defective product (step S406b).

画像検査結果は例えば表示部1500(あるいは不図示のプリンタなど)を用いて表示(印刷)出力することができる。その場合、例えばステップS405、S406a、S406bの判定結果に応じ、被検査物が良品または不良品のいずれかである旨の情報を出力する。また、ステップS403などにおいて検出した欠陥部位も同様に例えば表示部1500(あるいは不図示のプリンタなど)を用いて表示(印刷)出力することができる。その場合、欠陥部位(の画素)を他の部分と異なる色や濃度によって可視表示したり、演算に係る閾値や画素(群)の特徴量を数値表示により出力したりする手法を用いることができる。   The image inspection result can be displayed (printed) and output using a display unit 1500 (or a printer (not shown), for example). In this case, for example, information indicating that the inspection object is either a non-defective product or a defective product is output according to the determination results of steps S405, S406a, and S406b. Similarly, the defective portion detected in step S403 can be displayed (printed) and output using, for example, the display unit 1500 (or a printer (not shown)). In that case, a technique can be used in which a defective part (pixel) is visually displayed with a color or density different from that of other parts, or a threshold value for calculation or a feature value of a pixel (group) is output by numerical display. .

以上のように、本実施形態によれば同一の良品画像の位置合わせ公差内の画素から算出される第1の特徴量を、例えば別の良品画像の同一座標の画素から算出される第1の特徴量の近似値として利用して、第1の特徴量に関する統計量を画素ごとに算出する。そして、この第1の特徴量に関する統計量を用いて、実際の被検査物から求めた第1の特徴量と比較するための特徴量閾値を生成することができる。つまり、第1の特徴量について当該画素から算出され得る値を、1枚の良品画像から複数取得し、それに基づいて特徴量閾値を生成することができる。   As described above, according to the present embodiment, the first feature amount calculated from the pixels within the alignment tolerance of the same non-defective image is, for example, the first feature amount calculated from the pixel at the same coordinate of another non-defective image. A statistical amount related to the first feature value is calculated for each pixel by using the approximate value of the feature value. And the feature-value threshold value for comparing with the 1st feature-value calculated | required from the actual to-be-inspected object can be produced | generated using the statistics regarding this 1st feature-value. That is, a plurality of values that can be calculated from the pixel for the first feature amount can be acquired from one good product image, and a feature amount threshold value can be generated based on the acquired value.

例えば、ある画素について生成すべき特徴量閾値を生成する場合、特許文献1のような従来技術では複数枚の良品画像の統計量を用いる必要があった。これに対して、本実施形態では、位置合わせ公差内の画素から算出される第1の特徴量を用いることにより、複数枚の良品画像の統計量を集めたのと同じ効果が得られる。すなわち、本実施形態によれば、位置合わせ公差内の画素から算出される第1の特徴量を用いることにより、ある画素の第1の特徴量、ないしはそれに基づき生成する特徴量閾値に従来と同程度の信頼性を付与することができる。   For example, when generating a feature amount threshold value to be generated for a certain pixel, it is necessary to use a statistical amount of a plurality of non-defective images in the related art as in Patent Document 1. In contrast, in the present embodiment, by using the first feature amount calculated from the pixels within the alignment tolerance, the same effect as that obtained by collecting statistics of a plurality of non-defective images can be obtained. That is, according to the present embodiment, by using the first feature amount calculated from the pixels within the alignment tolerance, the first feature amount of a certain pixel, or the feature amount threshold generated based on the first feature amount, is the same as the conventional feature amount. A degree of reliability can be imparted.

このため、従来と同程度の信頼性を有する画素ごとの特徴量閾値を生成するのに必要な良品の濃淡画像数を著しく減少させることができる。すなわち、本実施形態によれば、画像検査のため複数の良品サンプルから画素ごとに欠陥判定を行うための閾値を生成するに際して、大量の良品サンプルを必要とせず、比較的少量の良品サンプルのみを用いて閾値生成を行うことができる。   For this reason, it is possible to remarkably reduce the number of non-defective gray images necessary for generating a feature amount threshold value for each pixel having the same level of reliability as in the past. That is, according to the present embodiment, when generating a threshold value for performing defect determination for each pixel from a plurality of non-defective samples for image inspection, a large amount of non-defective samples is not required, and only a relatively small amount of non-defective samples is obtained. Threshold generation can be performed.

なお、本実施形態ないし後述の各実施形態の画像検査方法は、例えば工業製品などの生産ライン中において実施することができる。例えば、本実施形態ないし後述の各実施形態の画像検査方法を実施する装置は工業製品などの生産ラインの途中ないし終端に配置することができる。そして、本実施形態ないし後述の各実施形態の画像検査方法により欠陥なしと判定された被検査物のみを後流の組み立て工程ないし出荷工程に送るよう生産ラインを制御することができる。   In addition, the image inspection method of this embodiment thru | or each below-mentioned embodiment can be implemented in production lines, such as an industrial product, for example. For example, an apparatus for performing an image inspection method according to the present embodiment or each of the embodiments described later can be disposed in the middle or at the end of a production line for industrial products or the like. Then, the production line can be controlled so that only inspected objects determined as having no defect by the image inspection method of the present embodiment or each of the embodiments described later are sent to a downstream assembly process or shipping process.

[第2実施形態]
上記の第1実施形態では、例えば複数(例えばn個)の良品からそれぞれ良品画像を(n枚)取得し、取得した複数(n枚)の画像から特徴量閾値を生成する。しかしながら、特徴量閾値の生成のために必要な複数(n枚)の画像は、同一の良品から取得することも考えられる。本実施形態では、位置摂動部1312による摂動制御を介して同一の良品から複数(n枚)の良品画像を取得することにより、画像検査のために用意すべき良品の数を減少させる構成例につき説明する。
[Second Embodiment]
In the first embodiment, for example, (n) non-defective images are acquired from a plurality of (for example, n) non-defective products, and a feature amount threshold value is generated from the acquired (n) images. However, it is also conceivable to obtain a plurality (n) of images necessary for generating the feature amount threshold value from the same non-defective product. In the present embodiment, a configuration example in which the number of non-defective products to be prepared for image inspection is reduced by acquiring a plurality (n) of non-defective images from the same non-defective product through the perturbation control by the position perturbation unit 1312. explain.

本実施形態のハードウェアは、第1実施形態で示した図1と同じでよい。また、本実施形態において、図1に示した画像処理装置ハードウェアを用いて画像検査(外観検査、光学検査)を行う場合の演算機能をブロック構成は、第1実施形態で示した図2と同じでよい。   The hardware of this embodiment may be the same as that of FIG. 1 shown in the first embodiment. Further, in this embodiment, the block configuration of the calculation function when performing image inspection (appearance inspection, optical inspection) using the image processing apparatus hardware shown in FIG. 1 is the same as that in FIG. 2 shown in the first embodiment. It can be the same.

ただし、本実施形態では、第1実施形態では用いなかった位置摂動部1312によって被検査物の位置摂動を行い、画素ごとの閾値生成を行う。第1実施形態と異なるのは、被検査物1900の位置合わせ後に、公差範囲内の任意位置に被検査物1900を変位させながらカメラ1200による撮像を行う点である。   However, in the present embodiment, the position perturbation unit 1312 that is not used in the first embodiment performs position perturbation of the inspection object, and generates a threshold value for each pixel. The difference from the first embodiment is that, after alignment of the inspection object 1900, imaging is performed by the camera 1200 while the inspection object 1900 is displaced to an arbitrary position within the tolerance range.

図7は、本実施形態において、画像検査の準備として、欠陥特徴量の検出に作用させる(第1の)特徴量閾値を生成する処理の流れを示している。図7の特徴量閾値生成処理は、第1実施形態の図3に対応するものである。   FIG. 7 shows a flow of processing for generating a (first) feature amount threshold value that acts on detection of a defect feature amount as preparation for image inspection in the present embodiment. The feature amount threshold value generation process of FIG. 7 corresponds to FIG. 3 of the first embodiment.

第1実施形態の図3の処理との違いは、画像検査準備において複数の良品画像データを取得する際、実際に複数の異なる良品を用意して読み取るのではなく、同一の良品を1度ないし数度摂動させて、その同一の良品から2枚以上の画像を撮像する点にある。   The difference from the process of FIG. 3 in the first embodiment is that when acquiring a plurality of non-defective product image data in image inspection preparation, a plurality of non-defective products are not actually prepared and read, but the same non-defective product is read once or twice. The point is that two or more images are taken from the same non-defective product by being perturbed several times.

すなわち、図7のステップS311では、同一の良品を位置摂動部1312によって位置合わせ公差内の任意位置に1度ないし数度摂動、変位させ、その都度、同一の良品をカメラ1200で撮像し、濃淡画像を取得する。例えば、位置合わせ公差内を1画素(ないし数画素)の範囲内とする。そして、最初の位置合わせおよび撮像の後、その範囲内で直交座標軸に沿って上下左右(東西南北)に適当な距離(1ないし数画素数分)、位置摂動部1312で摂動させれば、同じ良品からさらに4枚の画像を取得できる。   That is, in step S311 of FIG. 7, the same non-defective product is perturbed and displaced by 1 to several degrees at an arbitrary position within the alignment tolerance by the position perturbation unit 1312. Get an image. For example, the alignment tolerance is set within a range of one pixel (or several pixels). Then, after the initial alignment and imaging, if the position perturbation unit 1312 perturbs by an appropriate distance (one to several pixels) along the orthogonal coordinate axis within the range, up, down, left and right (east, west, north, and south), the same Four more images can be acquired from non-defective products.

図7のステップS311を除く処理ステップは、図3と同一のステップ番号で示しているように図3の場合と同様に実施することができる。例えば、特にステップS303の特徴量閾値生成においては、第1実施形態において式(1)〜(4)および図11〜図14で説明した全ての演算手法を用いることができる。その場合、上記のようにして位置摂動部1312の摂動制御を介して同じ良品から取得した複数(n枚)の画像を第1実施形態において説明した(それぞれ別の良品から取得した)複数の良品画像の代りに用いて上述の演算手法を用いればよい。そして、実際の被検査物の画像検査は、図4のフローチャートに示した処理手順を用いれば良い。   Processing steps other than step S311 in FIG. 7 can be performed in the same manner as in FIG. 3, as indicated by the same step numbers as in FIG. For example, in particular, in the feature amount threshold value generation in step S303, all the calculation methods described in the expressions (1) to (4) and FIGS. 11 to 14 in the first embodiment can be used. In that case, a plurality of (n sheets) images acquired from the same non-defective product via the perturbation control of the position perturbation unit 1312 as described above are described in the first embodiment (a plurality of non-defective products respectively acquired from different non-defective products). The above calculation method may be used instead of the image. Then, the actual image inspection of the inspection object may use the processing procedure shown in the flowchart of FIG.

本実施形態によれば、同一の良品から、位置摂動部1312の摂動制御を介して複数の良品画像を取得し、欠陥特徴量の検出に作用させる(第1の)特徴量閾値を生成することができる。特徴量閾値の生成処理は、第1実施形態において説明した手法のいずれかを用いることができる。   According to the present embodiment, a plurality of non-defective images are acquired from the same non-defective product via the perturbation control of the position perturbation unit 1312, and a (first) feature amount threshold value that acts on detection of a defect feature amount is generated. Can do. Any of the methods described in the first embodiment can be used for the feature amount threshold generation processing.

例えば、本実施形態では、特徴量閾値のために位置摂動部1312による摂動制御を介して同一の良品から例えばn枚の良品画像を取得することができる。一方、第1実施形態の演算処理がn枚の良品画像のためにn個の良品を用意することを前提とするなら、本実施形態によれば、1/nの個数の良品を用意するだけで第1実施形態とほぼ同等の信頼性を有する特徴量閾値を生成することができる。   For example, in the present embodiment, for example, n non-defective images can be acquired from the same non-defective product through the perturbation control by the position perturbation unit 1312 for the feature amount threshold. On the other hand, if it is assumed that the arithmetic processing of the first embodiment prepares n non-defective products for n non-defective images, according to the present embodiment, only 1 / n non-defective products are prepared. Thus, it is possible to generate a feature amount threshold value having substantially the same reliability as that of the first embodiment.

また、本実施形態では、位置摂動部1312による摂動制御を介して、位置合わせ公差内で被検査物を実際に摂動させて、その位置の被検査物から画像を取得する。このため、同一の良品を用いた場合でも、実際に被検査物の位置が変位した場合に生じる照明方向やカメラとの位置関係の変化が反映した複数の良品画像を取得し、欠陥特徴量の検出に作用させる(第1の)特徴量閾値を生成することができる。   In this embodiment, the inspection object is actually perturbed within the alignment tolerance through the perturbation control by the position perturbation unit 1312, and an image is acquired from the inspection object at that position. For this reason, even when the same non-defective product is used, a plurality of non-defective images that reflect changes in the illumination direction and the positional relationship with the camera that occur when the position of the object to be inspected are actually obtained are acquired. It is possible to generate a (first) feature amount threshold value that affects detection.

このため、本実施形態によれば、撮像位置の変位に起因して同一座標の画素から算出される第1の特徴量の変化の影響も含めた統計量を画素ごとに算出することができる。その結果、撮像位置の変位に対応した特徴量閾値が設定可能となり、閾値設定精度が向上するという効果を得ることができる。   For this reason, according to the present embodiment, it is possible to calculate, for each pixel, a statistic including the influence of the change in the first feature amount calculated from the pixel at the same coordinate due to the displacement of the imaging position. As a result, it is possible to set a feature amount threshold corresponding to the displacement of the imaging position, and an effect of improving the threshold setting accuracy can be obtained.

例えば、本実施形態の制御は、被検査物の変位によって生じる照明方向やカメラとの位置関係の変化の影響を受けやすい(例えば深い凹凸を多数、撮像される面に有するなど)形状の被検査物の画像検査において好適に実施できる可能性がある。   For example, the control of the present embodiment is subject to an inspection of a shape that is easily affected by changes in the illumination direction or the positional relationship with the camera caused by the displacement of the inspection object (for example, having a large number of deep irregularities on the imaged surface) There is a possibility that it can be suitably performed in image inspection of objects.

[第3実施形態]
第1および第2実施例では、複数の良品画像から第1の特徴量を取得し、取得した第1の特徴量を用いた演算により画素ごとに特徴量閾値を生成する。この特徴量閾値は、被検査物の画像データから別途、第2の特徴量を取得し、この第2の特徴量を用いて、画像検査の目的に沿うより適切な値に補正することも考えられる。本実施形態では、このような特徴量閾値の補正技術につき説明する。
[Third Embodiment]
In the first and second embodiments, a first feature amount is acquired from a plurality of non-defective images, and a feature amount threshold value is generated for each pixel by calculation using the acquired first feature amount. It is also conceivable that this feature value threshold value is obtained separately from the image data of the object to be inspected, and the second feature value is used to correct the feature value to a more appropriate value for the purpose of the image inspection. It is done. In the present embodiment, such a feature amount threshold value correction technique will be described.

本実施形態のハードウェアは、第1実施形態で示した図1と同じでよい。また、図8は、本実施形態において、図1に示した画像処理装置ハードウェアを用いて画像検査(外観検査、光学検査)を行う場合の演算機能をブロック構成を示している。ただし、図8では形式上、第1実施形態の図2と同様に第2実施形態で用いた位置摂動部1312を図示しているが、本実施形態では、説明を容易にするため、この位置摂動部1312による摂動制御は利用することなく実施する画像検査制御につき説明する。   The hardware of this embodiment may be the same as that of FIG. 1 shown in the first embodiment. FIG. 8 shows a block configuration of a calculation function when performing image inspection (appearance inspection, optical inspection) using the image processing apparatus hardware shown in FIG. 1 in the present embodiment. However, although the position perturbation unit 1312 used in the second embodiment is illustrated in FIG. 8 in the same manner as in FIG. 2 of the first embodiment, in this embodiment, this position is shown in this embodiment for ease of explanation. The image inspection control performed without using the perturbation control by the perturbation unit 1312 will be described.

図8において、第1および第2実施形態と異なる点は、被検査物の濃淡画像から第2の特徴量を画素ごとに算出する第2の特徴量算出部1323と、第2の特徴量を用いて特徴量閾値を補正する特徴量閾値補正部1324とを有する点である。その他の機能ブロックは同一の参照符号を用いている通り、図2に示したものと同様でよい。   In FIG. 8, the difference from the first and second embodiments is that a second feature amount calculation unit 1323 that calculates a second feature amount for each pixel from the grayscale image of the object to be inspected, and a second feature amount. And a feature amount threshold value correcting unit 1324 that corrects the feature amount threshold value. Other functional blocks may be the same as those shown in FIG. 2 as the same reference numerals are used.

以下、本実施形態の制御について、図9および図10を用いて説明する。図9は、図4と同様のフローチャート形式で、本実施形態における被検査物の画像検査手順を示している。また、図10は、本実施形態において処理される画像データの構造を模式的に示している。   Hereinafter, the control of this embodiment will be described with reference to FIGS. 9 and 10. FIG. 9 shows an image inspection procedure of the inspection object in the present embodiment in the same flowchart format as FIG. FIG. 10 schematically shows the structure of image data processed in the present embodiment.

図8の機能構成、および図9の制御手順において第1および第2実施形態の動作と異なる点は、第1に第2の特徴量算出部1323によって被検査物の濃淡画像から第2の特徴量を画素ごとに算出(ステップS411)する点にある。また、第2に、特徴量閾値補正部1324によって第1の特徴量閾値を第2の特徴量を用いて補正する(ステップS412)点にある。それ以外の処理ステップは、同一のステップ番号で示しているように図4の場合と同様に実施することができる。   The difference between the functional configuration of FIG. 8 and the control procedure of FIG. 9 from the operations of the first and second embodiments is that the second feature amount calculation unit 1323 first uses the second feature from the grayscale image of the inspection object. The amount is calculated for each pixel (step S411). Second, the feature value threshold correction unit 1324 corrects the first feature value threshold value using the second feature value (step S412). Other processing steps can be performed in the same manner as in FIG. 4 as indicated by the same step number.

第1および第2実施形態では、被検査物の外形や照明の写り込みなどの外乱情報である背景の誤抽出を防止するため、背景の近傍画素では特徴量閾値が過大に設定される傾向がある。その結果、背景の近傍画素では閾値の設定精度が低く、欠陥抽出感度が低くなる可能性がある。   In the first and second embodiments, in order to prevent erroneous background extraction, which is disturbance information such as the outer shape of the object to be inspected and the reflection of illumination, there is a tendency that the feature amount threshold is set excessively in the pixels near the background. is there. As a result, the threshold setting accuracy is low in pixels near the background, and the defect extraction sensitivity may be low.

例えば、図10(A)は被検査物の濃淡画像の一例を示しているが、同図の画像では背景110aと欠陥部111aが存在する。ここで、第1の特徴量としてエッジ強度が選択された場合に基づき、上記の欠陥抽出感度に関する問題につき考察する。   For example, FIG. 10A shows an example of a grayscale image of an inspection object. In the image of FIG. 10A, a background 110a and a defective portion 111a exist. Here, based on the case where the edge strength is selected as the first feature amount, the above-described problem relating to the defect extraction sensitivity will be considered.

図10(B)は、図10(A)の画像からステップS402で算出されたエッジ強度の断面に対して、例えば第1実施形態のステップS303で算出された特徴量閾値130を重ねて表示したものである。なお、図10(B)において符号120は、被検査物から第1の特徴量として取得したエッジ強度信号の波形を示している。   FIG. 10B displays the feature amount threshold 130 calculated in step S303 of the first embodiment, for example, overlaid on the cross-section of the edge strength calculated in step S402 from the image of FIG. 10A. Is. In FIG. 10B, reference numeral 120 indicates the waveform of the edge intensity signal acquired as the first feature amount from the inspection object.

図10(B)に示すように、特徴量閾値130の波形は、背景110aの近傍座標102、103、104の画素に関して背景110bのピークよりも高い閾値を有している。そのため、このような特徴量閾値130(の波形)では、背景110bの誤抽出は抑制できるが、欠陥部111bを抽出することは困難である。   As shown in FIG. 10B, the waveform of the feature amount threshold 130 has a threshold higher than the peak of the background 110b with respect to the pixels of the neighboring coordinates 102, 103, and 104 of the background 110a. Therefore, with such a feature amount threshold value 130 (waveform thereof), erroneous extraction of the background 110b can be suppressed, but it is difficult to extract the defective portion 111b.

一方、本実施形態によれば、まず被検査物の濃淡画像から第2の特徴量を画素ごとに算出する(図9のステップS411)。この第2の特徴量として、本実施形態では例えば空間周波数の低周波成分の情報を利用する。ただし、この第2の特徴量は、被検査物の画像データから取得可能であり、かつ背景が存在する画素は大きな値となり、欠陥部が存在する画素は小さな値となる性質の特徴量であれば、他の任意の特徴量を用いることができる。   On the other hand, according to the present embodiment, first, the second feature amount is calculated for each pixel from the grayscale image of the inspection object (step S411 in FIG. 9). As the second feature amount, in the present embodiment, for example, information on a low frequency component of a spatial frequency is used. However, the second feature amount can be obtained from the image data of the inspection object, and the feature amount has such a property that a pixel having a background has a large value and a pixel having a defective portion has a small value. For example, any other feature amount can be used.

本実施形態において、被検査物の濃淡画像から第2の特徴量として取得すべき低周波成分の情報は、例えば走査線方向の画素値(濃淡値、エッジ強度など)をローパスフィルタに通すことにより得られる。ローパスフィルタの通過特性は、被検査物、カメラ、照明系の特性により生じる背景の特性などに応じて予め適宜定めておけばよい。また、第2の特徴量として取得すべき低周波成分の情報は、ローパスフィルタ通過後の画像信号において、元の画素に対応する座標位置から画素ごとに取得することができる。   In this embodiment, the low-frequency component information to be acquired as the second feature amount from the grayscale image of the inspection object is obtained by, for example, passing a pixel value (grayscale value, edge strength, etc.) in the scanning line direction through a low-pass filter. can get. The pass characteristics of the low-pass filter may be appropriately determined in advance according to the characteristics of the background caused by the characteristics of the object to be inspected, the camera, and the illumination system. In addition, the low frequency component information to be acquired as the second feature amount can be acquired for each pixel from the coordinate position corresponding to the original pixel in the image signal after passing through the low-pass filter.

図10(C)は、図10(A)に示した被検査物の濃淡画像から算出された低周波成分の断面を示している。図10(A)において、欠陥部111aは背景110aより面積が小さい。このため背景110aの近傍に位置し、欠陥部111aが存在する座標104の画素は、図10(C)に示すように背景110aが存在する座標102および103の画素より低周波成分が小さくなる。   FIG. 10C shows a cross section of a low-frequency component calculated from the grayscale image of the inspection object shown in FIG. In FIG. 10A, the defective portion 111a has a smaller area than the background 110a. For this reason, the pixel of the coordinate 104 located near the background 110a and having the defective portion 111a has a lower frequency component than the pixels of the coordinates 102 and 103 having the background 110a as shown in FIG. 10C.

図10(C)のような低周波成分の情報を用いて、図10(B)の特徴量閾値130を図10(D)に示すような波形の特徴量閾値140に補正することができる。なお、図10(D)において符号120は、図10(B)と同様に被検査物から第1の特徴量として取得したエッジ強度信号の波形を示している。   Using the low-frequency component information as shown in FIG. 10C, the feature amount threshold 130 in FIG. 10B can be corrected to the waveform feature amount threshold 140 as shown in FIG. 10D. In FIG. 10D, reference numeral 120 denotes the waveform of the edge intensity signal acquired as the first feature amount from the inspection object, as in FIG.

図10(D)において、背景110dの2つのエッジ強度ピーク部分は補正された特徴量閾値140の波形以下にカバーされている。一方、欠陥部111dのエッジ強度ピーク部分では、低周波成分の情報により特徴量閾値140の値が図10(B)よりも低く補正されているため、この欠陥部111dを正しく欠陥として抽出することができる。   In FIG. 10D, the two edge intensity peak portions of the background 110d are covered below the waveform of the corrected feature amount threshold value 140. On the other hand, in the edge intensity peak portion of the defect portion 111d, the value of the feature amount threshold value 140 is corrected to be lower than that in FIG. 10B based on the low-frequency component information, and thus the defect portion 111d is correctly extracted as a defect. Can do.

本実施形態の画像検査準備は、第1実施形態で説明した図3のように行う。図3の処理では、前述のようにステップS303において良品画像から画素ごとに特徴量閾値を取得し、特徴量閾値記憶部1402に記憶させておく。   Image inspection preparation of this embodiment is performed as shown in FIG. 3 described in the first embodiment. In the process of FIG. 3, as described above, a feature amount threshold value is acquired for each pixel from the non-defective image in step S303 and stored in the feature amount threshold value storage unit 1402.

一方、特徴量閾値を補正する第2の特徴量は、上記のごとく図10で説明した通り、実際に検査される被検査物の画像から取得する必要がある。従って、図9の画像検査処理では、ステップS411において被検査物の濃淡画像データから第2の特徴量として例えば低周波成分の情報を取得する。   On the other hand, as described above with reference to FIG. 10, the second feature value for correcting the feature value threshold value needs to be acquired from the image of the inspection object actually inspected. Therefore, in the image inspection process of FIG. 9, in step S411, for example, low frequency component information is acquired as the second feature amount from the grayscale image data of the inspection object.

そして、ステップS412において、特徴量閾値記憶部1402に画素ごとに記憶されている特徴量閾値を第2の特徴量を用いて補正する。この補正は、画素ごとに、記憶されている特徴量閾値に対して行うが、補正演算には例えば式(5)のような演算を用いることができる。   In step S412, the feature value threshold value stored for each pixel in the feature value threshold value storage unit 1402 is corrected using the second feature value. This correction is performed on the stored feature amount threshold value for each pixel. For the correction calculation, for example, a calculation such as Expression (5) can be used.

Figure 0006410459
Figure 0006410459

式(5)において、Taは補正後の閾値、Tbは補正前の閾値、(L×s1)の部分がTbに乗算される補正量である。また、Lは上記のようにして取得した第2の特徴量で、本実施形態においてはその画素の低周波成分に対応する画素値である。また、s1は任意定数であり、本実施形態においては、低周波成分Lを0以上1以下にスケーリングするために濃淡画像の階調数の逆数を用いることが好適である。図9の他の処理ステップは、図4で説明した同一ステップ番号の処理ステップと同じであるから、ここでは詳細な説明は省略する。   In Expression (5), Ta is a threshold value after correction, Tb is a threshold value before correction, and a correction amount by which a portion of (L × s1) is multiplied by Tb. L is the second feature amount acquired as described above, and is a pixel value corresponding to the low-frequency component of the pixel in this embodiment. Further, s1 is an arbitrary constant, and in the present embodiment, it is preferable to use the reciprocal of the gradation number of the grayscale image in order to scale the low-frequency component L from 0 to 1. The other processing steps in FIG. 9 are the same as the processing steps having the same step numbers described in FIG. 4, and thus detailed description thereof is omitted here.

以上のようにして、画像検査処理において、被検査物の画像データから第2の特徴量として例えば低周波成分の情報を取得し、その値により良品から画素ごとに取得し、記憶させておいた特徴量閾値を補正することができる。これにより被検査物の外形や照明の写り込みなどの外乱情報である背景の誤抽出を防止し、確実な欠陥(良否)判定を行うことができる。   As described above, in the image inspection processing, for example, low-frequency component information is acquired as the second feature amount from the image data of the object to be inspected, and is acquired for each pixel from the non-defective product according to the value and stored. The feature amount threshold value can be corrected. As a result, it is possible to prevent erroneous extraction of the background, which is disturbance information such as the outer shape of the object to be inspected and the reflection of illumination, and to perform reliable defect (good or bad) determination.

図10(D)に示した通り、本実施形態の処理によって背景110dの2つのエッジ強度ピーク部分は補正された特徴量閾値140の波形以下にカバーされ、誤抽出されることなく良品の特徴部分として検出することができる。一方、欠陥部111dのエッジ強度ピーク部分では、特徴量閾値140の値が低く補正され、この欠陥部111dを正しく欠陥として抽出することができる。   As shown in FIG. 10D, the two edge intensity peak portions of the background 110d are covered below the corrected feature amount threshold value 140 waveform by the processing of the present embodiment, and the non-defective feature portions are not erroneously extracted. Can be detected as On the other hand, at the edge intensity peak portion of the defective portion 111d, the value of the feature amount threshold value 140 is corrected to be low, and the defective portion 111d can be correctly extracted as a defect.

以上のように本実施形態によれば、被検査物から算出される第2の特徴量を用いることで、背景近傍の画素に設定される特徴量閾値を、背景が存在する画素と異なる値に補正することができる。これにより、本実施形態によれば、背景近傍の画素における閾値設定精度が向上し、かつ欠陥抽出感度を向上させ、より的確な画像検査が可能になる。   As described above, according to the present embodiment, by using the second feature amount calculated from the object to be inspected, the feature amount threshold set for the pixels near the background is set to a value different from that of the pixels in which the background exists. It can be corrected. Thereby, according to this embodiment, the threshold setting accuracy in the pixels near the background is improved, the defect extraction sensitivity is improved, and more accurate image inspection is possible.

以上、3つの実施形態を示したが、本発明の画像検査技術は、例えば任意の工業製品を撮像し、撮像した画像から欠陥(良否)判定を行う画像検査方法として、任意の画像検査装置において実施することができる。なお、上記各実施形態の画像処理および欠陥判定を行う画像検査(処理)装置のCPU2100により実行される。従って上述した機能を実現するソフトウェアのプログラムを記録した記録媒体を画像検査装置に供給し、CPU2100が記録媒体に格納されたプログラムを読み出し実行することによって達成されるよう構成することができる。この場合、記録媒体から読み出されたプログラム自体が上述した実施形態の機能を実現することになり、プログラム自体、ないしそのプログラムを記録した記録媒体は本発明を構成することになる。   Although the three embodiments have been described above, the image inspection technique according to the present invention can be applied to an arbitrary image inspection apparatus as an image inspection method for imaging an arbitrary industrial product and determining a defect (good or bad) from the captured image. Can be implemented. It is executed by the CPU 2100 of the image inspection (processing) apparatus that performs image processing and defect determination in each of the above embodiments. Therefore, it can be configured to be achieved by supplying a recording medium recording a software program for realizing the above-described functions to the image inspection apparatus, and reading and executing the program stored in the recording medium by the CPU 2100. In this case, the program itself read from the recording medium realizes the functions of the above-described embodiment, and the program itself or the recording medium recording the program constitutes the present invention.

また、上記各実施形態では、コンピュータで読み取り可能な記録媒体が記憶装置2300、または他の不図示の外部記憶デバイスであるものとして説明したが、本発明はこのような形態に限定されるものではない。本発明を実施するためのプログラムは、コンピュータ読み取り可能な記録媒体であれば、いかなる記録媒体に記録されていてもよい。例えば、プログラムを供給するための記録媒体としては、着脱式のHDDやSSD、光学ディスク、各種フラッシュメモリデバイスなど、任意の外部記憶デバイスを用いることができるのはいうまでもない。   In each of the above embodiments, the computer-readable recording medium has been described as the storage device 2300 or other external storage device (not shown). However, the present invention is not limited to such a form. Absent. The program for carrying out the present invention may be recorded on any recording medium as long as it is a computer-readable recording medium. For example, as a recording medium for supplying the program, it goes without saying that any external storage device such as a removable HDD, SSD, optical disk, or various flash memory devices can be used.

1200…カメラ、1400…記憶部、1401…画像データ記憶部、1403…良否判定基準記憶部、1500…表示部、1600…入力部、1900…被検査物、2000…内部バス、2100…CPU、2200…メモリ、2300…記憶装置、2400…外部通信ポート、2500…外部接続機器 1200 ... Camera, 1400 ... Storage unit, 1401 ... Image data storage unit, 1403 ... Pass / fail judgment reference storage unit, 1500 ... Display unit, 1600 ... Input unit, 1900 ... Inspected object, 2000 ... Internal bus, 2100 ... CPU, 2200 ... Memory, 2300 ... Storage device, 2400 ... External communication port, 2500 ... Externally connected device

Claims (16)

被検査物の画像データを取得して前記被検査物の欠陥判定を行う画像検査方法において、
複数の良品サンプルの画像データの同一座標の画素の画素値と、前記同一座標の画素の周囲に位置する複数の画素の画素値とに対する統計量演算によって取得した第1の特徴量に基づき、画素ごとの特徴量閾値を生成する閾値生成工程と、
前記被検査物の画像データを取得し、画素ごとに取得した第2の特徴量に基づいて、前記閾値生成工程で画素ごとに生成された前記特徴量閾値を補正する補正工程と、
前記被検査物の画像データから取得した第1の特徴量と、前記補正工程にて補正された前記特徴量閾値とを比較して閾値を超えた画素を欠陥部位として抽出する欠陥抽出工程と、
前記欠陥抽出工程により抽出された画素が構成する欠陥部位の特性に基づき前記被検査物の欠陥の有無を判定する欠陥判定工程と、を含むことを特徴とする画像検査方法。
In the image inspection method for acquiring the image data of the inspection object and determining the defect of the inspection object,
Based on the first feature amount acquired by the statistic calculation for the pixel value of the pixel at the same coordinate in the image data of the plurality of non-defective samples and the pixel value of the plurality of pixels located around the pixel at the same coordinate , A threshold generation step of generating a feature amount threshold for each ;
A correction step of acquiring image data of the inspection object and correcting the feature amount threshold generated for each pixel in the threshold generation step based on a second feature amount acquired for each pixel;
A defect extraction step of comparing the first feature amount acquired from the image data of the inspection object and the feature amount threshold value corrected in the correction step to extract a pixel exceeding the threshold value as a defect site;
A defect determination step of determining the presence / absence of a defect in the inspection object based on a characteristic of a defective portion formed by the pixel extracted by the defect extraction step.
請求項1に記載の画像検査方法において、前記閾値生成工程では、同一の良品サンプルを前記画像データの取得の際の位置決めの公差範囲内で摂動させ、前記摂動の都度、取得した同一の良品サンプルの画像データを前記複数の良品サンプルの画像データとして用いることを特徴とする画像検査方法。 2. The image inspection method according to claim 1, wherein in the threshold generation step, the same non-defective sample is perturbed within a positioning tolerance range when acquiring the image data, and the acquired same non-defective sample is obtained every time the perturbation occurs. An image inspection method using the image data as image data of the plurality of non-defective samples. 請求項1に記載の画像検査方法において、前記閾値生成工程における前記同一座標の画素の周囲に位置する複数の画素は、前記画像データの取得の際の位置決めの公差範囲内にある画素であることを特徴とする画像検査方法。2. The image inspection method according to claim 1, wherein a plurality of pixels positioned around the pixel having the same coordinate in the threshold generation step are pixels within a positioning tolerance range when acquiring the image data. An image inspection method characterized by the above. 請求項1から3のいずれか1項に記載の画像検査方法において、検査者の選択操作に応じて選択された種類の特徴量を前記第1の特徴量として用いることを特徴とする画像検査方法。   4. The image inspection method according to claim 1, wherein a feature quantity of a type selected according to an inspector's selection operation is used as the first feature quantity. 5. . 請求項1から4のいずれか1項に記載の画像検査方法において、前記統計量演算が前記複数の良品サンプルの画像データの同一座標の画素の画素値、および前記同一座標の画素の周囲に位置する複数の画素の画素値に対する多値膨張処理または多値収縮処理であることを特徴とする画像検査方法。 5. The image inspection method according to claim 1, wherein the statistic calculation is performed around a pixel value of a pixel at the same coordinate in the image data of the plurality of non-defective samples and a pixel around the pixel at the same coordinate. An image inspection method, which is multi-value expansion processing or multi-value contraction processing for pixel values of a plurality of pixels. 請求項1から5のいずれか1項に記載の画像検査方法において、前記統計量演算が前記複数の良品サンプルの画像データの同一座標の画素の画素値、および前記同一座標の画素の周囲に位置する複数の画素の画素値に対する最大値合成処理、およびモルフォロジ処理であることを特徴とする画像検査方法。 6. The image inspection method according to claim 1, wherein the statistic calculation is performed around a pixel value of a pixel at the same coordinate in the image data of the plurality of non-defective samples and a pixel around the pixel at the same coordinate. An image inspection method comprising: a maximum value synthesis process and a morphology process for pixel values of a plurality of pixels. 請求項1から6のいずれか1項に記載の画像検査方法において、前記第1の特徴量が画素の濃淡値であることを特徴とする画像検査方法。   The image inspection method according to any one of claims 1 to 6, wherein the first feature amount is a gray value of a pixel. 請求項1から6のいずれか1項に記載の画像検査方法において、前記第1の特徴量が画素ごとに算出されるエッジ強度の情報であることを特徴とする画像検査方法。   The image inspection method according to claim 1, wherein the first feature amount is information on edge strength calculated for each pixel. 請求項1から6のいずれか1項に記載の画像検査方法において、前記第2の特徴量が画素ごとに算出される低周波成分の情報であることを特徴とする画像検査方法。 7. The image inspection method according to claim 1 , wherein the second feature amount is information of a low-frequency component calculated for each pixel. 8. 請求項1から9のいずれか1項に記載の画像検査方法の各工程を制御装置に実行させるための画像検査プログラム。   The image inspection program for making a control apparatus perform each process of the image inspection method of any one of Claim 1 to 9. 請求項10に記載の画像検査プログラムを格納したコンピュータ読み取り可能な記録媒体。   A computer-readable recording medium storing the image inspection program according to claim 10. 請求項1から9のいずれか1項に記載の画像検査方法により被検査物を検査する検査工程を備え、前記欠陥判定工程において欠陥なしと判定された被検査物を後流の組み立て工程または出荷工程に送ることを特徴とする生産方法。   An inspection process for inspecting an inspection object by the image inspection method according to claim 1, wherein the inspection object determined as having no defects in the defect determination process is a downstream assembly process or shipping. A production method characterized by being sent to a process. 被検査物の画像データを取得して前記被検査物の欠陥判定を行う画像検査装置において、
撮像対象物の画像データを取得する撮像手段と、
前記撮像手段により撮像した複数の良品サンプルの画像データの同一座標の画素の画素値と、前記同一座標の画素の周囲に位置する複数の画素の画素値とに対する統計量演算によって取得した第1の特徴量に基づき、画素ごとの特徴量閾値を生成する制御装置と、
前記特徴量閾値を記憶する記憶部と、を備え、
前記制御装置は、前記撮像手段により撮像された被検査物の画像データより、画素ごとに取得した第2の特徴量に基づいて、前記記憶部に記憶された画素ごとの前記特徴量閾値を補正し、被検査物の画像データより取得した第1の特徴量と、前記補正された特徴量閾値とを比較して閾値を超えた画素を欠陥部位として抽出し、抽出された画素が構成する欠陥部位の特性に基づき前記被検査物の欠陥の有無を判定することを特徴とする画像検査装置。
In the image inspection apparatus for acquiring the image data of the inspection object and determining the defect of the inspection object,
Imaging means for obtaining image data of the imaging object;
The first obtained by a statistic calculation on the pixel value of the pixel of the same coordinate of the image data of the plurality of non-defective samples imaged by the imaging means and the pixel value of the pixel located around the pixel of the same coordinate based on the feature quantity, and a control unit for generating a feature amount threshold for each pixel,
A storage unit for storing the feature amount threshold,
Wherein the control device, from the image data of the object imaged by the imaging means, on the basis of the second feature amount acquired for each pixel, corrects the feature amount threshold value for each pixel stored in the storage unit Then, the first feature amount acquired from the image data of the object to be inspected is compared with the corrected feature amount threshold value, and a pixel exceeding the threshold value is extracted as a defective portion, and the defect formed by the extracted pixel An image inspection apparatus for determining the presence or absence of a defect of the inspection object based on a characteristic of a part.
請求項13に記載の画像検査装置において、前記制御装置が前記第1の特徴量として画素の濃淡値を取得することを特徴とする画像検査装置。14. The image inspection apparatus according to claim 13, wherein the control device acquires a gray value of a pixel as the first feature amount. 請求項13に記載の画像検査装置において、前記制御装置が前記第1の特徴量として画素ごとに算出されるエッジ強度の情報を取得することを特徴とする画像検査装置。The image inspection apparatus according to claim 13, wherein the control device acquires edge intensity information calculated for each pixel as the first feature amount. 請求項13から15のいずれか1項に記載の画像検装置において、前記制御装置が前記第2の特徴量として画素ごとに算出される低周波成分の情報を取得することを特徴とする画像検査装置。16. The image inspection apparatus according to claim 13, wherein the control device acquires information on a low frequency component calculated for each pixel as the second feature amount. apparatus.
JP2014087947A 2014-04-22 2014-04-22 Image inspection method and image inspection apparatus Active JP6410459B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014087947A JP6410459B2 (en) 2014-04-22 2014-04-22 Image inspection method and image inspection apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014087947A JP6410459B2 (en) 2014-04-22 2014-04-22 Image inspection method and image inspection apparatus

Publications (2)

Publication Number Publication Date
JP2015206702A JP2015206702A (en) 2015-11-19
JP6410459B2 true JP6410459B2 (en) 2018-10-24

Family

ID=54603589

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014087947A Active JP6410459B2 (en) 2014-04-22 2014-04-22 Image inspection method and image inspection apparatus

Country Status (1)

Country Link
JP (1) JP6410459B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109580632B (en) * 2018-11-23 2021-03-30 京东方科技集团股份有限公司 Defect determination method, device and storage medium
CN116708764B (en) * 2023-08-09 2023-11-24 苏州艾微视图像科技有限公司 Inspection device and inspection method for camera internal parameters

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0633343A (en) * 1992-07-13 1994-02-08 Toyota Autom Loom Works Ltd Cloth inspecting apparatus
JPH06160302A (en) * 1992-11-17 1994-06-07 Kawasaki Steel Corp Method and apparatus for inspecting surface flaw of running strip
JP3577194B2 (en) * 1997-05-07 2004-10-13 シーケーディ株式会社 Tablet appearance inspection method and tablet appearance inspection device
JP2002140695A (en) * 2000-11-01 2002-05-17 Omron Corp Inspection method and its device
GB0324638D0 (en) * 2003-10-22 2003-11-26 Gore W L & Ass Uk An on-line inspection system
JP4416827B1 (en) * 2008-09-10 2010-02-17 シャープ株式会社 Evaluation apparatus, calibration method, calibration program, and recording medium
JP2010091360A (en) * 2008-10-07 2010-04-22 Yamatake Corp Method and device for inspecting image
JP5956814B2 (en) * 2012-04-20 2016-07-27 株式会社キーエンス Appearance inspection apparatus, appearance inspection method, and computer program

Also Published As

Publication number Publication date
JP2015206702A (en) 2015-11-19

Similar Documents

Publication Publication Date Title
US7881520B2 (en) Defect inspection system
JP5956814B2 (en) Appearance inspection apparatus, appearance inspection method, and computer program
WO2013187206A1 (en) Image processing device, image processing method, and image processing program
JP2008180696A (en) Defect detector, defect detecting method, image sensor device, image sensor module, defect detecting program, and computer readable recording medium
KR20130108413A (en) Charged particle beam apparatus
US11836961B2 (en) Information processing apparatus, information processing method, and storage medium for determining whether a captured image of a subject is suitable for recognition processing
KR101146081B1 (en) Detection of macro-defects using micro-inspection inputs
JP5660861B2 (en) Foreign matter inspection method and foreign matter inspection apparatus on substrate
JPWO2014013792A1 (en) Noise evaluation method, image processing apparatus, imaging apparatus, and program
JP4279833B2 (en) Appearance inspection method and appearance inspection apparatus
JP6045429B2 (en) Imaging apparatus, image processing apparatus, and image processing method
JP6410459B2 (en) Image inspection method and image inspection apparatus
JP2009036582A (en) Inspection method, inspection device and inspection program of plane display panel
JP2006155579A (en) Image processing method and image processing apparatus
JP2023514944A (en) Method and device for correction of ring artifacts in CT images and computer program medium
JP7003669B2 (en) Surface inspection equipment and surface inspection method
JP6818263B2 (en) Fracture surface analysis device and fracture surface analysis method
JP2007057705A (en) Inspection method and inspection apparatus of display panel
JP4403036B2 (en) Soot detection method and apparatus
JP6114559B2 (en) Automatic unevenness detector for flat panel display
JP2011232302A (en) Image inspection method and image inspection device
JP2008096302A (en) Defect inspection device
JP4367474B2 (en) Defect inspection equipment
JP2006329898A (en) Measuring method and device of surface distortion
CN110288662A (en) Display detection method and system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170421

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180220

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180227

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180426

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: 20180828

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180925

R151 Written notification of patent or utility model registration

Ref document number: 6410459

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151