JP3185559B2 - Surface defect inspection equipment - Google Patents

Surface defect inspection equipment

Info

Publication number
JP3185559B2
JP3185559B2 JP22057894A JP22057894A JP3185559B2 JP 3185559 B2 JP3185559 B2 JP 3185559B2 JP 22057894 A JP22057894 A JP 22057894A JP 22057894 A JP22057894 A JP 22057894A JP 3185559 B2 JP3185559 B2 JP 3185559B2
Authority
JP
Japan
Prior art keywords
inspected
image
area
defect
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.)
Expired - Lifetime
Application number
JP22057894A
Other languages
Japanese (ja)
Other versions
JPH0886634A (en
Inventor
正則 今西
祥代 方波見
千典 農宗
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP22057894A priority Critical patent/JP3185559B2/en
Publication of JPH0886634A publication Critical patent/JPH0886634A/en
Application granted granted Critical
Publication of JP3185559B2 publication Critical patent/JP3185559B2/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

Landscapes

  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Length Measuring Devices By Optical Means (AREA)

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 known.
For example, there is one disclosed in Japanese Patent No. 45144. These show a predetermined light and dark fringe (stripe) pattern on the surface to be inspected, and when there is a defect such as unevenness on the surface to be inspected, a received light image having a difference in brightness (brightness) and a change in brightness (brightness) due to the defect. Is differentiated to detect a defect on the surface of the surface to be inspected. Further, in the above conventional example, there is a defect that is not a defect such as a processed part on the surface to be inspected, and when it is present in a received image, the luminance level at the defect and the luminance level at a non-defect part such as the processed part are determined. There is described a technique for distinguishing a defect from other parts by utilizing the difference between the two.

【0003】[0003]

【発明が解決しようとする課題】しかし、上記のごとき
従来の表面欠陥検査装置においては、次のごとき問題が
あった。すなわち、従来の表面欠陥検査装置おいては、
ストライプ模様の明部分に黒く映る欠陥を検出するもの
であり、ストライプの暗部分に存在する欠陥を検出する
ことが出来ない。そのため、1画面中の明部分のみを検
査することになるので、1画面で検査できる領域が狭く
なり、広い被検査面を検査する場合には、多数回の検査
を繰り返さなければならない、という問題があった。
However, the conventional surface defect inspection apparatus as described above has the following problems. That is, in the conventional surface defect inspection apparatus,
This is to detect a defect appearing black in a bright portion of a stripe pattern, and cannot detect a defect existing in a dark portion of a stripe. As a result, only the bright portion in one screen is inspected, so that the area that can be inspected in one screen is narrowed, and when inspecting a wide inspection surface, the inspection must be repeated many times. was there.

【0004】また、例えば自動車ボディの塗装におい
て、通常、表面欠陥と呼ばれるものは、ゴミ等が付着し
た上に塗装が行なわれた結果生じる塗装表面の凸部であ
り、例えば直径が0.5mm〜2mm程度で厚さが数十μm程
度のものである。この程度の凸部は直径が小さいのに高
さ(厚さ)が比較的大きいため、光の乱反射角が大きく
なり、目につきやすい。これに対して欠陥とはならない
凹凸も存在する。すなわち、塗料溶剤の蒸発する過程に
おいて発生する渦対流により、塗料の濃度が厳密には一
定でなくなるので、塗膜の厚さには極めて薄い(低い)
凹凸が周期的に発生する。この凹凸は、例えば山と山の
間隔が1〜10mm程度で、凹凸の高さが数μm程度であ
る。このような極めて薄い凹凸は通常では気がつかない
程度のものであり、欠陥とはならない。しかし、光の加
減等では“ゆず”やオレンジの表面のように見えること
があるので、いわゆる“ゆず肌”もしくは“オレンジ
肌”と呼ばれるものである。上記のごとき従来例におい
ては、輝度変化を強調して検出するため、上記の“ゆず
肌”のような欠陥とはならない極めて薄い凹凸も検出
し、これを欠陥と誤判断するおそれがある。例えば、前
記の特開平2−73139号公報においては、ストライ
プ模様の間隔が狭い(1.5mm以下)照明を用いて欠陥
検出処理を行なうため、被検査面上に上記の“ゆず肌”
などが形成されている場合には、ストライプ自身および
その境界(線)が大きく乱れるので、例えばストライプ
の黒い部分が孤立点となり、画像上のストライプの幅が
一定にならないときに誤検出が発生しやすい。上記のよ
うに、従来技術においては、いわゆる“ゆず肌”のよう
な欠陥とならない極めて薄い凹凸を欠陥と誤検出するお
それがある、という問題もあった。
[0004] For example, in the coating of an automobile body, what is generally called a surface defect is a projection on the coating surface resulting from the application of dust and the like, for example, having a diameter of 0.5 mm or more. The thickness is about 2 mm and the thickness is about several tens of μm. Since the height (thickness) of the projections of this degree is relatively large although the diameter is small, the irregular reflection angle of light becomes large and is easily noticeable. 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 the eddy convection generated in the process of evaporating the paint solvent, the thickness of the coating film is extremely small (low).
Irregularities occur periodically. In this unevenness, for example, the interval between the peaks is about 1 to 10 mm, and the height of the unevenness is about several μm. Such extremely thin irregularities are of such a degree that they are usually not noticed and do not become defects. However, it may look like "yuzu" or "orange" depending on the degree of light, so it is called "yuzu skin" or "orange skin". In the conventional example as described above, since the luminance change is emphasized and detected, extremely thin irregularities that do not become a defect like the above-mentioned “Yuzu skin” are also detected, and this may be erroneously determined as a defect. For example, in Japanese Unexamined Patent Application Publication No. 2-73139, since the defect detection process is performed using illumination having a narrow stripe pattern (1.5 mm or less), the above-mentioned “yuzu skin” is formed on the surface to be inspected.
When the stripes are formed, the stripe itself and its boundary (line) are greatly disturbed. For example, a black portion of the stripe becomes an isolated point, and an erroneous detection occurs when the width of the stripe on the image is not constant. Cheap. As described above, in the related art, there is a problem that extremely thin unevenness that does not become a defect such as so-called “yuzu skin” may be erroneously detected as a defect.

【0005】本発明は上記のごとき従来技術の問題を解
決するためになされたものであり、第1の目的は1画面
で検査できる領域が広い表面欠陥検査装置を提供するこ
とである。また、第2の目的は、いわゆる“ゆず肌”の
ような欠陥とならない極めて薄い凹凸を欠陥と誤検出す
ることなく、より精密な欠陥検出を行なうことの出来る
表面欠陥検査装置を提供することである。
The present invention has been made to solve the problems of the prior art as described above, and a first object of the present invention is to provide a surface defect inspection apparatus having a wide area that can be inspected on one screen. A second object is to provide a surface defect inspection apparatus capable of performing more precise defect detection without erroneously detecting extremely thin irregularities that do not become defects such as so-called "yuzu skin" as defects. is there.

【0006】[0006]

【課題を解決するための手段】上記の目的を達成するた
め、本発明においては特許請求の範囲に記載するように
構成している。図1は、本発明のクレーム対応図であ
り、(a)は請求項1に相当し、図中の破線部分は請求
項2に相当するものである。図1(a)において、10
0は被検査面であり、例えば塗装面である。また、10
1は被検査面に所定の明暗パターンを映し出す照明手段
であり、例えば後記図4に示す照明装置である。また、
102は被検査面を撮像して上記明暗パターンを電気信
号の画像データに変換する撮像手段であり、例えばCC
Dカメラ等のビデオカメラである。また、103は上記
撮像手段102によって得られた画像データを処理して
上記明暗パターンの明部と暗部の境界領域を識別する境
界領域識別手段、104は上記画像データにおける周波
数成分のうち高い周波数領域で、かつレベルが所定値以
上の領域のみを抽出する画像強調手段、105は上記画
像強調手段104で抽出した領域のうち上記境界領域識
別手段103で識別した境界領域でない部分を欠陥とし
て検出する欠陥検出手段である。これら103〜105
の部分は、例えばコンピュータで構成される。上記の構
成は、例えば後記図2〜図22で説明する実施例に相当
する。
In order to achieve the above object, the present invention is configured as described in the appended claims. FIG. 1 is a diagram corresponding to the claims of the present invention, in which (a) corresponds to claim 1, and a broken line portion in the figure corresponds to claim 2. In FIG. 1A, 10
Reference numeral 0 denotes a surface to be inspected, for example, a painted surface. Also, 10
Reference numeral 1 denotes an illuminating unit for projecting a predetermined light and dark pattern on the surface to be inspected, and is, for example, an illuminating device shown in FIG. Also,
An imaging unit 102 captures an image of a surface to be inspected and converts the light / dark pattern into image data of an electric signal.
It is a video camera such as a D camera. Reference numeral 103 denotes a boundary region identification unit that processes the image data obtained by the imaging unit 102 to identify a boundary region between a light portion and a dark portion of the light-dark pattern, and 104 denotes a high frequency region among the frequency components in the image data. And an image enhancement means 105 for extracting only an area whose level is equal to or more than a predetermined value, and a defect 105 for detecting, as a defect, a portion which is not the boundary area identified by the boundary area identification means 103 among the areas extracted by the image enhancement means 104. It is a detecting means. These 103-105
Is composed of, for example, a computer. The above configuration corresponds to, for example, an embodiment described later with reference to FIGS.

【0007】次に、請求項2は、図1(a)に破線で示
すように、境界領域識別手段103によって得られた境
界領域を拡大する処理を行なう境界領域処理手段106
を、請求項1の境界領域識別手段103と欠陥検出手段
105との間に挿入したものである。この構成は、例え
ば後記図27〜図30の実施例に相当する。また、請求
項3に記載のように、上記境界領域処理手段は、被検査
面の粗さに応じて予め定められた所定値だけ境界領域を
拡大するものである。或いは、請求項4に記載のよう
に、上記境界領域処理手段は、上記撮像手段で求めた画
像データから得られる被検査面の粗さに応じた値だけ境
界領域を拡大するものである。或いは、請求項5に記載
のように、上記境界領域処理手段は、一旦、境界領域を
拡大した後、境界領域を縮小する処理を行なうものであ
る。
Next, as shown by a broken line in FIG. 1A, a boundary area processing means 106 for performing processing for enlarging the boundary area obtained by the boundary area identification means 103.
Is inserted between the boundary area identifying means 103 and the defect detecting means 105 of the first aspect. This configuration corresponds to, for example, an embodiment shown in FIGS. According to a third aspect of the present invention, the boundary area processing means enlarges the boundary area by a predetermined value determined in accordance with the roughness of the surface to be inspected. Alternatively, as set forth in claim 4, the boundary area processing means enlarges the boundary area by a value corresponding to the roughness of the surface to be inspected obtained from the image data obtained by the imaging means. Alternatively, as described in claim 5, the boundary region processing means performs a process of temporarily expanding the boundary region and then reducing the boundary region.

【0008】また、請求項6に記載のように、上記画像
強調手段は、上記撮像手段によって得られた画像データ
の原画像と、原画像に所定の平滑化処理を施した画像と
の差の絶対値を求めるものである。或いは、請求項7に
記載のように、上記画像強調手段は、上記撮像手段によ
って得られた画像データの原画像を正規関数で平滑化し
たのち2次微分した結果の絶対値を求めるものである。
[0008] According to a sixth aspect of the present invention, the image enhancing means is configured to calculate a difference between an original image of the image data obtained by the imaging means and an image obtained by performing a predetermined smoothing process on the original image. The absolute value is obtained. Alternatively, as described in claim 7, the image enhancing means obtains an absolute value of a result obtained by subjecting an original image of the image data obtained by the imaging means to a normal function and then performing a second derivative. .

【0009】また、請求項8に記載のように、上記境界
領域識別手段は、上記撮像手段によって得られた画像デ
ータの原画像に平滑化処理を施した画像を微分し、その
結果の絶対値を求めるものである。また、請求項9に記
載の発明は、上記境界領域認識手段で得られた画像に、
原画像の輝度ヒストグラムもしくは被検査面の粗さに基
づいて設定された平滑化処理を行うか、または上記境界
領域認識手段における微分係数を、原画像の輝度ヒスト
グラムに基づいて設定するものである。
The boundary area identifying means differentiates an image obtained by performing a smoothing process on an original image of the image data obtained by the imaging means, and obtains an absolute value of the result. Is what you want. According to the ninth aspect of the present invention, the image obtained by the boundary area recognition unit includes:
Either a smoothing process set based on the luminance histogram of the original image or the roughness of the surface to be inspected is performed, or the differential coefficient in the boundary area recognizing means is set based on the luminance histogram of the original image.

【0010】また、請求項10に記載のように、上記欠
陥検出手段は、上記境界領域認識手段の結果と上記画像
強調手段の結果との差を求め、その結果を所定のしきい
値で2値化するものである。また、請求項11に記載の
ように、上記欠陥検出手段は、原画像の輝度ヒストグラ
ムもしくは被検査面の粗さに基づいて上記2値化しきい
値を調節するものである。
The defect detecting means determines a difference between the result of the boundary area recognizing means and the result of the image enhancing means, and determines the result by a predetermined threshold value. It is something to be valued. Further, the defect detecting means adjusts the binarization threshold based on a luminance histogram of an original image or roughness of a surface to be inspected.

【0011】次に、図1(b)は、請求項12に相当す
るものであり、図中の破線部分は請求項13に相当す
る。図1(b)において、100は被検査面であり、例
えば塗装面である。また、101は被検査面に所定の明
暗パターンを映し出す照明手段であり、例えば後記図3
に示す照明装置である。また、102は被検査面を撮像
して上記明暗パターンを電気信号の画像データに変換す
る撮像手段であり、例えばCCDカメラ等のビデオカメ
ラである。また、107は上記撮像手段によって得られ
た画像データを平滑化する平滑化手段、108は上記平
滑化手段で平滑化した明暗パターンの画像データで輝度
変化のある部分を抽出する強調手段、109は上記強調
手段の結果を2値化する2値化手段、110は上記2値
化手段で得られた上記領域をそれぞれ演算することによ
って1画面中に存在する輝度変化のある部分毎にそれぞ
れの面積を求め、その面積が所定値以下であった部分を
欠陥として検出する面積判定処理手段である。これら1
07〜110の部分は、例えばコンピュータで構成され
る。上記の構成は、例えば後記図31〜図36で説明す
る実施例に相当する。
Next, FIG. 1B corresponds to claim 12, and the broken line portion in the figure corresponds to claim 13. In FIG. 1B, reference numeral 100 denotes a surface to be inspected, for example, a painted surface. Reference numeral 101 denotes an illuminating means for projecting a predetermined light / dark pattern on the surface to be inspected.
The lighting device shown in FIG. Reference numeral 102 denotes an imaging unit that captures an image of the surface to be inspected and converts the light / dark pattern into image data of an electric signal, for example, a video camera such as a CCD camera. Reference numeral 107 denotes a smoothing unit for smoothing the image data obtained by the image pickup unit; 108, an emphasis unit for extracting a portion having a change in luminance in the image data of the light and dark pattern smoothed by the smoothing unit; Binarizing means 110 for binarizing the result of the emphasizing means 110 calculates each of the regions obtained by the binarizing means to thereby calculate the area of each part having a change in luminance existing in one screen. And an area determination processing means for detecting a portion whose area is equal to or smaller than a predetermined value as a defect. These one
The parts 07 to 110 are constituted by a computer, for example. The above configuration corresponds to, for example, an embodiment described later with reference to FIGS.

【0012】次に、請求項13は、図1(b)に破線で
示すように、上記2値化手段109で得られた2値信号
のうち上記輝度変化のある部分に相当する値部分の領域
を拡大する処理を行なう領域処理手段111を、請求項
12の2値化手段109と欠陥検出手段110との間に
挿入したものである。また、請求項14に記載のよう
に、上記領域処理手段は、被検査面の粗さに応じて予め
定められた所定値だけ上記輝度変化のある部分に相当す
る値部分の領域を拡大するものである。或いは、請求項
15に記載のように、上記領域処理手段は、上記撮像手
段で求めた画像データから得られる被検査面の粗さに応
じた値だけ上記輝度変化のある部分に相当する値部分の
領域を拡大するものである。また、請求項16に記載の
ように、上記領域処理手段は、一旦、輝度変化のある部
分に相当する値部分の領域を拡大した後、該領域を縮小
する処理を行なうものである。
Next, as shown by a broken line in FIG. 1 (b), a value portion corresponding to a portion where the luminance changes in the binary signal obtained by the binarization means 109 is defined. An area processing means 111 for performing a process of enlarging an area is inserted between the binarization means 109 and the defect detection means 110 of the twelfth aspect. According to a fourteenth aspect of the present invention, the area processing means enlarges an area of a value part corresponding to the part having the luminance change by a predetermined value predetermined according to the roughness of the surface to be inspected. It is. Alternatively, as described in claim 15, the region processing means is a value part corresponding to a part 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 imaging means. Is to expand the area of the image. According to a sixteenth aspect of the present invention, the area processing means performs a process of temporarily enlarging an area of a value part corresponding to a part having a luminance change and then reducing the area.

【0013】また、請求項17に記載のように、上記面
積判定手段は、上記2値化した画像における画面の周辺
境界に接する所定領域を除去した後に、面積判定処理を
行なうものである。なお、この構成は、例えば図34で
説明する実施例に相当する。或いは、請求項18に記載
のように、上記面積判定手段は、上記2値化した画像に
おける画面の周辺境界に接する1画素分をストライプの
暗部分と同値にしたのち面積判定を行なうものである。
なお、この構成は、例えば図35で説明する実施例に相
当する。
[0013] According to a seventeenth aspect of the present invention, the area determining means performs an area determining process after removing a predetermined area in contact with a peripheral boundary of a screen in the binarized image. This configuration corresponds to, for example, the embodiment described with reference to FIG. Alternatively, as set forth in claim 18, the area determination means performs the area determination after setting one pixel in contact with the peripheral boundary of the screen in the binarized image to the same value as the dark portion of the stripe. .
This configuration corresponds to, for example, the embodiment described with reference to FIG.

【0014】また、請求項19に記載のように、上記照
明手段は、明暗パターンとして平行なストライプとそれ
を斜めに横切る線とからなる模様を映しだすものであ
る。なお、この構成は、例えば図36で説明する実施例
に相当する。また、請求項20に記載のように、上記照
明手段は、被検査面にストライプ状の明暗パターンを映
し出すものである。この構成は例えば後記図4、図5の
実施例に相当する。或いは、請求項21に記載のよう
に、上記照明手段は、被検査面に格子状の明暗パターン
を映し出すものである。この構成は例えば後記図14の
実施例に相当する。また、請求項22に記載のように、
上記照明手段は、被検査面に映し出された明暗パターン
の明部と暗部のそれぞれの幅すなわち間隔が、検査の目
的として予想される欠陥の大きさに比べて十分大きな値
に設定されているものである。また、請求項23に記載
のように、上記照明手段は、明暗パターンの明部と暗部
の間隔、比率および該照明手段から被検査面までの距離
が、被検査面の曲率および予想される欠陥と被検査面と
のなす角度に基づいて設定されているものである。
[0014] According to a nineteenth aspect of the present invention, the illuminating means projects a pattern consisting of parallel stripes and lines obliquely crossing the stripes as a light and dark pattern. This configuration corresponds to, for example, the embodiment described with reference to FIG. Further, as described in claim 20, the illumination means projects a stripe-like light-dark pattern on the surface to be inspected. This configuration corresponds to, for example, an embodiment shown in FIGS. Alternatively, the illuminating means projects a grid-like light and dark pattern on the surface to be inspected. This configuration corresponds to, for example, an embodiment of FIG. 14 described later. Also, as described in claim 22,
The illuminating means is such that the width, that is, the interval between the light and dark portions of the light and dark pattern projected on the surface to be inspected is set to a sufficiently large value compared to the size of a defect expected for the purpose of inspection. It is. According to a twelfth aspect of the present invention, in the illumination unit, the distance between the bright and dark portions of the light and dark pattern, the ratio between the illumination unit and the surface to be inspected is the curvature of the surface to be inspected and the expected defect. This is set based on the angle between the target and the surface to be inspected.

【0015】また、請求項24に記載の発明において
は、上記欠陥検出手段によって得られた欠陥に関するデ
ータに基づいて、ラベル付け処理および欠陥の面積と重
心座標計算処理を行なう手段を備えている。また、請求
項25に記載の発明においては、複数の上記撮像手段と
複数の上記照明手段を、被検査物体の周囲にアーチ状に
配置し、被検査物体の広い被検査面を同時に検査するよ
うに構成したものである。この構成は、例えば後記図2
3の実施例に相当する。
Further, the invention according to claim 24 is provided with means for performing labeling processing and calculation processing of the area of the defect and the center of gravity based on the data on the defect obtained by the defect detecting means. Further, in the invention according to claim 25, a plurality of the imaging means and a plurality of the illumination means are arranged in an arch shape around the object to be inspected, and a wide inspected surface of the object to be inspected is inspected simultaneously. It is what was constituted. This configuration is described in, for example, FIG.
This corresponds to the third embodiment.

【0016】[0016]

【作用】上記のように、請求項1に記載の発明において
は、照明手段によって被検査面に所定の明暗パターンを
映し出し、それを撮像手段で撮像して電気信号の画像デ
ータに変換する。次に、境界領域識別手段では上記画像
データを処理して画像データにおける周波数成分のうち
低い周波数領域での明部と暗部の境界領域を識別する。
この処理は、例えば画像信号の原画像に平滑化処理を施
した画像を微分し、その結果の絶対値を求めることによ
り、境界領域に対応した信号を得ることが出来る。ま
た、画像強調手段では、上記明暗パターンの画像データ
における周波数成分のうち高い周波数成分で、かつレベ
ルが所定値以上の成分のみを抽出する。上記の画像デー
タにおける高周波成分とは欠陥やストライプの境界領域
のような輝度変化のある部分および雑音であり、上記の
ようにレベルが所定値以上の成分のみを抽出することに
より、雑音成分を除去し、欠陥と境界領域のみとするこ
とが出来る。次に、欠陥検出手段では、上記画像強調手
段で抽出した領域のうち上記境界領域識別手段で識別し
た境界領域でない部分を欠陥として検出する。上記のよ
うに、画像強調手段で抽出した部分は欠陥と境界領域の
みであり、境界領域識別手段の結果は境界領域のみであ
るから、例えば、両者の差を求めれば欠陥部分のみを検
出することが出来る。または画像強調手段の結果と境界
領域識別手段の結果をそれぞれ2値化した値のANDを
求めてもよい。
As described above, according to the first aspect of the present invention, a predetermined light and dark pattern is projected on the surface to be inspected by the illuminating means, which is imaged by the imaging means and converted into image data of an electric signal. Next, the boundary region identifying means processes the image data to identify a boundary region between a bright part and a dark part in a low frequency region among the frequency components in the image data.
In this process, for example, a signal corresponding to a boundary region can be obtained by differentiating an image obtained by performing a smoothing process on an original image of an image signal and obtaining an absolute value of the result. Further, the image enhancing means extracts only a component having a high frequency component and a level equal to or higher than a predetermined value among the frequency components in the image data of the light and dark pattern. The high-frequency components in the above image data are a portion having a luminance change such as a defect or a boundary region of a stripe and noise, and a noise component is removed by extracting only a component whose level is equal to or higher than a predetermined value as described above. However, only the defect and the boundary area can be set. Next, the defect detection means detects, as a defect, a portion which is not the boundary area identified by the boundary area identification means among the areas extracted by the image enhancement means. As described above, only the defect and the boundary area are extracted by the image enhancement means, and the result of the boundary area identification means is only the boundary area. For example, if the difference between the two is obtained, only the defective part can be detected. Can be done. Alternatively, AND of the values obtained by binarizing the result of the image enhancement means and the result of the boundary area identification means may be obtained.

【0017】上記のように、請求項1に記載の発明は、
明暗ストライプ画像の明部分に黒く映る欠陥と暗部分に
白く映る欠陥との両方を検出するものである。ただし、
明暗の境界部分は欠陥検出を行なうことが出来ないの
で、被検査面全体を検査するには、被検査物体もしくは
照明手段と撮像手段を順次移動させ、明部分と暗部分
(境界領域を除いた部分)が被検査面全体を走査するよ
うに構成する。ただし、従来例のような明部分内のみを
検査するものよりも1画面中で欠陥検査を行なうことの
出来る領域が広範囲なので、検査を迅速に行なうことが
可能である。
As described above, the invention according to claim 1 is
This is to detect both a defect appearing black in a bright part and a defect appearing white in a dark part of a bright and dark stripe image. However,
Since it is impossible to detect defects at the boundary between light and dark, to inspect the entire surface to be inspected, the object to be inspected or the illuminating means and the imaging means are sequentially moved so that the bright part and the dark part (excluding the boundary area) ) Scans the entire surface to be inspected. However, since the area where the defect inspection can be performed in one screen is wider than that in the conventional example in which only the bright portion is inspected, the inspection can be performed quickly.

