JP5684505B2 - Image processing apparatus, image processing method, and computer program - Google Patents

Image processing apparatus, image processing method, and computer program Download PDF

Info

Publication number
JP5684505B2
JP5684505B2 JP2010161125A JP2010161125A JP5684505B2 JP 5684505 B2 JP5684505 B2 JP 5684505B2 JP 2010161125 A JP2010161125 A JP 2010161125A JP 2010161125 A JP2010161125 A JP 2010161125A JP 5684505 B2 JP5684505 B2 JP 5684505B2
Authority
JP
Japan
Prior art keywords
image
pixel
value
distribution range
distance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2010161125A
Other languages
Japanese (ja)
Other versions
JP2012021919A (en
Inventor
佐伯 和人
和人 佐伯
泰平 井上
泰平 井上
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Keyence Corp
Original Assignee
Keyence Corp
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 Keyence Corp filed Critical Keyence Corp
Priority to JP2010161125A priority Critical patent/JP5684505B2/en
Publication of JP2012021919A publication Critical patent/JP2012021919A/en
Application granted granted Critical
Publication of JP5684505B2 publication Critical patent/JP5684505B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、判定対象物を撮像して取得した多値画像及び撮像手段からの距離を濃淡値に変換した距離画像を、基準となる多値画像及び距離画像と比較する画像処理装置、画像処理方法、及びコンピュータプログラムに関する。   The present invention relates to an image processing apparatus and image processing for comparing a multi-value image obtained by imaging a determination target and a distance image obtained by converting a distance from an imaging unit into a gray value with a reference multi-value image and a distance image. The present invention relates to a method and a computer program.

従来、判定対象物を撮像して取得した多値画像を、基準となる多値画像と単純に比較することにより、判定対象物が良品であるか否かを判定する方法が開発されている。しかし、両画像を単純に比較するだけでは、良品自体の形状ばらつき、計算誤差、ノイズ等による画素値変動を考慮することができず、良品であるにもかかわらず良品ではないと誤って判定する等、正しく良品判定を行うことができないおそれがある等の問題があった。   Conventionally, a method has been developed for determining whether or not a determination target object is a non-defective product by simply comparing a multi-value image acquired by imaging the determination target object with a reference multi-value image. However, by simply comparing the two images, it is not possible to take into account pixel value fluctuations due to shape variations, calculation errors, noise, etc. of the non-defective product itself, and erroneously determine that it is non-defective even though it is non-defective For example, there is a possibility that correct product determination may not be performed correctly.

斯かる問題を解決するために、例えば特許文献1では、複数の良品に関する多値画像を準備しておき、それらの平均画像、標準偏差画像を求めることで、安定した良品判定を可能としている。具体的には、複数の良品に関する多値画像について位置合わせを行った後、同一座標の画素ごとに画素値の平均値及び標準偏差を算出する。判定対象物の多値画像について良品に関する多値(平均)画像との間で位置合わせを行った後、同一座標の画素ごとに、平均値との差分値を算出し、標準偏差に基づいて定義した閾値画像と画素ごとに比較することにより、良品判定を行っている。   In order to solve such a problem, for example, in Patent Document 1, a multi-value image relating to a plurality of non-defective products is prepared, and an average image and a standard deviation image thereof are obtained to enable stable non-defective product determination. Specifically, after aligning multi-valued images related to a plurality of non-defective products, an average value and a standard deviation of pixel values are calculated for each pixel having the same coordinates. After aligning the multi-value image of the judgment object with the multi-value (average) image related to the non-defective product, the difference value from the average value is calculated for each pixel at the same coordinate and defined based on the standard deviation The non-defective product is determined by comparing the threshold image for each pixel.

このようにすることで、良品自体の形状ばらつき、計算誤差、ノイズ等による画素値変動分を画素ごとの画素値のばらつき度合に応じて効果的に排除することができるとともに、画素ごとに良品であると判定する範囲が相違することから、良品の部位ごとに適切な良品判定の閾値を設定することができる。したがって、より高い精度で良品判定を行うことが可能となっている。   In this way, pixel value fluctuations due to non-defective product shape variations, calculation errors, noise, etc. can be effectively eliminated according to the degree of pixel value variation for each pixel, and non-defective products can be obtained for each pixel. Since the range to be determined is different, an appropriate non-defective threshold value can be set for each non-defective part. Therefore, the non-defective product can be determined with higher accuracy.

特開2005−265661号公報JP 2005-265661 A

しかし、特許文献1に開示されている画像処理方法では、濃淡値の差異として表れにくい判定対象物表面の凹凸を検出することができない。したがって、色の相違、表面の凹凸の相違が良品の分布範囲に含まれているにもかかわらず、判定対象物を載置した位置のばらつき等により光の当たり方が変化し、濃淡値の差異が実際より大きく検出されることで、良品ではないと誤って判定されるおそれがあった。   However, the image processing method disclosed in Patent Document 1 cannot detect unevenness on the surface of the determination object that is difficult to appear as a difference in light and shade values. Therefore, even though the difference in color and unevenness in the surface are included in the non-defective product distribution range, the way the light hits changes due to the variation in the position where the judgment object is placed, etc. May be erroneously determined to be non-defective due to being detected larger than actual.

また、三次元形状の差異を判断するべく、判定対象物の三次元形状を測定した三次元データと、判定対象物の三次元CADデータとを比較することも考えられる。しかし、実測値として正確な三次元データを取得する必要があり、多くの方向から計測した複数の計測データで三次元データを構成する等、良品であるか否かを判定するまでに相当の時間を要し、しかも装置自体が高価となる。   It is also conceivable to compare the three-dimensional data obtained by measuring the three-dimensional shape of the determination target with the three-dimensional CAD data of the determination target in order to determine the difference in the three-dimensional shape. However, it is necessary to acquire accurate three-dimensional data as measured values, and it takes a considerable amount of time to determine whether or not the product is non-defective, such as configuring the three-dimensional data with a plurality of measurement data measured from many directions. And the device itself is expensive.

さらに、欠陥が輪郭線の近傍に生じている場合、輪郭線近傍では画素値の標準偏差が大きいことから欠陥として認識することが困難であり、欠陥の存在を検出する感度が低くなってしまうという問題点があった。輪郭線の近傍にて画素値の標準偏差が大きくなるのは、判定対象物を載置した位置のばらつき、撮像位置の相違、良品自体の形状ばらつき等に起因する。   Furthermore, when a defect occurs in the vicinity of the contour line, it is difficult to recognize the defect as the standard deviation of the pixel value is large in the vicinity of the contour line, and the sensitivity to detect the presence of the defect is low. There was a problem. The increase in the standard deviation of the pixel value in the vicinity of the contour line is caused by the variation in the position where the determination target is placed, the difference in the imaging position, the shape variation of the non-defective product itself, and the like.

本発明は上記事情に鑑みてなされたものであり、第二の多値画像又は第二の距離画像の性状に応じて適切な特徴量を選択することができ、欠陥の存在だけでなく、色の相違についても高い感度で検出することができる画像処理装置、画像処理方法、及びコンピュータプログラムを提供することを目的とする。 The present invention has been made in view of the above circumstances, and an appropriate feature amount can be selected according to the properties of the second multi-valued image or the second distance image. An object of the present invention is to provide an image processing apparatus, an image processing method, and a computer program that can detect the difference between the two with high sensitivity .

上記目的を達成するために第1発明に係る画像処理装置は、判定対象物を撮像した多値画像を、良品に関する多値画像群と比較して良品判定を行う画像処理装置において、撮像手段で撮像された、良品に関する複数の第一の多値画像を取得する良品画像取得手段と、取得した第一の多値画像の画素ごとに、前記撮像手段からの距離を濃淡値に変換した第一の距離画像を生成する良品距離画像生成手段と、前記第一の多値画像の画素ごとに、色成分に関する画素値を特徴量として抽出する第一の特徴量抽出手段と、前記第一の多値画像又は前記第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度を特徴量として抽出する第二の特徴量抽出手段とを少なくとも含む複数の特徴量抽出手段のうち、少なくとも1つの特徴量抽出手段の選択を受け付ける選択受付手段と、取得した第一の多値画像及び生成した前記第一の距離画像の少なくとも一方の画素ごとの濃淡値の、良品判定を行うための分布範囲を算出する分布範囲算出手段と、判定対象物に関する第二の多値画像を取得する多値画像取得手段と、取得した第二の多値画像の画素ごとに、前記撮像手段からの距離を濃淡値に変換した第二の距離画像を生成する対象距離画像生成手段と、取得した第二の多値画像及び生成した前記第二の距離画像の少なくとも一方の画素ごとの濃淡値が対応する前記分布範囲に含まれているか否かを判断する判断手段とを備え、前記分布範囲算出手段は、前記第一の特徴量抽出手段の選択を受け付けた場合には第一の分布範囲を、前記第二の特徴量抽出手段の選択を受け付けた場合には第二の分布範囲を、それぞれ選択を受け付けた特徴量抽出手段により抽出した特徴量に基づいて算出するようにしてあり、前記判断手段は、前記第二の多値画像又は前記第二の距離画像の画素ごとに、選択を受け付けた特徴量抽出手段により特徴量を抽出し、抽出された特徴量に対応する前記第一の分布範囲又は前記第二の分布範囲に含まれているか否かを判断するようにしてあることを特徴とする。 In order to achieve the above object, an image processing apparatus according to a first aspect of the present invention is an image processing apparatus for performing non-defective product determination by comparing a multi-value image obtained by capturing an object to be determined with a multi-value image group related to non-defective products. A first non-defective image acquisition unit that acquires a plurality of first multi-valued images related to the acquired non-defective product, and a first value obtained by converting the distance from the imaging unit into a gray value for each pixel of the acquired first multi-level image. A non-defective distance image generating unit that generates a distance image of the first multi-value image, a first feature amount extracting unit that extracts a pixel value related to a color component as a feature amount for each pixel of the first multi-value image, and the first multi-value image At least one feature among a plurality of feature quantity extraction means including at least a second feature quantity extraction means for extracting edge strengths in two different directions as feature quantities for each pixel of the value image or the first distance image Selection of quantity extraction means A selection accepting means for accepting the acquired first gray value of at least every one of the pixels of the multivalued image and the generated the first distance image, the distribution range calculation means for calculating a distribution range for performing good decision A second multi-valued image obtaining unit for obtaining a second multi-valued image relating to the determination target, and a second value obtained by converting the distance from the imaging unit into a gray value for each pixel of the obtained second multi-valued image. Whether or not the target distance image generating means for generating the distance image, the acquired second multi-value image, and the gray value for each pixel of the generated second distance image are included in the corresponding distribution range. Determination means for determining whether or not the distribution range calculation means selects the first distribution range when the selection of the first feature quantity extraction means is accepted, and selects the second feature quantity extraction means. If you accept the second The distribution range is calculated based on the feature amount extracted by the feature amount extraction unit that has received the selection, and the determination unit is configured for each pixel of the second multi-value image or the second distance image. In addition, a feature amount is extracted by the feature amount extraction unit that has received the selection, and it is determined whether the feature amount is included in the first distribution range or the second distribution range corresponding to the extracted feature amount. It is characterized by being.

また、第2発明に係る画像処理装置は、第1発明において、複数の前記撮像手段を備え、前記良品距離画像生成手段又は前記対象距離画像生成手段は、複数の前記撮像手段で撮像された複数の前記第一の多値画像又は前記第二の多値画像に基づいて前記第一の距離画像又は前記第二の距離画像を生成するようにしてあることを特徴とする。   An image processing apparatus according to a second aspect of the present invention includes the plurality of imaging units in the first invention, and the non-defective distance image generation unit or the target distance image generation unit includes a plurality of images captured by the plurality of imaging units. The first distance image or the second distance image is generated based on the first multi-value image or the second multi-value image.

また、第3発明に係る画像処理装置は、第1発明において、前記撮像手段と、判定対象物に対して光を照射する光照射手段とを備え、前記良品距離画像生成手段又は前記対象距離画像生成手段は、前記撮像手段で撮像された前記第一の多値画像又は前記第二の多値画像、及び照射した光に基づいて前記第一の距離画像又は前記第二の距離画像を生成するようにしてあることを特徴とする。   An image processing apparatus according to a third aspect of the present invention is the image processing apparatus according to the first aspect, further comprising the imaging unit and a light irradiation unit that irradiates a determination target with light, and the good product distance image generation unit or the target distance image. The generation unit generates the first distance image or the second distance image based on the first multi-value image or the second multi-value image captured by the imaging unit and the irradiated light. It is characterized by the above.

また、第発明に係る画像処理装置は、第1乃至第3発明のいずれか1つにおいて、前記第一の特徴量抽出手段の選択を受け付けた場合、前記分布範囲算出手段は、前記第一の多値画像の画素ごとに、色成分に関する画素値の平均値を算出する画素平均値算出手段と、算出した色成分に関する画素値の平均値に基づいて、前記第一の多値画像の画素ごとに、色成分それぞれを座標軸とする多次元空間における画素値の前記第一の分布範囲を算出する画素値分布範囲算出手段とを有し、前記判断手段は、前記第二の多値画像の画素ごとに、色成分に関する画素値を算出して、色成分それぞれを座標軸とする多次元空間における画素値の前記第一の分布範囲に含まれているか否かを判断するようにしてあり、前記第二の特徴量抽出手段の選択を受け付けた場合、前記分布範囲算出手段は、前記第一の多値画像又は前記第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度を算出する方向別エッジ強度算出手段と、算出したエッジ強度に基づいて、前記第一の多値画像又は前記第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度の平均値を算出するエッジ強度平均値算出手段と、算出した平均値を中心として、前記第一の多値画像又は前記第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度の相互相関分布範囲を前記第二の分布範囲として算出するエッジ強度分布範囲算出手段とを有し、前記判断手段は、前記第二の多値画像又は前記第二の距離画像の画素ごとに、異なる二方向におけるエッジ強度を算出して、算出したエッジ強度が対応する前記相互相関分布範囲に含まれているか否かを判断するようにしてあることを特徴とする。 The image processing apparatus according to a fourth aspect of the present invention is the image processing apparatus according to any one of the first to third aspects, wherein when the selection of the first feature amount extraction unit is received, the distribution range calculation unit Pixel average value calculating means for calculating an average value of pixel values relating to color components for each pixel of the multi-value image, and pixels of the first multi-value image based on the calculated average values of pixel values relating to color components Each having a pixel value distribution range calculation means for calculating the first distribution range of pixel values in a multi-dimensional space having each color component as a coordinate axis, and the determination means includes the second multi-value image. For each pixel, a pixel value related to the color component is calculated, and it is determined whether or not the pixel value is included in the first distribution range of the pixel value in the multidimensional space with each color component as a coordinate axis. Receives selection of second feature extraction means When attached, the distribution range calculation means includes edge strength calculation means for each direction for calculating edge strength in two different directions for each pixel of the first multi-value image or the first distance image, and the calculated edge Based on the intensity, edge intensity average value calculating means for calculating an average value of edge intensity in two different directions for each pixel of the first multi-value image or the first distance image, and centering the calculated average value An edge intensity distribution range calculation means for calculating a cross-correlation distribution range of edge strengths in two different directions as the second distribution range for each pixel of the first multi-valued image or the first distance image. And the determination means calculates edge strengths in two different directions for each pixel of the second multi-valued image or the second distance image, and the calculated edge strengths correspond to the corresponding phases. Characterized in that you have to determine whether or not included in the correlation distribution range.

また、第発明に係る画像処理装置は、第発明において、前記方向別エッジ強度算出手段は、前記エッジ強度を互いに直交する二方向にて算出するようにしてあることを特徴とする。 An image processing apparatus according to a fifth aspect of the present invention is the image processing apparatus according to the fourth aspect , wherein the direction-specific edge strength calculating means calculates the edge strength in two directions orthogonal to each other.

また、第発明に係る画像処理装置は、第発明において、前記方向別エッジ強度算出手段は、前記エッジ強度を二次元画像における行方向と列方向との二方向にて算出するようにしてあることを特徴とする。 The image processing apparatus according to a sixth aspect of the present invention is the image processing apparatus according to the fifth aspect , wherein the direction-specific edge strength calculating means calculates the edge strength in two directions of a row direction and a column direction in a two-dimensional image. It is characterized by being.

また、第発明に係る画像処理装置は、第4乃至第6発明のいずれか1つにおいて、前記エッジ強度分布範囲算出手段は、仮想的な楕円領域として前記相互相関分布範囲を前記第二の分布範囲として算出するようにしてあることを特徴とする。 An image processing apparatus according to a seventh invention is the image processing apparatus according to any one of the fourth to sixth inventions, wherein the edge intensity distribution range calculation means sets the cross-correlation distribution range as the virtual ellipse region to the second It is characterized in that it is calculated as a distribution range .

また、第発明に係る画像処理装置は、第1乃至第発明のいずれか1つにおいて、前記第一の多値画像と前記第二の多値画像との位置合わせ又は前記第一の距離画像と前記第二の距離画像との位置合わせを行う位置調整手段を備えることを特徴とする。 According to an eighth aspect of the present invention, in any one of the first to seventh aspects, the first multi-value image and the second multi-value image are aligned or the first distance is set. Position adjustment means for aligning the image with the second distance image is provided.

また、第発明に係る画像処理装置は、第1乃至第発明のいずれか1つにおいて、前記選択受付手段が、複数の特徴量抽出手段の選択を受け付けた場合であって、前記判断手段が、選択を受け付けた特徴量抽出手段で抽出された特徴量のうち、いずれかの特徴量がそれぞれの特徴量に対応する前記第一の分布範囲又は前記第二の分布範囲に含まれていないと判断したとき、前記判定対象物は良品ではないと判定するようにしてあることを特徴とする。 An image processing apparatus according to a ninth invention is the image processing apparatus according to any one of the first to eighth inventions, wherein the selection accepting means accepts selection of a plurality of feature quantity extracting means. However, any one of the feature quantities extracted by the feature quantity extraction unit that has received the selection is not included in the first distribution range or the second distribution range corresponding to each feature quantity. When the determination is made, it is determined that the determination object is not a non-defective product.

次に、上記目的を達成するために第10発明に係る画像処理方法は、判定対象物を撮像した多値画像を、良品に関する多値画像群と比較して良品判定を行う画像処理装置で実行することが可能な画像処理方法において、撮像手段で撮像された、良品に関する複数の第一の多値画像を取得するステップと、取得した第一の多値画像の画素ごとに、前記撮像手段からの距離を濃淡値に変換した第一の距離画像を生成するステップと、前記第一の多値画像の画素ごとに、色成分に関する画素値を特徴量として抽出する第一の特徴量抽出手段と、前記第一の多値画像又は前記第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度を特徴量として抽出する第二の特徴量抽出手段とを少なくとも含む複数の特徴量抽出手段のうち、少なくとも1つの特徴量抽出手段の選択を受け付けるステップと、取得した第一の多値画像及び生成した前記第一の距離画像の少なくとも一方の画素ごとの濃淡値の、良品判定を行うための分布範囲を算出するステップと、判定対象物に関する第二の多値画像を取得するステップと、取得した第二の多値画像の画素ごとに、前記撮像手段からの距離を濃淡値に変換した第二の距離画像を生成するステップと、取得した第二の多値画像及び生成した前記第二の距離画像の少なくとも一方の画素ごとの濃淡値が対応する前記分布範囲に含まれているか否かを判断するステップとを含み、前記第一の特徴量抽出手段の選択を受け付けた場合には第一の分布範囲を、前記第二の特徴量抽出手段の選択を受け付けた場合には第二の分布範囲を、それぞれ選択を受け付けた特徴量抽出手段により抽出した特徴量に基づいて算出し、前記第二の多値画像又は前記第二の距離画像の画素ごとに、選択を受け付けた特徴量抽出手段により特徴量を抽出し、抽出された特徴量に対応する前記第一の分布範囲又は前記第二の分布範囲に含まれているか否かを判断することを特徴とする。 Next, in order to achieve the above object, the image processing method according to the tenth aspect of the present invention is executed by an image processing apparatus that performs a non-defective product determination by comparing a multi-value image obtained by imaging a determination target with a multi-value image group related to a good product In the image processing method that can be performed, a step of acquiring a plurality of first multi-value images related to non-defective products imaged by the imaging unit, and for each pixel of the acquired first multi-value image, from the imaging unit Generating a first distance image obtained by converting the distance into a gray value, and a first feature amount extraction means for extracting a pixel value related to a color component as a feature amount for each pixel of the first multi-value image; A plurality of feature quantity extraction means including at least a second feature quantity extraction means for extracting edge strengths in two different directions as feature quantities for each pixel of the first multi-value image or the first distance image. At least 1 Calculating a step of accepting a selection of a feature extraction means, the gray value of each at least one of the pixels of the first multivalued image, and generated the first distance image acquired, the distribution range for performing good determination of A second distance image obtained by converting a distance from the imaging unit into a gray value for each pixel of the acquired second multi-value image And determining whether or not a gray value for each pixel of at least one pixel of the acquired second multi-valued image and the generated second distance image is included in the corresponding distribution range; Including a first distribution range when the selection of the first feature amount extraction unit is received, and a second distribution range when the selection of the second feature amount extraction unit is received, respectively. Accept selection Calculated based on the feature amount extracted by the feature amount extraction means, and for each pixel of the second multi-valued image or the second distance image, the feature amount extraction means that has received a selection extracts the feature amount, It is characterized by determining whether it is included in said 1st distribution range or said 2nd distribution range corresponding to the extracted feature-value.

次に、上記目的を達成するために第11発明に係るコンピュータプログラムは、判定対象物を撮像した多値画像を、良品に関する多値画像群と比較して良品判定を行う画像処理装置で実行することが可能なコンピュータプログラムにおいて、前記画像処理装置を、撮像手段で撮像された、良品に関する複数の第一の多値画像を取得する良品画像取得手段、取得した第一の多値画像の画素ごとに、前記撮像手段からの距離を濃淡値に変換した第一の距離画像を生成する良品距離画像生成手段、前記第一の多値画像の画素ごとに、色成分に関する画素値を特徴量として抽出する第一の特徴量抽出手段と、前記第一の多値画像又は前記第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度を特徴量として抽出する第二の特徴量抽出手段とを少なくとも含む複数の特徴量抽出手段のうち、少なくとも1つの特徴量抽出手段の選択を受け付ける選択受付手段、取得した第一の多値画像及び生成した前記第一の距離画像の少なくとも一方の画素ごとの濃淡値の、良品判定を行うための分布範囲を算出する分布範囲算出手段、判定対象物に関する第二の多値画像を取得する多値画像取得手段、取得した第二の多値画像の画素ごとに、前記撮像手段からの距離を濃淡値に変換した第二の距離画像を生成する対象距離画像生成手段、及び取得した第二の多値画像及び生成した前記第二の距離画像の少なくとも一方の画素ごとの濃淡値が対応する前記分布範囲に含まれているか否かを判断する判断手段として機能させ、前記分布範囲算出手段を、前記第一の特徴量抽出手段の選択を受け付けた場合には第一の分布範囲を、前記第二の特徴量抽出手段の選択を受け付けた場合には第二の分布範囲を、それぞれ選択を受け付けた特徴量抽出手段により抽出した特徴量に基づいて算出する手段として機能させ、前記判断手段を、前記第二の多値画像又は前記第二の距離画像の画素ごとに、選択を受け付けた特徴量抽出手段により特徴量を抽出し、抽出された特徴量に対応する前記第一の分布範囲又は前記第二の分布範囲に含まれているか否かを判断する手段として機能させることを特徴とする。 Next, in order to achieve the above object, a computer program according to an eleventh aspect of the invention executes an image processing apparatus that performs a non-defective product determination by comparing a multi-value image obtained by imaging a determination target with a multi-value image group related to a non-defective product. A non-defective image acquiring unit that acquires a plurality of first multi-valued images related to a non-defective product that has been imaged by the imaging unit in the computer program capable of being acquired, for each pixel of the acquired first multi-valued image In addition, a non-defective distance image generation unit that generates a first distance image obtained by converting the distance from the imaging unit into a gray value, and extracts a pixel value related to a color component as a feature amount for each pixel of the first multi-value image First feature quantity extracting means, and second feature quantity extracting means for extracting edge strengths in two different directions as feature quantities for each pixel of the first multi-value image or the first distance image. Among the plurality of feature extraction means including at least a selection accepting means for accepting a selection of at least one feature extraction means, for each of at least one of the pixels of the first multivalued image, and generated the first distance image acquired Distribution range calculation means for calculating a distribution range for performing non-defective product determination of gray value, multi-value image acquisition means for acquiring a second multi-value image relating to the determination target, and for each pixel of the acquired second multi-value image In addition, target distance image generation means for generating a second distance image obtained by converting the distance from the imaging means into a gray value, and at least one of the acquired second multi-value image and the generated second distance image It functions as a determination unit that determines whether or not the gray value for each pixel is included in the corresponding distribution range, and the distribution range calculation unit accepts the selection of the first feature amount extraction unit If the selection of the second feature amount extraction unit is accepted, the second distribution range is selected based on the feature amount extracted by the feature amount extraction unit that has accepted the selection. It is made to function as a means for calculating, and the determination means extracts the feature amount by the feature amount extraction means that accepts selection for each pixel of the second multi-value image or the second distance image, and the extracted feature It is made to function as a means to judge whether it is contained in said 1st distribution range or said 2nd distribution range corresponding to quantity.

第1発明、第10発明及び第11発明では、撮像手段で撮像された、良品に関する複数の第一の多値画像を取得し、取得した第一の多値画像の画素ごとに、撮像手段からの距離を濃淡値に変換した第一の距離画像を生成する。第一の多値画像の画素ごとに、色成分に関する画素値を特徴量として抽出する第一の特徴量抽出手段と、第一の多値画像又は第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度を特徴量として抽出する第二の特徴量抽出手段とを少なくとも含む複数の特徴量抽出手段のうち、少なくとも1つの特徴量抽出手段の選択を受け付ける。取得した第一の多値画像及び生成した第一の距離画像の少なくとも一方の画素ごとの濃淡値の、良品判定を行うための分布範囲を算出する。判定対象物に関する第二の多値画像を取得し、取得した第二の多値画像の画素ごとに、撮像手段からの距離を濃淡値に変換した第二の距離画像を生成し、取得した第二の多値画像及び生成した第二の距離画像の少なくとも一方の画素ごとの濃淡値が対応する前記分布範囲に含まれているか否かを判断する。第二の距離画像に基づいて、良品であるか否かを判断するので、従来の方法では検出することが困難である判定対象物表面の凹凸を検出することができ、判定対象物を載置した位置のばらつき等により光の当たり方が変化した場合であっても、良品ではないと誤って判定される可能性を低減することが可能となる。また、第一の特徴量抽出手段の選択を受け付けた場合には第一の分布範囲を、第二の特徴量抽出手段の選択を受け付けた場合には第二の分布範囲を、それぞれ選択を受け付けた特徴量抽出手段により抽出した特徴量に基づいて算出し、第二の多値画像又は第二の距離画像の画素ごとに、選択を受け付けた特徴量抽出手段により特徴量を抽出し、抽出された特徴量に対応する第一の分布範囲又は第二の分布範囲に含まれているか否かを判断するので、第二の多値画像又は第二の距離画像の性状に応じて、特徴量抽出手段を選択することができ、適切な特徴量を選択することにより、欠陥が輪郭線近傍に生じている場合であっても欠陥の存在を検出することができ、色の相違についても高い感度で検出することが可能となる。例えば選択を受け付けた特徴量が色成分に関する画素値である場合、色の相違による濃淡のばらつきの存在を検出することができ、選択を受け付けた特徴量が異なる二方向におけるエッジ強度である場合、輪郭線近傍の欠陥の存在を検出することができる。 In the first invention, the tenth invention, and the eleventh invention, a plurality of first multi-value images related to non-defective products, which are imaged by the imaging means, are acquired, and the pixels of the acquired first multi-value image are obtained from the imaging means. A first distance image is generated by converting the distance to a gray value. The first feature value extraction means for extracting the pixel value related to the color component as a feature value for each pixel of the first multivalued image and two different pixels for each pixel of the first multivalued image or the first distance image. The selection of at least one feature quantity extraction means is accepted from among a plurality of feature quantity extraction means including at least a second feature quantity extraction means for extracting edge strength in the direction as a feature quantity. A distribution range for performing non-defective product determination of the gray value for each pixel of at least one of the acquired first multi-value image and the generated first distance image is calculated. A second multi-value image related to the determination target is acquired, and for each pixel of the acquired second multi-value image, a second distance image in which the distance from the imaging unit is converted into a gray value is generated and acquired. It is determined whether the gray value for each pixel of at least one of the second multi-valued image and the generated second distance image is included in the corresponding distribution range. Since it is determined based on the second distance image whether or not it is a non-defective product, it is possible to detect unevenness on the surface of the determination object that is difficult to detect by the conventional method, and to place the determination object Even if the way the light strikes changes due to variations in the position, etc., it is possible to reduce the possibility of erroneously determining that the light is not a good product. When the selection of the first feature quantity extraction unit is accepted, the first distribution range is accepted, and when the selection of the second feature quantity extraction unit is accepted, the second distribution range is accepted. Calculated based on the feature quantity extracted by the feature quantity extraction means, and extracted for each pixel of the second multi-valued image or the second distance image by extracting the feature quantity by the feature quantity extraction means that accepted the selection. Since it is determined whether or not it is included in the first distribution range or the second distribution range corresponding to the feature amount, the feature amount extraction is performed according to the property of the second multi-value image or the second distance image. By selecting an appropriate feature amount, it is possible to detect the presence of a defect even when the defect occurs in the vicinity of the contour line, and with high sensitivity for color differences. It becomes possible to detect. For example, when the feature amount that has received the selection is a pixel value related to a color component, it is possible to detect the presence or absence of shading variation due to a difference in color, and when the feature amount that has received the selection is an edge strength in two different directions, The presence of a defect near the contour line can be detected.

第2発明では、複数の撮像手段を備え、複数の撮像手段で撮像された複数の第一の多値画像又は第二の多値画像に基づいて第一の距離画像又は第二の距離画像を生成する。複数の撮像手段を備えることにより、複数の多値画像を取得することができ、ステレオ計測法等のいわゆるパッシブ方式にて距離画像を生成することができる。   In the second invention, the first distance image or the second distance image is provided on the basis of the plurality of first multi-value images or second multi-value images that are provided with a plurality of image pickup means and are imaged by the plurality of image pickup means. Generate. By providing a plurality of imaging means, a plurality of multi-value images can be acquired, and a distance image can be generated by a so-called passive method such as a stereo measurement method.

第3発明では、撮像手段と、判定対象物に対して光を照射する光照射手段とを備え、撮像手段で撮像された第一の多値画像又は第二の多値画像、及び照射した光に基づいて第一の距離画像又は第二の距離画像を生成する。これにより、高さ方向の距離を計測するために光を能動的に照射することができ、光切断法、パターン投影法等のいわゆるアクティブ方式にて距離画像を生成することができる。   In the third invention, the first multi-valued image or the second multi-valued image picked up by the image pickup means and the light irradiation means for irradiating the determination target with light, and the irradiated light The first distance image or the second distance image is generated based on the above. Accordingly, light can be actively irradiated to measure the distance in the height direction, and a distance image can be generated by a so-called active method such as a light cutting method or a pattern projection method.

発明では、第一の特徴量抽出手段の選択を受け付けた場合、第一の多値画像の画素ごとに、色成分に関する画素値の平均値を算出し、算出した色成分に関する画素値の平均値に基づいて、第一の多値画像の画素ごとに、色成分それぞれを座標軸とする多次元空間における画素値の第一の分布範囲を算出する。第二の多値画像の画素ごとに、色成分に関する画素値を算出して、色成分それぞれを座標軸とする多次元空間における画素値の第一の分布範囲に含まれているか否かを判断する。第二の特徴量抽出手段の選択を受け付けた場合、第一の多値画像又は第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度を算出し、算出したエッジ強度に基づいて、第一の多値画像又は第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度の平均値を算出し、算出した平均値を中心として、第一の多値画像又は第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度の相互相関分布範囲を第二の分布範囲として算出する。第二の多値画像又は第二の距離画像の画素ごとに、異なる二方向におけるエッジ強度を算出して、算出したエッジ強度が対応する相互相関分布範囲に含まれているか否かを判断する。これにより、選択を受け付けた特徴量が色成分に関する画素値である場合、算出した画素値の第一の分布範囲に含まれているか否かにより色の相違を検出することができ、選択を受け付けた特徴量が異なる二方向におけるエッジ強度である場合、算出したエッジ強度の相互相関分布範囲に含まれているか否かにより、輪郭線近傍の欠陥の存在を検出することができる。 In the fourth aspect of the invention, when the selection of the first feature amount extraction unit is accepted, the average value of the pixel values related to the color component is calculated for each pixel of the first multi-value image, and the pixel value related to the calculated color component is calculated. Based on the average value, a first distribution range of pixel values in a multidimensional space with each color component as a coordinate axis is calculated for each pixel of the first multivalued image. For each pixel of the second multi-valued image, a pixel value related to the color component is calculated, and it is determined whether or not the pixel value is included in the first distribution range of the pixel value in the multi-dimensional space with each color component as a coordinate axis. . When the selection of the second feature amount extraction means is accepted, the edge strength in two different directions is calculated for each pixel of the first multi-value image or the first distance image, and the first edge value is calculated based on the calculated edge strength. For each pixel of one multi-value image or first distance image, an average value of edge strengths in two different directions is calculated, and the first multi-value image or first distance image is calculated around the calculated average value. For each pixel, a cross-correlation distribution range of edge strengths in two different directions is calculated as a second distribution range . For each pixel of the second multi-value image or the second distance image, the edge strength in two different directions is calculated, and it is determined whether or not the calculated edge strength is included in the corresponding cross-correlation distribution range. As a result, when the feature quantity accepted for selection is a pixel value related to a color component, it is possible to detect a color difference depending on whether the calculated pixel value is included in the first distribution range, and accept the selection. If the detected feature amounts are edge strengths in two different directions, it is possible to detect the presence of a defect near the contour line depending on whether or not it is included in the cross-correlation distribution range of the calculated edge strengths.

発明では、エッジ強度を互いに直交する二方向にて算出することにより、相互相関分布範囲の算出が容易となり、演算処理負荷を軽減することが可能となる。 In the fifth invention, by calculating the edge strength in two directions orthogonal to each other, the calculation of the cross-correlation distribution range is facilitated, and the processing load can be reduced.

発明では、エッジ強度を二次元画像における行方向と列方向との二方向にて算出することにより、さらに相互相関分布範囲の算出が容易となり、演算処理負荷をより軽減することが可能となる。 In the sixth invention, by calculating the edge strength in two directions of the row direction and the column direction in the two-dimensional image, the calculation of the cross-correlation distribution range is further facilitated, and the processing load can be further reduced. Become.

発明では、仮想的な楕円領域として相互相関分布範囲を第二の分布範囲として算出することにより、第二の多値画像又は第二の距離画像の画素ごとに算出した異なる二方向におけるエッジ強度が、相互相関分布範囲に含まれているか否かをより容易に判断することが可能となる。 In the seventh invention, by calculating the cross-correlation distribution range as the second distribution range as a virtual elliptical region, edges in different two directions calculated for each pixel of the second multi-valued image or the second distance image It is possible to more easily determine whether or not the intensity is included in the cross-correlation distribution range.

発明では、第一の多値画像と第二の多値画像との位置合わせ又は第一の距離画像と第二の距離画像との位置合わせを行うことにより、第二の多値画像又は第二の距離画像の画素ごとに算出した異なる二方向におけるエッジ強度が、相互相関分布範囲に含まれているか否かをより正確に判断することが可能となる。 In the eighth invention, the second multi-value image or the second multi-value image is aligned by aligning the first multi-value image and the second multi-value image, or the first distance image and the second distance image. It is possible to more accurately determine whether or not the edge intensity in two different directions calculated for each pixel of the second distance image is included in the cross-correlation distribution range.

発明では、複数の特徴量抽出手段の選択を受け付けた場合であって、選択を受け付けた特徴量抽出手段で抽出された特徴量のうち、いずれかの特徴量がそれぞれの特徴量に対応する第一の分布範囲又は第二の分布範囲に含まれていないと判断したとき、判定対象物は良品ではないと判定する。これにより、従来は不適切な特徴量に基づいて、本来良品ではない判定対象物を誤って良品であると判定していた場合であっても、適切な特徴量に基づいて良品ではないと正しく判定することが可能となる。 In the ninth invention, when selection of a plurality of feature quantity extraction means is accepted, one of the feature quantities extracted by the feature quantity extraction means that has accepted the selection corresponds to each feature quantity. When it is determined that it is not included in the first distribution range or the second distribution range , it is determined that the determination target object is not a non-defective product. As a result, even if it was determined that a non-defective product was determined to be a non-defective product based on an inappropriate feature value, it was correctly determined that it was not a non-defective product based on an appropriate feature value. It becomes possible to judge.

本発明によれば、第二の距離画像に基づいて、良品であるか否かを判断するので、従来の方法では検出することが困難である判定対象物表面の凹凸を検出することができ、判定対象物を載置した位置のばらつき等により光の当たり方が変化した場合であっても、良品ではないと誤って判定される可能性を低減することが可能となる。また、第二の多値画像又は第二の距離画像の性状に応じて、特徴量抽出手段を選択することができ、適切な特徴量を選択することにより、欠陥が輪郭線近傍に生じている場合であっても欠陥の存在を検出することができ、色の相違についても高い感度で検出することが可能となる。例えば選択を受け付けた特徴量が色成分に関する画素値である場合、色の相違による濃淡のばらつきの存在を検出することができ、選択を受け付けた特徴量が異なる二方向におけるエッジ強度である場合、輪郭線近傍の欠陥の存在を検出することができる。 According to the present invention, since it is determined whether or not it is a non-defective product based on the second distance image, it is possible to detect unevenness on the surface of the determination target that is difficult to detect by the conventional method, Even if the way the light hits changes due to variations in the position where the determination target is placed, it is possible to reduce the possibility that it is erroneously determined that it is not a non-defective product. In addition, the feature quantity extraction unit can be selected according to the properties of the second multi-value image or the second distance image, and defects are generated in the vicinity of the contour line by selecting an appropriate feature quantity. Even in this case, the presence of a defect can be detected, and a difference in color can be detected with high sensitivity. For example, when the feature amount that has received the selection is a pixel value related to a color component, it is possible to detect the presence or absence of shading variation due to a difference in color, and when the feature amount that has received the selection is an edge strength in two different directions, The presence of a defect near the contour line can be detected.

本発明の実施の形態1に係る画像処理装置の構成を模式的に示すブロック図である。1 is a block diagram schematically showing a configuration of an image processing apparatus according to Embodiment 1 of the present invention. 本発明の実施の形態1に係る画像処理装置の一構成例を示す機能ブロック図である。It is a functional block diagram which shows the example of 1 structure of the image processing apparatus which concerns on Embodiment 1 of this invention. 本発明の実施の形態1に係る距離画像を説明するための斜視図及び距離画像の例示図である。It is the perspective view for demonstrating the distance image which concerns on Embodiment 1 of this invention, and the illustration figure of a distance image. 本発明の実施の形態1に係る画像処理装置の主制御部の良品情報収集処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the quality information collection process of the main-control part of the image processing apparatus which concerns on Embodiment 1 of this invention. 本発明の実施の形態1に係る画像処理装置の主制御部の良品判定処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the quality determination process of the main-control part of the image processing apparatus which concerns on Embodiment 1 of this invention. 本発明の実施の形態2に係る画像処理装置の一構成例を示す機能ブロック図である。It is a functional block diagram which shows the example of 1 structure of the image processing apparatus which concerns on Embodiment 2 of this invention. 本発明の実施の形態2に係る画像処理装置の主制御部の良品情報収集処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the quality information collection process of the main control part of the image processing apparatus which concerns on Embodiment 2 of this invention. 本発明の実施の形態2に係る画像処理装置の主制御部の良品判定処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the quality determination process of the main-control part of the image processing apparatus which concerns on Embodiment 2 of this invention. 本発明の実施の形態2に係る画像処理装置の第一の特徴量抽出手段の選択を受け付けた場合の分布範囲算出手段の機能ブロック図である。It is a functional block diagram of the distribution range calculation means when the selection of the first feature quantity extraction means of the image processing apparatus according to Embodiment 2 of the present invention is accepted. 本発明の実施の形態2に係る画像処理装置の第一の特徴量抽出手段の選択を受け付けた場合の、画素値の分布範囲を示す例示図である。It is an illustration figure which shows the distribution range of a pixel value when selection of the 1st feature-value extraction means of the image processing apparatus which concerns on Embodiment 2 of this invention is received. 本発明の実施の形態2に係る画像処理装置の主制御部の、第一の特徴量抽出手段の選択を受け付けた場合の、分布範囲算出処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the distribution range calculation process at the time of receiving selection of the 1st feature-value extraction means of the main control part of the image processing apparatus which concerns on Embodiment 2 of this invention. 本発明の実施の形態2に係る画像処理装置の第二の特徴量抽出手段の選択を受け付けた場合の分布範囲算出手段の機能ブロック図である。It is a functional block diagram of the distribution range calculation means when the selection of the second feature quantity extraction means of the image processing apparatus according to Embodiment 2 of the present invention is accepted. 本発明の実施の形態2に係る画像処理装置の所定の画素ごとの異なる二方向におけるエッジ強度の相互相関分布範囲の例示図である。It is an illustration figure of the cross correlation distribution range of the edge intensity | strength in two different directions for every predetermined | prescribed pixel of the image processing apparatus which concerns on Embodiment 2 of this invention. 本発明の実施の形態2に係る画像処理装置の主制御部の、第二の特徴量抽出手段の選択を受け付けた場合の、分布範囲算出処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the distribution range calculation process at the time of receiving selection of the 2nd feature-value extraction means of the main control part of the image processing apparatus which concerns on Embodiment 2 of this invention. 本発明の実施の形態2に係る画像処理装置の主制御部の、第二の特徴量抽出手段の選択を受け付けた場合の、良品判定処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the quality determination process in case the selection of the 2nd feature-value extraction means of the main control part of the image processing apparatus which concerns on Embodiment 2 of this invention is received.

以下、本発明の実施の形態に係る画像処理装置について、図面を参照して説明する。なお、参照する図面を通じて、同一又は同様の構成又は機能を有する要素については、同一又は同様の符号を付して、詳細な説明を省略する。   Hereinafter, an image processing apparatus according to an embodiment of the present invention will be described with reference to the drawings. Throughout the drawings to be referred, elements having the same or similar configuration or function are denoted by the same or similar reference numerals, and detailed description thereof is omitted.

(実施の形態1)
図1は、本発明の実施の形態1に係る画像処理装置の構成を模式的に示すブロック図である。図1に示すように本実施の形態1に係る画像処理装置2は、判定対象物又は良品の多値画像を撮像する撮像手段であるカメラ1、判定対象物又は良品にレーザ光を照射するライト9及び撮像された多値画像、生成された距離画像又は演算処理の途上で生成された画像を表示する画像表示手段である表示装置3に接続されている。
(Embodiment 1)
FIG. 1 is a block diagram schematically showing a configuration of an image processing apparatus according to Embodiment 1 of the present invention. As shown in FIG. 1, the image processing apparatus 2 according to the first embodiment includes a camera 1 that is an imaging unit that captures a multi-valued image of a determination target object or a non-defective product, and a light that irradiates the determination target object or the non-defective product with laser light. 9 and a captured multi-value image, a generated distance image, or a display device 3 which is an image display means for displaying an image generated in the course of calculation processing.

画像処理装置2は、少なくともCPU(中央演算装置)、LSI等で構成された主制御部21、メモリ22、記憶手段23、入力手段24、出力手段25、通信手段26、補助記憶手段27及び上述したハードウェアを接続する内部バス28で構成されている。主制御部21は、内部バス28を介して画像処理装置2の上述したようなハードウェア各部と接続されており、上述したハードウェア各部の動作を制御するとともに、記憶手段23に記憶されているコンピュータプログラム5に従って、種々のソフトウェア的機能を実行する。メモリ22は、SRAM、SDRAM等の揮発性メモリで構成され、コンピュータプログラム5の実行時にロードモジュールが展開され、コンピュータプログラム5の実行時に発生する一時的なデータ等を記憶する。   The image processing apparatus 2 includes at least a CPU (central processing unit), a main control unit 21 configured by an LSI, a memory 22, a storage unit 23, an input unit 24, an output unit 25, a communication unit 26, an auxiliary storage unit 27, and the above-described unit. The internal bus 28 is connected to the hardware. The main control unit 21 is connected to each hardware unit as described above of the image processing apparatus 2 via the internal bus 28, and controls the operation of each hardware unit described above and is stored in the storage unit 23. Various software functions are executed in accordance with the computer program 5. The memory 22 is composed of a volatile memory such as SRAM or SDRAM, and a load module is expanded when the computer program 5 is executed, and stores temporary data generated when the computer program 5 is executed.

記憶手段23は、内蔵される固定型記憶装置(ハードディスク、フラッシュメモリ)、ROM等で構成されている。記憶手段23に記憶されているコンピュータプログラム5は、プログラム及びデータ等の情報を記録したDVD、CD−ROM、フラッシュメモリ等の可搬型記録媒体4から、補助記憶手段27によりダウンロードされ、実行時には記憶手段23からメモリ22へ展開して実行される。もちろん、通信手段26を介して外部のコンピュータからダウンロードされたコンピュータプログラムであっても良い。   The storage means 23 is composed of a built-in fixed storage device (hard disk, flash memory), ROM or the like. The computer program 5 stored in the storage means 23 is downloaded by the auxiliary storage means 27 from the portable recording medium 4 such as a DVD, CD-ROM, or flash memory in which information such as programs and data is recorded, and stored at the time of execution. It is expanded from the means 23 to the memory 22 and executed. Of course, a computer program downloaded from an external computer via the communication means 26 may be used.

記憶手段23は、取得した良品に関する複数の多値画像に関する多値画像データを記憶しておく良品画像データ記憶部231と、良品画像データ記憶部231に記憶してある良品に関する複数の多値画像データに基づいて、画素ごとに濃淡値の分布範囲に関する情報(分布範囲情報)を記憶する分布範囲情報記憶部232とを備えている。判定対象物の特徴量が、分布範囲情報記憶部232に記憶してある分布範囲情報に基づいて特定される分布範囲に含まれているか否かの判断に応じて、判定対象物が良品であるか否かを判定する。   The storage unit 23 stores the multi-value image data related to the acquired multi-value images related to the multi-value images, and the multi-value images related to the non-defective products stored in the non-defective product image data storage unit 231. A distribution range information storage unit 232 that stores information (distribution range information) regarding the distribution range of the gray value for each pixel based on the data. The determination target is a non-defective product according to the determination as to whether or not the feature amount of the determination target is included in the distribution range specified based on the distribution range information stored in the distribution range information storage unit 232. It is determined whether or not.

通信手段26は内部バス28に接続されており、インターネット、LAN、WAN等の外部のネットワークに接続されることにより、外部のコンピュータ等とデータ送受信を行うことが可能となっている。すなわち、上述した記憶手段23は、画像処理装置2に内蔵される構成に限定されるものではなく、通信手段26を介して接続されている外部のサーバコンピュータ等に設置されているハードディスク等の外部記録媒体であっても良い。   The communication means 26 is connected to an internal bus 28, and is connected to an external network such as the Internet, a LAN, or a WAN, so that data can be transmitted / received to / from an external computer or the like. In other words, the storage unit 23 described above is not limited to the configuration built in the image processing apparatus 2, but an external device such as a hard disk installed in an external server computer connected via the communication unit 26. It may be a recording medium.

入力手段24は、キーボード及びマウス等のデータ入力媒体の他、液晶パネル等と一体となったタッチパネル等の入力情報を取得する装置全般を含む広い概念である。出力手段25は、レーザプリンタ、ドットプリンタ等の印刷装置等を意味する。   The input means 24 is a broad concept including all devices for acquiring input information such as a touch panel integrated with a liquid crystal panel or the like in addition to a data input medium such as a keyboard and a mouse. The output means 25 means a printing device such as a laser printer or a dot printer.

カメラ(撮像手段)1は、CCD撮像素子を備えたCCDカメラ等である。表示装置3は、CRT、液晶パネル等を有する表示装置である。また、ライト(光照射手段)9は、判定対象物及び良品に対してレーザ光を照射し、例えば正弦波縞パターンの位相をずらして撮像した複数の多値画像を取得することができる。   The camera (imaging means) 1 is a CCD camera or the like provided with a CCD image sensor. The display device 3 is a display device having a CRT, a liquid crystal panel, and the like. The light (light irradiating means) 9 can irradiate the determination target object and the non-defective product with laser light, and can acquire a plurality of multi-value images captured by shifting the phase of the sinusoidal fringe pattern, for example.

なお、一基のカメラ1と一基のライト9とを用いる構成に限定されるものではなく、カメラ1を複数用いても良い。複数のカメラ1、1、・・・により取得した複数の多値画像に基づいてステレオ計測法等を用いることにより、カメラ1から判定対象物までの距離を求め、距離画像を生成することができるからである。   The configuration is not limited to using one camera 1 and one light 9, and a plurality of cameras 1 may be used. By using a stereo measurement method or the like based on a plurality of multi-value images acquired by a plurality of cameras 1, 1,..., The distance from the camera 1 to the determination target can be obtained and a distance image can be generated. Because.

また、カメラ1、表示装置3、ライト9等は、画像処理装置2と一体化されていても良いし、分離されていても良い。   The camera 1, the display device 3, the light 9, and the like may be integrated with the image processing device 2 or may be separated.

外部制御機器6は、通信手段26を介して接続されている制御機器であり、例えばPLC(プログラマブルロジックコントローラ)等が相当する。ここで外部制御機器6とは、画像処理装置2による画像処理結果に応じて後処理を実行する機器全般を意味している。   The external control device 6 is a control device connected via the communication means 26, and corresponds to, for example, a PLC (programmable logic controller). Here, the external control device 6 means all devices that perform post-processing according to the image processing result by the image processing apparatus 2.

図2は、本発明の実施の形態1に係る画像処理装置2の一構成例を示す機能ブロック図である。図2において、本実施の形態1に係る画像処理装置2は、カメラ1と、ライト9と、画像処理装置2の処理を実行する画像処理部7と、記憶手段23と、画像表示部8とから構成される。   FIG. 2 is a functional block diagram showing a configuration example of the image processing apparatus 2 according to Embodiment 1 of the present invention. In FIG. 2, the image processing apparatus 2 according to the first embodiment includes a camera 1, a light 9, an image processing unit 7 that executes processing of the image processing apparatus 2, a storage unit 23, and an image display unit 8. Consists of

カメラ1は、例えばディジタルカメラであり、判定対象物として例えばフィルム表面を撮像し多値画像を取得して画像処理部7へ出力する。また、ライト9から光を照射することにより、判定対象物又は良品の表面に縞パターンを投影する。カメラ1は、投影された縞パターンを撮像する。画像処理装置2は、カメラ1により撮像された縞パターンを縞パターン画像として取得して、縞パターンの位相解析を実行することにより距離画像を生成し、記憶装置23に記憶する。なお、ライト9の光照射制御は、例えば主制御部21により行うことができる。   The camera 1 is, for example, a digital camera, captures, for example, a film surface as a determination target, acquires a multi-valued image, and outputs it to the image processing unit 7. Moreover, by irradiating light from the light 9, a fringe pattern is projected on the surface of the determination object or a non-defective product. The camera 1 images the projected fringe pattern. The image processing device 2 acquires the fringe pattern captured by the camera 1 as a fringe pattern image, generates a distance image by executing phase analysis of the fringe pattern, and stores the distance image in the storage device 23. The light irradiation control of the light 9 can be performed by the main control unit 21, for example.

画像処理部7は、良品画像取得手段71と、良品距離画像生成手段72と、分布範囲算出手段73と、多値画像取得手段74と、対象距離画像生成手段75と、位置調整手段76と、判断手段77とを含む。また、画像処理部7は、主制御部21、メモリ22、外部I/F等を含んで構成され、良品画像取得手段71、良品距離画像生成手段72、分布範囲算出手段73、多値画像取得手段74、対象距離画像生成手段75、位置調整手段76及び判断手段77の処理動作を制御する。   The image processing unit 7 includes a non-defective image acquisition unit 71, a non-defective product distance image generation unit 72, a distribution range calculation unit 73, a multi-value image acquisition unit 74, a target distance image generation unit 75, a position adjustment unit 76, Determination means 77. The image processing unit 7 includes a main control unit 21, a memory 22, an external I / F, and the like, and includes a non-defective image acquisition unit 71, a non-defective product distance image generation unit 72, a distribution range calculation unit 73, and a multi-value image acquisition. The processing operations of the means 74, the target distance image generating means 75, the position adjusting means 76, and the judging means 77 are controlled.

記憶手段23は、画像メモリとして機能し、カメラ1で撮像した多値画像に関する多値画像データ、ライト9から光を照射することにより投影された縞パターンをカメラ1で撮像した縞パターン画像に基づいて生成した距離画像に関する距離画像データ、及び画像処理部7において位置合わせ、平均値算出等の各種処理を行った後の画像データを随時記憶する。画像データとしてではなく、画素ごとの画素値データとして記憶しても良い。   The storage unit 23 functions as an image memory, and is based on multi-value image data related to the multi-value image captured by the camera 1 and a fringe pattern image captured by the camera 1 by projecting a stripe pattern projected by irradiating light from the light 9. The distance image data relating to the distance image generated in this way and the image data after performing various processes such as alignment and average value calculation in the image processing unit 7 are stored as needed. You may memorize | store as pixel value data for every pixel instead of as image data.

画像表示部8は、コンピュータ用のモニタ等の表示装置3で構成される。画像表示部8は、良品判定の対象となる判定対象物を撮像した多値画像、良品であるか否かの判定結果を、表示装置3の表示画面上に表示させる。すなわち多値画像表示手段81は、画像処理部7の指示に応じた多値画像を表示装置3の表示画面上に表示させ、判定結果表示手段82は、判定対象物が良品であるか否かの判定結果を表示装置3の表示画面上に表示させる。   The image display unit 8 includes a display device 3 such as a computer monitor. The image display unit 8 displays on the display screen of the display device 3 the determination result as to whether or not the multi-valued image obtained by imaging the determination target that is the target of the non-defective determination and the non-defective product. That is, the multi-value image display unit 81 displays a multi-value image corresponding to the instruction of the image processing unit 7 on the display screen of the display device 3, and the determination result display unit 82 determines whether or not the determination target object is a non-defective product. Are displayed on the display screen of the display device 3.

次に、画像処理部7の各構成について説明する。   Next, each configuration of the image processing unit 7 will be described.

良品画像取得手段71は、カメラ1で撮像した、良品に関する複数の多値画像(第一の多値画像)を取得する。すなわち、良品に関する多値画像を複数取得しておくことにより、取得した多値画像の画素ごとに複数の特徴量を抽出することができる。取得した多値画像に関する多値画像データは、記憶手段23の良品画像データ記憶部231に記憶される。   The non-defective product image acquisition unit 71 acquires a plurality of multi-value images (first multi-valued images) related to the non-defective product imaged by the camera 1. That is, by acquiring a plurality of multi-value images related to non-defective products, a plurality of feature amounts can be extracted for each pixel of the acquired multi-value image. Multi-value image data relating to the acquired multi-value image is stored in the non-defective image data storage unit 231 of the storage means 23.

良品距離画像生成手段72は、ライト9から光を照射することにより投影された縞パターンをカメラ1で撮像した縞パターン画像に基づいて、縞パターンの位相解析を実行することにより、良品の表面からカメラ1までの距離に応じて画素ごとに濃淡値を特定した良品距離画像(第一の距離画像)を生成する。図3は、本発明の実施の形態1に係る距離画像を説明するための斜視図及び距離画像の例示図である。   The non-defective product distance image generation means 72 performs the phase analysis of the fringe pattern based on the fringe pattern image obtained by imaging the fringe pattern projected by irradiating light from the light 9 with the camera 1, thereby A non-defective distance image (first distance image) in which the gray value is specified for each pixel according to the distance to the camera 1 is generated. FIG. 3 is a perspective view for explaining the distance image according to the first embodiment of the present invention and an exemplary view of the distance image.

図3(a)は、本発明の実施の形態1に係る距離画像を説明するための斜視図である。図3(a)の例では、半径の異なる2つの円柱を重ね合わせた形状を有するワーク301の上方にカメラ1を設置してある。ワーク301の最上面S1とカメラ1との距離をL1、ワーク301の中段面S2とカメラ1との距離をL2、ワーク301の載置面S3とカメラ1との距離をL3とし、ワークの高さHを(L3−L1)とする。   FIG. 3A is a perspective view for explaining a distance image according to Embodiment 1 of the present invention. In the example of FIG. 3A, the camera 1 is installed above a workpiece 301 having a shape in which two cylinders having different radii are overlapped. The distance between the top surface S1 of the work 301 and the camera 1 is L1, the distance between the middle surface S2 of the work 301 and the camera 1 is L2, and the distance between the mounting surface S3 of the work 301 and the camera 1 is L3. Let H be (L3-L1).

図3(b)は、本発明の実施の形態1に係る距離画像の例示図である。図3(b)に示すように、ワーク301の最上面S1が最も濃く(例えば黒色)、ワーク301の載置面S3が最も薄く(例えば白色)、ワーク301の中段面S2が中間色(例えば灰色)となっている。すなわち、ワーク301とカメラ1との間の距離L1、L2、L3に応じて、最上面S1、中段面S2、載置面S3の順に各画素の濃淡値が小さくなる距離画像を生成することができる。   FIG.3 (b) is an illustration figure of the distance image which concerns on Embodiment 1 of this invention. As shown in FIG. 3B, the uppermost surface S1 of the work 301 is the darkest (for example, black), the mounting surface S3 of the work 301 is the thinnest (for example, white), and the middle surface S2 of the work 301 is an intermediate color (for example, gray) ). That is, according to the distances L1, L2, and L3 between the workpiece 301 and the camera 1, a distance image in which the gray value of each pixel decreases in the order of the top surface S1, the middle surface S2, and the placement surface S3 may be generated. it can.

