JP6812118B2 - Defect detector, defect detection method and program - Google Patents

Defect detector, defect detection method and program Download PDF

Info

Publication number
JP6812118B2
JP6812118B2 JP2016052075A JP2016052075A JP6812118B2 JP 6812118 B2 JP6812118 B2 JP 6812118B2 JP 2016052075 A JP2016052075 A JP 2016052075A JP 2016052075 A JP2016052075 A JP 2016052075A JP 6812118 B2 JP6812118 B2 JP 6812118B2
Authority
JP
Japan
Prior art keywords
image
defect
region
defect candidate
captured image
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
JP2016052075A
Other languages
Japanese (ja)
Other versions
JP2017166957A (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.)
Screen Holdings Co Ltd
Original Assignee
Screen Holdings Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Screen Holdings Co Ltd filed Critical Screen Holdings Co Ltd
Priority to JP2016052075A priority Critical patent/JP6812118B2/en
Priority to EP17752875.9A priority patent/EP3418726A4/en
Priority to PCT/JP2017/001604 priority patent/WO2017141611A1/en
Priority to US15/998,664 priority patent/US11216936B2/en
Priority to TW106103793A priority patent/TWI626440B/en
Publication of JP2017166957A publication Critical patent/JP2017166957A/en
Application granted granted Critical
Publication of JP6812118B2 publication Critical patent/JP6812118B2/en
Priority to US17/536,290 priority patent/US20220084183A1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Description

本発明は、対象物の表面の欠陥を検出する技術に関する。 The present invention relates to a technique for detecting surface defects of an object.

従来、自動車の駆動部に用いられる金属部品は、鍛造または鋳造により製造される。金属部品の製造後には、得られた金属部品に傷等の欠陥が無いかどうかを調べる、いわゆる外観検査が行われる。このような金属部品の外観検査は、従来、作業者の目視により行われていた。しかしながら、作業者の目視に依存すると、複数の作業者間で、検査にかかる時間や検査結果にばらつきが生じる。また、同一の作業者であっても、体調不良や集中力の低下により、検査に時間がかかったり、欠陥の見落としが発生したりするおそれがある。このため、金属部品の外観検査を、自動かつ高速に行うことができる装置の開発が求められている。 Conventionally, metal parts used for driving parts of automobiles are manufactured by forging or casting. After manufacturing the metal parts, a so-called visual inspection is performed to check whether the obtained metal parts have defects such as scratches. Conventionally, the visual inspection of such metal parts has been performed visually by an operator. However, depending on the visual inspection of the worker, the time required for the inspection and the inspection result vary among the plurality of workers. In addition, even if the same worker is in poor physical condition or has poor concentration, the inspection may take a long time or defects may be overlooked. Therefore, there is a demand for the development of an apparatus capable of automatically and at high speed in visual inspection of metal parts.

ここで、従来より、対象物に光を照射して撮像し、撮像画像に基づいて対象物の外観を検査する装置が利用されている。特に、撮像画像について、膨張収縮処理を施す前後の画像で差分処理を行って、欠陥候補を抽出する技術(いわゆる自己比較技術)が公知である。 Here, conventionally, an apparatus has been used in which an object is irradiated with light to take an image and the appearance of the object is inspected based on the captured image. In particular, a technique (so-called self-comparison technique) is known in which a difference process is performed on an captured image before and after the expansion / contraction process to extract defect candidates.

例えば、特許文献1の電子部品の外観を検査する外観検査装置では、撮像画像を二値化処理したあと、膨張処理と収縮処理を行ってサイズの小さな欠陥を消失させた収縮画像を生成し、これと撮像画像との差分をとることでサイズの小さな欠陥を抽出している。また、特許文献1では、撮像画像と基準画像との差分処理により、サイズの大きな欠陥の抽出も併せて行い、差分画像のうち1つでもNG(欠陥)であると判定すれば、撮像画像は欠陥であるとする判定結果を出力することが記載されている(段落0061−0074、図5、図6参照)。 For example, in the visual inspection apparatus for inspecting the appearance of an electronic component of Patent Document 1, after binarizing the captured image, expansion processing and contraction processing are performed to generate a contracted image in which small defects are eliminated. By taking the difference between this and the captured image, a defect with a small size is extracted. Further, in Patent Document 1, if a defect having a large size is also extracted by the difference processing between the captured image and the reference image and it is determined that even one of the difference images is NG (defect), the captured image is obtained. It is described that the determination result of the defect is output (see paragraphs 0061-0074, FIGS. 5 and 6).

特開2015−137921号公報JP 2015-137921

上記のような自己比較による検査は、検査の基準となる画像(以下、「参照画像」という)の準備を要さず、撮像画像のみから、撮像画像に存在する各種の欠陥を抽出することができる。しかしながら、撮像画像に含まれる対象物の表面のうち、欠陥ではない細いラインや細かい凹凸も欠陥として検出するため、過検出の抑制が必要とされる。 The above self-comparison inspection does not require the preparation of an image (hereinafter referred to as "reference image") as a reference for the inspection, and can extract various defects existing in the captured image only from the captured image. it can. However, on the surface of the object included in the captured image, fine lines and fine irregularities that are not defects are also detected as defects, so it is necessary to suppress over-detection.

本発明は上記課題に鑑みなされたものであり、自己比較により抽出された欠陥候補から実際には欠陥に相当しないもの(偽欠陥)を高い精度にて除くことにより、欠陥の過検出を抑制することを目的としている。 The present invention has been made in view of the above problems, and over-detection of defects is suppressed by removing defects that do not actually correspond to defects (false defects) from the defect candidates extracted by self-comparison with high accuracy. The purpose is.

上記の課題を解決するための本願の第1発明は、対象物の表面の欠陥を検出する欠陥検出装置であって、対象物を撮像して撮像画像を取得する撮像部と、前記撮像画像に対応する参照画像を記憶する記憶部と、前記撮像画像の各画素の値と、前記撮像画像に対し、最大値フィルタを用いる膨張処理および最小値フィルタを用いる収縮処理のうち一方処理を施し、さらに膨張処理および収縮処理のうち前記一方処理とは異なる他方処理を施して得られる画像の前記撮像画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、欠陥候補領域を検出し、前記参照画像の各画素の値と、前記参照画像に対し、前記一方処理を施し、さらに前記他方処理を施して得られる画像の前記参照画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、マスク領域を検出し、前記欠陥候補領域のうち、前記マスク領域と重なる領域を、欠陥候補から除外し、前記欠陥候補領域と前記マスク領域とを重ねる際の位置合わせよりも正確に前記撮像画像と前記参照画像との位置合わせを行った後に、前記一方処理が膨張処理である場合には、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が暗い領域を他の欠陥候補領域として取得し、前記一方処理が収縮処理である場合には、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が明るい領域を他の欠陥候補領域として取得し、前記欠陥候補領域と前記他の欠陥候補領域とが重なる領域を、新たな欠陥候補領域として取得したうえで、前記新たな欠陥候補領域に基づいて前記撮像画像における欠陥の存在を取得する欠陥取得部とを備える。 The first invention of the present application for solving the above-mentioned problems is a defect detection device that detects defects on the surface of an object, and includes an imaging unit that captures an image of the object and acquires an captured image, and the captured image. A storage unit that stores the corresponding reference image, the value of each pixel of the captured image, and one of the expansion processing using the maximum value filter and the contraction processing using the minimum value filter are performed on the captured image, and further. A defect candidate region is detected based on at least one of a difference or a ratio between the value of the pixel corresponding to the captured image of the image obtained by performing the other processing different from the one processing of the expansion treatment and the contraction treatment. , The difference or ratio between the value of each pixel of the reference image and the value of the pixel corresponding to the reference image of the image obtained by subjecting the reference image to the one-sided processing and further performing the other-processing. A mask region is detected based on at least one of them, and among the defect candidate regions, a region overlapping the mask region is excluded from the defect candidates, and the alignment is performed when the defect candidate region and the mask region are overlapped. After accurately aligning the captured image with the reference image, if the one-sided process is an expansion process, the reference image is imaged based on the difference image or the ratio image of these images. When a region darker in the image is acquired as another defect candidate region and the one-sided processing is a shrinkage processing, the captured image is based on the difference image or the ratio image of these images with respect to the reference image. A brighter region is acquired as another defect candidate region, an region where the defect candidate region and the other defect candidate region overlap is acquired as a new defect candidate region, and then based on the new defect candidate region. It also includes a defect acquisition unit that acquires the presence of defects in the captured image.

第1発明によれば、撮像画像の自己比較により検出された欠陥候補のうち、参照画像の自己比較結果と重なるものを、欠陥候補から除外することができ、その結果、撮像画像に含まれる欠陥ではないものの周囲よりも明るい部分または暗い部分を欠陥候補から除去して過検出を抑制することができる。また、いわゆる自己比較により検出された欠陥候補と、撮像画像と参照画像との差分画像により検出された欠陥候補(いわゆる他者比較により検出された欠陥候補)とが重なる領域を、新たな欠陥候補とすることで、より確実に過検出を抑制することができる。 According to the first invention, among the defect candidates detected by the self-comparison of the captured images, those that overlap with the self-comparison result of the reference image can be excluded from the defect candidates, and as a result, the defects included in the captured image. It is possible to suppress over-detection by removing a portion brighter or darker than the surroundings from the defect candidates. In addition, a new defect candidate is defined as a region where the defect candidate detected by the so-called self-comparison and the defect candidate detected by the difference image between the captured image and the reference image (the defect candidate detected by the so-called comparison with others) overlap. By doing so, overdetection can be suppressed more reliably.

本願の第2発明は、第1発明の欠陥検出装置であって、欠陥取得部は、前記撮像画像における第1欠陥および当該第1欠陥とは異なる第2欠陥の存在を取得し、前記撮像画像の各画素の値と、前記撮像画像に対し、膨張処理を施した後に収縮処理を施して得られる画像の前記撮像画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、第1欠陥候補領域を検出し、前記参照画像の各画素の値と、前記参照画像に対し、膨張処理を施した後に収縮処理を施して得られる画像の前記参照画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、第1マスク領域を検出し、前記第1欠陥候補領域のうち、前記第1マスク領域と重なる領域を、第1欠陥候補から除外し、前記第1欠陥候補領域と前記第1マスク領域とを重ねる際の位置合わせよりも正確に前記撮像画像と前記参照画像との位置合わせを行った後に、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が暗い領域を第3欠陥候補領域として取得し、前記第1欠陥候補領域と前記第3欠陥候補領域とが重なる領域を、新たな第1欠陥候補領域として取得したうえで、前記新たな第1欠陥候補領域に基づいて前記撮像画像における第1欠陥の存在を取得する第1欠陥取得部と、前記撮像画像の各画素の値と、前記撮像画像に対し、収縮処理を施した後に膨張処理を施して得られる画像の前記撮像画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、第2欠陥候補領域を検出し、前記参照画像の各画素の値と、前記参照画像に対し、収縮処理を施した後に膨張処理を施して得られる画像の前記参照画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、第2マスク領域を検出し、前記第2欠陥候補領域のうち、前記第2マスク領域と重なる領域を、第2欠陥候補から除外し、前記第2欠陥候補領域と前記第2マスク領域とを重ねる際の位置合わせよりも正確に前記撮像画像と前記参照画像との位置合わせを行った後に、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が明るい領域を第4欠陥候補領域として取得し、前記第2欠陥候補領域と前記第4欠陥候補領域とが重なる領域を、新たな第2欠陥候補領域として取得したうえで、前記新たな2欠陥候補領域に基づいて前記撮像画像における第2欠陥の存在を取得する第2欠陥取得部とを有することを特徴とする。 The second invention of the present application is the defect detection device of the first invention, and the defect acquisition unit acquires the presence of the first defect in the captured image and the second defect different from the first defect, and the captured image. Based on at least one of the difference or ratio between the value of each pixel of the above and the value of the pixel corresponding to the captured image of the image obtained by subjecting the captured image to the expansion process and then the contraction process. The value of each pixel of the reference image after detecting the first defect candidate region, and the value of the pixel corresponding to the reference image of the image obtained by subjecting the reference image to expansion processing and then contraction processing. The first mask region is detected based on at least one of the difference or the ratio of, and the region of the first defect candidate region that overlaps with the first mask region is excluded from the first defect candidate, and the first defect candidate region is excluded . After aligning the captured image and the reference image more accurately than the alignment when the defect candidate region and the first mask region are overlapped, the reference is based on the difference image or the ratio image of these images. The region where the captured image is darker than the image is acquired as the third defect candidate region, and the region where the first defect candidate region and the third defect candidate region overlap is acquired as a new first defect candidate region. Then, with respect to the first defect acquisition unit that acquires the presence of the first defect in the captured image based on the new first defect candidate region, the value of each pixel of the captured image, and the captured image. The second defect candidate region is detected based on at least one of the difference or the ratio between the value of the pixel corresponding to the captured image of the image obtained by performing the shrinkage treatment and then the expansion treatment, and the reference image is described. The first is based on at least one of the difference or the ratio between the value of each pixel and the value of the pixel corresponding to the reference image of the image obtained by subjecting the reference image to the contraction process and then the expansion process. When detecting 2 mask regions, excluding the region overlapping the second mask region from the second defect candidate region from the second defect candidate, and overlapping the second defect candidate region with the second mask region. After aligning the captured image and the reference image more accurately than the alignment of the above, the captured image has a brighter region with respect to the reference image based on the difference image or the ratio image of these images. It is acquired as a fourth defect candidate area, and an area where the second defect candidate area and the fourth defect candidate area overlap is acquired as a new second defect candidate area, and then based on the new two defect candidate area. 2nd defect to acquire the presence of the 2nd defect in the captured image It is characterized by having a depression acquisition unit.

第2発明によれば、欠陥取得部は、膨張処理および収縮処理の順序を換えることで、第1欠陥および当該第1欠陥とは異なる第2欠陥、すなわち異なる種類の欠陥を取得することができる。これにより、撮像画像に含まれる欠陥の検出漏れをより確実に防止することができる。 According to the second invention, the defect acquisition unit can acquire the first defect and the second defect different from the first defect, that is, a different kind of defect by changing the order of the expansion treatment and the contraction treatment. .. As a result, it is possible to more reliably prevent omission of detection of defects included in the captured image.

上記の課題を解決するための本願の第3発明は、対象物の表面の欠陥を検出する欠陥検出方法であって、a)撮像部にて対象物を撮像して撮像画像を取得する撮像工程と、b)前記撮像画像の各画素の値と、前記撮像画像に対し、最大値フィルタを用いる膨張処理および最小値フィルタを用いる収縮処理のうち一方処理を施し、さらに膨張処理および収縮処理のうち前記一方処理とは異なる他方処理を施して得られる画像の前記撮像画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、欠陥候補領域を検出する欠陥候補領域検出工程と、c)前記撮像画像に対応する参照画像が準備されており、前記参照画像の各画素の値と、前記参照画像に対し、前記一方処理を施し、さらに前記他方処理を施して得られる画像の前記参照画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、マスク領域を検出するマスク領域検出工程と、d)前記欠陥候補領域のうち、前記マスク領域と重なる領域を、欠陥候補から除外する欠陥候補除外工程と、e)前記欠陥候補領域と前記マスク領域とを重ねる際の位置合わせよりも正確に前記撮像画像と前記参照画像との位置合わせを行った後に、前記一方処理が膨張処理である場合には、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が暗い領域を他の欠陥候補領域として取得し、前記一方処理が収縮処理である場合には、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が明るい領域を他の欠陥候補領域として取得し、前記欠陥候補領域と前記他の欠陥候補領域とが重なる領域を、新たな欠陥候補領域として取得したうえで、前記新たな欠陥候補領域に基づいて前記撮像画像における欠陥の存在を取得する欠陥取得工程とを備える。 The third invention of the present application for solving the above-mentioned problems is a defect detection method for detecting defects on the surface of an object, and a) an imaging step of capturing an image of the object with an imaging unit to acquire an image. And b) The value of each pixel of the captured image and one of the expansion process using the maximum value filter and the contraction process using the minimum value filter are performed on the captured image, and further, among the expansion process and the contraction process. A defect candidate region detection step of detecting a defect candidate region based on at least one of a difference or a ratio between the value of the pixel corresponding to the captured image of the image obtained by performing the other processing different from the one processing. c) A reference image corresponding to the captured image is prepared, and the value of each pixel of the reference image and the reference image are subjected to the one-sided processing and further the other-processed image. A mask area detection step of detecting a mask area based on at least one of the difference or ratio with the value of the pixel corresponding to the reference image, and d) a defect in the defect candidate area that overlaps with the mask area. The one-sided processing is performed after the defect candidate exclusion step of excluding from the candidates and e) the alignment of the captured image and the reference image are performed more accurately than the alignment when the defect candidate region and the mask region are overlapped. When is an expansion process, a region darker in the captured image than the reference image is acquired as another defect candidate region based on the difference image or the ratio image of these images, and the one-sided process is contracted. In the case of processing, a region in which the captured image is brighter than the reference image is acquired as another defect candidate region based on the difference image or the ratio image of these images, and the defect candidate region and the other A defect acquisition step is provided in which a region overlapping the defect candidate region of the above is acquired as a new defect candidate region, and then the presence of a defect in the captured image is acquired based on the new defect candidate region.

発明によれば、撮像画像の自己比較により検出された欠陥候補のうち、参照画像の自己比較結果と重なる領域を、欠陥候補から除外することができ、その結果、撮像画像に含まれる欠陥ではないものの周囲よりも明るい部分または暗い部分を欠陥候補から除去して過検出を抑制することができる。また、いわゆる自己比較により検出された欠陥候補と、撮像画像と参照画像との差分画像により検出された欠陥候補(いわゆる他者比較により検出された欠陥候補)とが重なる領域を、新たな欠陥候補とすることで、より確実に過検出を抑制することができる。 According to the third invention, among the defect candidates detected by the self-comparison of the captured images, the region overlapping with the self-comparison result of the reference image can be excluded from the defect candidates, and as a result, the defects included in the captured image. It is possible to suppress over-detection by removing a portion brighter or darker than the surroundings from the defect candidates. In addition, a new defect candidate is defined as a region where the defect candidate detected by the so-called self-comparison and the defect candidate detected by the difference image between the captured image and the reference image (the defect candidate detected by the so-called comparison with others) overlap. By doing so, overdetection can be suppressed more reliably.

上記の課題を解決するための本願の第4発明は、コンピュータに、対象物の表面の対象
領域の複数の画像から前記対象領域における欠陥を検出させるプログラムであって、前記
プログラムの前記コンピュータによる実行は、前記コンピュータに、a)前記対象領域を撮像して取得される撮像画像および対応する参照画像を準備する工程と、b)前記撮像画像の各画素の値と、前記撮像画像に対し、最大値フィルタを用いる膨張処理および最小値フィルタを用いる収縮処理のうち一方処理を施し、さらに膨張処理および収縮処理のうち前記一方処理とは異なる他方処理を施して得られる画像の前記撮像画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、欠陥候補領域を検出する欠陥候補領域検出工程と、c)前記撮像画像に対応する参照画像が準備されており、前記参照画像の各画素の値と、前記参照画像に対し、前記一方処理を施し、さらに前記他方処理を施して得られる画像の前記参照画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、マスク領域を検出するマスク領域検出工程と、d)前記欠陥候補領域のうち、前記マスク領域と重なる領域を、欠陥候補から除外する欠陥候補除外工程と、e)前記欠陥候補領域と前記マスク領域とを重ねる際の位置合わせよりも正確に前記撮像画像と前記参照画像との位置合わせを行った後に、前記一方処理が膨張処理である場合には、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が暗い領域を他の欠陥候補領域として取得し、前記一方処理が収縮処理である場合には、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が明るい領域を他の欠陥候補領域として取得し、前記欠陥候補領域と前記他の欠陥候補領域とが重なる領域を、新たな欠陥候補領域として取得したうえで、前記新たな欠陥候補領域に基づいて前記撮像画像における欠陥の存在を取得する欠陥取得工程とを実行させる。
The fourth invention of the present application for solving the above-mentioned problems is a program for causing a computer to detect a defect in the target area from a plurality of images of the target area on the surface of the object, and the computer executes the program. In the computer, a) a step of preparing an captured image acquired by imaging the target area and a corresponding reference image, and b) a value of each pixel of the captured image and a maximum with respect to the captured image. subjected to expansion processing and contrast processing in the contraction process using the minimum value filter uses a value filter, corresponding to the captured image of the image obtained by performing different other processing further the one processing in the expansion processing and contraction processing A defect candidate region detection step of detecting a defect candidate region based on at least one of a difference or a ratio between the pixel value and c) a reference image corresponding to the captured image is prepared, and each of the reference images Based on at least one of the difference or ratio between the pixel value and the pixel value corresponding to the reference image of the image obtained by subjecting the reference image to the one-sided processing and further performing the other-processing. A mask area detection step of detecting a mask area, d) a defect candidate exclusion step of excluding an area overlapping the mask area from the defect candidates, and e) the defect candidate area and the mask area. After aligning the captured image and the reference image more accurately than the alignment at the time of superimposing, if the one-sided processing is the expansion processing, it is based on the difference image or the ratio image of these images. When the region in which the captured image is darker than the reference image is acquired as another defect candidate region and the one-side processing is the shrinkage processing, the reference is based on the difference image or the ratio image of these images. A region in which the captured image is brighter than the image is acquired as another defect candidate region, and an region in which the defect candidate region and the other defect candidate region overlap is acquired as a new defect candidate region. A defect acquisition step of acquiring the presence of a defect in the captured image is executed based on the new defect candidate region.

発明のプログラムをコンピュータにインストールすることによって、撮像画像の自己比較により検出された欠陥候補のうち、参照画像の自己比較結果と重なる領域を、欠陥候補から除外する欠陥検出装置を得ることができ、その結果、撮像画像に含まれる欠陥ではないものの周囲よりも明るい部分または暗い部分を欠陥候補から除去して過検出を抑制することができる。また、いわゆる自己比較により検出された欠陥候補と、撮像画像と参照画像との差分画像により検出された欠陥候補(いわゆる他者比較により検出された欠陥候補)とが重なる領域を、新たな欠陥候補とすることで、より確実に過検出を抑制することができる。 By installing the program of the fourth invention on a computer, it is possible to obtain a defect detection device that excludes a region overlapping with the self-comparison result of the reference image from the defect candidates detected by the self-comparison of the captured images. As a result, over-detection can be suppressed by removing a portion brighter or darker than the surroundings from the defect candidates, although it is not a defect contained in the captured image. In addition, a new defect candidate is defined as a region where the defect candidate detected by the so-called self-comparison and the defect candidate detected by the difference image between the captured image and the reference image (the defect candidate detected by the so-called comparison with others) overlap. By doing so, overdetection can be suppressed more reliably.