【0018】次に、請求項2に記載の発明において、境
界領域処理手段は、境界領域識別手段で求めた境界領域
を拡大する処理を行なう。これは詳細を後述するよう
に、“ゆず肌”を欠陥と誤検出するのは、“ゆず肌”に
よってストライプの明暗の境界が乱れ、孤立点が生じる
ためであることに鑑み、このような誤検出の発生するお
それのある部分を一括して境界領域とすることにより、
そのような部分については欠陥検出を行なわないように
したものである。次に、請求項3〜請求項5は、上記境
界領域処理手段の構成例を示すものであり、請求項3
は、被検査面の粗さに応じて予め定められた所定値だけ
境界領域を拡大するもの、請求項4は、撮像手段で求め
た画像データから得られる被検査面の粗さに応じた値だ
け境界領域を拡大するものである。また、請求項5は、
一旦、境界領域を拡大した後、境界領域を縮小する処理
を行なうものである。上記のように、一旦、境界領域を
拡大し、“ゆず肌”の影響によって境界線が乱れたり、
孤立点が生じたような領域を境界領域(例えば暗部分と
する)に取り込んだ後は、境界領域を縮小する画像処理
を行なっても、上記の乱れや孤立点は再生しない。した
がって上記のごとき拡大処理と縮小処理を行なうことに
より、“ゆず肌”の影響を消去し、かつストライプ部分
は最初の状態に復帰させることが出来る。
Next, in the second aspect of the invention, the boundary area processing means performs processing for enlarging the boundary area obtained by the boundary area identification means. This is because, as described later in detail, the reason why the “yuzu skin” is erroneously detected as a defect is that the boundary between the bright and dark stripes is disturbed by the “yuzu skin” and an isolated point is generated. By making the area where detection may occur collectively a boundary area,
No defect detection is performed for such a portion. Next, claims 3 to 5 show configuration examples of the boundary area processing means.
Enlarging the boundary area by a predetermined value determined in advance according to the roughness of the surface to be inspected, wherein the value according to the roughness of the surface to be inspected obtained from the image data obtained by the imaging means Only the boundary area is enlarged. Claim 5
Once the boundary area is enlarged, processing for reducing the boundary area is performed. As described above, once the boundary area is enlarged, the boundary line is disturbed by the influence of "yuzu skin",
After a region where an isolated point is generated is taken into a boundary region (for example, a dark portion), even if image processing for reducing the boundary region is performed, the disturbance and the isolated point are not reproduced. Therefore, by performing the above-described enlargement processing and reduction processing, the influence of “yuzu skin” can be eliminated, and the stripe portion can be returned to the initial state.