なお、距離画像の生成方法は、大別すると2つの方式に分類される。一方は、画像を取得するために特段の光照射手段を用いることなく撮像した画像を用いて生成するパッシブ方式であり、他方は、高さ方向の距離を計測するために光を能動的に照射して生成するアクティブ方式である。本実施の形態1では、ライト9から光を照射して生成するアクティブ方式を採用している。   The generation method of the distance image is roughly classified into two methods. One is a passive method that uses images taken without using special light irradiation means to acquire images, and the other is active irradiation with light to measure the distance in the height direction. It is an active method to generate. In the first embodiment, an active method is used in which light is emitted from the light 9 and generated.

二基のカメラを用いるステレオ計測法は、パッシブ方式の代表例である。ステレオ計測法は、二基のカメラを所定の位置に配置するだけで距離画像を生成することができる。   The stereo measurement method using two cameras is a representative example of the passive method. In the stereo measurement method, a distance image can be generated simply by placing two cameras at a predetermined position.

一方、アクティブ方式では、光切断法、パターン投影法が代表例として挙げられる。光切断法は、一基のカメラと一基のライト(光照射手段)とを用いて、ワークに対して線状のレーザ光を照射し、ワーク表面の形状に応じた光の像の歪具合に基づいて、ワークの三次元形状を復元する。   On the other hand, in the active method, a light cutting method and a pattern projection method are given as typical examples. The light cutting method uses a single camera and a single light (light irradiation means) to irradiate a workpiece with a linear laser beam and distort the light image according to the shape of the workpiece surface. To restore the three-dimensional shape of the workpiece.