本発明によれば、欠陥の過検出を抑制することができる。 According to the present invention, over-detection of defects can be suppressed.

欠陥検出装置の構成を示す図である。It is a figure which shows the structure of the defect detection apparatus. 欠陥検出装置の本体を示す平面図である。It is a top view which shows the main body of a defect detection apparatus. コンピュータの構成を示す図である。It is a figure which shows the structure of a computer. コンピュータが実現する機能構成を示すブロック図である。It is a block diagram which shows the functional structure realized by a computer. 第1欠陥取得部の構成を示す図である。It is a figure which shows the structure of the 1st defect acquisition part. 第1欠陥候補取得部の構成を示す図である。It is a figure which shows the structure of the 1st defect candidate acquisition part. 第3欠陥候補取得部の構成を示す図である。It is a figure which shows the structure of the 3rd defect candidate acquisition part. 図5における欠陥候補限定部の構成を示す図である。It is a figure which shows the structure of the defect candidate limitation part in FIG. 第2欠陥取得部の構成を示す図である。It is a figure which shows the structure of the 2nd defect acquisition part. 第2欠陥候補取得部の構成を示す図である。It is a figure which shows the structure of the 2nd defect candidate acquisition part. 第4欠陥候補取得部の構成を示す図である。It is a figure which shows the structure of the 4th defect candidate acquisition part. 図9における欠陥候補限定部の構成を示す図である。It is a figure which shows the structure of the defect candidate limitation part in FIG. 欠陥検出装置の動作の流れを示す図である。It is a figure which shows the flow of operation of a defect detection apparatus. 図13における第1欠陥取得工程の流れを示す図である。It is a figure which shows the flow of the 1st defect acquisition process in FIG. 図13における第2欠陥取得工程の流れを示す図である。It is a figure which shows the flow of the 2nd defect acquisition process in FIG. 図14における第1欠陥候補取得工程の流れを示す図である。It is a figure which shows the flow of the 1st defect candidate acquisition process in FIG. 図15における第2欠陥候補取得工程の流れを示す図である。It is a figure which shows the flow of the 2nd defect candidate acquisition process in FIG. 図16の処理内容を説明するための画像例である。It is an image example for demonstrating the processing content of FIG. 図14の第3欠陥候補取得工程の処理内容を説明するための画像例である。It is an image example for demonstrating the processing content of the 3rd defect candidate acquisition process of FIG. 図14の欠陥候補限定工程の処理内容を説明するための画像例である。It is an image example for demonstrating the processing content of the defect candidate limiting process of FIG. 図17の処理内容を説明するための画像例である。It is an image example for demonstrating the processing content of FIG. 図15の第4欠陥候補取得工程の処理内容を説明するための画像例である。It is an image example for demonstrating the processing content of the 4th defect candidate acquisition process of FIG. 図15の欠陥候補限定工程の処理内容を説明するための画像例である。It is an image example for demonstrating the processing content of the defect candidate limiting process of FIG.

図1は、本発明の一の実施の形態に係る欠陥検出装置1の構成を示す図である。図2は、欠陥検出装置1の本体11を示す平面図である。欠陥検出装置1は、鏡面でない表面を有する立体的な対象物9の外観を検査する装置であり、対象物9の表面の欠陥を検出する。 FIG. 1 is a diagram showing a configuration of a defect detection device 1 according to an embodiment of the present invention. FIG. 2 is a plan view showing the main body 11 of the defect detection device 1. The defect detection device 1 is a device for inspecting the appearance of a three-dimensional object 9 having a non-mirror surface, and detects defects on the surface of the object 9.

<検査の対象物について>
対象物9は、例えば、鍛造や鋳造により形成された金属部品である。対象物9の表面は微小な凹凸を有する梨地状、すなわち、艶消し状態である。換言すれば、対象物9の表面は、光を乱反射しつつ、光沢を有する。対象物9の表面の光沢度は、好ましくは、約20〜約60である。光沢度とは、正反射光の割合や、拡散反射光の方向分布等に注目して、物体表面の光沢の程度を一次元的に表す指標である。光沢度は、JIS等の工業規格の光沢度測定方法に準拠した光沢計を利用して測定される。
<About the object to be inspected>
The object 9 is, for example, a metal part formed by forging or casting. The surface of the object 9 is satin-like with minute irregularities, that is, in a matte state. In other words, the surface of the object 9 has a gloss while reflecting light diffusely. The glossiness of the surface of the object 9 is preferably about 20 to about 60. The glossiness is an index that one-dimensionally expresses the degree of glossiness on the surface of an object by paying attention to the ratio of specularly reflected light and the directional distribution of diffusely reflected light. The glossiness is measured using a glossometer compliant with the glossiness measurement method of an industrial standard such as JIS.

対象物9の表面は、サンドブラストや、スチールショットブラスト等、所定の投射材を用いたショットブラストにより処理され、上下面と側面との境界部やエッジにおける角部や成形時のバリが除去された形状(いわゆる、R形状)となっている。対象物9は、例えば、自在継手に用いられる各種部品であり、例えば車両、航空機または発電機の駆動部分に用いられる金属部品である。 The surface of the object 9 was treated by shot blasting using a predetermined projecting material such as sandblasting or steel shot blasting, and corners and burrs at the edges and boundaries between the upper and lower surfaces and the side surfaces were removed. It has a shape (so-called R shape). The object 9 is, for example, various parts used for a universal joint, for example, a metal part used for a driving part of a vehicle, an aircraft, or a generator.

対象物9の表面における欠陥とは、理想的な形状に対して凹状または凸状となっている部位である。欠陥は、例えば、打痕、傷、加工不良等である。欠陥は、表面に付着している異物であってもよい。 A defect on the surface of the object 9 is a portion that is concave or convex with respect to an ideal shape. Defects include, for example, dents, scratches, processing defects, and the like. The defect may be a foreign object adhering to the surface.

<欠陥検出装置の構成>
図1に示すように、欠陥検出装置1は、本体11と、コンピュータ12とを備える。本体11は、保持部2と、複数の撮像部3(図1では、符号3a,3b,3cを付すが、これらを区別しない場合は符合3を付す。)と、光照射部4とを備える。対象物9は保持部2に保持される。本体11には、外部の光が保持部2上に到達することを防止する図示省略の遮光カバーが設けられ、保持部2、撮像部3および光照射部4は、遮光カバー内に設けられる。
<Configuration of defect detection device>
As shown in FIG. 1, the defect detection device 1 includes a main body 11 and a computer 12. The main body 11 includes a holding unit 2, a plurality of imaging units 3 (in FIG. 1, reference numerals 3a, 3b, 3c are attached, but when these are not distinguished, a code 3 is attached), and a light irradiation unit 4. .. The object 9 is held by the holding unit 2. The main body 11 is provided with a light-shielding cover (not shown) for preventing external light from reaching the holding unit 2, and the holding unit 2, the imaging unit 3, and the light irradiation unit 4 are provided in the light-shielding cover.

対象物9の全表面を自動で検査する場合は、もう1つの本体11が設けられる。そして、2つの本体11の間に対象物9の上下を反転して対象物9を搬送する機構が設けられる。 When the entire surface of the object 9 is automatically inspected, another main body 11 is provided. Then, a mechanism for transporting the object 9 by inverting the object 9 upside down is provided between the two main bodies 11.

図1および図2に示すように、複数の撮像部3には、1個の上方撮像部3aと、8個の斜方撮像部3bと、8個の側方撮像部3cとが含まれる。上方撮像部3aは、保持部2の上方に配置される。上方撮像部3aにより保持部2上の対象物9を真上から撮像した画像が取得可能である。 As shown in FIGS. 1 and 2, the plurality of imaging units 3 include one upper imaging unit 3a, eight oblique imaging units 3b, and eight side imaging units 3c. The upper imaging unit 3a is arranged above the holding unit 2. An image of the object 9 on the holding unit 2 captured from directly above can be acquired by the upper imaging unit 3a.

図2に示すように、上側から下方を向いて本体11を見た場合に(すなわち、本体11を平面視した場合に)、8個の斜方撮像部3bは保持部2の周囲に配置される。8個の斜方撮像部3bは、保持部2の中心を通り、上下方向を向く中心軸J1を中心とする周方向に45°の角度間隔(角度ピッチ)にて配列される。図1に示すように、各斜方撮像部3bの光軸K2と中心軸J1とを含む面において、光軸K2と中心軸J1とがなす角度θ2は、およそ45°である。各斜方撮像部3bにより保持部2上の対象物9を斜め上から撮像した画像が取得可能である。対象物9を斜め上から撮像するのであれば、角度θ2は45°には限定されず、好ましくは、15〜75°の範囲で任意に設定されてよい。 As shown in FIG. 2, when the main body 11 is viewed from the upper side to the lower side (that is, when the main body 11 is viewed in a plan view), eight oblique imaging units 3b are arranged around the holding unit 2. To. The eight oblique imaging units 3b pass through the center of the holding unit 2 and are arranged at an angular interval (angle pitch) of 45 ° in the circumferential direction centered on the central axis J1 facing in the vertical direction. As shown in FIG. 1, the angle θ2 formed by the optical axis K2 and the central axis J1 is approximately 45 ° on the surface of each oblique imaging unit 3b including the optical axis K2 and the central axis J1. Each oblique imaging unit 3b can acquire an image obtained by capturing an object 9 on the holding unit 2 from diagonally above. If the object 9 is imaged from diagonally above, the angle θ2 is not limited to 45 °, and is preferably set arbitrarily in the range of 15 to 75 °.

本体11を平面視した場合に、8個の側方撮像部3cも、8個の斜方撮像部3bと同様に保持部2の周囲に配置される。8個の側方撮像部3cは、周方向に45°の角度間隔にて配列される。各側方撮像部3cの光軸K3と中心軸J1とを含む面において、光軸K3と中心軸J1とがなす角度θ3は、およそ90°である。各側方撮像部3cにより保持部2上の対象物9を横から撮像した画像が取得可能である。 When the main body 11 is viewed in a plan view, the eight lateral imaging units 3c are also arranged around the holding unit 2 in the same manner as the eight oblique imaging units 3b. The eight lateral imaging units 3c are arranged at an angular interval of 45 ° in the circumferential direction. The angle θ3 formed by the optical axis K3 and the central axis J1 on the surface of each side imaging unit 3c including the optical axis K3 and the central axis J1 is approximately 90 °. An image obtained by capturing an object 9 on the holding unit 2 from the side can be acquired by each side imaging unit 3c.

上方撮像部3a、斜方撮像部3bおよび側方撮像部3cは、例えば、CCD(Charge Coupled Device)やCMOS(Complementary Metal-Oxide Semiconductor)等の2次元イメージセンサを有し、多階調の画像が取得される。上方撮像部3a、斜方撮像部3bおよび側方撮像部3cは、図示省略の支持部により支持される。 The upper imaging unit 3a, the oblique imaging unit 3b, and the side imaging unit 3c have, for example, a two-dimensional image sensor such as a CCD (Charge Coupled Device) or a CMOS (Complementary Metal-Oxide Semiconductor), and have a multi-gradation image. Is obtained. The upper image pickup unit 3a, the oblique image pickup unit 3b, and the side image pickup unit 3c are supported by a support portion (not shown).

光照射部4は、1個の上方光源部4aと、8個の斜方光源部4bと、8個の側方光源部4cとを含む。上方光源部4aは上方撮像部3aに隣接する。上方光源部4aでは、複数のLED(発光ダイオード)が中心軸J1に垂直に、すなわち、水平に配列される。上方光源部4aにより保持部2上の対象物9に対してほぼ真上から光が照射される。 The light irradiation unit 4 includes one upper light source unit 4a, eight oblique light source units 4b, and eight side light source units 4c. The upper light source unit 4a is adjacent to the upper imaging unit 3a. In the upper light source unit 4a, a plurality of LEDs (light emitting diodes) are arranged perpendicularly to the central axis J1, that is, horizontally. The upper light source unit 4a irradiates the object 9 on the holding unit 2 with light from substantially directly above.

本体11を平面視した場合に、8個の斜方光源部4bは保持部2の周囲に配置される。斜方光源部4bはそれぞれ斜方撮像部3bに隣接する。8個の斜方光源部4bは、周方向に45°の角度間隔にて配列される。各斜方光源部4bでは、複数のLEDが光軸K2にほぼ垂直に配列される。各斜方光源部4bでは、保持部2上の対象物9に対して斜め上から光が照射可能である。 When the main body 11 is viewed in a plan view, the eight oblique light source portions 4b are arranged around the holding portion 2. Each of the oblique light source units 4b is adjacent to the oblique imaging unit 3b. The eight oblique light source units 4b are arranged at an angular interval of 45 ° in the circumferential direction. In each oblique light source unit 4b, a plurality of LEDs are arranged substantially perpendicular to the optical axis K2. In each oblique light source unit 4b, light can be applied to the object 9 on the holding unit 2 from diagonally above.

本体11を平面視した場合に、8個の側方光源部4cは保持部2の周囲に配置される。側方光源部4cはそれぞれ側方撮像部3cに隣接する。8個の側方光源部4cは、周方向に45°の角度間隔にて配列される。各側方光源部4cでは、複数のLEDが光軸K3にほぼ垂直に、かつ、水平方向に配列される。そのため、平面視では8個の側方光源部4cは略八角形をなす。各側方光源部4cでは、保持部2上の対象物9に対して横から光が照射可能である。上方光源部4a、斜方光源部4bおよび側方光源部4cでは、LED以外の種類の光源が用いられてよい。本実施の形態では光の色は白であるが、光の色や波長帯は様々に変更されてよい。光照射部4により、対象物9に様々な方向から拡散光を照射することができる。以下、特定の少なくとも1つの光源部から光が照射されて対象物9が偏った光で照明される各状態を「照明状態」と呼ぶ。光照射部4は、互いに異なる複数の偏った照明状態にて、対象物9に光を照射することができる。 When the main body 11 is viewed in a plan view, the eight side light source portions 4c are arranged around the holding portion 2. The side light source units 4c are adjacent to the side image pickup units 3c, respectively. The eight side light source units 4c are arranged at an angular interval of 45 ° in the circumferential direction. In each side light source unit 4c, a plurality of LEDs are arranged substantially perpendicular to the optical axis K3 and in the horizontal direction. Therefore, in a plan view, the eight side light source portions 4c form a substantially octagon. In each side light source unit 4c, light can be irradiated from the side to the object 9 on the holding unit 2. A type of light source other than the LED may be used in the upper light source unit 4a, the oblique light source unit 4b, and the side light source unit 4c. In the present embodiment, the color of light is white, but the color of light and the wavelength band may be changed in various ways. The light irradiation unit 4 can irradiate the object 9 with diffused light from various directions. Hereinafter, each state in which light is emitted from at least one specific light source unit and the object 9 is illuminated with biased light is referred to as an “illumination state”. The light irradiation unit 4 can irradiate the object 9 with light in a plurality of biased illumination states different from each other.

図3はコンピュータ12の構成を示す図である。コンピュータ12は各種演算処理を行うCPU121、基本プログラムを記憶するROM122および各種情報を記憶するRAM123を含む一般的なコンピュータシステムの構成となっている。コンピュータ12は、情報記憶を行う固定ディスク124、画像等の各種情報の表示を行うディスプレイ125、操作者からの入力を受け付けるキーボード126aおよびマウス126b(以下、「入力部126」と総称する。)、光ディスク、磁気ディスク、光磁気ディスク等のコンピュータ読み取り可能な記録媒体8から情報の読み取りを行う読取装置127、並びに、欠陥検出装置1の他の構成との間で信号を送受信する通信部128をさらに含む。 FIG. 3 is a diagram showing the configuration of the computer 12. The computer 12 has a general computer system configuration including a CPU 121 that performs various arithmetic processes, a ROM 122 that stores basic programs, and a RAM 123 that stores various information. The computer 12 includes a fixed disk 124 for storing information, a display 125 for displaying various information such as images, a keyboard 126a and a mouse 126b for receiving input from an operator (hereinafter collectively referred to as "input unit 126"). Further, a reading device 127 that reads information from a computer-readable recording medium 8 such as an optical disk, a magnetic disk, or a magneto-optical disk, and a communication unit 128 that transmits / receives a signal to / from another configuration of the defect detecting device 1. Including.

コンピュータ12では、事前に読取装置127を介して記録媒体8からプログラム80が読み出されて固定ディスク124に記憶されている。CPU121は、プログラム80に従ってRAM123や固定ディスク124を利用しつつ演算処理を実行する。CPU121は、コンピュータ12において演算部として機能する。CPU121以外に演算部として機能する他の構成が採用されてもよい。 In the computer 12, the program 80 is read in advance from the recording medium 8 via the reading device 127 and stored in the fixed disk 124. The CPU 121 executes arithmetic processing while using the RAM 123 and the fixed disk 124 according to the program 80. The CPU 121 functions as a calculation unit in the computer 12. In addition to the CPU 121, another configuration that functions as a calculation unit may be adopted.

図4は、コンピュータ12がプログラム80に従って演算処理を実行することにより実現される機能を示す図である。図4において、撮像制御部51と、欠陥取得部52と、記憶部53とが、コンピュータ12が実現する機能に相当する。これらの機能の全部または一部は専用の電気回路により実現されてもよい。また、複数のコンピュータによりこれらの機能が実現されてもよい。 FIG. 4 is a diagram showing a function realized by the computer 12 executing arithmetic processing according to the program 80. In FIG. 4, the image pickup control unit 51, the defect acquisition unit 52, and the storage unit 53 correspond to the functions realized by the computer 12. All or part of these functions may be realized by a dedicated electric circuit. Further, these functions may be realized by a plurality of computers.

撮像制御部51は、撮像部3と、光照射部4とを制御し、対象物9の画像(正確には、画像を示すデータ)を取得する。画像データは記憶部53に保存される。図4では、撮像部3を1つのブロックにて示しているが、実際には、上方撮像部3a、斜方撮像部3bおよび側方撮像部3cが撮像制御部51に接続される。 The image pickup control unit 51 controls the image pickup unit 3 and the light irradiation unit 4, and acquires an image of the object 9 (more accurately, data indicating the image). The image data is stored in the storage unit 53. In FIG. 4, the image pickup unit 3 is shown by one block, but in reality, the upper image pickup unit 3a, the oblique image pickup unit 3b, and the side image pickup unit 3c are connected to the image pickup control unit 51.

後述するように、撮像制御部51が光照射部4の各光源部を制御して照明状態を変化させる毎に、17台の撮像部3の少なくとも1つにて画像のデータが取得される。以下、撮像により取得される画像を「撮像画像」と呼び、そのデータを「撮像画像データ」と呼ぶ。撮像画像データ911は、記憶部53に保存される。記憶部53には、各照明状態での理想的な対象物9の画像のデータが、参照画像データ912として保存されている。すなわち、各撮像部3の各照明状態に対応する理想的な画像データが、参照画像データ912として記憶部53に準備されている。 As will be described later, each time the image pickup control unit 51 controls each light source unit of the light irradiation unit 4 to change the illumination state, image data is acquired by at least one of the 17 image pickup units 3. Hereinafter, the image acquired by imaging is referred to as "captured image", and the data is referred to as "captured image data". The captured image data 911 is stored in the storage unit 53. In the storage unit 53, the image data of the ideal object 9 under each illumination state is stored as the reference image data 912. That is, ideal image data corresponding to each lighting state of each imaging unit 3 is prepared in the storage unit 53 as reference image data 912.

光照射部4による光の照明状態とは、特定の照射方向から対象物9に光が照射される状態を指す。照射方向は厳密に定められるものではなく、およその光の照射方向を意味する。照射方向は、光がその方向からのみ照射される場合の平行光であることを限定するものでもない。光がある方向から照射されることは、その方向から偏って照射されることを意味する。また、1回の撮影における光の照射方向の数は1つには限定されない。例えば、互いに離れた複数の光源部から同時に光が照射されてもよい。 The light illumination state by the light irradiation unit 4 refers to a state in which the object 9 is irradiated with light from a specific irradiation direction. The irradiation direction is not strictly defined and means an approximate light irradiation direction. The irradiation direction is not limited to parallel light when the light is irradiated only from that direction. When light is emitted from a certain direction, it means that the light is emitted unevenly from that direction. Further, the number of light irradiation directions in one shooting is not limited to one. For example, light may be emitted from a plurality of light source units separated from each other at the same time.

欠陥取得部52は、第1欠陥取得部521と、第2欠陥取得部522とを含む。なお、「第1欠陥」は、本実施形態においては画像中に暗く現れる欠陥、すなわち「暗欠陥」を意味する。「第2欠陥」は、本実施形態においては画像中に明るく現れる欠陥、すなわち「明欠陥」を意味する。 The defect acquisition unit 52 includes a first defect acquisition unit 521 and a second defect acquisition unit 522. The "first defect" means a defect that appears dark in the image in the present embodiment, that is, a "dark defect". The "second defect" means a defect that appears brightly in an image in the present embodiment, that is, a "bright defect".

以下、第1欠陥取得部521の各種構成について、図5から図8を参照しつつ、説明する。 Hereinafter, various configurations of the first defect acquisition unit 521 will be described with reference to FIGS. 5 to 8.

図5は、第1欠陥取得部521の構成を示す図である。第1欠陥取得部521は、第1欠陥候補取得部541と、第3欠陥候補取得部551と、欠陥候補限定部581とを含む。入力される撮像画像データ911および参照画像データ912に基づいて、第1欠陥取得部521が処理を行うことで、第1欠陥領域を示す画像データである第1欠陥データ931が取得される。第1欠陥領域は、撮像画像において参照画像に対して暗い領域のうち、後述する各種処理によってノイズ(撮像画像において、本来は第1欠陥ではない領域であって、後述する第1欠陥候補領域として検出した領域)を除去した領域である。 FIG. 5 is a diagram showing the configuration of the first defect acquisition unit 521. The first defect acquisition unit 521 includes a first defect candidate acquisition unit 541, a third defect candidate acquisition unit 551, and a defect candidate limitation unit 581. Based on the input captured image data 911 and reference image data 912, the first defect acquisition unit 521 performs processing to acquire the first defect data 931 which is the image data indicating the first defect region. The first defect region is a region that is darker than the reference image in the captured image due to various processes described later (a region that is not originally a first defect in the captured image and is used as a first defect candidate region described later. This is the area from which the detected area) has been removed.

