JP2002319021A - Binarization processing method, appearance inspection method and appearance inspection device - Google Patents

Binarization processing method, appearance inspection method and appearance inspection device

Info

Publication number
JP2002319021A
JP2002319021A JP2001121801A JP2001121801A JP2002319021A JP 2002319021 A JP2002319021 A JP 2002319021A JP 2001121801 A JP2001121801 A JP 2001121801A JP 2001121801 A JP2001121801 A JP 2001121801A JP 2002319021 A JP2002319021 A JP 2002319021A
Authority
JP
Japan
Prior art keywords
image
data
luminance
binarization
binarization threshold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2001121801A
Other languages
Japanese (ja)
Inventor
Tatsugo Komae
竜吾 小前
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.)
Murata Manufacturing Co Ltd
Original Assignee
Murata Manufacturing 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 Murata Manufacturing Co Ltd filed Critical Murata Manufacturing Co Ltd
Priority to JP2001121801A priority Critical patent/JP2002319021A/en
Publication of JP2002319021A publication Critical patent/JP2002319021A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To accurately automatically binarize data having various distributions. SOLUTION: In a grouping process (S1-S5) of this binarization processing method, by applying a K-means method to the luminance data of an image, the luminance data are divided into a prescribed number of groups, and a representative value of each the group is calculated. In a binarization threshold value setting process (S6, S7), a binarization threshold is set in the middle point of a maximum distance section wherein a difference between the adjacent representative values in a luminance level is maximum. Thereby, even the image having an unknown area ratio between a background and a figure conventionally difficult to binarize, or the image having an unclear trough of the luminance distribution can be accurately automatically binarized. Accordingly, in an appearance inspection or the like for a chip type electronic component, the picked-up image can be analyzed to execute decision having little false recognition.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、画像処理等におけ
る二値化処理方法、ならびに、これを用いた外観検査方
法および外観検査装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a binarization processing method in image processing and the like, and a visual inspection method and a visual inspection apparatus using the same.

【0002】[0002]

【従来の技術】従来、検査対象に光を照射して、肉眼や
外観検査装置により検査対象の欠陥を検出することが行
われている。そして、外観検査装置には、検査対象の外
観を撮像した画像データを画像処理することによって、
欠陥を自動検出するものもある。例えば、チップ型の電
子部品の外観検査装置では、セラミック素体の表面に生
じた割れ、欠け、異物付着等の欠陥を、輝度ヒストグラ
ムを用いた画像処理によって自動検出することができ
る。
2. Description of the Related Art Conventionally, it has been practiced to irradiate an inspection object with light and detect defects of the inspection object with the naked eye or a visual inspection apparatus. The appearance inspection apparatus performs image processing on image data obtained by capturing the appearance of the inspection object,
Some automatically detect defects. For example, a chip-type electronic component appearance inspection apparatus can automatically detect defects such as cracks, chips, and adherence of foreign matter on the surface of a ceramic body by image processing using a luminance histogram.

【0003】ここで、外観選別装置(外観検査装置)、
位置決め装置、文字認識装置などでは、画像処理の過程
で二値化処理を行っている。そして、従来の二値化処理
方法として、固定閾値二値化法、判別分析法、パーセン
トタイル法等がある。
[0003] Here, an appearance selection device (appearance inspection device),
In a positioning device, a character recognition device, and the like, a binarization process is performed in the process of image processing. As conventional binarization processing methods, there are a fixed threshold binarization method, a discriminant analysis method, a percent tile method, and the like.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、従来の
二値化処理方法では、像および背景の輝度レベルや面積
比が一定でない画像を正確に二値化することができなか
った。例えば、固定閾値二値化法では、二値化閾値が固
定されているため、像と背景の輝度があらかじめ分かっ
ている対象にしか適用できない。判別分析法は、自動二
値化に利用できるが、像と背景との面積比がある程度近
いものでないと、正確に閾値が設定できない。パーセン
トタイル法は、あらかじめ像と背景との面積比が分かっ
ていないと、正確に二値化できない。
However, the conventional binarization processing method cannot accurately binarize an image in which the luminance level and the area ratio of the image and the background are not constant. For example, in the fixed threshold binarization method, since the binarization threshold is fixed, it can be applied only to an object whose image and background luminances are known in advance. The discriminant analysis method can be used for automatic binarization, but the threshold value cannot be set accurately unless the area ratio between the image and the background is close to some extent. The percent tile method cannot be accurately binarized unless the area ratio between the image and the background is known in advance.

【0005】本発明は、上記の問題点を解決するために
なされたもので、その目的は、多様な分布のデータを正
確に自動二値化することができる二値化処理方法、なら
びに、これを用いた外観検査方法および外観検査装置を
提供することにある。
SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and an object of the present invention is to provide a binarization processing method capable of accurately and automatically binarizing data of various distributions. To provide a visual inspection method and a visual inspection device using the same.

【0006】[0006]

【課題を解決するための手段】本発明の二値化処理方法
は、上記の課題を解決するために、入力されたデータ群
にK−means法を施して、当該データ群のデータを
所定個数のグループに分割するK−means法処理手
段を用いた二値化処理方法であって、データ取得手段に
よって取得した一次元に配列可能な複数のデータよりな
るデータ群を、上記K−means法処理手段に入力し
て、所定個数のグループに分割し、各グループの代表値
を算出するグループ化処理と、上記配列上において隣り
合う上記代表値の差が最大となる最大距離区間内に二値
化閾値を設定する二値化閾値設定処理と、を含むことを
特徴としている。
In order to solve the above-mentioned problems, a binarization processing method of the present invention performs a K-means method on an input data group to reduce a predetermined number of data of the data group. A K-means method using a K-means method processing means for dividing a data group consisting of a plurality of data that can be arranged one-dimensionally and acquired by a data acquisition means. Means for dividing into a predetermined number of groups, calculating a representative value of each group, and binarizing within a maximum distance section in which the difference between the adjacent representative values on the array is maximum. A threshold setting process for setting a threshold.

【0007】上記の構成により、データ群のグループ化
処理において、データ群に対してK−means法を施
すことにより、データを所定個数のグループに振り分け
て各グループの代表値を算出し、二値化閾値設定処理に
おいて、配列(例えばデータ群が画像であれば輝度)上
隣り合う代表値の差が最大となる最大距離区間内にデー
タ群の二値化閾値を設定する。なお、二値化閾値は、ヒ
ストグラム上において最大距離区間の中点であってもよ
い。
With the above configuration, in the data group grouping process, the data group is subjected to the K-means method, the data is divided into a predetermined number of groups, and a representative value of each group is calculated. In the threshold setting process, the binarization threshold of the data group is set in the maximum distance section in which the difference between the representative values adjacent in the array (for example, the luminance is high if the data group is an image) is the largest. Note that the binarization threshold may be the middle point of the maximum distance section on the histogram.

【0008】これにより、像と背景との面積比が未知の
画像や輝度分布の谷がはっきりしない画像などの従来二
値化が難しかった画像であっても、正確に二値化でき
る。よって、上記二値化処理方法によれば、多様な形状
のヒストグラムを正確に自動二値化することが可能とな
る。したがって、像の面積、重心、周囲長などの物理長
を正確に計測できるため、精度の高い位置決め、外観選
別、文字認識等の画像処理が可能となる。
As a result, even if it is an image for which binarization has been difficult in the past, such as an image in which the area ratio between the image and the background is unknown or an image in which the valley of the luminance distribution is not clear, binarization can be accurately performed. Therefore, according to the above-described binarization processing method, it is possible to accurately and automatically binarize histograms having various shapes. Therefore, since the physical length such as the area, the center of gravity, and the perimeter of the image can be accurately measured, image processing such as highly accurate positioning, appearance selection, and character recognition can be performed.

【0009】特に、上記二値化処理方法を、チップ型電
子部品等の外観検査装置に適用すると、従来解析できな
かった撮像画像の解析が可能となり、誤認識の少ない判
別を行うことができる。よって、正確な自動二値化を実
現でき、欠陥検出の精度を飛躍的に向上させることがで
きる。
In particular, when the above-described binarization processing method is applied to a visual inspection apparatus for chip-type electronic components, etc., it becomes possible to analyze a picked-up image which could not be analyzed conventionally, and it is possible to perform determination with less erroneous recognition. Therefore, accurate automatic binarization can be realized, and the accuracy of defect detection can be dramatically improved.