パターン投影法は、ワークに投影された所定パターン(例えば縞パターン)の形状、位相等をずらして撮像した複数の多値画像を解析することで、ワークの三次元形状を復元する。本実施の形態1では、正弦波縞パターンの位相をずらして少なくとも三枚の多値画像を撮像し、画素ごとに正弦波の位相を求め、ワークの三次元形状を求める位相シフト法を用いている。   The pattern projection method restores the three-dimensional shape of the workpiece by analyzing a plurality of multi-valued images captured by shifting the shape, phase, and the like of a predetermined pattern (for example, a fringe pattern) projected onto the workpiece. In the first embodiment, the phase of the sine wave fringe pattern is shifted to capture at least three multivalued images, the phase of the sine wave is obtained for each pixel, and the phase shift method for obtaining the three-dimensional shape of the workpiece is used. Yes.

もちろん、これに限定されるものではなく、2つの規則的なパターンが合成される場合に生じる一種の空間周波数のうなり現象を利用して、ワークの三次元形状を復元するモアレポトグラフィ法を用いても良いし、光レーダ法、合焦点法、共焦点法、白色光干渉法等であっても良い。   Of course, the present invention is not limited to this, and a moire-potography method is used that restores the three-dimensional shape of the workpiece by using a kind of spatial frequency beat phenomenon that occurs when two regular patterns are synthesized. Alternatively, an optical radar method, a focusing method, a confocal method, a white light interference method, or the like may be used.

図2に戻って、分布範囲算出手段73は、生成した距離画像の画素ごとの濃淡値の、良品判定を行うための分布範囲を算出する。算出した分布範囲に関する情報は、分布範囲の境界を示す関数式、座標値、閾値等として、記憶手段23の分布範囲情報記憶部232に記憶される。   Returning to FIG. 2, the distribution range calculation means 73 calculates a distribution range for performing non-defective product determination of the gray value for each pixel of the generated distance image. Information on the calculated distribution range is stored in the distribution range information storage unit 232 of the storage unit 23 as a function expression indicating the boundary of the distribution range, coordinate values, threshold values, and the like.