図6は、第1欠陥候補取得部541の構成を示す図である。第1欠陥候補取得部541は、2つのフィルタ処理部542と、プリアライメント部543と、膨張処理部544と、収縮処理部545と、比較部546と、2値化部547と、面積フィルタ部548とを含む。入力される撮像画像データ911および参照画像データ912に基づいて、第1欠陥候補取得部541が処理を行うことで、第1欠陥候補領域を示す画像データである第1欠陥候補データ921が取得される。第1欠陥候補領域は、撮像画像において参照画像に対して暗い領域である。 FIG. 6 is a diagram showing the configuration of the first defect candidate acquisition unit 541. The first defect candidate acquisition unit 541 includes two filter processing units 542, a prealignment unit 543, an expansion processing unit 544, a contraction processing unit 545, a comparison unit 546, a binarization unit 547, and an area filter unit. Includes 548 and. Based on the input captured image data 911 and reference image data 912, the first defect candidate acquisition unit 541 performs processing to acquire the first defect candidate data 921, which is image data indicating the first defect candidate region. To. The first defect candidate region is a region that is darker than the reference image in the captured image.

図7は、第3欠陥候補取得部551の構成を示す図である。第3欠陥候補取得部551は、2つのフィルタ処理部552と、プリアライメント部553と、ゆすらせ比較部554と、2値化部555と、面積フィルタ部556とを含む。入力される撮像画像データ911および参照画像データ912に基づいて、第3欠陥候補取得部551が処理を行うことで、第3欠陥候補領域を示す画像データである第3欠陥候補データ923が取得される。第3欠陥候補領域は、撮像画像において参照画像に対して暗い領域である。後述するように、第3欠陥候補領域を取得する手法は、第1欠陥候補領域を取得する手法とは異なる。 FIG. 7 is a diagram showing the configuration of the third defect candidate acquisition unit 551. The third defect candidate acquisition unit 551 includes two filter processing units 552, a prealignment unit 553, a shaking comparison unit 554, a binarization unit 555, and an area filter unit 556. Based on the input captured image data 911 and reference image data 912, the third defect candidate acquisition unit 551 performs processing to acquire the third defect candidate data 923, which is image data indicating the third defect candidate region. To. The third defect candidate region is a region that is darker than the reference image in the captured image. As will be described later, the method of acquiring the third defect candidate region is different from the method of acquiring the first defect candidate region.

図8は、欠陥候補限定部581の構成を示す図である。欠陥候補限定部581は、2個以上の論理積演算部582,583と、領域選択部584とを含む。入力される第1欠陥候補データ921および第3欠陥候補データ923に基づいて、欠陥候補限定部581が処理を行うことで、第1欠陥データ931が取得される。 FIG. 8 is a diagram showing the configuration of the defect candidate limiting unit 581. The defect candidate limiting unit 581 includes two or more logical product calculation units 582 and 583 and an area selection unit 584. The first defect data 931 is acquired by the defect candidate limiting unit 581 performing processing based on the input first defect candidate data 921 and the third defect candidate data 923.

次に、第2欠陥取得部522の各種構成について、図9から図12を参照しつつ、説明する。 Next, various configurations of the second defect acquisition unit 522 will be described with reference to FIGS. 9 to 12.

図9は、第2欠陥取得部522の構成を示す図である。第2欠陥取得部522は、第2欠陥候補取得部561と、第4欠陥候補取得部571と、欠陥候補限定部591とを含む。入力される撮像画像データ911および参照画像データ912に基づいて、第2欠陥取得部522が処理を行うことで、第2欠陥領域を示す画像データである第2欠陥データ932が取得される。第2欠陥領域は、撮像画像において参照画像に対して明るい領域のうち、後述する各種処理によってノイズ(撮像画像において、本来は第2欠陥ではない領域であって、後述する第2欠陥候補領域として検出した領域)を除去した領域である。 FIG. 9 is a diagram showing the configuration of the second defect acquisition unit 522. The second defect acquisition unit 522 includes a second defect candidate acquisition unit 561, a fourth defect candidate acquisition unit 571, and a defect candidate limitation unit 591. Based on the input captured image data 911 and reference image data 912, the second defect acquisition unit 522 performs processing to acquire the second defect data 932, which is image data indicating the second defect region. The second defect region is a region that is bright with respect to the reference image in the captured image and is noise due to various processes described later (in the captured image, it is a region that is not originally a second defect and is used as a second defect candidate region described later. This is the area from which the detected area) has been removed.

図10は、第2欠陥候補取得部561の構成を示す図である。第2欠陥候補取得部561は、2つのフィルタ処理部562と、プリアライメント部563と、収縮処理部564と、膨張処理部565と、比較部566と、2値化部567と、面積フィルタ部568とを含む。入力される撮像画像データ911および参照画像データ912に基づいて、第2欠陥候補取得部561が処理を行うことで、第2欠陥候補領域を示す画像データである第2欠陥候補データ922が取得される。第2欠陥候補領域は、撮像画像において参照画像に対して明るい領域である。 FIG. 10 is a diagram showing the configuration of the second defect candidate acquisition unit 561. The second defect candidate acquisition unit 561 includes two filter processing units 562, a prealignment unit 563, a contraction processing unit 564, an expansion processing unit 565, a comparison unit 566, a binarization unit 567, and an area filter unit. Includes 568 and. The second defect candidate acquisition unit 561 performs processing based on the input captured image data 911 and reference image data 912 to acquire the second defect candidate data 922, which is image data indicating the second defect candidate region. To. The second defect candidate region is a region that is brighter than the reference image in the captured image.

図11は、第4欠陥候補取得部571の構成を示す図である。第4欠陥候補取得部571は、2つのフィルタ処理部572と、プリアライメント部573と、ゆすらせ比較部574と、2値化部575と、面積フィルタ部576とを含む。入力される撮像画像データ911および参照画像データ912に基づいて、第4欠陥候補取得部571が処理を行うことで、第4欠陥候補領域を示す画像データである第4欠陥候補データ924が取得される。第4欠陥候補領域は、撮像画像において参照画像に対して明るい領域である。後述するように、第4欠陥候補領域を取得する手法は、第2欠陥候補領域を取得する手法とは異なる。 FIG. 11 is a diagram showing the configuration of the fourth defect candidate acquisition unit 571. The fourth defect candidate acquisition unit 571 includes two filter processing units 572, a prealignment unit 573, a shaking comparison unit 574, a binarization unit 575, and an area filter unit 576. Based on the input captured image data 911 and reference image data 912, the fourth defect candidate acquisition unit 571 performs processing to acquire the fourth defect candidate data 924, which is image data indicating the fourth defect candidate region. To. The fourth defect candidate region is a region that is brighter than the reference image in the captured image. As will be described later, the method of acquiring the fourth defect candidate region is different from the method of acquiring the second defect candidate region.

図12は、欠陥候補限定部591の構成を示す図である。欠陥候補限定部591は、2個以上の論理積演算部592,593と、領域選択部594とを含む。入力される第2欠陥候補データ922および第4欠陥候補データ924に基づいて、欠陥候補限定部591が処理を行うことで、第2欠陥データ932が取得される。 FIG. 12 is a diagram showing the configuration of the defect candidate limiting unit 591. The defect candidate limiting unit 591 includes two or more logical product calculation units 592, 593 and an area selection unit 594. The second defect data 932 is acquired by the defect candidate limiting unit 591 performing processing based on the input second defect candidate data 922 and the fourth defect candidate data 924.

ここで、高速に処理を行う場合は、多数の第1欠陥候補取得部541および第3欠陥候補取得部551が第1欠陥取得部521に設けられ、また、多数の第2欠陥候補取得部561および第4欠陥候補取得部571が第2欠陥取得部522に設けられ、複数の撮像画像に対して処理が並行して行われる。 Here, in the case of high-speed processing, a large number of first defect candidate acquisition units 541 and a third defect candidate acquisition unit 551 are provided in the first defect acquisition unit 521, and a large number of second defect candidate acquisition units 561. A fourth defect candidate acquisition unit 571 is provided in the second defect acquisition unit 522, and processing is performed in parallel for a plurality of captured images.

<欠陥検出装置の動作>
図13は、欠陥検出装置1の動作の流れを示す図である。まず、保持部2上に検査対象となる対象物9が保持される。保持部2には、例えば、位置合わせ用の当接部が設けられており、対象物9の予め定められた部位と当接部とが接することにより、所定位置に対象物9が所定の向きにて配置される。保持部2は、位置決めピンを設けたステージであってもよい。
<Operation of defect detection device>
FIG. 13 is a diagram showing an operation flow of the defect detection device 1. First, the object 9 to be inspected is held on the holding unit 2. The holding portion 2 is provided with, for example, a contact portion for alignment, and when the contact portion comes into contact with a predetermined portion of the object 9, the object 9 is oriented at a predetermined position. It is placed at. The holding portion 2 may be a stage provided with a positioning pin.

次に、撮像制御部51が、点灯する光源部を変更することにより照明状態を変更しながら、選択された撮像部3にて撮像が行われる(ステップS11〜S13)。すなわち、撮像制御部51が光照射部4に対し点灯命令を出し、選択された光照射部4が点灯する光照射工程(ステップS11)と、光照射部4の点灯中に、撮像制御部51により選択された撮像部3にて対象物9の撮像を行い、撮像画像を取得する撮像工程(ステップS12)と、撮像工程後に、撮像制御部51が、次の撮像を行うか否かを判断する撮像継続判断工程(ステップS13)とを実行する。 Next, the image pickup control unit 51 performs imaging by the selected image pickup unit 3 while changing the illumination state by changing the light source unit to be lit (steps S11 to S13). That is, during the light irradiation step (step S11) in which the image pickup control unit 51 issues a lighting command to the light irradiation unit 4 and the selected light irradiation unit 4 lights up, and during the lighting of the light irradiation unit 4, the image pickup control unit 51 An imaging step (step S12) of capturing an image of an object 9 by the imaging unit 3 selected by the above and acquiring an captured image, and after the imaging step, the imaging control unit 51 determines whether or not to perform the next imaging. The imaging continuation determination step (step S13) is executed.

具体的には、1つの側方撮像部3cが選択され、当該側方撮像部3cを中央として水平方向に連続する5個の側方光源部4cの1つが順に選択されて点灯し、点灯毎に側方撮像部3cが画像を取得する。上記動作が側方撮像部3cを変更しつつ繰り返される。実際には、各照明状態で複数の側方撮像部3cにて撮像を行うことにより、動作時間の短縮が図られる。さらに、全ての側方光源部4cを点灯して全ての側方撮像部3cにて撮像が行われる。これにより、各側方撮像部3cにて6枚の画像が取得される。 Specifically, one side imaging unit 3c is selected, and one of five horizontal light source units 4c that are continuous in the horizontal direction with the side imaging unit 3c as the center is selected and lit in order, and each lighting is performed. The side imaging unit 3c acquires an image. The above operation is repeated while changing the side imaging unit 3c. Actually, the operation time can be shortened by performing imaging with a plurality of side imaging units 3c in each illumination state. Further, all the side light source units 4c are turned on, and all the side image pickup units 3c perform imaging. As a result, six images are acquired by each side imaging unit 3c.

斜方撮像部3bの場合は、1つの斜方撮像部3bが選択され、8個の斜方光源部4bの1つが順に選択されて点灯し、点灯毎に斜方撮像部3bが画像を取得する。上記動作が斜方撮像部3bを変更しつつ繰り返される。実際には、各照明状態で全ての斜方撮像部3bにて撮像を行うことにより、動作時間の短縮が図られる。さらに、全ての斜方光源部4bを点灯して全ての斜方撮像部3bにて撮像が行われる。上方光源部4aのみが点灯した状態でも全ての斜方撮像部3bにて撮像が行われる。これにより、各斜方撮像部3bにて10枚の画像が取得される。 In the case of the oblique imaging unit 3b, one oblique imaging unit 3b is selected, one of the eight oblique light source units 4b is selected and lit in order, and the oblique imaging unit 3b acquires an image each time it is lit. To do. The above operation is repeated while changing the oblique imaging unit 3b. Actually, the operation time can be shortened by performing imaging with all the oblique imaging units 3b in each illumination state. Further, all the oblique light source units 4b are turned on, and all the oblique imaging units 3b perform imaging. Even when only the upper light source unit 4a is lit, all the oblique imaging units 3b perform imaging. As a result, 10 images are acquired by each oblique imaging unit 3b.

上方撮像部3aの場合は、斜方撮像部3bと同様に照明状態が変更されて10枚の画像が取得される。実際の動作では、斜方撮像部3bの撮像時に上方撮像部3aにて撮像を行うことにより、動作時間の短縮が図られる。 In the case of the upper imaging unit 3a, the illumination state is changed and 10 images are acquired in the same manner as in the oblique imaging unit 3b. In the actual operation, the operation time can be shortened by performing the image pickup by the upper image pickup unit 3a at the time of the image pickup of the oblique image pickup unit 3b.

撮像された画像のデータは、撮像画像データ911として記憶部53に記憶される。記憶部53には、既述のように、各撮像画像に対応する参照画像のデータが参照画像データ912として準備されている。参照画像は、撮像画像と同様の照明状態下での欠陥検査の基準として抽出された対象物9(いわゆる、良品)を示す。参照画像データ912は、欠陥の存在しない対象物9を撮像することにより取得されてもよく、多数の対象物9の画像の平均画像のデータとして取得されてもよい。 The image data of the captured image is stored in the storage unit 53 as the captured image data 911. As described above, the storage unit 53 prepares the data of the reference image corresponding to each captured image as the reference image data 912. The reference image shows an object 9 (so-called non-defective product) extracted as a reference for defect inspection under the same lighting conditions as the captured image. The reference image data 912 may be acquired by imaging an object 9 having no defects, or may be acquired as data of an average image of images of a large number of objects 9.

撮像制御部51が予定する全ての撮像工程が終了すると、次に、欠陥取得部52が、第1欠陥取得工程(ステップS14)および第2欠陥取得工程(ステップS15)を実行する。第1欠陥取得工程S14は、撮像画像に含まれる第1欠陥を取得する工程である。第2欠陥取得工程S15は、撮像画像に含まれる第2欠陥を取得する工程である。第1欠陥取得工程S14および第2欠陥取得工程S15は、本実施形態においては、欠陥取得部52において並行して実行されるが、本発明の実施に関してはこれに限られず、第1欠陥取得工程S14が第2欠陥取得工程S15よりも先に実行されても良いし、その逆順であっても良い。 When all the imaging steps scheduled by the imaging control unit 51 are completed, the defect acquisition unit 52 then executes the first defect acquisition step (step S14) and the second defect acquisition step (step S15). The first defect acquisition step S14 is a step of acquiring the first defect included in the captured image. The second defect acquisition step S15 is a step of acquiring the second defect included in the captured image. In the present embodiment, the first defect acquisition step S14 and the second defect acquisition step S15 are executed in parallel by the defect acquisition unit 52, but the implementation of the present invention is not limited to this, and the first defect acquisition step S14 may be executed before the second defect acquisition step S15, or may be in the reverse order.

以下、表現を簡素化するために、画像データに対する処理を、単に画像に対する処理として表現する場合がある。また、1つの撮像部3に注目した処理のみを説明する。他の撮像部3に対しても同様の処理が行われる。欠陥検出装置1では、第1欠陥(暗欠陥)の存在と第2欠陥(明欠陥)の存在とを検出することができるが、以下の説明では、第1欠陥に注目して説明し、第2欠陥の検出処理において第1欠陥の検出処理と共通する点については説明を適宜省略する。 Hereinafter, in order to simplify the expression, the processing for the image data may be expressed simply as the processing for the image. Further, only the processing focusing on one imaging unit 3 will be described. The same processing is performed on the other imaging unit 3. The defect detection device 1 can detect the presence of the first defect (dark defect) and the presence of the second defect (bright defect). However, in the following description, the first defect will be focused on and the first defect will be described. 2. The points common to the first defect detection process in the defect detection process will be omitted as appropriate.

図14は、第1欠陥取得工程S14の詳細を示す図である。第1欠陥取得工程S14は、第1欠陥候補取得工程S141と、第3欠陥候補取得工程S142と、欠陥候補限定工程S143とを含む。 FIG. 14 is a diagram showing details of the first defect acquisition step S14. The first defect acquisition step S14 includes a first defect candidate acquisition step S141, a third defect candidate acquisition step S142, and a defect candidate limiting step S143.

図15は、第2欠陥取得工程S15の詳細を示す図である。第2欠陥取得工程S15は、第2欠陥候補取得工程S151と、第4欠陥候補取得工程S152と、欠陥候補限定工程S153とを含む。 FIG. 15 is a diagram showing details of the second defect acquisition step S15. The second defect acquisition step S15 includes a second defect candidate acquisition step S151, a fourth defect candidate acquisition step S152, and a defect candidate limiting step S153.

図16は、第1欠陥候補取得工程S141の詳細を示す図である。第1欠陥候補取得工程S141は、第1欠陥候補領域を検出する第1欠陥候補領域検出工程S1411と、第1マスク領域を検出する第1マスク領域検出工程S1412と、第1欠陥候補領域のうち、第1マスク領域と所定条件以上重なるものを第1欠陥候補から除外する欠陥候補除外工程S1413と、後処理工程S1414とを含む。 FIG. 16 is a diagram showing details of the first defect candidate acquisition step S141. The first defect candidate acquisition step S141 includes the first defect candidate region detection step S1411 for detecting the first defect candidate region, the first mask region detection step S1412 for detecting the first mask region, and the first defect candidate region. , The defect candidate exclusion step S1413 for excluding those overlapping the first mask region by a predetermined condition or more from the first defect candidates, and the post-processing step S1414 are included.

図17は、第2欠陥候補取得工程S151の詳細を示す図である。第2欠陥候補取得工程S151は、第2欠陥候補領域を検出する第2欠陥候補領域検出工程S1511と、第2マスク領域を検出する第2マスク領域検出工程S1512と、第2欠陥候補領域のうち、第2マスク領域と所定条件以上重なるものを第2欠陥候補から除外する欠陥候補除外工程S1513と、後処理工程S1514とを含む。 FIG. 17 is a diagram showing details of the second defect candidate acquisition step S151. The second defect candidate acquisition step S151 includes the second defect candidate region detection step S1511 for detecting the second defect candidate region, the second mask region detection step S1512 for detecting the second mask region, and the second defect candidate region. , The defect candidate exclusion step S1513 for excluding those overlapping the second mask region by a predetermined condition or more from the second defect candidate, and the post-processing step S1514 are included.

以下、図5から図20までを適宜参照しつつ、第1欠陥取得工程S14について説明する。 Hereinafter, the first defect acquisition step S14 will be described with reference to FIGS. 5 to 20 as appropriate.

第1欠陥取得工程S14が開始すると、まず、第1欠陥候補取得工程S141が実行される。第1欠陥候補取得工程S141では、まず、第1欠陥取得部521により1つの撮像画像が選択され、当該撮像画像に対応する参照画像が選択される。図6に示すように、第1欠陥候補取得部541では、撮像画像の撮像画像データ911がフィルタ処理部542に入力され(撮像画像データ入力工程S201)、参照画像の参照画像データ912がフィルタ処理部542に入力される(参照画像データ入力工程S211)。 When the first defect acquisition step S14 is started, first, the first defect candidate acquisition step S141 is executed. In the first defect candidate acquisition step S141, first, one captured image is selected by the first defect acquisition unit 521, and a reference image corresponding to the captured image is selected. As shown in FIG. 6, in the first defect candidate acquisition unit 541, the captured image data 911 of the captured image is input to the filter processing unit 542 (captured image data input step S201), and the reference image data 912 of the reference image is filtered. It is input to the unit 542 (reference image data input step S211).

図16を参照する。次に、フィルタ処理部542およびプリアライメント部543が、撮像画像および参照画像に対してフィルタ処理およびプリアライメント処理を行う前処理工程S202、S212を実行する。2つのフィルタ処理部542では、撮像画像および参照画像に対してメディアンフィルタやガウスフィルタ等のノイズを低減するフィルタ処理がそれぞれ行われる。フィルタ処理済みの撮像画像および参照画像は、プリアライメント部543に出力される。プリアライメント部543では、所定のパターンを利用したパターンマッチングにより、参照画像の撮像画像に対する相対的な位置および角度のずれ量が特定される。そして、両画像の間における位置および角度のずれ量だけ、参照画像を撮像画像に対して平行移動および回転することにより、参照画像のおよその位置および角度が撮像画像に合わせられる。これにより、両画像に対するプリアライメントが行われる。 See FIG. Next, the filter processing unit 542 and the prealignment unit 543 execute the preprocessing steps S202 and S212 for performing the filter processing and the prealignment processing on the captured image and the reference image. In the two filter processing units 542, filter processing for reducing noise such as a median filter and a Gaussian filter is performed on the captured image and the reference image, respectively. The filtered image and the reference image are output to the prealignment unit 543. In the pre-alignment unit 543, the amount of deviation of the position and angle of the reference image relative to the captured image is specified by pattern matching using a predetermined pattern. Then, by translating and rotating the reference image with respect to the captured image by the amount of displacement of the position and angle between the two images, the approximate position and angle of the reference image are adjusted to the captured image. As a result, pre-alignment is performed for both images.

図18を参照する。図18は、第1欠陥候補取得工程S141における処理の内容を示す画像例である。撮像画像データ入力工程S201により入力され、前処理工程S202が実行された撮像画像を撮像画像811として例示する。また、参照画像データ入力工程S211により入力され、前処理工程S212が実行された参照画像を参照画像812として例示する。対象物9の検査対象となる表面のうち、撮像画像811および参照画像812に表れる領域を「対象領域70」と称し、撮像画像811および参照画像812の中に矩形にて示す。撮像部3と対象領域70とは一対一に対応し、各撮像部3は常に同じ対象領域70の画像を取得する。 See FIG. FIG. 18 is an image example showing the content of the process in the first defect candidate acquisition step S141. The captured image input by the captured image data input step S201 and executed by the preprocessing step S202 is exemplified as the captured image 811. Further, a reference image input by the reference image data input step S211 and executed by the preprocessing step S212 is exemplified as the reference image 812. Of the surfaces of the object 9 to be inspected, the region appearing in the captured image 811 and the reference image 812 is referred to as a “target region 70”, and is indicated by a rectangle in the captured image 811 and the reference image 812. The imaging unit 3 and the target area 70 have a one-to-one correspondence, and each imaging unit 3 always acquires the same image of the target area 70.