【0010】本発明の外観検査方法は、上記の課題を解
決するために、検査対象の外観を撮像する撮像処理と、
上記撮像処理で撮像された画像の輝度データを二値化し
て、二値化画像を作成する二値化画像作成処理と、上記
二値化画像に基づいて、上記検査対象の欠陥を判断する
欠陥判断処理と、を含み、かつ、上記二値化画像作成処
理が、上記画像の輝度データに対してK−means法
を施して、前記輝度データを所定個数のグループに分割
し、各グループの代表値を算出するグループ化処理と、
輝度レベルが隣り合う上記代表値の差が最大となる最大
距離区間内に二値化閾値を設定する二値化閾値設定処理
と、をさらに含むことを特徴としている。
In order to solve the above-mentioned problems, an appearance inspection method according to the present invention includes an imaging process for imaging the appearance of an inspection object;
A binarized image creation process for binarizing luminance data of an image captured in the imaging process to create a binarized image; and a defect for determining a defect to be inspected based on the binarized image. And wherein the binarized image creating process performs a K-means method on the luminance data of the image, divides the luminance data into a predetermined number of groups, and represents a representative of each group. Grouping processing to calculate the value,
And a binarization threshold setting process of setting a binarization threshold in a maximum distance section in which the difference between the representative values adjacent to each other in the luminance level is maximum.

【0011】また、本発明の外観検査装置は、上記の課
題を解決するために、検査対象の外観を撮像する撮像手
段と、上記撮像手段によって撮像された画像の輝度デー
タを二値化して、二値化画像を作成する二値化画像作成
手段と、上記二値化画像に基づいて、上記検査対象の欠
陥を判断する欠陥判断手段と、を具備し、かつ、上記二
値化画像作成手段が、上記画像の輝度データに対してK
−means法を施して、前記輝度データを所定個数の
グループに分割し、各グループの代表値を算出するグル
ープ化手段と、輝度レベルが隣り合う上記代表値の差が
最大となる最大距離区間内に二値化閾値を設定する二値
化閾値設定手段と、をさらに含むことを特徴としてい
る。
According to another aspect of the present invention, there is provided an appearance inspection apparatus which binarizes luminance data of an image photographed by the imaging unit, the photographing unit photographing the appearance of the inspection object. A binarized image creating unit that creates a binarized image; and a defect determining unit that determines a defect to be inspected based on the binarized image. Is K to the brightness data of the image.
A grouping unit that divides the luminance data into a predetermined number of groups by performing a means method and calculates a representative value of each group; and a maximum distance section in which the difference between the representative values adjacent to each other in the luminance level is maximum. And a binarization threshold setting means for setting a binarization threshold.

【0012】上記の構成によって、検査対象の外観を撮
像した撮像画像の輝度データを二値化した二値化画像に
基づいて検査対象の欠陥を判断する外観検査において、
撮像画像の輝度データに対してK−means法を施す
ことにより、画素を所定個数のグループに振り分けて各
グループの代表値を算出し、輝度レベルが隣り合う代表
値の差が最大となる最大距離区間内に輝度データの二値
化閾値を設定する。なお、二値化閾値は、輝度ヒストグ
ラム上において最大距離区間の中点であってもよい。
With the above arrangement, in the appearance inspection for judging the defect of the inspection object based on the binarized image obtained by binarizing the luminance data of the captured image of the appearance of the inspection object,
By performing the K-means method on the luminance data of the captured image, the pixels are divided into a predetermined number of groups, the representative value of each group is calculated, and the maximum distance at which the difference between the representative values whose luminance levels are adjacent is the maximum. A binarization threshold for luminance data is set in the section. Note that the binarization threshold may be the middle point of the maximum distance section on the luminance histogram.

【0013】これにより、欠陥部と正常部との面積比が
未知の撮像画像や、輝度分布の谷がはっきりしない撮像
画像などの従来二値化が難しかった撮像画像であって
も、正確に二値化できる。よって、上記二値化処理方法
によれば、多様な形状の輝度ヒストグラムを正確に自動
二値化することが可能となる。
[0013] With this, even if it is a captured image for which binarization has been difficult in the past, such as a captured image in which the area ratio between the defective portion and the normal portion is unknown, or a captured image in which the valley of the luminance distribution is not clear, it can be accurately binarized. Can be valued. Therefore, according to the binarization processing method, it is possible to automatically binarize luminance histograms of various shapes accurately.

【0014】それゆえ、上記二値化処理方法を画像処理
に用いる上記外観検査方法および外観検査装置では、欠
陥の状態や撮像環境の変動に対してもロバスト性の強い
外観検査を行うことができる。すなわち、対象ワークの
姿勢の変動や照明の変動などの影響を受けにくく、誤認
識が少ない。さらに、欠陥の面積やフェレ径などの幾何
学情報を得ることもできるため、その情報を基に欠陥を
判定できる。
Therefore, the appearance inspection method and the appearance inspection apparatus using the above-described binarization processing method for image processing can perform an appearance inspection which is robust against a defect state and a change in an imaging environment. . That is, it is hardly affected by a change in the posture of the target work, a change in the illumination, and the like, and there is little erroneous recognition. Further, since geometric information such as the area of the defect and the diameter of the Feret can be obtained, the defect can be determined based on the information.

【0015】したがって、上記外観検査方法および外観
検査装置によれば、欠陥を有する不良品を後工程に流す
ことがない。また、欠陥の大きさを知ることも可能であ
るため、どのくらいのレベルの欠陥が発生しているかと
いう情報を、製造工程へフィードバックして、検査対象
である製品の品質を向上させることができる。さらに、
形状や大きさが欠陥に至っていないものを欠陥として過
剰に選別することを防止できる。
Therefore, according to the above-described appearance inspection method and appearance inspection apparatus, a defective product having a defect does not flow to a subsequent process. In addition, since it is possible to know the size of the defect, information on the level of the defect that has occurred can be fed back to the manufacturing process to improve the quality of the product to be inspected. further,
It is possible to prevent an object having a shape and a size that is not defective from being excessively selected as a defect.

【0016】[0016]

【発明の実施の形態】本発明の一実施の形態について図
1から図10に基づいて説明すれば、以下のとおりであ
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of the present invention will be described below with reference to FIGS.

【0017】本実施の形態では、本発明に係る二値化処
理方法について、チップ型電子部品のセラミック素体
(検査対象)の内部に生じたクラックに対する外観検査
を画像処理によって自動的に行う外観検査装置10(図
2)を例として説明する。なお、本発明に係る二値化処
理方法は、適用範囲が画像処理に限定されず、二値化処
理一般に適用できる。また、上記外観検査装置10は、
セラミック素体の内部クラック以外にも、例えば外部電
極表面の傷等を、上記二値化処理を用いた画像処理によ
って外観検査できる。
In the present embodiment, regarding the binarization processing method according to the present invention, an external appearance in which an appearance inspection for a crack generated inside a ceramic body (inspection object) of a chip-type electronic component is automatically performed by image processing. The inspection apparatus 10 (FIG. 2) will be described as an example. It should be noted that the binarization processing method according to the present invention is not limited in its application range to image processing, but can be generally applied to binarization processing. In addition, the appearance inspection device 10 includes:
In addition to the internal cracks in the ceramic body, for example, the appearance of a scratch on the surface of the external electrode can be inspected by image processing using the binarization process.

【0018】図5(a)は、上記外観検査装置10の検
査対象である対象ワークTを示す説明図である。
FIG. 5A is an explanatory view showing a target work T to be inspected by the appearance inspection apparatus 10.

【0019】上記対象ワークTは、多層構造を有し、通
常5mm角以下の直方体形状である電子部品のチップ型
部品である。図5(a)に示すように、対象ワークT
は、セラミック素体部(セラミックス素体)T1と、そ
の両端部に形成された電極部(外部電極)T2とからな
っている。
The target work T is a chip-type electronic component having a multilayer structure and usually a rectangular parallelepiped shape of 5 mm square or less. As shown in FIG.
Is composed of a ceramic body (ceramic body) T1 and electrodes (external electrodes) T2 formed at both ends thereof.

【0020】上記セラミック素体部T1は、セラミック
を主体とする多層構造体であり、光反射率が低い。一
方、上記電極部T2は、ニッケルやはんだ等の金属およ
び金属メッキの多層構造体であり、表面がほぼ平滑で、
光反射率が高く(鏡面でもよい)ほぼ一定である。
The ceramic body T1 is a multilayer structure mainly composed of ceramics and has a low light reflectance. On the other hand, the electrode portion T2 is a multilayer structure of metal and metal plating such as nickel and solder, and has a substantially smooth surface.
The light reflectance is high (it may be a mirror surface) and is almost constant.

【0021】ここで、対象ワークTには、外観検査によ
って検出可能な欠陥として、以下のような欠陥が生じ
る。上記セラミック素体部T1には、表面の割れ・欠
け、セラミックくず等の異物付着、内部の割れ・層の剥
がれ(内部クラック)などの欠陥が生じる。また、上記
電極部T2には、表面の凹凸である傷、電極が浮いて下
地が露出した電極の剥がれ、電極表面へのセラミックく
ず等の異物付着などの欠陥が生じる。
Here, the following defects occur in the target work T as defects that can be detected by visual inspection. In the ceramic body T1, defects such as cracks and chips on the surface, adhesion of foreign matters such as ceramic chips, internal cracks and peeling of layers (internal cracks) occur. In the electrode portion T2, defects such as scratches that are irregularities on the surface, peeling of the electrode where the electrode floats and the base is exposed, and adhesion of foreign matter such as ceramic chips to the electrode surface occur.