多値画像取得手段74は、カメラ1で撮像した、判定対象物に関する多値画像(第二の多値画像)を取得する。対象距離画像生成手段75は、ライト9から光を照射することにより投影された縞パターンをカメラ1で撮像した縞パターン画像に基づいて、縞パターンの位相解析を実行することにより、判定対象物の表面からカメラ1までの距離に応じて画素ごとの濃淡値を特定した対象距離画像(第二の距離画像)を生成する。良品距離画像の生成方法は、良品距離画像生成手段72と同様である。   The multi-value image acquisition unit 74 acquires a multi-value image (second multi-value image) related to the determination target imaged by the camera 1. The target distance image generation means 75 performs the phase analysis of the fringe pattern based on the fringe pattern image obtained by capturing the fringe pattern projected by irradiating light from the light 9 with the camera 1, thereby A target distance image (second distance image) in which the gray value for each pixel is specified according to the distance from the surface to the camera 1 is generated. The method for generating a non-defective distance image is the same as that of the non-defective distance image generating means 72.

位置調整手段76は、生成した判定対象物に関する対象距離画像と、良品に関する良品距離画像との位置合わせを行う。具体的には、良品に関する複数の良品距離画像の平均画像を算出しておき、平均画像との間で位置合わせを行う。距離画像間で位置合わせを行う手段は、周知の技術であれば特に限定されるものではない。例えば、パターンマッチングにより双方の距離画像の特徴点の位置を検出し、一致していると判断することが可能な上限値及び下限値を用いて位置合わせを行っても良い。また、正規化相関等を算出することにより双方の距離画像の一致度を算出し、一致度が所定値より大きくなるよう位置合わせを行っても良い。もちろん、双方の距離画像の輪郭線、面積、重心等を一致させるよう位置合わせを行っても良い。   The position adjusting unit 76 performs alignment between the target distance image related to the generated determination target object and the non-defective distance image related to the non-defective product. Specifically, an average image of a plurality of non-defective product distance images relating to non-defective products is calculated, and alignment with the average image is performed. The means for aligning the distance images is not particularly limited as long as it is a known technique. For example, the positions of feature points of both distance images may be detected by pattern matching, and alignment may be performed using an upper limit value and a lower limit value that can be determined to match. Further, the degree of coincidence between both distance images may be calculated by calculating a normalized correlation or the like, and alignment may be performed so that the degree of coincidence is greater than a predetermined value. Of course, the alignment may be performed so that the contour line, area, center of gravity, etc. of both distance images coincide.

なお、本実施の形態では、位置調整手段76は、生成した判定対象物に関する対象距離画像と、良品に関する良品距離画像との位置合わせを行っているが、特にこれに限定されるものではなく、例えば良品に関する複数の良品距離画像の平均画像を算出する際に複数の良品距離画像間で位置合わせを行っても良い。良品に関する複数の良品距離画像の平均画像を算出する際に複数の良品距離画像間で位置合わせを行う場合、位置調整手段76により位置合わせを行っても良いし、別途、良品距離画像間位置調整手段等を設けて行っても良い。   In the present embodiment, the position adjustment unit 76 performs alignment between the target distance image related to the generated determination target object and the non-defective product distance image related to the non-defective product, but is not particularly limited thereto. For example, when calculating an average image of a plurality of non-defective distance images regarding non-defective products, the alignment may be performed between the non-defective item distance images. When performing an alignment between a plurality of non-defective distance images when calculating an average image of a plurality of non-defective distance images regarding the non-defective products, the alignment may be performed by the position adjusting means 76, or the position adjustment between the non-defective distance images may be performed separately. Means and the like may be provided.

判断手段77は、生成した判定対象物に関する対象距離画像の画素ごとの濃淡値が、算出してある良品に関する良品距離画像の画素ごとの濃淡値の分布範囲に含まれているか否かを判断する。判定対象物に関する対象距離画像の画素ごとの濃淡値が分布範囲に含まれていると判断した場合には、判定対象物が良品であると判定し、含まれていないと判断した場合には、判定対象物が良品ではないと判定する。   The determination unit 77 determines whether the gray value for each pixel of the target distance image related to the generated determination target object is included in the distribution range of the gray value for each pixel of the non-defective distance image calculated for the good product. . If it is determined that the gray value for each pixel of the target distance image related to the determination target is included in the distribution range, the determination target is determined to be non-defective, and if it is determined that it is not included, It is determined that the determination target is not a non-defective product.

図4は、本発明の実施の形態1に係る画像処理装置2の主制御部21の良品情報収集処理の手順を示すフローチャートである。画像処理装置2の主制御部21は、カメラ1で撮像した、良品に関する複数の多値画像(第一の多値画像)を取得する(ステップS401)。主制御部21は、取得した多値画像群の多値画像データを、記憶手段23の良品画像データ記憶部231に記憶する(ステップS402)。   FIG. 4 is a flowchart showing a non-defective information collection process procedure of the main control unit 21 of the image processing apparatus 2 according to the first embodiment of the present invention. The main control unit 21 of the image processing apparatus 2 obtains a plurality of multi-value images (first multi-value images) related to non-defective products captured by the camera 1 (step S401). The main control unit 21 stores the acquired multi-value image data of the multi-value image group in the non-defective product image data storage unit 231 of the storage unit 23 (step S402).

主制御部21は、複数の良品に関して、ライト9から光を照射することにより投影された縞パターンをカメラ1で撮像した縞パターン画像を取得し(ステップS403)、縞パターンの位相解析を実行することにより、良品の表面からカメラ1までの距離に応じて画素ごとに濃淡値を特定した複数の良品距離画像を生成する(ステップS404)。主制御部21は、生成した良品距離画像群の距離画像データを、記憶手段23に記憶する(ステップS405)。   The main control unit 21 obtains a fringe pattern image obtained by photographing the fringe pattern projected by irradiating light from the light 9 with the camera 1 for a plurality of non-defective products (step S403), and executes the phase analysis of the fringe pattern. Thus, a plurality of non-defective product distance images in which the gray value is specified for each pixel according to the distance from the non-defective product surface to the camera 1 are generated (step S404). The main control unit 21 stores the generated distance image data of the non-defective distance image group in the storage unit 23 (step S405).

主制御部21は、生成した良品距離画像に基づいて、良品判定を行うための分布範囲を算出する(ステップS406)。主制御部21は、算出した分布範囲に関する情報を、分布範囲の境界を示す関数式、座標値、閾値等として、記憶手段23の分布範囲情報記憶部232に記憶する(ステップS407)。なお、良品判定を行うための分布範囲を算出する場合、複数の良品距離画像間で位置合わせを行っても良い。   The main control unit 21 calculates a distribution range for performing non-defective product determination based on the generated non-defective product distance image (step S406). The main control unit 21 stores the information on the calculated distribution range in the distribution range information storage unit 232 of the storage unit 23 as a function expression indicating the boundary of the distribution range, coordinate values, threshold values, and the like (step S407). In addition, when calculating the distribution range for performing non-defective product determination, alignment may be performed between a plurality of non-defective product distance images.

図5は、本発明の実施の形態1に係る画像処理装置2の主制御部21の良品判定処理の手順を示すフローチャートである。画像処理装置2の主制御部21は、カメラ1で撮像した、判定対象物に関する多値画像(第二の多値画像)を取得する(ステップS501)。主制御部21は、ライト9から光を照射することにより投影された縞パターンをカメラ1で撮像した縞パターン画像を取得し(ステップS502)、縞パターンの位相解析を実行することにより、判定対象物の表面からカメラ1までの距離に応じて画素ごとに濃淡値を特定した対象距離画像を生成する(ステップS503)。   FIG. 5 is a flowchart showing a non-defective product determination process performed by the main control unit 21 of the image processing apparatus 2 according to the first embodiment of the present invention. The main control unit 21 of the image processing apparatus 2 acquires a multi-value image (second multi-value image) related to the determination target imaged by the camera 1 (step S501). The main control unit 21 obtains a fringe pattern image obtained by imaging the fringe pattern projected by irradiating light from the light 9 with the camera 1 (step S502), and performs a phase analysis of the fringe pattern to thereby determine a determination target. A target distance image specifying a gray value for each pixel according to the distance from the surface of the object to the camera 1 is generated (step S503).

主制御部21は、生成した判定対象物に関する対象距離画像と、良品に関する良品距離画像との位置合わせを行う(ステップS504)。具体的には、良品に関する複数の良品距離画像の平均距離画像を算出しておき、平均距離画像との間で位置合わせを行う。距離画像間で位置合わせを行う手段は、周知の技術であれば特に限定されるものではない。例えば、パターンマッチングにより双方の距離画像の特徴点の位置を検出し、一致していると判断することが可能な上限値及び下限値を用いて位置合わせを行っても良い。また、正規化相関等を算出することにより双方の距離画像の一致度を算出し、一致度が所定値より大きくなるよう位置合わせを行っても良い。もちろん、双方の距離画像の輪郭線、面積、重心等を一致させるよう位置合わせを行っても良い。   The main control unit 21 aligns the target distance image related to the generated determination target object and the non-defective product distance image related to the non-defective product (Step S504). Specifically, an average distance image of a plurality of non-defective product distance images related to the non-defective product is calculated, and alignment is performed with the average distance image. The means for aligning the distance images is not particularly limited as long as it is a known technique. For example, the positions of feature points of both distance images may be detected by pattern matching, and alignment may be performed using an upper limit value and a lower limit value that can be determined to match. Further, the degree of coincidence between both distance images may be calculated by calculating a normalized correlation or the like, and alignment may be performed so that the degree of coincidence is greater than a predetermined value. Of course, the alignment may be performed so that the contour line, area, center of gravity, etc. of both distance images coincide.

主制御部21は、生成した判定対象物に関する対象距離画像の画素ごとの濃淡値が、算出してある良品に関する良品距離画像の画素ごとの濃淡値の分布範囲に含まれているか否かを判断する(ステップS505)。主制御部21が、判定対象物に関する対象距離画像の画素ごとの濃淡値が分布範囲に含まれていると判断した場合(ステップS505:YES)、主制御部21は、判定対象物が良品であると判定し、判定対象物が良品である旨を示す情報を判定結果として、表示装置3の表示画面上に表示する(ステップS506)。   The main control unit 21 determines whether or not the gray value for each pixel of the target distance image regarding the generated determination target object is included in the distribution range of the gray value for each pixel of the non-defective distance image regarding the calculated good product. (Step S505). When the main control unit 21 determines that the grayscale value for each pixel of the target distance image related to the determination target object is included in the distribution range (step S505: YES), the main control unit 21 determines that the determination target object is a non-defective product. It is determined that there is, and information indicating that the determination target is a non-defective product is displayed on the display screen of the display device 3 as a determination result (step S506).

主制御部21が、判定対象物に関する対象距離画像の画素ごとの濃淡値が分布範囲に含まれていないと判断した場合(ステップS505:NO)、主制御部21は、判定対象物が良品ではないと判定し、判定対象物が良品ではない旨を示す情報を判定結果として、表示装置3の表示画面上に表示する(ステップS507)。   When the main control unit 21 determines that the grayscale value for each pixel of the target distance image related to the determination target is not included in the distribution range (step S505: NO), the main control unit 21 determines that the determination target is a non-defective product. The information indicating that the determination target is not a non-defective product is displayed on the display screen of the display device 3 as a determination result (step S507).

以上のように本実施の形態1によれば、第二の距離画像に基づいて、良品であるか否かを判断するので、従来の方法では検出することが困難である判定対象物表面の凹凸を検出することができ、判定対象物を載置した位置のばらつき等により光の当たり方が変化した場合であっても、良品ではないと誤って判定される可能性を低減することが可能となる。   As described above, according to the first embodiment, since it is determined whether or not it is a non-defective product based on the second distance image, the unevenness on the surface of the determination target that is difficult to detect by the conventional method. It is possible to reduce the possibility of erroneously determining that the product is not a good product even if the way the light hits changes due to variations in the position where the determination target is placed, etc. Become.

(実施の形態2)
本発明の実施の形態2に係る画像処理装置の構成は、実施の形態1と同様であることから、同一の符号を付することにより詳細な説明を省略する。本実施の形態2は、複数の特徴量抽出手段を有し、取得した多値画像又は生成した距離画像それぞれの特徴量を抽出することにより、良品であるか否かを判断する点で、実施の形態1とは相違する。
(Embodiment 2)
Since the configuration of the image processing apparatus according to the second embodiment of the present invention is the same as that of the first embodiment, detailed description thereof is omitted by attaching the same reference numerals. The second embodiment has a plurality of feature amount extraction means, and it is implemented by determining whether or not it is a non-defective product by extracting the feature amounts of each of the acquired multi-value image or generated distance image. This is different from the first embodiment.

図6は、本発明の実施の形態2に係る画像処理装置2の一構成例を示す機能ブロック図である。図6において、本実施の形態2に係る画像処理装置2は、実施の形態1と同様、カメラ1と、ライト9と、画像処理装置2の処理を実行する画像処理部7と、記憶手段23と、画像表示部8とから構成される。   FIG. 6 is a functional block diagram showing a configuration example of the image processing apparatus 2 according to Embodiment 2 of the present invention. In FIG. 6, the image processing apparatus 2 according to the second embodiment is similar to the first embodiment in that the camera 1, the light 9, the image processing unit 7 that executes the processing of the image processing apparatus 2, and the storage unit 23. And an image display unit 8.

カメラ1は、例えばディジタルカメラであり、判定対象物として例えばフィルム表面を撮像し多値画像を取得して画像処理部7へ出力する。また、ライト9から光を照射することにより、判定対象物又は良品の表面に縞パターンを投影する。カメラ1は、投影された縞パターンを撮像する。画像処理装置2は、カメラ1により撮像された縞パターンを縞パターン画像として取得して、縞パターンの位相解析を実行することにより距離画像を生成し、記憶装置23に記憶する。   The camera 1 is, for example, a digital camera, captures, for example, a film surface as a determination target, acquires a multi-valued image, and outputs it to the image processing unit 7. Moreover, by irradiating light from the light 9, a fringe pattern is projected on the surface of the determination object or a non-defective product. The camera 1 images the projected fringe pattern. The image processing device 2 acquires the fringe pattern captured by the camera 1 as a fringe pattern image, generates a distance image by executing phase analysis of the fringe pattern, and stores the distance image in the storage device 23.

画像処理部7は、良品画像取得手段71と、良品距離画像生成手段72と、選択受付手段78と、特徴量抽出手段79(選択特徴量抽出手段79c)と、分布範囲算出手段73と、多値画像取得手段74と、対象距離画像生成手段75と、位置調整手段76と、判断手段77とを含む。また、画像処理部7は、主制御部21、メモリ22、外部I/F等を含んで構成され、良品画像取得手段71、良品距離画像生成手段72、選択受付手段78、特徴量抽出手段79(選択特徴量抽出手段79c)、分布範囲算出手段73、多値画像取得手段74、対象距離画像生成手段75、位置調整手段76、及び判断手段77の処理動作を制御する。   The image processing unit 7 includes a non-defective image acquiring unit 71, a non-defective product distance image generating unit 72, a selection receiving unit 78, a feature amount extracting unit 79 (selected feature amount extracting unit 79c), a distribution range calculating unit 73, A value image acquisition unit 74, a target distance image generation unit 75, a position adjustment unit 76, and a determination unit 77 are included. The image processing unit 7 includes a main control unit 21, a memory 22, an external I / F, and the like, and includes a non-defective image obtaining unit 71, a non-defective product distance image generating unit 72, a selection receiving unit 78, and a feature amount extracting unit 79. (Selected feature amount extraction means 79c), distribution range calculation means 73, multi-value image acquisition means 74, target distance image generation means 75, position adjustment means 76, and determination means 77 are controlled.

記憶手段23は、画像メモリとして機能し、カメラ1により撮像した多値画像に関する多値画像データ、ライト9から光を照射することにより投影された縞パターンをカメラ1で撮像した縞パターン画像に基づいて生成した距離画像に関する距離画像データ、及び画像処理部7において位置合わせ、平均値算出等の各種処理を行った後の画像データを随時記憶する。画像データとしてではなく、画素ごとの画素値データとして記憶しても良い。   The storage unit 23 functions as an image memory, and is based on multi-value image data related to the multi-value image captured by the camera 1 and a fringe pattern image captured by the camera 1 with a stripe pattern projected by irradiating light from the light 9. The distance image data relating to the distance image generated in this way and the image data after performing various processes such as alignment and average value calculation in the image processing unit 7 are stored as needed. You may memorize | store as pixel value data for every pixel instead of as image data.

画像表示部8は、コンピュータ用のモニタ等の表示装置3で構成される。画像表示部8は、良品判定の対象となる判定対象物を撮像した多値画像、良品であるか否かの判定結果を、表示装置3の表示画面上に表示させる。すなわち多値画像表示手段81は、画像処理部7の指示に応じた多値画像を表示装置3の表示画面上に表示させ、判定結果表示手段82は、判定対象物が良品であるか否かの判定結果を表示装置3の表示画面上に表示させる。   The image display unit 8 includes a display device 3 such as a computer monitor. The image display unit 8 displays on the display screen of the display device 3 the determination result as to whether or not the multi-valued image obtained by imaging the determination target that is the target of the non-defective determination and the non-defective product. That is, the multi-value image display unit 81 displays a multi-value image corresponding to the instruction of the image processing unit 7 on the display screen of the display device 3, and the determination result display unit 82 determines whether or not the determination target object is a non-defective product. Are displayed on the display screen of the display device 3.

次に、画像処理部7の各構成について説明する。   Next, each configuration of the image processing unit 7 will be described.

良品画像取得手段71は、カメラ1で撮像した、良品に関する複数の多値画像(第一の多値画像)を取得する。すなわち、良品に関する多値画像を複数取得しておくことにより、取得した多値画像の画素ごとに複数の特徴量を抽出することができる。取得した多値画像に関する多値画像データは、記憶手段23の良品画像データ記憶部231に記憶される。   The non-defective product image acquisition unit 71 acquires a plurality of multi-value images (first multi-valued images) related to the non-defective product imaged by the camera 1. That is, by acquiring a plurality of multi-value images related to non-defective products, a plurality of feature amounts can be extracted for each pixel of the acquired multi-value image. Multi-value image data relating to the acquired multi-value image is stored in the non-defective image data storage unit 231 of the storage means 23.

良品距離画像生成手段72は、ライト9から光を照射することにより投影された縞パターンをカメラ1で撮像した縞パターン画像に基づいて、縞パターンの位相解析を実行することにより、良品の表面からカメラ1までの距離に応じて画素ごとに濃淡値を特定した良品距離画像(第一の距離画像)を生成する。   The non-defective product distance image generation means 72 performs the phase analysis of the fringe pattern based on the fringe pattern image obtained by imaging the fringe pattern projected by irradiating light from the light 9 with the camera 1, thereby A non-defective distance image (first distance image) in which the gray value is specified for each pixel according to the distance to the camera 1 is generated.

選択受付手段78は、特徴量を抽出する複数の特徴量抽出手段のうち、少なくとも1つの特徴量抽出手段の選択を受け付ける。すなわち、本実施の形態2では、後述する第一の特徴量抽出手段79a又は第二の特徴量抽出手段79bの選択を受け付ける。なお、第一の特徴量抽出手段79a又は第二の特徴量抽出手段79bのいずれか1つの選択を受け付けても良いし、両方の選択を受け付けても良い。また、その他の特徴量抽出手段を含めた複数の特徴量抽出手段の中から選択を受け付けても良いことは言うまでもない。   The selection receiving unit 78 receives selection of at least one feature amount extracting unit among a plurality of feature amount extracting units that extract feature amounts. That is, in the second embodiment, selection of a first feature quantity extraction unit 79a or a second feature quantity extraction unit 79b described later is accepted. It should be noted that the selection of either one of the first feature quantity extraction means 79a or the second feature quantity extraction means 79b may be accepted, or both selections may be accepted. It goes without saying that selection may be accepted from a plurality of feature quantity extraction means including other feature quantity extraction means.

特徴量抽出手段79は、第一の特徴量抽出手段79aと第二の特徴量抽出手段79bとを備えている。第一の特徴量抽出手段79aは、取得した多値画像又は生成した距離画像の画素ごとに、色成分に関する画素値を特徴量として抽出する。第二の特徴量抽出手段79bは、取得した多値画像又は生成した距離画像の画素ごとに、異なる二方向におけるエッジ強度を特徴量として抽出する。特徴量が色成分に関する画素値である場合、色の相違を検出することができ、特徴量が異なる二方向におけるエッジ強度である場合、輪郭線近傍の欠陥の存在を検出することができる。   The feature quantity extraction unit 79 includes a first feature quantity extraction unit 79a and a second feature quantity extraction unit 79b. The first feature amount extraction unit 79a extracts a pixel value related to a color component as a feature amount for each pixel of the acquired multi-value image or the generated distance image. The second feature amount extraction unit 79b extracts edge strengths in two different directions as feature amounts for each pixel of the acquired multi-valued image or generated distance image. When the feature amount is a pixel value related to a color component, a difference in color can be detected, and when the feature amount is an edge intensity in two different directions, the presence of a defect in the vicinity of the contour line can be detected.