撮像画像811の対象領域70には、周囲よりも暗く写る第1欠陥711および周囲よりも明るく写る第2欠陥721を確認することができる。これらは、例えば打痕や傷である。撮像画像811の対象領域70には、パターン部分712、722が含まれる。パターン部分712は、周囲よりも明るく写る凹部または凸部であり、パターン部分722は、周囲よりも暗く写る凹部または凸部である。これらパターン部分712、722は、対象物9に従来形成されている形状に由来するものであり、欠陥ではない。 In the target area 70 of the captured image 811, a first defect 711 that appears darker than the surroundings and a second defect 721 that appears brighter than the surroundings can be confirmed. These are, for example, dents and scratches. The target area 70 of the captured image 811 includes pattern portions 712 and 722. The pattern portion 712 is a concave or convex portion that appears brighter than the surroundings, and the pattern portion 722 is a concave or convex portion that appears darker than the surroundings. These pattern portions 712 and 722 are derived from the shape conventionally formed on the object 9, and are not defects.

参照画像812の対象領域70には、周囲よりも明るく写る第2欠陥721を確認することができる。通常、参照画像としては欠陥のない対象物9を抽出して取得することが理想であるが、参照画像用に抽出した対象物9にも欠陥が含まれているおそれがある。また、参照画像812の対象領域70には、撮像画像811と同じ位置に、パターン部分712、722が含まれる。 In the target area 70 of the reference image 812, a second defect 721 that appears brighter than the surroundings can be confirmed. Normally, it is ideal to extract and acquire a defect-free object 9 as a reference image, but there is a possibility that the object 9 extracted for the reference image also contains defects. Further, the target area 70 of the reference image 812 includes the pattern portions 712 and 722 at the same positions as the captured image 811.

なお、図18に示す撮像画像811および参照画像812は、説明のために第1欠陥、第2欠陥およびパターン部分等を誇張して表現したものであり、実際の欠陥等は、より小さい画素によって表されることもある。また、撮像画像811および参照画像812では、便宜上、欠陥およびパターン部分の別を記載しているが、実際の画像においては、暗く写る領域が第1欠陥とパターン部分のいずれであるか、あるいは明るく映る部分が第2欠陥とパターン部分のいずれであるかは、後述する処理を通じてはじめて判明するものであり、撮像画像811および参照画像812の段階では欠陥およびパターン部分の別は不明である。 The captured image 811 and the reference image 812 shown in FIG. 18 are exaggerated representations of the first defect, the second defect, the pattern portion, and the like for the sake of explanation, and the actual defects and the like are expressed by smaller pixels. It may also be represented. Further, in the captured image 811 and the reference image 812, the defect and the pattern portion are separately described for convenience, but in the actual image, the dark region is either the first defect or the pattern portion, or is bright. Whether the reflected portion is the second defect or the pattern portion is clarified for the first time through the process described later, and it is unknown at the stage of the captured image 811 and the reference image 812 whether the defect or the pattern portion is distinguished.

図16を参照する。次に、膨張処理部544が、プリアライメント済みの撮像画像および参照画像に対して膨張処理を行う膨張処理工程S203、S213を実行する。 See FIG. Next, the expansion processing unit 544 executes expansion processing steps S203 and S213 to perform expansion processing on the prealigned captured image and the reference image.

図6に示すように、第1欠陥候補取得部541では、プリアライメント部543から撮像画像データ911および参照画像データ912が膨張処理部544に入力され、撮像画像および参照画像に膨張処理が行われる。ここでの膨張処理は、多値画像における明るい領域を膨張させる処理である。膨張処理では、公知の最大値フィルタが用いられる。最大値フィルタは、注目画素を中心とするカーネルサイズ内の画素中で、画素値が最大のものを抽出し、他の画素の画素値を当該最大の画素値に変更するフィルタである。最大値フィルタを通すことで、画素値の高い(すなわち、明るい)1ピクセルの画素が、3ピクセル×3ピクセルに膨張される。 As shown in FIG. 6, in the first defect candidate acquisition unit 541, the captured image data 911 and the reference image data 912 are input from the prealignment unit 543 to the expansion processing unit 544, and the captured image and the reference image are expanded. .. The expansion process here is a process for expanding a bright region in a multi-valued image. In the expansion treatment, a known maximum value filter is used. The maximum value filter is a filter that extracts the pixel having the maximum pixel value from the pixels within the kernel size centered on the pixel of interest and changes the pixel value of another pixel to the maximum pixel value. By passing through the maximum value filter, a pixel having a high pixel value (that is, bright) of 1 pixel is expanded to 3 pixels × 3 pixels.

これにより、図18の膨張画像811aおよび膨張画像812aが生成される。膨張画像811aおよび膨張画像812aは、多値画像である。膨張画像811aおよび膨張画像812aでは、明るい領域である第2欠陥721aおよびパターン部分712aが膨張された状態で確認される一方、小さな暗い領域は消滅する。 As a result, the expanded image 811a and the expanded image 812a of FIG. 18 are generated. The expanded image 811a and the expanded image 812a are multi-valued images. In the expanded image 811a and the expanded image 812a, the bright region 721a and the pattern portion 712a are confirmed in the expanded state, while the small dark region disappears.

なお、本発明の実施に関しては、最大値フィルタのカーネルサイズは3ピクセル×3ピクセルに限られず、他の各種のサイズを採用してもよい。 Regarding the implementation of the present invention, the kernel size of the maximum value filter is not limited to 3 pixels × 3 pixels, and various other sizes may be adopted.

図16を参照する。次に、収縮処理部545が、膨張処理済みの撮像画像および参照画像に対して収縮処理を行う収縮処理工程S204、S214を実行する。 See FIG. Next, the contraction processing unit 545 executes the contraction processing steps S204 and S214 for performing the contraction processing on the captured image and the reference image that have been expanded.

図6に示すように、膨張処理済みの撮像画像および参照画像のデータは、収縮処理部545に入力され、撮像画像および参照画像に収縮処理が行われる。ここでの収縮処理は、多値画像における明るい領域を収縮させる処理である。収縮処理では、例えば膨張処理で用いた最大値フィルタと同サイズの最小値フィルタが用いられ、明るい領域がほぼ元の大きさに戻される。最小値フィルタは、注目画素を中心とするカーネルサイズ内の画素中で、画素値が最小のものを抽出し、他の画素の画素値を当該最小の画素値に変更するフィルタである。 As shown in FIG. 6, the data of the captured image and the reference image that have been expanded are input to the contraction processing unit 545, and the captured image and the reference image are subjected to the contraction processing. The shrinkage process here is a process of shrinking a bright region in a multi-valued image. In the shrinkage treatment, for example, a minimum value filter having the same size as the maximum value filter used in the expansion treatment is used, and the bright region is returned to almost the original size. The minimum value filter is a filter that extracts the pixel having the smallest pixel value from the pixels in the kernel size centered on the pixel of interest and changes the pixel value of the other pixel to the minimum pixel value.

これにより、図18に示す収縮画像811bおよび収縮画像812bが生成される。収縮画像811bおよび収縮画像812bは、多値画像である。収縮画像811bおよび収縮画像812bでは、明るい領域である第2欠陥721bおよびパターン部分712bがほぼ元の大きさに戻った状態で確認される。膨張処理および収縮処理によって、元の撮像画像および参照画像において大きな暗い領域はほぼ元の状態が維持され、小さな暗い領域は消滅する。なお、図18の画像例においては、暗い領域はすべて膨張処理により消滅する。 As a result, the contraction image 811b and the contraction image 812b shown in FIG. 18 are generated. The contraction image 811b and the contraction image 812b are multi-valued images. In the contracted image 811b and the contracted image 812b, the second defect 721b and the pattern portion 712b, which are bright regions, are confirmed in a state of being substantially returned to their original sizes. By the expansion treatment and the contraction treatment, the large dark region in the original captured image and the reference image is maintained in the original state, and the small dark region disappears. In the image example of FIG. 18, all the dark areas disappear by the expansion process.

図16を参照する。次に、比較部546が、収縮処理済みの撮像画像および参照画像に対して比較処理を行う比較処理工程S205、S215を実行する。 See FIG. Next, the comparison unit 546 executes comparison processing steps S205 and S215 that perform comparison processing on the image captured image and the reference image that have undergone shrinkage processing.

図6に示すように、収縮処理済みの撮像画像および参照画像のデータは、比較部546に入力され、比較部546は、まず撮像画像と、当該撮像画像を膨張・収縮処理した収縮画像との差および比の少なくとも一方に基づいて比較画像を生成し(比較処理工程S205)、これと並行して、参照画像と、当該参照画像を膨張・収縮処理した収縮画像との差および比の少なくとも一方に基づいて比較画像を生成する(比較処理工程S215)。 As shown in FIG. 6, the data of the captured image and the reference image that have been contracted are input to the comparison unit 546, and the comparison unit 546 first combines the captured image and the contracted image obtained by expanding / contracting the captured image. A comparative image is generated based on at least one of the difference and the ratio (comparison processing step S205), and in parallel with this, at least one of the difference and the ratio between the reference image and the contracted image obtained by expanding / contracting the reference image. A comparison image is generated based on (comparison processing step S215).

比較処理工程S205は、撮像画像と、当該撮像画像を膨張・収縮処理した収縮画像との差および比の少なくとも一方に基づいて比較画像を生成する。本願の欠陥検査装置1において、差に基づくか、比に基づくかは、プログラム80により予め定められたパラメータ、またはユーザが入力部126を用いて指示したパラメータに基づいて決定される。また、本願の欠陥検査装置1において用いられる各種の所定値、基準値および閾値は、プログラム80により予め定められたパラメータ、またはユーザが入力部126を用いて指示したパラメータに基づいて決定される。以下、差に基づく比較画像の生成と、比に基づく比較画像の生成について、説明する。 The comparison processing step S205 generates a comparative image based on at least one of the difference and the ratio between the captured image and the contracted image obtained by expanding / contracting the captured image. In the defect inspection apparatus 1 of the present application, whether it is based on the difference or the ratio is determined based on the parameters predetermined by the program 80 or the parameters instructed by the user using the input unit 126. Further, various predetermined values, reference values and threshold values used in the defect inspection device 1 of the present application are determined based on parameters predetermined by the program 80 or parameters instructed by the user using the input unit 126. The generation of the comparison image based on the difference and the generation of the comparison image based on the ratio will be described below.

比較処理工程S205の具体例の一つとして、差(例えば、減算処理)によって比較画像を取得する。具体的には、撮像画像の各画素の値から、当該撮像画像を膨張・収縮処理した収縮画像の当該撮像画像と重なる領域における画素の値を減算することで、両画像の差分を示す差画像が取得される。そして、当該差画像のうち、画素の絶対値が所定の閾値よりも大きい領域を、第1欠陥候補領域として抽出した比較画像を取得する。 As one of the specific examples of the comparison processing step S205, a comparison image is acquired by the difference (for example, subtraction processing). Specifically, a difference image showing the difference between the two images by subtracting the pixel value in the region overlapping the captured image of the contracted image obtained by expanding / contracting the captured image from the value of each pixel of the captured image. Is obtained. Then, a comparative image obtained by extracting a region in which the absolute value of the pixel is larger than a predetermined threshold value as the first defect candidate region in the difference image is acquired.

本実施形態では、差画像のうち画素の絶対値が所定の閾値以下となる画素の値を「0」とし、画素値が0よりも大きい領域を第1欠陥候補領域として抽出する。なお、本願発明における第1欠陥候補領域の抽出手法としてはこれに限られず、所定の閾値によって差画像に対し2値化処理を実行することで第1欠陥候補領域を抽出してもよい。 In the present embodiment, the value of the pixel whose absolute value of the pixel is equal to or less than a predetermined threshold value in the difference image is set to "0", and the region where the pixel value is larger than 0 is extracted as the first defect candidate region. The method for extracting the first defect candidate region in the present invention is not limited to this, and the first defect candidate region may be extracted by executing a binarization process on the difference image according to a predetermined threshold value.

一般的に表現すれば、比較処理工程S205では、撮像画像において、当該撮像画像を膨張・収縮処理した収縮画像よりも明度が低く、かつ、明度の差の絶対値が第1基準値以上である領域が第1欠陥候補領域として比較画像に表現される。第1基準値は正の値である。さらに換言すれば、撮像画像において当該撮像画像を膨張・収縮処理した収縮画像よりも明度が所定値よりも低い領域が第1欠陥候補領域として比較画像に表現される。画像がモノクロである場合は、画素値を明度と捉えてもよく、カラー画像の場合は、色成分毎の画素値に対して所定の演算を行うことにより求められる値が明度として扱われる。 Generally speaking, in the comparative processing step S205, the brightness of the captured image is lower than that of the contracted image obtained by expanding / contracting the captured image, and the absolute value of the difference in brightness is equal to or higher than the first reference value. The region is represented in the comparison image as the first defect candidate region. The first reference value is a positive value. In other words, in the captured image, a region having a brightness lower than a predetermined value as compared with the contracted image obtained by expanding / contracting the captured image is represented in the comparative image as a first defect candidate region. When the image is monochrome, the pixel value may be regarded as the brightness, and in the case of a color image, the value obtained by performing a predetermined calculation on the pixel value for each color component is treated as the brightness.

また、比較処理工程S205の他の具体例として、第1欠陥候補領域は、撮像画像の各画素の値と当該撮像画像を膨張・収縮処理した収縮画像の対応する画素の値との比から求められてもよい。具体的には、撮像画像を膨張・収縮処理した収縮画像の各画素の値を当該撮像画像の対応する画素の値で除算することにより、比画像の画素の値が求められる。予め1よりも大きい第1基準値が準備されており、比画像において第1基準値以上の値を有する画素により構成される領域が第1欠陥候補領域として抽出され、当該第1欠陥候補領域を含む比較画像が取得される。 Further, as another specific example of the comparison processing step S205, the first defect candidate region is obtained from the ratio of the value of each pixel of the captured image and the value of the corresponding pixel of the contracted image obtained by expanding / contracting the captured image. May be done. Specifically, the pixel value of the ratio image is obtained by dividing the value of each pixel of the contracted image obtained by expanding / contracting the captured image by the value of the corresponding pixel of the captured image. A first reference value larger than 1 is prepared in advance, and a region composed of pixels having a value equal to or higher than the first reference value in the ratio image is extracted as a first defect candidate region, and the first defect candidate region is extracted. A comparative image including is acquired.

もちろん、撮像画像の各画素の値を当該撮像画像を膨張・収縮処理した収縮画像の対応する画素の値で除算することにより、比画像の画素の値が求められてもよい。この場合、比画像において1よりも小さい第1基準値以下の値を有する画素により構成される領域が第1欠陥候補領域として抽出され、当該第1欠陥候補領域を含む比較画像が取得される。 Of course, the pixel value of the ratio image may be obtained by dividing the value of each pixel of the captured image by the value of the corresponding pixel of the contracted image obtained by expanding / contracting the captured image. In this case, in the ratio image, a region composed of pixels having a value equal to or less than the first reference value smaller than 1 is extracted as the first defect candidate region, and a comparative image including the first defect candidate region is acquired.

第1基準値は定数でなくてもよい。第1基準値は撮像画像の明度または画素値の関数でもよい。第1基準値は、撮像画像の明度または画素値の差および比を用いて定められてもよく、さらに他の演算が利用されてもよい。第1基準値が様々に定められてよい点は、後述の第2、第3および第4基準値についても同様である。第1ないし第4基準値は同じ値である必要はなく、算出方法も異なってもよい。一般的に表現すれば、撮像画像において、明度が、参照画像の明度よりも低く、かつ、予め定められた条件を満たす値よりも低い領域が第1欠陥候補領域として取得される。「予め定められた条件」は、各撮像画像に対して個別に設定されてもよい。さらに、複数の「予め定められた条件」が、1つの撮像画像に用いられてもよい。例えば、撮像画像中のエッジのように、撮像毎に画素値が変化しやすい位置では、欠陥候補の領域として検出されにくいように第1基準値が設定されてよい。上記説明は、以下の第2欠陥候補領域、第3欠陥候補領域、第4欠陥候補領域の抽出に関しても同様である。 The first reference value does not have to be a constant. The first reference value may be a function of the brightness or pixel value of the captured image. The first reference value may be determined by using the difference and ratio of the brightness or pixel value of the captured image, and other calculations may be used. The point that the first reference value may be set in various ways is the same for the second, third, and fourth reference values described later. The first to fourth reference values do not have to be the same value, and the calculation method may be different. Generally speaking, in the captured image, a region whose brightness is lower than the brightness of the reference image and lower than a value satisfying a predetermined condition is acquired as the first defect candidate region. The "predetermined conditions" may be set individually for each captured image. Further, a plurality of "predetermined conditions" may be used for one captured image. For example, at a position where the pixel value is likely to change with each imaging, such as an edge in a captured image, a first reference value may be set so that it is difficult to detect as a defect candidate region. The above description is the same for the extraction of the second defect candidate region, the third defect candidate region, and the fourth defect candidate region below.

比較処理工程S215は、参照画像と、当該参照画像を膨張・収縮処理した収縮画像との差および比の少なくとも一方に基づいて比較画像を生成する。差画像または比画像の取得については、撮像画像についての比較処理工程S205と同様の処理を行う。比較処理工程S215では、比較処理工程S205と同様の処理により、第1欠陥候補領域に代えて、参照画像から第1マスク領域を抽出する。 The comparison processing step S215 generates a comparative image based on at least one of the difference and the ratio between the reference image and the contracted image obtained by expanding / contracting the reference image. Regarding the acquisition of the difference image or the ratio image, the same processing as in the comparison processing step S205 for the captured image is performed. In the comparison processing step S215, the first mask region is extracted from the reference image in place of the first defect candidate region by the same processing as in the comparison processing step S205.

比較処理工程S215の具体例の一つとして、差(例えば、減算処理)によって比較画像を取得する。具体的には、参照画像の各画素の値から、当該参照画像を膨張・収縮処理した収縮画像の当該参照画像と重なる領域における画素の値を減算することで、両画像の差分を示す差画像が取得される。そして、当該差画像のうち、画素の絶対値が所定の閾値よりも大きい領域を、第1マスク領域として抽出した比較画像を取得する。 As one of the specific examples of the comparison processing step S215, a comparison image is acquired by the difference (for example, subtraction processing). Specifically, a difference image showing the difference between the two images by subtracting the pixel value in the region overlapping the reference image of the contracted image obtained by expanding / contracting the reference image from the value of each pixel of the reference image. Is obtained. Then, a comparison image obtained by extracting a region in which the absolute value of the pixels is larger than a predetermined threshold value as the first mask region in the difference image is acquired.

また、比較処理工程S215の他の具体例として、第1マスク領域は、参照画像の各画素の値と当該参照画像を膨張・収縮処理した収縮画像の対応する画素の値との比から求められてもよい。具体的には、参照画像を膨張・収縮処理した収縮画像の各画素の値を当該参照画像の対応する画素の値で除算することにより、比画像の画素の値が求められる。予め1よりも大きい第1基準値が準備されており、比画像において第1基準値以上の値を有する画素により構成される領域が第1マスク領域として抽出され、当該第1マスク領域を含む比較画像が取得される。 Further, as another specific example of the comparison processing step S215, the first mask region is obtained from the ratio of the value of each pixel of the reference image to the value of the corresponding pixel of the contracted image obtained by expanding / contracting the reference image. You may. Specifically, the pixel value of the ratio image is obtained by dividing the value of each pixel of the contracted image obtained by expanding / contracting the reference image by the value of the corresponding pixel of the reference image. A first reference value larger than 1 is prepared in advance, and a region composed of pixels having a value equal to or higher than the first reference value in the ratio image is extracted as the first mask region, and a comparison including the first mask region is performed. The image is acquired.

このとき、比較処理工程S205における所定の閾値および第1基準値と、比較処理工程S215における所定の閾値および第1基準値とは、同一であっても良いし、異なっていても良い。同一である場合には、処理を共通させることができ、処理メモリの削減や処理時間の削減に資する。 At this time, the predetermined threshold value and the first reference value in the comparison processing step S205 and the predetermined threshold value and the first reference value in the comparison processing step S215 may be the same or different. If they are the same, the processing can be shared, which contributes to the reduction of processing memory and the reduction of processing time.

以上の処理により、図18に示す比較画像811cおよび比較画像812cが取得される。比較画像811cでは、撮像画像811よりも暗い領域として第1欠陥候補領域711c、722cが抽出されている。なお、711cは第1欠陥(真の欠陥)に対応し、722cはパターン部分(偽の欠陥)に対応する。また、比較画像812cでは、参照画像812よりも暗い領域として第1マスク領域722cが抽出されている。なお、722cはパターン部分(偽の欠陥)に対応する。 By the above processing, the comparative image 811c and the comparative image 812c shown in FIG. 18 are acquired. In the comparative image 811c, the first defect candidate regions 711c and 722c are extracted as regions darker than the captured image 811. In addition, 711c corresponds to the first defect (true defect), and 722c corresponds to the pattern portion (false defect). Further, in the comparative image 812c, the first mask region 722c is extracted as a region darker than the reference image 812. Note that 722c corresponds to a pattern portion (false defect).

以上に説明した、撮像画像データ入力工程S201と、前処理工程S202と、膨張処理工程S203と、収縮処理工程S204と、比較処理工程S205とが、本実施形態における第1欠陥候補領域検出工程S1411を構成する。なお、前処理工程S202は、撮像画像の状態や検査条件によっては省略することができる。 The captured image data input step S201, the pretreatment step S202, the expansion processing step S203, the shrinkage processing step S204, and the comparison processing step S205 described above are the first defect candidate region detection step S1411 in the present embodiment. To configure. The preprocessing step S202 can be omitted depending on the state of the captured image and the inspection conditions.

また、以上に説明した、参照画像データ入力工程S211と、前処理工程S212と、膨張処理工程S213と、収縮処理工程S214と、比較処理工程S215とが、本実施形態における第1マスク領域検出工程S1412を構成する。なお、前処理工程S212は、参照画像の状態や検査条件によっては省略することができる。 Further, the reference image data input step S211, the pretreatment step S212, the expansion treatment step S213, the contraction treatment step S214, and the comparison processing step S215 described above are the first mask region detection steps in the present embodiment. It constitutes S1412. The pretreatment step S212 may be omitted depending on the state of the reference image and the inspection conditions.

図16を参照する。次に、比較部546が、撮像画像に基づく比較画像に対して欠陥候補除外処理を行う欠陥候補除外工程S1413を実行する。 See FIG. Next, the comparison unit 546 executes the defect candidate exclusion step S1413 that performs the defect candidate exclusion process on the comparison image based on the captured image.