【0022】図2は、上記外観検査装置10の構成の概
略を示す説明図であり、上方より見た状態を示す。図2
に示すように、上記外観検査装置10は、載置台11、
供給部12、撮像部(データ取得手段,撮像手段)1
3、選別排出部14、制御部15を少なくとも備えて構
成されている。
FIG. 2 is an explanatory view showing the outline of the configuration of the appearance inspection apparatus 10, and shows a state viewed from above. FIG.
As shown in FIG.
Supply unit 12, imaging unit (data acquisition unit, imaging unit) 1
3. It comprises at least a sorting / discharging section 14 and a control section 15.

【0023】上記載置台11は、水平に回転する円盤状
の載置面を備えたガラステーブルである。載置台11
は、検査する表面を上にして載置した対象ワークTを、
載置面の回転によって、載置面の周縁部に順に設けられ
た撮像部13および選別排出部14へ搬送する。
The mounting table 11 is a glass table having a disk-shaped mounting surface that rotates horizontally. Mounting table 11
, The target workpiece T placed with the surface to be inspected facing up,
Due to the rotation of the mounting surface, the sheet is conveyed to the imaging unit 13 and the sorting / discharging unit 14 which are sequentially provided on the periphery of the mounting surface.

【0024】上記供給部12は、対象ワークTを載置台
11の載置面上に1個ずつ供給するリニアフィーダーで
ある。
The supply unit 12 is a linear feeder that supplies the target works T one by one onto the mounting surface of the mounting table 11.

【0025】上記撮像部13は、搬送された対象ワーク
Tに検査領域S(図5(a))を設定して撮像し、取得
した画像データを制御部15へ送信する。なお、載置台
11によって対象ワークTが高速で移動するため、1つ
の撮像部13では1つの照明条件での撮像を行う。よっ
て、複数の撮像データに基づいて、良品・不良品の判定
を行う場合には、複数の撮像部13を適宜配設すればよ
い。
The imaging unit 13 sets an inspection area S (FIG. 5A) on the transported target work T, captures an image, and transmits the acquired image data to the control unit 15. In addition, since the target work T moves at high speed by the mounting table 11, one imaging unit 13 performs imaging under one illumination condition. Therefore, when judging non-defective / defective products based on a plurality of imaging data, the plurality of imaging units 13 may be appropriately provided.

【0026】上記選別排出部14は、搬送された対象ワ
ークTを制御部15による良品・不良品の判定結果に従
ってそれぞれ排出する。
The sorting / discharging section 14 discharges the transported target work T in accordance with the result of the control section 15 determining a non-defective / defective product.

【0027】上記制御部15は、外観検査装置10の全
体の制御を行う。例えば、供給タイミングに基づき、撮
像部13での撮像や選別排出部14での排出のタイミン
グを管理する。また、上記外観検査方法に従って、対象
ワークTの良品・不良品の判定を行う。
The control section 15 controls the entire appearance inspection apparatus 10. For example, based on the supply timing, the timing of imaging by the imaging unit 13 and the timing of discharge by the sorting / discharging unit 14 are managed. In addition, according to the above-described appearance inspection method, the non-defective / defective product of the target work T is determined.

【0028】ここで、上記制御部15は、汎用のコンピ
ュータをベースに構成できる。すなわち、上記制御部1
5は、それぞれの機能を実現するプログラムの命令を実
行するCPU(central processing unit )、ブートロ
ジックを格納したROM(read only memory)、上記プ
ログラムを展開するRAM(random access memory)、
上記プログラムおよび各種データベースを格納するハー
ドディスク等の記憶装置(記録媒体)、キーボードやマ
ウス等の入力機器、モニタ、スピーカー、プリンタ等の
出力機器、外部のネットワークに接続するネットワーク
接続機器が、内部バスによって接続されて構成されてい
る。そして、上記制御部15の機能は、記憶装置に格納
さたプログラムを必要に応じてRAMに展開してCPU
で実行することでそれぞれ実現される。
Here, the control unit 15 can be configured based on a general-purpose computer. That is, the control unit 1
Reference numeral 5 denotes a CPU (central processing unit) for executing instructions of a program for realizing each function, a ROM (read only memory) storing boot logic, a RAM (random access memory) for expanding the program,
A storage device (recording medium) such as a hard disk for storing the above programs and various databases, input devices such as a keyboard and a mouse, output devices such as a monitor, a speaker and a printer, and network connection devices connected to an external network are connected by an internal bus. Connected and configured. The function of the control unit 15 is as follows.
, Respectively.

【0029】図3は、上記撮像部13の構成の概略を示
す説明図である。図3に示すように、上記撮像部13
は、載置台11に載置されて搬送中の対象ワークTを撮
像するために、カメラ41およびリング照明器42を備
えている。
FIG. 3 is an explanatory diagram showing the outline of the configuration of the image pickup section 13. As shown in FIG. As shown in FIG.
Is equipped with a camera 41 and a ring illuminator 42 for capturing an image of the target work T placed on the mounting table 11 and being transported.

【0030】上記カメラ41は、搬送中の対象ワークT
に検査領域Sを設定して、当該検査領域Sを撮像する撮
像装置である。
The camera 41 is used to move the target workpiece T being transported.
Is an imaging device that sets an inspection area S in the inspection area S and captures an image of the inspection area S.

【0031】上記リング照明器42は、カメラ41によ
る撮像時に対象ワークTへ照明光を照射する照明装置で
ある。リング照明器42は、光源からの光を光ファイバ
ーによって、リング照明器42の中心下方の所定の撮像
位置に搬送された対象ワークTを周囲から均等に照明で
きるようにリング状に形成されている。特に、リング照
明器42は、あらかじめ設定された照明角度θで対象ワ
ークTの上方から照明光を照射するように配設されてい
る。
The ring illuminator 42 is an illuminating device that illuminates the target work T with illumination light when an image is taken by the camera 41. The ring illuminator 42 is formed in a ring shape so that light from a light source can be uniformly illuminated from the surroundings of the target work T conveyed to a predetermined imaging position below the center of the ring illuminator 42 by an optical fiber. In particular, the ring illuminator 42 is disposed so as to emit illumination light from above the target work T at a preset illumination angle θ.

【0032】ここで、セラミック素体部T1の内部クラ
ックは、撮像時の照明角度や強度等の照明条件によっ
て、見えやすかったり、見えにくかったりする。そこ
で、上記撮像部13の照明条件は、あらかじめサンプル
ワークを用いた実験によって抽出して最適に設定される
(照明条件設定処理)。すなわち、図5(a)に示す欠
陥部Dの面積が大きく、かつ、欠陥部Dと正常部Nとの
輝度差が大きい照明条件に設定されている。
Here, the internal cracks in the ceramic body T1 are easily visible or hard to see depending on the illumination conditions such as the illumination angle and the intensity at the time of imaging. Therefore, the illumination condition of the imaging unit 13 is extracted and optimally set in advance by an experiment using a sample work (illumination condition setting processing). That is, the illumination condition is set such that the area of the defective portion D shown in FIG. 5A is large and the luminance difference between the defective portion D and the normal portion N is large.

【0033】つぎに、図4は、上記外観検査装置10に
おける欠陥検出および良品・不良品の選別処理の概略を
示す機能ブロック図である。なお、撮像部13および選
別排出部14は、図2に示したものと同一である。ま
た、画像記憶部(撮像画像記憶手段)15Aは、制御部
15のメモリ等に設けられる。また、二値化画像作成部
(二値化画像作成手段)15Bおよび欠陥判断部(欠陥
判断手段)15Cは、制御部15が対応するプログラム
を実行することによって実現される。
FIG. 4 is a functional block diagram showing an outline of a defect detection and a non-defective / defective selection process in the visual inspection apparatus 10. As shown in FIG. The imaging unit 13 and the sorting / discharging unit 14 are the same as those shown in FIG. The image storage unit (captured image storage unit) 15A is provided in a memory or the like of the control unit 15. The binarized image creating unit (binary image creating unit) 15B and the defect determining unit (defect determining unit) 15C are realized by the control unit 15 executing a corresponding program.

