JPH0886633A - Surface defect inspecting device - Google Patents

Surface defect inspecting device

Info

Publication number
JPH0886633A
JPH0886633A JP22056894A JP22056894A JPH0886633A JP H0886633 A JPH0886633 A JP H0886633A JP 22056894 A JP22056894 A JP 22056894A JP 22056894 A JP22056894 A JP 22056894A JP H0886633 A JPH0886633 A JP H0886633A
Authority
JP
Japan
Prior art keywords
image
dark
area
inspected
light
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP22056894A
Other languages
Japanese (ja)
Other versions
JP3189588B2 (en
Inventor
Masanori Imanishi
正則 今西
Sachiyo Katabami
祥代 方波見
Kazunori Noso
千典 農宗
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.)
Nissan Motor Co Ltd
Original Assignee
Nissan Motor 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 Nissan Motor Co Ltd filed Critical Nissan Motor Co Ltd
Priority to JP22056894A priority Critical patent/JP3189588B2/en
Publication of JPH0886633A publication Critical patent/JPH0886633A/en
Application granted granted Critical
Publication of JP3189588B2 publication Critical patent/JP3189588B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8806Specially adapted optical and illumination features

Abstract

PURPOSE: To closely inspect an object to be inspected for surface defect by providing an image pickup means which converts a received light image into image data, bright- and-dark pattern discriminating means which discriminates the brightness and darkness of the image by processing the image data, bright-and-dark area processing means which enlarges obtained bright areas and dark areas, image emphasizing means, defect detecting means, etc. CONSTITUTION: A camera control unit 4 generates the image signal of a received light image picked up with a video camera 2 and outputs the image signal to an image processor 5. The processor 5 performs a bright-and-dark pattern discriminating process, image emphasizing process, image area process, and defect detecting process on the original image. In order to recognize stripes from the original image, low-frequency components are extracted from the original image and binarized as a threshold to the original image and the brightness and darkness of the stripes are separated and extracted. In the image emphasizing process, signals from which only defective components are removed by smoothing are subtracted from the original image signal so as to offset the low-frequency and stripe components. In the defect detecting process, the image-emphasized results and bright-and-dark pattern discriminated results are ANDed so that only defects can be surely detected.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】この発明は、被検査物体の表面欠
陥、例えば自動車ボディの塗装面の凹凸等のような表面
欠陥を検査する装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus for inspecting a surface defect of an object to be inspected, for example, a surface defect such as unevenness of a painted surface of an automobile body.

【0002】[0002]

【従来技術】従来の表面欠陥検査装置としては、例えば
特開平2−73139号公報や特開平5−45142〜
45144号公報などに示されたものがある。これら
は、被検査面に所定の明暗縞(ストライプ)模様を映し
出し、被検査面上に凹凸等の欠陥があった場合、それに
よる明度(輝度)差や明度(輝度)変化をもった受光画
像を微分することにより、被検査面の表面の欠陥を検出
するという方法を用いたものである。また、上記の従来
例には、被検査面に加工部位など欠陥でないものがあ
り、それが受光画像中にあった場合、欠陥での輝度レベ
ルと上記加工部位など欠陥でない個所での輝度レベルと
に差があることを利用し、欠陥とそれ以外の個所とを区
別する技術が記載されている。
2. Description of the Related Art As a conventional surface defect inspection apparatus, for example, JP-A-2-73139 and JP-A-5-45142 are available.
There is one disclosed in Japanese Patent No. 45144 and the like. These are light-receiving images that show a predetermined light and dark stripe (stripe) pattern on the surface to be inspected, and if there are defects such as irregularities on the surface to be inspected, the difference in lightness (luminance) and the change in lightness (luminance) due to the defect. Is used to detect defects on the surface of the surface to be inspected. Further, in the above-mentioned conventional example, there is something that is not a defect such as a processed portion on the surface to be inspected, and when it is in the received light image, the brightness level at the defect and the brightness level at a non-defective portion such as the processed area A technique for distinguishing a defect from other parts by utilizing the difference in

【0003】[0003]

【発明が解決しようとする課題】しかし、上記のごとき
従来の表面欠陥検査装置においては、次のごとき問題が
あった。例えば、自動車ボディの塗装において、通常、
表面欠陥と呼ばれるものは、ゴミ等が付着した上に塗装
が行なわれた結果生じる塗装表面の凸部であり、例えば
直径が0.5mm〜2mm程度で厚さが数十μm程度のもので
ある。この程度の凸部は直径が小さいのに高さ(厚さ)
が比較的大きいため、光の乱反射角が大きくなり、目に
つきやすい。
However, the conventional surface defect inspection apparatus as described above has the following problems. For example, in painting automobile bodies,
What is called a surface defect is a convex portion on the surface of the coating that is produced as a result of coating on which dust or the like has adhered, for example, a diameter of about 0.5 mm to 2 mm and a thickness of about several tens of μm. . The height (thickness) of this degree of protrusion is small, though the diameter is small.
Is relatively large, the angle of diffuse reflection of light is large, and it is easy to see.

【0004】これに対して欠陥とはならない凹凸も存在
する。すなわち、塗料溶剤の蒸発する過程において発生
する渦対流により、塗料の濃度が厳密には一定でなくな
るので、塗膜の厚さには極めて薄い(低い)凹凸が周期
的に発生する。この凹凸は、例えば山と山の間隔が1〜
10mm程度で、凹凸の高さが数μm程度である。このよ
うな極めて薄い凹凸は通常では気がつかない程度のもの
であり、欠陥とはならない。しかし、光の加減等では
“ゆず”やオレンジの表面のように見えることがあるの
で、いわゆる“ゆず肌”もしくは“オレンジ肌”と呼ば
れるものである。上記のごとき従来例においては、輝度
変化を強調して検出するため、上記の“ゆず肌”のよう
な欠陥とはならない極めて薄い凹凸も検出し、これを欠
陥と誤判断するおそれがある。
On the other hand, there are irregularities that do not become defects. That is, since the concentration of the paint is not strictly constant due to eddy convection that occurs in the process of evaporation of the paint solvent, extremely thin (low) unevenness is periodically generated in the thickness of the coating film. This unevenness has, for example, a mountain-to-mountain interval of 1 to
The height of the unevenness is about 10 μm, and the height of the unevenness is about several μm. Such extremely thin irregularities are usually not noticeable and do not become defects. However, since it may look like "Yuzu" or the surface of orange under the control of light, it is so-called "Yuzu skin" or "Orange skin". In the conventional example as described above, since the change in brightness is emphasized and detected, extremely thin unevenness that does not cause a defect such as the above-mentioned "discolored skin" is also detected, and this may be erroneously determined to be a defect.

【0005】例えば、前記の特開平2−73139号公
報においては、ストライプ模様の間隔が狭い(1.5mm
以下)照明を用いて欠陥検出処理を行なうため、被検査
面上に上記の“ゆず肌”などが形成されている場合に
は、ストライプ自身およびその境界(線)が大きく乱れ
るので、例えばストライプの黒い部分が孤立点となり、
画像上のストライプの幅が一定にならないときに誤検出
が発生しやすい。上記のように、従来技術においては、
いわゆる“ゆず肌”のような欠陥とならない極めて薄い
凹凸を欠陥と誤検出するおそれがある、という問題があ
った。
For example, in the above-mentioned Japanese Laid-Open Patent Publication No. 2-73139, the stripe pattern has a narrow interval (1.5 mm).
(Below) Since the defect detection processing is performed using illumination, the stripe itself and its boundary (line) are greatly disturbed when the above-mentioned "Yuzu skin" is formed on the surface to be inspected. The black part becomes an isolated point,
False detection is likely to occur when the stripe width on the image is not uniform. As mentioned above, in the prior art,
There is a problem in that extremely thin unevenness that does not cause a defect such as so-called “citrus skin” may be erroneously detected as a defect.

【0006】本発明は上記のごとき従来技術の問題を解
決するためになされたものであり、いわゆる“ゆず肌”
のような欠陥とならない極めて薄い凹凸を欠陥と誤検出
することなく、より精密な欠陥検出を行なうことの出来
る表面欠陥検査装置を提供することを目的とする。
The present invention has been made to solve the problems of the prior art as described above, and is what is called "Yuzu skin".
It is an object of the present invention to provide a surface defect inspection apparatus capable of performing more accurate defect detection without erroneously detecting an extremely thin unevenness that does not cause such a defect as a defect.

【0007】[0007]

【課題を解決するための手段】上記の目的を達成するた
め、本発明においては特許請求の範囲に記載するように
構成している。図1は、本発明のクレーム対応図であ
り、(a)は請求項1に相当するものである。図1
(a)において、100は被検査面であり、例えば塗装
面である。また、101は被検査面に所定の明暗パター
ンを映し出す照明手段であり、例えば後記図4に示す照
明装置である。また、102は被検査面を撮像して上記
明暗パターンを電気信号の画像データに変換する撮像手
段であり、例えばCCDカメラ等のビデオカメラであ
る。また、103は上記撮像手段によって得られた画像
データを処理して明部と暗部を識別する明暗模様識別手
段、104は上記明暗模様識別手段によって得られた暗
部分の領域を拡大する処理を行なう明暗領域処理手段、
105は上記画像データにおける周波数成分のうち高い
周波数成分で、かつレベルが所定値以上の成分のみを抽
出する画像強調手段、106は上記明暗領域処理手段に
おける明部分と上記画像強調手段で抽出した成分との両
方が存在する部分を欠陥として検出する欠陥検出手段で
あり、これら103〜106の部分は、例えばコンピュ
ータで構成される。上記の構成は、例えば後記図2〜図
26で説明する実施例に相当する。
In order to achieve the above object, the present invention is constructed as described in the claims. FIG. 1 is a diagram corresponding to the claims of the present invention, and (a) corresponds to claim 1. FIG.
In (a), 100 is a surface to be inspected, for example, a painted surface. Reference numeral 101 denotes an illuminating device that projects a predetermined bright and dark pattern on the surface to be inspected, and is, for example, an illuminating device shown in FIG. 4 described later. Reference numeral 102 denotes an image pickup means for picking up an image of the surface to be inspected and converting the light / dark pattern into image data of an electric signal, which is, for example, a video camera such as a CCD camera. Further, 103 is a light and dark pattern identifying means for processing the image data obtained by the image pickup means to identify a light portion and a dark portion, and 104 is processing for enlarging the area of the dark portion obtained by the light and dark pattern identifying means. Bright and dark area processing means,
Reference numeral 105 denotes an image enhancing means for extracting only a component having a high frequency component out of the frequency components in the image data and having a level equal to or higher than a predetermined value, and 106 denotes a bright portion in the bright and dark region processing means and a component extracted by the image enhancing means. This is a defect detection means for detecting a portion in which both of and exist as a defect, and these portions 103 to 106 are composed of, for example, a computer. The above-described configuration corresponds to, for example, the embodiment described with reference to FIGS.

【0008】また、請求項2に記載のように、上記明暗
領域処理手段は、被検査面の粗さに応じて予め定められ
た所定値だけ暗部分の領域を拡大するものである。或い
は、請求項3に記載のように、上記明暗領域処理手段
は、上記撮像手段で求めた画像データから得られる被検
査面の粗さに応じた値だけ暗部分の領域を拡大するもの
である。或いは、請求項4に記載のように、上記明暗領
域処理手段は、一旦、暗部分の領域を拡大した後、暗部
分の領域を縮小する処理を行なうものである。また、請
求項5に記載のように、上記画像強調手段は、上記撮像
手段によって得られた画像データの原画像と、原画像に
所定の平滑化処理を施した画像との差を求め、その結果
を所定のしきい値で2値化するものである。或いは、請
求項6に記載のように、上記画像強調手段は、上記撮像
手段によって得られた画像データの原画像を正規関数で
平滑化したのち2次微分した結果を所定のしきい値で2
値化するものである。或いは、請求項7に記載のよう
に、上記画像強調手段は、上記撮像手段によって得られ
た画像データの原画像に所定の最大値フィルタ処理を行
なったのち最小値フィルタ処理を行なった画像と、原画
像との差を求め、その結果を所定のしきい値で2値化す
るものである。なお、最大値フィルタ処理、最小値フィ
ルタ処理とは、詳細を後述するように、一種の平滑化処
理であり、最大値フィルタ処理とは注目画素を含む周辺
画素中の輝度の最大値を注目画素の新たな輝度値とする
ものであり、最小値フィルタ処理とは注目画素を含む周
辺画素中の輝度の最小値を注目画素の新たな輝度値とす
る処理である。
Further, as described in claim 2, the light and dark area processing means enlarges the area of the dark portion by a predetermined value determined in advance according to the roughness of the surface to be inspected. Alternatively, as described in claim 3, the light and dark area processing means enlarges the area of the dark portion by a value corresponding to the roughness of the surface to be inspected obtained from the image data obtained by the image pickup means. . Alternatively, as described in claim 4, the light / dark area processing means temporarily enlarges the area of the dark portion and then reduces the area of the dark portion. Further, as described in claim 5, the image enhancing unit obtains a difference between an original image of the image data obtained by the image capturing unit and an image obtained by performing a predetermined smoothing process on the original image, The result is binarized with a predetermined threshold value. Alternatively, as described in claim 6, the image emphasizing means smoothes the original image of the image data obtained by the imaging means with a normal function, and then second-order differentiates the result to be 2 with a predetermined threshold value.
It is to be valued. Alternatively, as described in claim 7, the image emphasizing means performs a predetermined maximum value filter processing on the original image of the image data obtained by the image capturing means, and then performs an minimum value filter processing, The difference from the original image is obtained, and the result is binarized with a predetermined threshold value. Note that the maximum value filtering process and the minimum value filtering process are a kind of smoothing process, as will be described later in detail, and the maximum value filtering process is the maximum value of the luminance in the peripheral pixels including the target pixel. And the minimum value filtering process is a process in which the minimum value of the brightness in the peripheral pixels including the target pixel is set as the new brightness value of the target pixel.

【0009】また、請求項8に記載のように、上記明暗
模様識別手段は、上記撮像手段によって得られた画像デ
ータの原画像に対して平滑化処理を行い、その結果をし
きい値として明部分と暗部分の2値化すなわち認識を行
なうものである。
Further, as described in claim 8, the light and dark pattern identifying means performs a smoothing process on the original image of the image data obtained by the image pickup means, and the result is used as a threshold value for lightening. Binarization, that is, recognition of a portion and a dark portion is performed.

【0010】或いは、請求項9に記載のように、上記明
暗模様識別手段は、上記撮像手段によって得られた画像
データの原画像に対して最大値フィルタ処理または最小
値フィルタ処理を行い、その結果をしきい値として明部
分と暗部分の2値化すなわち認識を行なうものである。
或いは、請求項10に記載のように、上記明暗模様識別
手段は、上記撮像手段によって得られた画像データの原
画像に対して所定の係数のディジタルローパスフィルタ
処理を行い、その結果をしきい値として明部分と暗部分
の2値化すなわち認識を行なうものである。また、請求
項11に記載の発明は、上記画像強調手段および上記明
暗模様識別手段の2値化において、上記撮像手段によっ
て得られた画像データの原画像の輝度ヒストグラムまた
は所定の一つのラインの最大輝度値を求め、その結果に
基づいて上記2値化しきい値を調節するものである。
Alternatively, as described in claim 9, the light and dark pattern identifying means performs maximum value filtering processing or minimum value filtering processing on the original image of the image data obtained by the imaging means, and the result is obtained. The threshold value is used as a threshold value to binarize the bright part and the dark part, that is, to recognize.
Alternatively, as described in claim 10, the light and dark pattern identifying means performs digital low-pass filter processing of a predetermined coefficient on the original image of the image data obtained by the image capturing means, and the result is set as a threshold value. Is for binarizing the bright part and the dark part, that is, recognizing. According to the invention of claim 11, in the binarization of the image emphasizing means and the bright and dark pattern identifying means, the luminance histogram of the original image of the image data obtained by the imaging means or the maximum of one predetermined line is obtained. The brightness value is obtained, and the binarization threshold value is adjusted based on the result.

【0011】次に、図1(b)は、請求項12に相当す
るものである。図1(b)において、100は被検査面
であり、例えば塗装面である。また、101は被検査面
に所定の明暗パターンを映し出す照明手段であり、例え
ば後記図3に示す照明装置である。また、102は被検
査面を撮像して上記明暗パターンを電気信号の画像デー
タに変換する撮像手段であり、例えばCCDカメラ等の
ビデオカメラである。また、107は上記撮像手段によ
って得られた画像データを平滑化する平滑化手段、10
8は上記平滑化手段で平滑化した明暗パターンの画像デ
ータで輝度変化のある部分を抽出する強調手段、109
は上記強調手段の結果を2値化する2値化手段、110
は上記2値化手段で得られた2値信号のうち上記輝度変
化のある部分に相当する値部分の領域を拡大する処理を
行なう領域処理手段、111は上記領域処理手段で得ら
れた上記領域をそれぞれ演算することによって1画面中
に存在する輝度変化のある部分毎にそれぞれの面積を求
め、その面積が所定値以下であった部分を欠陥として検
出する面積判定処理手段である。これら107〜111
の部分は、例えばコンピュータで構成される。上記の構
成は、例えば後記図27〜図32で説明する実施例に相
当する。
Next, FIG. 1 (b) corresponds to claim 12. In FIG. 1B, 100 is a surface to be inspected, for example, a painted surface. Reference numeral 101 denotes an illuminating device that projects a predetermined light and dark pattern on the surface to be inspected, and is, for example, an illuminating device shown in FIG. 3 described later. Reference numeral 102 denotes an image pickup means for picking up an image of the surface to be inspected and converting the light / dark pattern into image data of an electric signal, which is, for example, a video camera such as a CCD camera. Further, 107 is a smoothing means for smoothing the image data obtained by the image pickup means, 10
Reference numeral 8 denotes an emphasizing means for extracting a portion having a brightness change in the image data of the light-dark pattern smoothed by the smoothing means, 109
Is a binarizing unit for binarizing the result of the emphasizing unit, 110
Is an area processing means for enlarging the area of the value portion corresponding to the portion having the luminance change in the binary signal obtained by the binarizing means, and 111 is the area obtained by the area processing means. Is an area determination processing means for calculating the area of each area in the screen where there is a change in brightness and detecting the area whose area is less than a predetermined value as a defect. These 107-111
The part of is composed of, for example, a computer. The above configuration corresponds to, for example, the embodiment described later with reference to FIGS. 27 to 32.