欠陥候補除外工程S1413が開始されると、まず比較部546が、第1マスク領域を太らせる太らせ処理を実行する。具体的には、比較画像812cに対して、膨張処理工程S213と同様に最大値フィルタを用いて膨張処理を、太らせ処理として施す。 When the defect candidate exclusion step S1413 is started, the comparison unit 546 first executes a thickening process for thickening the first mask region. Specifically, the comparative image 812c is subjected to an expansion process as a thickening process by using a maximum value filter in the same manner as in the expansion process step S213.

なお、本発明の実施に関しては、最大値フィルタを用いた太らせ処理に限られず、各種の太らせ処理を採用することができる。 The implementation of the present invention is not limited to the thickening treatment using the maximum value filter, and various thickening treatments can be adopted.

ここで、参照画像に写る対象物と、撮像画像に写る対象物との間には、公差が存在する場合がある。また、参照画像を撮像する際の対象物の姿勢と、撮像画像を撮像する際の対象物の姿勢との間には、位置ずれが存在する場合がある。したがって、後述するようにそのまま第1マスク領域と第1欠陥候補領域とが重なる領域を除外するのみでは、第1欠陥候補領域のうち欠陥ではない領域(すなわち、パターン部分)が第1マスク領域と良好に重ならず、位置ずれした部分については欠陥ではない領域がそのまま第1欠陥候補領域として残留することになる。そこで、第1マスク領域に対し太らせ処理を行い、位置ずれに起因する第1欠陥候補領域と第1マスク領域との非重複部分を低減する。これにより、より過検出を抑制することができる。 Here, there may be a tolerance between the object reflected in the reference image and the object reflected in the captured image. In addition, there may be a misalignment between the posture of the object when capturing the reference image and the posture of the object when capturing the captured image. Therefore, as will be described later, if the region where the first mask region and the first defect candidate region overlap is simply excluded, the non-defect region (that is, the pattern portion) of the first defect candidate region becomes the first mask region. For the portion that does not overlap well and is misaligned, the region that is not a defect remains as it is as the first defect candidate region. Therefore, the first mask region is thickened to reduce the non-overlapping portion between the first defect candidate region and the first mask region due to the misalignment. As a result, over-detection can be further suppressed.

続いて、欠陥候補除外工程S1413では、撮像画像の比較画像における第1欠陥候補領域の一部領域を、第1マスク領域に基づいて、第1欠陥候補から除外した第1欠陥候補画像を生成する欠陥候補除外処理を実行する。より具体的には、比較部546において生成された撮像画像に基づく比較画像の第1欠陥候補領域のうち、参照画像に基づく比較画像の第1マスク領域と所定条件以上重なるものを、第1欠陥候補から除外した第1欠陥候補画像を生成する。 Subsequently, in the defect candidate exclusion step S1413, a first defect candidate image is generated in which a part of the first defect candidate region in the comparison image of the captured image is excluded from the first defect candidate based on the first mask region. Execute defect candidate exclusion processing. More specifically, among the first defect candidate regions of the comparison image based on the captured image generated by the comparison unit 546, those that overlap the first mask region of the comparison image based on the reference image by a predetermined condition or more are the first defects. A first defect candidate image excluded from the candidates is generated.

ここで、第1欠陥候補領域と第1マスク領域との重なりの評価方法としては、撮像画像の比較画像における各画素と、参照画像の比較画像における各画素との差または和をとり、所定の閾値と比較して第1欠陥候補領域を抽出する方法が使用される。差および和のいずれの抽出方法を使用するかは、プログラム80により予め定められたパラメータ、またはユーザが入力部126を用いて指示したパラメータに基づいて決定される。 Here, as a method of evaluating the overlap between the first defect candidate region and the first mask region, a predetermined difference or sum is taken between each pixel in the comparison image of the captured image and each pixel in the comparison image of the reference image. A method of extracting the first defect candidate region in comparison with the threshold value is used. Which of the difference and sum extraction methods is used is determined based on the parameters predetermined by the program 80 or the parameters instructed by the user using the input unit 126.

差に基づいて第1欠陥候補画像を取得する場合、具体的には、撮像画像の比較画像における各画素の値から、参照画像の比較画像の対応する位置の画素の値を減算することで、両画像の差分を示す差画像を取得する。そして、当該差画像のうち、画素の値が所定の閾値よりも大きい領域を、第1欠陥候補として残し、他の領域を「0」とした状態で、第1欠陥候補画像を取得する。 When the first defect candidate image is acquired based on the difference, specifically, the value of the pixel at the corresponding position of the comparison image of the reference image is subtracted from the value of each pixel in the comparison image of the captured image. Acquire a difference image showing the difference between the two images. Then, among the difference images, the region where the pixel value is larger than the predetermined threshold value is left as the first defect candidate, and the first defect candidate image is acquired with the other regions set to "0".

和に基づいて第1欠陥候補画像を取得する場合、具体的には、撮像画像の比較画像における各画素の値と、参照画像の比較画像の対応する位置の画素の値を加算することで、両画像の和を示す和画像を取得する。そして、当該和画像のうち、画素の値が所定の閾値よりも大きい領域を画素値「0」とすることで、第1マスク領域と第1欠陥候補領域とが重複する領域として除外し、第1マスク領域と重複しない第1欠陥候補領域を残した状態で、第1欠陥候補画像を取得する。 When acquiring the first defect candidate image based on the sum, specifically, by adding the value of each pixel in the comparison image of the captured image and the value of the pixel at the corresponding position in the comparison image of the reference image, Acquire a sum image showing the sum of both images. Then, in the sum image, a region in which the pixel value is larger than a predetermined threshold value is set to the pixel value "0", so that the first mask region and the first defect candidate region are excluded as overlapping regions, and the first The first defect candidate image is acquired while leaving the first defect candidate area that does not overlap with the 1 mask area.

なお、本発明の実施に関してはこれに限られず、撮像画像の比較画像と、参照画像の比較画像について、それぞれ所定の閾値以上の画素値を有する画素を「1」とし、当該閾値より低い画素値を有する画素を「0」とする2値化処理を施した後に、参照画像の比較画像について画素値「1」と「0」を反転する処理を施し、撮像画像の比較画像の各画素の画素値と、参照画像の比較画像の反転画像における対応する各画素の画素値との論理積を取って、画素値が「1」となる領域を第1欠陥候補領域とする第1欠陥候補画像を取得してもよい。この場合、後述する後処理工程S1414のうち、2値化部547による2値化処理を省略できる。 The implementation of the present invention is not limited to this, and for the comparison image of the captured image and the comparison image of the reference image, the pixel having a pixel value equal to or higher than a predetermined threshold value is set to "1", and the pixel value lower than the threshold value is set to "1". After performing a binarization process in which the pixel having the above is set to "0", the comparison image of the reference image is subjected to a process of inverting the pixel values "1" and "0", and the pixels of each pixel of the comparison image of the captured image. The first defect candidate image in which the region where the pixel value is "1" is set as the first defect candidate region by taking the logical product of the value and the pixel value of each corresponding pixel in the inverted image of the comparison image of the reference image is obtained. You may get it. In this case, in the post-processing step S1414 described later, the binarization process by the binarization unit 547 can be omitted.

また、本実施形態では、欠陥候補除外工程S1413において太らせ処理を行ったが、本発明の実施に関してはこれに限られず、太らせ処理を省略し、欠陥候補除外工程S1413では欠陥候補除外処理のみを実行してもよい。 Further, in the present embodiment, the fattening process is performed in the defect candidate exclusion step S1413, but the embodiment of the present invention is not limited to this, the fattening process is omitted, and only the defect candidate exclusion process is performed in the defect candidate exclusion step S1413. May be executed.

図16を参照する。次に、2値化部547および面積フィルタ部548が、第1欠陥候補画像に対して後処理を行う後処理工程S1414を実行する。 See FIG. Next, the binarization unit 547 and the area filter unit 548 execute the post-processing step S1414 that performs post-processing on the first defect candidate image.

図6に示すように、比較部546から出力される第1欠陥候補画像は2値化部547にて所定の閾値にて2値化される。ここで、第1欠陥候補画像は、第1欠陥候補領域が多値で表され、それ以外の領域は「0」で表されている。2値化部547における2値化処理により、第1欠陥候補領域を「1」とし、それ以外の領域を「0」とする。 As shown in FIG. 6, the first defect candidate image output from the comparison unit 546 is binarized by the binarization unit 547 at a predetermined threshold value. Here, in the first defect candidate image, the first defect candidate region is represented by multiple values, and the other regions are represented by "0". By the binarization process in the binarization unit 547, the first defect candidate region is set to "1", and the other regions are set to "0".

続いて、2値化処理済みの第1欠陥候補画像は、面積フィルタ部548に入力される。面積フィルタ部548により、面積が予め定められた値よりも小さい第1欠陥候補領域が削除され、残りの第1欠陥候補領域を示す画像が最終的な第1欠陥候補画像(正確には、第1欠陥候補領域を示す画像データである第1欠陥候補データ921)として取得される。 Subsequently, the first defect candidate image that has been binarized is input to the area filter unit 548. The area filter unit 548 deletes the first defect candidate region whose area is smaller than the predetermined value, and the image showing the remaining first defect candidate region is the final first defect candidate image (to be exact, the first defect candidate image). It is acquired as first defect candidate data 921), which is image data indicating one defect candidate area.

以上の処理により、図18に示す第1欠陥候補画像821が取得される。第1欠陥候補画像821では、比較画像811cで抽出された第1欠陥候補領域722cが、比較画像812cとの差分をとることで除外されている。これにより、本来は欠陥ではないパターン部分722に起因する虚報を抑制することができる。但し、図18の画像例では、撮像画像811と参照画像812との間の、対象物9の公差に起因して、一部の第1欠陥候補領域722cが第1マスク領域によって除外しきれず、第1欠陥候補画像821において第1欠陥候補領域722dとして残留している。 By the above processing, the first defect candidate image 821 shown in FIG. 18 is acquired. In the first defect candidate image 821, the first defect candidate region 722c extracted in the comparison image 811c is excluded by taking a difference from the comparison image 812c. As a result, false news caused by the pattern portion 722, which is not originally a defect, can be suppressed. However, in the image example of FIG. 18, due to the tolerance of the object 9 between the captured image 811 and the reference image 812, a part of the first defect candidate region 722c cannot be completely excluded by the first mask region. It remains as the first defect candidate region 722d in the first defect candidate image 821.

撮像部3にて取得された複数の撮像画像は、処理対象として順次選択され、撮像画像の数に等しい数の第1欠陥候補データ921が取得される。 The plurality of captured images acquired by the imaging unit 3 are sequentially selected as processing targets, and a number of first defect candidate data 921 equal to the number of captured images is acquired.

図14を参照する。次に、第3欠陥候補取得部551が、第3欠陥候補取得工程S142を実行する。 See FIG. Next, the third defect candidate acquisition unit 551 executes the third defect candidate acquisition step S142.

図7に示すように、第3欠陥候補取得工程S142が開始されると、まず第1欠陥候補取得工程S141にて選択された1つの撮像画像と、当該撮像画像に対応する参照画像が選択される。そして、第3欠陥候補取得部551において、撮像画像の撮像画像データ911がフィルタ処理部552に入力され、参照画像の参照画像データ912がフィルタ処理部552に入力される。 As shown in FIG. 7, when the third defect candidate acquisition step S142 is started, first, one captured image selected in the first defect candidate acquisition step S141 and a reference image corresponding to the captured image are selected. To. Then, in the third defect candidate acquisition unit 551, the captured image data 911 of the captured image is input to the filter processing unit 552, and the reference image data 912 of the reference image is input to the filter processing unit 552.

次に、フィルタ処理部52およびプリアライメント部53が、撮像画像および参照画像に対してフィルタ処理およびプリアライメント処理を行う。これらの処理は、第1欠陥候補取得工程S141における前処理工程S202、S212と同様であるため、説明を省略する。 Next, the filtering unit 5 5 2 and the pre-alignment unit 5 5 3 performs the filtering and pre-alignment process on the captured image and the reference image. Since these processes are the same as the pretreatment steps S202 and S212 in the first defect candidate acquisition step S141, the description thereof will be omitted.

続いて、ゆすらせ比較部554が、前処理済みの撮像画像および参照画像を用いて、ゆすらせ比較処理を行い、2値化部555がゆすらせ比較処理済みの画像に対し2値化処理を行うことで、第3欠陥候補画像を生成する。ゆすらせ比較部554では、参照画像をプリアライメント済みの位置から、上下左右に少しずつ移動しながら、撮像画像と参照画像との差異を示す評価値が求められる。評価値としては、例えば、両画像が重なる領域における画素の値の(符号付きの)差の絶対値の和が求められる。そして、評価値が最小となる位置における両画像の画素の値の符号付き差分を示す画像が生成される。符号付き差分画像は、2値化部555により所定の値にて2値化され、第3欠陥候補領域を示す第3欠陥候補画像が生成される。 Subsequently, the shaking comparison unit 554 performs the shaking comparison processing using the preprocessed captured image and the reference image, and the binarization unit 555 performs the binarization processing on the shake comparison processed image. By doing so, a third defect candidate image is generated. In the shaking comparison unit 554, an evaluation value indicating the difference between the captured image and the reference image is obtained while moving the reference image from the prealigned position little by little up, down, left and right. As the evaluation value, for example, the sum of the absolute values of the (signed) differences of the pixel values in the region where the two images overlap is obtained. Then, an image showing the signed difference between the pixel values of both images at the position where the evaluation value is the minimum is generated. The signed difference image is binarized at a predetermined value by the binarization unit 555, and a third defect candidate image showing the third defect candidate region is generated.

実際には、処理を簡素化するために、符号付き差分画像は求められない。具体的には、参照画像の各画素の値から撮像画像の対応する画素の値が減算され、値が負の場合に0とすることにより、差分画像の画素の値が求められる。予め正の値が準備されており、差分画像において当該正の値以上の値を有する画素により構成される領域が第3欠陥候補領域として取得される。 In practice, a signed difference image is not required to simplify the process. Specifically, the value of the pixel of the difference image is obtained by subtracting the value of the corresponding pixel of the captured image from the value of each pixel of the reference image and setting it to 0 when the value is negative. A positive value is prepared in advance, and a region composed of pixels having a value equal to or greater than the positive value in the difference image is acquired as a third defect candidate region.

一般的に表現すれば、撮像画像において参照画像よりも明度が低く、かつ、明度の差の絶対値が第2基準値以上である領域が第3欠陥候補領域として取得される。第2基準値は正の値である。さらに換言すれば、撮像画像において参照画像よりも明度が所定値よりも低い領域が第3欠陥候補領域として取得される。画像がモノクロである場合は、画素値を明度と捉えてもよく、カラー画像の場合は、色成分毎の画素値に対して所定の演算を行うことにより求められる値が明度として扱われる。 Generally speaking, a region in the captured image whose brightness is lower than that of the reference image and whose absolute value of the difference in brightness is equal to or greater than the second reference value is acquired as the third defect candidate region. The second reference value is a positive value. In other words, in the captured image, a region having a brightness lower than a predetermined value than the reference image is acquired as a third defect candidate region. When the image is monochrome, the pixel value may be regarded as the brightness, and in the case of a color image, the value obtained by performing a predetermined calculation on the pixel value for each color component is treated as the brightness.

第3欠陥候補領域は、参照画像の各画素の値と撮像画像の対応する画素の値との比から求められてもよい。具体的には、参照画像の各画素の値を撮像画像の対応する画素の値で除算することにより、比画像の画素の値が求められる。予め1よりも大きい第2基準値が準備されており、比画像において第2基準値以上の値を有する画素により構成される領域が第3欠陥候補領域として取得される。もちろん、撮像画像の各画素の値を参照画像の対応する画素の値で除算することにより、比画像の画素の値が求められてもよい。この場合、比画像において1よりも小さい第2基準値以下の値を有する画素により構成される領域が第3欠陥候補領域として取得される。 The third defect candidate region may be obtained from the ratio of the value of each pixel of the reference image to the value of the corresponding pixel of the captured image. Specifically, the value of the pixel of the ratio image is obtained by dividing the value of each pixel of the reference image by the value of the corresponding pixel of the captured image. A second reference value larger than 1 is prepared in advance, and a region composed of pixels having a value equal to or higher than the second reference value in the ratio image is acquired as a third defect candidate region. Of course, the pixel value of the ratio image may be obtained by dividing the value of each pixel of the captured image by the value of the corresponding pixel of the reference image. In this case, a region composed of pixels having a value equal to or less than a second reference value smaller than 1 in the ratio image is acquired as a third defect candidate region.

第2基準値は定数でなくてもよい。第2基準値は参照画像および/または撮像画像の明度または画素値の関数でもよい。第2基準値は、参照画像および撮像画像の明度または画素値の差および比を用いて定められてもよく、さらに他の演算が利用されてもよい。 The second reference value does not have to be a constant. The second reference value may be a function of the brightness or pixel value of the reference image and / or the captured image. The second reference value may be determined using the difference and ratio of the brightness or pixel value of the reference image and the captured image, and other calculations may be used.

図19は、第3欠陥候補取得工程S142における処理の内容を示す画像例である。入力される撮像画像811および参照画像812は、図18にて例示した画像と同様である。ゆすらせ比較部554によるゆすらせ比較処理および2値化部555による2値化処理が実行された結果、生成される第3欠陥候補画像を第3欠陥候補画像823として例示する。 FIG. 19 is an image example showing the content of the process in the third defect candidate acquisition step S142. The input captured image 811 and reference image 812 are the same as the images illustrated in FIG. The third defect candidate image generated as a result of executing the shaking comparison processing by the shaking comparison unit 554 and the binarization processing by the binarization unit 555 is exemplified as the third defect candidate image 823.

第3欠陥候補画像823では、ゆすらせ比較処理によって撮像画像811のうち参照画像812と比べて暗い領域が第3欠陥候補領域711i、721iとして抽出されている。このうち、第3欠陥候補領域711iは、撮像画像811に存在する第1欠陥711に対応する真の欠陥である一方、第3欠陥候補領域721iは、撮像画像811には存在しないものの、参照画像812において第2欠陥721(すなわち、周囲よりも明るく写る欠陥)として存在するために、ゆすらせ比較処理によって参照画像812よりも暗い領域として抽出されてしまった、いわゆる偽の欠陥である。このように、ゆすらせ比較処理では、参照画像中に欠陥領域が含まれると、それに起因して撮像画像には含まれない欠陥領域をノイズとして抽出することがある。 In the third defect candidate image 823, regions of the captured image 811 that are darker than the reference image 812 are extracted as the third defect candidate regions 711i and 721i by the shaking comparison process. Of these, the third defect candidate region 711i is a true defect corresponding to the first defect 711 existing in the captured image 811, while the third defect candidate region 721i is not present in the captured image 811 but is a reference image. Since it exists as a second defect 721 (that is, a defect that appears brighter than the surroundings) in 812, it is a so-called false defect that has been extracted as a region darker than the reference image 812 by the shaking comparison process. As described above, in the shaking comparison process, if a defect region is included in the reference image, the defect region not included in the captured image may be extracted as noise due to the defect region.

図7を参照する。ゆすらせ比較処理および2値化処理によって第3欠陥候補領域711i、721iが取得されると、面積フィルタ部556により、面積が予め定められた値よりも小さい第3欠陥候補領域が削除され、残りの第3欠陥候補領域を示す画像が最終的な第3欠陥候補画像(正確には、第3欠陥候補領域を示す画像データである第3欠陥候補データ923)として取得される。 See FIG. 7. When the third defect candidate areas 711i and 721i are acquired by the shaking comparison process and the binarization process, the area filter unit 556 deletes the third defect candidate area whose area is smaller than the predetermined value, and the rest. The image showing the third defect candidate area of is acquired as the final third defect candidate image (more accurately, the third defect candidate data 923 which is the image data showing the third defect candidate area).

撮像部3にて取得された複数の撮像画像は、処理対象として順次選択され、撮像画像の数に等しい数の第3欠陥候補データ923が取得される。 The plurality of captured images acquired by the imaging unit 3 are sequentially selected as processing targets, and a number of third defect candidate data 923 equal to the number of captured images is acquired.

図14を参照する。第1欠陥候補データ921および第3欠陥候補データ923が取得されると、次に欠陥候補限定工程S143が実行され、第1欠陥候補データ921および第3欠陥候補データ923に基づいて、第1欠陥データ931が取得される。 See FIG. When the first defect candidate data 921 and the third defect candidate data 923 are acquired, the defect candidate limiting step S143 is then executed, and the first defect is executed based on the first defect candidate data 921 and the third defect candidate data 923. Data 931 is acquired.

図8に示すように、欠陥候補限定工程S143が開始されると、第1欠陥候補データ921および第3欠陥候補データ923が、論理積演算部582に入力される。ここで、論理積演算部582に入力される第1欠陥候補データ921は、所定の第1の撮像部3が所定の第1の照明条件のもとで取得した1個の撮像画像および当該撮像画像に対応する参照画像から生成されたデータである。そして、同じ論理積演算部582に入力される第3欠陥候補データ923は、第1の撮像部3が第1の照明条件のもとで取得した同じ撮像画像および当該撮像画像に対応する参照画像から生成されたデータである。 As shown in FIG. 8, when the defect candidate limiting step S143 is started, the first defect candidate data 921 and the third defect candidate data 923 are input to the logical product calculation unit 582. Here, the first defect candidate data 921 input to the logical product calculation unit 582 is one captured image acquired by the predetermined first imaging unit 3 under the predetermined first lighting condition and the captured image. It is the data generated from the reference image corresponding to the image. Then, the third defect candidate data 923 input to the same AND calculation unit 582 is the same captured image acquired by the first imaging unit 3 under the first lighting condition and the reference image corresponding to the captured image. It is the data generated from.

そして、論理積演算部582とは異なる論理積演算部583には、別の撮像画像および当該撮像画像に対応する参照画像から生成された第1欠陥候補データ921および第3欠陥候補データ923が入力される。ここで、論理積演算部583に入力される第1欠陥候補データ921は、論理積演算部582のものと同じ第1の撮像部3が、論理積演算部582のものと異なる第2の照明条件のもとで取得した1個の撮像画像および当該撮像画像に対応する参照画像から生成されたデータである。そして、同じ論理積演算部583に入力される第3欠陥候補データ923は、第1の撮像部3が第2の照明条件のもとで取得した撮像画像および当該撮像画像に対応する参照画像から生成されたデータである。 Then, the first defect candidate data 921 and the third defect candidate data 923 generated from another captured image and the reference image corresponding to the captured image are input to the logical product calculation unit 583 different from the logical product calculation unit 582. Will be done. Here, the first defect candidate data 921 input to the logical product calculation unit 583 has the same first imaging unit 3 as that of the logical product calculation unit 582, but is different from that of the logical product calculation unit 582. It is data generated from one captured image acquired under the conditions and a reference image corresponding to the captured image. Then, the third defect candidate data 923 input to the same AND calculation unit 583 is obtained from the captured image acquired by the first imaging unit 3 under the second lighting condition and the reference image corresponding to the captured image. This is the generated data.