【0019】次に、請求項6および請求項7は、上記画
像強調手段の構成例を示すものであり、請求項8および
請求項9は、上記境界領域識別手段の構成例を示すもの
である。また、請求項10および請求項11は、上記欠
陥検出手段の構成例を示すものである。次に、請求項1
2に記載の発明においては、照明手段によって被検査面
に所定の明暗パターンを映し出し、それを撮像手段で撮
像して上記明暗パターンを電気信号の画像データに変換
する。次に、平滑化手段では、撮像手段によって得られ
た画像データを平滑化する。この平滑化によってノイズ
等による微小な輝度変化成分を除去する。次に、強調手
段では、平滑化手段で平滑化した明暗パターンの画像デ
ータで輝度変化のある部分を抽出する。この強調処理
は、例えば微分処理である。次に、2値化手段では、強
調処理した結果を2値化する。この2値化処理によって
欠陥部分やストライプ境界部分のような輝度変化のある
領域が抽出される。次に、面積判定処理手段は、領域処
理手段で得られた上記領域をそれぞれ演算することによ
って1画面中に存在する輝度変化のある部分毎にそれぞ
れの面積を求め、その面積が所定値以下であった部分を
欠陥として検出する。すなわち、輝度変化のある部分と
しては、ストライプの明暗の境界部分と欠陥部分とが検
出されるが、そのうちストライプの明暗の境界部分の面
積に対し、欠陥部分の面積は大幅に小さいので、所定の
面積で区別することにより、欠陥部分のみを抽出するこ
とが出来る。上記請求項12に記載の発明は、明暗スト
ライプ画像の明部分に黒く映る欠陥と暗部分に白く映る
欠陥との両方を検出するものである。ただし、明暗の境
界領域部分は欠陥検出を行なうことが出来ないので、前
記請求項1と同様に、被検査面全体を検査するには、被
検査物体もしくは照明手段と撮像手段を順次移動させ、
明部分と暗部分(境界領域以外の部分)が被検査面全体
を走査するように構成する。
Next, claims 6 and 7 show examples of the configuration of the image enhancing means, and claims 8 and 9 show examples of the configuration of the boundary area identifying means. . Claims 10 and 11 show configuration examples of the defect detection means. Next, claim 1
In the invention described in item 2, a predetermined light / dark pattern is projected on the surface to be inspected by the illuminating means, and the light / dark pattern is converted into image data of an electric signal by capturing the image with the imaging means. Next, the smoothing means smoothes the image data obtained by the imaging means. This smoothing removes minute luminance change components due to noise or the like. Next, the emphasizing means extracts a portion having a luminance change from the image data of the light and dark pattern smoothed by the smoothing means. This emphasis processing is, for example, differentiation processing. Next, the binarization means binarizes the result of the emphasis processing. By this binarization process, a region having a change in luminance, such as a defective portion or a stripe boundary portion, is extracted. Next, the area determination processing means obtains an area for each of the portions having a change in luminance existing in one screen by calculating each of the areas obtained by the area processing means. The existing portion is detected as a defect. That is, as a portion having a change in luminance, a light-dark boundary portion of a stripe and a defective portion are detected. Of these, the area of the defective portion is significantly smaller than the area of the light-dark boundary portion of the stripe. By discriminating by area, only defective portions can be extracted. The twelfth aspect of the invention detects both a defect appearing black in a bright portion and a defect appearing white in a dark portion of a bright and dark stripe image. However, since a defect cannot be detected in the boundary area between light and dark, in order to inspect the entire surface to be inspected, the object to be inspected or the illuminating means and the image capturing means are sequentially moved in the same manner as in claim 1;
The light portion and the dark portion (portions other than the boundary region) are configured to scan the entire inspection surface.

【0020】また、請求項13に記載の発明において
は、領域処理手段によって、上記2値化手段で得られた
2値信号のうち上記輝度変化のある部分に相当する値部
分の領域を拡大する処理を行なう。これは詳細を後述す
るように、“ゆず肌”を欠陥と誤検出するのは、“ゆず
肌”によってストライプの明暗の境界が乱れ、孤立点が
生じるためであることに鑑み、このような誤検出の発生
するおそれのある部分については欠陥検出を行なわない
ようにしたものである。また、請求項14〜請求項16
は、上記領域処理手段の例を示すものであり、前記請求
項3〜請求項5と同様である。また、請求項17〜請求
項19は、請求項12に記載の発明において、被検査面
が曲面であった場合における面積判定時の誤差を解消す
る手段に関するものであり、請求項17は誤検出が生じ
やすい部分を削除するもの、請求項18は画面周辺の1
画素を画像処理することによってストライプ境界部分を
全て接続するようにしたもの、請求項19は照明装置の
ストライプ画像において予め各ストライプを接続してお
くように構成したものである。また、請求項20〜請求
項23は、上記照明手段の構成例を示すものである。ま
た、請求項24は、欠陥検出後の後処理手段の構成を示
すものである。また、請求項25は、被検査物体の広い
被検査面を同時に検査する構成を示したものであり、例
えば自動車ボディの塗装工程における塗装表面検査を行
なう構成である。
In the invention according to the thirteenth aspect, the area of the value portion corresponding to the portion where the luminance changes in the binary signal obtained by the binarization means is expanded by the area processing means. Perform processing. This is because, as described later in detail, the reason why the “yuzu skin” is erroneously detected as a defect is that the boundary between the bright and dark stripes is disturbed by the “yuzu skin” and an isolated point is generated. The defect detection is not performed for the portion where the detection is likely to occur. Claims 14 to 16
Shows an example of the area processing means, and is the same as in the third to fifth aspects. The seventeenth to nineteenth aspects relate to a means for eliminating an error in area determination when the surface to be inspected is a curved surface in the twelfth aspect. 18. The method according to claim 18, further comprising:
The stripe boundary portions are all connected by image processing of the pixels. Claim 19 is configured so that each stripe is connected in advance in the stripe image of the illumination device. Claims 20 to 23 show configuration examples of the lighting means. Claim 24 shows the configuration of the post-processing means after the defect detection. Further, claim 25 shows a configuration for simultaneously inspecting a wide inspection surface of an object to be inspected, for example, a configuration for performing a coating surface inspection in a coating process of an automobile body.

【0021】[0021]

【実施例】以下、この発明を図面に基づいて説明する。
図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 one embodiment of the present invention. In FIG. 2, reference numeral 1 denotes an illumination device, which is arranged so as to irradiate the surface 3 to be inspected with light having a predetermined light and dark pattern. Reference numeral 2 denotes a video camera (for example, a CCD camera or the like), which is arranged to capture an image of the surface 3 to be inspected on which a light-dark pattern is projected. Reference numeral 4 denotes a camera control unit, which generates an image signal of a received image picked up by the video camera 2 and outputs the image signal to the image processing device 5. Reference numeral 6 denotes a host computer, which has a function of controlling the image processing apparatus 5 and displaying or outputting processing results to the outside. Reference numeral 7 denotes a monitor which displays a screen captured by the video camera 2 and the like.

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

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

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

【0025】次に、上記のごときストライプ照明を用い
て、被検査物の表面上の欠陥を受光画像に映し出す原理
について、図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 using a stripe illumination as described above to project a defect on the surface of an object to be inspected in a received light image will be described with reference to FIGS. In FIG. 6, it is assumed that there is a convex defect 13 on the surface 3 to be inspected.
Point P1 is an arbitrary point on a normal surface without defects, and point P2 is an arbitrary point on defect 13. When the defect 13 is convex as shown in the figure, each of the arbitrary points on the defect 13 has an angle between a tangent line of the point and a normal surface to be inspected. I do. In this case, the vicinity of the defect 13 and the point P1 is within the bright stripe of the stripe illumination (the part irradiated with light).
It is assumed that When an angle between the video camera 2 and the surface 3 to be inspected is an incident angle θi, a point P which is a normal plane
At 1, the light is specularly reflected (θi), and there is a bright portion of the stripe illumination in that direction, so that the point P 1 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 irregularly reflected due to the inclination angle θ, and there is a black stripe in that direction, so that the point P2 is projected black by the video camera 2. Assuming that the irregular reflection angle at this time is θh, the defect point P
2, the angle (incident angle) in a certain direction of the video camera 2 is θi, so that θh = θi + 2θ (Equation 1) (see FIG. 7). That is, in the direction of the angle θh, a bright (white) portion of the stripe is projected white, and a black portion of the stripe is projected black (dark). Also,
As described above, since the light is specularly reflected on the normal plane, it can be expressed as θh = θi (Equation 2). Therefore, from the formulas (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 a starting point, but the same applies to the case where the lighting device 1 is used as a starting point. FIG. 7 shows an example in which the point P2 is on the right slope of the defect. However, the same applies to the case where P2 is on the left slope, and a description thereof will be omitted.

【0026】次に、被検査面が曲面の場合について図8
を用いて説明する。図8に示すように、被検査面3が曲
率半径Rの曲面とし、その中心をCとする。また、この
曲面上の任意の点をP1’とし、その点の中心角をθc
とする。ここで曲面上の点P1’での反射角θhは、 θh=θi+2θc …(数3) と表され、これが曲面での正反射角となる。さらに、点
P1’に欠陥がある場合、上記平面のときと同様に考え
ると、その反射角θhは、 θh=θi+2θc+2θ…(数4) となる。故に、欠陥での乱反射方向は、その点での正反
射方向を基準にすると、平面、曲面にかかわらず、2θ
となる。
FIG. 8 shows a case where the surface to be inspected is a curved surface.
This will be described with reference to FIG. 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. An arbitrary point on this curved surface is defined as P1 ', and the central angle of the point is θc
And Here, the reflection angle θh at the point P1 ′ on the curved surface is represented by θh = θi + 2θc (Equation 3), and this is the regular reflection angle on the curved surface. Further, when there is a defect at the point P1 ', the reflection angle θh is given by θh = θi + 2θc + 2θ (Equation 4), as in the case of the plane. Therefore, the irregular reflection direction at the defect is 2θ regardless of the plane or the curved surface, based on the regular reflection direction at that point.
Becomes

【0027】上記のように、欠陥での傾斜角θによって
被検査面での反射角が求められるので、あらかじめ欠陥
における傾斜角θの分布を測定しておき、検出したい、
すなわち画像中に黒く映し出したい範囲(被検査体の種
類に応じて、欠陥と判定すべき大きさの最小のランクに
合わせる)を決めておけば、その範囲での反射方向にス
トライプの暗(黒)部分があるようにストライプの間隔
(前記図4のT)および照明装置1と被検査面3との距
離(図6のD;照明装置と被検査面との角度も含む)が
決定できる。この際、被検査体の種類に応じて代表的な
欠陥をサンプルし、それに合うように設定する。なお、
これまでの説明とは逆に、上記原理を用い被検査面に黒
く映したストライプ内に、欠陥を白く映し出すことも出
来る。ただし、その場合には、照明装置1の光が拡散光
であるため、欠陥が明るくかつ大きく映りにくい場合が
ある(白色ではなく暗い灰色で、明るく映る部分の面積
も小さい)ので、このような場合は、この欠陥をより明
るく(白く)映し出すために、ストライプの明部分の幅
を暗部分より広くとる(例えば明暗の比率を明:暗=
2:1以上にする)、というようなストライプの明暗比
率を含めて上記ストライプの明暗の間隔Tや距離Dを決
定すればよい。
As described above, the reflection angle on the surface to be inspected is obtained from the inclination angle θ at the defect. Therefore, the distribution of the inclination angle θ at the defect is measured in advance, and it is desired to detect the distribution.
In other words, if the area to be projected in black in the image (to match the minimum rank of the size to be determined as a defect according to the type of the inspection object) is determined, the dark (black) of the stripe in the reflection direction in that area is determined. 4), the distance between the stripes (T in FIG. 4) and the distance between the illumination device 1 and the inspection surface 3 (D in FIG. 6; also includes the angle between the illumination device and the inspection surface). At this time, a representative defect is sampled according to the type of the inspection object, and the defect is set so as to match the sample. In addition,
Contrary to the above description, the above principle can be used to project a defect white in a stripe that appears black on the surface to be inspected. However, in this case, since the light from the lighting device 1 is diffused light, the defect may be bright and large and difficult to be imaged (dark gray instead of white, and the area of the bright image is small). In this case, in order to make the defect appear brighter (whiter), the width of the light portion of the stripe is made wider than that of the dark portion (for example, the light / dark ratio is set to light: dark =
2: 1 or more), the light-dark interval T and the distance D of the stripes may be determined.

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

【0029】次に、図10は、画像処理装置5における
処理内容を示すフローチャートである。画像処理装置5
においては、図10に示すごとく、原画像P1から、領
域認識処理P2、画像強調処理P3および欠陥検出処理
P4を行なって欠陥を検出する。また、上記のごとくに
して欠陥を検出した後の後処理P5としては、ラベリン
グ、面積および重心座標計算があり、それらの結果をモ
ニタ等に表示し、或いは後続機器に出力する。
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 by performing an area recognition process P2, an image enhancement process P3, and a defect detection process P4 from the original image P1. Further, as post-processing P5 after detecting a defect as described above, there are labeling, area and barycentric coordinate calculation, and the results are displayed on a monitor or the like or output to a subsequent device.