【0034】撮像部13は、載置台11に載置されて搬
送された対象ワークTのセラミック素体部T1に検査領
域Sを設定し(図5(a))、撮像した画像データを制
御部15へ送信する(撮像処理)。次に、制御部15で
は、第1に、撮像部13が撮像した画像データを画像記
憶部15Aに記憶する。第2に、二値化画像作成部15
Bが、画像記憶部15Aに記憶された画像の輝度データ
(データ群)から二値化閾値を求め、この二値化閾値を
用いて当該画像の二値化画像を作成する(二値化画像作
成処理)。第3に、欠陥判断部15Cが、二値化画像作
成部15Bによって作成された二値化画像に基づいて対
象ワークTに欠陥があるか否かを判断する(欠陥判断処
理)。最後に、制御部15は、欠陥判断部15Cにおけ
る判断結果に従って、対象ワークTを良品と不良品とを
別にして回収するように、選別排出部14を制御する。
The imaging section 13 sets an inspection area S in the ceramic body T1 of the target work T mounted and conveyed on the mounting table 11 (FIG. 5A), and the captured image data is controlled by the control section. 15 (imaging process). Next, the control unit 15 first stores the image data captured by the imaging unit 13 in the image storage unit 15A. Second, the binarized image creation unit 15
B obtains a binarization threshold from the luminance data (data group) of the image stored in the image storage unit 15A, and creates a binarized image of the image using the binarization threshold (binary image Creation process). Third, the defect determination unit 15C determines whether or not the target work T has a defect based on the binarized image created by the binarized image creation unit 15B (defect determination processing). Finally, the control unit 15 controls the sorting / discharging unit 14 so as to collect the target work T separately from non-defective products and defective products according to the judgment result of the defect judgment unit 15C.

【0035】ここで、上記二値化画像作成部15Bは、
グループ化処理部(グループ化手段)21、K−mea
ns法処理部(K−means法処理手段)22、二値
化閾値設定処理部(二値化閾値設定手段)23を含んで
いる。そして、上記二値化画像作成部15Bは、画像
記憶部15Aから読み出した撮像画像の輝度データを、
グループ化処理部21にてK−means法に従って所
定個数のグループに分割して代表値を求め、二値化閾
値設定処理部23にて隣接する代表値の差が最大となる
最大距離区間の中点に二値化閾値を設定し、得られた
二値化閾値を用いて撮像画像から二値化画像を作成す
る。
Here, the binarized image creating unit 15B
Grouping processing unit (grouping means) 21, K-mea
An ns method processing unit (K-means method processing unit) 22 and a binarization threshold setting processing unit (binarization threshold setting unit) 23 are included. Then, the binarized image creating unit 15B converts the luminance data of the captured image read from the image storage unit 15A into
The grouping processing unit 21 divides the data into a predetermined number of groups according to the K-means method to obtain a representative value, and the binarization threshold setting processing unit 23 calculates the representative value in the maximum distance section where the difference between the adjacent representative values is maximum. A binarization threshold is set for a point, and a binarized image is created from the captured image using the obtained binarization threshold.

【0036】なお、グループ化処理部21は、輝度デー
タをグループ化して代表値を求める過程において、K−
means法の処理をK−means法処理部22に依
頼する。また、K−means法処理部22が行う、輝
度について画素を所定個数にグループ化する処理は、輝
度ヒストグラムを所定個数の領域へ分割する領域分割処
理に相当する。また、二値化閾値設定処理部23が最大
距離区間に設定する二値化閾値は、最大距離区間の中点
に限定されず、当該区間内の最小値や最大曲率等の種々
の基準に従って決定できる。
In the process of grouping the luminance data to obtain a representative value, the grouping processing section 21
The K-means method processing unit 22 is requested to perform the means method. Further, the process of grouping pixels into a predetermined number of luminances performed by the K-means method processing unit 22 corresponds to a region division process of dividing a luminance histogram into a predetermined number of regions. Further, the binarization threshold set by the binarization threshold setting processing unit 23 in the maximum distance section is not limited to the midpoint of the maximum distance section, and is determined according to various criteria such as the minimum value and the maximum curvature in the section. it can.

【0037】ここで、図7は、上記二値化処理方法に従
って、ある輝度ヒストグラムの二値化閾値THを求めた
グラフである。図7では、領域数Kを3として、3つの
領域G1,G2,G3に領域分割されている。そして、
隣接する代表値(領域平均輝度)間の距離が、L12
(=|R2−R1|)<L23(=|R3−R2|)で
あるため、その最大値はL23となる。よって、二値化
閾値THは(R2+R3)/2となる。なお、図7で
は、二値化閾値THは輝度ヒストグラムの中点に位置し
ている。
FIG. 7 is a graph showing the binarization threshold value TH of a certain luminance histogram according to the binarization processing method. In FIG. 7, assuming that the number of areas K is 3, the area is divided into three areas G1, G2, and G3. And
The distance between adjacent representative values (region average luminance) is L12
Since (= | R2-R1 |) <L23 (= | R3-R2 |), the maximum value is L23. Therefore, the binarization threshold TH is (R2 + R3) / 2. In FIG. 7, the binarization threshold TH is located at the middle point of the luminance histogram.

【0038】図8(a)(b)は、図7と同じ輝度ヒス
トグラムを、領域数Kを4,5として、それぞれ領域分
割を行って最大距離区間を抽出し、二値化閾値THを求
めたグラフである。図7および図8(a)(b)に示す
ように、K−means法により求まった各領域の代表
値は、背景の山と像の山に集まる。各山に集まる代表値
の数は像と背景との面積比に応じて異なるが、領域数K
が何れの場合でも、隣接する代表値の差が大きい部分
は、輝度ヒストグラムのちょうど谷の部分となる。すな
わち、谷は常に最大距離区間に含まれている。
FIGS. 8 (a) and 8 (b) show the same luminance histogram as that of FIG. 7, with the number of areas K being 4 and 5, performing area division to extract the maximum distance section and obtaining the binarization threshold TH. FIG. As shown in FIGS. 7 and 8A and 8B, the representative values of the respective regions obtained by the K-means method are gathered at the background mountain and the image mountain. The number of representative values gathered in each mountain differs according to the area ratio between the image and the background.
In any case, the part where the difference between the adjacent representative values is large is the valley part of the luminance histogram. That is, the valley is always included in the maximum distance section.

【0039】よって、この谷の部分に二値化閾値を設定
して二値化画像を作成すると、像と背景とをきれいに分
離することができる。それゆえ、像の面積、重心、周囲
長などの物理長を正確に計測することができ、精度の高
い位置決め処理や外観選別処理が可能となる。
Therefore, when a binarized image is created by setting a binarized threshold value at the valley portion, the image and the background can be clearly separated. Therefore, the physical length such as the area, the center of gravity, and the perimeter of the image can be accurately measured, and highly accurate positioning processing and appearance selection processing can be performed.

【0040】例えば、図9は、図10(a)の実験によ
る原画像の輝度ヒストグラムであり、横軸に輝度値、縦
軸に画素数(度数)を示している。この輝度ヒストグラ
ムを、K−means法により領域数Kを4として代表
値1〜代表値4を求める。図9では、代表値1と代表値
2とを両端とする区間が最大距離区間となるため、二値
化閾値THをこの区間の平均値として求めることができ
る。そして、この二値化閾値THによって作成した二値
化画像が図10(b)であり、欠陥部が暗部として抽出
されている。
For example, FIG. 9 is a luminance histogram of the original image obtained by the experiment of FIG. 10A, in which the horizontal axis represents the luminance value and the vertical axis represents the number of pixels (frequency). From the luminance histogram, representative values 1 to 4 are obtained by setting the number of regions K to 4 by the K-means method. In FIG. 9, a section having both ends of the representative value 1 and the representative value 2 is the maximum distance section, and thus the binarization threshold TH can be obtained as an average value of this section. FIG. 10B shows a binarized image created by the binarization threshold TH, and a defective portion is extracted as a dark portion.

【0041】つづいて、図1に示すフローチャートを参
照しながら、撮像部13が撮像した多階調の画像を、二
値化画像作成部15Bが二値化画像に変換する処理につ
いて説明する。なお、ステップS1〜S5が、K−me
ans法処理部22において実行される、データを任意
の領域に領域分割する手法であるK−means法によ
る処理である。
Next, with reference to the flowchart shown in FIG. 1, a process of converting a multi-tone image picked up by the image pickup unit 13 into a binarized image by the binarized image creating unit 15B will be described. Note that steps S1 to S5 are K-me
This is a process executed by the ans method processing unit 22 according to the K-means method, which is a method of dividing data into arbitrary regions.

【0042】まず、ステップS1では、K−means
法処理部22に領域数(すなわち、画素のグループ数)
Kを設定する。なお、領域数Kは通常3から10程度で
あり、外観検査の実験結果では3から5が適しており、
3が最適である。
First, in step S1, K-means
The number of regions (that is, the number of pixel groups)
Set K. The number of regions K is usually about 3 to 10, and 3 to 5 is suitable in the experimental results of the appearance inspection.
3 is optimal.