そして、領域選択部584には、第1欠陥候補データ921と第3欠陥候補データ923との各組み合わせから得られる論理積画像のデータが入力される。換言すれば、各論理積画像は、それぞれ同じ撮像部が異なる照明条件のもとで取得した撮像画像および参照画像から生成される画像である。論理積演算部582で得られる第1の論理積画像は、第1の撮像部3により第1の照明条件のもとで取得した画像に基づいて生成され、論理積演算部583で得られる第2の論理積画像は、第1の撮像部3により第2の照明条件のもとで取得した画像に基づいて生成される。 Then, the data of the logical product image obtained from each combination of the first defect candidate data 921 and the third defect candidate data 923 is input to the area selection unit 584. In other words, each AND image is an image generated from a captured image and a reference image acquired by the same imaging unit under different lighting conditions. The first logical product image obtained by the logical product calculation unit 582 is generated based on the image acquired by the first imaging unit 3 under the first lighting condition, and is obtained by the logical product calculation unit 583. The logical product image of 2 is generated based on the image acquired by the first imaging unit 3 under the second illumination condition.

各論理積画像は、第1欠陥候補領域と第3欠陥候補領域とから生成される第1欠陥領域を示す画像である。 Each logical product image is an image showing a first defect region generated from the first defect candidate region and the third defect candidate region.

図20は、図18の第1欠陥候補領域711d、722dと図19の第3欠陥候補領域711i、721iとから生成される第1欠陥領域731を示す第1欠陥画像831を例示する図である。 FIG. 20 is a diagram illustrating a first defect image 831 showing a first defect region 731 generated from the first defect candidate regions 711d and 722d of FIG. 18 and the third defect candidate regions 711i and 721i of FIG. ..

第1欠陥候補領域711d、722dは、撮像画像のいわゆる自己比較により抽出した比較画像811cにおける第1欠陥候補領域711c、722cを、参照画像のいわゆる自己比較により抽出した比較画像812cにおける第1マスク領域722cでマスクすることで得られるため、参照画像812に含まれる欠陥に起因するノイズを検出する可能性が低い。しかし、処理時間の都合上、正確な位置合わせを行っていないことによる偽欠陥(図20では、第1欠陥候補領域722d)を検出するおそれがある。 The first defect candidate regions 711d and 722d are the first mask regions in the comparative image 812c obtained by extracting the first defect candidate regions 711c and 722c in the comparative image 811c extracted by the so-called self-comparison of the captured images by the so-called self-comparison of the reference image. Since it is obtained by masking with 722c, it is unlikely to detect noise caused by a defect contained in the reference image 812. However, due to the convenience of processing time, there is a possibility of detecting a false defect (first defect candidate region 722d in FIG. 20) due to improper alignment.

一方、第3欠陥候補領域711i、721iは、撮像画像811と参照画像812との位置合わせを行った後に、これらの画像の差分画像から得られるため、欠陥の存在を示す信頼性が高い。しかし、第3欠陥候補領域は、参照画像812に含まれる欠陥を偽欠陥(図20では第3欠陥候補領域721i)として検出するおそれがある。 On the other hand, the third defect candidate regions 711i and 721i are obtained from the difference images of these images after the captured image 811 and the reference image 812 are aligned, so that the reliability indicating the existence of the defect is high. However, the third defect candidate region may detect the defect included in the reference image 812 as a false defect (third defect candidate region 721i in FIG. 20).

そこで、本実施形態では、第1欠陥候補画像821と第3欠陥候補画像823との論理積画像を求めることにより、信頼性を向上した第1欠陥領域731を示す第1欠陥画像831を得る。 Therefore, in the present embodiment, by obtaining the logical product image of the first defect candidate image 821 and the third defect candidate image 823, the first defect image 831 showing the first defect region 731 with improved reliability is obtained.

領域選択部584では、複数の第1欠陥画像831を重ねた場合に、所定数以上の第1欠陥領域が重なる領域を、第1欠陥領域として維持し、所定数未満の領域を第1欠陥領域から除外する。ここで、「重なる領域」は、重なる複数の領域における画素値の論理和であってもよく、当該画素値の論理積であってもよい。本実施の形態では重なる領域の数が2以上の場合に第1欠陥領域として維持する。領域選択部584により、第1欠陥領域731を示す複数の第1欠陥画像831から、限定された第1欠陥領域を示す1つの第1欠陥画像が取得され、これに対応する第1欠陥データ931が領域選択部584から出力される。これにより、複数の照明状態にて取得された複数の撮像画像から、対応する参照画像を参照しつつ参照画像に対して暗い領域が第1欠陥領域として抽出される。 In the area selection unit 584, when a plurality of first defect images 831 are overlapped, the area where a predetermined number or more of the first defect areas overlap is maintained as the first defect area, and the area less than the predetermined number is the first defect area. Exclude from. Here, the "overlapping region" may be a logical sum of pixel values in a plurality of overlapping regions, or may be a logical product of the pixel values. In the present embodiment, when the number of overlapping regions is 2 or more, it is maintained as the first defect region. The region selection unit 584 acquires one first defect image showing a limited first defect region from a plurality of first defect images 831 showing the first defect region 731, and the corresponding first defect data 931. Is output from the area selection unit 584. As a result, a dark region with respect to the reference image is extracted as the first defect region from the plurality of captured images acquired under the plurality of illumination states while referring to the corresponding reference image.

領域選択部584から出力された第1欠陥データ931は、欠陥取得部52から記憶部53へ出力されて、記憶部53にて記憶される。 The first defect data 931 output from the area selection unit 584 is output from the defect acquisition unit 52 to the storage unit 53 and stored in the storage unit 53.

以上により、撮像画像における第1欠陥の存在を取得する第1欠陥取得工程S14が終了する。 As a result, the first defect acquisition step S14 for acquiring the presence of the first defect in the captured image is completed.

第1欠陥取得工程S14と並行して、撮像画像における第2欠陥の存在を取得する第2欠陥取得工程S15が実行される。第2欠陥は、撮像画像のうち参照画像に対して明るく現れる欠陥である。第2欠陥取得工程S15が第1欠陥取得工程S14と異なるところは、参照画像や撮像画像内部の他の領域に比して撮像画像のうち明るい領域を検出するために、膨張処理工程と収縮処理工程の順序が逆である点、減算や除算の順序が逆である点であり、その他の部分では第1欠陥取得工程S14と共通するため、共通部分については説明を適宜省略する。 In parallel with the first defect acquisition step S14, the second defect acquisition step S15 for acquiring the presence of the second defect in the captured image is executed. The second defect is a defect that appears brightly with respect to the reference image in the captured image. The second defect acquisition step S15 is different from the first defect acquisition step S14 in that the expansion processing step and the contraction processing are performed in order to detect a bright region of the captured image as compared with the reference image and other regions inside the captured image. Since the order of the steps is reversed and the order of subtraction and division is reversed, and the other parts are common to the first defect acquisition step S14, the description of the common parts will be omitted as appropriate.

以下、図9から図23までを適宜参照しつつ、第2欠陥取得工程S15について説明する。 Hereinafter, the second defect acquisition step S15 will be described with reference to FIGS. 9 to 23 as appropriate.

第2欠陥取得工程S15が開始すると、まず、第2欠陥候補取得工程S151が実行される。第2欠陥候補取得工程S151では、まず、第2欠陥取得部522により1つの撮像画像が選択され、当該撮像画像に対応する参照画像が選択される。図10に示すように、第2欠陥候補取得部561では、撮像画像の撮像画像データ911がフィルタ処理部562に入力され(撮像画像データ入力工程S301)、参照画像の参照画像データ912がフィルタ処理部562に入力される(参照画像データ入力工程S311)。 When the second defect acquisition step S15 is started, first, the second defect candidate acquisition step S151 is executed. In the second defect candidate acquisition step S151, first, one captured image is selected by the second defect acquisition unit 522, and the reference image corresponding to the captured image is selected. As shown in FIG. 10 , in the second defect candidate acquisition unit 561, the captured image data 911 of the captured image is input to the filter processing unit 562 (captured image data input step S301), and the reference image data 912 of the reference image is filtered. It is input to the unit 562 (reference image data input step S311).

図17を参照する。前処理工程S302、S312は、前処理工程S201、S211(図16)と同様に行われる。次に、収縮処理部564が、プリアライメント済みの撮像画像および参照画像に対して収縮処理を行う収縮処理工程S303、S313を実行する。 See FIG. The pretreatment steps S302 and S312 are performed in the same manner as the pretreatment steps S201 and S211 (FIG. 16). Next, the shrinkage processing unit 564 executes the shrinkage processing steps S303 and S313 that perform the shrinkage processing on the prealigned captured image and the reference image.

図10に示すように、第2欠陥候補取得部561では、プリアライメント部563から撮像画像データ911および参照画像データ912が収縮処理部564に入力され、撮像画像および参照画像に収縮処理が行われる。ここでの収縮処理は、多値画像における明るい領域を収縮させる処理であり、暗い領域に対する膨張処理でもある。これにより、明るい小さな領域が消滅する。収縮処理では、例えば公知の最小値フィルタが用いられ、画素値の低い(すなわち、暗い)1ピクセルの画素が、3ピクセル×3ピクセルに膨張される。 As shown in FIG. 10, in the second defect candidate acquisition unit 561, the captured image data 911 and the reference image data 912 are input from the prealignment unit 563 to the contraction processing unit 564, and the captured image and the reference image are contracted. .. The shrinkage process here is a process of shrinking a bright region in a multi-valued image, and is also a process of expanding a dark region. This eliminates the small bright areas. In the shrinkage process, for example, a known minimum value filter is used, and a pixel having a low pixel value (that is, dark) of 1 pixel is expanded to 3 pixels × 3 pixels.

図21は、第2欠陥候補取得工程S151における処理の内容を示す画像例であり、入力される撮像画像811および参照画像812は、図18と同様の画像である。 FIG. 21 is an image example showing the content of the process in the second defect candidate acquisition step S151, and the input captured image 811 and the reference image 812 are the same images as those in FIG.

収縮処理により、図21の収縮画像811eおよび収縮画像812eが生成される。収縮画像811eおよび収縮画像812eでは、暗い領域である第1欠陥711eおよびパターン部分722eが膨張された状態で確認される一方、小さな明るい領域は消滅する。 The contraction process produces the contraction image 811e and the contraction image 812e of FIG. In the contracted image 811e and the contracted image 812e, the dark region, the first defect 711e and the pattern portion 722e, are confirmed in an expanded state, while the small bright region disappears.

なお、本発明の実施に関しては、最小値フィルタのカーネルサイズは3ピクセル×3ピクセルに限られず、他の各種のサイズを採用してもよい。 Regarding the implementation of the present invention, the kernel size of the minimum value filter is not limited to 3 pixels × 3 pixels, and various other sizes may be adopted.

図17を参照する。次に、膨張処理部565が、収縮処理済みの撮像画像および参照画像に対して膨張処理を行う膨張処理工程S304、S314を実行する。 See FIG. Next, the expansion processing unit 565 executes expansion processing steps S304 and S314 for performing expansion processing on the captured image and the reference image that have undergone contraction processing.

図10に示すように、収縮処理済みの撮像画像および参照画像のデータは、膨張処理部565に入力され、撮像画像および参照画像に膨張処理が行われる。ここでの膨張処理は、多値画像における明るい領域を膨張させる処理である。膨張処理では、例えば収縮処理で用いた最小値フィルタと同サイズの最大値フィルタが用いられ、膨張していた暗い領域がほぼ元の大きさに戻される。 As shown in FIG. 10, the data of the captured image and the reference image that have been shrink-processed are input to the expansion processing unit 565, and the captured image and the reference image are expanded. The expansion process here is a process for expanding a bright region in a multi-valued image. In the expansion treatment, for example, a maximum value filter having the same size as the minimum value filter used in the contraction treatment is used, and the expanded dark region is returned to almost the original size.

これにより、図21に示す膨張画像811fおよび膨張画像812fが生成される。膨張画像811fおよび膨張画像812fでは、暗い領域である第1欠陥711fおよびパターン部分722fがほぼ元の大きさに戻った状態で確認される。収縮処理および膨張処理によって、元の撮像画像および参照画像において大きな明るい領域はほぼ元の状態が維持され、小さな明るい領域は消滅する。なお、図21の画像例においては、明るい領域はすべて収縮処理により消滅する。 As a result, the expansion image 811f and the expansion image 812f shown in FIG. 21 are generated. In the expanded image 811f and the expanded image 812f, the first defect 711f and the pattern portion 722f, which are dark regions, are confirmed in a state of being substantially returned to their original sizes. By the contraction treatment and the expansion treatment, the large bright region in the original captured image and the reference image is maintained in the original state, and the small bright region disappears. In the image example of FIG. 21, all the bright regions disappear by the shrinkage treatment.

図17を参照する。次に、比較部566が、膨張処理済みの撮像画像および参照画像に対して比較処理を行う比較処理工程S305、S315を実行する。 See FIG. Next, the comparison unit 566 executes the comparison processing steps S305 and S315 for performing the comparison processing on the expanded image and the reference image.

図10に示すように、膨張処理済みの撮像画像および参照画像のデータは、比較部566に入力され、比較部566は、まず撮像画像と、当該撮像画像を収縮・膨張処理した膨張画像との差および比の少なくとも一方に基づいて比較画像を生成し(比較処理工程S305)、これと並行して、参照画像と、当該参照画像を収縮・膨張処理した膨張画像との差および比の少なくとも一方に基づいて比較画像を生成する(比較処理工程S315)。 As shown in FIG. 10, the data of the captured image and the reference image that have been expanded are input to the comparison unit 566, and the comparison unit 566 first combines the captured image and the expanded image obtained by shrinking / expanding the captured image. A comparative image is generated based on at least one of the difference and the ratio (comparison processing step S305), and in parallel with this, at least one of the difference and the ratio between the reference image and the expanded image obtained by shrinking / expanding the reference image. A comparison image is generated based on (comparison processing step S315).

比較処理工程S305、S315における処理は、比較処理工程S205、S215と閾値として用いる基準値や、比に基づいて比較画像を生成する際の分子分母の順が異なる点以外は、共通するため、共通する点については適宜説明を省略する。 The processing in the comparison processing steps S305 and S315 is common because it is common except that the reference value used as the threshold value and the order of the numerator denominator when generating the comparison image based on the ratio are different from those in the comparison processing steps S205 and S215. The points to be described will be omitted as appropriate.

比較処理工程S305の具体例の一つとして、差(例えば、減算処理)によって比較画像を取得する。具体的には、撮像画像の各画素の値から、当該撮像画像を収縮・膨張処理した膨張画像の当該撮像画像と重なる領域における画素の値を減算することで、両画像の差分を示す差画像が取得される。そして、当該差画像のうち、画素の絶対値が所定の閾値よりも大きい領域を、第2欠陥候補領域として抽出した比較画像を取得する。 As one of the specific examples of the comparison processing step S305, a comparison image is acquired by the difference (for example, subtraction processing). Specifically, a difference image showing the difference between the two images by subtracting the pixel value in the region overlapping the captured image of the expanded image obtained by shrinking / expanding the captured image from the value of each pixel of the captured image. Is obtained. Then, a comparison image obtained by extracting a region in which the absolute value of the pixel is larger than a predetermined threshold value as a second defect candidate region in the difference image is acquired.

一般的に表現すれば、比較処理工程S305では、撮像画像において、当該撮像画像を収縮・膨張処理した膨張画像よりも明度が高く、かつ、明度の差の絶対値が第3基準値以上である領域が第2欠陥候補領域として比較画像に表現される。第3基準値は正の値である。さらに換言すれば、撮像画像において当該撮像画像を収縮・膨張処理した膨張画像よりも明度が所定値以上高い領域が第2欠陥候補領域として比較画像に表現される。画像がモノクロである場合は、画素値を明度と捉えてもよく、カラー画像の場合は、色成分毎の画素値に対して所定の演算を行うことにより求められる値が明度として扱われる。 Generally speaking, in the comparative processing step S305, in the captured image, the brightness is higher than that of the expanded image obtained by shrinking / expanding the captured image, and the absolute value of the difference in brightness is equal to or higher than the third reference value. The region is represented in the comparative image as a second defect candidate region. The third reference value is a positive value. In other words, in the captured image, a region having a brightness higher than a predetermined value or more than the expanded image obtained by shrinking / expanding the captured image is represented in the comparative image as a second defect candidate region. When the image is monochrome, the pixel value may be regarded as the brightness, and in the case of a color image, the value obtained by performing a predetermined calculation on the pixel value for each color component is treated as the brightness.

また、比較処理工程S305の他の具体例として、第2欠陥候補領域は、撮像画像の各画素の値と当該撮像画像を収縮・膨張処理した膨張画像の対応する画素の値との比から求められてもよい。具体的には、撮像画像の対応する画素の値を当該撮像画像を収縮・膨張処理した膨張画像の各画素の値で除算することにより、比画像の画素の値が求められる。予め1よりも大きい第3基準値が準備されており、比画像において第3基準値以上の値を有する画素により構成される領域が第2欠陥候補領域として抽出され、当該第2欠陥候補領域を含む比較画像が取得される。 Further, as another specific example of the comparison processing step S305, the second defect candidate region is obtained from the ratio of the value of each pixel of the captured image and the value of the corresponding pixel of the expanded image obtained by shrinking / expanding the captured image. May be done. Specifically, the pixel value of the ratio image is obtained by dividing the value of the corresponding pixel of the captured image by the value of each pixel of the expanded image obtained by shrinking / expanding the captured image. A third reference value larger than 1 is prepared in advance, and a region composed of pixels having a value equal to or higher than the third reference value in the ratio image is extracted as a second defect candidate region, and the second defect candidate region is extracted. A comparative image including is acquired.

もちろん、撮像画像を収縮・膨張処理した膨張画像の画素の値を当該撮像画像の対応する各画素の値で除算することにより、比画像の画素の値が求められてもよい。この場合、比画像において1よりも小さい第3基準値以下の値を有する画素により構成される領域が第2欠陥候補領域として抽出され、当該第2欠陥候補領域を含む比較画像が取得される。 Of course, the pixel value of the ratio image may be obtained by dividing the pixel value of the expanded image obtained by shrinking / expanding the captured image by the value of each corresponding pixel of the captured image. In this case, in the ratio image, a region composed of pixels having a value equal to or less than a third reference value smaller than 1 is extracted as a second defect candidate region, and a comparative image including the second defect candidate region is acquired.

比較処理工程S315は、参照画像と、当該参照画像を収縮・膨張処理した膨張画像との差および比の少なくとも一方に基づいて比較画像を生成する。差画像または比画像の取得については、撮像画像についての比較処理工程S305と同様の処理を行う。比較処理工程S315では、比較処理工程S305と同様の処理により、第2欠陥候補領域に代えて、参照画像のうち明るい領域を第2マスク領域として抽出する。 The comparison processing step S315 generates a comparative image based on at least one of the difference and the ratio between the reference image and the expanded image obtained by shrinking / expanding the reference image. Regarding the acquisition of the difference image or the ratio image, the same processing as in the comparison processing step S305 for the captured image is performed. In the comparison processing step S315, a bright region of the reference image is extracted as the second mask region in place of the second defect candidate region by the same processing as in the comparison processing step S305.

比較処理工程S315の具体例の一つとして、差(例えば、減算処理)によって比較画像を取得する。具体的には、参照画像の各画素の値から、当該参照画像を収縮・膨張処理した膨張画像の当該参照画像と重なる領域における画素の値を減算することで、両画像の差分を示す差画像が取得される。そして、当該差画像のうち、画素の絶対値が所定の閾値よりも大きい領域を、第2マスク領域として抽出した比較画像を取得する。 As one of the specific examples of the comparison processing step S315, a comparison image is acquired by the difference (for example, subtraction processing). Specifically, a difference image showing the difference between the two images by subtracting the pixel value in the region overlapping the reference image of the expanded image obtained by shrinking / expanding the reference image from the value of each pixel of the reference image. Is obtained. Then, a comparison image obtained by extracting a region in which the absolute value of the pixels is larger than a predetermined threshold value as a second mask region in the difference image is acquired.

また、比較処理工程S315の他の具体例として、第2マスク領域は、参照画像の各画素の値と当該参照画像を収縮・膨張処理した膨張画像の対応する画素の値との比から求められてもよい。 Further, as another specific example of the comparison processing step S315, the second mask region is obtained from the ratio of the value of each pixel of the reference image to the value of the corresponding pixel of the expanded image obtained by shrinking / expanding the reference image. You may.

以上の処理により、図21に示す比較画像811gおよび比較画像812gが取得される。比較画像811gでは、撮像画像811よりも明るい領域として第2欠陥候補領域712g、721gが抽出されている。また、比較画像812gでは、参照画像812よりも明るい領域として第2マスク領域712g、721gが抽出されている。なお、721gは第2欠陥(真の欠陥)に対応し、712gはパターン部分(偽の欠陥)に対応する。 By the above processing, the comparative image 811 g and the comparative image 812 g shown in FIG. 21 are acquired. In the comparative image 811g, the second defect candidate regions 712g and 721g are extracted as regions brighter than the captured image 811. Further, in the comparative image 812 g, the second mask regions 712 g and 721 g are extracted as regions brighter than the reference image 812. In addition, 721 g corresponds to the second defect (true defect), and 712 g corresponds to the pattern portion (false defect).

以上に説明した、撮像画像データ入力工程S301と、前処理工程S302と、収縮処理工程S303と、膨張処理工程S304と、比較処理工程S305とが、本実施形態における第2欠陥候補領域検出工程S1511を構成する。なお、前処理工程S302は、撮像画像の状態や検査条件によっては省略することができる。 The captured image data input step S301, the pretreatment step S302, the shrinkage treatment step S303, the expansion treatment step S304, and the comparison processing step S305 described above are the second defect candidate region detection step S1511 in the present embodiment. To configure. The preprocessing step S302 can be omitted depending on the state of the captured image and the inspection conditions.