【0012】また、請求項13に記載のように、上記領
域処理手段は、被検査面の粗さに応じて予め定められた
所定値だけ上記輝度変化のある部分に相当する値部分の
領域を拡大するものである。或いは、請求項14に記載
のように、上記領域処理手段は、上記撮像手段で求めた
画像データから得られる被検査面の粗さに応じた値だけ
上記輝度変化のある部分に相当する値部分の領域を拡大
するものである。また、請求項15に記載のように、上
記領域処理手段は、一旦、上記輝度変化のある部分に相
当する値部分の領域を拡大した後、該領域を縮小する処
理を行なうものである。
Further, according to a thirteenth aspect, the area processing means forms an area of a value portion corresponding to a portion where the luminance changes by a predetermined value which is predetermined according to the roughness of the surface to be inspected. It will expand. Alternatively, as described in claim 14, the area processing means is a value portion corresponding to a portion having the brightness change by a value corresponding to the roughness of the surface to be inspected obtained from the image data obtained by the image pickup means. To expand the area of. Further, as described in claim 15, the area processing means temporarily enlarges the area of the value portion corresponding to the portion having the luminance change, and then performs the processing of reducing the area.

【0013】また、請求項16に記載のように、上記面
積判定手段は、上記2値化した画像における画面の周辺
境界に接する所定領域を除去した後に、面積判定処理を
行なうものである。或いは、請求項17に記載のよう
に、上記面積判定手段は、上記2値化した画像における
画面の周辺境界に接する1画素分を上記輝度変化のある
部分と同値にしたのち面積判定を行なうものである。
According to a sixteenth aspect of the present invention, the area determination means performs the area determination processing after removing a predetermined area in contact with the peripheral boundary of the screen in the binarized image. Alternatively, as described in claim 17, the area determination means makes the area determination after making one pixel, which is in contact with a peripheral boundary of the screen in the binarized image, equal to the portion having the luminance change. Is.

【0014】また、請求項18に記載のように、上記照
明手段は、明暗パターンとして平行なストライプとそれ
を斜めに横切る線とからなる模様を映しだすものであ
る。
Further, as described in the eighteenth aspect, the illuminating means projects a pattern consisting of parallel stripes and a line diagonally crossing the stripes as a light and dark pattern.

【0015】また、請求項19に記載のように、上記照
明手段は、被検査面にストライプ状の明暗パターンを映
し出すものである。この構成は例えば後記図4、図5の
実施例に相当する。或いは、請求項20に記載のよう
に、上記照明手段は、被検査面に格子状の明暗パターン
を映し出すものである。この構成は例えば後記図17の
実施例に相当する。また、請求項21に記載のように、
上記照明手段は、明暗パターンの明部と暗部の間隔、比
率および該照明手段から被検査面までの距離が、被検査
面の曲率および予想される欠陥と被検査面とのなす角度
に基づいて設定されているものである。また、請求項2
2に記載の発明においては、上記欠陥検出手段によって
得られた欠陥に関するデータに基づいて、ラベル付け処
理および欠陥の面積と重心座標計算処理を行なう手段を
備えている。また、請求項23に記載の発明において
は、複数の上記撮像手段と複数の上記照明手段を、被検
査物体の周囲にアーチ状に配置し、被検査物体の広い被
検査面を同時に検査するように構成したものである。こ
の構成は、例えば後記図26の実施例に相当する。
According to a nineteenth aspect of the present invention, the illuminating means projects a bright and dark pattern in stripes on the surface to be inspected. This structure corresponds to, for example, the embodiment shown in FIGS. Alternatively, as described in claim 20, the illuminating means projects a grid-like bright-dark pattern on the surface to be inspected. This structure corresponds to, for example, the embodiment shown in FIG. 17 described later. Moreover, as described in claim 21,
The illuminating means is such that the distance between the bright and dark parts of the light-dark pattern, the ratio and the distance from the illuminating means to the surface to be inspected are based on the curvature of the surface to be inspected and the angle between the expected defect and the surface to be inspected It is set. In addition, claim 2
In the invention described in item 2, there is provided means for performing a labeling process and a defect area and barycentric coordinate calculation process based on the defect data obtained by the defect detection means. Further, in the invention described in claim 23, the plurality of image pickup means and the plurality of illumination means are arranged in an arch shape around the object to be inspected so that a large surface to be inspected of the object to be inspected is simultaneously inspected. It is configured in. This structure corresponds to, for example, the embodiment shown in FIG.

【0016】[0016]

【作用】上記のように、請求項1に記載の発明において
は、照明手段によって被検査面に所定の明暗パターンを
映し出し、それを撮像手段で撮像して上記明暗パターン
を電気信号の画像データに変換する。次に、明暗模様識
別手段では明暗パターン画像を処理して明部と暗部とを
識別する。この処理は、例えば画像信号を所定のしきい
値で2値化することにより、しきい値以上の明部分とし
きい値以下の暗部分とに区別することが出来る。次に、
明暗領域処理手段では、上記のようにして区別した暗部
分の領域を拡大する処理(明部分の領域を縮小する処理
でも同一)を行なう。これは詳細を後述するように、
“ゆず肌”を欠陥と誤検出するのは、“ゆず肌”によっ
てストライプの明暗の境界が乱れ、孤立点が生じるため
であることに鑑み、このような誤検出の発生するおそれ
のある部分を暗部分とすることにより、そのような部分
については欠陥検出を行なわないようにしたものであ
る。次に、画像強調手段では、上記明暗パターンの画像
データにおける周波数成分のうち高い周波数成分で、か
つレベルが所定値以上の成分のみを抽出する。上記の画
像データにおける高周波成分とは欠陥やストライプの境
界部分のような輝度変化のある部分および雑音であり、
上記のようにレベルが所定値以上の成分のみを抽出する
ことにより、雑音成分を除去し、欠陥とストライプの境
界部分のみとすることが出来る。次に、欠陥検出手段で
は、上記明暗領域処理手段における明部分と上記画像強
調手段で抽出した成分との両方が存在する部分を欠陥と
して検出する。上記のように、明暗領域処理手段におけ
る明部分とは、“ゆず肌”による影響部分を除去したも
のであるから、明暗領域処理手段の明部分と画像強調手
段の抽出成分とのアンドを求めれば、“ゆず肌”の影響
を排除し、かつ加工部位などの領域を区別して真の欠陥
のみを抽出することが出来る。上記のように、請求項1
に記載の発明は、明暗ストライプ画像の明部分に黒く映
る欠陥を検出するものであり、ストライプ画像の暗部分
に存在する欠陥は検出しない。したがって被検査面全体
を検査するには、被検査物体もしくは照明手段と撮像手
段を順次移動させ、明部分が被検査面全体を走査するよ
うに構成する。
As described above, according to the first aspect of the invention, a predetermined light and dark pattern is projected on the surface to be inspected by the illumination means, and the light and dark pattern is picked up by the image pickup means, and the light and dark pattern is converted into image data of electric signals. Convert. Next, the light and dark pattern identifying means processes the light and dark pattern image to identify the light portion and the dark portion. In this processing, for example, by binarizing the image signal with a predetermined threshold value, it is possible to distinguish between a bright portion above the threshold value and a dark portion below the threshold value. next,
The bright / dark area processing means performs the processing of enlarging the area of the dark portion distinguished as described above (the same is true for the processing of reducing the area of the bright portion). This will be explained in detail later,
The reason why “Yuzu skin” is erroneously detected as a defect is that the boundary between the light and dark stripes is disturbed by the “Yuzu skin” and an isolated point is generated. The dark portion prevents the defect from being detected in such a portion. Next, the image enhancing means extracts only the high frequency component of the frequency components in the image data of the light and dark pattern and the level of which is equal to or higher than a predetermined value. The high frequency components in the above image data are noise and a portion with a change in brightness such as a boundary portion of a defect or stripe,
As described above, by extracting only the component whose level is equal to or higher than the predetermined value, the noise component can be removed and only the boundary between the defect and the stripe can be obtained. Next, the defect detection unit detects, as a defect, a portion in which both the bright portion in the light and dark area processing unit and the component extracted by the image enhancement unit are present. As described above, the bright portion in the light and dark area processing means is obtained by removing the affected portion due to “Yuzu skin”, so if the AND of the light portion of the light and dark area processing means and the extracted component of the image enhancing means is obtained. , It is possible to eliminate the influence of "Yuzu skin", and to distinguish only regions such as processed parts and extract only true defects. As stated above, claim 1
The invention described in (1) detects defects that appear black in the bright portion of the bright-dark stripe image, and does not detect defects that exist in the dark portion of the stripe image. Therefore, in order to inspect the entire surface to be inspected, the object to be inspected or the illumination means and the image pickup means are sequentially moved so that the bright portion scans the entire surface to be inspected.

【0017】次に、請求項2〜請求項4は、上記明暗領
域処理手段の構成例を示すものであり、請求項2は、被
検査面の粗さに応じて予め定められた所定値だけ暗部分
の領域を拡大するもの、請求項3は、撮像手段で求めた
画像データから得られる被検査面の粗さに応じた値だけ
暗部分の領域を拡大するものである。また、請求項4
は、一旦、暗部分の領域を拡大した後、暗部分の領域を
縮小する処理を行なうものである。上記のように、一
旦、暗部分の領域を拡大し、“ゆず肌”の影響によって
境界線が乱れたり、孤立点が生じたような領域を暗部分
の領域に取り込んだ後は、暗部分の領域を縮小する画像
処理を行なっても、上記の乱れや孤立点は再生しない。
したがって上記のごとき拡大処理と縮小処理を行なうこ
とにより、“ゆず肌”の影響を消去し、かつストライプ
部分は最初の状態に復帰させることが出来る。
Next, claims 2 to 4 show a configuration example of the light and dark area processing means, and claim 2 is only a predetermined value which is predetermined according to the roughness of the surface to be inspected. According to the third aspect, the area of the dark portion is enlarged, and the area of the dark portion is enlarged by a value corresponding to the roughness of the surface to be inspected obtained from the image data obtained by the image pickup means. In addition, claim 4
Is a process of once expanding the area of the dark portion and then reducing the area of the dark portion. As described above, once the area of the dark part is enlarged and the boundary line is disturbed by the effect of "Yuzu skin", or the area where an isolated point is generated is taken into the area of the dark part, Even if the image processing for reducing the area is performed, the above disorder and isolated points are not reproduced.
Therefore, by performing the enlarging process and the reducing process as described above, the effect of "discolored skin" can be erased and the stripe portion can be returned to the initial state.

【0018】次に、請求項5〜請求項7は、上記画像強
調手段の構成例を示すものであり、請求項8〜請求項1
0は、上記明暗模様識別手段の構成例を示すものであ
る。また、請求項11は、上記画像強調手段と上記明暗
模様識別手段の2値化しきい値の構成例を示すものであ
る。次に、請求項12に記載の発明においては、照明手
段によって被検査面に所定の明暗パターンを映し出し、
それを撮像手段で撮像して上記明暗パターンを電気信号
の画像データに変換する。次に、平滑化手段では、撮像
手段によって得られた画像データを平滑化する。この平
滑化によってノイズ等による微小な輝度変化成分を除去
する。次に、強調手段では、平滑化手段で平滑化した明
暗パターンの画像データで輝度変化のある部分を抽出す
る。この強調処理は、例えば微分処理である。次に、2
値化手段では、強調処理した結果を2値化する。この2
値化処理によって欠陥部分やストライプ境界部分のよう
な輝度変化のある領域が抽出される。次に、領域処理手
段は、上記2値化手段で得られた2値信号のうち上記輝
度変化のある部分に相当する値部分の領域を拡大する処
理を行なう。これは詳細を後述するように、“ゆず肌”
を欠陥と誤検出するのは、“ゆず肌”によってストライ
プの明暗の境界が乱れ、孤立点が生じるためであること
に鑑み、このような誤検出の発生するおそれのある部分
については欠陥検出を行なわないようにしたものであ
る。次に、面積判定処理手段は、領域処理手段で得られ
た上記領域をそれぞれ演算することによって1画面中に
存在する輝度変化のある部分毎にそれぞれの面積を求
め、その面積が所定値以下であった部分を欠陥として検
出する。すなわち、輝度変化のある部分としては、スト
ライプの明暗の境界部分と欠陥部分とが検出されるが、
そのうちストライプの明暗の境界部分の面積に対し、欠
陥部分の面積は大幅に小さいので、所定の面積で区別す
ることにより、欠陥部分のみを抽出することが出来る。
また、“ゆず肌”が生じやすい領域は、前記領域処理手
段によって除去されているので、“ゆず肌”部分を欠陥
部分と誤検出するおそれもない。同様に、被検査面に加
工部位などがあっても、それらは欠陥に対して面積が十
分に大きいので、誤検出されることはない。
Next, claims 5 to 7 show examples of the structure of the image enhancing means, and claims 8 to 1
Reference numeral 0 indicates an example of the structure of the light / dark pattern identifying means. The eleventh aspect of the present invention shows a configuration example of the binarization threshold values of the image enhancing means and the light and dark pattern identifying means. Next, in the invention according to claim 12, a predetermined bright and dark pattern is projected on the surface to be inspected by the illumination means,
The image is picked up by an image pickup means to convert the light-dark pattern into image data of an electric signal. Next, the smoothing means smoothes the image data obtained by the imaging means. This smoothing removes a minute luminance change component due to noise or the like. Next, the emphasizing means extracts a portion having a brightness change from the image data of the light-dark pattern smoothed by the smoothing means. This emphasis process is, for example, a differentiation process. Then 2
The binarizing means binarizes the result of the emphasis processing. This 2
By the binarization process, a region having a change in brightness such as a defective portion or a stripe boundary portion is extracted. Next, the area processing means performs processing of enlarging the area of the value portion corresponding to the portion having the luminance change in the binary signal obtained by the binarizing means. This is “Yuzu skin”, as will be described later in detail.
The reason for erroneously detecting a defect as "defect" is that the bright and dark boundaries of the stripes are disturbed by "Yuzu skin" and an isolated point is generated. I decided not to do it. Next, the area determination processing means calculates each area obtained by the area processing means to obtain an area for each portion in the screen where there is a change in luminance, and the area is below a predetermined value. The part that was there is detected as a defect. That is, as a portion having a change in luminance, a bright / dark boundary portion of a stripe and a defective portion are detected,
Since the area of the defective portion is significantly smaller than the area of the light-dark boundary portion of the stripe, only the defective portion can be extracted by distinguishing by the predetermined area.
Further, since the area where the "discolored skin" is likely to occur is removed by the area processing means, there is no possibility of erroneously detecting the "discolored skin" portion as a defective portion. Similarly, even if there is a processed portion or the like on the surface to be inspected, since the area of the processed portion is sufficiently large for the defect, it is not erroneously detected.

【0019】上記請求項12に記載の発明は、明暗スト
ライプ画像の明部分に黒く映る欠陥と暗部分に白く映る
欠陥との両方を検出するものである。ただし、明暗の境
界領域部分は欠陥検出を行なうことが出来ないので、前
記請求項1と同様に、被検査面全体を検査するには、被
検査物体もしくは照明手段と撮像手段を順次移動させ、
明部分と暗部分(境界領域を除いた部分)が被検査面全
体を走査するように構成する。ただ、請求項1の場合よ
りも1画面中で欠陥検査を行なうことの出来る領域が広
範囲なので、検査を迅速に行なうことが可能である。
According to the twelfth aspect of the present invention, both a defect appearing black in the bright portion and a defect appearing white in the dark portion of the bright-dark stripe image are detected. However, since it is not possible to detect defects in the bright and dark boundary areas, in order to inspect the entire surface to be inspected, the object to be inspected or the illuminating means and the image pickup means are sequentially moved in the same manner as in claim 1.
The bright part and the dark part (the part excluding the boundary region) are configured to scan the entire surface to be inspected. However, since the area in which defect inspection can be performed in one screen is wider than in the case of claim 1, the inspection can be performed quickly.

【0020】また、請求項13〜請求項15は、上記領
域処理手段の例を示すものであり、前記請求項2〜請求
項4と同様である。また、請求項16〜請求項18は、
請求項12に記載の発明において、被検査面が曲面であ
った場合における面積判定時の誤差を解消する手段に関
するものであり、請求項16は誤検出が生じやすい部分
を削除するもの、請求項17は画面周辺の1画素を画像
処理することによってストライプ境界部分を全て接続す
るようにしたもの、請求項18は照明装置のストライプ
パターンにおいて予め各ストライプを接続しておくよう
に構成したものである。
Further, claims 13 to 15 show an example of the area processing means, and are the same as the claims 2 to 4. In addition, claims 16 to 18,
The invention according to claim 12 relates to means for eliminating an error at the time of area determination when the surface to be inspected is a curved surface, and claim 16 deletes a portion where erroneous detection is likely to occur, Reference numeral 17 is for connecting all stripe boundary portions by image-processing one pixel around the screen, and claim 18 is for connecting each stripe in advance in the stripe pattern of the lighting device. .

【0021】また、請求項19〜請求項21は、上記照
明手段の構成例を示すものである。また、請求項22
は、欠陥検出後の後処理手段の構成を示すものである。
また、請求項23は、被検査物体の広い被検査面を同時
に検査する構成を示したものであり、例えば自動車ボデ
ィの塗装工程における塗装表面検査を行なう構成であ
る。
[0021] Claims 19 to 21 show examples of the structure of the illuminating means. In addition, claim 22
Shows the configuration of post-processing means after defect detection.
A twenty-third aspect of the present invention shows a structure for simultaneously inspecting a wide surface to be inspected of an object to be inspected, for example, a structure for performing a coating surface inspection in a coating process of an automobile body.

【0022】[0022]

【実施例】以下、この発明を図面に基づいて説明する。
図2は、この発明の一実施例を示す図である。図2にお
いて、1は照明装置であり、被検査面3に所定の明暗パ
ターンの光を照射するよう配置されている。2はビデオ
カメラ(例えばCCDカメラ等)であり、明暗パターン
が映し出された被検査面3を撮像するよう配置されてい
る。また、4はカメラコントロールユニットであり、こ
こではビデオカメラ2で撮像された受光画像の画像信号
が生成され、画像処理装置5へ出力される。また、6は
ホストコンピュータであり、画像処理装置5の制御や処
理結果を外部に表示させたり、出力させる機能を有す
る。また、7はモニタであり、ビデオカメラ2で撮像し
た画面等を表示する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described below with reference to the drawings.
FIG. 2 is a diagram showing an embodiment of the present invention. In FIG. 2, reference numeral 1 denotes an illuminating device, which is arranged so as to irradiate the surface 3 to be inspected with light of a predetermined bright and dark pattern. Reference numeral 2 denotes a video camera (for example, a CCD camera), which is arranged so as to capture an image of the surface 3 to be inspected on which the light and dark patterns are displayed. Further, 4 is a camera control unit, in which an image signal of a light-receiving image captured by the video camera 2 is generated and output to the image processing device 5. Reference numeral 6 denotes a host computer, which has a function of externally displaying or outputting control of the image processing apparatus 5 and processing results. A monitor 7 displays a screen imaged by the video camera 2.

【0023】次に、図3は上記画像処理装置5の構成を
示すブロック図である。図3において、カメラコントロ
ールユニット4からの画像信号は、バッファアンプ8を
介しA/D変換器9でディジタル値に変換される。ま
た、MPU(マイクロプロセッサ)10は、画像データ
に対して所定の演算、処理等を行なう。11は画像デー
タや処理結果を記憶するメモリであり、処理結果等はD
/A変換器12を介してモニタ7に出力して表示するこ
とができる。
Next, FIG. 3 is a block diagram showing the configuration of the image processing apparatus 5. In FIG. 3, the image signal from the camera control unit 4 is converted into a digital value by the A / D converter 9 via the buffer amplifier 8. Further, the MPU (microprocessor) 10 performs predetermined calculation, processing, etc. on the image data. Reference numeral 11 denotes a memory that stores image data and processing results.
It can be output to and displayed on the monitor 7 via the / A converter 12.

【0024】次に、図4は、照明装置1の詳細を示す分
解斜視図である。本実施例においては、明暗のストライ
プパターンの照明を用いるものとして説明する。図4に
おいて、1aは光源であり、その光は拡散板1bで拡散
され、ストライプ板1cを通して被検査面に照射され
る。拡散板1bは、例えばすりガラスのようなものであ
り、被検査面3に光を均一に照射する。ストライプ板1
cは、透明もしくは拡散板のようなものに黒色のストラ
イプを所定の間隔で施したものである。
Next, FIG. 4 is an exploded perspective view showing the details of the illuminating device 1. In the present embodiment, description will be made on the assumption that illumination with a bright and dark stripe pattern is used. In FIG. 4, reference numeral 1a is a light source, and the light is diffused by the diffusion plate 1b and is irradiated onto the surface to be inspected through the stripe plate 1c. The diffusion plate 1b is, for example, like frosted glass, and uniformly irradiates the surface 3 to be inspected with light. Stripe board 1
c is a transparent or diffuser plate with black stripes arranged at predetermined intervals.

【0025】また、図5は、拡散板1bを使用しない場
合の照明装置の一例を示す斜視図である。図5におい
て、光源1aが一般の蛍光灯のような、予め拡散された
光を発生する光源であれば、背景1dを黒色にすること
により、上記と同様なストライプ光が得られる。したが
って、このように照明装置を構成することにより、被検
査面3に明暗(白黒)のストライプ模様を映し出すこと
ができる。
FIG. 5 is a perspective view showing an example of the illuminating device when the diffusion plate 1b is not used. In FIG. 5, if the light source 1a is a light source that emits previously diffused light, such as a general fluorescent lamp, the same stripe light as above can be obtained by making the background 1d black. Therefore, by constructing the illumination device in this way, a bright and dark (black and white) stripe pattern can be projected on the surface 3 to be inspected.

【0026】次に、上記のごときストライプ照明を用い
て、被検査物の表面上の欠陥を受光画像に映し出す原理
について、図6〜図8を用いて説明する。図6におい
て、被検査面3上に凸状の欠陥13があるものとする。
点P1は、欠陥のない正常な面上の任意の点であり、点
P2は、欠陥13上の任意の点である。欠陥13が図の
ように凸状の場合、欠陥13上の任意の点のそれぞれに
おいて、その点の接線と正常な被検査面とのなす角度を
もっており、点P2におけるこの角度を傾斜角θとす
る。この場合、欠陥13および点P1の近傍は、ストラ
イプ照明の明ストライプ内(光が照射されている部分)
にあるものとする。ビデオカメラ2と被検査面3とのな
す角を入射角θiとした場合に、正常な平面である点P
1では光は正反射(θi)し、その方向にはストライプ
照明の明部分があるので、点P1はビデオカメラ2で明
(白)部分として映し出される。しかし、欠陥13上の
点P2においては、傾斜角θによってビデオカメラ2か
らの入射は正反射せず乱反射し、その方向には黒ストラ
イプがあるため、点P2はビデオカメラ2で黒く映し出
される。このときの乱反射角をθhとすると、欠陥点P
2での傾斜角θ、ビデオカメラ2のある方向の角度(入
射角)はθiであるから、 θh=θi+2θ …(数1) となる(図7参照)。すなわち、角度θhの方向に、ス
トライプの明(白)部分があれば白、ストライプの黒部
分があれば黒(暗)く映し出されるわけである。また、
上記のように正常な平面では正反射するので、 θh=θi …(数2) と表せる。よって(数1)、(数2)式より、欠陥によ
る乱反射は、正反射方向θiを基準にすると2θと表す
ことができる。なお、上記の説明ではビデオカメラ2を
始点として説明したが、照明装置1を始点としてもまっ
たく同じである。また、図7は、欠陥の右側の斜面に点
P2がある場合についての例であるが、P2が左斜面に
ある場合でも考え方は同じであるので、説明は省略す
る。
Next, the principle of displaying a defect on the surface of the object to be inspected in the received light image by using the above stripe illumination will be described with reference to FIGS. 6 to 8. In FIG. 6, it is assumed that there is a convex defect 13 on the surface 3 to be inspected.
The point P1 is an arbitrary point on the normal surface having no defect, and the point P2 is an arbitrary point on the defect 13. When the defect 13 is convex as shown in the figure, each arbitrary point on the defect 13 has an angle formed by a tangent line of the point and a normal surface to be inspected, and this angle at the point P2 is referred to as an inclination angle θ. To do. In this case, the vicinity of the defect 13 and the point P1 is in the bright stripe of the stripe illumination (the portion where light is irradiated).
It is assumed that When the angle formed by the video camera 2 and the surface 3 to be inspected is an incident angle θi, a point P which is a normal plane
In 1, the light is specularly reflected (θi), and since there is a bright portion of the stripe illumination in that direction, the point P1 is projected by the video camera 2 as a bright (white) portion. However, at the point P2 on the defect 13, the incident light from the video camera 2 is not specularly reflected but diffusely reflected due to the inclination angle θ, and since there is a black stripe in that direction, the point P2 is displayed as black by the video camera 2. If the irregular reflection angle at this time is θh, the defect point P
Since the tilt angle θ at 2 and the angle (incident angle) in a certain direction of the video camera 2 are θi, θh = θi + 2θ (Equation 1) (see FIG. 7). That is, if there is a bright (white) portion of the stripe in the direction of the angle θh, it is displayed as white, and if there is a black portion of the stripe, it is displayed as black (dark). Also,
As described above, since it is specularly reflected on a normal plane, it can be expressed as θh = θi (Equation 2). Therefore, from the equations (1) and (2), the irregular reflection due to the defect can be expressed as 2θ based on the regular reflection direction θi. In the above description, the video camera 2 is used as the starting point, but the lighting device 1 is also used as the starting point. Further, FIG. 7 is an example of a case where the point P2 is on the slope on the right side of the defect, but the concept is the same even when P2 is on the slope on the left, and therefore the description is omitted.

【0027】次に、被検査面が曲面の場合について図8
を用いて説明する。図8に示すように、被検査面3が曲
率半径Rの曲面とし、その中心をCとする。また、この
曲面上の任意の点をP1’とし、その点の中心角をθc
とする。ここで曲面上の点P1’での反射角θhは、 θh=θi+2θc …(数3) と表され、これが曲面での正反射角となる。さらに、点
P1’に欠陥がある場合、上記平面のときと同様に考え
ると、その反射角θhは、 θh=θi+2θc+2θ…(数4) となる。故に、欠陥での乱反射方向は、その点での正反
射方向を基準にすると、平面、曲面にかかわらず、2θ
となる。
Next, the case where the surface to be inspected is a curved surface is shown in FIG.
Will be explained. As shown in FIG. 8, the surface 3 to be inspected is a curved surface having a radius of curvature R, and the center thereof is C. Also, let P1 'be an arbitrary point on this curved surface, and let the central angle of that point be θc.
And Here, the reflection angle θh at the point P1 ′ on the curved surface is expressed as θh = θi + 2θc (Equation 3), which is the regular reflection angle on the curved surface. Furthermore, when there is a defect at the point P1 ′, the reflection angle θh is θh = θi + 2θc + 2θ (Equation 4), considering the same as in the case of the above-mentioned plane. Therefore, the diffuse reflection direction at the defect is 2θ regardless of whether it is a flat surface or a curved surface, with reference to the regular reflection direction at that point.
Becomes

【0028】上記のように、欠陥での傾斜角θによって
被検査面での反射角が求められるので、あらかじめ欠陥
における傾斜角θの分布を測定しておき、検出したい、
すなわち画像中に黒く映し出したい範囲(被検査体の種
類に応じて、欠陥と判定すべき大きさの最小のランクに
合わせる)を決めておけば、その範囲での反射方向にス
トライプの暗(黒)部分があるようにストライプの間隔
(前記図4のT)および照明装置1と被検査面3との距
離(図6のD;照明装置と被検査面との角度も含む)が
決定できる。この際、被検査体の種類に応じて代表的な
欠陥をサンプルし、それに合うように設定する。なお、
これまでの説明とは逆に、上記原理を用い被検査面に黒
く映したストライプ内に、欠陥を白く映し出すことも可
能ではあるが、照明装置1の光が拡散光であるため、欠
陥が明るくかつ大きく映らない(白色ではなく暗い灰色
に映り、明るく映る部分の面積も小さい)ので、本実施
例では用いていない。
As described above, since the reflection angle on the surface to be inspected can be obtained by the inclination angle θ of the defect, it is desired to measure and detect the distribution of the inclination angle θ of the defect in advance.
In other words, if you decide the range that you want to appear black in the image (match the minimum rank of the size that should be judged as a defect depending on the type of the object to be inspected), the stripe darkness (black 4) and the distance between the illuminating device 1 and the surface 3 to be inspected (D in FIG. 6; the angle between the illuminating device and the surface to be inspected is also included). At this time, typical defects are sampled according to the type of the object to be inspected and set so as to match them. In addition,
Contrary to the above description, it is possible to project the defects white in the stripes which are projected black on the surface to be inspected using the above-mentioned principle, but since the light of the illumination device 1 is diffused light, the defects are bright. It is not used in this embodiment because it does not appear large (it appears dark gray instead of white, and the area of the bright image is small).

【0029】上記のように、本実施例においては、欠陥
での光の乱反射を用いて、明ストライプ中に黒く映る欠
陥を検出するものである。そのため、例えばストライプ
の明暗部分の比率が1:1ならば、受光画像中の明部分
は画像全体の1/2となり、1画像で検査できる領域が
狭くなってしまう。故に、画像中の明部分ができるだけ
広くなるように、ストライプの明部分の幅を広げる(例
えば、明暗の比率を明:暗=2:1以上にする)ことを
含めて、上記ストライプの明暗の間隔Tや距離Dを決定
すればよい。なお、被検査面全体を検査するには、後記
図25で説明するように、被検査体もしくは照明装置と
ビデオカメラを移動させ、ストライプの明部分が被検査
面全体を順次走査するように構成する。
As described above, in this embodiment, the irregular reflection of light at the defect is used to detect the defect appearing black in the bright stripe. Therefore, for example, if the ratio of the bright and dark portions of the stripe is 1: 1, the bright portion in the received light image becomes 1/2 of the entire image, and the area that can be inspected in one image becomes narrow. Therefore, the width of the light portion of the stripe is widened so that the light portion in the image is as wide as possible (for example, the ratio of light and dark is set to light: dark = 2: 1 or more). The distance T and the distance D may be determined. In order to inspect the entire surface to be inspected, as will be described later with reference to FIG. 25, the object to be inspected or the illumination device and the video camera are moved so that the bright portion of the stripe sequentially scans the entire surface to be inspected. To do.

【0030】次に、作用を説明する。なお、この実施例
は図1(a)のブロック図に相当する。被検査面3上に
明暗ストライプが映し出されており、そのストライプの
明部分の中に欠陥13があるとすると、その受光画像は
図9(a)のようになり、前記の原理によって欠陥13
が明ストライプ内に黒く映し出される。図9(a)の受
光画像において、画面左上を原点として座標軸x,yを
とると、欠陥13におけるx方向の輝度レベルは、図9
(b)のようになる。なお、図9(b)において、大き
な凹凸はストライプの明部分と暗部分とに対応するもの
であり、細かな凹凸はノイズである。そして欠陥は凸部
分(明部分)から落ちこんだ、ノイズよりは大きな凹み
として示される。前記の画像処理装置5は、図9に示す
ような受光画像を原画像の信号S0として取り込む。例
えば、ビデオカメラ2からの画像信号をA/D変換し、
輝度レベルを8bitのディジタル値に変換した場合に
は、図9(b)に示すように、縦軸において255が最
大値で明、0が黒となり、1画面を512×512画素
の分解能で取り込んだ場合には、横軸は0〜512の画
素数となる。なお、図示の信号S0はy軸方向の或る値
(*印の値)についての信号であり、このような信号が
y軸の各値について存在する。
Next, the operation will be described. It should be noted that this embodiment corresponds to the block diagram of FIG. If a bright and dark stripe is projected on the surface 3 to be inspected and there is a defect 13 in the bright portion of the stripe, the received light image is as shown in FIG.
Is projected black in the bright stripe. In the received light image of FIG. 9A, when the coordinate axes x and y are taken with the upper left corner of the screen as the origin, the luminance level in the x direction of the defect 13 is as shown in FIG.
It becomes like (b). Note that in FIG. 9B, the large unevenness corresponds to the bright portion and the dark portion of the stripe, and the fine unevenness is noise. Then, the defect is shown as a depression that is larger than the noise and that falls from the convex portion (bright portion). The image processing device 5 takes in a light-receiving image as shown in FIG. 9 as the signal S0 of the original image. For example, the image signal from the video camera 2 is A / D converted,
When the brightness level is converted into an 8-bit digital value, as shown in FIG. 9B, 255 is the maximum value on the vertical axis, which is bright, 0 is black, and one screen is captured with a resolution of 512 × 512 pixels. In that case, the horizontal axis represents the number of pixels of 0 to 512. The signal S0 shown is a signal for a certain value (value marked with *) in the y-axis direction, and such a signal exists for each value on the y-axis.

【0031】次に、図10は、画像処理装置5における
処理内容を示すフローチャートである。画像処理装置5
においては、図10に示すごとく、原画像P1から、明
暗模様識別処理P2、画像強調処理P3、明暗領域処理
P4および欠陥検出処理P5を行なって欠陥を検出す
る。また、上記のごとくにして欠陥を検出した後の後処
理P6としては、ラベリング、面積および重心座標計算
があり、それらの結果をモニタ等に表示し、或いは後続
機器に出力する。
Next, FIG. 10 is a flowchart showing the processing contents in the image processing apparatus 5. Image processing device 5
In FIG. 10, as shown in FIG. 10, a defect is detected from the original image P1 by performing the light and dark pattern identification processing P2, the image enhancement processing P3, the light and dark area processing P4, and the defect detection processing P5. Further, as post-processing P6 after detecting a defect as described above, there are labeling, area and barycentric coordinate calculation, and the results thereof are displayed on a monitor or the like or output to a subsequent device.

【0032】以下、上記の各処理の内容について詳細に
説明する。まず、明暗模様認識処理P2について説明す
る。図11は、原画像の信号S0に含まれる各成分の波
形図である。図11のように、原画像の信号S0は、照
度むら等によるシェーディング成分(低周波成分)と、
ストライプ照明による輝度変化成分(中間成分)と、欠
陥13やノイズによる輝度変化成分(高周波成分)の3
つに分けられる。このような原画像からストライプを認
識するために、原画像から低周波成分を取り出し、それ
を原画像に対するしきい値(しきい面)として2値化す
ることにより、ストライプの明暗(白黒)を分離/抽出
つまり認識するのである。なお、上記の周波数とは、画
像処理における空間周波数である。
The contents of each of the above processes will be described in detail below. First, the light and dark pattern recognition process P2 will be described. FIG. 11 is a waveform diagram of each component included in the signal S0 of the original image. As shown in FIG. 11, the signal S0 of the original image includes a shading component (low frequency component) due to uneven illuminance,
The brightness change component (intermediate component) due to the stripe illumination and the brightness change component (high frequency component) due to the defect 13 or noise 3
Divided into two. In order to recognize stripes from such an original image, low-frequency components are extracted from the original image and binarized as a threshold value (threshold surface) for the original image to determine the brightness (black and white) of the stripe. Separation / extraction or recognition. The above-mentioned frequency is a spatial frequency in image processing.

【0033】以下、明暗模様認識処理P2の具体例につ
いて説明する。明暗模様認識処理P2は、図10に示す
ように、スムージングP21、平滑化P22および2値
化P23の各処理を行なう。まず、原画像をスムージン
グ(ローパスフィルタ)し、欠陥やノイズによる高周波
成分のみを取り除く。これは、ストライプを認識するた
めにストライプ成分のみを取り出すためと、後に説明す
る画像強調処理において、欠陥13による輝度変化のみ
を強調するために欠陥成分のみを取り出す必要があるか
らである。
A specific example of the light and dark pattern recognition processing P2 will be described below. As shown in FIG. 10, the light and dark pattern recognition processing P2 includes smoothing P21, smoothing P22, and binarization P23. First, the original image is smoothed (low-pass filter) to remove only high frequency components due to defects and noise. This is because it is necessary to extract only the stripe component for recognizing the stripe, and it is necessary to extract only the defect component for emphasizing only the luminance change due to the defect 13 in the image enhancement process described later.

【0034】以下、上記のスムージングについて、平滑
化フィルタを用いた場合について説明する。平滑化フィ
ルタは、例えば、1画面512×512画素の各画素に
対して、図12に示すように、3×3マスクの局所演算
を行なう場合、注目画素Q0(正方形状に並んだ9画素
中の真中の画素)およびその周囲を囲むQ1〜Q8の合
計9画素の輝度値の単純平均値を注目画素Q0の新たな
輝度値とするものである。このように周辺8画素を用い
た単純平均値をとるので、微小ノイズ等が除去される。
なお、5×5マスクや7×7マスクのように、マスクの
大きさは任意であり、これをマスクサイズと呼ぶ。上記
の平滑化フィルタの処理回数やマスクサイズは、ストラ
イプの間隔や欠陥13の大きさに応じて設定すればよ
い。このような平滑化フィルタ処理の結果、原画像の信
号S0は図13に示す信号S1のような欠陥(高周波)
成分のみが取り除かれた信号となる。
The smoothing described above will be described using a smoothing filter. For example, when the smoothing filter performs local calculation of a 3 × 3 mask on each pixel of 512 × 512 pixels on one screen as shown in FIG. 12, the pixel of interest Q0 (of 9 pixels arranged in a square shape (A pixel in the middle of the pixel) and a surrounding average of Q1 to Q8, that is, a simple average value of luminance values of a total of 9 pixels is set as a new luminance value of the target pixel Q0. Since the simple average value is calculated using the eight peripheral pixels in this way, minute noises and the like are removed.
The size of the mask is arbitrary, such as the 5 × 5 mask or the 7 × 7 mask, and this is called the mask size. The number of times the smoothing filter is processed and the mask size may be set according to the stripe interval and the size of the defect 13. As a result of such smoothing filter processing, the signal S0 of the original image has a defect (high frequency) like the signal S1 shown in FIG.
The signal has only the components removed.

【0035】次に、低周波成分を除去してストライプ成
分のみを取り出すため、さらに信号S1に対して平滑化
処理(P22)を繰り返す。これは、上記平滑化フィル
タを繰り返し使用してもよいし、平滑化フィルタのマス
クサイズをストライプ間隔に合わせ大きくし、処理時間
の短縮を図ってもよい。この結果、低周波成分のみが取
り出され、信号S2のようになる。このS2をしきい値
(しきい面)としてスムージング後の信号S1を2値化
すると、S3のようになり、ストライプの明暗(白黒)
の認識が可能となる。ここで原画像の信号S0に対して
2値化を行ってもよいが、信号S0にノイズ等の高周波
成分が多い場合は、上記のようにスムージング後の信号
S1を用いた方が安定した2値化が可能である。本実施
例は、ストライプ照明で明く照らされた領域内に黒く映
る欠陥13を検出するものなので、上記のように認識さ
れたストライプの明部分(2値化で“1”となった領
域)のみを処理すればよい。なお、明暗模様認識処理の
他の方法としては、上記のスムージング後の信号S1か
ら平滑化画像S2を減算することによって信号S4と
し、0をしきい値として2値化する方法でもよい。
Next, the smoothing process (P22) is repeated for the signal S1 in order to remove the low frequency components and extract only the stripe components. For this, the smoothing filter may be repeatedly used, or the mask size of the smoothing filter may be increased according to the stripe interval to shorten the processing time. As a result, only the low frequency component is taken out and becomes the signal S2. When the signal S1 after smoothing is binarized by using this S2 as a threshold value (threshold surface), it becomes S3, and the brightness of the stripe (black and white)
Can be recognized. Here, the signal S0 of the original image may be binarized, but when the signal S0 has many high-frequency components such as noise, it is more stable to use the signal S1 after smoothing as described above. It can be valued. In this embodiment, since the defect 13 that appears black in the area illuminated brightly by the stripe illumination is detected, the bright portion of the stripe recognized as described above (the area which becomes "1" by binarization). Only need to process. As another method of the light-dark pattern recognition processing, a method of subtracting the smoothed image S2 from the smoothed signal S1 to obtain the signal S4 and binarizing 0 as a threshold value may be used.

【0036】次に、画像強調処理P3について説明す
る。本実施例では、原画像の信号S0とスムージングに
よって欠陥成分のみが除去された信号S1とを用いた方
法について説明する。これは、信号S0から信号S1を
減算する処理であり、これによって低周波成分およびス
トライプ成分が相殺され、信号S5のように欠陥、明暗
の境界部分およびノイズ等による高周波成分のみが抽出
される。上記の結果を欠陥が確実に抽出されるようなし
きい値で2値化する。しかし、欠陥部分以外でも明暗の
境界部分などのような輝度変化がある個所も強調され、
かつその部分の輝度値がしきい値を越えた場合には、結
果はS6に示すように明暗の境界部分も検出されること
になる。そのため、次の欠陥検出処理P5において、上
記の画像強調結果S6と前記の明暗模様認識結果S3と
のAND(論理積)をとることにより、誤検出が発生し
やすいストライプの境界や被検査面以外の領域等をマス
クし、かつシェーディング等の影響を受けずに欠陥のみ
を確実に検出することができる。このようにして検出し
た欠陥信号はS7のようになる。
Next, the image enhancement process P3 will be described. In the present embodiment, a method using the signal S0 of the original image and the signal S1 from which only the defect component has been removed by smoothing will be described. This is a process of subtracting the signal S1 from the signal S0, whereby the low-frequency component and the stripe component are canceled out, and only the high-frequency component due to a defect, a boundary between light and dark, noise, etc. is extracted like the signal S5. The above result is binarized with a threshold value that ensures that defects are extracted. However, in places other than the defective part, areas where there is a change in brightness such as the boundary part of light and darkness are also emphasized,
If the brightness value of that portion exceeds the threshold value, the result is that the bright / dark boundary portion is also detected as shown in S6. Therefore, in the next defect detection process P5, the AND (logical product) of the image enhancement result S6 and the bright / dark pattern recognition result S3 is taken, so that a stripe boundary or an inspected surface other than the erroneous detection is likely to occur. It is possible to reliably detect only the defects by masking the areas and the like and without being affected by shading or the like. The defect signal thus detected is as in S7.

【0037】基本的には、上記のようにして欠陥検出を
行なうが、前に説明した“ゆず肌”がある場合には、誤
検出を生じるおそれがあるので、以下、それを解消する
明暗領域処理P4について説明する。被検査面に“ゆず
肌”などの薄い凹凸がある場合、その粗さの程度によっ
ては、上記のマスク処理でもマスクしきれずに残ってし
まい、欠陥以外の個所を誤検出してしまう場合がある。
例えば、図14に示すように、ストライプ画像の明暗の
境界は表面の粗さに応じた乱れが生じ、(c)のような
孤立点が表れたり、輝度レベルが不安定となる範囲αが
発生する。この範囲αの部分が上記誤検出の原因とな
る。そしてこれは表面粗さに比例して大きくなるので、
範囲αが大きいほどマスクされずに残ってしまい誤検出
が発生しやすくなる。上記の問題を解決するため、本実
施例においては、ストライプ認識(2値化)結果の信号
S3の暗部分の領域を拡大処理することにより、マスク
領域を拡大して範囲αの部分もマスクするようにしてい
る。このようにすれば、誤検出を生じるおそれのある部
分は暗部分として処理されるので、“ゆず肌”を欠陥と
誤検出するおそれはなくなる。なお、暗部分の領域を拡
大する代わりに明部分の領域を縮小する処理を行なって
も全く同様である。
Basically, the defect detection is carried out as described above. However, if there is the above-mentioned "discolored skin", there is a risk of erroneous detection. The process P4 will be described. If the surface to be inspected has thin irregularities such as "Yuzu skin", it may remain unmasked even with the above mask processing, depending on the degree of roughness, and false detection of points other than defects may occur. .
For example, as shown in FIG. 14, the bright and dark boundaries of the stripe image are disturbed according to the surface roughness, and an isolated point as shown in (c) appears or a range α in which the brightness level becomes unstable is generated. To do. The portion in this range α causes the above-mentioned erroneous detection. And since this increases in proportion to the surface roughness,
The larger the range α, the more the area remains without being masked, and erroneous detection is more likely to occur. In order to solve the above-mentioned problem, in the present embodiment, the mask area is enlarged by enlarging the area of the dark portion of the signal S3 of the stripe recognition (binarization) result, and the portion of the range α is also masked. I am trying. In this way, the portion that may cause erroneous detection is processed as a dark portion, so that there is no risk of erroneously detecting "discolored skin" as a defect. It should be noted that the same processing is performed even if the process of reducing the area of the bright portion is performed instead of enlarging the area of the dark portion.

【0038】次に、上記の明暗領域処理P4の具体的方
法について説明する。図15は、明暗領域処理の原理を
説明するための図である。暗部分の領域拡大処理は、図
15(a)において、注目画素Q0の周囲を囲むQ1〜
Q8の画素中に少なくとも一つ図形画素(図形の暗部
分)がある場合に、注目画素Q0を図形画素と同値にす
る処理である。それにより、図15(b)に示すよう
に、画像中の図形画像の連結成分は外側に1画素づつ拡
大されることになり、黒部分が斜線部分まで拡大され
る。なお、領域縮小処理は、上記拡大処理の逆の処理で
あり、注目画素Q0の周囲を囲むQ1〜Q8の画素中に
少なくとも一つ背景画素(図形の明部分)ある場合に、
注目画素Q0を背景画素と同値にする処理である。これ
により、図形の暗部分が縮小して明部分が拡大する。な
お、上記のごとき画素図形における明暗領域処理は、1
回の処理で周囲1画素分を拡大/縮小するから、処理量
は処理回数に比例する。
Next, a specific method of the light / dark area processing P4 will be described. FIG. 15 is a diagram for explaining the principle of bright and dark area processing. The area enlargement processing of the dark portion is performed by using Q1 to Q1 surrounding the pixel of interest Q0 in FIG.
When at least one figure pixel (dark part of figure) is present in the pixels of Q8, the pixel of interest Q0 is set to the same value as the figure pixel. As a result, as shown in FIG. 15B, the connected component of the graphic image in the image is enlarged outward by one pixel, and the black portion is enlarged to the shaded portion. The area reduction process is the reverse of the enlargement process described above. When there is at least one background pixel (bright part of the figure) among the pixels Q1 to Q8 surrounding the pixel of interest Q0,
This is a process of setting the pixel of interest Q0 to the same value as the background pixel. As a result, the dark part of the figure is reduced and the bright part is enlarged. In addition, the bright and dark area processing in the pixel figure as described above is 1
The amount of processing is proportional to the number of times of processing, because the surrounding one pixel is enlarged / reduced by one time of processing.

【0039】実際の明暗領域処理における処理回数(す
なわち暗部分を拡大する量)を設定する方法としては、
例えば、次の(1)または(2)ような方法がある。 (1)被検査面が自動車の塗装面といった表面粗さがほ
ぼ決まった範囲内の値である場合には、その粗さ範囲の
最大値に合わせて、粗さによる誤検出部分(範囲α)ま
で完全にマスクする(埋めつくす)のに必要な回数を実
験等であらかじめ求めておき、その値に設定すればよ
い。このようにすれば、実際の検査時に、暗部分を拡大
する量を簡単に設定することが出来る。 (2)入力画像毎にその被検査面の表面粗さを測定し、
その結果から拡大処理の最適な回数を自動的に求めるよ
うにしてもよい。このようにすれば、それぞれの被検査
体に応じた最適な量だけ暗部分を拡大することが出来、
精密な検査を行なうことが出来る。 上記の表面粗さを測定する方法としては、(イ)通常の
表面粗さ測定器を用いる方法、(ロ)入力画像のストラ
イプの乱れ量を、画像の空間周波数から求める方法、等
がある。
As a method of setting the number of times of processing in the actual light and dark area processing (that is, the amount of enlarging the dark portion),
For example, there is the following method (1) or (2). (1) If the surface to be inspected has a surface roughness, such as a painted surface of an automobile, within a substantially fixed range, the erroneous detection part due to the roughness (range α) is adjusted to the maximum value of the roughness range. The number of times required for completely masking (filling in) can be obtained in advance by experiments and set to that value. By doing so, the amount of enlargement of the dark portion can be easily set at the time of actual inspection. (2) Measure the surface roughness of the surface to be inspected for each input image,
The optimum number of enlargement processes may be automatically obtained from the result. By doing this, it is possible to enlarge the dark part by the optimum amount according to each inspected object,
A precise inspection can be performed. As a method of measuring the surface roughness, there are (a) a method using a normal surface roughness measuring instrument, (b) a method of obtaining the amount of stripe disorder of an input image from the spatial frequency of the image, and the like.

【0040】以下、上記(ロ)の方法について簡単に説
明する。被検査面にストライプパターンを映し出し、そ
れをビデオカメラ2で撮像すると、図16(a)に示す
ように、表面の凹凸に応じてストライプパターンに乱れ
が生じる。この信号をFFT(高速フーリエ変換)処理
してパワースペクトルを求めると、図16(b)に示す
ようになる。図16(b)の特性曲線において、左端の
大きな凸領域はストライプの明暗に対応した基本波、そ
の右の長波長領域は“ゆず肌”のような比較的面積の大
きな凹凸に対応した部分、その右の中波長領域や短波長
領域はそれよりも面積の小さな凹凸に対応した部分であ
る。したがって“ゆず肌”による表面の粗さが大きいと
長波長領域の面積(斜線部の面積)が大きくなるので、
この値から“ゆず肌”の程度を測定することが出来る。
The above method (b) will be briefly described below. When the stripe pattern is displayed on the surface to be inspected and the image is picked up by the video camera 2, as shown in FIG. 16A, the stripe pattern is disturbed according to the unevenness of the surface. When this signal is subjected to FFT (Fast Fourier Transform) to obtain the power spectrum, it becomes as shown in FIG. In the characteristic curve of FIG. 16B, the large convex region on the left end is the fundamental wave corresponding to the light and shade of the stripe, and the long wavelength region on the right thereof is the portion corresponding to the irregularities having a relatively large area such as “Yuzu skin”. The middle-wavelength region and the short-wavelength region on the right are portions corresponding to irregularities having a smaller area. Therefore, if the surface roughness due to "Yuzu skin" is large, the area of the long wavelength region (the area of the shaded area) becomes large,
From this value, the degree of "Yuzu skin" can be measured.

【0041】また、誤検出部分の面積が本来の欠陥部分
の面積より十分小さく、かつ一定(予め粗さを測定し、
それがほぼ一定であることが判れば決定できる)であれ
ば、前記図13の2値化信号S6において暗部分の拡大
処理を行なった後、本来の欠陥のみを処理前の元の大き
さ(面積)にもどすため暗部分の収縮処理(明部分の拡
大処理)を行なうようにしてもよい。すなわち、上記の
ように、一旦、暗部分の領域を拡大し、“ゆず肌”の影
響によって境界線が乱れたり、孤立点が生じたような領
域を暗部分の領域に取り込んだ後は、暗部分の領域を縮
小する画像処理を行なっても、上記の乱れや孤立点は再
生しない。したがって上記のごとき拡大処理と縮小処理
を行なうことにより、“ゆず肌”の影響を消去し、かつ
欠陥やストライプ部分は最初の状態に復帰させることが
出来る。
The area of the erroneously detected portion is sufficiently smaller than the original area of the defective portion and is constant (the roughness is measured in advance,
If it can be determined that it is almost constant), after the dark part is enlarged in the binarized signal S6 of FIG. 13, only the original defect is processed to the original size before the process. In order to restore the area, a dark part contraction process (bright part enlargement process) may be performed. That is, as described above, once the dark area is enlarged and the boundary line is disturbed due to the effect of "Yuzu-skin", or an area where an isolated point is generated is captured in the dark area, Even if the image processing for reducing the partial area is performed, the above-mentioned disorder or isolated point is not reproduced. Therefore, by performing the enlargement processing and the reduction processing as described above, it is possible to eliminate the influence of "discolored skin" and restore the defect or stripe portion to the initial state.

【0042】次に、上記のようにして欠陥検出を完了し
た後の後処理としては、欠陥検出信号S7に基づいて、
欠陥部分のラベリング(ラベル付け)、面積計算および
重心座標計算を行なう。そしてホストコンピュータ6
は、その結果から欠陥の種類などの特定や欠陥の発生位
置の計算、およびランク付け等を行い、それを表示装置
やプリンタ等の出力装置へ出力する。または、欠陥があ
った場合に、被検査物を通常ラインから修正専用ライン
(例えば自動車ボディの塗装工程の場合は、欠陥部分の
みを修正塗装する等)へ切り替えるといったラインの制
御、あるいは欠陥のランク(大きさ)、発生個所に対す
る統計処理などに用いてもよい。
Next, as post-processing after the defect detection is completed as described above, based on the defect detection signal S7,
Labeling (labeling) of defects, area calculation, and barycentric coordinate calculation. And host computer 6
Identifies the defect type, calculates the defect occurrence position, ranks, etc. from the result, and outputs it to an output device such as a display device or a printer. Alternatively, if there is a defect, control the line such as switching the inspection object from a normal line to a repair-only line (for example, in the case of a car body painting process, only the defective part is repair-painted), or the defect rank. It may be used for (size), statistical processing for the occurrence location, and the like.

【0043】また、これまでの説明においては、照明装
置1としてストライプ状の明暗パターンを映し出すもの
について説明したが、図17に示すように、明暗パター
ンを格子状にしてもよい。具体的には、前記図4のスト
ライプ板1cを図17のような格子状のパターンとする
ことで実現できる。このような格子状パターンを用いた
場合の作用、効果は、これまで説明したストライプ状の
場合と同様である。また、格子状パターンの間隔や比率
等もこれまで説明したものと同様に設定すればよい。た
だし、横方向の格子状パターンが被検査物体の移動方向
と同一方向であると、横方向の格子パターン(暗部)内
に欠陥がある場合、欠陥は一度も明部内に映らないの
で、検出できないことが予想される。したがって格子パ
ターンは、被検査物体の移動方向に対して斜めに配置す
ればよい。
Further, in the above description, the illumination device 1 has been described as a device that projects a stripe-shaped bright and dark pattern, but as shown in FIG. 17, the bright and dark pattern may be a grid pattern. Specifically, it can be realized by forming the stripe plate 1c of FIG. 4 into a lattice pattern as shown in FIG. The operation and effect of using such a grid pattern are similar to those of the stripe pattern described above. Further, the intervals and ratios of the grid pattern may be set in the same manner as described above. However, if the horizontal grid pattern is in the same direction as the moving direction of the object to be inspected, if there is a defect in the horizontal grid pattern (dark part), the defect is not reflected in the bright part even once, so it cannot be detected. It is expected that. Therefore, the grid pattern may be arranged obliquely with respect to the moving direction of the inspection object.

【0044】次に、画像強調処理P3の他の実施例につ
いて説明する。原画像に直接2次微分のみを適用した場
合、電気的なノイズや微小な輝度変化成分等のノイズを
も強調しすぎてしまう。そのため、本実施例において
は、原画像の信号をまず正規関数(ガウス関数)で平滑
化してから2次微分を適用するようにしている。なお、
最後に2値化する点は前記と同様である。原画像のx方
向において、平均0、分散σのガウス関数は、下記(数
5)式で示される。なお、関数形は図18に示す。
Next, another embodiment of the image enhancement process P3 will be described. When only the second derivative is directly applied to the original image, electrical noise and noise such as minute luminance change component are also emphasized too much. Therefore, in this embodiment, the signal of the original image is first smoothed by a normal function (Gaussian function), and then the second derivative is applied. In addition,
The final point of binarization is the same as above. A Gaussian function having an average of 0 and a variance σ in the x direction of the original image is represented by the following (Equation 5). The function form is shown in FIG.

【0045】[0045]

【数5】 (Equation 5)

【0046】上記(数5)式を2次微分すると、下記
(数6)式が得られる。なお、関数形は図19に示す。
When the above equation (5) is second-order differentiated, the following equation (6) is obtained. The function form is shown in FIG.

【0047】[0047]

【数6】 (Equation 6)

【0048】上記(数6)式においては、パラメータσ
によって強調能力が調節できるので、欠陥よりも小さい
ノイズ成分や欠陥よりも大きいストライプ成分等には反
応せず、欠陥のみを強調するようなσを設定すれば良
い。実際には、画像が離散値であるディジタル信号なの
で、図19に示した(数6)式の関数も図20に示すよ
うになる。図20は、マスクサイズが9画素のフィルタ
として適用した一例であり、強調したい欠陥の大きさに
応じて係数a1〜a5を調節すればよい。本実施例の画像
強調処理においては、平滑化作用をも含み、かつ欠陥よ
りも小さい微小点は無視して欠陥のみを強調することが
でき、またこれらの作用/処理を高速に行うことができ
る、といった効果がある。
In the above equation (6), the parameter σ
Since the emphasizing ability can be adjusted by σ, it is sufficient to set σ so as to emphasize only the defect without reacting to a noise component smaller than the defect or a stripe component larger than the defect. Actually, since the image is a digital signal having discrete values, the function of the equation (6) shown in FIG. 19 also becomes as shown in FIG. FIG. 20 shows an example in which the mask size is applied as a filter of 9 pixels, and the coefficients a 1 to a 5 may be adjusted according to the size of the defect to be emphasized. In the image emphasizing process of this embodiment, it is possible to ignore only minute points smaller than a defect and also include a smoothing function, and emphasize only the defect, and these functions / processes can be performed at high speed. , And so on.

【0049】次に、画像強調処理P3のさらに他に実施
例について説明する。本実施例は、原画像に対して最大
値フィルタ処理および最小値フィルタ処理を行なうもの
である。最大値フィルタ処理または最小値フィルタ処理
は、注目画素およびその近傍画素における輝度値の最大
値または最小値を注目画素の値とする一種の平滑化処理
である。例えば、原画像に最大値フィルタ処理を行う
と、輝度の低いストライプの暗部分がその周囲の明部分
の輝度値に置き換えられる。このときのフィルタサイズ
と処理回数は、原画像中のストライプの間隔に応じて決
定すれば良い。最小値フィルタの場合は、これとは反対
にストライプの明部分を暗部分の輝度値に置き換える処
理となる。
Next, another embodiment of the image enhancement process P3 will be described. In this embodiment, the maximum value filtering process and the minimum value filtering process are performed on the original image. The maximum value filtering process or the minimum value filtering process is a kind of smoothing process in which the maximum value or the minimum value of the brightness values of the target pixel and its neighboring pixels is set as the value of the target pixel. For example, when the maximum value filtering process is performed on the original image, the dark portion of the low-luminance stripe is replaced with the luminance value of the surrounding bright portion. The filter size and the number of times of processing at this time may be determined according to the interval between stripes in the original image. On the contrary, in the case of the minimum value filter, the bright portion of the stripe is replaced with the luminance value of the dark portion.

【0050】以下、図21に基づいて具体的に説明す
る。図21は、最大値フィルタ処理と最小値フィルタ処
理時における画像信号と対応する画像を示す図である。
最大値フィルタ処理は、例えば、前記図12に示したご
とき3×3サイズの場合、Q0〜Q8の9画素中の輝度
の最大値を注目画素Q0の新たな輝度値とするものであ
る。そのため輝度の高い領域、すなわち明部分が外側に
1画素づつ広がるので、最大値フィルタ処理を行なう
と、図21のS11に示すように明部分が広がる。した
がって、明部分内の黒い欠陥部分が全て無くなるまで最
大値フィルタ処理を行なえば、欠陥部分を消去すること
が出来る。しかし、このような処理を行なうと、明部分
の領域が広がり、黒いストライプの幅が狭くなる。その
ため、最小値フィルタ処理を行なって黒いストライプの
幅を最初の状態に戻す。
A detailed description will be given below with reference to FIG. FIG. 21 is a diagram showing images corresponding to image signals at the time of maximum value filtering and minimum value filtering.
In the maximum value filtering process, for example, in the case of the 3 × 3 size shown in FIG. 12, the maximum value of the brightness among the nine pixels Q0 to Q8 is set as the new brightness value of the target pixel Q0. Therefore, a high-luminance region, that is, a bright portion spreads outward by one pixel, and when the maximum value filtering process is performed, the bright portion spreads as shown in S11 of FIG. Therefore, if the maximum value filtering process is performed until all the black defective portions in the bright portion are eliminated, the defective portions can be erased. However, when such a process is performed, the area of the bright portion is widened and the width of the black stripe is narrowed. Therefore, the minimum value filtering is performed to restore the width of the black stripe to the initial state.

【0051】最小値フィルタ処理は、最大値フィルタ処
理の逆の処理であり、Q0〜Q8の9画素中の輝度の最
小値を注目画素Q0の新たな輝度値とするものである。
そのため輝度の高い領域、すなわち明部分が1画素づつ
狭くなるので、最小値フィルタ処理を行なうと、図21
のS12に示すように明部分が狭くなり、最大値フィル
タ処理と同じ回数だけ最小値フィルタ処理を行なえば、
原画像S10のストライプ幅に戻すことが出来る。この
場合、一旦、消去された欠陥は、最小値フィルタ処理を
行なっても復元されないので、最大値フィルタ処理と最
小値フィルタ処理と行なうことにより、原画像から欠陥
部分のみを消去した画像が得られる。上記のようにして
欠陥部分のみを消去した画像S12を原画像S10から
減算すると、S13に示すように、欠陥部分のみを抽出
する、すなわち強調することが出来る。なお、S13の
画像は白黒を反転して示している。
The minimum value filter process is the reverse of the maximum value filter process, and the minimum value of the brightness among the nine pixels Q0 to Q8 is set as the new brightness value of the target pixel Q0.
As a result, a high-luminance region, that is, a bright portion is narrowed by one pixel.
As shown in S12, the bright part becomes narrower, and if the minimum value filter processing is performed the same number of times as the maximum value filter processing,
The stripe width of the original image S10 can be restored. In this case, the once-erased defect is not restored even if the minimum value filtering process is performed. Therefore, by performing the maximum value filtering process and the minimum value filtering process, an image in which only the defective portion is deleted from the original image is obtained. . By subtracting the image S12 from which only the defective portion is erased as described above from the original image S10, only the defective portion can be extracted, that is, emphasized, as shown in S13. The image of S13 is shown by reversing black and white.

【0052】従来の画像強調処理のように単に微分処理
を用いて欠陥を検出もしくは強調する方式では、明暗ス
トライプ模様の明部と暗部との境界や被検査面以外の領
域およびその領域との境界、もしくは被検査面にデザイ
ンとして施された凹凸や加工部位などの個所においても
輝度変化が存在するので、このように欠陥ではないが輝
度変化のある個所が受光画像中に存在した場合には、上
記のような欠陥ではない個所も強調してしまうという問
題があったが、上記のように本実施例においては、上記
の問題を解消することが出来る。
In the method of detecting or emphasizing a defect by simply using the differential processing like the conventional image emphasizing processing, the boundary between the light and dark portions of the light and dark stripe pattern, the area other than the surface to be inspected and the boundary with the area. Or, since there is a change in brightness even at a portion such as a concavo-convex or a processed portion which is provided as a design on the surface to be inspected, if there is a portion having a change in luminance in the received light image, which is not a defect, Although there is a problem that points other than the above defects are also emphasized, the above problem can be solved in this embodiment as described above.

【0053】次に、明暗模様認識処理P2の他の実施例
について説明する。本実施例は、原画像に対して最大値
フィルタ処理または最小値フィルタ処理を行ってストラ
イプ成分を除去して低周波数成分のみを取り出し、その
結果をしきい値(面)として、ストライプの認識を行う
ものである。前記のごとき最大値フィルタ処理を多数回
行なうと、図22に示すように、輝度の低いストライプ
の暗部分がその周囲の明部分の輝度値に置き換えられる
ので、平滑化された画像信号となる。このときのフィル
タサイズと処理回数は、原画像中のストライプの間隔に
応じて決定すれば良い。最小値フィルタ処理の場合は、
これとは反対にストライプの明部分を暗部分の輝度値に
置き換える処理となる。このような結果をしきい値
(面)として原画像を2値化するが、図22からも明ら
かなように、実際にはこの結果に適当なバイアスを加え
る必要がある。さらに、後記図24、図25で説明する
ように、被検査面の色などによる輝度レベルの違い応じ
て必要なバイアスの値が変化する場合には、原画像の輝
度ヒストグラムに応じて上記バイアスを設定および調節
するようにしてもよい。
Next, another embodiment of the light and dark pattern recognition processing P2 will be described. In this embodiment, the maximum value filtering process or the minimum value filtering process is performed on the original image to remove the stripe components and only the low frequency components are extracted, and the result is used as a threshold value (plane) to recognize the stripes. It is something to do. When the maximum value filtering process as described above is performed a number of times, as shown in FIG. 22, the dark portion of the stripe with low luminance is replaced with the luminance value of the bright portion around it, resulting in a smoothed image signal. The filter size and the number of times of processing at this time may be determined according to the interval between stripes in the original image. For minimum value filtering,
On the contrary, the bright part of the stripe is replaced with the brightness value of the dark part. Although the original image is binarized by using such a result as a threshold value (plane), it is necessary to add an appropriate bias to this result in practice, as is clear from FIG. Further, as will be described later with reference to FIGS. 24 and 25, when the necessary bias value changes according to the difference in the brightness level due to the color of the surface to be inspected, the bias is adjusted according to the brightness histogram of the original image. It may be set and adjusted.

【0054】また、最大値フィルタ処理や最小値フィル
タ処理は、一種の平滑化なので、前記のスムージング処
理として用いても良い。これは、前記画像強調処理の欄
でも説明したように、まず初めに最大値フィルタ処理で
ストライプの明部分に黒く映る欠陥を周囲の明部分の輝
度値で埋め尽くして消去するものである。この結果スト
ライプの暗部分の一部も明部分の輝度値に置き換えられ
るため、暗部分の幅が狭くなってしまうが、上記最大値
フィルタ処理と同じサイズの最小値フィルタ処理を同じ
回数かけることによって、ストライプのみを元の幅に復
帰させておけばよい。このとき欠陥は消去されているの
で再び出現する事はなく、最終的に欠陥のみを消去する
ことができる。
Further, the maximum value filtering process and the minimum value filtering process are a kind of smoothing, and thus may be used as the smoothing process. As described in the section of the image enhancement processing, first, the maximum value filter processing is performed to completely erase the defect appearing black in the bright portion of the stripe by the brightness value of the surrounding bright portion. As a result, a part of the dark part of the stripe is also replaced with the brightness value of the bright part, so that the width of the dark part becomes narrower. However, by applying the minimum value filter process of the same size as the maximum value filter process the same number of times. , Only the stripes should be restored to their original width. At this time, since the defect has been erased, it does not appear again, and only the defect can be finally erased.

【0055】従来の明暗模様認識処理においては、照明
の光量変動やシェーディング(輝度むら)の影響などに
よって輝度レベルの関係が一定であるとは限らないた
め、欠陥でない個所を欠陥と誤検出してしまう、という
問題があったが、上記のように本実施例においてはその
ような問題を解消することが出来る。
In the conventional bright and dark pattern recognition processing, the relationship between the brightness levels is not always constant due to the influence of the light quantity variation of the illumination, the effect of shading (luminance unevenness), etc. Therefore, a non-defective portion is erroneously detected as a defect. However, in the present embodiment, such a problem can be solved as described above.

【0056】次に、明暗模様識別処理P2における2値
化しきい値作成の他の実施例について説明する。本実施
例は、原画像にディジタルローパスフィルタをかけて平
滑化することにより、2値化しきい値(面)を作成する
ものである。図23は、ディジタルローパスフィルタの
一例であり、IIR(無限インパルス応答)フィルタの
ブロック図である。これを数式で表すと下記(数7)式
に示すようになる。 y(n)=(1−k)・x(n)+k・y(n−1) …(数7) ただし、x(n):原画像輝度値 y(n):新輝度値 k:係数(0<k<1) また、伝達関数H(z)は、 H(z)=(1−k)/(1−kz) …(数8) となるので、k→1となるほど急峻な減衰特性のローパ
スフィルタ(平滑化フィルタ)として動作する。なお、
図23において、Dは1画素の遅延回路である。また、
係数kは、原画像に映るストライプの間隔に応じて調節
すれば良い。本実施例は、計算式が簡単であるため、高
速処理が可能であり、メモリの使用量も少なく済む、と
いう利点がある。
Next, another embodiment of creating the binarized threshold value in the bright and dark pattern identifying process P2 will be described. In this embodiment, a binarized threshold value (plane) is created by smoothing an original image by applying a digital low-pass filter. FIG. 23 is a block diagram of an IIR (infinite impulse response) filter, which is an example of a digital low-pass filter. This can be expressed by a mathematical expression as shown in the following (Equation 7). y (n) = (1-k) * x (n) + k * y (n-1) (Equation 7) where x (n): original image brightness value y (n): new brightness value k: coefficient (0 <k <1) Since the transfer function H (z) is H (z) = (1-k) / (1-kz) (Equation 8), the steeper the attenuation as k → 1. It operates as a low pass filter (smoothing filter) with characteristics. In addition,
In FIG. 23, D is a 1-pixel delay circuit. Also,
The coefficient k may be adjusted according to the interval between stripes shown in the original image. The present embodiment has the advantages that the calculation formula is simple, high-speed processing is possible, and the memory usage is small.

【0057】次に、画像強調処理P3および明暗模様識
別処理P2において、被検査面の塗装色などの色によっ
て2値化しきい値が変化する場合の例について説明す
る。図24に示すように、被検査面の色の持つ輝度が高
い(明るい)色と低い(暗い)色では、信号全体の輝度
レベルおよびストライプのコントラストが異なるため、
画像強調処理における2値化しきい値を、色に応じて若
干変化させる必要がある場合がある。そのため本実施例
では、原画像の輝度ヒストグラムをとることにより、被
検査面の色の違いを検出し、それに応じて画像強調処理
における2値化しきい値を微調整する。例えば、図25
に示すように、原画像の輝度ヒストグラフをとると、被
検査面が明るい色の場合には輝度値の高い画素の頻度が
大きく、逆に暗い色の場合には輝度値の低い画素の頻度
が大きくなることから、被検査面の色の違いを検出して
判断し、画像強調処理における2値化しきい値の微調整
を行う。このように本実施例においては、被検査面の色
を特別な装置を用いることなく検出して判定することが
出来る。なお、原画像の輝度ヒストグラムの代わりに所
定の一つのライン(例えば画像中央y=256のx方向
の1ライン)の最大輝度値を用いても同様の処理を行な
うことが出来る。また、前記のように、明暗模様認識処
理における2値化しきい値も上記のように輝度レベルに
応じて調整することが出来る。
Next, an example in which the binarization threshold value changes depending on the color of the surface to be inspected in the image enhancement processing P3 and the light and dark pattern identification processing P2 will be described. As shown in FIG. 24, the high luminance (bright) color and the low luminance (dark) color of the surface to be inspected have different luminance levels of the entire signal and stripe contrast,
It may be necessary to slightly change the binarization threshold value in the image enhancement process depending on the color. Therefore, in this embodiment, by taking the luminance histogram of the original image, the difference in color of the surface to be inspected is detected, and the binarization threshold value in the image enhancement processing is finely adjusted accordingly. For example, in FIG.
As shown in Fig. 4, if the luminance histogram of the original image is taken, the frequency of pixels with high luminance value is high when the surface to be inspected is bright color, and conversely, the frequency of pixels with low luminance value is dark when the surface is dark. Therefore, the difference in color of the surface to be inspected is detected and judged, and the binarization threshold value in the image enhancement processing is finely adjusted. As described above, in this embodiment, the color of the surface to be inspected can be detected and determined without using a special device. The same process can be performed by using the maximum luminance value of a predetermined one line (for example, one line in the x direction of the image center y = 256) instead of the luminance histogram of the original image. Further, as described above, the binarization threshold value in the bright and dark pattern recognition processing can be adjusted according to the brightness level as described above.

【0058】次に、本発明の実用的な実施例について説
明する。図26は、本発明を自動車製造ラインの塗装検
査工程に適用した実施例の斜視図である。図26に示す
ように、塗装された自動車のボディ14が塗装検査ライ
ンを矢印の方向へ流れている。このボディ14の塗装面
の一部分に、所定の明暗模様を映し出し、かつ明暗模様
が映し出された部分を撮像するように、照明装置1、ビ
デオカメラ2がアーチ状に固定された状態で複数個配置
されている。したがって、ボディ14が塗装検査ライン
上を移動し、アーチ状に配置されたビデオカメラとスト
ライプ照明の下を通過する間に、被検査面の欠陥検出が
行われる。このような構成とすることにより、ボディ1
4の塗装面を余すところなく検査することができる。ま
た、ロボットなどを用いてビデオカメラと照明を被検査
面に沿って走査する必要もなく、容易にボディ全面を検
査することができる。
Next, practical examples of the present invention will be described. FIG. 26 is a perspective view of an embodiment in which the present invention is applied to a coating inspection process of an automobile manufacturing line. As shown in FIG. 26, the painted automobile body 14 flows along the coating inspection line in the direction of the arrow. A plurality of lighting devices 1 and video cameras 2 are arranged in an arched shape so that a predetermined light and dark pattern is projected on a part of the painted surface of the body 14 and the part where the light and dark pattern is projected is imaged. Has been done. Therefore, defects are detected on the surface to be inspected while the body 14 moves on the coating inspection line and passes under the arched video camera and stripe illumination. With such a configuration, the body 1
It is possible to thoroughly inspect the painted surface of No. 4. Moreover, it is not necessary to scan the video camera and the illumination along the surface to be inspected by using a robot or the like, and the entire body can be easily inspected.

【0059】次に、本発明の他の実施例について説明す
る。この実施例は、図1(b)のブロック図に相当する
ものであり、明暗模様の明部分にある黒い欠陥と、暗部
分にある白い欠陥との両方を検出するものである。本実
施例において、照明装置1、ビデオカメラ2、カメラコ
ントロールユニット4、画像処理装置5、ホストコンピ
ュータ6等の部分は、前記図1(a)の実施例と同様で
あり、処理内容のみが異なっている。
Next, another embodiment of the present invention will be described. This embodiment corresponds to the block diagram of FIG. 1B and detects both a black defect in a bright portion of a bright and dark pattern and a white defect in a dark portion. In this embodiment, parts such as the illumination device 1, the video camera 2, the camera control unit 4, the image processing device 5, and the host computer 6 are the same as those in the embodiment of FIG. 1A, and only the processing contents are different. ing.

【0060】以下、作用を説明する。被検査面3上に明
暗ストライプが映し出されており、その明部分中および
暗部分中に欠陥があるとすると、その受光画像は図27
(a)のようになり、欠陥は明ストライプ中に黒く、暗
ストライプ中に白く映し出される。図27(a)の受光
画像において、画面左上を原点として座標軸x,yをと
ると、欠陥部分のy座標(*印の値)におけるx方向の
輝度レベルは、図27(b)に示すようになる。画像処
理装置5は、図27(a)の受光画像を図27(b)の
ような原画像の信号S20として取り込む。例えば、画
像信号をA/D変換し、輝度レベルを8bitのディジ
タル値に変換した場合、縦軸において255が最大値で
白、0が黒となり、1画面を512×512画素の分解
能で取り込んだ場合には、横軸は0〜511の画素数と
なる。
The operation will be described below. If bright and dark stripes are projected on the surface 3 to be inspected and there is a defect in the bright portion and the dark portion, the received light image is as shown in FIG.
As shown in (a), the defect appears as black in the light stripe and as white in the dark stripe. In the received light image of FIG. 27A, when the coordinate axes x and y are taken with the upper left corner of the screen as the origin, the luminance level in the x direction at the y coordinate (value of * mark) of the defective portion is as shown in FIG. 27B. become. The image processing device 5 takes in the received light image of FIG. 27A as a signal S20 of the original image as shown in FIG. 27B. For example, when the image signal is A / D converted and the brightness level is converted into a digital value of 8 bits, 255 is the maximum value on the vertical axis, white is 0 and 0 is black, and one screen is captured with a resolution of 512 × 512 pixels. In this case, the horizontal axis represents the number of pixels of 0 to 511.

【0061】次に、図28は、画像処理装置5における
処理内容を示すフローチャートである。画像処理装置5
においては、図28に示すごとく、原画像P1から、平
滑化処理P11、強調処理P12、2値化処理P13、
領域処理P14および面積判定処理P15を行なって欠
陥を検出する。また、上記のごとくにして欠陥を検出し
た後の後処理としては、ラベリング、面積および重心座
標計算P16があり、それらの結果をP17でモニタ等
に表示し、或いは後続機器に出力する。
Next, FIG. 28 is a flow chart showing the processing contents in the image processing apparatus 5. Image processing device 5
28, from the original image P1, the smoothing process P11, the enhancement process P12, the binarization process P13,
A region process P14 and an area determination process P15 are performed to detect a defect. Further, as post-processing after detecting defects as described above, there are labeling, area and barycentric coordinate calculation P16, and the results thereof are displayed on a monitor or the like at P17 or output to a subsequent device.

【0062】以下、上記の各処理の内容について詳細に
説明する。図29は各画像とその信号(或るy座標の
値、この例では図27の*印の値におけるもの)を示す
図である。以下、図29に基づいて画像処理内容につい
て説明する。まず、原画像S20に対して所定のマスク
サイズの平滑化(スムージング)処理を行い、ノイズ等
による微小な輝度変化成分のみを取り除くとS21が得
られる。この平滑化処理は、例えば注目画素およびその
近傍の画素の輝度値の平均値を求め、それを注目画素の
新たな輝度値とする単純平均化フィルタである。このと
きの平滑化フィルタのマスクサイズは、原画像に発生す
るノイズの大きさに応じて決めればよい。次に、S21
を強調処理することで輝度変化のある領域を強調する。
この強調処理は、例えば微分処理であり、xおよびy方
向の微分結果の絶対値の和、もしくは2乗の和の平方根
をとったものであり、輝度変化領域をすべて正(+)側
に出力するとS22に示すようになる。なお、S22の
画像は、白と黒を反転して示している。上記のように、
本実施例では、平滑化処理の後に強調処理を行なう順序
であるが、例えば、前記図18〜図20で説明したよう
に、平滑化と微分処理とを同時に実行し、原画像S20
から直接に処理画像S22を得るようにしてもよい。次
に、S22の結果を所定のしきい値で輝度変化領域を黒
(“0”)それ以外を白(“255”)となるように2
値化すると、S23のようになる。S23の画像に示す
ように、欠陥部分およびストライプ境界部分といった輝
度変化のある領域が抽出される。なお、被検査面の状態
によってはストライプの境界線が歪んで抽出されるが、
上記のように原画像を平滑化することによって、1つの
連続した領域として抽出されるため、被検査面の影響は
ほとんどない。しかし、ストライプの境界線付近では、
被検査面の“ゆず肌”の影響によるノイズが残る可能性
があるので、それを除去するため、前記と同様に、領域
処理を行なう。すなわち、S23の画像における暗部分
(輝度変化のある部分に相当)の領域を拡大する処理を
行なうことにより、ストライプ境界領域と“ゆず肌”に
よるノイズとを連結して1つの領域とする。
The contents of each of the above processes will be described in detail below. FIG. 29 is a diagram showing each image and its signal (at a certain y-coordinate value, in this example, at the value marked with * in FIG. 27). The contents of image processing will be described below with reference to FIG. First, smoothing (smoothing) of a predetermined mask size is performed on the original image S20, and only a minute luminance change component due to noise or the like is removed to obtain S21. This smoothing processing is, for example, a simple averaging filter that obtains an average value of the brightness values of the pixel of interest and pixels in the vicinity thereof and sets it as a new brightness value of the pixel of interest. The mask size of the smoothing filter at this time may be determined according to the size of noise generated in the original image. Next, S21
By emphasizing the area, the area having the brightness change is emphasized.
This emphasis processing is, for example, differential processing, which is the sum of the absolute values of the differential results in the x and y directions, or the square root of the sum of squares, and outputs all the brightness change regions to the positive (+) side. Then, it becomes as shown in S22. The image of S22 is shown by reversing white and black. As described above,
In the present embodiment, the order of performing the emphasizing process after the smoothing process is, for example, as described with reference to FIGS. 18 to 20, the smoothing and the differentiating process are simultaneously executed to obtain the original image S20.
Alternatively, the processed image S22 may be directly obtained from. Next, the result of S22 is set to a predetermined threshold value so that the brightness change region is black (“0”) and the others are white (“255”).
When the value is converted, it becomes as in S23. As shown in the image of S23, areas having a luminance change such as a defective portion and a stripe boundary portion are extracted. Depending on the condition of the surface to be inspected, the boundary line of the stripe is distorted and extracted,
By smoothing the original image as described above, the original image is extracted as one continuous region, so that the surface to be inspected is hardly affected. However, near the border of the stripe,
Since there is a possibility that noise will be left due to the effect of the "skinned skin" on the surface to be inspected, in order to remove it, area processing is performed in the same manner as described above. That is, by performing the process of enlarging the dark area (corresponding to the area where the brightness changes) in the image in S23, the stripe boundary area and the noise due to the "discolored skin" are connected into one area.

【0063】次に、上記の結果について、各部分の面積
判定を行なう。S23の画像から明らかなように、欠陥
部分の面積(大きさ)はストライプ境界部分の面積に比
べて大幅に小さいので、所定面積以下の領域を欠陥と判
定するといった判定処理を行うことにより、欠陥のみを
抽出することが出来る。この面積判定結果はS24に示
すようになり、明暗ストライプ画像の明部分に黒く映る
欠陥と暗部分に白く映る欠陥との両方を検出することが
出来る。ただし、明暗の境界部分(輝度変化のある部
分)は欠陥検出を行なうことが出来ないので、前記図1
(a)の実施例と同様に、被検査面全体を検査するに
は、被検査物体もしくは照明手段と撮像手段を順次移動
させ、明部分が被検査面全体を走査するように構成する
(例えば前記図26の構成)。ただ、前記図1(a)の
実施例よりも1画面中で欠陥検査を行なうことの出来る
領域が広範囲なので、検査を迅速に行なうことが可能で
ある。
Next, the area of each part is determined based on the above result. As is clear from the image in S23, the area (size) of the defective portion is significantly smaller than the area of the stripe boundary portion, and therefore the defect processing is performed by performing a determination process such as determining a region having a predetermined area or less as a defect. Only can be extracted. This area determination result is as shown in S24, and it is possible to detect both the defect that appears black in the bright portion and the defect that appears white in the dark portion of the bright-dark stripe image. However, since it is not possible to detect defects in the boundary portion of brightness and darkness (the portion where there is a change in luminance), the above-mentioned FIG.
Similar to the embodiment of (a), in order to inspect the entire surface to be inspected, the object to be inspected or the illumination means and the image pickup means are sequentially moved so that the bright part scans the entire surface to be inspected (for example, 26). However, as compared with the embodiment of FIG. 1 (a), the area in which the defect inspection can be performed is wider in one screen, so that the inspection can be performed quickly.

【0064】次に、被検査面が曲面の場合おける特別な
処理について説明する。上記実施例においては、面積判
定によって欠陥を検出するため、次のような問題が生じ
る。すなわち、図30に示すように、被検査面が曲面の
場合には、ストライプが曲面に沿って変形する。そのた
め、ストライプ境界線が画面隅に途切れて面積が小さく
なる場合(○印で囲んだ部分)が生じることがある。こ
のような場合には、面積判定においてこの部分を欠陥と
誤検出してしまう可能性がある。そのため、ストライプ
境界線は必ずウィンドウ(画面4辺)のいずれかに接し
ている、という性質を利用し、検出領域がウィンドウに
接している場合には、その領域を処理対象から除く処理
を行えばよい。具体的には、1画面が512×480画
素の場合に、検出領域のxおよびy座標の最大および最
小点が0、479もしくは511のいずれかであったな
らば、その領域がウィンドウに接しているものと判断
し、その部分を除けばよい。
Next, special processing when the surface to be inspected is a curved surface will be described. In the above-mentioned embodiment, since the defect is detected by the area determination, the following problems occur. That is, as shown in FIG. 30, when the surface to be inspected is a curved surface, the stripe is deformed along the curved surface. Therefore, there may be a case where the stripe boundary line is cut off at the corner of the screen and the area becomes small (a portion surrounded by a circle). In such a case, this portion may be erroneously detected as a defect in the area determination. Therefore, the property that the stripe boundary line is always in contact with one of the windows (four sides of the screen) is used. When the detection area is in contact with the window, if the area is excluded from the processing target, Good. Specifically, if one screen has 512 × 480 pixels, and the maximum and minimum points of the x and y coordinates of the detection area are 0, 479 or 511, the area is in contact with the window. It is judged that there is one, and that part can be removed.

【0065】また、上記の問題を解決する他の方法とし
て次のような方法もある。すなわち、図31に示すよう
に、画面周囲を1画素分だけ(図31の斜線部分)検出
領域と同じ輝度値(図31では黒)とすることにより、
ストライプ境界線が全て連結され、1つの領域となるた
め面積が大きくなり、面積判定がより確実に行われる。
Another method for solving the above problem is as follows. That is, as shown in FIG. 31, by setting the same brightness value (black in FIG. 31) as the detection area around the screen for one pixel (hatched portion in FIG. 31),
Since all the stripe boundary lines are connected to form one region, the area becomes large, and the area determination is performed more reliably.

【0066】また、上記の問題を解決するためのさらに
他の方法として次のような方法もある。照明装置1のス
トライプ板1cに、ストライプに対して斜めに、白スト
ライプ内には黒、黒ストライプ内には白となるようなの
線を入れ、さらにこの線に交差するような上記と同様の
線をもう1本予め入れておく。そのような照明装置を用
いた場合のストライプ画像は、図32(a)に示すよう
になる。このような原画像を処理すれば、図32(b)
に示すようになり、ストライプ境界線がすべて連結した
1つの領域となるため、面積が大きくなり、面積判定が
より確実に行われる。
Further, there is the following method as another method for solving the above problem. On the stripe plate 1c of the illuminating device 1, a line that is diagonal to the stripe, is black in the white stripe, and is white in the black stripe, and intersects with this line. Put another one in advance. A stripe image when such an illuminating device is used is as shown in FIG. If such an original image is processed, FIG.
As shown in (1), the stripe boundary lines are all connected to form a single region, so that the area becomes large and the area determination is performed more reliably.

【0067】ただし、前記の図26のように、被検査体
を順次移動させて広い面積を検査する場合に、被検査体
の移動方向と上記の斜めの線の方向とが一致すると、そ
の線の境界部分に欠陥があった場合には、欠陥が検出さ
れないことになる。したがって、上記の斜めの線と移動
方向とが一致しないように設定する必要がある。なお、
上記図1(b)に相当する実施例において、前記図1
(a)に相当する実施例で説明した照明手段の構成、2
値化しきい値の設定方法や領域処理の具体的方法、実用
化装置等については、前記と同様に適用することが出来
る。
However, as shown in FIG. 26, when the object to be inspected is sequentially moved to inspect a large area, if the moving direction of the object to be inspected and the direction of the above-mentioned oblique line match, the line is moved. If there is a defect in the boundary part of, the defect will not be detected. Therefore, it is necessary to set so that the above-mentioned diagonal line and the moving direction do not match. In addition,
In the embodiment corresponding to FIG.
Configuration of the illumination means described in the embodiment corresponding to (a), 2
The setting method of the threshold value, the specific method of the area processing, the practical application device and the like can be applied in the same manner as described above.

【0068】次に、前記照明装置1におけるストライプ
照明の実用的な設定方法、すなわち、ストライプの間隔
T、白と黒の比率および検査面からの距離Dの設定方法
について説明する。まず、図33に基づいて、ビデオカ
メラ2の検査範囲Lについて説明する。
Next, a practical setting method of stripe illumination in the illuminating device 1, that is, a method of setting the stripe interval T, the ratio of white to black, and the distance D from the inspection surface will be described. First, the inspection range L of the video camera 2 will be described with reference to FIG.

【0069】図33において、レンズおよび受光素子
(例えばCCD)で構成されるビデオカメラ2から被検
査面3までの距離をa、被検査面3における検査範囲
(カメラ視野)をL、視野角をθg、焦点距離をb、素
子サイズをcとすると、 L:a=c:b の関係が成立するので、使用するビデオカメラのレンズ
や検出範囲が決定すれば、距離aも決定される。例え
ば、自動車の塗装検査工程で使用する場合には、検査効
率やスペースを考慮すると、L=100〜200mm、a
=50〜100cm程度が適当である。また、図34に示
すように、ビデオカメラ2を被検査面3に対して角度θ
iの方向に配置した場合には、検査範囲Lは図33の場
合よりもやや広くなる。被検査面3の平面における検査
範囲Lの端部をそれぞれJ1、J2とすると、図34のよ
うに、J1、J2での正反射方向に照明装置1が配置され
ていれば、検査範囲L全体にストライプ光を照射するこ
とが出来る。この時の照明装置1までの距離がDとな
る。
In FIG. 33, the distance from the video camera 2 composed of a lens and a light receiving element (for example, CCD) to the surface 3 to be inspected is a, the inspection range (camera field of view) on the surface to be inspected L is L, and the viewing angle is. When θg, the focal length is b, and the element size is c, the relationship of L: a = c: b holds. Therefore, if the lens of the video camera to be used and the detection range are determined, the distance a is also determined. For example, when used in the coating inspection process of automobiles, considering inspection efficiency and space, L = 100 to 200 mm, a
== about 50 to 100 cm is suitable. In addition, as shown in FIG.
When arranged in the i direction, the inspection range L is slightly wider than in the case of FIG. Assuming that the end portions of the inspection range L on the plane of the surface 3 to be inspected are J 1 and J 2 , respectively, as shown in FIG. 34, if the illuminating device 1 is arranged in the regular reflection directions at J 1 and J 2 . Stripe light can be applied to the entire inspection range L. The distance to the lighting device 1 at this time is D.

【0070】次に、図35の点J1に欠陥があった場合
について考察する。図35において、正反射方向を基準
の0(deg)とし、欠陥の凹凸による乱反射角度を±α
(deg)(ただし、±の符号は方向を示す)とする。図
36は、いわゆる“ごみつぶ”と呼ばれる凸状の欠陥の
測定結果を示す図である。このような測定結果から欠陥
上の任意の複数の点における角度θの分布を求めれば、
各点における乱反射角度αが求められる。次に、図37
に示すように、点J1が欠陥の左斜面上にあるものとし
て考えると、乱反射角が+αよりも大きい方向にストラ
イプ照明の黒ストライプがある場合、その点での角度θ
よりも大きい傾斜角を持つ範囲は周囲よりも暗く映るこ
とになる。この範囲をWとすると、Wとαの関係は図3
8に示すようになる。したがって図38から欠陥におけ
る傾斜角θが何度以上の範囲が白ストライプ内の黒点と
して映るかが求められる。例えば、L=150mmの視野
を512画素の分解能で撮像した場合、幅1mmの欠陥は
約3画素の幅で映ることになり、欠陥検出が可能である
と判断できる。したがって図38からW=1mmとなるよ
うなαを見つけることが出来る。例えば、図39におい
て、ストライプの白と黒の比率を2:1とした場合、白
ストライプが−5〜5(deg)、−10〜20(deg)、
黒ストライプが5〜10(deg)、20〜25(deg)と
いう角度αの比率で、(W1−W2)+W3≧1mmである
とする。これに基づいて図40に示すように、J1、J2
からそれぞれ上記比率の角度αの線を引く。そして黒ス
トライプ方向(上記の5〜10deg、20〜25deg範
囲)の交わった部分に黒ストライプが存在すればよい。
このように、図40からストライプのおおよその間隔T
と距離Dを決定することが出来る。上記のように、検出
したい最小の欠陥について図36のような傾斜角度分布
を求め、これに基づいて上記のようにストライプ照明の
設定を行なえば、欠陥検査に最適な照明を得ることが出
来る。
Next, consider the case where there is a defect at point J 1 in FIG. In FIG. 35, the regular reflection direction is set to 0 (deg) as a reference, and the irregular reflection angle due to the unevenness of the defect is ± α.
(Deg) (however, the sign of ± indicates the direction). FIG. 36 is a diagram showing a measurement result of a convex defect called "dust". If the distribution of angles θ at arbitrary points on the defect is obtained from such measurement results,
The diffuse reflection angle α at each point is obtained. Next, FIG.
As shown in FIG. 3, assuming that the point J 1 is on the left slope of the defect, when there is a black stripe of stripe illumination in the direction in which the diffused reflection angle is larger than + α, the angle θ at that point
Areas with a larger tilt angle appear darker than the surroundings. Letting this range be W, the relationship between W and α is shown in FIG.
As shown in 8. Therefore, from FIG. 38, it is necessary to determine how many times or more the inclination angle θ of the defect appears as a black dot in the white stripe. For example, when a field of view of L = 150 mm is imaged with a resolution of 512 pixels, a defect having a width of 1 mm appears in a width of about 3 pixels, and it can be determined that the defect can be detected. Therefore, α can be found from FIG. 38 so that W = 1 mm. For example, in FIG. 39, if the ratio of white to black in the stripe is 2: 1, the white stripe has -5 to 5 (deg), -10 to 20 (deg),
It is assumed that the black stripe is (W 1 −W 2 ) + W 3 ≧ 1 mm at a ratio of the angle α of 5 to 10 (deg) and 20 to 25 (deg). Based on this, as shown in FIG. 40, J 1 , J 2
From the above, draw the line of the angle α of the above ratio. Then, it suffices that the black stripes exist at the intersections of the black stripe directions (the above-mentioned range of 5 to 10 deg and 20 to 25 deg).
Thus, from FIG. 40, the approximate spacing T of the stripes is
And the distance D can be determined. As described above, if the inclination angle distribution as shown in FIG. 36 is obtained for the smallest defect to be detected and the stripe illumination is set based on this, the optimal illumination for the defect inspection can be obtained.

【0071】さらに、厳密な間隔Tと距離Dを求めるた
めには、前記の乱反射の原理式(数1)式、(数2)式
を用いて、検出範囲Lにおける角度計算を行なってもよ
い。なお、上記の説明においては、検出範囲Lの端部J
1、J2について考えたが、他の複数の点を含めて考えれ
ば、さらに厳密な照明設定を行なうことが出来る。ま
た、図34から、θgが小さいほど照明装置1も小型で
済むことが判る。また、被検査面3が曲面の場合は、曲
率半径Rおよび中心角θcを考慮した前記(数4)式に
基づいて、上記の平面の場合と同様に計算、設計すれば
よい。なお、ストライプ照明の設定方法は、上記の例に
限定されるものではない。
Furthermore, in order to obtain the strict interval T and the distance D, the angle calculation in the detection range L may be performed using the above-mentioned diffuse reflection principle formulas (Formula 1) and (Formula 2). . In the above description, the end portion J of the detection range L is
Although I considered 1 and J 2 , more rigorous illumination settings can be made by considering other points. Further, it can be seen from FIG. 34 that the smaller θg is, the smaller the illumination device 1 is. When the surface 3 to be inspected is a curved surface, calculation and design may be performed in the same manner as in the case of the above-mentioned plane, based on the equation (4) in consideration of the radius of curvature R and the central angle θc. The method for setting the stripe illumination is not limited to the above example.

【0072】[0072]

【発明の効果】以上説明してきたように、この発明にお
いては、いわゆる“ゆず肌”のような欠陥とならない極
めて薄い凹凸による影響を生じやすい領域を欠陥検出領
域から排除するように構成したことにより、“ゆず肌”
を欠陥と誤検出するおそれがなくなり、より高精度の欠
陥検出を行なうことが出来る、という効果が得られる。
また、上記の影響を生じやすい領域を欠陥検出領域から
排除するための領域処理を行なう量を、実験等であらか
じめ求めておいた値に設定するものにおいては、実際の
検査時に、処理量を簡単に設定することが出来、また、
入力画像毎に被検査面の表面粗さを測定し、その結果か
ら処理の最適な量を自動的に求めるものにおいては、そ
れぞれの被検査体に応じた最適な量に設定することが出
来、精密な検査を行なうことが出来る。また、明暗パタ
ーン画像の輝度ヒストグラムに基づいて2値化しきい値
を調節するものにおいては、色による明暗の変化に左右
されることなく、精度の良い検査が実現できる。また、
面積判定によって欠陥を検出するものにおいて、ストラ
イプ境界線部分を一繋がりの領域とするように構成した
ものにおいては、曲面による影響を排除し、常に精度の
良い検査が実現できる。また、工場ラインにおいて、被
検査物体をアーチ状に囲むように複数の照明手段と撮像
手段とを配置したものにおいては、ロボット等の高価な
装置を用いることなく被検査物体全面を容易に検査する
ことができる、等の効果が得られる。
As described above, according to the present invention, the region where the influence of extremely thin unevenness which is not a defect such as so-called "discolored skin" is likely to occur is excluded from the defect detection region. , "Yuzu skin"
There is no possibility of erroneously detecting a defect as a defect, and it is possible to obtain a more accurate defect detection.
In addition, in the case where the amount of area processing for eliminating the above-described areas that are likely to be affected from the defect detection area is set to a value obtained in advance by experiments, etc., the amount of processing can be simplified at the time of actual inspection. Can be set to
In the case of measuring the surface roughness of the surface to be inspected for each input image and automatically finding the optimum amount of processing from the result, it is possible to set the optimum amount according to each inspected object, A precise inspection can be performed. Further, in the case where the binarization threshold value is adjusted based on the brightness histogram of the light and dark pattern image, accurate inspection can be realized without being influenced by the change in light and dark due to color. Also,
In the case where a defect is detected by area determination and the stripe boundary line portion is formed as a continuous region, the influence of the curved surface can be eliminated and an accurate inspection can always be realized. Further, in a factory line in which a plurality of illumination means and imaging means are arranged so as to surround an object to be inspected in an arch shape, the entire surface of the object to be inspected can be easily inspected without using an expensive device such as a robot. It is possible to obtain effects such as.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の機能ブロック図。FIG. 1 is a functional block diagram of the present invention.

【図2】本発明の第1の実施例図。FIG. 2 is a diagram of a first embodiment of the present invention.

【図3】図1の実施例における画像処理装置5の一例の
ブロック図。
3 is a block diagram of an example of an image processing apparatus 5 in the embodiment of FIG.

【図4】図1の実施例における照明装置1の一例の分解
斜視図。
FIG. 4 is an exploded perspective view of an example of the lighting device 1 in the embodiment of FIG.

【図5】図1の実施例における照明装置1の他の一例の
斜視図。
5 is a perspective view of another example of the lighting device 1 in the embodiment of FIG.

【図6】被検査物の表面上の欠陥を受光画像に映し出す
原理を示す図。
FIG. 6 is a diagram showing the principle of displaying a defect on the surface of the inspection object in a received light image.

【図7】被検査物の表面上の欠陥を受光画像に映し出す
原理を示す図。
FIG. 7 is a diagram showing a principle of displaying a defect on a surface of an inspection object in a received light image.

【図8】被検査表面が曲面の場合を説明するための図。FIG. 8 is a diagram for explaining a case where the surface to be inspected is a curved surface.

【図9】受光画像とその画像信号とを示す図。FIG. 9 is a diagram showing a received light image and its image signal.

【図10】第1の実施例における処理内容を示すフロー
チャート。
FIG. 10 is a flowchart showing the processing contents in the first embodiment.

【図11】原画像の信号に含まれる各成分を示す図。FIG. 11 is a diagram showing each component included in a signal of an original image.

【図12】平滑化フィルタ(スムージング)を説明する
ための画素図。
FIG. 12 is a pixel diagram for explaining a smoothing filter (smoothing).

【図13】第1の実施例の各処理における信号を示す
図。
FIG. 13 is a diagram showing signals in each processing of the first embodiment.

【図14】被検査表面の粗さによるストライプ画像の乱
れを示す図。
FIG. 14 is a view showing a disorder of a stripe image due to roughness of a surface to be inspected.

【図15】明暗領域処理を説明するための画素図。FIG. 15 is a pixel diagram for explaining bright and dark area processing.

【図16】表面粗さ測定を説明するための画像図および
特性図。
FIG. 16 is an image diagram and a characteristic diagram for explaining the surface roughness measurement.

【図17】照明装置の他の明暗模様を示す図。FIG. 17 is a diagram showing another bright and dark pattern of the lighting device.

【図18】正規関数の関数形を示す図。FIG. 18 is a diagram showing a function form of a normal function.

【図19】正規関数を2次微分した関数形を示す図。FIG. 19 is a diagram showing a functional form obtained by quadratic differentiating a normal function.

【図20】図19のデジタル化した特性を示す図。20 is a diagram showing the digitized characteristic of FIG. 19;

【図21】最大値フィルタ処理と最小値フィルタ処理を
用いた画像強調処理を説明するための画像信号と画像と
を示す図。
FIG. 21 is a diagram showing an image signal and an image for explaining image enhancement processing using maximum value filtering processing and minimum value filtering processing.

【図22】最大値フィルタ処理の結果を示す図。FIG. 22 is a diagram showing a result of maximum value filter processing.

【図23】ディジタルローパスフィルタの一例のブロッ
ク図。
FIG. 23 is a block diagram of an example of a digital low pass filter.

【図24】色による輝度変化のある場合の画像信号を示
す図。
FIG. 24 is a diagram showing an image signal in the case where there is a luminance change due to color.

【図25】色による輝度変化のある場合の輝度の頻度を
示す図。
FIG. 25 is a diagram showing the frequency of luminance when there is a luminance change due to color.

【図26】本発明を自動車ボディ塗装検査ラインに適用
した場合の実施例を示す斜視図。
FIG. 26 is a perspective view showing an embodiment when the present invention is applied to an automobile body coating inspection line.

【図27】本発明の第2の実施例における受光画像とそ
の画像信号を示す図。
FIG. 27 is a diagram showing a received light image and its image signal in the second embodiment of the present invention.

【図28】第2の実施例における処理内容を示すフロー
チャート。
FIG. 28 is a flowchart showing the processing contents in the second embodiment.

【図29】本発明の第2の実施例の各処理における画像
とその画像信号とを示す図。
FIG. 29 is a diagram showing an image and its image signal in each processing of the second embodiment of the present invention.

【図30】被検査面が曲面の場合における画像の変化を
示す図。
FIG. 30 is a diagram showing a change in an image when the surface to be inspected is a curved surface.

【図31】画面周辺の1画素分を変換した結果を示す
図。
FIG. 31 is a diagram showing a result of converting one pixel around the screen.

【図32】照明装置に斜めのストライプを付加したもの
における受光画像とその画像信号を示す図。
FIG. 32 is a diagram showing a light-receiving image and its image signal in a lighting device to which an oblique stripe is added.

【図33】ビデオカメラの各数値と検査範囲Lとの関係
を示す図。
FIG. 33 is a diagram showing the relationship between each numerical value of the video camera and the inspection range L.

【図34】検査範囲Lを説明するための図。FIG. 34 is a diagram for explaining an inspection range L.

【図35】欠陥と検出角度との関係を説明するための
図。
FIG. 35 is a diagram for explaining the relationship between a defect and a detection angle.

【図36】凸状の欠陥の測定結果を示す図。FIG. 36 is a diagram showing a measurement result of a convex defect.

【図37】点J1が欠陥の左斜面上にある場合の例を説
明するための図。
FIG. 37 is a view for explaining an example in which the point J 1 is on the left slope of the defect.

【図38】Wとαの関係を示す特性図。FIG. 38 is a characteristic diagram showing the relationship between W and α.

【図39】Wとαの関係の一例を示す特性図。FIG. 39 is a characteristic diagram showing an example of the relationship between W and α.

【図40】ストライプの間隔Tと距離Dを決定する方法
を説明するための図。
FIG. 40 is a view for explaining a method of determining the stripe interval T and the distance D.

【符号の説明】[Explanation of symbols]

1…照明装置 6…ホストコ
ンピュータ 1a…光源 7…モニタ 1b…拡散板 8…バッファ
アンプ 1c…ストライプ板 9…A/D変
換器 1d…背景 10…MPU 2…ビデオカメラ 11…メモリ 3…被検査面 12…D/A変
換器 4…カメラコントロールユニット 13…欠陥 5…画像処理装置 14…ボディ
DESCRIPTION OF SYMBOLS 1 ... Illumination device 6 ... Host computer 1a ... Light source 7 ... Monitor 1b ... Diffusion plate 8 ... Buffer amplifier 1c ... Stripe plate 9 ... A / D converter 1d ... Background 10 ... MPU 2 ... Video camera 11 ... Memory 3 ... Inspected Surface 12 ... D / A converter 4 ... Camera control unit 13 ... Defect 5 ... Image processing device 14 ... Body

Claims (23)

【特許請求の範囲】[Claims] 【請求項1】被検査面に光を照射し、その被検査面から
の反射光に基づいて受光画像を作成し、この受光画像に
基づいて被検査面上の欠陥を検出する表面欠陥検査装置
において、 被検査面に所定の明暗パターンを映し出す照明手段と、 上記被検査面を撮像して得られる受光画像を電気信号の
画像データに変換する撮像手段と、 上記撮像手段によって得られた画像データを処理して明
部と暗部を識別する明暗模様識別手段と、 上記明暗模様識別手段によって得られた暗部分の領域を
拡大する処理を行なう明暗領域処理手段と、 上記画像データにおける周波数成分のうち高い周波数領
域で、かつレベルが所定値以上の成分のみを抽出する画
像強調手段と、 上記明暗領域処理手段における明部分と上記画像強調手
段で抽出した成分との両方が存在する部分を欠陥として
検出する欠陥検出手段と、 を備えたことを特徴とする表面欠陥検査装置。
1. A surface defect inspection apparatus for irradiating a surface to be inspected with light, creating a light-receiving image based on light reflected from the surface to be inspected, and detecting defects on the surface to be inspected based on the light-receiving image. In, an illumination means for displaying a predetermined light and dark pattern on the surface to be inspected, an imaging means for converting a light-receiving image obtained by imaging the surface to be inspected into image data of an electric signal, and image data obtained by the image capturing means. Of the frequency components in the image data, the bright and dark pattern identifying means for processing the light portion and the dark portion to identify the bright portion and the dark portion, the bright and dark area processing means for expanding the area of the dark portion obtained by the light and dark pattern identifying means, There are both an image enhancing means for extracting only a component in a high frequency region and a level equal to or higher than a predetermined value, and a bright portion in the bright / dark region processing means and a component extracted by the image enhancing means. Surface defect inspection apparatus characterized by comprising a defect detection means for detecting as a defect a portion.
【請求項2】上記明暗領域処理手段は、被検査面の粗さ
に応じて予め定められた所定値だけ暗部分の領域を拡大
するものである、ことを特徴とする請求項1に記載の表
面欠陥検査装置。
2. The light and dark area processing means enlarges the area of the dark portion by a predetermined value which is predetermined according to the roughness of the surface to be inspected. Surface defect inspection device.
【請求項3】上記明暗領域処理手段は、上記撮像手段で
求めた画像データから得られる被検査面の粗さに応じた
値だけ暗部分の領域を拡大するものである、ことを特徴
とする請求項1に記載の表面欠陥検査装置。
3. The light and dark area processing means enlarges the area of the dark portion by a value corresponding to the roughness of the surface to be inspected obtained from the image data obtained by the image pickup means. The surface defect inspection apparatus according to claim 1.
【請求項4】上記明暗領域処理手段は、一旦、暗部分の
領域を拡大した後、暗部分の領域を縮小する処理を行な
うものである、ことを特徴とする請求項1乃至請求項3
のいずれかに記載の表面欠陥検査装置。
4. The light and dark area processing means, which temporarily enlarges the area of the dark portion and then reduces the area of the dark portion.
The surface defect inspection apparatus according to any one of 1.
【請求項5】上記画像強調手段は、上記撮像手段によっ
て得られた画像データの原画像と、原画像に所定の平滑
化処理を施した画像との差を求め、その結果を所定のし
きい値で2値化するものである、ことを特徴とする請求
項1乃至請求項4のいずれかに記載の表面欠陥検査装
置。
5. The image enhancing means obtains a difference between an original image of the image data obtained by the image pickup means and an image obtained by subjecting the original image to a predetermined smoothing process, and the result is a predetermined threshold. The surface defect inspection apparatus according to any one of claims 1 to 4, wherein the value is binarized.
【請求項6】上記画像強調手段は、上記撮像手段によっ
て得られた画像データの原画像を正規関数で平滑化した
のち2次微分した結果を所定のしきい値で2値化するも
のである、ことを特徴とする請求項1乃至請求項4のい
ずれかに記載の表面欠陥検査装置。
6. The image emphasizing means smoothes an original image of the image data obtained by the imaging means with a normal function and then second-order-differentiates the binarized result with a predetermined threshold value. The surface defect inspection apparatus according to any one of claims 1 to 4, wherein.
【請求項7】上記画像強調手段は、上記撮像手段によっ
て得られた画像データの原画像に所定の最大値フィルタ
処理を行なったのち最小値フィルタ処理を行なった画像
と、原画像との差を求め、その結果を所定のしきい値で
2値化するものである、ことを特徴とする請求項1乃至
請求項4のいずれかに記載の表面欠陥検査装置。
7. The image enhancing means determines the difference between the original image and the original image of the original image of the image data obtained by the image pickup means after the predetermined maximum value filtering process and the minimum value filtering process. The surface defect inspection apparatus according to any one of claims 1 to 4, wherein the obtained result is binarized at a predetermined threshold value.
【請求項8】上記明暗模様識別手段は、上記撮像手段に
よって得られた画像データの原画像に対して所定の平滑
化処理を行い、その結果をしきい値として明部分と暗部
分の2値化すなわち認識を行なうものである、ことを特
徴とする請求項1乃至請求項7のいずれかに記載の表面
欠陥検査装置。
8. The light / dark pattern identifying means performs a predetermined smoothing process on the original image of the image data obtained by the image pickup means, and the result is used as a threshold value to binarize a bright part and a dark part. The surface defect inspection apparatus according to any one of claims 1 to 7, wherein the surface defect inspection apparatus is configured to perform a change or recognition.
【請求項9】上記明暗模様識別手段は、上記撮像手段に
よって得られた画像データの原画像に対して所定の最大
値フィルタ処理または最小値フィルタ処理を行い、その
結果をしきい値として明部分と暗部分の2値化すなわち
認識を行なうものである、ことを特徴とする請求項1乃
至請求項7のいずれかに記載の表面欠陥検査装置。
9. The light and dark pattern identifying means performs predetermined maximum value filtering processing or minimum value filtering processing on the original image of the image data obtained by the image capturing means, and the result is used as a threshold value for a bright portion. 8. The surface defect inspection apparatus according to claim 1, wherein the dark part is binarized, that is, recognized.
【請求項10】上記明暗模様識別手段は、上記撮像手段
によって得られた画像データの原画像に対して所定の係
数のディジタルローパスフィルタ処理を行い、その結果
をしきい値として明部分と暗部分の2値化すなわち認識
を行なうものである、ことを特徴とする請求項1乃至請
求項7のいずれかに記載の表面欠陥検査装置。
10. The light / dark pattern identifying means performs digital low-pass filter processing with a predetermined coefficient on the original image of the image data obtained by the image pickup means, and the result is used as a threshold value for a bright portion and a dark portion. 8. The surface defect inspection apparatus according to claim 1, wherein the surface defect inspection apparatus is for binarizing, that is, recognizing.
【請求項11】上記画像強調手段および上記明暗模様識
別手段の2値化において、上記撮像手段によって得られ
た画像データの原画像の輝度ヒストグラムまたは所定の
一つのラインの最大輝度値を求め、その結果に基づいて
上記2値化しきい値を調節することを特徴とする請求項
1乃至請求項10のいずれかに記載の表面欠陥検査装
置。
11. A binarization of the image emphasizing means and the light / dark pattern identifying means, a luminance histogram of an original image of image data obtained by the imaging means or a maximum luminance value of a predetermined line is obtained, 11. The surface defect inspection apparatus according to claim 1, wherein the binarization threshold value is adjusted based on the result.
【請求項12】被検査面に光を照射し、その被検査面か
らの反射光に基づいて受光画像を作成し、この受光画像
に基づいて被検査面上の欠陥を検出する表面欠陥検査装
置において、 被検査面に所定の明暗パターンを映し出す照明手段と、 上記被検査面を撮像して得られた受光画像を電気信号の
画像データに変換する撮像手段と、 上記撮像手段によって得られた画像データを平滑化する
平滑化手段と、 上記平滑化手段で平滑化した画像データで輝度変化のあ
る部分を抽出する強調手段と、 上記強調手段の結果を2値化する2値化手段と、 上記2値化手段で得られた2値信号のうち上記輝度変化
のある部分に相当する値部分の領域を拡大する処理を行
なう領域処理手段と、 上記領域処理手段で得られた上記領域をそれぞれ演算す
ることによって1画面中に存在する輝度変化のある部分
毎にそれぞれの面積を求め、その面積が所定値以下であ
った部分を欠陥として検出する面積判定処理手段と、 を備えたことを特徴とする表面欠陥検査装置。
12. A surface defect inspection apparatus for irradiating a surface to be inspected with light, forming a light-receiving image based on the light reflected from the surface to be inspected, and detecting a defect on the surface to be inspected based on the light-receiving image. In, an illuminating means for displaying a predetermined light and dark pattern on the surface to be inspected, an image pickup means for converting a received light image obtained by imaging the surface to be inspected into image data of an electric signal, and an image obtained by the image pickup means. Smoothing means for smoothing the data; enhancement means for extracting a portion having a brightness change in the image data smoothed by the smoothing means; binarization means for binarizing the result of the enhancement means; The area processing means for enlarging the area of the value portion corresponding to the portion having the luminance change in the binary signal obtained by the binarizing means, and the area obtained by the area processing means are respectively calculated. By doing Area determination processing means for obtaining an area for each portion having a brightness change existing in one screen and detecting a portion whose area is equal to or smaller than a predetermined value as a defect. Defect inspection equipment.
【請求項13】上記領域処理手段は、被検査面の粗さに
応じて予め定められた所定値だけ上記輝度変化のある部
分に相当する値部分の領域を拡大するものである、こと
を特徴とする請求項12に記載の表面欠陥検査装置。
13. The area processing means enlarges the area of the value portion corresponding to the portion having the luminance change by a predetermined value determined in advance according to the roughness of the surface to be inspected. The surface defect inspection apparatus according to claim 12.
【請求項14】上記領域処理手段は、上記撮像手段で求
めた画像データから得られる被検査面の粗さに応じた値
だけ上記輝度変化のある部分に相当する値部分の領域を
拡大するものである、ことを特徴とする請求項12に記
載の表面欠陥検査装置。
14. The area processing means enlarges the area of the value portion corresponding to the portion having the luminance change by a value corresponding to the roughness of the surface to be inspected obtained from the image data obtained by the image pickup means. The surface defect inspection apparatus according to claim 12, wherein
【請求項15】上記領域処理手段は、一旦、上記輝度変
化のある部分に相当する値部分の領域を拡大した後、該
領域を縮小する処理を行なうものである、ことを特徴と
する請求項12乃至請求項14のいずれかに記載の表面
欠陥検査装置。
15. The area processing means temporarily enlarges the area of the value portion corresponding to the portion having the brightness change and then reduces the area. The surface defect inspection apparatus according to any one of claims 12 to 14.
【請求項16】上記面積判定手段は、上記2値化した画
像における画面の周辺境界に接する所定領域を除去した
後に、面積判定処理を行なうものである、ことを特徴と
する請求項12乃至請求項15のいずれかに記載の表面
欠陥検査装置。
16. The area determining means performs the area determining process after removing a predetermined region in contact with the peripheral boundary of the screen in the binarized image. Item 16. The surface defect inspection device according to any one of items 15.
【請求項17】上記面積判定手段は、上記2値化した画
像における画面の周辺境界に接する1画素分を上記輝度
変化のある部分と同値にしたのち面積判定を行なうもの
である、ことを特徴とする請求項12乃至請求項15の
いずれかに記載の表面欠陥検査装置。
17. The area determining means determines the area after making one pixel, which is in contact with the peripheral boundary of the screen in the binarized image, the same value as the portion having the luminance change. The surface defect inspection apparatus according to any one of claims 12 to 15.
【請求項18】上記照明手段は、明暗パターンとして平
行なストライプとそれを斜めに横切る線とからなる模様
を映しだすものである、ことを特徴とする請求項12乃
至請求項17のいずれかに記載の表面欠陥検査装置。
18. The illuminating means displays a pattern consisting of parallel stripes and a line diagonally crossing the stripes as a light-dark pattern, according to any one of claims 12 to 17. The surface defect inspection device described.
【請求項19】上記照明手段は、被検査面にストライプ
状の明暗パターンを映し出すものである、ことを特徴と
する請求項1乃至請求項17のいずれかに記載の表面欠
陥検査装置。
19. The surface defect inspection apparatus according to claim 1, wherein the illuminating means projects a stripe-shaped bright-dark pattern on the surface to be inspected.
【請求項20】上記照明手段は、被検査面に格子状の明
暗パターンを映し出すものである、ことを特徴とする請
求項1乃至請求項17のいずれかに記載の表面欠陥検査
装置。
20. The surface defect inspection apparatus according to claim 1, wherein the illuminating means projects a grid-like bright-dark pattern on the surface to be inspected.
【請求項21】上記照明手段は、明暗パターンの明部と
暗部の間隔、比率および該照明手段から被検査面までの
距離が、被検査面の曲率および予想される欠陥と被検査
面とのなす角度に基づいて設定されているものである、
ことを特徴とする請求項1乃至請求項20のいずれかに
記載の表面欠陥検査装置。
21. The illuminating means is such that the distance and ratio between the bright and dark parts of the light-dark pattern and the distance from the illuminating means to the surface to be inspected are the curvature of the surface to be inspected and the expected defects and the surface to be inspected. It is set based on the angle you make,
The surface defect inspection apparatus according to any one of claims 1 to 20, characterized in that.
【請求項22】上記欠陥検出手段によって得られた欠陥
に関するデータに基づいて、ラベル付け処理および欠陥
の面積と重心座標計算処理を行なう手段を備えたことを
特徴とする請求項1乃至請求項21のいずれかに記載の
表面欠陥検査装置。
22. A means for performing a labeling process and a defect area and barycentric coordinate calculation process on the basis of the data relating to the defect obtained by the defect detecting means. The surface defect inspection apparatus according to any one of 1.
【請求項23】複数の上記撮像手段と複数の上記照明手
段を、被検査物体の周囲にアーチ状に配置し、被検査物
体の広い被検査面を同時に検査するように構成したこと
を特徴とする請求項1乃至請求項22のいずれかに記載
の表面欠陥検査装置。
23. A plurality of the image pickup means and a plurality of the illumination means are arranged in an arch shape around an object to be inspected, and a wide surface to be inspected of the object to be inspected is inspected at the same time. 23. The surface defect inspection apparatus according to claim 1.
JP22056894A 1994-09-14 1994-09-14 Surface defect inspection equipment Expired - Lifetime JP3189588B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP22056894A JP3189588B2 (en) 1994-09-14 1994-09-14 Surface defect inspection equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP22056894A JP3189588B2 (en) 1994-09-14 1994-09-14 Surface defect inspection equipment

Publications (2)

Publication Number Publication Date
JPH0886633A true JPH0886633A (en) 1996-04-02
JP3189588B2 JP3189588B2 (en) 2001-07-16

Family

ID=16753035

Family Applications (1)

Application Number Title Priority Date Filing Date
JP22056894A Expired - Lifetime JP3189588B2 (en) 1994-09-14 1994-09-14 Surface defect inspection equipment

Country Status (1)

Country Link
JP (1) JP3189588B2 (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003302208A (en) * 2002-04-12 2003-10-24 Canon Inc Kind discriminating device and method for recording material and image forming apparatus
JP2006322757A (en) * 2005-05-17 2006-11-30 Fujifilm Holdings Corp Stain inspection method and stain inspection device
WO2008123604A1 (en) * 2007-03-29 2008-10-16 Toyota Jidosha Kabushiki Kaisha Surface inspection device
JP2013061239A (en) * 2011-09-13 2013-04-04 Toshiba Corp Mask surface roughness measuring method and measuring device
JP2017219478A (en) * 2016-06-09 2017-12-14 本田技研工業株式会社 Defect inspection method and device of the same
CN107490580A (en) * 2016-06-09 2017-12-19 本田技研工业株式会社 Defect detecting method and its equipment
WO2018221005A1 (en) * 2017-05-29 2018-12-06 コニカミノルタ株式会社 Surface defect inspection device and method
WO2018221006A1 (en) * 2017-05-29 2018-12-06 コニカミノルタ株式会社 Surface defect inspection device and method
CZ307838B6 (en) * 2018-02-05 2019-06-12 Christoph Vávra 3D analytical optical data meter
CN112782179A (en) * 2020-12-22 2021-05-11 北京市新技术应用研究所 Method and system for detecting defects of light-reflecting surface of product
CN113196040A (en) * 2018-11-30 2021-07-30 杰富意钢铁株式会社 Surface defect detection method, surface defect detection device, steel product manufacturing method, steel product quality management method, steel product manufacturing facility, surface defect determination model generation method, and surface defect determination model
WO2022038491A1 (en) * 2020-08-19 2022-02-24 3M Innovative Properties Company Robotic repair control systems and methods
CN114486916A (en) * 2022-01-26 2022-05-13 上海电机学院 Mobile phone glass cover plate defect detection method based on machine vision
CN115575402A (en) * 2022-10-17 2023-01-06 中国兵器装备集团西南技术工程研究所 Intelligent identification, calculation and judgment method for defects of inner wall of closed cylindrical part

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003302208A (en) * 2002-04-12 2003-10-24 Canon Inc Kind discriminating device and method for recording material and image forming apparatus
USRE44152E1 (en) 2002-04-12 2013-04-16 Canon Kabushiki Kaisha Recording-material type determination apparatus and method and image forming apparatus
JP2006322757A (en) * 2005-05-17 2006-11-30 Fujifilm Holdings Corp Stain inspection method and stain inspection device
WO2008123604A1 (en) * 2007-03-29 2008-10-16 Toyota Jidosha Kabushiki Kaisha Surface inspection device
JP2013061239A (en) * 2011-09-13 2013-04-04 Toshiba Corp Mask surface roughness measuring method and measuring device
JP2017219478A (en) * 2016-06-09 2017-12-14 本田技研工業株式会社 Defect inspection method and device of the same
CN107490579A (en) * 2016-06-09 2017-12-19 本田技研工业株式会社 Defect detecting method and its equipment
CN107490580A (en) * 2016-06-09 2017-12-19 本田技研工业株式会社 Defect detecting method and its equipment
US9970887B2 (en) 2016-06-09 2018-05-15 Honda Motor Co., Ltd. Defect inspection method and apparatus therefor
CN107490579B (en) * 2016-06-09 2021-09-07 本田技研工业株式会社 Defect inspection method and apparatus therefor
WO2018221006A1 (en) * 2017-05-29 2018-12-06 コニカミノルタ株式会社 Surface defect inspection device and method
JPWO2018221005A1 (en) * 2017-05-29 2020-03-26 コニカミノルタ株式会社 Surface defect inspection apparatus and method
JPWO2018221006A1 (en) * 2017-05-29 2020-04-02 コニカミノルタ株式会社 Surface defect inspection apparatus and method
US10768118B2 (en) 2017-05-29 2020-09-08 Konica Minolta, Inc. Surface defect inspection device and method
WO2018221005A1 (en) * 2017-05-29 2018-12-06 コニカミノルタ株式会社 Surface defect inspection device and method
CZ307838B6 (en) * 2018-02-05 2019-06-12 Christoph Vávra 3D analytical optical data meter
CN113196040A (en) * 2018-11-30 2021-07-30 杰富意钢铁株式会社 Surface defect detection method, surface defect detection device, steel product manufacturing method, steel product quality management method, steel product manufacturing facility, surface defect determination model generation method, and surface defect determination model
WO2022038491A1 (en) * 2020-08-19 2022-02-24 3M Innovative Properties Company Robotic repair control systems and methods
CN112782179A (en) * 2020-12-22 2021-05-11 北京市新技术应用研究所 Method and system for detecting defects of light-reflecting surface of product
CN114486916A (en) * 2022-01-26 2022-05-13 上海电机学院 Mobile phone glass cover plate defect detection method based on machine vision
CN115575402A (en) * 2022-10-17 2023-01-06 中国兵器装备集团西南技术工程研究所 Intelligent identification, calculation and judgment method for defects of inner wall of closed cylindrical part

Also Published As

Publication number Publication date
JP3189588B2 (en) 2001-07-16

Similar Documents

Publication Publication Date Title
JP3185559B2 (en) Surface defect inspection equipment
JP6745173B2 (en) Image inspection apparatus, image inspection method, image inspection program, computer-readable recording medium, and recorded device
JP3189588B2 (en) Surface defect inspection equipment
JP4150390B2 (en) Appearance inspection method and appearance inspection apparatus
JP4633245B2 (en) Surface inspection apparatus and surface inspection method
JP3127758B2 (en) Method and apparatus for inspecting defects on inspected surface
JP3412366B2 (en) Coating smoothness inspection device
JPH0979988A (en) Surface defect inspecting device
JP3493979B2 (en) Method and apparatus for inspecting defects on inspected surface
JP3688520B2 (en) Surface inspection apparatus and surface inspection method
JP2003167529A (en) Method and device for picture defect detection, and program for picture defect detection
JP4520880B2 (en) Blot inspection method and blot inspection apparatus
JP3854585B2 (en) Display defect detection method and display defect inspection apparatus for liquid crystal panel
JP3871963B2 (en) Surface inspection apparatus and surface inspection method
JP3159063B2 (en) Surface defect inspection equipment
JP3201217B2 (en) Surface defect inspection equipment
JPH0283438A (en) Apparatus for evaluating deposit or the like on surface of transparent plate
JPH03175343A (en) Method for extracting flaw by inspection appearance
JP3433333B2 (en) Defect inspection method
JP2001235319A (en) Shading correcting apparatus and shading correcting method, and surface inspection apparatus
JP4491922B2 (en) Surface defect inspection method
JPH1010053A (en) Inspection device for surface defect
JP3941403B2 (en) Image density unevenness detection method and inspection apparatus
JPH06281595A (en) Apparatus for detecting flaw on surface of object
JP3038092B2 (en) Appearance inspection method

Legal Events

Date Code Title Description
FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080518

Year of fee payment: 7

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090518

Year of fee payment: 8

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100518

Year of fee payment: 9

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110518

Year of fee payment: 10

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130518

Year of fee payment: 12

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140518

Year of fee payment: 13

EXPY Cancellation because of completion of term