【0043】ステップS2では、K個の領域にそれぞれ
の代表値Y1(n),Y2(n),…,YK(n)の初
期値を設定する。ここで、nはくり返し数を示す。よっ
て、代表値の初期値はY1(1),Y2(1),…,Y
K(1)と表すことができる。なお、代表値は、繰り返
し演算によって収束するため、初期値は任意に設定して
よい。例えば、輝度の階調をK+1で均等割りした値を
設定してもよい。すなわち、256階調の画像を3つの
輝度グループに分割する場合、代表値を輝度レベル6
4,128,192にそれぞれ設定してもよい。
In step S2, the initial values of the representative values Y1 (n), Y2 (n),..., YK (n) are set in the K areas. Here, n indicates the number of repetitions. Therefore, the initial values of the representative values are Y1 (1), Y2 (1),.
K (1). In addition, since the representative value converges by repeated calculation, the initial value may be arbitrarily set. For example, a value obtained by equally dividing the luminance gradation by K + 1 may be set. That is, when an image of 256 gradations is divided into three luminance groups, the representative value is represented by luminance level 6
4, 128, and 192, respectively.

【0044】ステップS3では、注目画素(i,j)の
輝度をaijとすると、dm=|aij−Ym(n)|(m
=1,2,…,K)を計算し、dmの最小値dmin =m
in{dm}となるmを注目画素(i,j)の領域ラベ
ルとする。この計算をすべての画素について行い、すべ
ての画素にK個の領域ラベルの何れかをそれぞれ割り当
てる。
In step S3, assuming that the luminance of the pixel of interest (i, j) is aij, dm = | aij-Ym (n) | (m
= 1, 2,..., K) and the minimum value of dm dmin = m
Let m, which is in {dm}, be the region label of the pixel of interest (i, j). This calculation is performed for all the pixels, and each of the pixels is assigned one of the K region labels.

【0045】ステップS4では、同一の領域ラベルを有
する画素の輝度の平均値(領域平均輝度)を計算し、得
られた領域平均輝度で各領域の代表値を更新する。これ
により、Y1(2),Y2(2),…,YK(2)が得
られる。
In step S4, the average value of the luminance of the pixels having the same region label (region average luminance) is calculated, and the representative value of each region is updated with the obtained region average luminance. Thereby, Y1 (2), Y2 (2),..., YK (2) are obtained.

【0046】ステップS5では、全画素の領域ラベルが
前回の領域ラベルと同一(図1)であるか否かを判定
し、同一でなければステップS3へ復帰する。すなわ
ち、ステップS3,S4の処理を、全画素の領域ラベル
が収束するまで繰り返す。
In step S5, it is determined whether or not the region labels of all pixels are the same as the previous region label (FIG. 1). If not, the process returns to step S3. That is, the processing of steps S3 and S4 is repeated until the area labels of all the pixels converge.

【0047】以上の処理(K−means法処理)の結
果、q回で処理が終了したとすると、最終の代表値(領
域平均輝度)は、Y1(q),Y2(q),…,YK
(q)と表わせる。
As a result of the above processing (K-means method processing), assuming that the processing is completed q times, the final representative values (area average luminance) are Y1 (q), Y2 (q),.
(Q).

【0048】つづいて、ステップS6では、グループ化
処理部21が、最終の代表値Y1(q),Y2(q),
…,YK(q)を昇順(あるいは降順)に並び替え、隣
接する代表値の差が最大となる代表値(平均輝度)の区
間(最大距離区間)を抽出する。次に、ステップS7で
は、二値化閾値設定処理部23が、最大距離区間の中点
を求めて、得られた輝度を撮像画像の二値化閾値THに
決定する。なお、ステップS6,S7は、二値化閾値設
定処理に相当する。
Subsequently, in step S6, the grouping processing section 21 sets the final representative values Y1 (q), Y2 (q),
.., YK (q) are rearranged in ascending order (or descending order), and a section (maximum distance section) of a representative value (average luminance) in which the difference between adjacent representative values is maximum is extracted. Next, in step S7, the binarization threshold setting processing unit 23 obtains the midpoint of the maximum distance section, and determines the obtained luminance as the binarization threshold TH of the captured image. Steps S6 and S7 correspond to a binarization threshold setting process.

【0049】最後に、ステップS8では、二値化画像作
成部15Bが、上記二値化閾値THを用いて、撮像画像
の二値化画像を作成する。
Finally, in step S8, the binarized image creating section 15B creates a binarized image of the captured image by using the above-mentioned binarization threshold TH.

【0050】ここで、外観検査装置10によって、セラ
ミック素体部T1に生じた内部クラックを、上記二値化
方法を用いた画像処理により検出する場合について、具
体的について説明する。
Here, a specific description will be given of a case in which the appearance inspection device 10 detects an internal crack generated in the ceramic body T1 by image processing using the above-described binarization method.

【0051】図5(b)は、内部クラックの欠陥がある
セラミック素体部T1に設定した検査領域Sの輝度ヒス
トグラムである。図5(b)に示すように、セラミック
素体部T1の内部クラックは、輝度データとしては、高
輝度の欠陥部(高輝度領域)Dとなって現れる。すなわ
ち、セラミック素体部T1の内部クラックは、正常部N
よりも明るく見える。
FIG. 5B is a luminance histogram of the inspection area S set in the ceramic body T1 having a defect of an internal crack. As shown in FIG. 5B, the internal crack of the ceramic body T1 appears as a high-luminance defect portion (high-luminance region) D as luminance data. That is, the internal cracks of the ceramic body T1
It looks brighter.

【0052】ここで、セラミック素体部T1に生じる内
部クラックは、内部の欠陥であり、表面には高々1μm
程度の浮きとしてしか現れない。それゆえ、内部クラッ
クを表面に生じた凹凸として観察することは困難であ
る。しかし、セラミック素体部T1の表面に適当な照明
角度θ(図3)の光を照射すると、光が表面から内部へ
しみ込む。そして、内部に入った光は、内部クラックが
あるとそこで反射して表面からしみ出すのに対して、内
部クラックの無い部分では反射が起こらず表面へは戻ら
ない。よって、セラミック素体部T1の表面に適当な照
明角度θの光を照射することにより、内部クラックを白
い領域として観察することができる。なお、照明角度θ
が高いと、表面で反射するため、内部で反射しているの
かどうかがわからない。また、セラミック素体部T1の
表面の割れや欠けは、照明角度θによらず、光が反射せ
ず黒く見える。
Here, the internal crack generated in the ceramic body T1 is an internal defect, and the surface thereof has a thickness of at most 1 μm.
Appears only as a float. Therefore, it is difficult to observe the internal crack as unevenness generated on the surface. However, when the surface of the ceramic body T1 is irradiated with light having an appropriate illumination angle θ (FIG. 3), the light permeates from the surface to the inside. Light that has entered the interior is reflected there if there is an internal crack, and exudes from the surface, whereas reflection does not occur at a portion without the internal crack and does not return to the surface. Therefore, by irradiating the surface of the ceramic body T1 with light having an appropriate illumination angle θ, the internal cracks can be observed as white areas. Note that the illumination angle θ
If it is high, it is reflected on the surface, so it is not known whether it is reflected inside. Further, the cracks or chips on the surface of the ceramic body T1 appear black without reflecting light regardless of the illumination angle θ.

【0053】ここで、セラミック素体部T1の内部クラ
ックを検出する場合には、照明角度θを40度程度に設
定する。なお、照明角度θは、下限値が30度以上、好
ましくは35度以上、上限値が60度以下、好ましくは
50度以下の範囲で設定することが望ましい。このよう
に、撮像部13では、対象ワークTに応じて、内部クラ
ックの検出に最適な照明条件が設定されているので、内
部クラックが発生している欠陥部Dの領域をはっきりと
撮像できる(図5(a))。
Here, when detecting an internal crack in the ceramic body T1, the illumination angle θ is set to about 40 degrees. It is desirable that the lower limit value of the illumination angle θ is 30 degrees or more, preferably 35 degrees or more, and the upper limit value is 60 degrees or less, preferably 50 degrees or less. As described above, in the imaging unit 13, the optimal illumination condition for detecting the internal crack is set according to the target work T, so that the area of the defective portion D where the internal crack has occurred can be clearly imaged ( FIG. 5 (a)).

【0054】そして、上記外観検査装置10は、セラミ
ック素体部T1の内部クラックが正常部Nの明るさに比
べ、ずっと高い明るさ(輝度)の欠陥部Dとして見える
ことを利用した判定アルゴリズムを用いる。すなわち、
上記外観検査装置10は、撮像部13によってセラミッ
ク素体部T1に検査領域Sを設定して撮像し(撮像処
理)、二値化画像作成部15Bによって撮像画像の輝度
を二値化して二値化閾値以上の高輝度領域(欠陥部D
(図6))の占有率を算出し(二値化画像作成処理)、
欠陥判断部15Cによって占有率が基準占有率以上であ
れば内部クラックのある不良品であると判断する(欠陥
判断処理)。なお、上記基準占有率は、欠陥部Dの面積
の許容限度であり、不良品であるか否かを判定する際の
欠陥部Dの占有率の閾値である。そして、基準占有率
は、サンプルワークに対する実験に基づいてあらかじめ
設定される。
The appearance inspection apparatus 10 employs a determination algorithm utilizing the fact that the internal cracks of the ceramic body T1 appear as defective portions D having much higher brightness (brightness) than the brightness of the normal portion N. Used. That is,
The visual inspection device 10 sets the inspection area S in the ceramic body T1 by the imaging unit 13 and captures an image (imaging processing), and binarizes the brightness of the captured image by the binarized image creation unit 15B to obtain a binary image. High brightness area (defect portion D
(FIG. 6)) is calculated (binary image creation processing),
If the occupancy is equal to or more than the reference occupancy by the defect determination unit 15C, it is determined that the defective product has an internal crack (defect determination processing). Note that the reference occupancy is an allowable limit of the area of the defective portion D, and is a threshold value of the occupancy of the defective portion D when determining whether or not the defective portion is defective. Then, the reference occupancy is set in advance based on an experiment on the sample work.

【0055】よって、上記外観検査装置では、対象ワー
クTに応じて、内部クラックの検出に最適に照明条件を
設定するため、内部クラック等の欠陥をはっきりと撮像
し、欠陥を自動検出することが可能となる。
Therefore, in the above-described visual inspection apparatus, in order to set the illumination condition optimally for detecting an internal crack according to the target work T, it is possible to clearly image a defect such as an internal crack and to automatically detect the defect. It becomes possible.

【0056】以上のように、上記二値化処理方法によれ
ば、多様な形状のヒストグラムを正確に二値化すること
が可能となる。すなわち、従来2値化が難しかった画像
の像と背景の面積比が画像によってばらつくものに対し
ても、きれいに二値化できる。このため、従来解析でき
なかった画像も解析できるようになり、画像処理の技術
を飛躍的に向上させることができる。
As described above, according to the above-mentioned binarization processing method, it is possible to binarize histograms of various shapes accurately. In other words, even if the area ratio between the image and the background of the image, which has conventionally been difficult to binarize, varies with the image, the binarization can be finely performed. For this reason, an image which could not be analyzed conventionally can be analyzed, and the image processing technology can be dramatically improved.

【0057】それゆえ、上記二値化処理方法を画像処理
に用いる上記外観検査装置では、欠陥の状態や撮像環境
の変動に対してもロバスト性の強い外観検査を行うこと
ができる。すなわち、上記外観検査装置は、対象ワーク
Tの姿勢の変動や照明の変動などの影響を受けにくく、
誤認識が少ない。さらに、欠陥の面積やフェレ径などの
幾何学情報を得ることもできるため、その情報を基に欠
陥を判定できる。
Therefore, the appearance inspection apparatus using the above-described binarization processing method for image processing can perform an appearance inspection which is robust against a defect state and a change in an imaging environment. That is, the appearance inspection apparatus is hardly affected by a change in the posture of the target work T, a change in the illumination, and the like.
Less misrecognition. Further, since geometric information such as the area of the defect and the diameter of the Feret can be obtained, the defect can be determined based on the information.

【0058】したがって、上記外観検査装置によれば、
欠陥を有する不良品を後工程に流すことがない。また、
欠陥の大きさを知ることも可能であるため、どのくらい
のレベルの欠陥が発生しているかという情報を、製造工
程へフィードバックして、検査対象である製品の品質を
向上させることができる。さらに、形状や大きさが欠陥
に至っていないものを欠陥として過剰に選別することを
防止できる。
Therefore, according to the appearance inspection apparatus,
A defective product having a defect is not sent to a subsequent process. Also,
Since it is also possible to know the size of the defect, it is possible to improve the quality of the product to be inspected by feeding back information on the level of the defect that has occurred to the manufacturing process. Further, it is possible to prevent a material having a shape and a size that is not defective from being excessively selected as a defect.

【0059】なお、上記外観検査装置10における二値
化処理方法は、画素単位でサンプリングした多階調の濃
度レベルを二値化する際に、任意の領域数に領域分割す
る手法であるK−means法を実施し、各領域の代表
値(平均輝度)を求め、これを昇順(降順も可)に配置
し、隣接する代表値(平均輝度)の差(絶対値)を求
め、差が最大となる代表値(平均輝度)間の中点を二値
化閾値として二値化処理を行う方法であってもよい。
The binarization processing method in the visual inspection apparatus 10 is a method of dividing a region into an arbitrary number of regions when binarizing a multi-tone density level sampled in pixel units. The means method is performed to determine a representative value (average luminance) of each area, arrange them in ascending order (descending order is also possible), determine the difference (absolute value) between adjacent representative values (average luminance), and determine the maximum difference. The binarization process may be performed by using the middle point between the representative values (average luminance) as the binarization threshold.

【0060】これにより、従来二値化が難しかった画像
の像と背景の面積比が画像によってぱらつくものに対し
ても、きれいに2値化できる。このため、従来解析でき
なかった画像も解析できるようになり、画像処理の技術
を飛躍的に向上させることができる。
As a result, even if the area ratio between the image and the background of the image, which has conventionally been difficult to binarize, varies depending on the image, the binarization can be finely performed. For this reason, an image which could not be analyzed conventionally can be analyzed, and the image processing technology can be dramatically improved.

【0061】[0061]

【発明の効果】本発明の二値化処理方法は、以上のよう
に、入力されたデータ群にK−means法を施して、
当該データ群のデータを所定個数のグループに分割する
K−means法処理手段を用いた二値化処理方法であ
って、データ取得手段によって取得した一次元に配列可
能な複数のデータよりなるデータ群を、上記K−mea
ns法処理手段に入力して、所定個数のグループに分割
し、各グループの代表値を算出するグループ化処理と、
上記配列上において隣り合う上記代表値の差が最大とな
る最大距離区間内に二値化閾値を設定する二値化閾値設
定処理と、を含む方法である。
According to the binarization processing method of the present invention, the input data group is subjected to the K-means method as described above,
A binarization processing method using K-means processing means for dividing the data of the data group into a predetermined number of groups, wherein the data group includes a plurality of one-dimensionally arrayable data acquired by the data acquisition means With the above K-mea
a grouping process of inputting to the ns method processing means, dividing the data into a predetermined number of groups, and calculating a representative value of each group;
And a binarization threshold setting process of setting a binarization threshold in a maximum distance section in which a difference between the representative values adjacent to each other on the array is maximum.

【0062】それゆえ、像と背景との面積比が未知の画
像や輝度分布の谷がはっきりしない画像などの従来二値
化が難しかった画像であっても、正確に二値化できる。
よって、上記二値化処理方法によれば、多様な形状のヒ
ストグラムを正確に自動二値化することが可能となると
いう効果を奏する。したがって、像の面積、重心、周囲
長などの物理長を正確に計測できるため、精度の高い位
置決め、外観選別、文字認識等の画像処理が可能となる
という効果を奏する。
Therefore, it is possible to accurately binarize even an image for which binarization has conventionally been difficult, such as an image whose area ratio between an image and a background is unknown or an image in which a valley of a luminance distribution is not clear.
Therefore, according to the above-mentioned binarization processing method, there is an effect that histograms of various shapes can be accurately and automatically binarized. Therefore, since the physical length such as the area, the center of gravity, and the perimeter of the image can be accurately measured, there is an effect that image processing such as highly accurate positioning, appearance selection, and character recognition can be performed.

【0063】特に、上記二値化処理方法を、チップ型電
子部品等の外観検査装置に適用すると、従来解析できな
かった撮像画像の解析が可能となり、誤認識の少ない判
別を行うことができる。よって、正確な自動二値化を実
現でき、欠陥検出の精度を飛躍的に向上させることがで
きる。
In particular, when the above-mentioned binarization processing method is applied to a visual inspection apparatus for chip-type electronic components, it is possible to analyze a captured image which could not be analyzed conventionally, and it is possible to make a determination with less erroneous recognition. Therefore, accurate automatic binarization can be realized, and the accuracy of defect detection can be dramatically improved.

【0064】本発明の外観検査方法は、以上のように、
検査対象の外観を撮像する撮像処理と、上記撮像処理で
撮像された画像の輝度データを二値化して、二値化画像
を作成する二値化画像作成処理と、上記二値化画像に基
づいて、上記検査対象の欠陥を判断する欠陥判断処理
と、を含み、かつ、上記二値化画像作成処理が、上記画
像の輝度データに対してK−means法を施して、前
記輝度データを所定個数のグループに分割し、各グルー
プの代表値を算出するグループ化処理と、輝度レベルが
隣り合う上記代表値の差が最大となる最大距離区間内に
二値化閾値を設定する二値化閾値設定処理と、をさらに
含む方法である。
As described above, the appearance inspection method of the present invention
An imaging process for imaging the appearance of the inspection target, a binarized image creation process for binarizing luminance data of the image captured in the imaging process, and creating a binarized image, based on the binarized image And a defect determination process of determining the defect to be inspected, and wherein the binarized image creation process performs a K-means method on the brightness data of the image to determine the brightness data. A grouping process of dividing the number of groups and calculating a representative value of each group, and a binarization threshold for setting a binarization threshold within a maximum distance section in which a difference between the representative values adjacent to each other in the luminance level is the maximum And a setting process.