また、以上に説明した、参照画像データ入力工程S311と、前処理工程S312と、収縮処理工程S313と、膨張処理工程S314と、比較処理工程S315とが、本実施形態における第2マスク領域検出工程S1512を構成する。なお、前処理工程S312は、参照画像の状態や検査条件によっては省略することができる。 Further, the reference image data input step S311, the pretreatment step S312, the shrinkage treatment step S313, the expansion treatment step S314, and the comparison treatment step S315 described above are the second mask region detection steps in the present embodiment. It constitutes S1512. The pretreatment step S312 can be omitted depending on the state of the reference image and the inspection conditions.

図17を参照する。次に、比較部566が、撮像画像に基づく比較画像に対して欠陥候補除外処理を行う欠陥候補除外工程S1513を実行する。 See FIG. Next, the comparison unit 566 executes the defect candidate exclusion step S1513 that performs the defect candidate exclusion process on the comparison image based on the captured image.

欠陥候補除外工程S1513では、撮像画像の比較画像における第2欠陥候補領域の一部領域を、第2マスク領域に基づいて、第2欠陥候補から除外した第2欠陥候補画像を生成する。より具体的には、欠陥候補除外工程S1413と同様に、比較部566において生成された撮像画像に基づく比較画像の第2欠陥候補領域のうち、参照画像に基づく比較画像の第2マスク領域と所定条件以上重なるものを、第2欠陥候補から除外した第2欠陥候補画像を生成する。 In the defect candidate exclusion step S1513, a second defect candidate image is generated in which a part of the second defect candidate region in the comparison image of the captured image is excluded from the second defect candidate based on the second mask region. More specifically, similarly to the defect candidate exclusion step S1413, among the second defect candidate regions of the comparison image based on the captured image generated by the comparison unit 566, the second mask region of the comparison image based on the reference image is defined. A second defect candidate image is generated in which those that overlap more than the conditions are excluded from the second defect candidates.

次に、2値化部567および面積フィルタ部568が、第2欠陥候補画像に対して後処理を行う後処理工程S1514を実行し、最終的な第2欠陥候補画像(正確には、第2欠陥候補領域を示す画像データである第2欠陥候補データ922)が取得される。後処理工程S1514は、後処理工程S1414と同様の処理であるため、説明を省略する。 Next, the binarization unit 567 and the area filter unit 568 execute the post-processing step S1514 that performs post-processing on the second defect candidate image, and the final second defect candidate image (to be exact, the second defect candidate image). The second defect candidate data 922), which is image data indicating the defect candidate area, is acquired. Since the post-treatment step S1514 is the same process as the post-treatment step S1414, the description thereof will be omitted.

以上の処理により、図21に示す第2欠陥候補画像822が取得される。第2欠陥候補画像822では、比較画像811gで抽出された第2欠陥候補領域712gが、比較画像812gとの差分をとることで除外され、第2欠陥候補領域721hのみが残留している。これにより、本来は欠陥ではないパターン部分712に起因する過検出を抑制することができる。 By the above processing, the second defect candidate image 822 shown in FIG. 21 is acquired. In the second defect candidate image 822, the second defect candidate region 712g extracted from the comparison image 811g is excluded by taking a difference from the comparison image 812g, and only the second defect candidate region 721h remains. As a result, over-detection caused by the pattern portion 712, which is not originally a defect, can be suppressed.

また、比較画像812gにおいて、参照画像812に含まれる第2欠陥721が第2マスク領域721gとして残っていたとしても、第2欠陥候補画像822に影響することは防止される。第2欠陥候補領域721hは、比較画像811gの第2欠陥候補領域712g、721gのうちから抽出されるため、参照画像812のみで生じる第2欠陥721に起因して第2欠陥候補画像822にノイズ(すなわち、偽欠陥)が生じることはない。 Further, in the comparative image 812g, even if the second defect 721 included in the reference image 812 remains as the second mask region 721g, it is prevented from affecting the second defect candidate image 822. Since the second defect candidate region 721h is extracted from the second defect candidate regions 712g and 721g of the comparative image 811g, noise is generated in the second defect candidate image 822 due to the second defect 721 generated only in the reference image 812. (Ie, false defects) do not occur.

撮像部3にて取得された複数の撮像画像は、処理対象として順次選択され、撮像画像の数に等しい数の第2欠陥候補データ922が取得される。 The plurality of captured images acquired by the imaging unit 3 are sequentially selected as processing targets, and a number of second defect candidate data 922 equal to the number of captured images is acquired.

図15を参照する。次に、第4欠陥候補取得部571が、第4欠陥候補取得工程S152を実行する。 See FIG. Next, the fourth defect candidate acquisition unit 571 executes the fourth defect candidate acquisition step S152.

図11に示すように、第4欠陥候補取得工程S152が開始されると、まず第2欠陥候補取得工程S151にて選択された1つの撮像画像と、当該撮像画像に対応する参照画像が選択される。そして、第4欠陥候補取得部571において、撮像画像の撮像画像データ911がフィルタ処理部572に入力され、参照画像の参照画像データ912がフィルタ処理部572に入力される。 As shown in FIG. 11, when the fourth defect candidate acquisition step S152 is started, first, one captured image selected in the second defect candidate acquisition step S151 and a reference image corresponding to the captured image are selected. To. Then, in the fourth defect candidate acquisition unit 571, the captured image data 911 of the captured image is input to the filter processing unit 572, and the reference image data 912 of the reference image is input to the filter processing unit 572.

次に、フィルタ処理部572およびプリアライメント部573が、撮像画像および参照画像に対してフィルタ処理およびプリアライメント処理を行う。これらの処理は、第2欠陥候補取得工程S151における前処理工程S302、S312と同様であるため、説明を省略する。 Next, the filter processing unit 572 and the prealignment unit 573 perform filter processing and prealignment processing on the captured image and the reference image. Since these processes are the same as the pretreatment steps S302 and S312 in the second defect candidate acquisition step S151, the description thereof will be omitted.

続いて、ゆすらせ比較部574が、前処理済みの撮像画像および参照画像を用いて、ゆすらせ比較処理を行い、2値化部575がゆすらせ比較処理済みの画像に対し2値化処理を行うことで、第4欠陥候補画像を生成する。ゆすらせ比較部574では、参照画像をプリアライメント済みの位置から、上下左右に少しずつ移動しながら、撮像画像と参照画像との差異を示す評価値が求められる。評価値としては、例えば、両画像が重なる領域における画素の値の(符号付きの)差の絶対値の和が求められる。そして、評価値が最小となる位置における両画像の画素の値の符号付き差分を示す画像が生成される。符号付き差分画像は、2値化部575により所定の値にて2値化され、第4欠陥候補領域を示す第4欠陥候補画像が生成される。 Subsequently, the shaking comparison unit 574 performs the shaking comparison processing using the preprocessed captured image and the reference image, and the binarization unit 575 performs the binarization processing on the shake comparison processed image. By doing so, a fourth defect candidate image is generated. In the shaking comparison unit 574, an evaluation value indicating the difference between the captured image and the reference image is obtained while moving the reference image from the prealigned position little by little up, down, left and right. As the evaluation value, for example, the sum of the absolute values of the (signed) differences of the pixel values in the region where the two images overlap is obtained. Then, an image showing the signed difference between the pixel values of both images at the position where the evaluation value is the minimum is generated. The signed difference image is binarized at a predetermined value by the binarization unit 575, and a fourth defect candidate image showing the fourth defect candidate region is generated.

実際には、処理を簡素化するために、符号付き差分画像は求められない。具体的には、撮像画像の各画素の値から参照画像の対応する画素の値が減算され、値が負の場合に0とすることにより、差分画像の画素の値が求められる。予め正の値が準備されており、差分画像において当該正の値以上の値を有する画素により構成される領域が第4欠陥候補領域として取得される。 In practice, a signed difference image is not required to simplify the process. Specifically, the value of the pixel of the difference image is obtained by subtracting the value of the corresponding pixel of the reference image from the value of each pixel of the captured image and setting it to 0 when the value is negative. A positive value is prepared in advance, and a region composed of pixels having a value equal to or greater than the positive value in the difference image is acquired as a fourth defect candidate region.

一般的に表現すれば、撮像画像において参照画像よりも明度が高く、かつ、明度の差の絶対値が第4基準値以上である領域が第4欠陥候補領域として取得される。第4基準値は正の値である。さらに換言すれば、撮像画像において参照画像よりも明度が所定値以上高い領域が第4欠陥候補領域として取得される。画像がモノクロである場合は、画素値を明度と捉えてもよく、カラー画像の場合は、色成分毎の画素値に対して所定の演算を行うことにより求められる値が明度として扱われる。 Generally speaking, a region in the captured image having a higher brightness than the reference image and an absolute value of the difference in brightness of which is equal to or greater than the fourth reference value is acquired as the fourth defect candidate region. The fourth reference value is a positive value. In other words, in the captured image, a region having a brightness higher than the reference image by a predetermined value or more is acquired as the fourth defect candidate region. When the image is monochrome, the pixel value may be regarded as the brightness, and in the case of a color image, the value obtained by performing a predetermined calculation on the pixel value for each color component is treated as the brightness.

第4欠陥候補領域は、参照画像の各画素の値と撮像画像の対応する画素の値との比から求められてもよい。具体的には、撮像画像の各画素の値を参照画像の対応する画素の値で除算することにより、比画像の画素の値が求められる。予め1よりも大きい第4基準値が準備されており、比画像において第4基準値以上の値を有する画素により構成される領域が第4欠陥候補領域として取得される。もちろん、参照画像の各画素の値を撮像画像の対応する画素の値で除算することにより、比画像の画素の値が求められてもよい。この場合、比画像において1よりも小さい第4基準値以下の値を有する画素により構成される領域が第4欠陥候補領域として取得される。 The fourth defect candidate region may be obtained from the ratio of the value of each pixel of the reference image to the value of the corresponding pixel of the captured image. Specifically, the value of the pixel of the ratio image is obtained by dividing the value of each pixel of the captured image by the value of the corresponding pixel of the reference image. A fourth reference value larger than 1 is prepared in advance, and a region composed of pixels having a value equal to or higher than the fourth reference value in the ratio image is acquired as the fourth defect candidate region. Of course, the value of the pixel of the ratio image may be obtained by dividing the value of each pixel of the reference image by the value of the corresponding pixel of the captured image. In this case, a region composed of pixels having a value equal to or less than the fourth reference value smaller than 1 in the ratio image is acquired as the fourth defect candidate region.

第4基準値は定数でなくてもよい。第4基準値は参照画像および/または撮像画像の明度または画素値の関数でもよい。第4基準値は、参照画像および撮像画像の明度または画素値の差および比を用いて定められてもよく、さらに他の演算が利用されてもよい。 The fourth reference value does not have to be a constant. The fourth reference value may be a function of the brightness or pixel value of the reference image and / or the captured image. The fourth reference value may be determined using the difference and ratio of the brightness or pixel value of the reference image and the captured image, and other calculations may be used.

図22は、第4欠陥候補取得工程S152における処理の内容を示す画像例である。入力される撮像画像811および参照画像812は、図21にて例示した画像と同様である。ゆすらせ比較部574によるゆすらせ比較処理および2値化部575による2値化処理が実行された結果、生成される第4欠陥候補画像を第4欠陥候補画像824として例示する。 FIG. 22 is an image example showing the content of the process in the fourth defect candidate acquisition step S152. The input captured image 811 and reference image 812 are the same as the images illustrated in FIG. The fourth defect candidate image generated as a result of executing the shaking comparison processing by the shaking comparison unit 574 and the binarization processing by the binarization unit 575 is exemplified as the fourth defect candidate image 824.

第4欠陥候補画像824では、ゆすらせ比較処理によって撮像画像811のうち参照画像812と比べて明るい領域が第4欠陥候補領域721jとして抽出されている。 In the fourth defect candidate image 824, a region of the captured image 811 that is brighter than the reference image 812 is extracted as the fourth defect candidate region 721j by the shaking comparison process.

図1を参照する。ゆすらせ比較処理および2値化処理によって第4欠陥候補領域721jが取得されると、面積フィルタ部576により、面積が予め定められた値よりも小さい第4欠陥候補領域が削除され、残りの第4欠陥候補領域を示す画像が最終的な第4欠陥候補画像(正確には、第4欠陥候補領域を示す画像データである第4欠陥候補データ924)として取得される。 Referring to FIG. 1 1. When the fourth defect candidate region 721j is acquired by the shaking comparison processing and the binarization processing, the area filter unit 576 deletes the fourth defect candidate region whose area is smaller than the predetermined value, and the remaining third defect candidate region is deleted. The image showing the four defect candidate areas is acquired as the final fourth defect candidate image (more accurately, the fourth defect candidate data 924 which is the image data showing the fourth defect candidate area).

撮像部3にて取得された複数の撮像画像は、処理対象として順次選択され、撮像画像の数に等しい数の第4欠陥候補データ924が取得される。 The plurality of captured images acquired by the imaging unit 3 are sequentially selected as processing targets, and a number of fourth defect candidate data 924 equal to the number of captured images is acquired.

図15を参照する。第2欠陥候補データ922および第4欠陥候補データ924が取得されると、次に欠陥候補限定工程S153が実行され、第2欠陥候補データ922および第4欠陥候補データ924に基づいて、第2欠陥データ932が取得される。 See FIG. When the second defect candidate data 922 and the fourth defect candidate data 924 are acquired, the defect candidate limiting step S153 is then executed, and the second defect is executed based on the second defect candidate data 922 and the fourth defect candidate data 924. Data 932 is acquired.

図12に示すように、欠陥候補限定工程S153が開始されると、第2欠陥候補データ922および第4欠陥候補データ924が、論理積演算部592、593に入力される。入力される第2欠陥候補データ922および第4欠陥候補データ924と、論理積演算部592、593との関係(すなわち、撮像部と照明条件の関係)は、欠陥候補限定工程S143における関係と同様であるため、説明を省略する。 As shown in FIG. 12, when the defect candidate limiting step S153 is started, the second defect candidate data 922 and the fourth defect candidate data 924 are input to the logical product calculation units 592 and 593. The relationship between the input second defect candidate data 922 and the fourth defect candidate data 924 and the logical product calculation units 592 and 593 (that is, the relationship between the imaging unit and the lighting conditions) is the same as the relationship in the defect candidate limiting step S143. Therefore, the description thereof will be omitted.

領域選択部594には、第2欠陥候補データ922と第4欠陥候補データ924との各組み合わせから得られる論理積画像のデータが入力される。 The logical product image data obtained from each combination of the second defect candidate data 922 and the fourth defect candidate data 924 is input to the area selection unit 594.

図23は、図21の第2欠陥候補領域721hと図22の第4欠陥候補領域721jとから生成される第2欠陥領域732を示す第2欠陥画像832を例示する図である。 FIG. 23 is a diagram illustrating a second defect image 832 showing a second defect region 732 generated from the second defect candidate region 721h of FIG. 21 and the fourth defect candidate region 721j of FIG. 22.

欠陥候補除外工程S1513では、第2欠陥候補画像822と第4欠陥候補画像824との論理積画像を求めることにより、信頼性を向上した第2欠陥領域732を示す第2欠陥画像832を得ることができる。 In the defect candidate exclusion step S1513, a second defect image 832 showing the second defect region 732 with improved reliability is obtained by obtaining a logical product image of the second defect candidate image 822 and the fourth defect candidate image 824. Can be done.

領域選択部594では、複数の第2欠陥画像832を重ねた場合に、所定数以上の第2欠陥領域が重なる領域を、第2欠陥領域として維持し、所定数未満の領域を第2欠陥領域から除外する。ここで、「重なる領域」は、重なる複数の領域の論理和であってもよく、論理積であってもよい。本実施の形態では重なる領域の数が2以上の場合に第2欠陥領域として維持する。領域選択部594により、第2欠陥領域732を示す複数の第2欠陥画像832から、限定された第2欠陥領域を示す1つの第2欠陥画像が取得され、これに対応する第2欠陥データ932が領域選択部594から出力される。これにより、複数の照明状態にて取得された複数の撮像画像から、対応する参照画像を参照しつつ参照画像に対して明るい領域が第2欠陥領域として抽出される。 In the area selection unit 594, when a plurality of second defect images 832 are overlapped, the area where a predetermined number or more of the second defect areas overlap is maintained as the second defect area, and the area less than the predetermined number is the second defect area. Exclude from. Here, the "overlapping region" may be a logical sum of a plurality of overlapping regions, or may be a logical product. In the present embodiment, when the number of overlapping regions is 2 or more, it is maintained as a second defect region. The region selection unit 594 acquires one second defect image showing a limited second defect region from a plurality of second defect images 832 showing the second defect region 732, and the corresponding second defect data 932. Is output from the area selection unit 594. As a result, a region brighter than the reference image is extracted as the second defect region from the plurality of captured images acquired under the plurality of illumination states while referring to the corresponding reference image.

領域選択部594から出力された第2欠陥データ932は、欠陥取得部52から記憶部53へ出力されて、記憶部53にて記憶される。 The second defect data 932 output from the area selection unit 594 is output from the defect acquisition unit 52 to the storage unit 53 and stored in the storage unit 53.

以上により、撮像画像における第2欠陥の存在を取得する第2欠陥取得工程S15が終了する。 As a result, the second defect acquisition step S15 for acquiring the presence of the second defect in the captured image is completed.

以上の処理により、1つの撮像部3から見た対象領域70において、欠陥が存在する場合の欠陥の位置が検出される。 By the above processing, the position of the defect when the defect is present is detected in the target area 70 as seen from one imaging unit 3.

コンピュータ12の表示部には、1つの撮像画像が表示され、対象領域70上に、第1欠陥領域および第2欠陥領域がそれぞれ異なる色が付いた領域として併せて表示される。なお、本願発明の実施に関してはこれに限られず、表示部において第1欠陥領域および第2欠陥領域のいずれか一方を表示し、ユーザの入力に基づいて他方を表示できるよう切り替え可能に表示されても良い。 One captured image is displayed on the display unit of the computer 12, and the first defect region and the second defect region are displayed together as regions with different colors on the target region 70. The implementation of the present invention is not limited to this, and one of the first defect area and the second defect area is displayed on the display unit, and the other is displayed so as to be switchable based on the input of the user. Is also good.

1つの撮像部3により取得される撮像画像の最小数は2であるが、好ましくは3以上である。すなわち、光照射部4は互いに異なる3以上の照明状態とすることができ、例えば、対象物9に3以上の方向から光を照射することができ、撮像制御部51の制御により、3以上の照明状態の間に撮像部3が画像を取得する。好ましい照明状態が既知の場合は、その情報に基づいて取得された3以上の撮像画像の少なくとも1つが処理対象の撮像画像として選択されてもよい。3以上の撮像画像を準備することにより、より適切な欠陥検出を容易に行うことができる。 The minimum number of captured images acquired by one imaging unit 3 is 2, but preferably 3 or more. That is, the light irradiation unit 4 can be in three or more different illumination states, for example, the object 9 can be irradiated with light from three or more directions, and three or more can be controlled by the image pickup control unit 51. The imaging unit 3 acquires an image during the illumination state. When a preferable lighting state is known, at least one of three or more captured images acquired based on the information may be selected as the captured image to be processed. By preparing three or more captured images, more appropriate defect detection can be easily performed.

一般的には、上記説明における第1欠陥候補および第2欠陥候補は「欠陥候補」と表現することができ、第1欠陥候補領域および第2欠陥候補領域は「欠陥候補領域」と表現することができ、第1マスク領域および第2マスク領域は「マスク領域」と表現することができ、第1欠陥候補画像および第2欠陥候補画像は「欠陥候補画像」と表現することができる。 In general, the first defect candidate and the second defect candidate in the above description can be expressed as "defect candidate", and the first defect candidate area and the second defect candidate area are expressed as "defect candidate area". The first mask area and the second mask area can be expressed as a "mask area", and the first defect candidate image and the second defect candidate image can be expressed as a "defect candidate image".

上記欠陥検出装置1では様々な変形が可能である。 The defect detection device 1 can be modified in various ways.

光源部4a,4b,4cおよび撮像部3の配置および数は適宜変更されてよい。光照射部4による照明状態は様々に変更されてよい。複数の光源部のうち2つずつが点灯されてもよいし、3つずつが点灯されてもよい。光照射部4では光源部が移動することにより状明状態が変更されてもよい。 The arrangement and number of the light source units 4a, 4b, 4c and the imaging unit 3 may be changed as appropriate. The illumination state by the light irradiation unit 4 may be changed in various ways. Two of the plurality of light source units may be lit, or three may be lit. In the light irradiation unit 4, the state of state may be changed by moving the light source unit.

また、欠陥検出方法において、第1欠陥取得工程S14における第3欠陥候補取得工程S142および欠陥候補限定工程S143を省略し、第1欠陥候補取得工程S141にて取得された第1欠陥候補領域を第1欠陥領域として取得してもよい。この場合においても、第1欠陥候補取得工程S141において第1欠陥候補領域のうち、第1マスク領域と所定条件以上重なるものを、第1欠陥候補から除外したうえで、第1欠陥候補領域に基づいて撮像画像における欠陥の存在を取得するため、過検出を抑制することができる。 Further, in the defect detection method, the third defect candidate acquisition step S142 and the defect candidate limiting step S143 in the first defect acquisition step S14 are omitted, and the first defect candidate region acquired in the first defect candidate acquisition step S141 is used. It may be acquired as one defect area. Also in this case, in the first defect candidate acquisition step S141, among the first defect candidate regions, those that overlap the first mask region by a predetermined condition or more are excluded from the first defect candidates, and are based on the first defect candidate region. Since the presence of defects in the captured image is acquired, over-detection can be suppressed.

同様に、第2欠陥取得工程S15における第4欠陥候補取得工程S152および欠陥候補限定工程S153を省略し、第2欠陥候補取得工程S151にて取得された第2欠陥候補領域を第2欠陥領域として取得してもよい。この場合においても、第2欠陥候補取得工程S151において第2欠陥候補領域のうち、第2マスク領域と所定条件以上重なるものを、第2欠陥候補から除外したうえで、第2欠陥候補領域に基づいて撮像画像における欠陥の存在を取得するため、過検出を抑制することができる。 Similarly, the fourth defect candidate acquisition step S152 and the defect candidate limiting step S153 in the second defect acquisition step S15 are omitted, and the second defect candidate region acquired in the second defect candidate acquisition step S151 is used as the second defect region. You may get it. Also in this case, in the second defect candidate acquisition step S151, among the second defect candidate regions, those that overlap the second mask region by a predetermined condition or more are excluded from the second defect candidates, and are based on the second defect candidate region. Since the presence of defects in the captured image is acquired, over-detection can be suppressed.