【0030】以下、上記の各処理の内容について詳細に
説明する。まず、境界領域認識処理P2について説明す
る。図11は、原画像の信号S0に含まれる各成分の波
形図である。図11のように、原画像の信号S0は、照
度むら等によるシェーディング成分(低周波成分)と、
ストライプ照明による輝度変化成分(中間成分)と、欠
陥13、13’やノイズによる輝度変化成分(高周波成
分)の3つに分けられる。このような原画像からストラ
イプの境界領域を認識するために、原画像から輝度変化
成分(中間成分)のうち欠陥でない領域を分離/抽出す
る。なお、上記の周波数とは、画像処理における空間周
波数である。上記中間成分の認識を簡単かつ確実に行う
には、被検査面に映るストライプ模様の間隔および幅
が、欠陥に対して十分大きければよい。図11を例にと
ると、シェーディングなどの低周波成分の周期は、1画
面のx方向の大きさ512画素以上である。ストライプ
模様などの中間成分は、1画面当たり4〜5周期(明暗
ストライプが計9本)なので、1周期約50〜60画素
の大きさである。ここで、欠陥が約0.5〜1mmの大
きさで、カメラの視野が150×140mmであるとす
ると、欠陥は受光画像中に約3画素の大きさで映る。こ
のように上記3つの成分の大きさ(画素数)の差が大き
いほど、中間成分の認識は容易に行うことができる。よ
ってこの差が大きくなるようストライプ照明の間隔、
幅、および明暗の比率を設定すればよい。
Hereinafter, the contents of each of the above processes will be described in detail. First, the boundary region recognition processing 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 and the like.
It is divided into three components: a luminance change component (intermediate component) due to stripe illumination, and a luminance change component (high frequency component) due to defects 13, 13 'and noise. In order to recognize the boundary region of the stripe from such an original image, an area that is not defective among the luminance change components (intermediate components) is separated / extracted from the original image. The above frequency is a spatial frequency in image processing. In order to easily and reliably recognize the intermediate component, it is sufficient that the interval and width of the stripe pattern reflected on the surface to be inspected are sufficiently large for the defect. Taking FIG. 11 as an example, the cycle of the low-frequency component such as shading is 512 pixels or more in the x direction of one screen. An intermediate component such as a stripe pattern has a size of about 50 to 60 pixels per cycle because 4 to 5 cycles per screen (a total of 9 bright and dark stripes). Here, assuming that the defect has a size of about 0.5 to 1 mm and the field of view of the camera is 150 × 140 mm, the defect appears in a received image with a size of about 3 pixels. As described above, as the difference between the sizes (the number of pixels) of the three components is larger, the intermediate component can be more easily recognized. Therefore, the interval of the stripe illumination,
What is necessary is just to set the width and the ratio of light and dark.

【0031】以下、図10の境界領域認識処理P2の具
体例について説明する。境界領域認識処理は、図10に
示すように、スムージングP21、微分P22および絶
対値P23の各処理を行なう。まず、原画像をスムージ
ング(ローパスフィルタ)し、欠陥やノイズによる高周
波成分のみを取り除く。これは、全ての輝度変化のある
領域から欠陥以外の輝度変化のある部分(境界領域)を
認識するために、上記中間成分と高周波成分とを分離し
て中間成分のみを取り出すためと、後に説明する画像強
調処理において、欠陥による輝度変化のみを強調するた
めに欠陥成分のみを取り出す必要があるからである。
Hereinafter, a specific example of the boundary area recognition processing P2 in FIG. 10 will be described. In the boundary region recognition processing, as shown in FIG. 10, each processing of smoothing P21, differentiation P22, and absolute value P23 is performed. First, the original image is smoothed (low-pass filter) to remove only high-frequency components due to defects and noise. This is because the intermediate component and the high-frequency component are separated to extract only the intermediate component in order to recognize a portion (a boundary region) having a luminance change other than a defect from all the regions having a luminance change. This is because it is necessary to take out only the defect component in order to emphasize only the luminance change due to the defect in the image enhancement process.

【0032】以下、上記のスムージングについて、平滑
化フィルタを用いた場合について説明する。平滑化フィ
ルタは、例えば、1画面512×512画素の各画素に
対して、図12に示すように、3×3マスクの局所演算
を行なう場合、注目画素Q0(正方形状に並んだ9画素
中の真中の画素)およびその周囲を囲むQ1〜Q8の画
素に対して、周辺のQ1〜Q8の画素の輝度値の単純平
均値を注目画素の新たな輝度値とするものである。この
ように周辺8画素の単純平均値をとるので、微小ノイズ
等が除去される。なお、5×5マスクや7×7マスクの
ように、マスクの大きさは任意であり、これをマスクサ
イズと呼ぶ。上記の平滑化フィルタの処理回数やマスク
サイズは、ストライプの間隔や欠陥13、13’の大き
さに応じて設定すればよい。このような平滑化フィルタ
処理の結果、原画像の信号S0は図13に示す信号S1
のような欠陥(高周波)成分のみが取り除かれ、欠陥以
外による輝度変化成分(中間成分)とシェーディングな
どによる低周波成分との画像となる。次に、得られた信
号S1を微分する。その結果、シェーディングなどによ
る輝度変化の緩やかな低周波成分が除去され、輝度変化
の急激な中間成分のみが強調される。ただし、一般的な
微分処理では、輝度変化の立ち上がりと立ち下がりエッ
ジが輝度0に対して正負に現われるため、上記微分した
結果の絶対値をとり、すべての輝度変化が正となるよう
な処理を行う。その結果は信号S2に示すようになる。
このようにして、原画像から欠陥以外による輝度変化成
分、すなわち明暗ストライプの境界領域を分離/抽出つ
まり認識することが可能となる。
Hereinafter, a case where a smoothing filter is used for the above-described smoothing will be described. For example, as shown in FIG. 12, when performing a local operation of a 3 × 3 mask on each pixel of 512 × 512 pixels on one screen, the smoothing filter includes a pixel of interest Q0 (out of nine pixels arranged in a square shape). , And a simple average value of the luminance values of the surrounding pixels Q1 to Q8 is set as a new luminance value of the pixel of interest with respect to the pixels Q1 to Q8 surrounding the surrounding pixels. Since the simple average value of the eight peripheral pixels is thus obtained, minute noise and the like are removed. The size of the mask is arbitrary, such as a 5 × 5 mask or a 7 × 7 mask, and this is called a mask size. The number of times of processing of the smoothing filter and the mask size may be set according to the interval between stripes and the size of the defects 13 and 13 '. As a result of such a smoothing filter process, the signal S0 of the original image becomes the signal S1 shown in FIG.
Only the defect (high-frequency) component is removed, and an image is formed of a luminance change component (intermediate component) due to something other than the defect and a low-frequency component due to shading or the like. Next, the obtained signal S1 is differentiated. As a result, a low-frequency component whose luminance changes gradually due to shading or the like is removed, and only an intermediate component whose luminance changes rapidly is emphasized. However, in the general differentiation processing, since the rising edge and the falling edge of the luminance change appear positive or negative with respect to the luminance of 0, the absolute value of the result of the above differentiation is taken, and the processing is performed so that all the luminance changes are positive. Do. The result is as shown in signal S2.
In this manner, it is possible to separate / extract, that is, recognize a luminance change component due to a factor other than a defect, that is, a boundary region between light and dark stripes, from the original image.

【0033】次に、図10の画像強調処理P3の具体例
について説明する。画像強調処理は、図10に示すよう
に、減算P31と絶対値P32の各処理を行なう。本実
施例では、図13における原画像の信号S0とスムージ
ングによって欠陥成分のみが除去された信号S1とを用
いた方法について説明する。これは、信号S0から信号
S1を減算する処理であり、これによって低周波成分お
よびストライプ成分が相殺され、信号S3のように欠
陥、明暗の境界部分およびノイズ等による高周波成分の
みが抽出される。ただし、上記減算のやり方によって、
明ストライプ中に黒く映る欠陥13と暗ストライプ中に
白く映る欠陥13’との一方が負の値となってしまう。
そのため、上記の減算結果の絶対値を求め、全ての強調
結果が正の値となるようにする。なお、図13の画像強
調結果S3には、欠陥の他に境界領域に相当する部分
(中間成分)も残る場合があり、これが誤検出の原因と
なる。そのため次の欠陥検出処理を行なう。
Next, a specific example of the image enhancement process P3 in FIG. 10 will be described. In the image enhancement processing, as shown in FIG. 10, each processing of subtraction P31 and absolute value P32 is performed. In the present embodiment, a method using the signal S0 of the original image in FIG. 13 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, thereby canceling the low-frequency component and the stripe component, and extracting only the high-frequency component due to a defect, a boundary between light and dark, and noise as in the signal S3. However, depending on the method of subtraction,
One of the defect 13 appearing black in the bright stripe and the defect 13 ′ appearing white in the dark stripe has a negative value.
Therefore, the absolute value of the subtraction result is obtained, and all the enhancement results are set to be positive values. In addition, in the image enhancement result S3 in FIG. 13, there may be a case where a portion (intermediate component) corresponding to the boundary region remains in addition to the defect, which causes erroneous detection. Therefore, the following defect detection processing is performed.

【0034】次に、図10の欠陥検出処理P4について
説明する。欠陥検出処理は、図10に示すごとく、減算
P41と2値化P42の各処理を行なう。まず、図13
の画像強調結果S3から境界領域認識結果S2を減算
し、その結果としてS4を得る。これは、上記の減算を
することで欠陥以外の輝度変化領域(境界領域による中
間成分)のレベルを下げ、後の2値化のしきい値の設定
範囲を広げるためである。なお、減算の結果で上記中間
成分の領域が負の値となるが、負になった場合は0にす
るか、もしくは図13のS3に示すように、画像強調処
理での減算の前にあらかじめバイアスBを加えておけば
よい。次に、図13のS4に示すように、所定のしきい
値(ThもしくはバイアスB+Th)で2値化すること
により、S5のごとき2値化信号が得られる。このよう
に、誤検出の原因となりやすい欠陥以外の輝度変化領域
(境界領域)をマスクし、かつシェーディング等の影響
を受けずに欠陥のみを確実に検出することができる。
Next, the defect detection processing P4 in FIG. 10 will be described. In the defect detection processing, as shown in FIG. 10, each processing of subtraction P41 and binarization P42 is performed. First, FIG.
Is subtracted from the boundary area recognition result S2 from the image enhancement result S3, and the result is S4. This is because the above-described subtraction lowers the level of the luminance change region (intermediate component due to the boundary region) other than the defect and widens the setting range of the threshold value for binarization later. Note that the intermediate component area has a negative value as a result of the subtraction. If the intermediate component area has a negative value, the value is set to 0 or, as shown in S3 of FIG. A bias B may be added. Next, as shown in S4 of FIG. 13, binarization is performed with a predetermined threshold value (Th or bias B + Th), thereby obtaining a binarized signal as in S5. In this way, it is possible to mask the luminance change area (boundary area) other than the defect that is likely to cause erroneous detection, and to reliably detect only the defect without being affected by shading or the like.

【0035】次に、上記のようにして欠陥検出を完了し
た後の後処理としては、図10のP5に示すように、欠
陥検出信号S5に基づいて、欠陥部分のラベリング(ラ
ベル付け)、面積計算および重心座標計算を行なう。そ
してホストコンピュータ6は、その結果から欠陥の特
定、位置およびランク付け等を行い、それを表示装置や
プリンタ等の出力装置へ出力する。または、欠陥があっ
た場合に、被検査物を通常ラインから修正専用ライン
(例えば自動車ボディの塗装工程の場合は、欠陥部分の
みを修正塗装する等)へ切り替えるといったラインの制
御、あるいは欠陥のランク(大きさ)、発生個所に対す
る統計処理などに用いてもよい。また、これまでの説明
においては、照明装置1としてストライプ状の明暗パタ
ーンを映し出すものについて説明したが、図14に示す
ように、明暗パターンを格子状にしてもよい。具体的に
は、前記図4のストライプ板1cを図14のような格子
状のパターンとすることで実現できる。このような格子
状パターンを用いた場合の作用、効果は、これまで説明
したストライプ状の場合と同様である。また、格子状パ
ターンの間隔や比率等もこれまで説明しものと同様に設
定すればよい。
Next, as post-processing after the completion of the defect detection as described above, labeling (labeling) and area of the defective portion are performed based on the defect detection signal S5 as shown at P5 in FIG. Calculation and barycentric coordinate calculation are performed. Then, the host computer 6 specifies the defect, positions and ranks the defect based on the result, and outputs the result to an output device such as a display device or a printer. Or, when there is a defect, control of the line such that the inspection object is switched from a normal line to a line dedicated to repair (for example, in the case of a painting process of an automobile body, only the defective portion is repair-painted), or a rank of the defect. (Size) and statistical processing for the location of occurrence may be used. Further, in the above description, the illumination device 1 that projects a stripe-like light-dark pattern has been described. However, as shown in FIG. 14, the light-dark pattern may be formed in a lattice shape. Specifically, it can be realized by forming the stripe plate 1c in FIG. 4 into a lattice pattern as shown in FIG. The operation and effect when such a lattice pattern is used are the same as those in the case of the stripe described above. Further, the intervals and ratios of the lattice pattern may be set in the same manner as described above.