【0065】また、本発明の外観検査装置は、以上のよ
うに、検査対象の外観を撮像する撮像手段と、上記撮像
手段によって撮像された画像の輝度データを二値化し
て、二値化画像を作成する二値化画像作成手段と、上記
二値化画像に基づいて、上記検査対象の欠陥を判断する
欠陥判断手段と、を具備し、かつ、上記二値化画像作成
手段が、上記画像の輝度データに対してK−means
法を施して、前記輝度データを所定個数のグループに分
割し、各グループの代表値を算出するグループ化手段
と、輝度レベルが隣り合う上記代表値の差が最大となる
最大距離区間内に二値化閾値を設定する二値化閾値設定
手段と、をさらに含む構成である。
Further, as described above, the appearance inspection apparatus of the present invention provides an image pickup means for picking up the appearance of an object to be inspected, and binarization of the luminance data of the image picked up by the image pickup means. And a defect judging means for judging a defect to be inspected based on the binarized image, and wherein the binarized image creating means comprises: K-means for the luminance data of
And a grouping means for dividing the luminance data into a predetermined number of groups and calculating a representative value of each group. And a binarization threshold setting means for setting a binarization threshold.

【0066】それゆえ、検査対象の欠陥部と正常部との
面積比が未知の撮像画像や、輝度分布の谷がはっきりし
ない撮像画像などの従来二値化が難しかった撮像画像で
あっても、正確に二値化できる。よって、上記二値化処
理方法によれば、多様な形状の輝度ヒストグラムを正確
に自動二値化することが可能となる。
Therefore, even if the image ratio of the defect area to be inspected to the normal area is unknown, or even if it is an image in which binarization has been difficult in the past, such as an image in which the valley of the luminance distribution is not clear, It can be binarized accurately. Therefore, according to the binarization processing method, it is possible to automatically binarize luminance histograms of various shapes accurately.

【0067】よって、欠陥の状態や撮像環境の変動に対
してもロバスト性の強い外観検査を行うことができると
いう効果を奏する。すなわち、対象ワークの姿勢の変動
や照明の変動などの影響を受けにくく、誤認識を削減で
きるという効果を奏する。さらに、欠陥の面積やフェレ
径などの幾何学情報を得ることもできるため、その情報
を基に欠陥を判定できるという効果を奏する。
Accordingly, an effect is obtained that an appearance inspection with high robustness can be performed even for a defect state and a change in an imaging environment. In other words, there is an effect that it is hardly affected by a change in the posture of the target work, a change in the illumination, or the like, and the erroneous recognition can be reduced. Further, since it is possible to obtain geometric information such as the area of the defect and the diameter of the feret, it is possible to determine the defect based on the information.

【0068】したがって、欠陥を有する不良品を後工程
に流すことがないという効果を奏する。また、欠陥の大
きさを知ることも可能であるため、どのくらいのレベル
の欠陥が発生しているかという情報を、製造工程へフィ
ードバックして、検査対象である製品の品質を向上させ
ることができるという効果を奏する。さらに、形状や大
きさが欠陥に至っていないものを欠陥として過剰に選別
することを防止できるという効果を奏する。
Therefore, there is an effect that a defective product having a defect does not flow to a subsequent process. Also, since it is possible to know the size of the defect, it is possible to improve the quality of the product to be inspected by feeding back information on the level of the defect occurring to the manufacturing process. It works. Further, there is an effect that it is possible to prevent an object having a shape and a size that is not defective from being excessively selected as a defect.

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

【図1】本発明の一実施の形態に係る二値化処理方法の
概略を示すフローチャートである。
FIG. 1 is a flowchart schematically showing a binarization processing method according to an embodiment of the present invention.

【図2】図1に示した二値化処理方法を画像処理に適用
した外観検査装置の構成の概略を示す説明図である。
FIG. 2 is an explanatory view schematically showing a configuration of a visual inspection apparatus in which the binarization processing method shown in FIG. 1 is applied to image processing.

【図3】図2に示した外観検査装置に含まれる撮像部の
構成の概略を示す説明図である。
FIG. 3 is an explanatory diagram schematically showing a configuration of an imaging unit included in the appearance inspection apparatus shown in FIG. 2;

【図4】図2に示した外観検査装置における選別処理の
概略を示す機能ブロック図である。
FIG. 4 is a functional block diagram showing an outline of a sorting process in the visual inspection device shown in FIG. 2;

【図5】図5(a)は、図2に示した外観検査装置の検
査対象であるチップ型電子部品を示す説明図である。な
お、上記チップ型電子部品はセラミック素体部に内部ク
ラックがある不良品である。図5(b)は、図5(a)
に示したチップ型電子部品のセラミック素体部の撮像画
像の輝度ヒストグラムである。
FIG. 5A is an explanatory view showing a chip-type electronic component to be inspected by the appearance inspection apparatus shown in FIG. 2; The chip-type electronic component is a defective product having an internal crack in the ceramic body. FIG. 5 (b) is the same as FIG.
3 is a luminance histogram of a captured image of a ceramic body of the chip-type electronic component shown in FIG.

【図6】図5(a)に示したチップ型電子部品のセラミ
ック素体部の撮像画像を、図5(b)に示した輝度の二
値化閾値によって二値化した二値化画像を示す説明図で
ある。
FIG. 6 is a diagram showing a binarized image obtained by binarizing a captured image of the ceramic body of the chip-type electronic component shown in FIG. 5A using the binarization threshold of luminance shown in FIG. 5B; FIG.

【図7】図1に示した二値化処理方法によって、輝度ヒ
ストグラムに領域数を3として二値化閾値を設定した状
態を示す説明図である。
FIG. 7 is an explanatory diagram showing a state in which the number of regions is set to 3 in the luminance histogram and a binarization threshold is set by the binarization processing method shown in FIG. 1;

【図8】図8(a)(b)は、図7の比較例の説明図で
あり、図8(a)は領域数が4の場合、図8(b)は領
域数が5の場合を示す。
8 (a) and 8 (b) are explanatory diagrams of the comparative example of FIG. 7; FIG. 8 (a) shows a case where the number of regions is 4, FIG. 8 (b) shows a case where the number of regions is 5 Is shown.

【図9】図2に示した外観検査装置における二値化処理
の具体例であり、図10(a)に示す撮像画像の輝度ヒ
ストグラムおよび二値化閾値を示す説明図である。
9 is a specific example of the binarization processing in the appearance inspection device shown in FIG. 2, and is an explanatory diagram showing a luminance histogram and a binarization threshold of a captured image shown in FIG.

【図10】図2に示した外観検査装置における二値化処
理の具体例であり、図10(a)は撮像部が撮像した撮
像画像をディスプレイ上に表示した中間調画像を示す図
面代用写真であり、図10(b)は図9の二値化閾値に
より図10(a)の撮像画像を二値化した二値化画像を
示す図である。
10A and 10B are specific examples of the binarization processing in the appearance inspection device shown in FIG. 2; FIG. 10A is a drawing substitute photograph showing a halftone image in which a captured image captured by an imaging unit is displayed on a display; FIG. 10B is a diagram showing a binarized image obtained by binarizing the captured image of FIG. 10A using the binarization threshold of FIG.

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

10 外観検査装置 13 撮像部(データ取得手段,撮像手段) 15B 二値化画像作成部(二値化画像作成手段) 15C 欠陥判断部(欠陥判断手段) 21 グループ化処理部(グループ化手段) 22 K−means法処理部(K−means法処
理手段) 23 二値化閾値設定処理部(二値化閾値設定手段) S1〜S5 グループ化処理 S6,S7 二値化閾値設定処理 T 対象ワーク(検査対象) TH 二値化閾値
Reference Signs List 10 appearance inspection device 13 imaging unit (data acquisition unit, imaging unit) 15B binarized image creation unit (binary image creation unit) 15C defect determination unit (defect determination unit) 21 grouping processing unit (grouping unit) 22 K-means method processing unit (K-means method processing means) 23 binarization threshold setting processing unit (binarization threshold setting means) S1 to S5 grouping processing S6, S7 binarization threshold setting processing T target work (inspection Target) TH binarization threshold