分布範囲算出手段73は、選択を受け付けた特徴量抽出手段79により抽出した特徴量に基づいて、良品判定を行うための分布範囲を算出する。第一の特徴量抽出手段79aの選択を受け付けた場合には、分布範囲算出手段73aにより、第二の特徴量抽出手段79bの選択を受け付けた場合には、分布範囲算出手段73bにより、それぞれ分布範囲を算出する。算出した分布範囲に関する情報は、分布範囲の境界を示す関数式、座標値、閾値等として、記憶手段23の分布範囲情報記憶部232に記憶される。   The distribution range calculation unit 73 calculates a distribution range for performing non-defective product determination based on the feature amount extracted by the feature amount extraction unit 79 that has received the selection. When the selection of the first feature quantity extraction means 79a is accepted, the distribution range calculation means 73a accepts the selection of the second feature quantity extraction means 79b. Calculate the range. Information on the calculated distribution range is stored in the distribution range information storage unit 232 of the storage unit 23 as a function expression indicating the boundary of the distribution range, coordinate values, threshold values, and the like.

多値画像取得手段74は、カメラ1で撮像した、判定対象物に関する多値画像(第二の多値画像)を取得する。対象距離画像生成手段75は、ライト9から光を照射することにより投影された縞パターンをカメラ1で撮像した縞パターン画像に基づいて、縞パターンの位相解析を実行することにより、判定対象物の表面からカメラ1までの距離に応じて画素ごとに濃淡値を特定した対象距離画像(第二の距離画像)を生成する。対象距離画像の生成方法は、良品距離画像生成手段72と同様である。   The multi-value image acquisition unit 74 acquires a multi-value image (second multi-value image) related to the determination target imaged by the camera 1. The target distance image generation means 75 performs the phase analysis of the fringe pattern based on the fringe pattern image obtained by capturing the fringe pattern projected by irradiating light from the light 9 with the camera 1, thereby A target distance image (second distance image) specifying a gray value for each pixel according to the distance from the surface to the camera 1 is generated. The method for generating the target distance image is the same as that for the non-defective distance image generating means 72.

位置調整手段76は、判定対象物に関する多値画像と、良品に関する多値画像との位置合わせ、及び生成した判定対象物に関する対象距離画像と、良品に関する良品距離画像との位置合わせを行う。具体的には、良品に関する複数の多値画像又は良品距離画像の平均画像を算出しておき、平均画像との間で位置合わせを行う。多値画像間又は距離画像間で位置合わせを行う手段は、周知の技術であれば特に限定されるものではない。例えば、パターンマッチングにより双方の多値画像又は距離画像の特徴点の位置を検出し、一致していると判断することが可能な上限値及び下限値を用いて位置合わせを行っても良い。また、正規化相関等を算出することにより双方の多値画像又は距離画像の一致度を算出し、一致度が所定値より大きくなるよう位置合わせを行っても良い。もちろん、双方の多値画像又は距離画像の輪郭線、面積、重心等を一致させるよう位置合わせを行っても良い。   The position adjustment unit 76 aligns the multi-value image related to the determination target and the multi-value image related to the non-defective product, and aligns the target distance image related to the generated determination target and the non-defective product distance image related to the non-defective product. Specifically, an average image of a plurality of multi-value images or non-defective product distance images related to non-defective products is calculated, and alignment with the average image is performed. The means for performing alignment between multi-value images or distance images is not particularly limited as long as it is a known technique. For example, the positions of the feature points of both multi-valued images or distance images may be detected by pattern matching, and alignment may be performed using an upper limit value and a lower limit value that can be determined to match. In addition, the degree of coincidence between both multi-valued images or distance images may be calculated by calculating a normalized correlation or the like, and alignment may be performed so that the degree of coincidence is greater than a predetermined value. Of course, the alignment may be performed so that the contour lines, areas, centroids, and the like of both the multi-valued images or distance images match.

選択特徴量抽出手段79cは、取得した判定対象物に関する多値画像又は生成した対象距離画像の画素ごとに、選択受付手段78にて選択を受け付けた特徴量抽出手段79と同じ特徴量抽出手段により特徴量を抽出する。例えば、第一の特徴量抽出手段79aの選択を受け付けた場合、判定対象物に関する多値画像又は対象距離画像の画素ごとに、色成分に関する画素値を特徴量として抽出し、第二の特徴量抽出手段79bの選択を受け付けた場合、判定対象物に関する多値画像又は対象距離画像の画素ごとに、異なる二方向におけるエッジ強度を特徴量として抽出する。   The selected feature amount extraction unit 79c is the same feature amount extraction unit as the feature amount extraction unit 79 that has received selection by the selection reception unit 78 for each pixel of the acquired multi-value image or the generated target distance image related to the determination object. Extract features. For example, when the selection of the first feature quantity extraction unit 79a is accepted, the pixel value related to the color component is extracted as the feature quantity for each pixel of the multi-value image or the target distance image related to the determination target, and the second feature quantity When the selection of the extraction unit 79b is received, edge strengths in two different directions are extracted as feature amounts for each pixel of the multi-value image or the target distance image related to the determination target.

判断手段77は、取得した判定対象物に関する多値画像又は生成した対象距離画像の画素ごとに、選択を受け付けた特徴量抽出手段79により対応する特徴量を抽出し、抽出した特徴量が、算出してある良品に関する多値画像又は良品距離画像の、同じ特徴量の分布範囲に含まれているか否かを判断する。抽出した特徴量がすべて分布範囲に含まれていると判断した場合には、判定対象物が良品であると判定し、1つでも含まれていないと判断した場合には、判定対象物が良品ではないと判定する。   The determination unit 77 extracts the corresponding feature amount by the feature amount extraction unit 79 that has received the selection for each pixel of the acquired multi-value image or the generated target distance image, and the extracted feature amount is calculated. It is determined whether or not the multi-valued image or the non-defective distance image regarding the non-defective product is included in the same feature amount distribution range. If it is determined that all the extracted feature values are included in the distribution range, it is determined that the determination target object is a non-defective product. If it is determined that none of the extracted feature values is included, the determination target object is a non-defective product. It is determined that it is not.

図7は、本発明の実施の形態2に係る画像処理装置2の主制御部21の良品情報収集処理の手順を示すフローチャートである。画像処理装置2の主制御部21は、カメラ1で撮像した、良品に関する複数の多値画像(第一の多値画像)を取得する(ステップS701)。主制御部21は、取得した多値画像群の多値画像データを、記憶手段23の良品画像データ記憶部231に記憶する(ステップS702)。   FIG. 7 is a flowchart showing a non-defective product information collection process performed by the main control unit 21 of the image processing apparatus 2 according to the second embodiment of the present invention. The main control unit 21 of the image processing apparatus 2 acquires a plurality of multi-value images (first multi-value images) related to non-defective products, which are captured by the camera 1 (step S701). The main control unit 21 stores the acquired multi-value image data of the multi-value image group in the non-defective image data storage unit 231 of the storage unit 23 (step S702).

主制御部21は、複数の良品に関して、ライト9から光を照射することにより投影された縞パターンをカメラ1で撮像した縞パターン画像を取得し(ステップS703)、縞パターンの位相解析を実行することにより、良品の表面からカメラ1までの距離に応じて画素ごとの濃淡値を特定した複数の良品距離画像を生成する(ステップS704)。主制御部21は、生成した良品距離画像群の距離画像データを、記憶手段23に記憶する(ステップS705)。   The main control unit 21 acquires a fringe pattern image obtained by imaging the fringe pattern projected by irradiating light from the light 9 with the camera 1 for a plurality of non-defective products (step S703), and executes phase analysis of the fringe pattern. As a result, a plurality of non-defective product distance images specifying the gray value for each pixel in accordance with the distance from the non-defective product surface to the camera 1 are generated (step S704). The main control unit 21 stores the generated distance image data of the non-defective distance image group in the storage unit 23 (step S705).

主制御部21は、多値画像又は良品距離画像から特徴量を抽出する特徴量抽出手段79の選択を受け付ける(ステップS706)。選択対象となる特徴量抽出手段79は、取得した多値画像又は生成した良品距離画像の画素ごとに、色成分に関する画素値を特徴量として抽出する第一の特徴量抽出手段79a、及び取得した多値画像又は生成した良品距離画像の画素ごとに、異なる二方向におけるエッジ強度を特徴量として抽出する第二の特徴量抽出手段79bである。なお、選択を受け付ける特徴量抽出手段79は一つであっても良いし、複数であっても良い。   The main control unit 21 receives the selection of the feature amount extraction unit 79 that extracts the feature amount from the multi-valued image or the good product distance image (step S706). The feature quantity extraction unit 79 to be selected is a first feature quantity extraction unit 79a that extracts a pixel value related to a color component as a feature quantity for each pixel of the acquired multi-valued image or the generated non-defective distance image, and acquired. The second feature amount extraction unit 79b extracts edge strengths in two different directions as feature amounts for each pixel of the multi-valued image or the generated non-defective distance image. Note that the feature amount extraction unit 79 that accepts selection may be one or plural.

主制御部21は、選択を受け付けた特徴量抽出手段79により、多値画像又は良品距離画像の画素ごとに特徴量を抽出し(ステップS707)、良品判定を行うための分布範囲を抽出した特徴量ごとに算出する(ステップS708a、S708b)。選択を受け付けた特徴量抽出手段79が一つである場合には、例えばステップS708aのみにより、選択を受け付けた特徴量抽出手段79が二つである場合には、ステップS708a、S708bにより、それぞれに対応する分布範囲を、抽出した特徴量ごとに算出する。主制御部21は、算出した分布範囲に関する情報を、分布範囲の境界を示す関数式、座標値、閾値等として、記憶手段23の分布範囲情報記憶部232に記憶する(ステップS709)。   The main control unit 21 extracts the feature amount for each pixel of the multi-valued image or the non-defective distance image by the feature amount extracting unit 79 that has received the selection (step S707), and the feature from which the distribution range for performing the non-defective product determination is extracted. Calculation is performed for each amount (steps S708a and S708b). When there is only one feature amount extraction unit 79 that has received selection, for example, only by step S708a, and when there are two feature amount extraction units 79 that have received selection, steps S708a and S708b respectively. A corresponding distribution range is calculated for each extracted feature amount. The main control unit 21 stores information on the calculated distribution range in the distribution range information storage unit 232 of the storage unit 23 as a function expression indicating the boundary of the distribution range, coordinate values, threshold values, and the like (step S709).

図8は、本発明の実施の形態2に係る画像処理装置2の主制御部21の良品判定処理の手順を示すフローチャートである。画像処理装置2の主制御部21は、カメラ1で撮像した、判定対象物に関する多値画像(第二の多値画像)を取得する(ステップS801)。主制御部21は、取得した判定対象物に関する多値画像と、良品に関する多値画像(第一の多値画像)との位置合わせを行う(ステップS802)。具体的には、良品に関する複数の多値画像の平均画像を算出しておき、平均画像との間で位置合わせを行う。   FIG. 8 is a flowchart showing a non-defective product determination process performed by the main control unit 21 of the image processing apparatus 2 according to the second embodiment of the present invention. The main control unit 21 of the image processing apparatus 2 acquires a multi-value image (second multi-value image) related to the determination target imaged by the camera 1 (step S801). The main control unit 21 aligns the acquired multi-value image related to the determination target object and the multi-value image related to the non-defective product (first multi-value image) (step S802). Specifically, an average image of a plurality of multi-valued images related to non-defective products is calculated, and alignment with the average image is performed.

主制御部21は、ライト9から光を照射することにより投影された縞パターンをカメラ1で撮像した縞パターン画像を取得し(ステップS803)、縞パターンの位相解析を実行することにより、判定対象物の表面からカメラ1までの距離に応じて画素ごとに濃淡値を特定した対象距離画像を生成する(ステップS804)。   The main control unit 21 obtains a fringe pattern image obtained by imaging the fringe pattern projected by irradiating light from the light 9 with the camera 1 (step S803), and performs a phase analysis of the fringe pattern to thereby determine a determination target. A target distance image specifying a gray value for each pixel according to the distance from the surface of the object to the camera 1 is generated (step S804).

主制御部21は、生成した判定対象物に関する対象距離画像と、良品に関する良品距離画像との位置合わせを行う(ステップS805)。具体的には、良品に関する複数の良品距離画像の平均距離画像を算出しておき、平均距離画像との間で位置合わせを行う。   The main control unit 21 performs alignment between the target distance image related to the generated determination target object and the non-defective distance image related to the non-defective product (step S805). Specifically, an average distance image of a plurality of non-defective product distance images related to the non-defective product is calculated, and alignment is performed with the average distance image.

主制御部21は、取得した判定対象物に関する多値画像又は生成した対象距離画像の画素ごとに、選択を受け付けた特徴量抽出手段79により特徴量を抽出する(ステップS806)。例えば、特徴量抽出手段79として色成分に関する画素値を抽出する第一の特徴量抽出手段79aの選択を受け付けた場合には、判定対象物に関する多値画像又は対象距離画像の画素ごとに、色成分に関する画素値を特徴量として抽出し、異なる二方向におけるエッジ強度を抽出する第二の特徴量抽出手段79bの選択を受け付けた場合には、判定対象物に関する多値画像又は対象距離画像の画素ごとに、異なる二方向におけるエッジ強度を特徴量として抽出する。   The main control unit 21 extracts a feature amount by the feature amount extraction unit 79 that has received the selection for each pixel of the acquired multi-value image or the generated target distance image regarding the determination object (step S806). For example, when the selection of the first feature quantity extraction unit 79a that extracts the pixel value related to the color component is accepted as the feature quantity extraction unit 79, the color of each pixel of the multi-value image or the target distance image related to the determination target is determined. When a pixel value related to a component is extracted as a feature quantity and selection of the second feature quantity extraction means 79b that extracts edge strengths in two different directions is accepted, a pixel of a multi-value image or target distance image related to the determination target Each time, edge strengths in two different directions are extracted as feature amounts.

主制御部21は、多値画像又は対象距離画像の画素ごとに抽出した特徴量が、算出してある良品に関する多値画像又は良品距離画像の同じ特徴量に対応する分布範囲に含まれているか否かを判断する(ステップS807)。主制御部21が、抽出した多値画像又は対象距離画像の特徴量がすべて分布範囲に含まれていると判断した場合(ステップS807:YES)、主制御部21は、判定対象物が良品であると判定し、判定対象物が良品である旨を示す情報を判定結果として、表示装置3の表示画面上に表示する(ステップS808)。   Whether the main control unit 21 includes the feature value extracted for each pixel of the multi-value image or the target distance image in the distribution range corresponding to the same feature value of the calculated multi-value image or the good product distance image. It is determined whether or not (step S807). When the main control unit 21 determines that all the feature values of the extracted multi-value image or target distance image are included in the distribution range (step S807: YES), the main control unit 21 determines that the determination target is a non-defective product. It is determined that there is, and information indicating that the determination target is a non-defective product is displayed on the display screen of the display device 3 as a determination result (step S808).

主制御部21が、抽出した多値画像又は対象距離画像の特徴量が1つでも分布範囲に含まれていないと判断した場合(ステップS807:NO)、主制御部21は、判定対象物が良品ではないと判定し、判定対象物が良品ではない旨を示す情報を判定結果として、表示装置3の表示画面上に表示する(ステップS809)。なお、特徴量抽出手段79の選択を複数受け付けた場合には、選択を受け付けた特徴量抽出手段79により抽出された特徴量を用いた良品判定の判定結果のうち、一つでも良品ではないと判定された場合には、判定対象物が良品ではないと判定すれば良い。   When the main control unit 21 determines that even one feature amount of the extracted multi-value image or target distance image is not included in the distribution range (step S807: NO), the main control unit 21 determines that the determination target object is It is determined that the product is not a non-defective product, and information indicating that the determination target is not a good product is displayed on the display screen of the display device 3 as a determination result (step S809). When a plurality of selections by the feature amount extraction unit 79 are received, one of the determination results of the non-defective product determination using the feature amount extracted by the feature amount extraction unit 79 that has received the selection is not a non-defective product. When it is determined, it may be determined that the determination target is not a good product.

また、上述したステップS806では、取得した判定対象物に関する多値画像又は生成した対象距離画像の画素ごとに、選択を受け付けた特徴量抽出手段79により特徴量を抽出しているが、例えば取得した判定対象物に関する多値画像と生成した対象距離画像との双方について、画素ごとに選択を受け付けた特徴量抽出手段79により特徴量を抽出することもできる。つまり、取得した判定対象物に関する多値画像の画素ごとに、選択を受け付けた特徴量抽出手段79により特徴量を抽出するとともに、生成した対象距離画像の画素ごとに、選択を受け付けた特徴量抽出手段79により特徴量を抽出することも可能である(特徴量は同じであっても異なっていても良い)。そして、取得した判定対象物に関する多値画像と生成した対象距離画像とのそれぞれについて、特徴量が分布範囲に含まれているか否かを判断し、取得した判定対象物に関する多値画像に着目したときの第一の良品判定及び生成した対象距離画像に着目したときの第二の良品判定を行う。例えば、いずれの良品判定においても特徴量が分布範囲に含まれていると判断した場合には、最終的に良品であると判定し、いずれか一方の良品判定において特徴量が分布範囲に含まれていないと判断した場合には、最終的に不良品であると判定する。このように、分布範囲算出手段73は、生成した距離画像だけでなく、多値画像の画素ごとの濃淡値の、良品判定を行うための分布範囲を算出しても良く、多値画像の画素ごとの濃淡値が、算出してある良品に関する良品多値画像の画素ごとの濃淡値の分布範囲に含まれているか否かを判断しても良い。なお、最終的に良品であると判定する条件のユーザ設定を受け付ける受付手段(マウス、モニタ等)を設けても良い。   Further, in step S806 described above, the feature amount is extracted by the feature amount extraction unit 79 that has received the selection for each pixel of the acquired multi-value image related to the determination target object or the generated target distance image. With respect to both the multi-value image relating to the determination target object and the generated target distance image, the feature amount can be extracted by the feature amount extraction unit 79 that accepts selection for each pixel. That is, for each pixel of the acquired multi-valued image relating to the determination object, the feature amount is extracted by the feature amount extraction unit 79 that has received the selection, and the feature amount extraction that has received the selection for each pixel of the generated target distance image It is also possible to extract feature quantities by means 79 (feature quantities may be the same or different). Then, for each of the acquired multi-value image related to the determination object and the generated target distance image, it is determined whether or not the feature amount is included in the distribution range, and attention is paid to the acquired multi-value image related to the determination object. The first non-defective product determination and the second non-defective product determination when paying attention to the generated target distance image are performed. For example, if it is determined that the feature amount is included in the distribution range in any non-defective product determination, it is finally determined that the feature amount is in the distribution range, and the feature amount is included in the distribution range in any one non-defective product determination. If it is determined that it is not, it is finally determined that the product is defective. As described above, the distribution range calculation unit 73 may calculate not only the generated distance image but also the distribution range for performing the non-defective product determination of the gray value for each pixel of the multi-value image. It may be determined whether or not each gray value is included in the gray value distribution range for each pixel of the non-defective product multi-valued image regarding the calculated good product. An accepting unit (such as a mouse or a monitor) that accepts user settings for conditions for finally determining that the product is non-defective may be provided.

ここで、第一の特徴量抽出手段79aの選択を受け付けた場合、すなわち抽出される特徴量が、色成分に関する画素値である場合には、良品に関する多値画像又は良品距離画像の画素ごとの色成分に関する画素値の平均値を算出し、算出した色成分に関する画素値の平均値に基づいて、良品に関する多値画像又は良品距離画像の画素ごとに画素値の分布範囲を算出する。図9は、本発明の実施の形態2に係る画像処理装置2の第一の特徴量抽出手段79aの選択を受け付けた場合の分布範囲算出手段73aの機能ブロック図である。   Here, when the selection of the first feature quantity extraction unit 79a is accepted, that is, when the feature quantity to be extracted is a pixel value related to a color component, for each pixel of a multi-value image related to a good product or a good product distance image. An average value of pixel values related to color components is calculated, and a distribution range of pixel values is calculated for each pixel of a multi-value image related to good products or a good product distance image based on the calculated average values of pixel values related to color components. FIG. 9 is a functional block diagram of the distribution range calculation unit 73a when the selection of the first feature amount extraction unit 79a of the image processing apparatus 2 according to Embodiment 2 of the present invention is accepted.