【0036】次に、図10の画像強調処理P3の他の実
施例について説明する。図15は、画像強調処理P3の
他の実施例のフローチャートである。この実施例おいて
は、正規関数での平滑化P33、2次微分P34および
絶対値P35の各処理を行なう。原画像に直接2次微分
のみを適用した場合、電気的なノイズや微小な輝度変化
成分等のノイズをも強調しすぎてしまう。そのため、本
実施例においては、原画像の信号をまず正規関数(ガウ
ス関数)で平滑化してから2次微分を適用するようにし
ている。なお、最後に絶対値を求める点は前記と同様で
ある。原画像のx方向において、平均0、分散σのガウ
ス関数は、下記(数5)式で示される。なお、関数形は
図16に示す。
Next, another embodiment of the image enhancing process P3 in FIG. 10 will be described. FIG. 15 is a flowchart of another embodiment of the image enhancement process P3. In this embodiment, each processing of the smoothing P33 with the normal function, the second derivative P34 and the absolute value P35 is performed. When only the second derivative is directly applied to the original image, electrical noise and noise such as a minute luminance change component are excessively emphasized. Therefore, in the present embodiment, the signal of the original image is first smoothed by a normal function (Gaussian function), and then the second derivative is applied. Note that the point at which the absolute value is finally obtained is the same as described above. In the x direction of the original image, a Gaussian function having an average of 0 and a variance of σ is represented by the following equation (5). The function form is shown in FIG.

【0037】[0037]

【数5】 (Equation 5)

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

【0039】[0039]

【数6】 (Equation 6)

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

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

【0042】次に、被検査面の塗装色などによる影響を
除去する処理について説明する。図19に示すように、
被検査面の色の持つ輝度が高い(明るい)色と低い(暗
い)色では、信号全体の輝度レベルおよびストライプの
コントラストが異なるため、境界領域認識処理P2にお
ける結果が中間成分をマスクするのに不十分な場合があ
る。すなわち、前記図13の画像強調処理S3から境界
領域認識処理結果S2を減算する場合に、欠陥以外の中
間成分のレベルがバイアスレベルB以下に下がらず、2
値化しきい値の設定範囲が広げられない場合が生じる場
合や、被検査面の粗さによって中間成分S2の幅が変化
する場合などである。
Next, a process for removing the influence of the paint color on the surface to be inspected will be described. As shown in FIG.
Since the luminance level of the entire signal and the contrast of the stripe are different between the high (bright) color and the low (dark) color of the color of the surface to be inspected, the result of the boundary region recognition processing P2 masks the intermediate component. May not be enough. That is, when the boundary area recognition processing result S2 is subtracted from the image enhancement processing S3 in FIG. 13, the level of the intermediate component other than the defect does not drop below the bias level B,
There are cases where the setting range of the binarization threshold is not expanded, and cases where the width of the intermediate component S2 changes due to the roughness of the surface to be inspected.

【0043】上記の問題に対処する処理のフローチャー
トを図21に示す。図21は、前記図10の境界領域認
識処理P2の部分を示す。この実施例は、前記図10の
境界領域認識処理P2に、輝度レベル判断P24と平滑
化(係数調節)P25の二つの処理を付加したものであ
る。原画像の輝度ヒストグラフをとると、図20に示す
ように、被検査面が明るい色の場合には輝度値の高い画
素の頻度が大きく、逆に暗い色の場合には輝度値の低い
画素の頻度が大きくなる。そのため、被検査面の色等に
よって輝度レベルを検出/判断することができる。ま
た、図22は、本実施例における信号波形図である。明
るい色の場合はコントラストが大きいので中間成分S2
のレベルL1は大きいが、暗い色の場合はレベルL1は
小さい。このレベルL1を大きくするために微分の絶対
値S2を再度平滑化するとS6のようになり、中間成分
のレベルL1および幅W1がL2およびW2に変化す
る。この平滑化を単純平均化フィルタとすると、フィル
タの係数もしくは除数を変化させることにより、S6の
レベルをS7のレベルL3のように大きく変化させるこ
とが出来る。このS7を用いて画像強調結果S3をマス
ク(減算)すれば、被検査面の色の影響を受けずに上記
2値化しきい値の設定範囲を広げることができる。図2
1のフローチャートにおいては、P24で、原画像P1
の輝度ヒストグラフによる輝度レベル判断を行ない、そ
の結果を用いてP25の平滑化処理における係数を調節
するようにしている。上記と同様に被検査面の粗さを測
定し、その粗さの程度に応じて所定の平滑化処理を行
い、中間レベルの幅(図22:S6のW2)を設定する
ことが出来る。また、中間成分S2のレベルのみを変化
させるには、微分処理P22における微分係数を変化さ
せることでも実現できる。
FIG. 21 is a flowchart of a process for addressing the above problem. FIG. 21 shows a part of the boundary area recognition processing P2 in FIG. In this embodiment, two processes of a luminance level judgment P24 and a smoothing (coefficient adjustment) P25 are added to the boundary region recognition process P2 in FIG. When a luminance histogram of the original image is taken, as shown in FIG. 20, the frequency of a pixel having a high luminance value is high when the surface to be inspected is a bright color, and the frequency of a pixel having a low luminance value is low when the surface to be inspected is a dark color. The frequency increases. Therefore, the luminance level can be detected / determined based on the color of the surface to be inspected. FIG. 22 is a signal waveform diagram in the present embodiment. In the case of a bright color, the contrast is large, so the intermediate component S2
Is large, but in the case of a dark color, the level L1 is small. When the absolute value S2 of the differentiation is smoothed again to increase the level L1, the result becomes S6, and the level L1 and the width W1 of the intermediate component change to L2 and W2. Assuming that this smoothing is a simple averaging filter, the level of S6 can be greatly changed like the level L3 of S7 by changing the coefficient or divisor of the filter. If the image enhancement result S3 is masked (subtracted) using S7, the setting range of the binarization threshold can be expanded without being affected by the color of the surface to be inspected. FIG.
In the flowchart of FIG. 1, at P24, the original image P1
The luminance level is determined by using the luminance histogram shown in FIG. 3, and the result is used to adjust the coefficient in the smoothing process of P25. The roughness of the surface to be inspected is measured in the same manner as described above, and a predetermined smoothing process is performed according to the degree of the roughness, so that the width of the intermediate level (FIG. 22: W2 in S6) can be set. Further, changing only the level of the intermediate component S2 can also be realized by changing the differential coefficient in the differential processing P22.

【0044】次に、被検査面の色によってストライプの
コントラストの違いによる影響が上記の処理を用いても
残ってしまう場合や、被検査面粗さがかなり大きくて欠
陥とはならない高周波成分が大きい場合には、前記図1
0の欠陥検出処理P4における2値化のしきい値Thを
被検査面の色もしくは粗さに基づいて変化させることに
より、欠陥のみを確実に検出することが出来る。構成は
上記と同様に、被検査面の色もしくは粗さを検出し、暗
い色でストライプのコントラストが大きい場合や粗さが
大きい場合は、それに応じて欠陥検出処理P4における
2値化のしきい値Thを上げる、といったように欠陥の
みが確実に検出されるようにしきい値Thが設定する。
Next, the influence of the difference in the contrast of the stripe depending on the color of the surface to be inspected remains even when the above processing is used, or the high frequency component that does not become a defect because the surface to be inspected is considerably large. In the case shown in FIG.
By changing the threshold value Th for binarization in the defect detection process P4 of 0 based on the color or roughness of the surface to be inspected, only the defect can be reliably detected. In the same manner as described above, the configuration detects the color or roughness of the surface to be inspected, and if the contrast is high or the roughness of the stripe is large in a dark color, the threshold value for binarization in the defect detection process P4 is accordingly determined. The threshold value Th is set such that only the defect is reliably detected, such as increasing the value Th.

【0045】次に、本発明の実用的な実施例について説
明する。図23は、本発明を自動車製造ラインの塗装検
査工程に適用した実施例の斜視図である。図23に示す
ように、塗装された自動車のボディ14が塗装検査ライ
ンを矢印の方向へ流れている。このボディ14の塗装面
の一部分に、所定の明暗模様を映し出し、かつ明暗模様
が映し出された部分を撮像するように、照明装置1、ビ
デオカメラ2がアーチ状に固定された状態で複数個配置
されている。したがって、ボディ14が塗装検査ライン
上を移動し、アーチ状に配置されたビデオカメラとスト
ライプ照明の下を通過する間に、被検査面の欠陥検出が
行われる。このような構成とすることにより、ボディ1
4の塗装面を余すところなく検査することができる。
Next, a practical embodiment of the present invention will be described. FIG. 23 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. 23, the painted automobile body 14 flows on the paint inspection line in the direction of the arrow. A plurality of lighting devices 1 and video cameras 2 are arranged in an arched manner so that a predetermined light and dark pattern is projected on a part of the painted surface of the body 14 and an image of the part where the light and dark pattern is projected is taken. Have been. Accordingly, while the body 14 moves on the paint inspection line and passes under the video camera arranged in an arch shape and under the stripe illumination, the defect detection of the inspection surface is performed. With such a configuration, the body 1
The painted surface of No. 4 can be thoroughly inspected.

【0046】上記のように、照明装置1およびビデオカ
メラ2は所定の位置に固定されているので、被検査物体
であるボディ14との相対位置および塗装ラインのライ
ンスピードが既知であれば、ホストコンピュータ6にお
いて被検査物体上の欠陥位置の特定が可能である。した
がって、例えば被検査物体の外観図を表示して欠陥位置
にマーカを付加する、もしくは座標などの数値として欠
陥位置を出力する、または被検査面の欠陥位置に除去可
能なマーカを直接付加するような装置の制御を行う、な
どといった何らかの出力方法によって検査結果を作業者
に知らせるようにホストコンピュータ6を構成すればよ
い。或いは、欠陥があった場合、被検査物体を通常ライ
ンから修正専用ラインへ切り替えるといったラインの制
御、または欠陥のランク(大きさ)、発生個所に関する
統計処理などを行ってもよい。このような構成とするこ
とにより、ボディの塗装面をくまなく検査することがで
き、また、高価なロボット装置などを用いてビデオカメ
ラと照明を被検査面に沿って走査する必要もなく、容易
にボディ全面を検査することができる。
As described above, since the illumination device 1 and the video camera 2 are fixed at predetermined positions, if the relative position with respect to the body 14 to be inspected and the line speed of the coating line are known, the host The computer 6 can specify a defect position on the inspection object. Therefore, for example, an external view of the inspected object is displayed to add a marker to the defect position, or the defect position is output as a numerical value such as coordinates, or a removable marker is directly added to the defect position on the inspected surface. The host computer 6 may be configured to notify the operator of the inspection result by any output method such as controlling an appropriate device. Alternatively, when there is a defect, line control such as switching the inspected object from a normal line to a line dedicated to correction, or a statistical process relating to the rank (size) of the defect and the place of occurrence may be performed. With such a configuration, the painted surface of the body can be inspected throughout, and there is no need to scan the video camera and the illumination along the surface to be inspected using an expensive robot device or the like. The whole body can be inspected.

【0047】次に、本発明の実用的な他の実施例につい
て説明する。図24は、自動車の塗装ラインにおいて、
塗装ライン上を矢印の方向に移動する自動車ボディ14
の塗装面3をビデオカメラ2で撮像し、連続して検査す
るものに本発明を適用した例である。前記のごとく本発
明は、ストライプの境界領域(マスクされた領域)は検
査できない。したがって1画面の幅だけ順にずらして撮
像したのでは、上記の境界領域が検査されないまま残っ
てしまう。そのため、図24に示すように、ビデオカメ
ラ2で順次撮像する各受光画像範囲を重ねることによっ
て、もれなく欠陥検出を行うようにしたものである。図
25を用いてさらに詳細に説明する。図25において、
ビデオカメラ2から任意のn回目の受光画像が図のよう
に得られたとすると、n+1回目の受光画像がストライ
プ1本分の幅の1/2(△g)だけずれた画像であれ
ば、n回目の受光画像においてマスクされたストライプ
の境界領域がn+1回目の受光画像では明もしくは暗ス
トライプ内に入るので、検出もれは生じない。さらに、
n+2回目の受光画像を1画面(G)だけずらして取り
込み、再び前回と同様に△gずらしてn+3回目を取り
込む、というような処理を繰り返して行えば、効率よく
かつ連続して欠陥検出を行なうことが出来る。
Next, another practical embodiment of the present invention will be described. FIG. 24 shows a coating line of an automobile.
The car body 14 moves in the direction of the arrow on the painting line
This is an example in which the present invention is applied to an apparatus in which the painted surface 3 of the image No. 1 is imaged by the video camera 2 and inspected continuously. As described above, the present invention cannot inspect the boundary region (masked region) of the stripe. Therefore, if the images are sequentially shifted by the width of one screen, the above boundary area remains without being inspected. Therefore, as shown in FIG. 24, the defect detection is performed without fail by overlapping the respective light-receiving image ranges that are sequentially captured by the video camera 2. This will be described in more detail with reference to FIG. In FIG.
Assuming that an arbitrary n-th received light image is obtained from the video camera 2 as shown in the figure, if the (n + 1) -th received light image is an image shifted by △ (△ g) of the width of one stripe, n In the (n + 1) -th received light image, the boundary region of the masked stripe in the second received light image falls within the bright or dark stripe, so that no detection omission occurs. further,
If the process of taking in the (n + 2) th received light image by shifting by one screen (G) and taking in the (n + 3) th time again by shifting by Δg as in the previous time is repeatedly performed, defect detection is performed efficiently and continuously. I can do it.

【0048】また、上記のごとき検出もれを防ぐ他の方
法としては、図26に示すような、不等間隔のストライ
プの照明装置を用いてもよい。すなわち、検出もれは、
ストライプの境界領域に相当するマスク領域の間隔と、
欠陥が受光画面に現われるタイミングとが一致すること
によって発生する可能性が高い。したがって検出タイミ
ングがほぼ一定であれば、図26に示すように、ストラ
イプの間隔または幅を一定でなくすれば、検出もれの発
生を解消することが出来る。
As another method for preventing the above-mentioned detection leakage, an illuminating device having unequally spaced stripes as shown in FIG. 26 may be used. In other words,
An interval between mask regions corresponding to the boundary region of the stripe;
It is highly likely that a defect occurs when the timing of appearance of the defect coincides with the timing of appearance on the light receiving screen. Therefore, if the detection timing is substantially constant, as shown in FIG. 26, if the intervals or widths of the stripes are not constant, it is possible to eliminate the occurrence of missed detection.