この場合において、欠陥検出装置1は、特に第3欠陥候補取得部551、第4欠陥候補取得部571、欠陥候補限定部581および591を設けず、第1欠陥候補取得部541が出力する第1欠陥候補データ921を第1欠陥データ931として取得してもよいし、第2欠陥候補取得部561が出力する第2欠陥候補データ922を第2欠陥データ932として取得してもよい。 In this case, the defect detection device 1 does not particularly provide the third defect candidate acquisition unit 551, the fourth defect candidate acquisition unit 571, the defect candidate limiting unit 581 and 591, and the first defect candidate acquisition unit 541 outputs the first defect candidate unit 541. The defect candidate data 921 may be acquired as the first defect data 931, or the second defect candidate data 922 output by the second defect candidate acquisition unit 561 may be acquired as the second defect data 932.

コンピュータ12は、専用のハードウェアであってもよく、部分的に専用のハードウェアが用いられてもよい。高速に外観検査を行う場合は、コンピュータや専用のハードウェアによる並列処理が行われることが好ましい。 The computer 12 may be dedicated hardware, or partially dedicated hardware may be used. When performing visual inspection at high speed, it is preferable that parallel processing is performed by a computer or dedicated hardware.

実質的に同じ処理が行われるのであれば、処理順序は適宜変更可能である。上記実施の形態にて説明した処理順序は一例にすぎない。 If substantially the same processing is performed, the processing order can be changed as appropriate. The processing sequence described in the above embodiment is only an example.

欠陥検出装置1は、パターンが形成される各種基板やフィルム等、他の対象物の表面における欠陥の検出に利用されてよい。欠陥検出装置1は、梨地状の領域(金属の表面には限定されない。)を表面に有することにより過検出が生じやすい対象物の検査に特に適している。 The defect detection device 1 may be used for detecting defects on the surface of other objects such as various substrates and films on which patterns are formed. The defect detection device 1 is particularly suitable for inspecting an object in which over-detection is likely to occur due to having a satin-like region (not limited to a metal surface) on the surface.

上記実施の形態および各変形例における構成は、相互に矛盾しない限り適宜組み合わされてよい。 The above-described embodiments and configurations in the respective modifications may be appropriately combined as long as they do not conflict with each other.

1 欠陥検出装置
2 保持部
3 撮像部(3a 上方撮像部、3b 斜方撮像部、3c 側方撮像部)
4 光照射部(4a 上方光源部、4b 斜方光源部、4c 側方光源部)
8 記録媒体
9 対象物
11 本体
12 コンピュータ
51 撮像制御部
52 欠陥取得部
53 記憶部
70 対象領域
80 プログラム
124 固定ディスク
125 ディスプレイ
126 入力部(126a キーボード、126b マウス)
127 読取装置
128 通信部
521 第1欠陥取得部
522 第2欠陥取得部
541 第1欠陥候補取得部
544 膨張処理部
545 収縮処理部
546 比較部
551 第3欠陥候補取得部
554 比較部
561 第2欠陥候補取得部
564 収縮処理部
565 膨張処理部
566 比較部
571 第4欠陥候補取得部
574 比較部
581 欠陥候補限定部
582,583 論理積演算部
584 領域選択部
591 欠陥候補限定部
592,593 論理積演算部
711 第1欠陥
721 第2欠陥
S12 撮像工程
S14 第1欠陥取得工程
S141 第1欠陥候補取得工程
S1411 第1欠陥候補領域検出工程
S1412 第1マスク領域検出工程
S1413 欠陥候補除外工程
S142 第3欠陥候補取得工程
S143 欠陥候補限定工程
S15 第2欠陥取得工程
S151 第2欠陥候補取得工程
S1511 第2欠陥候補領域検出工程
S1512 第2マスク領域検出工程
S1513 欠陥候補除外工程
S152 第3欠陥候補取得工程
S153 欠陥候補限定工程
S203、S213、S304、S314 膨張処理工程
S204、S214、S303、S313 収縮処理工程
S205、S215、S305、S315 比較処理工程
1 Defect detection device 2 Holding unit 3 Imaging unit (3a Upper imaging unit, 3b Orthorhombic imaging unit, 3c Side imaging unit)
4 Light irradiation unit (4a upper light source unit, 4b oblique light source unit, 4c side light source unit)
8 Recording medium 9 Object 11 Main unit 12 Computer 51 Imaging control unit 52 Defect acquisition unit 53 Storage unit 70 Target area 80 Program 124 Fixed disk 125 Display 126 Input unit (126a keyboard, 126b mouse)
127 Reader 128 Communication unit 521 First defect acquisition unit 522 Second defect acquisition unit 541 First defect candidate acquisition unit 544 Expansion processing unit 545 Shrinkage processing unit 546 Comparison unit 551 Third defect candidate acquisition unit 554 Comparison unit 561 Second defect Candidate acquisition unit 564 Shrinkage processing unit 565 Expansion processing unit 566 Comparison unit 571 Fourth defect candidate acquisition unit 574 Comparison unit 581 Defect candidate limiting unit 582,583 Logical product calculation unit 584 Area selection unit 591 Defect candidate limiting unit 592,593 Logical product Calculation unit 711 First defect 721 Second defect S12 Imaging process S14 First defect acquisition process S141 First defect candidate acquisition process S14111 First defect candidate area detection process S1412 First mask area detection process S1413 Defect candidate exclusion process S142 Third defect Candidate acquisition process S143 Defect candidate limiting process S15 Second defect acquisition process S151 Second defect candidate acquisition process S1511 Second defect candidate area detection process S1512 Second mask area detection process S1513 Defect candidate exclusion process S152 Third defect candidate acquisition process S153 Defects Candidate limited process S203, S213, S304, S314 Expansion process S204, S214, S303, S313 Shrinkage process S205, S215, S305, S315 Comparison process

Claims (4)

対象物の表面の欠陥を検出する欠陥検出装置であって、
対象物を撮像して撮像画像を取得する撮像部と、
前記撮像画像に対応する参照画像を記憶する記憶部と、
前記撮像画像の各画素の値と、前記撮像画像に対し、最大値フィルタを用いる膨張処理および最小値フィルタを用いる収縮処理のうち一方処理を施し、さらに膨張処理および収縮処理のうち前記一方処理とは異なる他方処理を施して得られる画像の前記撮像画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、欠陥候補領域を検出し、前記参照画像の各画素の値と、前記参照画像に対し、前記一方処理を施し、さらに前記他方処理を施して得られる画像の前記参照画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、マスク領域を検出し、前記欠陥候補領域のうち、前記マスク領域と重なる領域を、欠陥候補から除外し、前記欠陥候補領域と前記マスク領域とを重ねる際の位置合わせよりも正確に前記撮像画像と前記参照画像との位置合わせを行った後に、前記一方処理が膨張処理である場合には、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が暗い領域を他の欠陥候補領域として取得し、前記一方処理が収縮処理である場合には、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が明るい領域を他の欠陥候補領域として取得し、前記欠陥候補領域と前記他の欠陥候補領域とが重なる領域を、新たな欠陥候補領域として取得したうえで、前記新たな欠陥候補領域に基づいて前記撮像画像における欠陥の存在を取得する欠陥取得部と、
を備える、欠陥検出装置。
A defect detection device that detects defects on the surface of an object.
An imaging unit that captures an object and acquires an captured image,
A storage unit that stores a reference image corresponding to the captured image,
The value of each pixel of the captured image and one of the expansion treatment using the maximum value filter and the shrinkage treatment using the minimum value filter are performed on the captured image, and further, the one-sided treatment of the expansion treatment and the shrinkage treatment is performed. Detects a defect candidate region based on at least one of the difference or ratio between the value of the pixel corresponding to the captured image of the image obtained by performing different other processing, and the value of each pixel of the reference image. The mask region is detected based on at least one of the difference or the ratio of the reference image to the pixel value corresponding to the reference image of the image obtained by subjecting the one-sided processing to the other-processing. , Of the defect candidate regions, the region that overlaps with the mask region is excluded from the defect candidates, and the captured image and the reference image are more accurately aligned than when the defect candidate region and the mask region are overlapped. After the alignment is performed, when the one-sided processing is the expansion processing, the region where the captured image is darker than the reference image is set as another defect candidate based on the difference image or the ratio image of these images. When the region is acquired as a region and the one-sided processing is a contraction processing, a region in which the captured image is brighter than the reference image is used as another defect candidate region based on the difference image or the ratio image of these images. The region where the defect candidate region and the other defect candidate region overlap is acquired as a new defect candidate region, and then the presence of a defect in the captured image is acquired based on the new defect candidate region. Defect acquisition department and
A defect detection device.
請求項1に記載の欠陥検出装置であって、
欠陥取得部は、前記撮像画像における第1欠陥および当該第1欠陥とは異なる第2欠陥の存在を取得し、
前記撮像画像の各画素の値と、前記撮像画像に対し、膨張処理を施した後に収縮処理を施して得られる画像の前記撮像画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、第1欠陥候補領域を検出し、前記参照画像の各画素の値と、前記参照画像に対し、膨張処理を施した後に収縮処理を施して得られる画像の前記参照画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、第1マスク領域を検出し、前記第1欠陥候補領域のうち、前記第1マスク領域と重なる領域を、第1欠陥候補から除外し、前記第1欠陥候補領域と前記第1マスク領域とを重ねる際の位置合わせよりも正確に前記撮像画像と前記参照画像との位置合わせを行った後に、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が暗い領域を第3欠陥候補領域として取得し、前記第1欠陥候補領域と前記第3欠陥候補領域とが重なる領域を、新たな第1欠陥候補領域として取得したうえで、前記新たな第1欠陥候補領域に基づいて前記撮像画像における第1欠陥の存在を取得する第1欠陥取得部と、
前記撮像画像の各画素の値と、前記撮像画像に対し、収縮処理を施した後に膨張処理を施して得られる画像の前記撮像画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、第2欠陥候補領域を検出し、前記参照画像の各画素の値と、前記参照画像に対し、収縮処理を施した後に膨張処理を施して得られる画像の前記参照画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、第2マスク領域を検出し、前記第2欠陥候補領域のうち、前記第2マスク領域と重なる領域を、第2欠陥候補から除外し、前記第2欠陥候補領域と前記第2マスク領域とを重ねる際の位置合わせよりも正確に前記撮像画像と前記参照画像との位置合わせを行った後に、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が明るい領域を第4欠陥候補領域として取得し、前記第2欠陥候補領域と前記第4欠陥候補領域とが重なる領域を、新たな第2欠陥候補領域として取得したうえで、前記新たな第2欠陥候補領域に基づいて前記撮像画像における第2欠陥の存在を取得する第2欠陥取得部と、
を有することを特徴とする、欠陥検出装置。
The defect detection device according to claim 1.
The defect acquisition unit acquires the existence of the first defect in the captured image and the second defect different from the first defect.
At least one of the difference or ratio between the value of each pixel of the captured image and the value of the pixel corresponding to the captured image of the image obtained by subjecting the captured image to expansion processing and then contraction processing. Based on this, the first defect candidate region is detected, and the value of each pixel of the reference image and the pixel corresponding to the reference image of the image obtained by subjecting the reference image to expansion processing and then contraction processing. The first mask region is detected based on at least one of the difference or the ratio with the value of, and the region of the first defect candidate region that overlaps with the first mask region is excluded from the first defect candidate. After aligning the captured image and the reference image more accurately than the alignment when the first defect candidate region and the first mask region are overlapped, the difference image or the ratio image of these images is used. The region where the captured image is darker than the reference image is acquired as the third defect candidate region, and the region where the first defect candidate region and the third defect candidate region overlap is a new first defect candidate. A first defect acquisition unit that acquires the presence of the first defect in the captured image based on the new first defect candidate region after acquiring the region.
At least one of the difference or ratio between the value of each pixel of the captured image and the value of the pixel corresponding to the captured image of the image obtained by subjecting the captured image to the contraction process and then the expansion process. Based on this, the second defect candidate region is detected, and the value of each pixel of the reference image and the pixel corresponding to the reference image of the image obtained by subjecting the reference image to shrinkage processing and then expansion processing. The second mask region is detected based on at least one of the difference or the ratio with the value of, and the region of the second defect candidate region that overlaps with the second mask region is excluded from the second defect candidate. After aligning the captured image and the reference image more accurately than the alignment when the second defect candidate region and the second mask region are overlapped, the difference image or the ratio image of these images is used. The region where the captured image is brighter than the reference image is acquired as the fourth defect candidate region, and the region where the second defect candidate region and the fourth defect candidate region overlap is a new second defect candidate. A second defect acquisition unit that acquires the presence of the second defect in the captured image based on the new second defect candidate region after acquiring the region.
A defect detection device, characterized in that it has.
対象物の表面の欠陥を検出する欠陥検出方法であって、
a)撮像部にて対象物を撮像して撮像画像を取得する撮像工程と、
b)前記撮像画像の各画素の値と、前記撮像画像に対し、最大値フィルタを用いる膨張処理および最小値フィルタを用いる収縮処理のうち一方処理を施し、さらに膨張処理および収縮処理のうち前記一方処理とは異なる他方処理を施して得られる画像の前記撮像画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、欠陥候補領域を検出する欠陥候補領域検出工程と、
c)前記撮像画像に対応する参照画像が準備されており、前記参照画像の各画素の値と、前記参照画像に対し、前記一方処理を施し、さらに前記他方処理を施して得られる画像の前記参照画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、マスク領域を検出するマスク領域検出工程と、
d)前記欠陥候補領域のうち、前記マスク領域と重なる領域を、欠陥候補から除外する欠陥候補除外工程と、
e)前記欠陥候補領域と前記マスク領域とを重ねる際の位置合わせよりも正確に前記撮像画像と前記参照画像との位置合わせを行った後に、前記一方処理が膨張処理である場合には、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が暗い領域を他の欠陥候補領域として取得し、前記一方処理が収縮処理である場合には、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が明るい領域を他の欠陥候補領域として取得し、前記欠陥候補領域と前記他の欠陥候補領域とが重なる領域を、新たな欠陥候補領域として取得したうえで、前記新たな欠陥候補領域に基づいて前記撮像画像における欠陥の存在を取得する欠陥取得工程と、
を備える、欠陥検出方法。
A defect detection method that detects defects on the surface of an object.
a) An imaging process in which an object is imaged by an imaging unit to acquire an captured image,
b) The value of each pixel of the captured image and one of the expansion treatment using the maximum value filter and the shrinkage treatment using the minimum value filter are performed on the captured image, and one of the expansion treatment and the shrinkage treatment is further performed. A defect candidate region detection step of detecting a defect candidate region based on at least one of a difference or a ratio between the pixel values corresponding to the captured image of the image obtained by performing the other processing different from the processing.
c) A reference image corresponding to the captured image is prepared, and the value of each pixel of the reference image and the reference image are subjected to the one-sided processing and then the other-processed image. A mask area detection step that detects a mask area based on at least one of the differences or ratios of the pixel values corresponding to the reference image.
d) A defect candidate exclusion step of excluding the region overlapping the mask region from the defect candidates among the defect candidate regions.
e) After aligning the captured image and the reference image more accurately than the alignment when the defect candidate region and the mask region are overlapped, if the one-sided processing is an expansion processing, these When the captured image is darker than the reference image as another defect candidate region based on the difference image or the ratio image of the image, and the one-sided processing is the shrinkage processing, these images A region in which the captured image is brighter than the reference image is acquired as another defect candidate region based on the difference image or the ratio image of the above, and a region in which the defect candidate region and the other defect candidate region overlap is obtained. A defect acquisition step of acquiring the presence of a defect in the captured image based on the new defect candidate region after acquiring it as a new defect candidate region.
A defect detection method.
コンピュータに、対象物の表面の対象領域の複数の画像から前記対象領域における欠陥を検出させるプログラムであって、前記プログラムの前記コンピュータによる実行は、前記コンピュータに、
a)前記対象領域を撮像して取得される撮像画像および対応する参照画像を準備する工程と、
b)前記撮像画像の各画素の値と、前記撮像画像に対し、最大値フィルタを用いる膨張処理および最小値フィルタを用いる収縮処理のうち一方処理を施し、さらに膨張処理および収縮処理のうち前記一方処理とは異なる他方処理を施して得られる画像の前記撮像画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、欠陥候補領域を検出する欠陥候補領域検出工程と、
c)前記撮像画像に対応する参照画像が準備されており、前記参照画像の各画素の値と、前記参照画像に対し、前記一方処理を施し、さらに前記他方処理を施して得られる画像の前記参照画像に対応する画素の値と、の差または比の少なくとも一方に基づいて、マスク領域を検出するマスク領域検出工程と、
d)前記欠陥候補領域のうち、前記マスク領域と重なる領域を、欠陥候補から除外する欠陥候補除外工程と、
e)前記欠陥候補領域と前記マスク領域とを重ねる際の位置合わせよりも正確に前記撮像画像と前記参照画像との位置合わせを行った後に、前記一方処理が膨張処理である場合には、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が暗い領域を他の欠陥候補領域として取得し、前記一方処理が収縮処理である場合には、これらの画像の差分画像または比画像に基づいて前記参照画像に対して前記撮像画像の方が明るい領域を他の欠陥候補領域として取得し、前記欠陥候補領域と前記他の欠陥候補領域とが重なる領域を、新たな欠陥候補領域として取得したうえで、前記新たな欠陥候補領域に基づいて前記撮像画像における欠陥の存在を取得する欠陥取得工程と、
を実行させる、ことを特徴とするプログラム。
A program that causes a computer to detect defects in the target area from a plurality of images of the target area on the surface of the object, and execution of the program by the computer causes the computer to execute the program.
a) A step of preparing an captured image and a corresponding reference image obtained by imaging the target area, and
b) The value of each pixel of the captured image and one of the expansion treatment using the maximum value filter and the shrinkage treatment using the minimum value filter are performed on the captured image, and one of the expansion treatment and the shrinkage treatment is further performed. A defect candidate region detection step of detecting a defect candidate region based on at least one of a difference or a ratio between the pixel values corresponding to the captured image of the image obtained by performing the other processing different from the processing.
c) A reference image corresponding to the captured image is prepared, and the value of each pixel of the reference image and the reference image are subjected to the one-sided processing and then the other-processed image. A mask area detection step that detects a mask area based on at least one of the differences or ratios of the pixel values corresponding to the reference image.
d) A defect candidate exclusion step of excluding the region overlapping the mask region from the defect candidates among the defect candidate regions.
e) After aligning the captured image and the reference image more accurately than the alignment when the defect candidate region and the mask region are overlapped, if the one-sided processing is an expansion processing, these When the captured image is darker than the reference image as another defect candidate region based on the difference image or the ratio image of the image, and the one-sided processing is the shrinkage processing, these images A region in which the captured image is brighter than the reference image is acquired as another defect candidate region based on the difference image or the ratio image of the above, and a region in which the defect candidate region and the other defect candidate region overlap is obtained. A defect acquisition step of acquiring the presence of a defect in the captured image based on the new defect candidate region after acquiring it as a new defect candidate region.
A program characterized by executing.
JP2016052075A 2016-02-19 2016-03-16 Defect detector, defect detection method and program Active JP6812118B2 (en)

Priority Applications (6)

Application Number Priority Date Filing Date Title
JP2016052075A JP6812118B2 (en) 2016-03-16 2016-03-16 Defect detector, defect detection method and program
EP17752875.9A EP3418726A4 (en) 2016-02-19 2017-01-18 Defect detection apparatus, defect detection method, and program
PCT/JP2017/001604 WO2017141611A1 (en) 2016-02-19 2017-01-18 Defect detection apparatus, defect detection method, and program
US15/998,664 US11216936B2 (en) 2016-02-19 2017-01-18 Defect detection device, defect detection method, and program
TW106103793A TWI626440B (en) 2016-02-19 2017-02-06 Defect detection apparatus, defect detection method and program product
US17/536,290 US20220084183A1 (en) 2016-02-19 2021-11-29 Defect detection device, defect detection method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016052075A JP6812118B2 (en) 2016-03-16 2016-03-16 Defect detector, defect detection method and program

Publications (2)

Publication Number Publication Date
JP2017166957A JP2017166957A (en) 2017-09-21
JP6812118B2 true JP6812118B2 (en) 2021-01-13

Family

ID=59913328

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016052075A Active JP6812118B2 (en) 2016-02-19 2016-03-16 Defect detector, defect detection method and program

Country Status (1)

Country Link
JP (1) JP6812118B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6811540B2 (en) * 2016-03-16 2021-01-13 株式会社Screenホールディングス Defect detector, defect detection method and program
KR102450130B1 (en) * 2019-07-02 2022-10-04 주식회사 마키나락스 Systems and methods for detecting flaws on panels using images of the panels
US11948292B2 (en) * 2019-07-02 2024-04-02 MakinaRocks Co., Ltd. Systems and methods for detecting flaws on panels using images of the panels
CN115690102B (en) * 2022-12-29 2023-04-18 摩尔线程智能科技(北京)有限责任公司 Defect detection method, defect detection apparatus, electronic device, storage medium, and program product

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012027810A (en) * 2010-07-27 2012-02-09 National Printing Bureau Functionality inspection device
JP6244981B2 (en) * 2014-02-28 2017-12-13 大日本印刷株式会社 Appearance inspection apparatus, appearance inspection method, and program
JP6811540B2 (en) * 2016-03-16 2021-01-13 株式会社Screenホールディングス Defect detector, defect detection method and program

Also Published As

Publication number Publication date
JP2017166957A (en) 2017-09-21

Similar Documents

Publication Publication Date Title
WO2017141611A1 (en) Defect detection apparatus, defect detection method, and program
EP3203217B1 (en) Inspection device and inspection method
TWI580951B (en) Inspection apparatus and inspection method
US10495581B2 (en) Defect detection device and defect detection method
JP6812118B2 (en) Defect detector, defect detection method and program
JP4279833B2 (en) Appearance inspection method and appearance inspection apparatus
JP6811540B2 (en) Defect detector, defect detection method and program
WO2018225460A1 (en) Inspecting device and inspecting method
JP6688629B2 (en) Defect detecting device, defect detecting method and program
JP4967132B2 (en) Defect inspection method for object surface

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20181221

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20191224

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200221

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20200221

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200806

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200930

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20201216

R150 Certificate of patent or registration of utility model

Ref document number: 6812118

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250