図9に示すように、分布範囲算出手段73aは、画素平均値算出手段731、画素値分布範囲算出手段732を含む。画像処理部7の主制御部21は、画素平均値算出手段731、画素値分布範囲算出手段732の処理動作を制御する。   As shown in FIG. 9, the distribution range calculation unit 73 a includes a pixel average value calculation unit 731 and a pixel value distribution range calculation unit 732. The main control unit 21 of the image processing unit 7 controls processing operations of the pixel average value calculating unit 731 and the pixel value distribution range calculating unit 732.

画素平均値算出手段731は、取得した良品に関する多値画像又は生成した良品距離画像の画素ごとに、色成分に関する画素値、例えば濃淡値の平均値を算出する。画素値分布範囲算出手段732は、算出した色成分に関する画素値、例えば濃淡値の平均値に基づいて、良品に関する多値画像又は良品距離画像の画素ごとに色成分それぞれを座標軸とする多次元空間における画素値の分布範囲を算出する。   The pixel average value calculating unit 731 calculates a pixel value related to a color component, for example, an average value of gray values, for each pixel of the acquired multi-value image related to the good product or the generated good product distance image. The pixel value distribution range calculation means 732 is a multidimensional space in which each color component is a coordinate axis for each pixel of a multi-valued image or a non-defective product distance image related to a non-defective product based on a pixel value related to the calculated color component, for example, an average value of gray values. The distribution range of pixel values at is calculated.

例えば、R成分、G成分、B成分それぞれを座標軸とした三次元座標系を想定する。単純にR成分、G成分、B成分に関する画素値の平均値をそれぞれ算出して、各成分の画素値の分布範囲を算出して良品判定を行う方法では、色成分に基づいて正しく判定することができない場合が生じうる。   For example, assume a three-dimensional coordinate system having R, G, and B components as coordinate axes. In the method of simply calculating the average value of the pixel values related to the R component, G component, and B component, and calculating the distribution range of the pixel values of each component to perform the non-defective product determination, the correct determination is made based on the color components. There are cases where it is not possible.

例えば良品が白に近似する色から濃いグレイまでを含む色、すなわちR成分の画素値が30〜240、G成分の画素値が30〜240、B成分の画素値が30〜240に分布する場合、赤に近い色の判定対象物、例えばR成分の画素値が200、G成分の画素値が50、B成分の画素値が100である判定対象物については、明らかに良品ではないにもかかわらず、各成分に関する画素値の分布範囲に含まれていると判断されるおそれがある。したがって、R成分、G成分、B成分について個別に判断するのではなく、R成分、G成分、B成分を座標軸とした仮想三次元空間における画素値の分布範囲に含まれているか否かに応じて良品であるか否かを判定する。   For example, when the non-defective product is distributed in a color including a color similar to white to dark gray, that is, the R component pixel values are 30 to 240, the G component pixel values are 30 to 240, and the B component pixel values are 30 to 240. A determination object having a color close to red, such as a determination object having an R component pixel value of 200, a G component pixel value of 50, and a B component pixel value of 100, is clearly not a good product. However, it may be determined that the pixel value is included in the distribution range of the pixel values for each component. Therefore, R component, G component, and B component are not individually determined, but depending on whether they are included in the pixel value distribution range in the virtual three-dimensional space with R component, G component, and B component as coordinate axes. Judge whether it is a good product.

図10は、本発明の実施の形態2に係る画像処理装置2の第一の特徴量抽出手段79aの選択を受け付けた場合の、画素値の分布範囲を示す例示図である。図10では、複数の良品に関する多値画像又は良品距離画像に基づいて、各色成分の画素値をR成分、G成分、B成分を互いに直交する座標軸とした三次元空間に点60、60、・・・としてプロットしている。そして、各色成分の画素値の平均値Avを算出して、算出した平均値Avを中心として、三次元空間に良品判定を行うための分布範囲61を算出している。   FIG. 10 is an exemplary diagram showing a distribution range of pixel values when selection by the first feature quantity extraction unit 79a of the image processing apparatus 2 according to Embodiment 2 of the present invention is accepted. In FIG. 10, on the basis of a multi-value image or a non-defective distance image regarding a plurality of non-defective products, points 60, 60,... In a three-dimensional space having pixel values of each color component as R, G, and B components orthogonal to each other. Plotted as. Then, an average value Av of pixel values of each color component is calculated, and a distribution range 61 for performing non-defective product determination in a three-dimensional space is calculated around the calculated average value Av.

例えば判定対象物の多値画像又は対象距離画像の画素ごとの各色成分に関する画素値をプロットした点62、63では、点63の方が平均値Avから離れている。しかし、点63は分布範囲61内であるのに対し、点62は分布範囲61の外側にプロットされている。したがって、点63としてプロットされた判定対象物は良品であると判定され、点62としてプロットされた判定対象物は良品ではないと判定される。   For example, at points 62 and 63 where pixel values relating to each color component of each pixel of the multi-value image or the target distance image of the determination target are plotted, the point 63 is farther from the average value Av. However, the point 63 is within the distribution range 61, whereas the point 62 is plotted outside the distribution range 61. Therefore, the determination target object plotted as the point 63 is determined to be non-defective, and the determination target object plotted as the point 62 is determined to be non-defective.

分布範囲61の算出方法は特に限定されるものではない。例えば空間距離であるユークリッド距離を用いても良いし、マハラノビス距離を用いても良い。以下、マハラノビス距離を用いる場合について説明する。   The calculation method of the distribution range 61 is not particularly limited. For example, a Euclidean distance that is a spatial distance may be used, or a Mahalanobis distance may be used. Hereinafter, a case where the Mahalanobis distance is used will be described.

まず、画素ごとの色成分に関する画素値のマハラノビス距離DM は、三次元座標軸、すなわち図10の例ではR軸方向、G軸方向及びB軸方向における画素ごとの画素ベクトルx(r、g、b)の平均値をそれぞれ平均値ベクトルμi (rバー、gバー、bバー)、分散共分散行列の逆行列をΣi -1 とした場合、ベクトル行列式を用いて(式1)のように算出することができる。 First, the Mahalanobis distance D M of the pixel value related to the color component for each pixel is the pixel vector x (r, g, The average value of b) is the average value vector μ i (r bar, g bar, b bar), and the inverse matrix of the covariance matrix is Σ i −1. In this case, it can be calculated as (Equation 1) using a vector determinant.

Figure 0005684505
Figure 0005684505

(式1)において、λj は固有値であり、ベクトルφj は固有値λj に対応した固有ベクトルである。すなわち(式1)で算出するマハラノビス距離DM は、点x(r、g、b)と分布範囲61の重心(平均値)との距離を、固有ベクトルφj 方向成分に分解し、固有ベクトルφj 方向成分を分散λj で正規化した距離と言える。なお、(式1)におけるiは分布の区別を示しており、上述した計算では分布範囲61が1つであることから特段の意味を有してはいない。 In (Expression 1), λ j is an eigenvalue, and the vector φ j is an eigenvector corresponding to the eigenvalue λ j . That is, the Mahalanobis distance D M calculated by (Equation 1) is obtained by decomposing the distance between the point x (r, g, b) and the center of gravity (average value) of the distribution range 61 into eigenvector φ j direction components, and eigenvector φ j It can be said that the direction component is normalized by the variance λ j . Note that i in (Equation 1) indicates the distinction of the distribution, and the above calculation does not have a special meaning because the distribution range 61 is one.

仮想三次元空間であることから、(式1)において、n=3であり、固有値λj 、固有ベクトルφj はそれぞれ3個であり、固有ベクトルφj も三次元の行列となる。すなわち、分散共分散行列Σi は、(式2)のように表すことができる。 Since it is a virtual three-dimensional space, in (Expression 1), n = 3, there are three eigenvalues λ j and eigenvectors φ j , and the eigenvector φ j is also a three-dimensional matrix. That is, the variance-covariance matrix Σ i can be expressed as (Equation 2).

Figure 0005684505
Figure 0005684505

(式2)において、Vは分散を表しており、R成分、G成分、B成分それぞれの分散は(式3)により求めることができる。   In (Expression 2), V represents the dispersion, and the dispersion of each of the R component, the G component, and the B component can be obtained by (Expression 3).

Figure 0005684505
Figure 0005684505

また、(式2)において、Covは共分散を表しており、R成分とG成分との共分散、R成分とB成分との共分散、G成分とB成分との共分散は、それぞれ(式4)により求めることができる。   In (Expression 2), Cov represents covariance, and the covariance between the R component and the G component, the covariance between the R component and the B component, and the covariance between the G component and the B component are ( It can be obtained from equation 4).

Figure 0005684505
Figure 0005684505

(式4)の分母及び分子にnを乗算して変形することで、(式5)を得る。   (Formula 5) is obtained by multiplying n by the denominator and numerator of (Formula 4).

Figure 0005684505
Figure 0005684505

(式5)から、良品に関する多値画像又は良品距離画像に基づいて、画素ごとに、色成分に関する画素値の総和(平均値)、色成分に関する画素値の二乗和、及び二組ずつの色成分の画素値を乗算した値の総和を算出することにより、分散共分散行列Σi を求めることができることがわかる。色成分に関する画素値の総和(平均値)、色成分に関する画素値の二乗和、及び二組ずつの色成分の画素値を乗算した値の総和は、良品画像データ記憶部231に記憶しておき、良品であると判定する分布範囲61を算出する。 From (Equation 5), based on the multi-value image or the non-defective distance image regarding the non-defective product, the sum (average value) of the pixel values regarding the color component, the square sum of the pixel values regarding the color component, and two sets of colors for each pixel. It can be seen that the variance-covariance matrix Σ i can be obtained by calculating the sum of the values obtained by multiplying the component pixel values. The sum total of pixel values related to color components (average value), the sum of squares of pixel values related to color components, and the sum of values obtained by multiplying pixel values of two sets of color components are stored in the non-defective image data storage unit 231. The distribution range 61 for determining that the product is non-defective is calculated.

次に、判定対象物に関する多値画像又は距離画像の画素ごとの色成分に関する画素値について、(式1)で算出されるマハラノビス距離DM 、すなわち分布範囲61の重心から色成分に関する画素値までの距離を、分布範囲61の重心から色成分に関する画素値に向かう方向における分布範囲61の境界と重心との距離で正規化した値が、所定値より大きい場合には、画素値は分布範囲61に含まれていない。したがって、色が良品範囲を超えて変化したことを示しているので、良品ではないと判定することができる。 Next, regarding the pixel value related to the color component for each pixel of the multivalued image or the distance image related to the determination object, the Mahalanobis distance D M calculated by (Equation 1), that is, from the center of gravity of the distribution range 61 to the pixel value related to the color component. Is normalized by the distance between the boundary of the distribution range 61 and the center of gravity in the direction from the center of gravity of the distribution range 61 to the pixel value relating to the color component, and the pixel value is greater than the predetermined value. Not included. Therefore, since the color has changed beyond the non-defective range, it can be determined that the color is not good.

別の判定方法として、例えば仮想的な楕円球のような形状の範囲(以下、楕円球範囲)の重心から判定対象物に関する多値画像又は対象距離画像の画素ごとの画素値までの距離であるユークリッド距離を算出し、算出したユークリッド距離が、楕円球範囲の重心から判定対象物に関する多値画像又は対象距離画像の画素ごとの画素値に向かう方向における楕円球範囲の境界と重心との距離に基づく所定値より小さいか否かで相互相関分布範囲に含まれているか否かを判断する。ユークリッド距離を用いることにより、分布広がりの大小により感度が大きく変化することなく良品として判定される相互相関分布範囲から外れている度合いを算出することが可能となる。   As another determination method, for example, a distance from the center of gravity of a range of a shape like a virtual ellipsoid (hereinafter referred to as an elliptical sphere range) to a pixel value for each pixel of the multivalued image or target distance image related to the determination target. The Euclidean distance is calculated, and the calculated Euclidean distance is the distance between the center of gravity of the elliptic sphere range and the center of gravity in the direction from the centroid of the elliptic sphere range to the pixel value for each pixel of the multi-valued image or target distance image regarding the determination target. It is determined whether or not it is included in the cross-correlation distribution range based on whether or not it is smaller than a predetermined value. By using the Euclidean distance, it is possible to calculate the degree of deviating from the cross-correlation distribution range determined as non-defective without the sensitivity greatly changing due to the size of the distribution spread.

また、分布範囲61を楕円球範囲に限定する必要はなく、分布範囲61を内接する直方体形状の範囲を仮想的に算出しても良い。   Further, it is not necessary to limit the distribution range 61 to an elliptical sphere range, and a rectangular parallelepiped-shaped range inscribed in the distribution range 61 may be calculated virtually.

図11は、本発明の実施の形態2に係る画像処理装置2の主制御部21の、第一の特徴量抽出手段79aの選択を受け付けた場合の、分布範囲算出処理の手順を示すフローチャートである。斯かる処理は、図7のステップS708aに相当する。   FIG. 11 is a flowchart showing the procedure of the distribution range calculation process when the main control unit 21 of the image processing apparatus 2 according to Embodiment 2 of the present invention receives selection of the first feature quantity extraction unit 79a. is there. Such processing corresponds to step S708a in FIG.

図11において、画像処理装置2の主制御部21は、良品に関する複数の多値画像又は良品距離画像に基づいて算出して、良品画像データ記憶部231に記憶してある、多値画像又は良品距離画像の画素ごとの色成分に関する画素値の総和(平均値)、色成分に関する画素値の二乗和、及び二組ずつの色成分に関する画素値を乗算した値の総和を読み出し(ステップS1101)、画素ごとの色成分に関する画素値の分散共分散行列Σiを作成する(ステップS1102)。すなわち、(式2)に示す分散共分散行列Σi を作成する。 In FIG. 11, the main control unit 21 of the image processing apparatus 2 calculates based on a plurality of multi-value images or non-defective distance images regarding non-defective products and stores them in the non-defective image data storage unit 231. Read out the sum of pixel values related to the color components for each pixel of the distance image (average value), the sum of squares of the pixel values related to the color components, and the sum of the values multiplied by the pixel values related to two sets of color components (step S1101), A variance / covariance matrix Σ i of pixel values relating to color components for each pixel is created (step S1102). That is, the variance-covariance matrix Σ i shown in (Expression 2) is created.

主制御部21は、分散共分散行列Σi の固有値λj 、固有ベクトルφj を算出し(ステップS1103)、分布範囲に関する分布範囲情報として分布範囲情報記憶部232へ記憶する(ステップS1104)。 The main control unit 21 calculates the eigenvalue λ j and eigenvector φ j of the variance-covariance matrix Σ i (step S1103), and stores them in the distribution range information storage unit 232 as distribution range information related to the distribution range (step S1104).

そして、図8のステップS807における分布範囲に含まれているか否かの判断は、取得した判定対象物に関する多値画像又は生成した対象距離画像の画素ごとの特徴量として、色成分に関する画素値を算出し、(式1)にて算出することができるマハラノビス距離DM が所定値よりも大きい場合には分布範囲61に含まれていないと判断し、良品ではないと判定することができる。 The determination as to whether or not the image is included in the distribution range in step S807 in FIG. 8 is performed by using a pixel value related to a color component as a feature value for each pixel of the acquired multi-value image or the generated target distance image. When the Mahalanobis distance D M that can be calculated and calculated by (Equation 1) is larger than a predetermined value, it is determined that it is not included in the distribution range 61, and it can be determined that it is not a non-defective product.

次に、第二の特徴量抽出手段79bの選択を受け付けた場合、すなわち抽出される特徴量が、異なる二方向におけるエッジ強度である場合には、良品に関する多値画像又は距離画像の画素ごとの異なる二方向におけるエッジ強度の平均値を算出し、算出した平均値を中心として、良品に関する多値画像又は良品距離画像の画素ごとに、異なる二方向にエッジ強度の相互相関分布範囲を算出する。図12は、本発明の実施の形態2に係る画像処理装置2の第二の特徴量抽出手段79bの選択を受け付けた場合の分布範囲算出手段73bの機能ブロック図である。   Next, when the selection of the second feature quantity extraction unit 79b is accepted, that is, when the feature quantity to be extracted is the edge strength in two different directions, the multi-value image or the distance image for each non-defective product is obtained for each pixel. An average value of edge intensities in two different directions is calculated, and a cross-correlation distribution range of edge intensities in two different directions is calculated for each pixel of the multi-valued image or non-defective product distance image regarding the non-defective product with the calculated average value as the center. FIG. 12 is a functional block diagram of the distribution range calculation unit 73b when the selection of the second feature amount extraction unit 79b of the image processing apparatus 2 according to Embodiment 2 of the present invention is accepted.

図12に示すように、分布範囲算出手段73bは、方向別エッジ強度算出手段734、エッジ強度平均値算出手段735、及びエッジ強度分布範囲算出手段736を含む。画像処理部7の主制御部21は、方向別エッジ強度算出手段734、エッジ強度平均値算出手段735、及びエッジ強度分布範囲算出手段736の処理動作を制御する。   As shown in FIG. 12, the distribution range calculation unit 73b includes a direction-specific edge strength calculation unit 734, an edge strength average value calculation unit 735, and an edge strength distribution range calculation unit 736. The main control unit 21 of the image processing unit 7 controls processing operations of the direction-specific edge intensity calculating unit 734, the edge intensity average value calculating unit 735, and the edge intensity distribution range calculating unit 736.

方向別エッジ強度算出手段734は、取得した良品に関する多値画像又は生成した良品距離画像の画素ごとの異なる二方向におけるエッジ強度を算出する。エッジ強度を算出する方向は特に限定されるものではないが、本実施の形態2では、異なる二方向である二次元画像の行方向及び列方向について、それぞれエッジ強度を算出する。具体的にはソーベルフィルタで用いる3×3のウインドウテンプレートを用いて、行方向及び列方向のエッジ強度を算出すれば良い。   The direction-specific edge strength calculation means 734 calculates edge strengths in two different directions for each pixel of the acquired multi-value image or the generated good product distance image. Although the direction in which the edge strength is calculated is not particularly limited, in the second embodiment, the edge strength is calculated for each of the row direction and the column direction of the two-dimensional image which are two different directions. Specifically, the edge intensity in the row direction and the column direction may be calculated using a 3 × 3 window template used in the Sobel filter.

エッジ強度平均値算出手段735は、算出した画素ごとの異なる二方向におけるエッジ強度に基づいて、良品に関する多値画像又は良品距離画像の画素ごとに、異なる二方向におけるエッジ強度の平均値を算出する。   The edge strength average value calculation means 735 calculates an average value of edge strengths in two different directions for each pixel of the multi-valued image or the non-defective distance image regarding the non-defective product based on the calculated edge strengths in two different directions for each pixel. .

エッジ強度分布範囲算出手段736は、算出した平均値を中心として、良品に関する多値画像又は良品距離画像の画素ごとに、異なる二方向におけるエッジ強度の相互相関分布範囲を算出する。   The edge intensity distribution range calculation means 736 calculates the cross-correlation distribution range of the edge intensity in two different directions for each pixel of the multi-valued image or the non-defective distance image regarding the non-defective product with the calculated average value as the center.

図13は、本発明の実施の形態2に係る画像処理装置2の所定の画素ごとの異なる二方向におけるエッジ強度の相互相関分布範囲の例示図である。図13では、二次元画像における行方向のエッジ強度exをX軸、列方向のエッジ強度eyをY軸としている。   FIG. 13 is an exemplary diagram of a cross-correlation distribution range of edge strengths in two different directions for each predetermined pixel of the image processing apparatus 2 according to Embodiment 2 of the present invention. In FIG. 13, the edge strength ex in the row direction in the two-dimensional image is taken as the X axis, and the edge strength ey in the column direction is taken as the Y axis.

エッジ強度平均値算出手段735により、良品に関する多値画像又は良品距離画像の画素ごとに、二次元画像における行方向のエッジ強度exの平均値及び列方向のエッジ強度eyの平均値が算出されているので、良品に関する多値画像又は良品距離画像の画素ごとのエッジ強度の平均値ベクトルEAVE は、エッジ角度θを傾斜角とする直線上に位置する。そして、例えば取得した複数の良品に関する多値画像(第一の多値画像)又は生成した複数の良品に関する良品距離画像(第一の距離画像)の画素ごとのエッジ強度のばらつきが大きい場合であって、エッジ方向がほぼ揃っているときには、良品に関する多値画像又は良品距離画像のエッジ強度の平均値ベクトルEAVE を長軸及び短軸が交差する点を中心とした仮想的な楕円領域として相互相関分布領域91を算出する。したがって、判定対象物に関する多値画像又は対象距離画像の画素ごとのエッジ強度を算出して、同一の画素について、二次元画像における行方向のエッジ強度ex及び列方向のエッジ強度eyをプロットしたエッジ点92が、相互相関分布範囲91に含まれているか否かを判断することにより、判定対象物が良品であるか否かを判定することができる。 The edge strength average value calculation means 735 calculates the average value of the edge strength ex in the row direction and the average value of the edge strength ey in the column direction in the two-dimensional image for each pixel of the multi-value image or the good product distance image related to the good product. Therefore, the average value vector E AVE of the edge strength for each pixel of the multi-value image or the non-defective distance image regarding the non-defective product is located on a straight line having the edge angle θ as the inclination angle. For example, this is a case where there is a large variation in edge intensity for each pixel of the acquired multi-value image (first multi-value image) related to a plurality of non-defective products or the generated good-quality distance image (first distance image) related to a plurality of non-defective products. When the edge directions are almost aligned, the average value vector E AVE of the edge strengths of the multi-valued image or the good-quality distance image for the non-defective product is mutually displayed as a virtual elliptical area centered on the point where the major axis and the minor axis intersect. A correlation distribution region 91 is calculated. Therefore, the edge strength for each pixel of the multi-value image or the target distance image related to the determination target is calculated, and the edge strength ex in the row direction and the edge strength ey in the column direction in the two-dimensional image are plotted for the same pixel. By determining whether or not the point 92 is included in the cross-correlation distribution range 91, it can be determined whether or not the determination target is a non-defective product.