フロントページの続き Fターム(参考) 2G051 AA61 AB02 CA04 DA08 EA08 EA11 EB01 EC02 5B057 AA03 BA02 CA08 CA12 CA16 CB06 CB12 CB16 CC01 DA03 DB02 DB08 DC04 DC23 5C077 LL19 MP01 RR14 Continued on front page F-term (reference) 2G051 AA61 AB02 CA04 DA08 EA08 EA11 EB01 EC02 5B057 AA03 BA02 CA08 CA12 CA16 CB06 CB12 CB16 CC01 DA03 DB02 DB08 DC04 DC23 5C077 LL19 MP01 RR14

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】入力されたデータ群にK−means法を
施して、当該データ群のデータを所定個数のグループに
分割するK−means法処理手段を用いた二値化処理
方法であって、 データ取得手段によって取得した一次元に配列可能な複
数のデータよりなるデータ群を、上記K−means法
処理手段に入力して、所定個数のグループに分割し、各
グループの代表値を算出するグループ化処理と、 上記配列上において隣り合う上記代表値の差が最大とな
る最大距離区間内に二値化閾値を設定する二値化閾値設
定処理と、を含むことを特徴とする二値化処理方法。
1. A binarization processing method using K-means processing means for subjecting an input data group to a K-means method and dividing the data of the data group into a predetermined number of groups, A data group consisting of a plurality of data that can be arranged one-dimensionally and acquired by the data acquisition means is input to the K-means method processing means, divided into a predetermined number of groups, and a group for calculating a representative value of each group And a binarization threshold setting process of setting a binarization threshold within a maximum distance section in which a difference between the representative values adjacent on the array is maximum. Method.
【請求項2】検査対象の外観を撮像する撮像処理と、 上記撮像処理で撮像された画像の輝度データを二値化し
て、二値化画像を作成する二値化画像作成処理と、 上記二値化画像に基づいて、上記検査対象の欠陥を判断
する欠陥判断処理と、を含み、 かつ、上記二値化画像作成処理が、 上記画像の輝度データに対してK−means法を施し
て、前記輝度データを所定個数のグループに分割し、各
グループの代表値を算出するグループ化処理と、 輝度レベルが隣り合う上記代表値の差が最大となる最大
距離区間内に二値化閾値を設定する二値化閾値設定処理
と、をさらに含むことを特徴とする外観検査方法。
2. An image pickup process for picking up an appearance of an inspection object, a binarized image forming process for binarizing luminance data of an image picked up by the image pickup process to generate a binarized image, A defect determination process for determining a defect to be inspected based on the binarized image, and the binarized image creation process performs a K-means method on luminance data of the image, Dividing the luminance data into a predetermined number of groups, and calculating a representative value of each group; and setting a binarization threshold value in a maximum distance section in which a difference between the representative values adjacent to each other in the luminance level is maximum. And a binarization threshold setting process.
【請求項3】検査対象の外観を撮像する撮像手段と、 上記撮像手段によって撮像された画像の輝度データを二
値化して、二値化画像を作成する二値化画像作成手段
と、 上記二値化画像に基づいて、上記検査対象の欠陥を判断
する欠陥判断手段と、を具備し、 かつ、上記二値化画像作成手段が、 上記画像の輝度データに対してK−means法を施し
て、前記輝度データを所定個数のグループに分割し、各
グループの代表値を算出するグループ化手段と、 輝度レベルが隣り合う上記代表値の差が最大となる最大
距離区間内に二値化閾値を設定する二値化閾値設定手段
と、をさらに含むことを特徴とする外観検査装置。
3. An image pickup means for picking up an appearance of an inspection object, a binarized image forming means for binarizing luminance data of an image picked up by the image pickup means to generate a binarized image, Defect determination means for determining the defect to be inspected based on the digitized image, and wherein the binarized image creation means performs a K-means method on the luminance data of the image. Grouping means for dividing the luminance data into a predetermined number of groups and calculating a representative value of each group; and a binarization threshold value within a maximum distance section in which the difference between the representative values adjacent to each other in the luminance level is maximum. And a binarization threshold setting means for setting.
JP2001121801A 2001-04-19 2001-04-19 Binarization processing method, appearance inspection method and appearance inspection device Pending JP2002319021A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001121801A JP2002319021A (en) 2001-04-19 2001-04-19 Binarization processing method, appearance inspection method and appearance inspection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001121801A JP2002319021A (en) 2001-04-19 2001-04-19 Binarization processing method, appearance inspection method and appearance inspection device

Publications (1)

Publication Number Publication Date
JP2002319021A true JP2002319021A (en) 2002-10-31

Family

ID=18971603

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001121801A Pending JP2002319021A (en) 2001-04-19 2001-04-19 Binarization processing method, appearance inspection method and appearance inspection device

Country Status (1)

Country Link
JP (1) JP2002319021A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009140244A (en) * 2007-12-06 2009-06-25 Seiko Epson Corp Image processing program and image processor
JP2011232040A (en) * 2010-04-23 2011-11-17 Murata Mfg Co Ltd Appearance inspection device
JP2012208107A (en) * 2011-03-28 2012-10-25 Youngtek Electronics Corp Multichannel detection system for detecting appearance of plural electronic elements
CN110610473A (en) * 2018-06-13 2019-12-24 富士通株式会社 Image processing apparatus, image processing method, and computer-readable storage medium
CN113554604A (en) * 2021-07-01 2021-10-26 常州大学 Melt-blown fabric defect area detection method based on machine vision
JP2022501673A (en) * 2019-08-26 2022-01-06 上海寒武紀信息科技有限公司Shanghai Cambricon Information Technology Co., Ltd Methods, equipment, and related products for processing data
CN116893175A (en) * 2023-07-04 2023-10-17 千顺智能(珠海)有限公司 Multi-station multi-defect unified connector measurement system based on deep learning

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009140244A (en) * 2007-12-06 2009-06-25 Seiko Epson Corp Image processing program and image processor
JP2011232040A (en) * 2010-04-23 2011-11-17 Murata Mfg Co Ltd Appearance inspection device
JP2012208107A (en) * 2011-03-28 2012-10-25 Youngtek Electronics Corp Multichannel detection system for detecting appearance of plural electronic elements
CN110610473A (en) * 2018-06-13 2019-12-24 富士通株式会社 Image processing apparatus, image processing method, and computer-readable storage medium
CN110610473B (en) * 2018-06-13 2023-05-09 富士通株式会社 Image processing apparatus, image processing method, and computer-readable storage medium
JP2022501673A (en) * 2019-08-26 2022-01-06 上海寒武紀信息科技有限公司Shanghai Cambricon Information Technology Co., Ltd Methods, equipment, and related products for processing data
JP7072680B2 (en) 2019-08-26 2022-05-20 上海寒武紀信息科技有限公司 Methods, equipment, and related products for processing data
CN113554604A (en) * 2021-07-01 2021-10-26 常州大学 Melt-blown fabric defect area detection method based on machine vision
CN113554604B (en) * 2021-07-01 2024-02-02 常州大学 Melt-blown cloth defect area detection method based on machine vision
CN116893175A (en) * 2023-07-04 2023-10-17 千顺智能(珠海)有限公司 Multi-station multi-defect unified connector measurement system based on deep learning

Similar Documents

Publication Publication Date Title
JP3551188B2 (en) Surface condition inspection method and substrate inspection device
Li et al. Computer vision based system for apple surface defect detection
CN110389127A (en) A kind of identification of cermet part and surface defects detection system and method
JP4150390B2 (en) Appearance inspection method and appearance inspection apparatus
JPH06103165B2 (en) How to measure the height of circuit elements on a board
EP1277042B1 (en) Directional lighting and method to distinguish three dimensional information
CN111667455A (en) AI detection method for various defects of brush
JP2003500780A (en) Pixel Classification Based on Accuracy in Object Inspection
CN111239142A (en) Paste appearance defect detection device and method
JPH08320294A (en) Device and method for inspecting defect of pattern to be inspected
CN116441190A (en) Longan detection system, method, equipment and storage medium
JP2002319021A (en) Binarization processing method, appearance inspection method and appearance inspection device
US6382510B1 (en) Automatic inspection system using barcode localization and method thereof
EP2063259A1 (en) Method for inspecting mounting status of electronic component
JP2001289792A (en) Method and device for visual inspection
JP2002318195A (en) External appearance inspection method and external appearance inspection device
JP4184511B2 (en) Method and apparatus for defect inspection of metal sample surface
JP2003149160A (en) Appearance inspection method and appearance inspection system
JP2969011B2 (en) Appearance inspection device for soldering condition
WO2003010622A2 (en) Automatic separation of subject pixels using segmentation based on multiple planes of measurement data
JP2002310936A (en) Method and apparatus for visual inspection
JP3032616B2 (en) Appearance inspection method and device
JPH04147045A (en) Surface inspection device
JPH04194701A (en) Picture image inputting method and apparatus and appearance inspecting instrument
JPH0560537A (en) Through-hole inspection device