JP2007226334A - Color image processing method and color image processing device - Google Patents
Color image processing method and color image processing device Download PDFInfo
- Publication number
- JP2007226334A JP2007226334A JP2006044195A JP2006044195A JP2007226334A JP 2007226334 A JP2007226334 A JP 2007226334A JP 2006044195 A JP2006044195 A JP 2006044195A JP 2006044195 A JP2006044195 A JP 2006044195A JP 2007226334 A JP2007226334 A JP 2007226334A
- Authority
- JP
- Japan
- Prior art keywords
- image
- color
- color data
- color image
- value
- 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
Links
Images
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
- Length Measuring Devices By Optical Means (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
Description
この発明は、所定の対象物を含むカラー画像から前記対象物を抽出するための方法および装置に関する。 The present invention relates to a method and apparatus for extracting an object from a color image including a predetermined object.
出願人は、「カラーハイライト照明」と呼ばれる照明方式を導入した基板検査装置について、多数の出願を行っている(たとえば特許文献1。)。この基板検査装置では、赤、緑、青の各色彩光を異なる仰角方向から基板に向けて照射しつつ前記基板を撮像することにより、鏡面反射性の高い部位がその傾斜角度に応じた色彩で表されるカラー画像を生成する。そして、このカラー画像上のあらかじめ設定した位置に検査領域を設定し、その領域内の画像を2値化して被検査部位を抽出する。さらに、抽出した被検査部位の位置や面積などを計測して、その計測値を所定の判定基準値と照合することにより、前記被検査部位の適否を判別する。 The applicant has filed a number of applications for a substrate inspection apparatus in which an illumination method called “color highlight illumination” is introduced (for example, Patent Document 1). In this substrate inspection apparatus, by imaging the substrate while irradiating each color light of red, green, and blue toward the substrate from different elevation angles, the highly specular portion has a color corresponding to the inclination angle. Generate the color image represented. Then, an inspection region is set at a preset position on the color image, and the image in the region is binarized to extract a region to be inspected. Further, the suitability of the inspection site is determined by measuring the position, area, and the like of the extracted inspection site and comparing the measured value with a predetermined determination reference value.
上記特許文献1に記載の基板検査装置では、被検査部位の色彩を抽出するために、4種類のパラメータを設定し、これらのパラメータ毎に上限値および下限値の2種類のしきい値を設定している。4種類のパラメータの1つは、明度データであって、R,G,Bの各色データの総和BRTにより表される。その他の3つのパラメータは、R,G,Bの各色データの明度データに対する比率ROP,GOP,BOP(たとえばROP=R/BRT)である。
なお、これらのパラメータに対応するしきい値は、特許文献1に示されているように、ユーザーが被検査部位のモデルのカラー画像やガイダンス画面を見ながら設定するのが、一般的である。
In the substrate inspection apparatus described in
In general, the threshold values corresponding to these parameters are set by a user while looking at a color image of a model of a region to be inspected or a guidance screen, as disclosed in
上記の基板検査装置によれば、鏡面反射性が高い被検査部位については、その部位の傾斜角度を表す色データが顕著に表れたカラー画像が生成されるので、被検査部位を背景から精度良く切り分けて抽出することができる。しかし、被検査部位の反射率が低くなると、前記傾斜角度を表す色データの強度が弱まり、これに伴って明るさも低下するため、誤抽出が起こる可能性がある。 According to the above-described substrate inspection apparatus, a color image in which color data representing the inclination angle of the part having a high specular reflectivity is generated is generated for the part to be inspected with high specular reflectivity. It can be cut and extracted. However, when the reflectance of the site to be inspected is lowered, the intensity of the color data representing the tilt angle is weakened, and the brightness is reduced accordingly, so that erroneous extraction may occur.
たとえば、ICのリードの先端部を検査する場合、一般に、先端部が平坦であることからRの値が強くなるので、前出のパラメータのうち、BRTおよびROPのしきい値を高めに設定することにより、リードを抽出することができる。
ところが、パラジウムメッキが施されるなどして、リードの反射率が低くなった場合には、Rの強度が低下するため、BRTやROPのしきい値を低く設定しなければならない。この結果、背景部分でRの強度が比較的高い部分がノイズとして誤抽出される可能性が生じ、リード検査の精度が低下してしまう。
For example, when the tip of an IC lead is inspected, the value of R generally increases because the tip is flat. Therefore, among the parameters described above, the threshold values of BRT and ROP are set higher. As a result, the lead can be extracted.
However, when the reflectivity of the lead is lowered due to palladium plating or the like, the strength of R is lowered, so the threshold values of BRT and ROP must be set low. As a result, a portion having a relatively high R intensity in the background portion may be erroneously extracted as noise, leading to a decrease in lead inspection accuracy.
なお、上記の問題は、被検査部位自体の反射率に限らず、たとえば、照明条件が適切でないために、カメラに入射する反射光の強さを確保できない場合にも起こり得る問題である。 Note that the above problem is not limited to the reflectance of the region to be inspected, and may occur even when the intensity of reflected light incident on the camera cannot be ensured because, for example, the illumination conditions are not appropriate.
つぎに、2値化処理のためのしきい値の設定には知識や経験が必要となるが、被検査部位の反射率や照明条件に応じてしきい値の値を細かく調整する必要があるため、熟練者であっても最適なしきい値を設定するのは容易なことではない。 Next, knowledge and experience are required to set the threshold value for the binarization process, but it is necessary to finely adjust the threshold value according to the reflectance of the part to be inspected and the illumination conditions. For this reason, it is not easy for an expert to set an optimal threshold value.
この点について、下記の特許文献2では、複数の認識対象物のサンプルの画像を用いて、対象物の構成色(この明細書で言う色データと同義と思われる。)のばらつきを自動的に抽出し、そのばらつきの範囲に基づいて最適な範囲の色彩の抽出範囲を求めるようにしている。しかし、この特許文献2では、画像上の出現頻度の高い色彩をベースに構成色を抽出しているので、対象物の反射率が低く、背景との間の構成色の差異が小さい場合には、構成色のばらつきが不正確になり、しきい値を正確に求められない可能性がある。また複数のサンプルの画像を用いた統計処理を行う必要があるので、処理が大がかりになる。
In this regard, in
この発明は上記問題点に着目してなされたもので、画像上の対象物の明るさの度合いに左右されることなく、対象物の抽出精度を確保できるようにすることを第1の目的とする。
またこの発明は、上記の抽出処理に適したしきい値を自動的に設定して2値化を行えるようにすることにより、ユーザーの負担を大幅に削減することを、第2の目的とする。
The present invention has been made paying attention to the above-mentioned problems, and has as its first object to ensure the extraction accuracy of an object regardless of the brightness level of the object on the image. To do.
A second object of the present invention is to greatly reduce the burden on the user by automatically setting a threshold value suitable for the above-described extraction processing so that binarization can be performed. .
この発明にかかるカラー画像の処理方法では、所定の対象物を含むカラー画像から前記対象物を抽出するために、以下の第1、第2のステップを実行する。
第1のステップでは、前記カラー画像を構成する複数の色データのうち、前記対象物の抽出に適した色データに正の値の係数を、その他の色データに負の係数をそれぞれ設定して、前記カラー画像に含まれる画素毎にこれらの係数により重み付けされた色データの総和を求める演算を実行し、各画素と前記演算で得た総和とを対応づけたグレイスケール画像を生成する。
第2のステップでは、前記第1のステップで生成されたグレイスケール画像を所定のしきい値により2値化することにより、前記対象物を抽出する。
In the color image processing method according to the present invention, the following first and second steps are executed in order to extract the object from a color image including a predetermined object.
In the first step, among a plurality of color data constituting the color image, a positive coefficient is set for color data suitable for extraction of the object, and a negative coefficient is set for other color data. For each pixel included in the color image, an operation for obtaining the sum of the color data weighted by these coefficients is executed to generate a gray scale image in which each pixel is associated with the sum obtained by the operation.
In the second step, the object is extracted by binarizing the grayscale image generated in the first step using a predetermined threshold value.
上記において、「カラー画像を構成する複数の色データ」は、たとえばR,G,Bの3種類の画像データであるが、これに限定されるものではない。
「対象物の抽出に適した色データ」は、一般に、カラー画像上の対象物において他の色データより優勢になると考えられる色データであるが、カラー画像上の対象物における比率が最も高い色データを1つ選択しても良いし、2以上の色データを選択しても良い。ただし、全ての色データを選択するのは望ましくない。また、対象物上にある程度の大きさで出現する色データであっても、対象物の近傍で優勢になるものは、「対象物の抽出に適した色データ」から外すのが望ましい。
In the above, “a plurality of color data constituting a color image” is, for example, three types of image data of R, G, and B, but is not limited thereto.
“Color data suitable for object extraction” is color data that is generally considered to be dominant over other color data in an object on a color image, but the color with the highest ratio in the object on the color image. One data may be selected, or two or more color data may be selected. However, it is not desirable to select all color data. Further, even if the color data appears in a certain size on the object, it is desirable to remove the data that predominates in the vicinity of the object from the “color data suitable for extraction of the object”.
第1のステップの演算によれば、対象物の抽出に適した色データ(以下、「抽出色データ」という。)が正の値の係数により強められて、総和における比率が高められる一方、抽出色データ以外の色データは負の値の係数により弱められ、総和における比率が減少する。よって、グレイスケール画像では、抽出色データが他の色データより優勢な画像領域(対象物に該当する。)とその他の画像領域との間の濃度差を大きくすることができる。
なお、上記の「その他の画像領域」には、抽出色データの占める割合が小さく、抽出色データ以外の色データが優勢な画像領域のほかに、抽出色データが優勢であるが、その度合いが対象物におけるものより低い画像領域も含まれる。
According to the calculation in the first step, color data suitable for extraction of an object (hereinafter referred to as “extraction color data”) is strengthened by a positive value coefficient, and the ratio in the sum is increased. Color data other than color data is weakened by a negative coefficient, and the ratio in the sum is reduced. Therefore, in the gray scale image, it is possible to increase the density difference between the image area in which the extracted color data is more dominant than the other color data (corresponding to the object) and the other image areas.
In the above-mentioned “other image areas”, the proportion of the extracted color data is small, and the extracted color data is dominant in addition to the image areas where the color data other than the extracted color data is dominant. Image areas that are lower than those in the object are also included.
よって、反射率が低いという理由や、照明強度が弱いという理由により、抽出色データの値が顕著な大きさを示さない対象物であっても、グレイスケール画像上では、背景に対する濃度差が大きい画像領域として現れるようになる。また負の値の係数によって、抽出色データ以外の色データによる影響を小さくすることができるので、背景に抽出色データ以外の色データが大きくなる部分が含まれていても、グレイスケール画像上でその部分の濃度が大きくなるのを防止することができる。
よって、カラー画像上の対象物の明るさに関わらず、その対象物を背景部分から精度良く切り分けることが可能になる。
Therefore, even for an object whose extracted color data value does not show a significant size due to low reflectance or low illumination intensity, the density difference with respect to the background is large on the grayscale image. Appears as an image area. In addition, since the negative value coefficient can reduce the influence of color data other than the extracted color data, even if the background contains a portion where the color data other than the extracted color data is large, It is possible to prevent the concentration of the portion from increasing.
Therefore, regardless of the brightness of the object on the color image, the object can be accurately separated from the background portion.
上記方法の好ましい一態様では、前記各色データに対応する係数は、前記対象物の背景を構成する画素に対する前記演算の結果が0に近似する値になるように設定される。この設定によれば、グレイスケール画像上では対象物以外の濃度値はほぼ0になるから、対象物と背景とを精度良く切り分けることが可能になる。 In a preferred aspect of the above method, the coefficient corresponding to each color data is set so that the result of the calculation for the pixels constituting the background of the object is a value that approximates zero. According to this setting, on the gray scale image, the density value other than the object is almost 0, so that the object and the background can be accurately separated.
他の好ましい態様では、前記第2のステップにおいて、前記グレイスケール画像の濃度分布状態に基づいて前記2値化のためのしきい値を特定し、この特定されたしきい値により前記グレイスケール画像を2値化する。 In another preferred aspect, in the second step, a threshold for binarization is specified based on a density distribution state of the gray scale image, and the gray scale image is determined based on the specified threshold. Is binarized.
上記の態様では、たとえば、判別分析法などの公知の手法に基づき、前記グレイスケール画像の濃度ヒストグラムを作成し、そのヒストグラムの分布状態に基づいて2値化のためのしきい値を特定する。この場合、前記第1ステップにおいて、対象物と背景との間の濃度差が大きなグレイスケール画像が生成されているので、対象物の抽出に適したしきい値を簡単に特定することができる。 In the above aspect, for example, a density histogram of the gray scale image is created based on a known method such as a discriminant analysis method, and a threshold value for binarization is specified based on the distribution state of the histogram. In this case, in the first step, a grayscale image having a large density difference between the object and the background is generated, so that a threshold suitable for extraction of the object can be easily specified.
なお、この発明にかかるカラー画像の処理方法では、前記対象物を撮像することにより生成されたカラー画像全体を処理対象としても良いし、その全体画像中のあらかじめ定められた領域(対象物の位置情報に基づき設定された領域)内のカラー画像のみを処理対象としてもよい。 In the color image processing method according to the present invention, the entire color image generated by imaging the object may be processed, or a predetermined area (position of the object) in the entire image may be processed. Only the color image in the area) set based on the information may be processed.
つぎに、この発明にかかるカラー画像処理装置は、所定の対象物を撮像して得られたカラー画像を入力する画像入力手段と、前記カラー画像を構成する複数の色データのうち、前記対象物の抽出に適した色データに正の値の係数を、その他の色データに負の値の係数をそれぞれ設定して、画像入力手段により入力されたカラー画像中の所定の領域に含まれる画素毎に前記各係数により重み付けされた色データの総和を求める演算を実行する演算手段と、前記所定の領域内の各画素と前記演算手段の演算で得た総和とを対応づけたグレイスケール画像を生成する画像生成手段と、前記画像生成手段により生成されたグレイスケール画像の濃度分布状態に基づき、前記グレイスケール画像を2値化するためのしきい値を設定するしきい値設定手段と、前記しきい値設定手段により設定されたしきい値により前記グレイスケール画像を2値化する2値化手段とを、具備する。 Next, a color image processing apparatus according to the present invention includes an image input means for inputting a color image obtained by imaging a predetermined object, and the object among a plurality of color data constituting the color image. For each pixel included in a predetermined area in the color image input by the image input means by setting a positive coefficient for the color data suitable for the extraction and a negative coefficient for the other color data. Generating a gray scale image in which the calculation means for calculating the sum of the color data weighted by each coefficient is associated with each pixel in the predetermined area and the sum obtained by the calculation of the calculation means And a threshold value setting means for setting a threshold value for binarizing the gray scale image based on the density distribution state of the gray scale image generated by the image generation means And a binarizing means for binarizing the gray-scale image by the threshold set by the threshold value setting means comprises.
上記構成のカラー画像処理装置によれば、前出のカラー画像の処理方法を実行することにより対象物を精度良く抽出することができる。よって、その後に実行される計測や検査についても、精度を確保することができる。また、カラー画像を入力する都度、そのカラー画像から生成されるグレイスケール画像に適したしきい値が自動設定されるので、あらかじめしきい値を設定する必要がない。 According to the color image processing apparatus having the above-described configuration, it is possible to accurately extract an object by executing the above-described color image processing method. Therefore, it is possible to ensure the accuracy of the measurement and inspection performed thereafter. In addition, every time a color image is input, a threshold suitable for a grayscale image generated from the color image is automatically set, so that it is not necessary to set a threshold in advance.
なお、前記画像生成手段が処理対象とする領域は、入力されたカラー画像中の一部の領域でも良いが、これに限らず、入力されたカラー画像の全体であっても良い。 The area to be processed by the image generation means may be a partial area in the input color image, but is not limited to this, and may be the entire input color image.
この発明によれば、対象物のカラー画像を処理するのに代えて、対象物の抽出に適した色データの強度の影響が強められ、かつその他の色データの強度の影響が弱められたグレイスケール画像を処理するようにしたので、対象物自体の反射率が小さいという理由や、照明が不十分であるという理由などによって、カラー画像上の対象物の明るさが十分でない場合でも、その対象物を精度良く抽出することが可能になる。
また上記のようなグレイスケール画像を用いた抽出処理を行うことにより、抽出に適したしきい値を自動設定した上で2値化を行うことが可能になるので、ユーザーの負担を大幅に削減することができる。
According to the present invention, instead of processing a color image of an object, the effect of the intensity of color data suitable for the extraction of the object is increased, and the influence of the intensity of other color data is reduced. Since the scale image is processed, even if the object on the color image is not sufficiently bright due to the reason that the reflectance of the object itself is small or the illumination is insufficient, the object Objects can be extracted with high accuracy.
Also, by performing extraction processing using the gray scale image as described above, it is possible to perform binarization after automatically setting a threshold suitable for extraction, greatly reducing the burden on the user. can do.
図1は、この発明が適用された基板検査装置の構成例を示す。
この実施例の基板検査装置は、部品実装基板の製造ライン中の部品実装工程を経た基板を処理対象として、部品の実装位置毎に検査を行うもので、コントローラ1、カメラ2、基板ステージ3、照明装置4、入力部5、モニタ6などにより構成される。
FIG. 1 shows a configuration example of a substrate inspection apparatus to which the present invention is applied.
The board inspection apparatus according to this embodiment performs an inspection at each component mounting position on a substrate that has undergone a component mounting process in a component mounting board manufacturing line, and includes a
前記カメラ2は、カラー静止画像を生成するもので、前記基板ステージ3の上方に撮像面を下方に向けた状態で固定配備される。基板ステージ3には、検査対象の基板を水平に支持するテーブル3a(図2に示す。)や、このテーブル3aをX方向(基板の長さ方向)およびY方向(基板の幅方向)に移動させるための移動機構(図示せず。)が含まれる。照明装置4は、検査対象の基板を照明するためのものである。
The
前記コントローラ1には、コンピュータによる制御部11のほか、画像入力部12、XYステージ制御部13、照明制御部14、メモリ15、検査結果出力部16などが設けられる。
画像入力部12には、前記カメラ2に対するインターフェース回路やA/D変換回路が含まれる。XYステージ制御部13は、前記基板ステージ3の移動を制御し、照明制御部14は、前記照明装置4の点灯・消灯動作を調整する。
The
The
メモリ15には、検査にかかる一連の処理手順が記述されたプログラムや検査データファイルなどが格納される。
検査データファイルには、基板に設定する検査領域の設定条件(領域の位置や大きさ)や被検査部位の良否を判定するための判定基準値などが格納される。さらに、この実施例では、前記基板を複数の撮像対象領域に分けて撮像を行うようにしているため、検査データファイルには、各撮像対象領域の設定位置を示すデータが登録される。また後記するグレイスケール画像の生成のための係数の比率も、検査データファイル内に格納される。
The
The inspection data file stores conditions for setting the inspection region (region position and size) to be set on the substrate, determination reference values for determining the quality of the region to be inspected, and the like. Further, in this embodiment, since the substrate is divided into a plurality of imaging target areas for imaging, data indicating the set position of each imaging target area is registered in the inspection data file. A ratio of coefficients for generating a gray scale image to be described later is also stored in the inspection data file.
前記制御部11は、XYステージ制御部13を介して基板ステージ3の移動を制御することにより、前記カメラ2を各撮像対象領域に順に位置合わせし、撮像する。ここで生成されたカラー画像は画像入力部12を介して制御部11に入力され、その内部のメモリ(RAM)に格納される。制御部11は、このRAMに格納されたカラー画像の各被検査部位に対し、それぞれ前記検査データファイル内の設定条件に基づき検査領域を設定し、その領域において、被検査部位の抽出、計測、判別の各処理を、順次実行する。
The
基板上のすべての部品に対する判定処理が終了すると、制御部11は、これらの判定結果をとりまとめて、基板の良、不良を判定する。この最終の判定結果や不良と判定された場合の不良部位に関する情報は、検査結果出力部16に与えられた後、この検査結果出力部16から図示しない外部装置に出力される。
When the determination processing for all components on the board is completed, the
上記の基板検査装置では、ICやQFPなどのリード部品を検査する際には、リード毎に検査領域を設定し、リードの先端部に曲がりや浮きがないかどうかなどを検査するようにしている。 In the above-described board inspection apparatus, when inspecting lead parts such as IC and QFP, an inspection area is set for each lead to inspect whether the leading end of the lead is bent or lifted. .
図2は、カメラ2および照明装置4により基板7上のリード部品8を撮像している状態を、カメラ2や照明装置4の光源の配置関係とともに示す。なお、図中の80は、リードであり、部品本体に装着される根元部82と、基板7のランドにはんだ付けされる先端部81と、これらを繋ぐ中間部83とを有する。また9は、前記先端部81とランドとを接続するはんだである。
前記照明装置4には、それぞれ赤色、緑色、青色の色彩光を発する3個の円環状光源4R,4G,4B(以下、「赤色光源4R」、「緑色光源4G」、「青色光源4B」という。)が、各中心部を位置合わせした状態で配備されている。また前記カメラ2は、照明装置4の上方位置に、光軸が各光源4R,4G,4Bの中心に合うようにして配備される。
FIG. 2 shows a state in which the
The
赤色光源4Rは3個の光源の中で最も径が小さく、カメラ2に最も近い位置に配置される。青色光源4Bは3個の光源の中で最も径が大きく、基板7に最も近い位置に配置される。緑色光源4Gは光源4Rと光源4Bとの間に配置され、その径も光源4Rの径と光源4Bの径との間になるように設定される。
The
この構成により、赤、緑、青の各色彩光がそれぞれ異なる仰角方向から基板7に照射されるようになる。基板上の鏡面反射性の高い部位(はんだ付け部9、リード80など)では、これらの色彩光が正反射するが、カメラ2に入射する反射光の種類は光が照射された位置の傾斜角度によって異なるものになる。
たとえばリード80の場合、先端部81や根元部82では、上面がほぼ平坦であるため、主として、赤色光に対する反射光がカメラ2に入射する。また、中間部83や先端部81の端縁81aでは、傾斜が急になるため、主として、青色光に対する反射光が入射する。また平坦な面と急斜面との境界にあたる部分では、緑色光に対する反射光が入射する比率が高められる。
With this configuration, red, green, and blue color lights are irradiated onto the
For example, in the case of the
図3は、前記照明装置4による照明下で生成されたリード部品8の一部を撮像して得られたカラー画像100を模式化したものである。便宜上、このカラー画像100中の各部に図2と同じ符号を付す。また前記リード80の各部81,82,83を、それぞれ画像上で優勢になる色データに対応するパターン(図2の光源4R,4G,4Bに付したものに対応する。)により表している。ただし、緑色が顕著に表れる領域はきわめて小さいため、ここでは図示を省略している。
なお、91は、図2に図示されていなかったランドの画像である。またはんだ付け部9には、Rが優勢な領域のほか、傾斜状態によってGやBが優勢な領域も出現するが、この実施例の抽出対象ではないため、R,G,Bに対応しない一律のパターンにより表している。
FIG. 3 schematically shows a
この実施例では、リード80の先端部81(以下、「リード先端部81」という。)の状態を検査するために、各リード先端部81毎に検査領域Rを設定し、それぞれの検査領域R内のカラー画像をグレイスケール画像に変換して2値化する。また2値化処理では、判別分析法を用いてしきい値を自動抽出するようにしている。
In this embodiment, in order to inspect the state of the
ここで、前記グレイスケール画像の生成方法について、詳細に説明する。
この実施例では、前記検査領域Rに含まれる各画素につき、それぞれ、その画素の色彩を表す色データR,G,B(以下、それぞれの色データを「赤色データR」、「緑色データG」、「青色データB」という。)を下記の(1)式にあてはめた演算を実行し、算出されたIの値を濃度値とするグレイスケール画像を生成する。
I=CR×R+CG×G+CB×B ・・・(1)
Here, a method of generating the gray scale image will be described in detail.
In this embodiment, for each pixel included in the inspection region R, color data R, G, B representing the color of the pixel (hereinafter, each color data is referred to as “red data R”, “green data G”). , “Blue data B”) is applied to the following equation (1) to generate a grayscale image having the calculated I value as the density value.
I = C R × R + C G × G + C B × B ··· (1)
上記(1)式の係数CR,CG,CBのうち、リード先端部81の望ましい傾斜状態を表す色データの係数には正の値が設定され、それ以外の色データの係数に負の値が設定される。
前記図3に示したようにリード先端部81では赤色データRが優勢になるが、中間部83や端縁81aとの境界に近い位置では緑色データGの割合も大きくなる。この点を考慮して、この実施例では、赤色データRに対する係数値CRと、緑色データGに対応する係数値CGとに、正の値を設定するようにしている。
Among the coefficients C R , C G , and C B in the above equation (1), positive values are set for the coefficients of the color data representing the desired inclination state of the
As shown in FIG. 3, the red data R is dominant at the
またこの実施例では、正の係数CR,CGの比率を、望ましい傾斜状態のリード先端部81の画像に表れるR,Gの比率に合わせている。この比率は、あらかじめ反射率が十分に高いリード先端部81のカラー画像から抽出され、前記検査データファイルに格納される。
Further, in this embodiment, the ratio of the positive coefficients C R and C G is matched with the ratio of R and G appearing in the image of the
さらにこの実施例では、基板7の地の面(ランド91などが形成されていない基板7の表面)のカラー画像(以下「背景画像」という。)に前記(1)式を適用したときに、Iの値が0になるように、各係数CR,CG,CBの値を決定する。
Further, in this embodiment, when the expression (1) is applied to a color image (hereinafter referred to as “background image”) of the ground surface of the substrate 7 (the surface of the
以下、検査データファイルに登録された係数CR,CGの比率が3:1であり、背景画像の画像データが、R=45,G=60,B=45(いずれも、8ビット構成のデータとする。)であるという前提の下で説明する。 Hereinafter, the ratio of the coefficients C R and C G registered in the inspection data file is 3: 1, and the image data of the background image is R = 45, G = 60, and B = 45 (all of which have an 8-bit configuration). It will be explained under the assumption that it is data.
まずCG=a(a>0)とおいて、前記背景画像の画像データによる(1)式の演算結果を0にすること前提に、
3a×45+a×60+CB×45=0 ・・・(2) とする。
First, assuming that C G = a (a> 0), the calculation result of the expression (1) based on the image data of the background image is set to 0.
3a × 45 + a × 60 + C B × 45 = 0 (2)
上記(2)式を整理すると、CB=−4.33a となる。
ここでCBが整数に近い値になるようにa=3とすると、CR=9,CG=3となる。またCBの小数点以下を繰り上げると、CB=−13となる。
If the above formula (2) is arranged, C B = −4.33a.
Here, if a = 3 so that C B becomes a value close to an integer, C R = 9 and C G = 3. Further, when the decimal point of C B is raised, C B = −13.
上記の係数CR,CG,CBによれば、リード先端部81の表面の傾斜状態を表す赤色データRおよび緑色データGが強められる一方で、傾斜状態を表さない青色データBは負の係数CBによって弱められる。よって、カラー画像上のリード先端部81では、(1)式の右辺中の正の値(CR×R+CG×G)が大きくなる一方、負の値(CB×B)の絶対値は小さくなるから、濃度Iは高い値になると考えられる。
According to the coefficients C R , C G , and C B described above, the red data R and the green data G that indicate the inclination state of the surface of the
またパラジウムめっきが施されたリード80など、反射率の低いリード80では、カラー画像におけるリード先端部81の赤色データRや緑色データGの値は低くなるが、上記(1)式によれば、RやGの値が係数CR,CGで強調されるので、濃度Iにある程度の値を確保することができる。
In addition, in the
一方、基板の地の面の部分については、色彩に大きなばらつきがない限り、濃度Iは0に近い値を示すと考えられる。また前記中間部83などの青色が優勢な急斜面では、RやGの値が元々小さいので、正の係数CR,CGによる重み付け後の値もさほど大きくならない。一方、Bについては、負の係数CBによる重み付けによって、マイナス方向に大きくなるので、(1)式の演算結果は、0に近い値、もしくは負の値になると考えられる。なお、Iが負の値になった場合には、I=0とみなされる。したがって、前記図3に示した検査領域Rによれば、リード先端部81以外の部分のカラー画像は、RやGの値が高いノイズが発生していない限り、0または0に近い値に変換されると考えられる。
On the other hand, regarding the ground surface portion of the substrate, the density I is considered to show a value close to 0 unless there is a large variation in color. In the blue predominant steep such as the
このように、前記(1)式によるグレイスケール画像によれば、抽出対象のリード先端部81の反射率が低い場合でも、リード先端部81の画像とそれ以外の部分との間に有為な濃度差を設定することが可能になる。よって、このグレイスケール画像から双峰性の高い濃度ヒストグラムを作成することができるから、判別分析法を用いて2値化処理のためのしきい値を自動抽出し、精度の高い2値化処理を行うことが可能になる。
As described above, according to the gray scale image according to the equation (1), even when the reflectance of the
図4は、反射率が高いリード80と、反射率が低いリード80とについて、カラー画像における各色データR,G,Bの濃度分布と、グレイスケール画像上の濃度分布とを、グラフにしたものである。いずれのグラフも、リード先端部81の長さ方向に沿う濃度分布を示すもので、縦軸は濃度(最大255階調)を、横軸は画素の位置を、それぞれ示す。
なお、グレイスケール画像の生成のための係数CR,CG,CBについては、前出の具体例に基づき、CR=9,CG=3,CB=−13とし、演算の結果を正規化している。
FIG. 4 is a graph showing the density distribution of each color data R, G, and B in the color image and the density distribution on the gray scale image for the
Note that the coefficients C R , C G , and C B for generating the gray scale image are C R = 9, C G = 3, and C B = −13 based on the above-described specific example, and the result of the calculation Is normalized.
グラフ1では、中央の広い領域で赤色データRが他の色データG,Bより格段に優勢になり、その近傍位置にGおよびBのピークが現れている。また、Rの優勢な領域内の両端位置では、GがBより大きな変化を示している。これらの現象は、リード先端部81の傾斜状態を的確に反映しているといえる。
これらR,G,Bの値を反映して、Iの値はRやGの値が高い範囲で高くなり、その外側では、矢印f1で示す部分を除き、ほぼ0になっている。
In the
Reflecting these values of R, G, and B, the value of I increases in the range where the values of R and G are high, and outside thereof, it is substantially zero except for the portion indicated by the arrow f1.
グラフ2でも、中央部でRが優勢になり、その近傍にGやBのピークが出現しているが、グラフ1と比べると、いずれの色データのピークも低く、ばらつき度合いも小さくなっている。
しかし、Iの濃度分布には2つの大きなピークが現れている。またこれらのピークに挟まれた領域では、最低でも60程度の値が確保されているのに対し、それ以外の部分では、矢印f2で示す部分を除き、ほぼ0になっている。
Even in the
However, two large peaks appear in the concentration distribution of I. In the region sandwiched between these peaks, a value of at least about 60 is secured, while in other portions, it is almost 0 except for the portion indicated by the arrow f2.
なお、グラフ1,2の矢印f1,f2で示した部分は、Rの値が若干高くなったために生じたノイズであると考えられる。しかし、Iの値があまり高くならないグラフ2においても、ノイズ部分とリード先端部81に対応する範囲との間には、かなりの差が認められるから、判別分析法のための濃度ヒストグラムにおいて、ノイズにおけるIの値とリード先端部8のにおけるIの値とが同じピークに含まれることはないと思われる。
The portions indicated by arrows f1 and f2 in the
つぎに、前記赤色データRに対する係数CRの値を変更した場合の影響について、検討する。
図5のグラフ3,4は、図4と同じカラー画像を処理する場合に、赤色データRに対する係数CRを9から8に変更して(その他の係数CG,CBは同じ。)、グレイスケール画像の濃度Iを算出した例を示す。この例でも、反射率の高いリードについては、リード先端部81に対応するRやBの大きな範囲でIの値が高められている(グラフ3参照。)。
Next, the effect of changing the value of the coefficient C R for the red data R, consider.
しかし、反射率の低いリードに対応するグラフ4では、リード先端部81に対応するはずの中央部にIの値が0まで落ち込む箇所が発生している。これは、R,B間の差が小さいため、正の係数CRを小さくしたことによって、負の係数CBによる減算量の影響が大きくなったためと考えられる。
However, in the
図6のグラフ5,6は、図4と同じカラー画像を処理する場合に、赤色データRに対する係数CRを9から10に変更して(その他の係数CG,CBは同じ。)、グレイスケール画像の濃度Iを算出した例を示す。この例では、グラフ5,6とも、リード先端部81に対応する部分のIの値が高くなっているが、矢印f1,f2で示すノイズの値もグラフ1,2のものより大きくなっている。
上記図5,6によれば、係数CRを調整する場合、値を下げる調整は好ましくないと考えられる。また値を上げる場合にも、背景部分のノイズが強調される点を考慮する必要がある。 According to FIG. 5 and 6, when adjusting the coefficients C R, adjusted to lower values is considered undesirable. Also, when raising the value, it is necessary to take into consideration that noise in the background portion is emphasized.
なお、上記では、正の係数CR,CGの比率を決定するために、反射率の高いリード先端部81のカラー画像からR、Gの各色データを抽出するようにしたが、方法はこれに限定されるものではない。たとえば、前記反射率の高いリード先端部81の画像からRが最も強い領域の面積とGが最も強い領域の面積とを計測し、その面積比に基づき係数CR,CGの比率を決定してもよい。またRの優勢な領域とGの優勢な領域との比率をユーザーが経験的に知っている場合には、その知識に基づいて係数CR,CGの比率を決定してもよい。
または、リード先端部81の長さ、幅、傾斜角度などを計測し、それらの計測値と前記光源4R,4Gからの照明光の角度範囲とに基づき、リード先端部81からカメラ2に入射するR,Gの反射光の比率を算出し、その比率に応じて係数CR,CBの比率を定めてもよい。
In the above description, in order to determine the ratio of the positive coefficients C R and C G , the R and G color data are extracted from the color image of the
Alternatively, the length, width, inclination angle, and the like of the
図7は、上記基板検査装置が実行する処理の流れを示す。なお、ここでは、説明を簡単にするために、前記したリード先端部81の検査に限定した流れを示す。
まず最初のST1(STは「ステップ」の略である。以下も同じ。)で、検査対象の基板7を基板ステージ3に搬入する。ST2では、基板7の地の面を撮像可能な領域にカメラ2の視野を合わせ、撮像を行う。これにより、前記した背景画像が生成される。
FIG. 7 shows a flow of processing executed by the substrate inspection apparatus. Here, in order to simplify the description, the flow limited to the inspection of the
First, in the first ST 1 (ST is an abbreviation of “step”. The same applies to the following), the
ST3では、前記背景画像からR,G,Bの値を抽出する。なお、この抽出処理は1つの画素に対して行ってもよいが、R,G,Bとも、複数の画素の値を抽出して、それらの平均値を求めるようにしてもよい。
つぎのST4では、前記検査データファイルから係数CR,CGの比率を読み出し、この比率と前記ST3で抽出した背景画像のR,G,Bの値とを用いて係数CR,CG,CBの値を決定する。この決定方法は、先に前記(2)式を用いた具体例により説明したとおりである。
In ST3, R, G, and B values are extracted from the background image. This extraction process may be performed on one pixel, but the values of a plurality of pixels may be extracted for R, G, and B, and the average value thereof may be obtained.
In the next ST4, the coefficient C R from the inspection data file, reads the ratio of C G, R of the background image extracted by the this ratio ST3, G, coefficients using the values of B C R, C G, Determine the value of C B. This determination method is as described above with reference to the specific example using the expression (2).
この後、ST5では、前記基板ステージ3の位置を調整して、カメラ2の視野を検査対象のリード80に合わせ、撮像を行う。これにより前記図2に示したようなカラー画像が生成される。
Thereafter, in ST5, the position of the
ST6では、前記ST5で生成されたカラー画像上に検査領域を設定する。
ST7では、検査領域内の画素毎に、設定した各係数を用いて(1)式を実行し、濃度Iを求める。さらに算出された濃度Iを処理対象の画素の座標に対応づけることにより、検査領域のグレイスケール画像を生成する。
In ST6, an inspection area is set on the color image generated in ST5.
In ST7, Expression (1) is executed for each pixel in the inspection region using each set coefficient to obtain the density I. Further, a gray scale image of the inspection area is generated by associating the calculated density I with the coordinates of the pixel to be processed.
ST8では、前記グレイスケール画像から濃度ヒストグラムを作成し、そのヒストグラムに現れる2つのピークの間の所定位置に対応する濃度Iをしきい値として設定する。
つぎのST9では、ST8で設定されたしきい値により前記グレイスケール画像を2値化する。これにより、リード先端部81が抽出される。
In ST8, a density histogram is created from the gray scale image, and a density I corresponding to a predetermined position between two peaks appearing in the histogram is set as a threshold value.
In the next ST9, the gray scale image is binarized by the threshold set in ST8. Thereby, the
ST10では、抽出したリード先端部81に対し、先端縁の位置や長さなどを計測する処理を行う。さらにその計測結果を所定の判定基準値と照合することにより、リード先端部81の良否を判別する。なお、この判別結果は前記RAMに一次保存される。
In ST10, the extracted
以下、画像に含まれるすべての検査領域Rに対し、ST7〜10の各ステップを実行する。またここには図示していないが、1つの部品を複数回に分けて撮像したり、検査対象部品が複数個ある場合には、各撮像対象領域にカメラ2を順に合わせて、撮像対象領域毎にST5〜11の処理を実行する。
このようにして、基板7上のすべての検査領域Rに対する処理が終了すると、ST11が「YES」となり、ST12で検査結果を出力した後に、検査を終了する。
Hereinafter, each step of ST7-10 is performed with respect to all the test | inspection area | regions R contained in an image. Although not shown here, when one part is imaged in multiple times, or when there are a plurality of parts to be inspected, the
In this way, when the processing for all the inspection regions R on the
なお、図7の例では、検査対象の基板7毎に背景画像の生成処理(ST2)および係数の決定処理(ST3)を実行しているが、これに限らず、これらのステップを実行するのは最初の検査対象の基板7だけとし、この基板7について求めた係数値を以後の基板7にも適用するようにしてもよい。
In the example of FIG. 7, the background image generation process (ST2) and the coefficient determination process (ST3) are executed for each
1 コントローラ
2 カメラ
4 照明装置
11 制御部
15 メモリ
81 リード先端部
100 カラー画像
R,G,B 色データ
CR,CG,CB 係数
I グレイスケール画像の濃度値
1
Claims (4)
前記カラー画像を構成する複数の色データのうち、前記対象物の抽出に適した色データに正の値の係数を、その他の色データに負の値の係数をそれぞれ設定して、前記カラー画像に含まれる画素毎にこれらの係数により重み付けされた色データの総和を求める演算を実行し、各画素と前記演算で得た総和とを対応づけたグレイスケール画像を生成する第1のステップと、
前記第1のステップで生成されたグレイスケール画像を所定のしきい値により2値化することにより、前記対象物を抽出する第2のステップとを、
実行することを特徴とするカラー画像の処理方法。 A method of extracting the object from a color image including a predetermined object,
Of the plurality of color data constituting the color image, a positive value coefficient is set for color data suitable for extraction of the object, and a negative value coefficient is set for the other color data. A first step of generating a grayscale image in which each pixel is associated with the total obtained by the calculation, by performing an operation for obtaining a sum of color data weighted by these coefficients for each pixel included in
A second step of extracting the object by binarizing the grayscale image generated in the first step with a predetermined threshold;
A color image processing method comprising: executing the color image processing method.
前記カラー画像を構成する複数の色データのうち、前記対象物の抽出に適した色データに正の値の係数を、その他の色データに負の値の係数をそれぞれ設定して、前記画像入力手段により入力されたカラー画像中の所定の領域に含まれる画素毎に前記各係数により重み付けされた色データの総和を求める演算を実行する演算手段と、
前記所定の領域内の各画素と前記演算手段の演算で得た総和とを対応づけたグレイスケール画像を生成する画像生成手段と、
前記画像生成手段により生成されたグレイスケール画像の濃度分布状態に基づき、前記グレイスケール画像を2値化するためのしきい値を設定するしきい値設定手段と、
前記しきい値設定手段により設定されたしきい値により前記グレイスケール画像を2値化する2値化手段とを、具備するカラー画像処理装置。 Image input means for inputting a color image obtained by imaging a predetermined object;
Of the plurality of color data constituting the color image, a positive value coefficient is set for color data suitable for extraction of the object, and a negative value coefficient is set for the other color data. Calculating means for executing a calculation for obtaining a sum of color data weighted by each coefficient for each pixel included in a predetermined area in the color image input by the means;
Image generation means for generating a grayscale image in which each pixel in the predetermined region is associated with the sum obtained by the calculation of the calculation means;
Threshold setting means for setting a threshold for binarizing the gray scale image based on the density distribution state of the gray scale image generated by the image generating means;
A color image processing apparatus comprising: binarizing means for binarizing the gray scale image with a threshold set by the threshold setting means.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006044195A JP2007226334A (en) | 2006-02-21 | 2006-02-21 | Color image processing method and color image processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006044195A JP2007226334A (en) | 2006-02-21 | 2006-02-21 | Color image processing method and color image processing device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2007226334A true JP2007226334A (en) | 2007-09-06 |
Family
ID=38548128
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006044195A Pending JP2007226334A (en) | 2006-02-21 | 2006-02-21 | Color image processing method and color image processing device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2007226334A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100963797B1 (en) * | 2008-02-27 | 2010-06-17 | 아주대학교산학협력단 | Method for realtime target detection based on reduced complexity hyperspectral processing |
JP2010256275A (en) * | 2009-04-28 | 2010-11-11 | Visco Technologies Corp | Shape inspection apparatus and shape inspection program |
WO2013062345A1 (en) * | 2011-10-28 | 2013-05-02 | 한국생산기술연구원 | Colour lighting control method for improving image quality in a vision system |
KR101418772B1 (en) | 2013-02-12 | 2014-07-11 | 한국생산기술연구원 | Control method for color lighting of vision system |
KR101497920B1 (en) * | 2013-11-15 | 2015-03-03 | 한국생산기술연구원 | Control method for color lighting of vision system by steepest descent algorithm |
WO2017068638A1 (en) * | 2015-10-20 | 2017-04-27 | 富士機械製造株式会社 | Image processing apparatus and parts mounter |
JP2017142737A (en) * | 2016-02-12 | 2017-08-17 | 旭精工株式会社 | Apparatus and method for determining color of disc |
JP2018535393A (en) * | 2015-09-16 | 2018-11-29 | サーモ エレクトロン サイエンティフィック インストルメンツ リミテッド ライアビリティ カンパニー | Image analysis system and method |
WO2019000726A1 (en) * | 2017-06-30 | 2019-01-03 | 惠科股份有限公司 | Display panel detecting method and device |
-
2006
- 2006-02-21 JP JP2006044195A patent/JP2007226334A/en active Pending
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100963797B1 (en) * | 2008-02-27 | 2010-06-17 | 아주대학교산학협력단 | Method for realtime target detection based on reduced complexity hyperspectral processing |
JP2010256275A (en) * | 2009-04-28 | 2010-11-11 | Visco Technologies Corp | Shape inspection apparatus and shape inspection program |
US9654746B2 (en) | 2011-10-28 | 2017-05-16 | Korea Institute Of Industrial Technology | Colour lighting control method for improving image quality in a vision system |
WO2013062345A1 (en) * | 2011-10-28 | 2013-05-02 | 한국생산기술연구원 | Colour lighting control method for improving image quality in a vision system |
KR101284268B1 (en) * | 2011-10-28 | 2013-07-08 | 한국생산기술연구원 | Color lighting control method for improving image quality of vision system |
DE112012004493B4 (en) * | 2011-10-28 | 2020-10-08 | Korea Institute Of Industrial Technology | Color lighting control method to improve image quality in an imaging system |
KR101418772B1 (en) | 2013-02-12 | 2014-07-11 | 한국생산기술연구원 | Control method for color lighting of vision system |
DE102013107687B4 (en) | 2013-02-12 | 2022-06-30 | Korea Institute Of Industrial Technology | Method for controlling color lighting in an imaging system |
KR101497920B1 (en) * | 2013-11-15 | 2015-03-03 | 한국생산기술연구원 | Control method for color lighting of vision system by steepest descent algorithm |
JP2018535393A (en) * | 2015-09-16 | 2018-11-29 | サーモ エレクトロン サイエンティフィック インストルメンツ リミテッド ライアビリティ カンパニー | Image analysis system and method |
US11057599B2 (en) | 2015-09-16 | 2021-07-06 | Thermo Electron Scientific Instruments Llc | Image analysis system and method |
JP7139243B2 (en) | 2015-09-16 | 2022-09-20 | サーモ エレクトロン サイエンティフィック インストルメンツ リミテッド ライアビリティ カンパニー | Image analysis system and method |
WO2017068638A1 (en) * | 2015-10-20 | 2017-04-27 | 富士機械製造株式会社 | Image processing apparatus and parts mounter |
JPWO2017068638A1 (en) * | 2015-10-20 | 2018-08-09 | 株式会社Fuji | Image processing apparatus and component mounting machine |
JP2017142737A (en) * | 2016-02-12 | 2017-08-17 | 旭精工株式会社 | Apparatus and method for determining color of disc |
WO2019000726A1 (en) * | 2017-06-30 | 2019-01-03 | 惠科股份有限公司 | Display panel detecting method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3551188B2 (en) | Surface condition inspection method and substrate inspection device | |
JP2007226334A (en) | Color image processing method and color image processing device | |
US7505149B2 (en) | Apparatus for surface inspection and method and apparatus for inspecting substrate | |
US7822261B2 (en) | Board inspecting apparatus, its parameter setting method and parameter setting apparatus | |
JP5421763B2 (en) | Inspection apparatus and inspection method | |
JP4492356B2 (en) | Substrate inspection device, parameter setting method and parameter setting device | |
JP2009128303A (en) | Visual examination device for substrate | |
JP2006220437A (en) | Substrate inspection device, method and device for setting parameter | |
JP3594026B2 (en) | Surface condition inspection method and substrate inspection device for curved body | |
JP4910897B2 (en) | Solder fillet inspection method and board appearance inspection device | |
JP2010014530A (en) | Substrate visual inspection method and substrate visual inspecting device | |
JP2008051694A (en) | Visual inspection method and system of mounting substrate | |
JP2007033126A (en) | Substrate inspection device, parameter adjusting method thereof and parameter adjusting device | |
JP3622749B2 (en) | Curved surface property inspection method and substrate inspection apparatus using this method | |
JP4506395B2 (en) | Substrate inspection device, parameter setting method and parameter setting device | |
JP3599023B2 (en) | Solder inspection method and board inspection apparatus using this method | |
JP2007258293A (en) | Device and method for solder wettability evaluation | |
JP2006098093A (en) | Substrate inspection device, substrate inspection method, inspection logic forming device of substrate inspection device and inspection logic forming method | |
JP2008292398A (en) | Method of inspecting floating defect of component electrode and substrate inspecting device | |
JP2005223006A (en) | Inspection method of cream solder print | |
JP4389761B2 (en) | Solder inspection method and board inspection apparatus using the method | |
JP4419778B2 (en) | Substrate inspection device, parameter setting method and parameter setting device | |
JP3038107B2 (en) | Soldering inspection method | |
JP4858227B2 (en) | Inspection parameter setting support device, control program and control method thereof | |
JP4649930B2 (en) | Soldering appearance inspection apparatus and soldering appearance inspection method |