相互相関分布範囲91の算出方法は特に限定されるものではない。例えば空間距離であるユークリッド距離を用いても良いし、マハラノビス距離を用いても良い。以下、マハラノビス距離を用いる場合について説明する。   The calculation method of the cross-correlation distribution range 91 is not particularly limited. For example, a Euclidean distance that is a spatial distance may be used, or a Mahalanobis distance may be used. Hereinafter, a case where the Mahalanobis distance is used will be described.

この場合、図6に示す判断手段77の距離算出手段70は、分布範囲の重心、例えば図13の例では仮想的な楕円領域である相互相関分布範囲91の重心(中心点)から判定対象物に関する多値画像又は対象距離画像の画素ごとのエッジ点(特徴量)までの距離を、重心からエッジ点(特徴量)に向かう方向における相互相関分布範囲91の境界と重心との距離で正規化したマハラノビス距離を算出する。   In this case, the distance calculation means 70 of the determination means 77 shown in FIG. 6 determines the object to be determined from the centroid of the distribution range, for example, the centroid (center point) of the cross-correlation distribution range 91 which is a virtual elliptical area in the example of FIG. Normalize the distance to the edge point (feature amount) for each pixel of the multi-valued image or target distance image with respect to the boundary and the centroid of the cross-correlation distribution range 91 in the direction from the centroid to the edge point (feature amount) Calculate the Mahalanobis distance.

画素ごとのエッジ強度のマハラノビス距離DM
は、異なる二方向、すなわち図13の例ではX軸方向及びY軸方向における画素ごとのエッジ強度ベクトルx(ex 、ey )の平均値をそれぞれ平均値ベクトルμi (ex バー、ey バー)、分散共分散行列の逆行列をΣi -1 とした場合、ベクトル行列式を用いて(式6)のように算出することができる。
Mahalanobis distance D M of edge intensity for each pixel
Is two different directions, i.e. the average value of each average value vector μ i (e x bar in the example of FIG. 13 X-axis direction and Y each pixel in the direction of the edge intensity vector x (e x, e y) , e y bar), and the inverse of the variance-covariance matrix Σ i -1 In this case, it can be calculated as (Expression 6) using a vector determinant.

Figure 0005684505
Figure 0005684505

(式6)において、λj は固有値であり、ベクトルφj は固有値λj に対応した固有ベクトルである。すなわち(式6)で算出するマハラノビス距離DM は、点x(ex 、ey )と相互相関分布範囲91の重心(平均値)との距離を、固有ベクトルφj 方向成分に分解し、固有ベクトルφj 方向成分を分散λj で正規化した距離と言える。なお、(式6)におけるiは分布の区別を示しており、上述した計算では相互相関分布範囲91が1つであることから特段の意味を有してはいない。 In (Expression 6), λ j is an eigenvalue, and vector φ j is an eigenvector corresponding to the eigenvalue λ j . That Mahalanobis distance D M is calculated by (Equation 6), the point x (e x, e y) the distance between the center of gravity of the cross-correlation distribution range 91 (average value), and degraded eigenvector phi j direction component, eigenvector It can be said that the φ j direction component is normalized by the variance λ j . Note that i in (Equation 6) indicates the distinction of the distribution, and since the cross correlation distribution range 91 is one in the above calculation, it does not have any special meaning.

図10とは異なり、異なる二方向の二次元空間であることから、(式6)において、n=2であり、固有値λj 、固有ベクトルφj はそれぞれ2個であり、固有ベクトルφj も二次元の行列となる。すなわち、分散共分散行列Σi は、(式7)のように表すことができる。 Unlike FIG. 10, since it is a two-dimensional space in two different directions, in (Equation 6), n = 2, eigenvalue λ j and eigenvector φ j are two, and eigenvector φ j is also two-dimensional. It becomes the matrix of. That is, the variance-covariance matrix Σ i can be expressed as (Equation 7).

Figure 0005684505
Figure 0005684505

(式7)において、Vは分散を表しており、X軸方向のエッジ強度、Y軸方向のエッジ強度それぞれの分散は(式8)により求めることができる。   In (Expression 7), V represents the dispersion, and the dispersion of the edge strength in the X-axis direction and the edge strength in the Y-axis direction can be obtained by (Expression 8).

Figure 0005684505
Figure 0005684505

また、(式7)において、Covは共分散を表しており、X軸方向のエッジ強度とY軸方向のエッジ強度との共分散は、(式9)により求めることができる。   In (Expression 7), Cov represents covariance, and the covariance between the edge strength in the X-axis direction and the edge strength in the Y-axis direction can be obtained by (Expression 9).

Figure 0005684505
Figure 0005684505

(式9)から、良品に関する多値画像又は良品距離画像に基づいて、画素ごとに、異なる二方向におけるエッジ強度の総和(平均値)、異なる二方向におけるエッジ強度の二乗和、及び異なる二方向におけるエッジ強度を互いに乗算した値の総和を算出することにより、分散共分散行列Σi を求めることができることがわかる。異なる二方向におけるエッジ強度の総和(平均値)、異なる二方向におけるエッジ強度の二乗和、及び異なる二方向におけるエッジ強度を互いに乗算した値の総和は、良品画像データ記憶部231に記憶しておき、良品であると判定する相互相関分布範囲91を算出する。 From (Equation 9), based on a multi-value image or a non-defective distance image regarding a non-defective product, for each pixel, the sum (average value) of edge strengths in two different directions, the square sum of edge strengths in two different directions, and two different directions It can be seen that the variance-covariance matrix Σ i can be obtained by calculating the total sum of the values obtained by multiplying the edge intensities at. The sum (average value) of edge strengths in two different directions, the square sum of edge strengths in two different directions, and the sum of values obtained by multiplying the edge strengths in two different directions are stored in the non-defective image data storage unit 231. The cross-correlation distribution range 91 for determining that the product is non-defective is calculated.

次に、判定対象物に関する多値画像又は対象距離画像の画素ごとの異なる二方向(X軸方向及びY軸方向)におけるエッジ強度について、(式6)で算出されるマハラノビス距離DM 、すなわち相互相関分布範囲91の重心からエッジ点(特徴量)までの距離を、相互相関分布範囲91の重心からエッジ点(特徴量)に向かう方向における相互相関分布範囲91の境界と重心との距離で正規化した値が、所定値より大きい場合には、エッジ点は相互相関分布範囲91に含まれていない。したがって、エッジ角度が良品範囲を超えて変動したことを示しているので輪郭線の形状が大きく変化したと判断することができ、良品ではないと判定することができる。 Next, regarding the edge strength in two different directions (X-axis direction and Y-axis direction) for each pixel of the multivalued image or the target distance image related to the determination target, the Mahalanobis distance D M calculated by (Expression 6), that is, mutual The distance from the centroid of the correlation distribution range 91 to the edge point (feature) is normalized by the distance between the boundary of the cross-correlation distribution range 91 and the centroid in the direction from the centroid of the cross-correlation distribution range 91 to the edge point (feature). If the converted value is larger than the predetermined value, the edge point is not included in the cross-correlation distribution range 91. Therefore, since the edge angle indicates that it has fluctuated beyond the non-defective range, it can be determined that the shape of the contour has changed greatly, and it can be determined that the edge is not non-defective.

図14は、本発明の実施の形態2に係る画像処理装置2の主制御部21の、第二の特徴量抽出手段79bの選択を受け付けた場合の、分布範囲算出処理の手順を示すフローチャートである。斯かる処理は、図7のステップS708bに相当する。   FIG. 14 is a flowchart showing the procedure of the distribution range calculation process when the main control unit 21 of the image processing apparatus 2 according to Embodiment 2 of the present invention accepts the selection of the second feature quantity extraction unit 79b. is there. Such processing corresponds to step S708b in FIG.

図14において、画像処理装置2の主制御部21は、良品に関する多値画像又は良品距離画像に基づいて算出して記憶してある、多値画像又は良品距離画像の画素ごとの異なる二方向におけるエッジ強度の総和(平均値)、異なる二方向におけるエッジ強度の二乗和、及び異なる二方向におけるエッジ強度を互いに乗算した値の総和を読み出し(ステップS1401)、画素ごとの異なる二方向におけるエッジ強度の分散共分散行列Σiを作成する(ステップS1402)。 In FIG. 14, the main control unit 21 of the image processing apparatus 2 calculates and stores a multi-value image or a good product distance image based on a multi-value image or a good product distance image related to a good product in two different directions for each pixel. The sum of the edge strengths (average value), the sum of squares of the edge strengths in two different directions, and the sum of values obtained by multiplying the edge strengths in the two different directions are read (step S1401), and the edge strengths in the two different directions for each pixel are read. A variance-covariance matrix Σ i is created (step S1402).

主制御部21は、分散共分散行列Σi の固有値λj 、固有ベクトルφj を算出し(ステップS1403)、相互相関分布範囲に関する分布範囲情報として分布範囲情報記憶部232へ記憶する(ステップS1404)。 The main control unit 21 calculates the eigenvalue λ j and eigenvector φ j of the variance-covariance matrix Σ i (step S1403), and stores them in the distribution range information storage unit 232 as distribution range information related to the cross-correlation distribution range (step S1404). .

そして、図8のステップS807における分布範囲に含まれているか否かの判断は、取得した判定対象物に関する多値画像又は生成した対象距離画像の画素ごとの特徴量として、異なる二方向におけるエッジ強度を算出し、(式6)にて算出することができるマハラノビス距離DM が所定値よりも大きい場合には相互相関分布範囲91に含まれていないと判断し、良品ではないと判定することができる。 Then, the determination as to whether or not the image is included in the distribution range in step S807 in FIG. 8 is based on the edge strength in two different directions as the feature value for each pixel of the obtained multi-value image or the generated target distance image. When the Mahalanobis distance D M that can be calculated by (Equation 6) is larger than a predetermined value, it is determined that it is not included in the cross-correlation distribution range 91, and it is determined that it is not a good product. it can.

図15は、本発明の実施の形態2に係る画像処理装置2の主制御部21の、第二の特徴量抽出手段79bの選択を受け付けた場合の、良品判定処理の手順を示すフローチャートである。画像処理装置2の主制御部21は、カメラ1で撮像した、判定対象物に関する多値画像を取得する(ステップS1501)。主制御部21は、取得した判定対象物に関する多値画像と、良品に関する多値画像との位置合わせを行う(ステップS1502)。具体的には、良品に関する複数の多値画像の平均画像を算出しておき、平均画像との間で位置合わせを行う。多値画像間で位置合わせを行う手段は、周知の技術であれば特に限定されるものではない。   FIG. 15 is a flowchart showing a non-defective product determination process when the main control unit 21 of the image processing apparatus 2 according to the second embodiment of the present invention receives selection of the second feature quantity extraction unit 79b. . The main control unit 21 of the image processing apparatus 2 acquires a multi-value image related to the determination target imaged by the camera 1 (step S1501). The main control unit 21 aligns the acquired multi-value image related to the determination target object and the multi-value image related to the non-defective product (step S1502). Specifically, an average image of a plurality of multi-valued images related to non-defective products is calculated, and alignment with the average image is performed. The means for aligning the multi-value images is not particularly limited as long as it is a well-known technique.

主制御部21は、ライト9から光を照射することにより投影された縞パターンをカメラ1で撮像した縞パターン画像を取得し(ステップS1503)、縞パターンの位相解析を実行することにより、判定対象物の表面からカメラ1までの距離に応じて画素ごとに濃淡値を特定した対象距離画像を生成する(ステップS1504)。   The main control unit 21 obtains a fringe pattern image obtained by imaging the fringe pattern projected by irradiating light from the light 9 with the camera 1 (step S1503), and executes a phase analysis of the fringe pattern to determine a determination target. A target distance image specifying a gray value for each pixel according to the distance from the surface of the object to the camera 1 is generated (step S1504).

主制御部21は、生成した判定対象物に関する対象距離画像と、良品に関する良品距離画像との位置合わせを行う(ステップS1505)。具体的には、良品に関する複数の良品距離画像の平均距離画像を算出しておき、平均距離画像との間で位置合わせを行う。   The main control unit 21 performs alignment between the target distance image related to the generated determination target object and the non-defective distance image related to the non-defective product (step S1505). Specifically, an average distance image of a plurality of non-defective product distance images related to the non-defective product is calculated, and alignment is performed with the average distance image.

主制御部21は、取得した判定対象物に関する多値画像又は生成した対象距離画像の画素ごとに、異なる二方向におけるエッジ強度を算出する(ステップS1506)。エッジ強度を算出する方向は特に限定されるものではないが、上述した方法と同様、異なる二方向である二次元画像における列方向及び行方向について、それぞれエッジ強度を算出する。   The main control unit 21 calculates edge strengths in two different directions for each pixel of the acquired multi-value image or the generated target distance image related to the determination object (step S1506). The direction in which the edge strength is calculated is not particularly limited, but the edge strength is calculated for each of the column direction and the row direction in the two-dimensional image which are two different directions, as in the method described above.

主制御部21は、算出した判定対象物に関する多値画像又は対象距離画像の画素ごとのエッジ強度が、算出した良品に関する多値画像又は良品距離画像の画素ごとのエッジ強度の相互相関分布範囲に含まれているか否かを判断する(ステップS1507)。主制御部21が、算出したエッジ強度がすべて相互相関分布範囲に含まれていると判断した場合(ステップS1507:YES)、主制御部21は、判定対象物が良品であると判定し、判定対象物が良品である旨を示す情報を判定結果として、表示装置3の表示画面上に表示する(ステップS1508)。主制御部21が、算出したエッジ強度が1つでも相互相関分布範囲に含まれていないと判断した場合(ステップS1507:NO)、主制御部21は、判定対象物が良品ではないと判定し、判定対象物が良品ではない旨を示す情報を判定結果として、表示装置3の表示画面上に表示する(ステップS1509)。   The main control unit 21 determines that the calculated edge intensity for each pixel of the multi-value image or the target distance image related to the determination target object is within the cross-correlation distribution range of the edge strength for each pixel of the calculated multi-value image or the good distance image. It is determined whether it is included (step S1507). When the main control unit 21 determines that all of the calculated edge intensities are included in the cross-correlation distribution range (step S1507: YES), the main control unit 21 determines that the determination target is a non-defective product and determines Information indicating that the object is a non-defective product is displayed on the display screen of the display device 3 as a determination result (step S1508). When the main control unit 21 determines that even one calculated edge strength is not included in the cross-correlation distribution range (step S1507: NO), the main control unit 21 determines that the determination target is not a non-defective product. Then, information indicating that the determination target is not a good product is displayed on the display screen of the display device 3 as a determination result (step S1509).

なお、上述した実施の形態2では、相互相関分布範囲が、仮想的な楕円領域である場合について説明しているが、特に楕円領域に限定されるものではない。   In the second embodiment described above, the case where the cross-correlation distribution range is a virtual elliptical area has been described. However, the present invention is not particularly limited to the elliptical area.

以上のように本実施の形態2によれば、取得した判定対象物に関する多値画像(第二の多値画像)又は対象距離画像(第二の距離画像)の性状に応じて、良品であるか否かを判定する基礎となる特徴量を抽出する手段を少なくとも一つ選択することができるので、適切な特徴量抽出手段79を選択することにより、欠陥が輪郭線近傍に生じている場合であっても欠陥の存在を検出することができ、色の相違についても高い感度で検出することが可能となる。例えば選択を受け付けた特徴量抽出手段79が、色成分に関する画素値を特徴量として抽出する場合、色の相違による濃淡のばらつきの存在を検出することができ、選択を受け付けた特徴量抽出手段79が異なる二方向におけるエッジ強度を特徴量として抽出する場合、輪郭線近傍の欠陥の存在を検出することができる。   As described above, according to the second embodiment, the multi-value image (second multi-value image) or the target distance image (second distance image) related to the acquired determination target object is a non-defective product. Since at least one means for extracting a feature quantity as a basis for determining whether or not a defect has occurred in the vicinity of the contour line by selecting an appropriate feature quantity extraction means 79 can be selected. Even if it exists, the presence of a defect can be detected, and a difference in color can be detected with high sensitivity. For example, when the feature amount extraction unit 79 that has received a selection extracts a pixel value related to a color component as a feature amount, it is possible to detect the presence or absence of shading variation due to a color difference, and the feature amount extraction unit 79 that has received a selection. When edge strengths in two different directions are extracted as feature amounts, it is possible to detect the presence of a defect near the contour line.

なお、本発明は上記実施例に限定されるものではなく、本発明の趣旨の範囲内であれば多種の変更、改良等が可能である。異なる二方向を二次元画像の行方向及び列方向としているが、特に限定されるものではなく、互いに直交する二方向であれば足り、色成分についてもR成分、G成分、B成分だけではなく、シアン成分、マゼンタ成分、イエロー成分であっても良い。   The present invention is not limited to the above-described embodiments, and various changes and improvements can be made within the scope of the present invention. Two different directions are used as the row direction and the column direction of the two-dimensional image. However, the two directions are not particularly limited, and the two directions are orthogonal to each other. The color components are not limited to the R component, the G component, and the B component. , A cyan component, a magenta component, and a yellow component.

1 カメラ(撮像手段)
2 画像処理装置
3 表示装置(画像表示手段)
4 可搬型記録媒体
5 コンピュータプログラム
6 外部制御機器
7 画像処理部
8 画像表示部
9 ライト(光照射手段)
21 主制御部
22 メモリ
23 記憶手段
24 入力手段
25 出力手段
26 通信手段
27 補助記憶手段
28 内部バス
1 Camera (imaging means)
2 Image processing device 3 Display device (image display means)
4 portable recording medium 5 computer program 6 external control device 7 image processing unit 8 image display unit 9 light (light irradiation means)
21 Main Control Unit 22 Memory 23 Storage Unit 24 Input Unit 25 Output Unit 26 Communication Unit 27 Auxiliary Storage Unit 28 Internal Bus

Claims (11)