【0049】次に、前に説明した“ゆず肌”がある場合
には、誤検出を生じるおそれがあるので、以下、それを
解消する境界領域処理について説明する。図27は、
“ゆず肌”対策として境界領域処理を行なう場合の処理
を示すフローチャートである。図27では、前記図10
のフローチャートに、境界領域処理P6を追加した点
と、絶対値処理P23、P32が2値化処理P24、P
33に変わった点が異なり、その他の部分は同じであ
る。被検査面に“ゆず肌”などの薄い凹凸がある場合、
その粗さの程度によっては、上記のマスク処理でもマス
クしきれずに残ってしまい、欠陥以外の個所を誤検出し
てしまう場合がある。例えば、図28に示すように、ス
トライプ画像の明暗の境界は表面の粗さに応じた乱れが
生じ、(c)のような孤立点が表れたり、輝度レベルが
不安定となる範囲αが発生する。この範囲αの部分が上
記誤検出の原因となる。そしてこれは表面粗さに比例し
て大きくなるので、範囲αが大きいほどマスクされずに
残ってしまい誤検出が発生しやすくなる。上記の問題を
解決するため、本実施例においては、次のように構成し
ている。まず、境界領域認識処理においては、前記と同
様のスムージングP21と微分P22の処理を行なった
結果をP24で2値化する。また、画像強調処理P3で
は、減算P31を行なった結果をP33で2値化する。
この際、例えば、P24では境界領域が“0”(黒)、
境界領域でない部分が“1”(白)となるように2値化
し、P33では輝度変化のある部分が“1”(白)、な
い部分が“0”(黒)となるように2値化する。次に、
境界領域処理P6では、P24の結果において境界領域
(例えば“0”)を拡大処理(詳細後述)する。次に、
欠陥検出処理P4では、P41で境界領域処理結果と画
像強調処理結果とのANDを求める。上記の例では、境
界領域処理結果では境界領域でない部分が“1”であ
り、画像強調処理結果では輝度変化のある部分(欠陥や
境界領域の部分)が“1”であるから、両者のANDを
求めれば、欠陥部分のみを検出することが出来る。ま
た、上記のように、境界領域の拡大処理を行なってマス
ク領域を拡大し、図28の範囲αの部分もマスクするよ
うにしているので、誤検出を生じるおそれのある部分は
暗部分として処理され、“ゆず肌”を欠陥と誤検出する
おそれはなくなる。なお、基本的には、上記の境界領域
処理P6を除いた構成、すなわち、P2の境界領域認識
処理結果とP3の画像強調処理結果とのANDを求める
構成でもよい。
Next, there is a possibility that erroneous detection may occur in the case where the above-mentioned "yuzu skin" is present. Hereinafter, the boundary region processing for solving the problem will be described. FIG.
It is a flowchart which shows the process at the time of performing a boundary area process as a measure against "yuzu skin". In FIG. 27, FIG.
The point that the boundary area processing P6 is added to the flowchart of FIG.
33, and the other parts are the same. If the surface to be inspected has thin irregularities such as "yuzu skin",
Depending on the degree of the roughness, the mask processing may remain without being completely masked, and a portion other than a defect may be erroneously detected. For example, as shown in FIG. 28, the boundary between the light and dark portions of the stripe image is disturbed according to the surface roughness, and an isolated point appears as shown in FIG. I do. This part of the range α causes the erroneous detection. Since this increases in proportion to the surface roughness, the larger the range α is, the more the mask remains without being masked, and erroneous detection is likely to occur. In order to solve the above problem, the present embodiment is configured as follows. First, in the boundary region recognition processing, the result of performing the same processing of smoothing P21 and differentiation P22 as described above is binarized at P24. In the image enhancement process P3, the result of the subtraction P31 is binarized in P33.
At this time, for example, in P24, the boundary area is “0” (black),
In P33, binarization is performed so that a portion that is not a boundary region is “1” (white), and a portion with luminance change is “1” (white) and a portion that is not changed is “0” (black) in P33. I do. next,
In the boundary area processing P6, the boundary area (for example, “0”) is enlarged (as will be described later) in the result of P24. next,
In the defect detection processing P4, an AND of the boundary area processing result and the image enhancement processing result is obtained in P41. In the above example, a portion that is not a boundary region is “1” in the boundary region processing result, and a portion with a change in luminance (a defect or a boundary region portion) is “1” in the image enhancement processing result. Is obtained, only the defective portion can be detected. Further, as described above, the mask area is enlarged by performing the enlargement processing of the boundary area, and the part of the range α in FIG. 28 is also masked. As a result, there is no danger of erroneously detecting “yuzu skin” as a defect. Basically, a configuration excluding the above-described boundary region processing P6, that is, a configuration in which an AND of the boundary region recognition processing result of P2 and the image enhancement processing result of P3 may be obtained.

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

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

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

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

【0054】次に、本発明の他の実施例について説明す
る。この実施例は、図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. In this embodiment, parts such as the lighting 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 shown in FIG.
This embodiment is the same as the first embodiment, and only the processing contents are different.

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

【0056】次に、図32は、画像処理装置5における
処理内容を示すフローチャートである。画像処理装置5
においては、図32に示すごとく、基本的には、原画像
P1から、平滑化処理P11、強調処理P12、2値化
処理P13および面積判定処理P14を行なって欠陥を
検出する。また、後述するように、“ゆず肌”対策とし
て領域処理P15を追加してもよい。また、上記のごと
くにして欠陥を検出した後の後処理としては、ラベリン
グ、面積および重心座標計算P16があり、それらの結
果をP17でモニタ等に表示し、或いは後続機器に出力
する。
Next, FIG. 32 is a flowchart showing the processing contents in the image processing apparatus 5. Image processing device 5
In FIG. 32, as shown in FIG. 32, basically, a defect is detected by performing a smoothing process P11, an emphasizing process P12, a binarizing process P13, and an area determining process P14 from the original image P1. As will be described later, a region process P15 may be added as a measure against “yuzu skin”. As post-processing after detecting a defect as described above, there is labeling, area and barycentric coordinate calculation P16, and the results are displayed on a monitor or the like at P17 or output to a subsequent device.

【0057】以下、上記の各処理の内容について詳細に
説明する。図33は各画像とその信号(或るy座標の
値、この例では図31の*印の値におけるもの)を示す
図である。以下、図33に基づいて画像処理内容につい
て説明する。まず、原画像S20に対して所定のマスク
サイズの平滑化(スムージング)処理を行い、ノイズ等
による微小な輝度変化成分のみを取り除くとS21が得
られる。この平滑化処理は、例えば注目画素およびその
近傍の画素の輝度値の平均値を求め、それを注目画素の
新たな輝度値とする単純平均化フィルタである。このと
きの平滑化フィルタのマスクサイズは、原画像に発生す
るノイズの大きさに応じて決めればよい。次に、S21
を強調処理することで輝度変化のある領域を強調する。
この強調処理は、例えば微分処理であり、xおよびy方
向の微分結果の絶対値の和、もしくは2乗の和の平方根
をとったものであり、輝度変化領域をすべて正(+)側
に出力するとS22に示すようになる。なお、S22の
画像は、白と黒を反転して示している。S22の結果を
所定のしきい値で輝度変化領域を黒(“0”)それ以外
を白(“255”)となるように2値化すると、S23
のようになる。S23の画像に示すように、欠陥部分お
よびストライプ境界部分といった輝度変化のある領域が
抽出される。なお、被検査面の状態によってはストライ
プの境界線が歪んで抽出されるが、上記のように原画像
を平滑化することによって、1つの連続した領域として
抽出されるため、被検査面の影響はほとんどない。しか
し、ストライプの境界線付近では、被検査面の“ゆず
肌”の影響によるノイズが残る可能性があるので、それ
を除去するため、領域処理を行なう。すなわち、S23
の画像における暗部分(輝度変化のある部分に相当)の
領域を拡大する処理を行なうことにより、ストライプ境
界領域と“ゆず肌”によるノイズとを連結して1つの領
域とする。
Hereinafter, the contents of each of the above processes will be described in detail. FIG. 33 is a diagram showing each image and its signal (at a certain y-coordinate, in this example, at the value of the mark * in FIG. 31). Hereinafter, the content of the image processing will be described with reference to FIG. First, a smoothing process of a predetermined mask size is performed on the original image S20 to remove only a small luminance change component due to noise or the like, thereby obtaining S21. This smoothing processing is, for example, a simple averaging filter that obtains an average value of luminance values of a target pixel and pixels in the vicinity thereof and uses the average value as a new luminance value of the target pixel. At this time, the mask size of the smoothing filter may be determined according to the magnitude of noise generated in the original image. Next, S21
Is emphasized, thereby emphasizing an area having a luminance change.
This emphasis process is, for example, a differentiation process, which is performed by taking the sum of the absolute values of the differentiation results in the x and y directions or the square root of the sum of the squares, and outputs all the brightness change areas to the positive (+) side. Then, it becomes as shown in S22. In addition, the image of S22 is shown by inverting white and black. When the result of S22 is binarized with a predetermined threshold value so that the brightness change area becomes black (“0”) and the other areas become white (“255”), S23
become that way. As shown in the image of S23, a region having a luminance change such as a defective portion and a stripe boundary portion is extracted. Note that, depending on the state of the surface to be inspected, the boundary of the stripe is extracted with distortion, but is extracted as one continuous region by smoothing the original image as described above. Almost no. However, near the boundary of the stripe, there is a possibility that noise due to the influence of “yuzu skin” on the surface to be inspected may remain. Therefore, region processing is performed to remove the noise. That is, S23
By performing a process of enlarging a dark portion (corresponding to a portion having a change in luminance) in the image of (1), the stripe boundary region and the noise due to “yuzu skin” are connected to form one region.

【0058】次に、上記の結果について、各部分の面積
判定を行なう。S23の画像から明らかなように、欠陥
部分の面積(大きさ)はストライプ境界部分の面積に比
べて大幅に小さいので、所定面積以下の領域を欠陥と判
定するといった判定処理を行うことにより、欠陥のみを
抽出することが出来る。この面積判定結果はS24に示
すようになり、明暗ストライプ画像の明部分に黒く映る
欠陥と暗部分に白く映る欠陥との両方を検出することが
出来る。ただし、明暗の境界部分(輝度変化のある部
分)は欠陥検出を行なうことが出来ないので、前記図1
(a)の実施例と同様に、被検査面全体を検査するに
は、被検査物体もしくは照明手段と撮像手段を順次移動
させ、明部分が被検査面全体を走査するように構成する
(例えば前記図23、図24の構成)。
Next, the area of each part is determined based on the above result. As is clear from the image of S23, the area (size) of the defective portion is much smaller than the area of the stripe boundary portion. Only one can be extracted. The result of the area determination is as shown in S24, and it is possible to detect both a defect appearing black in the bright part and a defect appearing white in the dark part of the bright and dark stripe image. However, since a defect cannot be detected at a boundary portion between light and dark (a portion having a change in luminance), the above-described FIG.
As in the embodiment of (a), in order to inspect the entire surface to be inspected, the object to be inspected or the illuminating means and the imaging means are sequentially moved so that the bright portion scans the entire surface to be inspected (for example, 23 and 24).

【0059】次に、被検査面が曲面の場合おける特別な
処理について説明する。上記実施例においては、面積判
定によって欠陥を検出するため、次のような問題が生じ
る。すなわち、図34に示すように、被検査面が曲面の
場合には、ストライプが曲面に沿って変形する。そのた
め、ストライプ境界線が画面隅に途切れて面積が小さく
なる場合(○印で囲んだ部分)が生じることがある。こ
のような場合には、面積判定においてこの部分を欠陥と
誤検出してしまう可能性がある。そのような問題を解決
するため、ストライプ境界線は必ずウィンドウ(画面4
辺)のいずれかに接している、という性質を利用し、検
出領域がウィンドウに接している場合には、その領域を
処理対象から除く処理を行えばよい。具体的には、1画
面が512×480画素の場合に、検出領域のxおよび
y座標の最大および最小点が0、479もしくは511
のいずれかであったならば、その領域がウィンドウに接
しているものと判断し、その部分を除けばよい。
Next, a special process when the surface to be inspected is a curved surface will be described. In the above embodiment, the following problem occurs because the defect is detected by the area determination. That is, as shown in FIG. 34, when the surface to be inspected is a curved surface, the stripe is deformed along the curved surface. For this reason, the stripe boundary line may be interrupted at the corner of the screen to reduce the area (a part surrounded by a circle) in some cases. In such a case, this part may be erroneously detected as a defect in the area determination. In order to solve such a problem, the stripe boundary line must be a window (screen 4).
If the detection area is in contact with the window, the process of excluding the area from the processing target may be performed. Specifically, when one screen has 512 × 480 pixels, the maximum and minimum points of the x and y coordinates of the detection area are 0, 479 or 511.
If so, it is determined that the area is in contact with the window, and that part may be removed.

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

【0061】また、上記の問題を解決するためのさらに
他の方法として次のような方法もある。照明装置1のス
トライプ板1cに、ストライプに対して斜めに、白スト
ライプ内には黒、黒ストライプ内には白となるような線
を入れ、さらにこの線に交差するような上記と同様の線
をもう1本予め入れておく。そのような照明装置を用い
た場合のストライプ画像は、図36(a)に示すように
なる。このような原画像を処理すれば、図36(b)に
示すようになり、ストライプ境界線がすべて連結した1
つの領域となるため、面積が大きくなり、面積判定がよ
り確実に行われることになる。ただし、前記の図23や
図24のように、被検査体を順次移動させて広い面積を
検査する場合に、被検査体の移動方向と上記の斜めの線
の方向とが一致すると、その線の境界部分に欠陥があっ
た場合には、欠陥が検出されないことになる。したがっ
て、上記の斜めの線と移動方向とが一致しないように設
定する必要がある。なお、上記図1(b)に相当する実
施例において、前記図1(a)に相当する実施例で説明
した照明手段の構成、2値化しきい値の設定方法や領域
処理の具体的方法、実用化装置等については、前記と同
様に適用することが出来る。
Further, as another method for solving the above problem, there is the following method. In the stripe plate 1c of the illuminating device 1, a line similar to the above, which crosses this line, is inserted diagonally to the stripe so as to be black in the white stripe and white in the black stripe. Put another one in advance. FIG. 36A shows a stripe image when such a lighting device is used. When such an original image is processed, the result is as shown in FIG. 36 (b).
Since there are three regions, the area is increased, and the area determination is performed more reliably. However, as shown in FIG. 23 and FIG. 24, when the inspection object is sequentially moved and a large area is inspected, if the moving direction of the inspection object coincides with the direction of the oblique line, the line If there is a defect at the boundary portion of, the defect will not be detected. Therefore, it is necessary to set so that the above-mentioned oblique line does not coincide with the moving direction. In the embodiment corresponding to FIG. 1B, the configuration of the illuminating means described in the embodiment corresponding to FIG. The practical application device and the like can be applied in the same manner as described above.

【0062】次に、前記照明装置1におけるストライプ
照明の実用的な設定方法、すなわち、ストライプの間隔
T、白と黒の比率および検査面からの距離Dの設定方法
について説明する。まず、図37に基づいて、ビデオカ
メラ2の検査範囲Lについて説明する。
Next, a practical method of setting stripe illumination in the illumination device 1, that is, a method of setting the interval T between stripes, the ratio of black and white, 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.

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

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

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

【0066】[0066]

【発明の効果】以上説明してきたように、この発明にお
いては、ストライプ画像の明部分中に黒く映る欠陥と暗
部分中に白く映る欠陥との両方を検出するように構成し
たことにより、1画面で検出できる領域が広くなるの
で、欠陥検出を迅速に行なうことが出来る。また、いわ
ゆる“ゆず肌”のような欠陥とならない極めて薄い凹凸
による影響を生じやすい領域を欠陥検出領域から排除す
るように構成したことにより、“ゆず肌”を欠陥と誤検
出するおそれがなくなり、より高精度の欠陥検出を行な
うことが出来る、という効果が得られる。
As described above, according to the present invention, both a defect appearing black in a light portion of a stripe image and a defect appearing white in a dark portion of a stripe image are detected. Since the area which can be detected by the method is widened, the defect can be detected quickly. In addition, since a region that is likely to be affected by extremely thin unevenness that does not become a defect such as so-called “yuzu skin” is excluded from the defect detection region, there is no possibility that “yuzu skin” is erroneously detected as a defect. The effect is obtained that the defect can be detected with higher accuracy.

【0067】また、上記の影響を生じやすい領域を欠陥
検出領域から排除するための領域処理を行なう量を、実
験等であらかじめ求めておいた値に設定するものにおい
ては、実際の検査時に、処理量を簡単に設定することが
出来、また、入力画像毎に被検査面の表面粗さを測定
し、その結果から処理の最適な量を自動的に求めるもの
においては、それぞれの被検査体に応じた最適な量に設
定することが出来、精密な検査を行なうことが出来る。
また、明暗パターン画像の輝度ヒストグラムに基づいて
微分係数や2値化しきい値等を調節するものにおいて
は、色による明暗の変化に左右されることなく、精度の
良い検査が実現できる。また、面積判定によって欠陥を
検出するものにおいて、ストライプ境界線部分を一繋が
りの領域とするように構成したものにおいては、曲面に
よる影響を排除し、常に精度の良い検査が実現できる。
また、工場ラインにおいて、被検査物体をアーチ状に囲
むように複数の照明手段と撮像手段とを配置したものに
おいては、ロボット等の高価な装置を用いることなく被
検査物体全面を容易に検査することができる、等の効果
が得られる。
In the case where the amount of area processing for excluding the area where the above-mentioned influence is likely to occur from the defect detection area is set to a value obtained in advance by an experiment or the like, the amount of processing performed at the time of actual inspection is reduced. The amount can be easily set, and the surface roughness of the surface to be inspected is measured for each input image, and the optimum amount of processing is automatically determined from the results. It can be set to an optimal amount according to it, and a precise inspection can be performed.
Further, in the case of adjusting the differential coefficient, the binarization threshold, and the like based on the luminance histogram of the light-dark pattern image, a highly accurate inspection can be realized without being affected by the change in light-darkness due to the color. Further, in the case where a defect is detected by area determination and the stripe boundary line portion is configured as a continuous area, the influence of a curved surface is eliminated, and a highly accurate inspection can always be realized.
Further, in a factory line where a plurality of illumination means and imaging means are arranged so as to surround the inspected object in an arch shape, the entire inspected object can be easily inspected without using an expensive device such as a robot. Can be obtained.

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

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

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

【図3】図1の実施例における画像処理装置5の一例の
ブロック図。
FIG. 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 illumination device 1 in the embodiment of FIG.

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

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

【図7】被検査物の表面上の欠陥を受光画像に映し出す
原理を示す図。
FIG. 7 is a view showing the principle of displaying a defect on the surface of the 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 processing contents in the first embodiment.

【図11】原画像の信号に含まれる各成分を示す図。FIG. 11 is a diagram showing components 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 view showing signals in each processing of the first embodiment.

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

【図15】画像強調処理の他の処理手順を示すフローチ
ャート。
FIG. 15 is a flowchart illustrating another processing procedure of the image enhancement processing.

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

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

【図18】図17の特性をデジタル化した特性を示す
図。
FIG. 18 is a diagram showing characteristics obtained by digitizing the characteristics shown in FIG. 17;

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

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

【図21】境界領域認識処理の他の処理手順を示すフロ
ーチャート。
FIG. 21 is a flowchart illustrating another processing procedure of the boundary area recognition processing.

【図22】図21の境界領域認識処理における信号波形
図。
FIG. 22 is a signal waveform diagram in the boundary area recognition processing of FIG. 21.

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

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

【図25】図24における画像の移動状況を説明するた
めの図。
FIG. 25 is a view for explaining the movement state of the image in FIG. 24;

【図26】図24における他の照明画像を示す図。FIG. 26 is a diagram showing another illumination image in FIG. 24;

【図27】“ゆず肌”対策として境界領域処理を設けた
場合の処理内容を示すフローチャート。
FIG. 27 is a flowchart showing processing contents when a boundary area processing is provided as a measure against “yuzu skin”.

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

【図29】領域拡大/縮小処理を説明するための画素
図。
FIG. 29 is a pixel diagram for explaining area enlargement / reduction processing.

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

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

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

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

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

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

【図36】照明装置に斜めのストライプを付加したもの
における受光画像とその画像信号を示す図。
FIG. 36 is a diagram showing a received light image and its image signal in a case where a diagonal stripe is added to the illumination device.

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

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

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

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

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

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

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

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

【符号の説明】[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 ... Inspection Surface 12 D / A converter 4 Camera control unit 13 Defect 5 Image processing device 14 Body

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭63−111448(JP,A) 特開 平6−148098(JP,A) 特開 平4−16752(JP,A) 特開 平2−298841(JP,A) 特開 平6−235624(JP,A) 特開 平5−164703(JP,A) 特開 昭63−171345(JP,A) 特開 平2−93313(JP,A) (58)調査した分野(Int.Cl.7,DB名) G01B 11/00 - 11/30 102 G01N 21/84 - 21/958 ──────────────────────────────────────────────────続 き Continuation of the front page (56) References JP-A-63-111448 (JP, A) JP-A-6-148098 (JP, A) JP-A-4-16752 (JP, A) JP-A-2- 298841 (JP, A) JP-A-6-235624 (JP, A) JP-A-5-164703 (JP, A) JP-A-63-171345 (JP, A) JP-A-2-93313 (JP, A) (58) Field surveyed (Int.Cl. 7 , DB name) G01B 11/00-11/30 102 G01N 21/84-21/958

Claims (25)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】被検査面に光を照射し、その被検査面から
の反射光に基づいて受光画像を作成し、この受光画像に
基づいて被検査面上の欠陥を検出する表面欠陥検査装置
において、 被検査面に所定の明暗パターンを映し出す照明手段と、 上記被検査面を撮像して得られる受光画像を電気信号の
画像データに変換する撮像手段と、 上記画像データにおける周波数成分のうち低い周波数領
域での明部と暗部の境界領域を識別する境界領域識別手
段と、 上記画像データにおける周波数成分のうち高い周波数領
域で、かつレベルが所定値以上の領域のみを抽出する画
像強調手段と、 上記画像強調手段で抽出した領域のうち上記境界領域識
別手段で識別した境界領域でない部分を欠陥として検出
する欠陥検出手段と、 を備えたことを特徴とする表面欠陥検査装置。
1. A surface defect inspection apparatus which irradiates a surface to be inspected with light, creates a light reception image based on light reflected from the surface to be inspected, and detects a defect on the surface to be inspected based on the light reception image. An illumination unit for projecting a predetermined light and dark pattern on the surface to be inspected; an imaging unit for converting a received light image obtained by imaging the surface to be inspected into image data of an electric signal; and a low frequency component among the image data. Boundary region identification means for identifying a boundary region between a bright part and a dark part in a frequency domain, and image enhancement means for extracting only a high-frequency region among frequency components in the image data, and a level having a predetermined value or more, Defect detection means for detecting, as a defect, a portion other than the boundary area identified by the boundary area identification means in the area extracted by the image enhancement means, Inspection equipment.
【請求項2】上記境界領域識別手段によって得られた境
界領域を拡大する処理を行なう境界領域処理手段を備え
たことを特徴とする請求項1に記載の表面欠陥検査装
置。
2. The surface defect inspection apparatus according to claim 1, further comprising a boundary area processing means for performing processing for enlarging the boundary area obtained by said boundary area identification means.
【請求項3】上記境界領域処理手段は、被検査面の粗さ
に応じて予め定められた所定値だけ境界領域を拡大する
ものである、ことを特徴とする請求項2に記載の表面欠
陥検査装置。
3. The surface defect according to claim 2, wherein said boundary area processing means enlarges the boundary area by a predetermined value according to the roughness of the surface to be inspected. Inspection equipment.
【請求項4】上記境界領域処理手段は、上記撮像手段で
求めた画像データから得られる被検査面の粗さに応じた
値だけ境界領域を拡大するものである、ことを特徴とす
る請求項2に記載の表面欠陥検査装置。
4. The apparatus according to claim 1, wherein said boundary area processing means expands the boundary area by a value corresponding to the roughness of the surface to be inspected obtained from the image data obtained by said imaging means. 3. The surface defect inspection device according to 2.
【請求項5】上記境界領域処理手段は、一旦、境界領域
を拡大した後、境界領域を縮小する処理を行なうもので
ある、ことを特徴とする請求項2乃至請求項4のいずれ
かに記載の表面欠陥検査装置。
5. The method according to claim 2, wherein said boundary area processing means performs processing for reducing the boundary area after expanding the boundary area once. Surface defect inspection equipment.
【請求項6】上記画像強調手段は、上記撮像手段によっ
て得られた画像データの原画像と、原画像に所定の平滑
化処理を施した画像との差の絶対値を求めるものであ
る、ことを特徴とする請求項1乃至請求項5のいずれか
に記載の表面欠陥検査装置。
6. The image enhancement means for calculating an absolute value of a difference between an original image of image data obtained by the imaging means and an image obtained by performing a predetermined smoothing process on the original image. The surface defect inspection apparatus according to any one of claims 1 to 5, wherein:
【請求項7】上記画像強調手段は、上記撮像手段によっ
て得られた画像データの原画像を正規関数で平滑化した
のち2次微分した結果の絶対値を求めるものである、こ
とを特徴とする請求項1乃至請求項5のいずれかに記載
の表面欠陥検査装置。
7. The image emphasizing means is for obtaining an absolute value of a result obtained by subjecting an original image of the image data obtained by the imaging means to a normal function and then performing a second differentiation. The surface defect inspection device according to claim 1.
【請求項8】上記境界領域識別手段は、上記撮像手段に
よって得られた画像データの原画像に平滑化処理を施し
た画像を微分し、その結果の絶対値を求めるものであ
る、ことを特徴とする請求項1乃至請求項7のいずれか
に記載の表面欠陥検査装置。
8. The method according to claim 1, wherein the boundary area identifying means differentiates an image obtained by performing a smoothing process on an original image of the image data obtained by the imaging means, and obtains an absolute value of the result. The surface defect inspection apparatus according to any one of claims 1 to 7, wherein
【請求項9】上記境界領域識別手段で得られた画像に、
原画像の輝度ヒストグラムもしくは被検査面の粗さに基
づいて設定された平滑化処理を行うか、または上記境界
領域認識手段における微分係数を、原画像の輝度ヒスト
グラムに基づいて設定することを特徴とする請求項1乃
至請求項8のいずれかに記載の表面欠陥検査装置。
9. An image obtained by the boundary area identifying means,
Performing a smoothing process set based on the luminance histogram of the original image or the roughness of the surface to be inspected, or setting the differential coefficient in the boundary area recognition means based on the luminance histogram of the original image. The surface defect inspection apparatus according to any one of claims 1 to 8, wherein:
【請求項10】上記欠陥検出手段は、上記境界領域認識
手段の結果と上記画像強調手段の結果との差を求め、そ
の結果を所定のしきい値で2値化するものである、こと
を特徴とする請求項1乃至請求項9のいずれかに記載の
表面欠陥検査装置。
10. The method according to claim 1, wherein said defect detecting means calculates a difference between a result of said boundary area recognizing means and a result of said image enhancing means, and binarizes the result with a predetermined threshold value. The surface defect inspection apparatus according to any one of claims 1 to 9, wherein:
【請求項11】上記欠陥検出手段は、原画像の輝度ヒス
トグラムもしくは被検査面の粗さに基づいて上記2値化
しきい値を調節するものである、ことを特徴とする請求
項10に記載の表面欠陥検査装置。
11. The apparatus according to claim 10, wherein said defect detecting means adjusts said binarization threshold based on a luminance histogram of an original image or roughness of a surface to be inspected. Surface defect inspection equipment.
【請求項12】被検査面に光を照射し、その被検査面か
らの反射光に基づいて受光画像を作成し、この受光画像
に基づいて被検査面上の欠陥を検出する表面欠陥検査装
置において、 被検査面に所定の明暗パターンを映し出す照明手段と、 上記被検査面を撮像して得られた受光画像を電気信号の
画像データに変換する撮像手段と、 上記撮像手段によって得られた画像データを平滑化する
平滑化手段と、 上記平滑化手段で平滑化した明暗パターンの画像データ
で輝度変化のある部分を抽出する強調手段と、 上記強調手段の結果を2値化する2値化手段と、 上記2値化手段で得られた上記輝度変化のある部分の領
域をそれぞれ演算することによって1画面中に存在する
輝度変化のある部分毎にそれぞれの面積を求め、その面
積が所定値以下であった部分を欠陥として検出する面積
判定処理手段と、 を備えたことを特徴とする表面欠陥検査装置。
12. A surface defect inspection apparatus that irradiates light to a surface to be inspected, creates a light receiving image based on the reflected light from the surface to be inspected, and detects a defect on the surface to be inspected based on the light receiving image. An illumination unit for projecting a predetermined light and dark pattern on a surface to be inspected; an imaging unit 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 imaging unit Smoothing means for smoothing data; emphasizing means for extracting a portion having a change in brightness from image data of a light and dark pattern smoothed by the smoothing means; and binarizing means for binarizing the result of the emphasizing means. And calculating the area of each of the portions of the screen having the change in brightness obtained by the binarization means, thereby obtaining the area of each of the portions of the screen having the change in brightness. In The area determination processing means for detecting the portion as a defect, a surface defect inspection apparatus comprising the.
【請求項13】上記2値化手段で得られた2値信号のう
ち上記輝度変化のある部分に相当する値部分の領域を拡
大する処理を行なう領域処理手段を備えたことを特徴と
する請求項12に記載の表面欠陥検査装置。
13. An apparatus according to claim 12, further comprising an area processing means for performing processing for enlarging an area of a value part corresponding to the part having a change in luminance in the binary signal obtained by said binarization means. Item 13. A surface defect inspection device according to item 12.
【請求項14】上記領域処理手段は、被検査面の粗さに
応じて予め定められた所定値だけ上記輝度変化のある部
分に相当する値部分の領域を拡大するものである、こと
を特徴とする請求項13に記載の表面欠陥検査装置。
14. The method according to claim 1, wherein the area processing means expands an area of a value portion corresponding to a portion having the luminance change by a predetermined value according to the roughness of the surface to be inspected. The surface defect inspection apparatus according to claim 13, wherein:
【請求項15】上記領域処理手段は、上記撮像手段で求
めた画像データから得られる被検査面の粗さに応じた値
だけ上記輝度変化のある部分に相当する値部分の領域を
拡大するものである、ことを特徴とする請求項13に記
載の表面欠陥検査装置。
15. The area processing means for enlarging an area of a value part corresponding to a part having a change in luminance by a value corresponding to roughness of a surface to be inspected obtained from image data obtained by the imaging means. The surface defect inspection apparatus according to claim 13, wherein:
【請求項16】上記領域処理手段は、一旦、上記輝度変
化のある部分に相当する値部分の領域を拡大した後、該
領域を縮小する処理を行なうものである、ことを特徴と
する請求項13乃至請求項15のいずれかに記載の表面
欠陥検査装置。
16. An apparatus according to claim 16, wherein said area processing means performs a process of temporarily enlarging an area of a value portion corresponding to a part where the luminance changes, and then reducing the area. A surface defect inspection apparatus according to any one of claims 13 to 15.
【請求項17】上記面積判定手段は、上記2値化した画
像における画面の周辺境界に接する所定領域を除去した
後に、面積判定処理を行なうものである、ことを特徴と
する請求項12乃至請求項16のいずれかに記載の表面
欠陥検査装置。
17. The apparatus according to claim 12, wherein said area determining means performs an area determining process after removing a predetermined area in contact with a peripheral boundary of a screen in said binarized image. Item 17. A surface defect inspection device according to any one of Items 16.
【請求項18】上記面積判定手段は、上記2値化した画
像における画面の周辺境界に接する1画素分をストライ
プの暗部分と同値にしたのち面積判定を行なうものであ
る、ことを特徴とする請求項12乃至請求項16のいず
れかに記載の表面欠陥検査装置。
18. The method according to claim 18, wherein the area determining means determines the area after making one pixel in contact with the peripheral boundary of the screen in the binarized image the same as the dark portion of the stripe. A surface defect inspection device according to any one of claims 12 to 16.
【請求項19】上記照明手段は、明暗パターンとして平
行なストライプとそれを斜めに横切る線とからなる模様
を映しだすものである、ことを特徴とする請求項12乃
至請求項18のいずれかに記載の表面欠陥検査装置。
19. The lighting device according to claim 12, wherein the illuminating means projects a pattern consisting of parallel stripes and lines crossing the stripes obliquely as a light and dark pattern. The surface defect inspection device according to the above.
【請求項20】上記照明手段は、被検査面にストライプ
状の明暗パターンを映し出すものである、ことを特徴と
する請求項1乃至請求項18のいずれかに記載の表面欠
陥検査装置。
20. The surface defect inspection apparatus according to claim 1, wherein said illuminating means projects a stripe-like light and dark pattern on a surface to be inspected.
【請求項21】上記照明手段は、被検査面に格子状の明
暗パターンを映し出すものである、ことを特徴とする請
求項1乃至請求項18のいずれかに記載の表面欠陥検査
装置。
21. A surface defect inspection apparatus according to claim 1, wherein said illumination means projects a grid-like light and dark pattern on a surface to be inspected.
【請求項22】上記照明手段は、被検査面に映し出され
た明暗パターンの明部と暗部のそれぞれの幅すなわち間
隔が、検査の目的として予想される欠陥の大きさに比べ
て十分大きな値に設定されていることを特徴とする請求
項20または請求項21に記載の表面欠陥検査装置。
22. The illumination means, wherein the width, that is, the interval between the bright and dark portions of the light and dark pattern projected on the surface to be inspected is set to a value sufficiently larger than the size of a defect expected for the purpose of inspection. 22. The surface defect inspection device according to claim 20, wherein the surface defect inspection device is set.
【請求項23】上記照明手段は、明暗パターンの明部と
暗部の間隔、比率および該照明手段から被検査面までの
距離が、被検査面の曲率および予想される欠陥と被検査
面とのなす角度に基づいて設定されているものである、
ことを特徴とする請求項19乃至請求項22のいずれか
に記載の表面欠陥検査装置。
23. The illumination means, wherein the distance between the light and dark portions of the light and dark pattern and the distance from the illumination means to the surface to be inspected are determined by the curvature of the surface to be inspected and the expected defect to the surface to be inspected. It is set based on the angle made,
The surface defect inspection apparatus according to any one of claims 19 to 22, wherein:
【請求項24】上記欠陥検出手段または上記面積判定手
段によって得られた欠陥に関するデータに基づいて、ラ
ベル付け処理および欠陥の面積と重心座標計算処理を行
なう手段を備えたことを特徴とする請求項1乃至請求項
23のいずれかに記載の表面欠陥検査装置。
24. A system according to claim 21, further comprising means for performing a labeling process and a process of calculating the area of the defect and the center of gravity based on the data on the defect obtained by said defect detecting means or said area determining means. The surface defect inspection apparatus according to any one of claims 1 to 23.
【請求項25】複数の上記撮像手段と複数の上記照明手
段を、被検査物体の周囲にアーチ状に配置し、被検査物
体の広い被検査面を同時に検査するように構成したこと
を特徴とする請求項1乃至請求項24のいずれかに記載
の表面欠陥検査装置。
25. A system according to claim 25, wherein a plurality of said image pickup means and a plurality of said illuminating means are arranged in an arch around the object to be inspected, so that a wide inspected surface of the object to be inspected is inspected simultaneously. The surface defect inspection device according to any one of claims 1 to 24.
JP22057894A 1994-09-14 1994-09-14 Surface defect inspection equipment Expired - Lifetime JP3185559B2 (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
JPH0886634A JPH0886634A (en) 1996-04-02
JP3185559B2 true JP3185559B2 (en) 2001-07-11

Family

ID=16753178

Family Applications (1)

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

Country Status (1)

Country Link
JP (1) JP3185559B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022117401A1 (en) * 2020-12-02 2022-06-09 Basf Coatings Gmbh A method and a system for assessing and optionally monitoring or controlling the texture of a surface

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3204443B2 (en) * 1996-06-26 2001-09-04 日産自動車株式会社 Surface defect inspection equipment
JPH10123066A (en) * 1996-10-17 1998-05-15 Asahi Glass Co Ltd Apparatus and method for detection of singularity point
DE10122917A1 (en) * 2001-05-11 2002-11-14 Byk Gardner Gmbh Device and method for determining the properties of reflective bodies
WO2004048887A1 (en) * 2002-11-25 2004-06-10 Nippon Telegraph And Telephone Corporation Real world object recognition method and device, and attached device
JP2004191070A (en) * 2002-12-06 2004-07-08 Daihatsu Motor Co Ltd Coated surface inspection apparatus
JP2006098252A (en) * 2004-09-30 2006-04-13 Brother Ind Ltd Three-dimensional information acquisition method
JP2010234237A (en) * 2009-03-31 2010-10-21 Toray Eng Co Ltd Coating apparatus and coating method
DE102009038965A1 (en) * 2009-08-20 2011-03-03 Carl Zeiss Oim Gmbh Apparatus and method for optically inspecting a surface on an article
JP2013061239A (en) * 2011-09-13 2013-04-04 Toshiba Corp Mask surface roughness measuring method and measuring device
JP2013232109A (en) 2012-04-27 2013-11-14 Ricoh Co Ltd Imaging device, imaging system and imaging method
JP2014219346A (en) * 2013-05-10 2014-11-20 株式会社豊田自動織機 Surface inspection method and surface inspection apparatus
JP2017101979A (en) * 2015-11-30 2017-06-08 リコーエレメックス株式会社 Inspection system
JP2017101977A (en) * 2015-11-30 2017-06-08 リコーエレメックス株式会社 Inspection system and inspection method
EP3633353A4 (en) * 2017-05-29 2020-06-10 Konica Minolta, Inc. Surface defect inspection device and method
JP6917781B2 (en) * 2017-05-31 2021-08-11 株式会社キーエンス Image inspection equipment
IT201700093595A1 (en) * 2017-08-11 2019-02-11 Angelo Vicino PROCEDURE AND APPARATUS FOR DETECTION OF DAMAGES FROM GRANDINE ON THE BODY OF A VEHICLE OR SIMILAR
CN112334761B (en) 2018-06-22 2023-12-15 柯尼卡美能达株式会社 Defect discriminating method, defect discriminating apparatus, and recording medium
KR102528968B1 (en) * 2021-01-29 2023-05-08 케이앤피로지스 주식회사 Pre-Delivery Inspection Apparatus
KR102528963B1 (en) * 2021-01-29 2023-05-08 케이앤피로지스 주식회사 Pre-Delivery Inspection Apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022117401A1 (en) * 2020-12-02 2022-06-09 Basf Coatings Gmbh A method and a system for assessing and optionally monitoring or controlling the texture of a surface

Also Published As

Publication number Publication date
JPH0886634A (en) 1996-04-02

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
JP2007285754A (en) Flaw detection method and flaw detector
JP3127758B2 (en) Method and apparatus for inspecting defects on inspected surface
CN115272256A (en) Sub-pixel level sensing optical fiber path Gaussian extraction method and system
JP3412366B2 (en) Coating smoothness inspection device
JPH0979988A (en) Surface defect inspecting device
JP3493979B2 (en) Method and apparatus for inspecting defects on inspected surface
JP4320990B2 (en) Screen defect detection method and apparatus, and screen defect detection program
JP2001209798A (en) Method and device for inspecting outward appearance
JP3688520B2 (en) Surface inspection apparatus and surface inspection method
JP3871963B2 (en) Surface inspection apparatus and surface inspection method
JP3159063B2 (en) Surface defect inspection equipment
JP3201217B2 (en) Surface defect inspection equipment
JP2006226837A (en) Method and apparatus for inspecting stain
JP2001059717A (en) Surface defect inspection method
JP2005140655A (en) Method of detecting stain flaw, and stain flaw detector
JPH1010053A (en) Inspection device for surface defect
JP2001235319A (en) Shading correcting apparatus and shading correcting method, and surface inspection apparatus
JPH06281595A (en) Apparatus for detecting flaw on surface of object
JP3160838B2 (en) Surface defect inspection equipment
JP2955686B2 (en) Surface defect inspection equipment

Legal Events

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

Free format text: PAYMENT UNTIL: 20090511

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20100511

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20110511

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20130511

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20140511

Year of fee payment: 13

EXPY Cancellation because of completion of term