判定対象物を撮像した多値画像を、良品に関する多値画像群と比較して良品判定を行う画像処理装置において、
撮像手段で撮像された、良品に関する複数の第一の多値画像を取得する良品画像取得手段と、
取得した第一の多値画像の画素ごとに、前記撮像手段からの距離を濃淡値に変換した第一の距離画像を生成する良品距離画像生成手段と、
前記第一の多値画像の画素ごとに、色成分に関する画素値を特徴量として抽出する第一の特徴量抽出手段と、前記第一の多値画像又は前記第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度を特徴量として抽出する第二の特徴量抽出手段とを少なくとも含む複数の特徴量抽出手段のうち、少なくとも1つの特徴量抽出手段の選択を受け付ける選択受付手段と、
取得した第一の多値画像及び生成した前記第一の距離画像の少なくとも一方の画素ごとの濃淡値の、良品判定を行うための分布範囲を算出する分布範囲算出手段と、
判定対象物に関する第二の多値画像を取得する多値画像取得手段と、
取得した第二の多値画像の画素ごとに、前記撮像手段からの距離を濃淡値に変換した第二の距離画像を生成する対象距離画像生成手段と、
取得した第二の多値画像及び生成した前記第二の距離画像の少なくとも一方の画素ごとの濃淡値が対応する前記分布範囲に含まれているか否かを判断する判断手段と
を備え、
前記分布範囲算出手段は、前記第一の特徴量抽出手段の選択を受け付けた場合には第一の分布範囲を、前記第二の特徴量抽出手段の選択を受け付けた場合には第二の分布範囲を、それぞれ選択を受け付けた特徴量抽出手段により抽出した特徴量に基づいて算出するようにしてあり、
前記判断手段は、前記第二の多値画像又は前記第二の距離画像の画素ごとに、選択を受け付けた特徴量抽出手段により特徴量を抽出し、抽出された特徴量に対応する前記第一の分布範囲又は前記第二の分布範囲に含まれているか否かを判断するようにしてあることを特徴とする画像処理装置。
In an image processing apparatus that performs a non-defective product determination by comparing a multi-value image obtained by imaging a determination target with a multi-value image group related to a good product,
A non-defective image acquisition means for acquiring a plurality of first multi-value images related to the non-defective product imaged by the imaging means;
A non-defective distance image generating means for generating a first distance image obtained by converting the distance from the imaging means into a gray value for each pixel of the acquired first multi-valued image;
For each pixel of the first multi-valued image, for each pixel of the first multi-valued image or the first distance image, a first feature amount extracting means for extracting a pixel value related to a color component as a feature amount. Selection accepting means for accepting selection of at least one feature quantity extracting means among a plurality of feature quantity extracting means including at least second feature quantity extracting means for extracting edge strengths in two different directions as feature quantities;
The gray value of each at least one pixel of the acquired first multivalued image and generated the first distance image, the distribution range calculation means for calculating a distribution range for performing good judgment,
Multi-valued image acquisition means for acquiring a second multi-valued image related to the determination target;
Target distance image generation means for generating a second distance image obtained by converting the distance from the imaging means into a gray value for each pixel of the acquired second multi-valued image;
Determination means for determining whether or not the gray value for each pixel of at least one pixel of the acquired second multi-valued image and the generated second distance image is included in the corresponding distribution range, and
The distribution range calculation means displays the first distribution range when the selection of the first feature quantity extraction means is accepted, and the second distribution when the selection of the second feature quantity extraction means is accepted. The range is calculated based on the feature amount extracted by the feature amount extraction unit that has accepted the selection,
The determination unit extracts a feature amount by a feature amount extraction unit that has received a selection for each pixel of the second multi-valued image or the second distance image, and the first corresponding to the extracted feature amount An image processing apparatus is characterized in that it is determined whether or not the distribution range is included in the distribution range or the second distribution range.
複数の前記撮像手段を備え、前記良品距離画像生成手段又は前記対象距離画像生成手段は、複数の前記撮像手段で撮像された複数の前記第一の多値画像又は前記第二の多値画像に基づいて前記第一の距離画像又は前記第二の距離画像を生成するようにしてあることを特徴とする請求項1記載の画像処理装置。   The non-defective product distance image generating unit or the target distance image generating unit includes a plurality of the first multi-value images or the second multi-value images captured by the plurality of image capturing units. 2. The image processing apparatus according to claim 1, wherein the first distance image or the second distance image is generated based on the first distance image. 前記撮像手段と、判定対象物に対して光を照射する光照射手段とを備え、前記良品距離画像生成手段又は前記対象距離画像生成手段は、前記撮像手段で撮像された前記第一の多値画像又は前記第二の多値画像、及び照射した光に基づいて前記第一の距離画像又は前記第二の距離画像を生成するようにしてあることを特徴とする請求項1記載の画像処理装置。   The imaging unit and a light irradiation unit that irradiates light to the determination target, wherein the non-defective distance image generation unit or the target distance image generation unit is the first multi-value imaged by the imaging unit. The image processing apparatus according to claim 1, wherein the first distance image or the second distance image is generated based on the image or the second multi-valued image and the irradiated light. . 前記第一の特徴量抽出手段の選択を受け付けた場合、前記分布範囲算出手段は、
前記第一の多値画像の画素ごとに、色成分に関する画素値の平均値を算出する画素平均値算出手段と、
算出した色成分に関する画素値の平均値に基づいて、前記第一の多値画像の画素ごとに、色成分それぞれを座標軸とする多次元空間における画素値の前記第一の分布範囲を算出する画素値分布範囲算出手段と
を有し、
前記判断手段は、前記第二の多値画像の画素ごとに、色成分に関する画素値を算出して、色成分それぞれを座標軸とする多次元空間における画素値の前記第一の分布範囲に含まれているか否かを判断するようにしてあり、
前記第二の特徴量抽出手段の選択を受け付けた場合、前記分布範囲算出手段は、
前記第一の多値画像又は前記第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度を算出する方向別エッジ強度算出手段と、
算出したエッジ強度に基づいて、前記第一の多値画像又は前記第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度の平均値を算出するエッジ強度平均値算出手段と、
算出した平均値を中心として、前記第一の多値画像又は前記第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度の相互相関分布範囲を前記第二の分布範囲として算出するエッジ強度分布範囲算出手段と
を有し、
前記判断手段は、前記第二の多値画像又は前記第二の距離画像の画素ごとに、異なる二方向におけるエッジ強度を算出して、算出したエッジ強度が対応する前記相互相関分布範囲に含まれているか否かを判断するようにしてあることを特徴とする請求項1乃至3のいずれか一項に記載の画像処理装置。
When receiving the selection of the first feature amount extraction unit, the distribution range calculation unit,
Pixel average value calculating means for calculating an average value of pixel values related to color components for each pixel of the first multi-valued image;
Pixels for calculating the first distribution range of pixel values in a multidimensional space with each color component as a coordinate axis for each pixel of the first multi-valued image, based on the average value of the pixel values relating to the calculated color component A value distribution range calculation means, and
The determination means calculates a pixel value related to a color component for each pixel of the second multi-value image, and is included in the first distribution range of pixel values in a multi-dimensional space with each color component as a coordinate axis. To judge whether or not
When receiving the selection of the second feature amount extraction means, the distribution range calculation means,
Direction-specific edge strength calculating means for calculating edge strength in two different directions for each pixel of the first multi-valued image or the first distance image;
Based on the calculated edge strength, for each pixel of the first multi-value image or the first distance image, an edge strength average value calculating means for calculating an average value of edge strengths in two different directions;
Edge strength for calculating the cross-correlation distribution range of edge strengths in two different directions as the second distribution range for each pixel of the first multi-valued image or the first distance image with the calculated average value as the center A distribution range calculation means, and
The determining means calculates edge strengths in two different directions for each pixel of the second multi-valued image or the second distance image, and the calculated edge strengths are included in the corresponding cross-correlation distribution range. 4. The image processing apparatus according to claim 1, wherein the image processing apparatus is configured to determine whether or not the image processing apparatus is present.
前記方向別エッジ強度算出手段は、前記エッジ強度を互いに直交する二方向にて算出するようにしてあることを特徴とする請求項4記載の画像処理装置。   5. The image processing apparatus according to claim 4, wherein the direction-specific edge strength calculating means calculates the edge strength in two directions orthogonal to each other. 前記方向別エッジ強度算出手段は、前記エッジ強度を二次元画像における行方向と列方向との二方向にて算出するようにしてあることを特徴とする請求項5記載の画像処理装置。   6. The image processing apparatus according to claim 5, wherein the direction-specific edge strength calculating means calculates the edge strength in two directions of a row direction and a column direction in a two-dimensional image. 前記エッジ強度分布範囲算出手段は、仮想的な楕円領域として前記相互相関分布範囲を前記第二の分布範囲として算出するようにしてあることを特徴とする請求項4乃至6のいずれか一項に記載の画像処理装置。   7. The edge intensity distribution range calculation means calculates the cross-correlation distribution range as the second distribution range as a virtual ellipse region. The image processing apparatus described. 前記第一の多値画像と前記第二の多値画像との位置合わせ又は前記第一の距離画像と前記第二の距離画像との位置合わせを行う位置調整手段を備えることを特徴とする請求項1乃至7のいずれか一項に記載の画像処理装置。   A position adjustment unit is provided for aligning the first multi-value image and the second multi-value image or aligning the first distance image and the second distance image. Item 8. The image processing apparatus according to any one of Items 1 to 7. 前記選択受付手段が、複数の特徴量抽出手段の選択を受け付けた場合であって、前記判断手段が、選択を受け付けた特徴量抽出手段で抽出された特徴量のうち、いずれかの特徴量がそれぞれの特徴量に対応する前記第一の分布範囲又は前記第二の分布範囲に含まれていないと判断したとき、前記判定対象物は良品ではないと判定するようにしてあることを特徴とする請求項1乃至8のいずれか一項に記載の画像処理装置。   In the case where the selection accepting unit accepts the selection of a plurality of feature amount extracting units, any one of the feature amounts extracted by the feature amount extracting unit that has received the selection by the determining unit is When it is determined that the object is not included in the first distribution range or the second distribution range corresponding to each feature amount, the determination object is determined not to be non-defective. The image processing apparatus according to claim 1. 判定対象物を撮像した多値画像を、良品に関する多値画像群と比較して良品判定を行う画像処理装置で実行することが可能な画像処理方法において、
撮像手段で撮像された、良品に関する複数の第一の多値画像を取得するステップと、
取得した第一の多値画像の画素ごとに、前記撮像手段からの距離を濃淡値に変換した第一の距離画像を生成するステップと、
前記第一の多値画像の画素ごとに、色成分に関する画素値を特徴量として抽出する第一の特徴量抽出手段と、前記第一の多値画像又は前記第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度を特徴量として抽出する第二の特徴量抽出手段とを少なくとも含む複数の特徴量抽出手段のうち、少なくとも1つの特徴量抽出手段の選択を受け付けるステップと、
取得した第一の多値画像及び生成した前記第一の距離画像の少なくとも一方の画素ごとの濃淡値の、良品判定を行うための分布範囲を算出するステップと、
判定対象物に関する第二の多値画像を取得するステップと、
取得した第二の多値画像の画素ごとに、前記撮像手段からの距離を濃淡値に変換した第二の距離画像を生成するステップと、
取得した第二の多値画像及び生成した前記第二の距離画像の少なくとも一方の画素ごとの濃淡値が対応する前記分布範囲に含まれているか否かを判断するステップと
を含み、
前記第一の特徴量抽出手段の選択を受け付けた場合には第一の分布範囲を、前記第二の特徴量抽出手段の選択を受け付けた場合には第二の分布範囲を、それぞれ選択を受け付けた特徴量抽出手段により抽出した特徴量に基づいて算出し、
前記第二の多値画像又は前記第二の距離画像の画素ごとに、選択を受け付けた特徴量抽出手段により特徴量を抽出し、抽出された特徴量に対応する前記第一の分布範囲又は前記第二の分布範囲に含まれているか否かを判断することを特徴とする画像処理方法。
In an image processing method that can be executed by an image processing apparatus that performs a non-defective product determination by comparing a multi-value image obtained by imaging a determination target with a multi-value image group related to a non-defective product,
Acquiring a plurality of first multi-valued images related to non-defective products imaged by the imaging means;
Generating a first distance image obtained by converting the distance from the imaging unit into a gray value for each pixel of the acquired first multi-valued image;
For each pixel of the first multi-valued image, for each pixel of the first multi-valued image or the first distance image, a first feature amount extracting means for extracting a pixel value related to a color component as a feature amount. Receiving a selection of at least one feature quantity extraction means among a plurality of feature quantity extraction means including at least a second feature quantity extraction means for extracting edge strengths in two different directions as feature quantities;
Calculating the gray value of each at least one pixel of the acquired first multivalued image and generated the first distance image, the distribution range for performing good judgment,
Obtaining a second multi-valued image relating to the determination object;
Generating a second distance image obtained by converting the distance from the imaging unit into a gray value for each pixel of the acquired second multi-valued image;
Determining whether a gray value for each pixel of at least one pixel of the acquired second multi-valued image and the generated second distance image is included in the corresponding distribution range, and
When the selection of the first feature quantity extraction unit is accepted, the selection is accepted, and when the selection of the second feature quantity extraction unit is accepted, the second distribution range is accepted. Calculated based on the feature amount extracted by the feature amount extraction means,
For each pixel of the second multi-value image or the second distance image, a feature amount is extracted by a feature amount extraction unit that has received a selection, and the first distribution range corresponding to the extracted feature amount or the An image processing method comprising determining whether or not the second distribution range is included.
判定対象物を撮像した多値画像を、良品に関する多値画像群と比較して良品判定を行う画像処理装置で実行することが可能なコンピュータプログラムにおいて、
前記画像処理装置を、
撮像手段で撮像された、良品に関する複数の第一の多値画像を取得する良品画像取得手段、
取得した第一の多値画像の画素ごとに、前記撮像手段からの距離を濃淡値に変換した第一の距離画像を生成する良品距離画像生成手段、
前記第一の多値画像の画素ごとに、色成分に関する画素値を特徴量として抽出する第一の特徴量抽出手段と、前記第一の多値画像又は前記第一の距離画像の画素ごとに、異なる二方向におけるエッジ強度を特徴量として抽出する第二の特徴量抽出手段とを少なくとも含む複数の特徴量抽出手段のうち、少なくとも1つの特徴量抽出手段の選択を受け付ける選択受付手段、
取得した第一の多値画像及び生成した前記第一の距離画像の少なくとも一方の画素ごとの濃淡値の、良品判定を行うための分布範囲を算出する分布範囲算出手段、
判定対象物に関する第二の多値画像を取得する多値画像取得手段、
取得した第二の多値画像の画素ごとに、前記撮像手段からの距離を濃淡値に変換した第二の距離画像を生成する対象距離画像生成手段、及び
取得した第二の多値画像及び生成した前記第二の距離画像の少なくとも一方の画素ごとの濃淡値が対応する前記分布範囲に含まれているか否かを判断する判断手段
として機能させ、
前記分布範囲算出手段を、前記第一の特徴量抽出手段の選択を受け付けた場合には第一の分布範囲を、前記第二の特徴量抽出手段の選択を受け付けた場合には第二の分布範囲を、それぞれ選択を受け付けた特徴量抽出手段により抽出した特徴量に基づいて算出する手段として機能させ、
前記判断手段を、前記第二の多値画像又は前記第二の距離画像の画素ごとに、選択を受け付けた特徴量抽出手段により特徴量を抽出し、抽出された特徴量に対応する前記第一の分布範囲又は前記第二の分布範囲に含まれているか否かを判断する手段として機能させることを特徴とするコンピュータプログラム。
In a computer program that can be executed by an image processing apparatus that performs a non-defective product determination by comparing a multi-value image obtained by imaging a determination target with a multi-value image group related to a non-defective product,
The image processing apparatus;
Non-defective image acquisition means for acquiring a plurality of first multi-value images related to non-defective products imaged by the imaging means,
Non-defective distance image generation means for generating a first distance image obtained by converting the distance from the imaging means into a gray value for each pixel of the acquired first multi-valued image,
For each pixel of the first multi-valued image, for each pixel of the first multi-valued image or the first distance image, a first feature amount extracting means for extracting a pixel value related to a color component as a feature amount. Selection accepting means for accepting selection of at least one feature quantity extracting means among a plurality of feature quantity extracting means including at least second feature quantity extracting means for extracting edge strengths in two different directions as feature quantities;
Acquired first gray value of at least every one of the pixels of the multivalued image and the generated the first distance image, the distribution range calculation means for calculating a distribution range for performing good judgment,
Multi-valued image obtaining means for obtaining a second multi-valued image relating to the determination object;
Target distance image generation means for generating a second distance image obtained by converting the distance from the imaging means into a gray value for each pixel of the acquired second multi-valued image; and
Function as a determination means for determining whether or not the gray value for each pixel of at least one pixel of the acquired second multi-valued image and the generated second distance image is included in the corresponding distribution range;
When the selection of the first feature amount extraction unit is accepted, the distribution range calculation unit displays the first distribution range, and when the selection of the second feature amount extraction unit is accepted, the second distribution The range functions as a means for calculating based on the feature amount extracted by the feature amount extraction means that accepts the selection,
The determination unit extracts the feature amount by the feature amount extraction unit that has received selection for each pixel of the second multi-valued image or the second distance image, and the first feature corresponding to the extracted feature amount A computer program that functions as means for determining whether or not the distribution range is included in the second distribution range.
JP2010161125A 2010-07-16 2010-07-16 Image processing apparatus, image processing method, and computer program Expired - Fee Related JP5684505B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010161125A JP5684505B2 (en) 2010-07-16 2010-07-16 Image processing apparatus, image processing method, and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010161125A JP5684505B2 (en) 2010-07-16 2010-07-16 Image processing apparatus, image processing method, and computer program

Publications (2)

Publication Number Publication Date
JP2012021919A JP2012021919A (en) 2012-02-02
JP5684505B2 true JP5684505B2 (en) 2015-03-11

Family

ID=45776311

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010161125A Expired - Fee Related JP5684505B2 (en) 2010-07-16 2010-07-16 Image processing apparatus, image processing method, and computer program

Country Status (1)

Country Link
JP (1) JP5684505B2 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4054188B2 (en) * 2001-11-30 2008-02-27 富士通株式会社 Semiconductor device
JP2014106164A (en) * 2012-11-29 2014-06-09 Mitsubishi Motors Corp Method and apparatus for inspecting fitting state of connector
JP6405124B2 (en) * 2014-06-09 2018-10-17 株式会社キーエンス Inspection device, inspection method, and program
JP6314798B2 (en) * 2014-11-12 2018-04-25 Jfeスチール株式会社 Surface defect detection method and surface defect detection apparatus
JP7037876B2 (en) * 2015-06-26 2022-03-17 コグネックス・コーポレイション Use of 3D vision in automated industrial inspection
US11158039B2 (en) 2015-06-26 2021-10-26 Cognex Corporation Using 3D vision for automated industrial inspection
JP2018112470A (en) * 2017-01-11 2018-07-19 リコーエレメックス株式会社 Inspection system and inspection method
JP2018112471A (en) * 2017-01-11 2018-07-19 リコーエレメックス株式会社 Inspection system and inspection method
JP6530536B2 (en) * 2018-06-20 2019-06-12 株式会社キーエンス Three-dimensional shape measuring apparatus, measurement data processing unit, measurement data processing method, and computer program
JP6585793B2 (en) * 2018-09-18 2019-10-02 株式会社キーエンス Inspection device, inspection method, and program
JP7416071B2 (en) * 2019-08-23 2024-01-17 コニカミノルタ株式会社 Judgment device and judgment program
CN116297524B (en) * 2023-04-07 2023-11-14 苏州矽行半导体技术有限公司 Multi-mode detection method for wafer with image

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006282725A (en) * 2005-03-31 2006-10-19 Kri Inc Silicon-containing new optically active compound
JP4928862B2 (en) * 2006-08-04 2012-05-09 株式会社日立ハイテクノロジーズ Defect inspection method and apparatus
JP2008139074A (en) * 2006-11-30 2008-06-19 Rozefu Technol:Kk Method for detecting defect in image
JP2010146357A (en) * 2008-12-19 2010-07-01 Panasonic Electric Works Co Ltd Method and apparatus for three-dimensional image processing

Also Published As

Publication number Publication date
JP2012021919A (en) 2012-02-02

Similar Documents

Publication Publication Date Title
JP5684505B2 (en) Image processing apparatus, image processing method, and computer program
US10775160B2 (en) System and method for efficient surface measurement using a laser displacement sensor
EP1788345B1 (en) Image processing device and image processing method performing 3d measurement
WO2022052313A1 (en) Calibration method for 3d structured light system, and electronic device and storage medium
JP4885584B2 (en) Rangefinder calibration method and apparatus
JP6506731B2 (en) System and method for scoring clutter used for 3D point cloud matching in vision system
AU2019203928B2 (en) Face location detection
JP4001162B2 (en) Image processing method, image processing program and storage medium therefor, and image processing apparatus
JP6899189B2 (en) Systems and methods for efficiently scoring probes in images with a vision system
US10508995B2 (en) Three-dimensional image inspection device, three-dimensional image inspection method, three-dimensional image inspection program, and computer-readable recording medium and recording equipment
US10771776B2 (en) Apparatus and method for generating a camera model for an imaging system
WO2013061976A1 (en) Shape inspection method and device
JP2007213353A (en) Apparatus for detecting three-dimensional object
KR102073468B1 (en) System and method for scoring color candidate poses against a color image in a vision system
JP5956814B2 (en) Appearance inspection apparatus, appearance inspection method, and computer program
JP7064404B2 (en) Optical displacement meter
TWI538077B (en) Semiconductor process control apparatus and computer program
CN107680125B (en) System and method for automatically selecting three-dimensional alignment algorithm in vision system
WO2015040657A1 (en) Image processing device, image processing method, and image processing program
JP5469532B2 (en) Image processing apparatus, image processing method, and computer program
JP2006010375A (en) Stereoscopic shape measuring method by sem and its device
WO2021024499A1 (en) Reinforcing bar determination device and reinforcing bar determination method
JP5486403B2 (en) Image processing apparatus, image processing method, and computer program
JP2010133744A (en) Defect detection method, and visual inspection device using the same
JP6867766B2 (en) Information processing device and its control method, program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130409

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131126

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131129

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140114

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140722

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140917

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20150113

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150115

R150 Certificate of patent or registration of utility model

Ref document number: 5684505

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees