JP2017076168A - Image processing sensor, image processing method, and computer program - Google Patents

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

Info

Publication number
JP2017076168A
JP2017076168A JP2015201849A JP2015201849A JP2017076168A JP 2017076168 A JP2017076168 A JP 2017076168A JP 2015201849 A JP2015201849 A JP 2015201849A JP 2015201849 A JP2015201849 A JP 2015201849A JP 2017076168 A JP2017076168 A JP 2017076168A
Authority
JP
Japan
Prior art keywords
edge
image processing
image
feature amount
inspection object
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2015201849A
Other languages
Japanese (ja)
Other versions
JP6587894B2 (en
Inventor
広志 匂坂
Hiroshi Kosaka
広志 匂坂
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 JP2015201849A priority Critical patent/JP6587894B2/en
Publication of JP2017076168A publication Critical patent/JP2017076168A/en
Application granted granted Critical
Publication of JP6587894B2 publication Critical patent/JP6587894B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

PROBLEM TO BE SOLVED: To provide an image processing sensor and an image processing method, capable of highly accurately determining whether an inspection object is acceptable or not even when whether the inspection object is acceptable or not is determined according to the magnitude of the number of edge points.SOLUTION: An image processing sensor comprises: imaging means for imaging an inspection object; display means for displaying the image imaged by the imaging means; image processing means for extracting an edge from the image displayed by the display means and performing image processing on the basis of the extracted edge; acceptable/not acceptable determination means for determining whether the inspection object is acceptable or not acceptable on the basis of the processing results of the image processing means; and output means for outputting the determination results of the acceptable/inacceptable determination means to the outside. The image processing means comprises an edge extraction unit 704 which extracts an edge from the image of the imaged inspection object, an amount-of-characteristics calculation unit 705 for calculating an amount of characteristics of an edge pixel constituting the extracted edge, an angle calculation unit 706 for calculating an angle of the extracted edge per pixel; and an amount-of-characteristics correction unit 708 which corrects the calculated amount of characteristics on the basis of the calculated edge angle.SELECTED DRAWING: Figure 7

Description

本発明は、エッジ角度に基づいてエッジ点の個数を補正することで、検査対象物の良否判定を高い精度で行うことができる画像処理センサ、該画像処理センサで実行することが可能な画像処理方法及びコンピュータプログラムに関する。   The present invention corrects the number of edge points on the basis of the edge angle, whereby an image processing sensor capable of performing pass / fail determination of an inspection object with high accuracy, and image processing that can be executed by the image processing sensor The present invention relates to a method and a computer program.

検査対象物の外観検査を実行する場合、生産ライン上を流れてくる検査対象物の表面の画像を撮像し、撮像された画像に基づいて位置ずれの有無、欠陥の有無等の検査を行う。例えば、検査対象物の画像中で抽出された特徴点(エッジ点)の個数の大小、エッジ強度の大小等に基づいて検査対象物の良否判定を行う。   When executing an appearance inspection of an inspection object, an image of the surface of the inspection object flowing on the production line is taken, and the presence / absence of a displacement, the presence / absence of a defect, etc. are inspected based on the taken image. For example, the quality of the inspection object is determined based on the number of feature points (edge points) extracted from the image of the inspection object, the edge strength, and the like.

特許文献1では、エッジ点の個数及びエッジ強度の度数分布に応じてパターンサーチ処理の対象となる特徴点(エッジ点)の抽出するべき個数を指定する画像処理装置が開示されている。エッジ強度の閾値、エッジ点の個数の閾値等を設定するような簡単な設定により、検査対象物の画像の輝度に対してロバストに良否を判定することができる。   Patent Document 1 discloses an image processing apparatus that specifies the number of feature points (edge points) to be extracted according to the number of edge points and the frequency distribution of edge strengths to be extracted. By simple settings such as setting a threshold value for edge strength, a threshold value for the number of edge points, etc., it is possible to determine whether the inspection object is robust or not with respect to the luminance of the image.

特開2007−141222号公報JP 2007-141222 A

特許文献1に開示されている画像処理装置では、画素ごとにエッジの存否を判別して、エッジ点の個数を計数する。しかし、画素ごとにエッジの存否を判別しているので、実際には同一の長さを有するエッジであっても、エッジの方向(角度)によっては計数されたエッジ点の個数が異なるおそれがあった。そのため、エッジ点の個数の大小により検査対象物の良否判定を行う処理では、同一の検査対象物であっても、撮像する姿勢によってエッジ点の個数が変動するので、良否判定を高い精度で行うことが困難であるという問題点があった。   In the image processing apparatus disclosed in Patent Document 1, the presence or absence of an edge is determined for each pixel, and the number of edge points is counted. However, since the presence or absence of an edge is determined for each pixel, the number of counted edge points may differ depending on the direction (angle) of the edge even if the edges actually have the same length. It was. For this reason, in the process of determining the quality of an inspection object based on the number of edge points, the number of edge points varies depending on the posture of imaging even for the same inspection object, so the quality determination is performed with high accuracy. There was a problem that it was difficult.

本発明は、上記問題点に鑑みてなされたものであり、エッジ点の個数の大小で検査対象物の良否判定を行う場合であっても、高い精度で良否判定を行うことができる画像処理センサ、該画像処理センサで実行することが可能な画像処理方法及びコンピュータプログラムを提供することを目的とする。   The present invention has been made in view of the above problems, and is an image processing sensor that can perform pass / fail determination with high accuracy even when determining pass / fail of an inspection object based on the number of edge points. Another object of the present invention is to provide an image processing method and a computer program that can be executed by the image processing sensor.

上記目的を達成するために第1発明に係る画像処理センサは、検査対象物を撮像する撮像手段と、該撮像手段で撮像された画像を表示する表示手段と、該表示手段で表示された画像からエッジを抽出して、抽出されたエッジに基づいて画像処理を行う画像処理手段と、該画像処理手段の処理結果に基づいて、検査対象物の良否判定を行う良否判定手段と、該良否判定手段の判定結果を外部へ出力する出力手段とを有する画像処理センサにおいて、前記画像処理手段は、撮像された検査対象物の画像からエッジを抽出するエッジ抽出手段と、抽出されたエッジを構成するエッジ画素の特徴量を算出する特徴量算出手段と、抽出されたエッジ角度を画素ごとに算出する角度算出手段と、算出されたエッジ角度に基づいて、算出された特徴量を補正する特徴量補正手段とを備えることを特徴とする。   In order to achieve the above object, an image processing sensor according to a first aspect of the present invention includes an image pickup means for picking up an inspection object, a display means for displaying an image picked up by the image pickup means, and an image displayed by the display means. An image processing means for extracting an edge from the image and performing image processing based on the extracted edge, a quality determination means for determining pass / fail of an inspection object based on a processing result of the image processing means, and the quality determination In the image processing sensor having an output means for outputting the determination result of the means to the outside, the image processing means constitutes an edge extraction means for extracting an edge from the image of the imaged inspection object, and the extracted edge Feature quantity calculation means for calculating the feature quantity of the edge pixel, angle calculation means for calculating the extracted edge angle for each pixel, and correction of the calculated feature quantity based on the calculated edge angle Characterized in that it comprises a characteristic quantity correcting means that.

また、第2発明に係る画像処理センサは、第1発明において、エッジの幅を細線化する細線化手段を備え、前記特徴量算出手段は、細線化されたエッジを構成するエッジ画素の個数を算出することを特徴とする。   An image processing sensor according to a second aspect of the present invention is the image processing sensor according to the first aspect, further comprising thinning means for thinning the width of the edge, wherein the feature amount calculating means calculates the number of edge pixels constituting the thinned edge. It is characterized by calculating.

また、第3発明に係る画像処理センサは、第1又は第2発明において、エッジ角度ごとの補正係数を記憶しておき、前記特徴量補正手段は、記憶されているエッジ角度に基づいて特定された補正係数を用いて、算出された特徴量を補正することを特徴とする。   An image processing sensor according to a third aspect of the present invention stores the correction coefficient for each edge angle in the first or second aspect, and the feature amount correction means is specified based on the stored edge angle. The calculated feature value is corrected using the correction coefficient.

また、第4発明に係る画像処理センサは、第1又は第2発明において、エッジ角度に基づいて補正係数を算出する計算式を記憶しておき、前記特徴量補正手段は、記憶されている計算式に基づいて、算出された特徴量を補正することを特徴とする。   An image processing sensor according to a fourth aspect of the present invention stores a calculation formula for calculating a correction coefficient based on an edge angle in the first or second aspect, and the feature amount correction unit stores the calculation. The calculated feature value is corrected based on the equation.

また、第5発明に係る画像処理センサは、第1乃至第4発明のいずれか1つにおいて、良否判定の基準となる基準画像の指定を受け付ける指定受付手段と、指定を受け付けた基準画像に対して、エッジの抽出領域を設定する抽出領域設定手段とを備え、前記画像処理手段は、設定されたエッジの抽出領域内の特徴量を算出することを特徴とする。   According to a fifth aspect of the present invention, in any one of the first to fourth aspects of the invention, a designation accepting unit that accepts designation of a reference image that serves as a reference for pass / fail judgment, and a reference image that has received the designation. Extraction region setting means for setting an edge extraction region, and the image processing means calculates a feature amount in the set edge extraction region.

また、第6発明に係る画像処理センサは、第1乃至第5発明のいずれか1つにおいて、エッジ角度の頻度分布を記憶しておき、前記特徴量補正手段は、エッジ角度の頻度を減少させることを特徴とする。   An image processing sensor according to a sixth aspect of the present invention is the image processing sensor according to any one of the first to fifth aspects, wherein the frequency distribution of the edge angle is stored, and the feature amount correction unit decreases the frequency of the edge angle. It is characterized by that.

次に、上記目的を達成するために第7発明に係る画像処理方法は、検査対象物を撮像する撮像手段と、該撮像手段で撮像された画像を表示する表示手段とを備え、該表示手段で表示された画像からエッジを抽出して、抽出されたエッジに基づいて画像処理を行い、画像処理の処理結果に基づいて、検査対象物の良否判定を行い、良否判定の判定結果を外部へ出力する画像処理センサで実行することが可能な画像処理方法において、前記画像処理センサは、撮像された検査対象物の画像からエッジを抽出するステップと、抽出されたエッジを構成するエッジ画素の特徴量を算出するステップと、抽出されたエッジ角度を画素ごとに算出するステップと、算出されたエッジ角度に基づいて、算出された特徴量を補正するステップとを含むことを特徴とする。   Next, in order to achieve the above object, an image processing method according to a seventh aspect of the present invention includes an imaging unit that images an inspection object, and a display unit that displays an image captured by the imaging unit. The edge is extracted from the image displayed in step, the image processing is performed based on the extracted edge, the quality of the inspection target is determined based on the processing result of the image processing, and the determination result of the quality determination is sent to the outside. In the image processing method that can be executed by the output image processing sensor, the image processing sensor includes a step of extracting an edge from the captured image of the inspection object, and a feature of the edge pixel that constitutes the extracted edge A step of calculating the amount, a step of calculating the extracted edge angle for each pixel, and a step of correcting the calculated feature amount based on the calculated edge angle. To.

また、第8発明に係る画像処理方法は、第7発明において、前記画像処理センサは、エッジの幅を細線化するステップを含み、細線化されたエッジを構成するエッジ画素の個数を算出することを特徴とする。   The image processing method according to an eighth aspect of the present invention is the image processing method according to the seventh aspect, wherein the image processing sensor includes the step of thinning the width of the edge, and calculates the number of edge pixels constituting the thinned edge. It is characterized by.

また、第9発明に係る画像処理方法は、第7又は第8発明において、前記画像処理センサは、エッジ角度ごとの補正係数を記憶しておき、記憶されているエッジ角度に基づいて特定された補正係数を用いて、算出された特徴量を補正することを特徴とする。   The image processing method according to the ninth invention is the image processing method according to the seventh or eighth invention, wherein the image processing sensor stores a correction coefficient for each edge angle and is specified based on the stored edge angle. A feature is that the calculated feature value is corrected using a correction coefficient.

また、第10発明に係る画像処理方法は、第7又は第8発明において、前記画像処理センサは、エッジ角度に基づいて補正係数を算出する計算式を記憶しておき、記憶されている計算式に基づいて、算出された特徴量を補正することを特徴とする。   In the image processing method according to the tenth invention, in the seventh or eighth invention, the image processing sensor stores a calculation formula for calculating a correction coefficient based on an edge angle, and the stored calculation formula Based on the above, the calculated feature amount is corrected.

また、第11発明に係る画像処理方法は、第7乃至第10発明のいずれか1つにおいて、前記画像処理センサは、良否判定の基準となる基準画像の指定を受け付けるステップと、指定を受け付けた基準画像に対して、エッジの抽出領域を設定するステップとを含み、設定されたエッジの抽出領域内の特徴量を算出することを特徴とする。   An image processing method according to an eleventh aspect of the present invention is the image processing method according to any one of the seventh to tenth aspects, wherein the image processing sensor receives a designation of a reference image serving as a reference for pass / fail judgment, and a designation. A step of setting an edge extraction region for the reference image, and calculating a feature amount in the set edge extraction region.

また、第12発明に係る画像処理方法は、第7乃至第11発明のいずれか1つにおいて、前記画像処理センサは、エッジ角度の頻度分布を記憶しておき、エッジ角度の頻度を減少させることを特徴とする。   An image processing method according to a twelfth aspect of the present invention is the image processing method according to any one of the seventh to eleventh aspects, wherein the image processing sensor stores an edge angle frequency distribution to reduce the edge angle frequency. It is characterized by.

次に、上記目的を達成するために第13発明に係るコンピュータプログラムは、検査対象物を撮像する撮像手段と、該撮像手段で撮像された画像を表示する表示手段と、該表示手段で表示された画像からエッジを抽出して、抽出されたエッジに基づいて画像処理を行う画像処理手段と、該画像処理手段の処理結果に基づいて、検査対象物の良否判定を行う良否判定手段と、該良否判定手段の判定結果を外部へ出力する出力手段とを有する画像処理センサで実行することが可能なコンピュータプログラムにおいて、前記画像処理手段を、撮像された検査対象物の画像からエッジを抽出するエッジ抽出手段、抽出されたエッジを構成するエッジ画素の特徴量を算出する特徴量算出手段、抽出されたエッジ角度を画素ごとに算出する角度算出手段、及び算出されたエッジ角度に基づいて、算出された特徴量を補正する特徴量補正手段として機能させることを特徴とする。   Next, in order to achieve the above object, a computer program according to the thirteenth invention is displayed on an imaging means for imaging an inspection object, a display means for displaying an image captured by the imaging means, and a display means. An image processing means for extracting an edge from the obtained image and performing image processing based on the extracted edge; a quality determination means for determining quality of the inspection object based on a processing result of the image processing means; In the computer program that can be executed by an image processing sensor having an output unit that outputs the determination result of the pass / fail determination unit to the outside, the image processing unit is configured to extract an edge from an image of the imaged inspection object Extraction means, feature quantity calculation means for calculating feature quantities of edge pixels constituting the extracted edge, angle calculation means for calculating the extracted edge angle for each pixel, Based on the fine calculated edge angle, characterized in that to function as a feature quantity correcting means for correcting the characteristic amount calculated.

第1発明、第7発明及び第13発明では、検査対象物の画像からエッジを抽出し、抽出されたエッジを構成するエッジ画素の特徴量を算出する。抽出されたエッジ角度を画素ごとに算出し、算出されたエッジ角度に基づいて、算出された特徴量を補正する。補正された特徴量に基づいて検査対象物の良否判定を行うことにより、撮像された検査対象物の傾斜角度が相違している場合であっても、同じ長さのエッジであれば略同一のエッジ点の個数として計数することができ、検査対象物の良否判定を高い精度で行うことが可能となる。   In the first invention, the seventh invention, and the thirteenth invention, an edge is extracted from the image of the inspection object, and the feature amount of the edge pixel constituting the extracted edge is calculated. The extracted edge angle is calculated for each pixel, and the calculated feature amount is corrected based on the calculated edge angle. By performing pass / fail determination of the inspection object based on the corrected feature amount, even if the inclination angle of the imaged inspection object is different, the edges having the same length are substantially the same. The number of edge points can be counted, and the quality of the inspection object can be determined with high accuracy.

第2発明及び第8発明では、エッジの幅を細線化し、細線化されたエッジを構成するエッジ画素の個数を算出するので、エッジ点の個数の計数誤差がより小さくなり、検査対象物の良否判定をより高い精度で行うことが可能となる。   In the second and eighth inventions, since the edge width is thinned and the number of edge pixels constituting the thinned edge is calculated, the counting error of the number of edge points becomes smaller and the quality of the inspection object is good. The determination can be performed with higher accuracy.

第3発明及び第9発明では、エッジ角度ごとの補正係数を記憶しておき、記憶されているエッジ角度に基づいて特定された補正係数を用いて、算出された特徴量を補正するので、抽出されたエッジ角度に応じて特徴量を補正することができ、撮像された検査対象物の傾斜角度が相違している場合であっても、同じ長さのエッジであれば略同一のエッジ点の個数として計数することができ、検査対象物の良否判定を高い精度で行うことが可能となる。   In the third and ninth inventions, the correction coefficient for each edge angle is stored, and the calculated feature amount is corrected using the correction coefficient specified based on the stored edge angle. The feature amount can be corrected according to the measured edge angle, and even if the inclination angle of the imaged inspection object is different, the edges of the same length can be obtained as long as the edges have the same length. It can be counted as a number, and it is possible to determine the quality of an inspection object with high accuracy.

第4発明及び第10発明では、エッジ角度に基づいて補正係数を算出する計算式を記憶し、記憶されている計算式に基づいて、算出された特徴量を補正するので、抽出されたエッジ角度に応じて特徴量を補正することができ、撮像された検査対象物の傾斜角度が相違している場合であっても、同じ長さのエッジであれば略同一のエッジ点の個数として計数することができ、検査対象物の良否判定を高い精度で行うことが可能となる。   In the fourth and tenth inventions, the calculation formula for calculating the correction coefficient based on the edge angle is stored, and the calculated feature value is corrected based on the stored calculation formula. The feature amount can be corrected according to the number of edges, and even if the inspected angles of the inspected object are different, if the edges have the same length, they are counted as substantially the same number of edge points. Therefore, it is possible to determine the quality of the inspection object with high accuracy.

第5発明及び第11発明では、良否判定の基準となる基準画像の指定を受け付け、指定を受け付けた基準画像に対して、エッジの抽出領域を設定する。設定されたエッジの抽出領域内の特徴量を算出するので、抽出領域内にて抽出されたエッジ角度に応じて特徴量を算出することができ、撮像された検査対象物の傾斜角度が相違している場合であっても、同じ長さのエッジであれば略同一のエッジ点の個数として計数できるよう補正することができ、検査対象物の良否判定を高い精度で行うことが可能となる。   In the fifth and eleventh aspects of the invention, designation of a reference image serving as a criterion for pass / fail judgment is accepted, and an edge extraction region is set for the reference image for which designation has been accepted. Since the feature amount in the extraction region of the set edge is calculated, the feature amount can be calculated according to the edge angle extracted in the extraction region, and the inclination angle of the imaged inspection object is different. Even if the edges have the same length, they can be corrected so that they can be counted as substantially the same number of edge points, and the quality of the inspection object can be determined with high accuracy.

第6発明及び第12発明では、エッジ角度の頻度分布を記憶し、エッジ角度の頻度を減少させるので、抽出されたエッジ角度に応じて特徴量を補正することができ、撮像された検査対象物の傾斜角度が相違している場合であっても、同じ長さのエッジであれば略同一のエッジ点の個数として計数することができ、検査対象物の良否判定を高い精度で行うことが可能となる。   In the sixth invention and the twelfth invention, the frequency distribution of the edge angle is stored and the frequency of the edge angle is decreased, so that the feature amount can be corrected according to the extracted edge angle, and the imaged inspection object Even if the inclination angles are different, if the edges have the same length, they can be counted as the number of substantially the same edge points, and the quality of the inspection object can be determined with high accuracy. It becomes.

本発明では、補正された特徴量に基づいて検査対象物の良否判定を行うことにより、撮像された検査対象物の傾斜角度が相違している場合であっても、同じ長さのエッジであれば略同一のエッジ点の個数として計数することができ、検査対象物の良否判定を高い精度で行うことが可能となる。   In the present invention, the quality of the inspection object is determined based on the corrected feature amount, so that even if the inclination angle of the imaged inspection object is different, the edges having the same length can be used. For example, it is possible to count the number of substantially the same edge points, and it is possible to determine whether the inspection object is good or not with high accuracy.

本発明の実施の形態に係る画像処理センサの構成を示す模式図である。It is a schematic diagram which shows the structure of the image processing sensor which concerns on embodiment of this invention. 本発明の実施の形態に係る画像処理センサの撮像装置の構成を示す外形図である。1 is an outline view showing a configuration of an imaging device of an image processing sensor according to an embodiment of the present invention. 本発明の実施の形態に係る画像処理センサの撮像装置のハードウェア構成を示すブロック図である。It is a block diagram which shows the hardware constitutions of the imaging device of the image processing sensor which concerns on embodiment of this invention. 本発明の実施の形態に係る画像処理センサの表示装置の構成を示す正面図である。It is a front view which shows the structure of the display apparatus of the image processing sensor which concerns on embodiment of this invention. 本発明の実施の形態に係る画像処理センサの表示装置のモード切り替え画面の例示図である。It is an illustration figure of the mode switching screen of the display apparatus of the image processing sensor which concerns on embodiment of this invention. 特徴量としてエッジ点の個数を計数する場合、従来のエッジ点の個数の計数処理の問題点を示す例示図である。When counting the number of edge points as a feature quantity, it is an exemplary diagram showing a problem of the conventional counting process of the number of edge points. 本発明の実施の形態に係る画像処理センサの機能ブロック図である。It is a functional block diagram of the image processing sensor which concerns on embodiment of this invention. 本発明の実施の形態に係る画像処理センサの、各種設定を受け付ける画面の例示図である。It is an illustration figure of the screen which receives various settings of the image processing sensor which concerns on embodiment of this invention. 本発明の実施の形態に係る画像処理センサの、エッジ抽出によるエッジ強度画像及びエッジ角度画像の例示図である。It is an illustration figure of the edge strength image and edge angle image by edge extraction of the image processing sensor which concerns on embodiment of this invention. 本発明の実施の形態に係る画像処理センサの細線化処理の内容の説明図である。It is explanatory drawing of the content of the thinning process of the image processing sensor which concerns on embodiment of this invention. 本発明の実施の形態に係る画像処理センサの、細線化された状態でのエッジ強度画像及びエッジ角度画像の例示図である。It is an illustration figure of the edge strength image and edge angle image in the state of thinning of the image processing sensor which concerns on embodiment of this invention. 本発明の実施の形態に係る画像処理センサの、細線化された状態でのエッジ点の個数のヒストグラムである。6 is a histogram of the number of edge points in the thinned state of the image processing sensor according to the embodiment of the present invention. 比較対象となるエッジ画素の例示図である。It is an illustration figure of the edge pixel used as comparison object. 本発明の実施の形態に係る画像処理センサのエッジ幅の例示図である。It is an illustration figure of the edge width of the image processing sensor which concerns on embodiment of this invention. 本発明の実施の形態に係る画像処理センサの補正係数の例示図である。It is an illustration figure of the correction coefficient of the image processing sensor which concerns on embodiment of this invention. 本発明の実施の形態に係る画像処理センサの、細線化された状態でのエッジ点の個数のヒストグラムである。6 is a histogram of the number of edge points in the thinned state of the image processing sensor according to the embodiment of the present invention. 比較対象となるエッジ画素の他の例示図である。It is another example figure of the edge pixel used as comparison object. 細線化処理の違いによるエッジパターンの例示図である。It is an illustration figure of the edge pattern by the difference in a thinning process. 本発明の実施の形態に係る画像処理センサの細線化処理結果の比較図である。It is a comparison figure of the thinning process result of the image processing sensor which concerns on embodiment of this invention. 本発明の実施の形態に係る画像処理センサの細線化処理を行わない場合のエッジ抽出結果の例示図である。It is an illustration figure of the edge extraction result when not performing the thinning process of the image processing sensor which concerns on embodiment of this invention. 本発明の実施の形態に係る画像処理センサの撮像装置のメイン基板のDSPの、特徴量補正処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the feature-value correction process of DSP of the main board | substrate of the imaging device of the image processing sensor which concerns on embodiment of this invention. 本発明の実施の形態に係る画像処理センサの良否判定結果の例示図である。It is an illustration figure of the quality determination result of the image processing sensor which concerns on embodiment of this invention.

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

図1は、本発明の実施の形態に係る画像処理センサの構成を示す模式図である。図1に示すように、本実施の形態に係る画像処理センサは、撮像装置(撮像手段)1と、撮像装置1とデータ通信することが可能に接続ケーブル3で接続されている表示装置(表示手段)2とで構成されている。もちろん、表示装置2の代わりに、ディスプレイを有する外部コンピュータであっても良い。なお、撮像装置1と表示装置2とが一体として構成されていても良い。   FIG. 1 is a schematic diagram showing a configuration of an image processing sensor according to an embodiment of the present invention. As shown in FIG. 1, the image processing sensor according to the present embodiment includes an imaging device (imaging means) 1 and a display device (display) connected by a connection cable 3 so as to be able to perform data communication with the imaging device 1. Means) 2. Of course, instead of the display device 2, an external computer having a display may be used. Note that the imaging device 1 and the display device 2 may be configured integrally.

撮像装置1は、内部に画像処理を実行するFPGA、DSP等を備えており、検査対象物を撮像する撮像素子を有するカメラモジュールと、検査対象物に対して光を照射する照明部とを備えている。撮像装置1をコンパクトにするべく、例えば図1に示すように、撮像装置1の正面の中央近傍にレンズ12を配置し、レンズ12の周囲を囲むように、照明部として複数のLED11を配置してある。なお、撮像装置1とは別に外部照明(リング照明等)を設けても良い。   The imaging apparatus 1 includes an FPGA, a DSP, and the like that execute image processing therein, and includes a camera module having an imaging device that images the inspection target, and an illumination unit that irradiates the inspection target with light. ing. In order to make the imaging device 1 compact, for example, as shown in FIG. 1, a lens 12 is arranged near the center of the front of the imaging device 1, and a plurality of LEDs 11 are arranged as an illumination unit so as to surround the lens 12. It is. Note that external illumination (ring illumination or the like) may be provided separately from the imaging device 1.

図2は、本発明の実施の形態に係る画像処理センサの撮像装置1の構成を示す外形図である。図2(a)は、本発明の実施の形態に係る画像処理センサの撮像装置1の構成を示す正面図を、図2(b)は、本発明の実施の形態に係る画像処理センサの撮像装置1の構成を示す平面図を、図2(c)は、本発明の実施の形態に係る画像処理センサの撮像装置1の構成を示す背面図を、それぞれ示している。   FIG. 2 is an outline view showing the configuration of the imaging device 1 of the image processing sensor according to the embodiment of the present invention. 2A is a front view showing the configuration of the imaging device 1 of the image processing sensor according to the embodiment of the present invention, and FIG. 2B is the imaging of the image processing sensor according to the embodiment of the present invention. FIG. 2C is a plan view showing the configuration of the apparatus 1, and FIG. 2C is a rear view showing the configuration of the imaging apparatus 1 of the image processing sensor according to the embodiment of the present invention.

図2(a)に示すように、撮像装置1はレンズ12を正面の中央近傍に配置しており、レンズ12の周囲を囲むように複数のLED11を配置してある。撮像時には、複数のLED11を点灯させることにより、検査対象物に光を照射し、検査対象物を明瞭に撮像することができる。   As shown in FIG. 2A, the imaging apparatus 1 has a lens 12 disposed in the vicinity of the center of the front surface, and a plurality of LEDs 11 are disposed so as to surround the lens 12. At the time of imaging, by turning on the plurality of LEDs 11, it is possible to irradiate the inspection object with light and to clearly image the inspection object.

ここで、光源を内蔵する撮像装置1を用いて外観検査を行う場合、検査対象物からの正反射を防ぐために、撮像装置1を検査対象物の真上ではなく斜め上に配置することがある。検査対象物の斜め上に配置した場合、撮像装置1により撮像された画像は、上方と下方と(又は左方と右方と)で明るさが異なる。   Here, when an appearance inspection is performed using the imaging device 1 with a built-in light source, the imaging device 1 may be disposed obliquely above the inspection object in order to prevent regular reflection from the inspection object. . When arranged obliquely above the object to be inspected, the brightness of the image captured by the imaging device 1 is different between above and below (or left and right).

例えば、撮像装置1を、水平に載置された検査対象物の手前上方に配置した場合、検査対象物の手前部分から撮像装置1までの距離よりも、検査対象物の奥部分から撮像装置1までの距離の方が長くなるため、検査対象物を撮像した画像上で上方部分が暗くなり、下方部分が明るくなる。もちろん、撮像装置1を真上に配置した場合であっても、撮像領域の中央付近が明るく、端へ向かうにつれて暗くなる。このように、光源を内蔵する撮像装置1を用いて外観検査を行う場合、検査対象物を撮像した画像上に色ムラが発生することがある。しかし、後述する画像処理方法によれば、このような色ムラが発生した場合であっても、色の抽出範囲を簡易な作業で設定することができる。   For example, when the imaging apparatus 1 is disposed in front of the inspection object placed horizontally, the imaging apparatus 1 is located from the back part of the inspection object rather than the distance from the front part of the inspection object to the imaging apparatus 1. Therefore, the upper part becomes dark and the lower part becomes bright on the image obtained by imaging the inspection object. Of course, even when the imaging device 1 is arranged directly above, the vicinity of the center of the imaging region is bright and becomes darker toward the end. As described above, when an appearance inspection is performed using the imaging device 1 including a light source, color unevenness may occur on an image obtained by imaging an inspection object. However, according to the image processing method described later, even if such color unevenness occurs, the color extraction range can be set with a simple operation.

図2(b)及び図2(c)に示すように、撮像装置1の背面には、外部の電源から電力の供給を受ける電源ケーブルを接続する電源コネクタ102と、表示装置2とデータ通信する接続ケーブル3を接続することが可能な接続コネクタ103とを備えている。また、手動でフォーカスを調整することができるフォーカス調整ネジ101も背面に備えている。   As shown in FIGS. 2B and 2C, the rear surface of the imaging device 1 is in data communication with the display device 2 and a power connector 102 that connects a power cable that receives power supplied from an external power source. A connection connector 103 to which the connection cable 3 can be connected is provided. A focus adjustment screw 101 that can manually adjust the focus is also provided on the back surface.

図3は、本発明の実施の形態に係る画像処理センサの撮像装置1のハードウェア構成を示すブロック図である。図3において、コネクタ基板16は、電源インタフェース161に設けてある電源コネクタ102(図2(b)及び図2(c)参照)を介して、外部の電源から電力の供給を受ける。電源基板18は、供給された電力を各基板に供給する。本実施の形態では、カメラモジュール14にはメイン基板13を介して電力を供給している。電源基板18のモータドライバ181は、カメラモジュール14のモータ141に駆動電力を供給し、オートフォーカスを実現している。   FIG. 3 is a block diagram showing a hardware configuration of the imaging device 1 of the image processing sensor according to the embodiment of the present invention. In FIG. 3, the connector board 16 is supplied with power from an external power source via a power connector 102 (see FIGS. 2B and 2C) provided in the power interface 161. The power supply board 18 supplies the supplied power to each board. In the present embodiment, power is supplied to the camera module 14 via the main board 13. The motor driver 181 of the power supply board 18 supplies driving power to the motor 141 of the camera module 14 to realize autofocus.

通信基板17は、メイン基板13から出力された欠陥を検出したか否かで検査対象物の良否を示すOK/NG信号(判定信号)、画像データ等を表示装置2へ送信する。判定信号を受信した表示装置2は、判定結果を表示する。なお、本実施の形態では、通信基板17を介してOK/NG信号(判定信号)を出力する構成にしているが、例えばコネクタ基板16を介してOK/NG信号(判定信号)を出力する構成にしても良い。   The communication board 17 transmits an OK / NG signal (determination signal), image data, and the like indicating the quality of the inspection object to the display device 2 based on whether or not a defect output from the main board 13 is detected. The display device 2 that has received the determination signal displays the determination result. In this embodiment, an OK / NG signal (determination signal) is output via the communication board 17, but an OK / NG signal (determination signal) is output via the connector board 16, for example. Anyway.

照明基板15は、検査対象物を撮像する撮像領域に光を照射する、複数のLED11が設けてあり、図示しないリフレクタはLED11の前方に設けてある。また、レンズ12は、短距離用又は長距離用のレンズユニットとして交換可能となっている。   The illumination board 15 is provided with a plurality of LEDs 11 that irradiate light to an imaging region for imaging the inspection object, and a reflector (not shown) is provided in front of the LEDs 11. The lens 12 can be replaced as a lens unit for short distance or long distance.

カメラモジュール(撮像手段)14は、モータ141が駆動することにより、オートフォーカス動作の制御を行うことができる。メイン基板13からの撮像指示信号に応じて検査対象物を撮像する。本実施の形態では、撮像素子としてCMOS基板142を備えており、撮像されたカラー画像は、CMOS基板142にてダイナミックレンジを広げる変換特性に基づいてHDR画像に変換され、メイン基板13のFPGA131へ出力される。   The camera module (imaging means) 14 can control the autofocus operation when the motor 141 is driven. The inspection object is imaged according to the imaging instruction signal from the main board 13. In the present embodiment, a CMOS substrate 142 is provided as an image sensor, and the captured color image is converted into an HDR image based on conversion characteristics that widen the dynamic range in the CMOS substrate 142 and is transferred to the FPGA 131 on the main substrate 13. Is output.

メイン基板13は、接続してある各基板の動作を制御する。例えば照明基板15に対しては、複数のLED11の点灯/消灯を制御する制御信号を、LEDドライバ151へ送信する。LEDドライバ151は、FPGA131からの制御信号に応じて、例えばLED11の点灯/消灯、光量等を調整する。また、カメラモジュール14のモータ141に対しては、電源基板18のモータドライバ181を介してオートフォーカス動作を制御する制御信号を、CMOS基板142に対しては、撮像指示信号等を、それぞれ送信する。   The main board 13 controls the operation of each connected board. For example, a control signal for controlling turning on / off of the plurality of LEDs 11 is transmitted to the LED driver 151 with respect to the illumination board 15. The LED driver 151 adjusts, for example, lighting / extinguishing of the LED 11, the amount of light, and the like according to a control signal from the FPGA 131. Further, a control signal for controlling the autofocus operation is transmitted to the motor 141 of the camera module 14 via the motor driver 181 of the power supply substrate 18, and an imaging instruction signal and the like are transmitted to the CMOS substrate 142. .

なお、メイン基板13には可搬型ディスクドライブ19が接続されていても良い。可搬型ディスクドライブ19を介して、DVD−ROM等の可搬型記録媒体90から各種の設定ファイル100をダウンロードすることもできる。   A portable disk drive 19 may be connected to the main board 13. Various setting files 100 can also be downloaded from a portable recording medium 90 such as a DVD-ROM via the portable disk drive 19.

メイン基板13のFPGA131は、照明制御、撮像制御をするとともに、取得した画像データに対する画像処理を実行する(画像処理手段)。また、メイン基板13のDSP132は、画像データについて、エッジ検出処理、パターン検索処理等を実行する。パターン検索処理の結果として、欠陥を検出したか否かで検査対象物の良否を示すOK/NG信号(判定信号)を通信基板17へ出力する(良否判定手段、出力手段)。演算処理結果等はメモリ133に記憶される。なお、本実施の形態では、FPGA131が照明制御、撮像制御等を実行するが、DSP132が実行しても良い。また、FPGA131とDSP132とが一体となった回路、すなわち主制御回路(主制御部)を設けても良い。要するに、複数のLED11の点灯/消灯を制御する制御信号をLEDドライバ151へ送信したり、オートフォーカス動作を制御する制御信号をカメラモジュール14のモータ141へ送信したり、撮像指示信号等をCMOS基板142へ送信したり、FPGA131及びDSP132の双方の機能を有する主制御部を設けても良い。   The FPGA 131 of the main board 13 performs illumination control and imaging control, and executes image processing on the acquired image data (image processing means). In addition, the DSP 132 of the main board 13 performs edge detection processing, pattern search processing, and the like on the image data. As a result of the pattern search process, an OK / NG signal (determination signal) indicating whether the inspection object is good or not is output to the communication board 17 based on whether or not a defect is detected (good / bad determination means, output means). The arithmetic processing result and the like are stored in the memory 133. In the present embodiment, the FPGA 131 executes illumination control, imaging control, and the like, but the DSP 132 may execute it. Further, a circuit in which the FPGA 131 and the DSP 132 are integrated, that is, a main control circuit (main control unit) may be provided. In short, a control signal for controlling turning on / off of the plurality of LEDs 11 is transmitted to the LED driver 151, a control signal for controlling the autofocus operation is transmitted to the motor 141 of the camera module 14, and an imaging instruction signal or the like is transmitted to the CMOS substrate. 142 may be provided, or a main control unit having the functions of both the FPGA 131 and the DSP 132 may be provided.

図4は、本発明の実施の形態に係る画像処理センサの表示装置(表示手段)2の構成を示す正面図である。図4に示すように、表示装置2の前面の中央部分にはタッチパネル21が設けてあり、撮像した検査対象物のカラー画像を画面に表示するとともに、ユーザによる選択入力を受け付ける。   FIG. 4 is a front view showing the configuration of the display device (display unit) 2 of the image processing sensor according to the embodiment of the present invention. As shown in FIG. 4, a touch panel 21 is provided in the central portion of the front surface of the display device 2, displays a color image of the imaged inspection object on the screen, and accepts a selection input by the user.

また、表示装置2は、外部の電源から電力が供給される電源ケーブルを接続する電源コネクタ24と、撮像装置1とデータ通信する接続ケーブル3を接続することが可能な接続コネクタ25とを備えている。さらにUSBメモリ等と接続することが可能なUSBポート22を前面に設けてある。   The display device 2 includes a power connector 24 that connects a power cable supplied with power from an external power source, and a connection connector 25 that can connect the connection cable 3 that performs data communication with the imaging device 1. Yes. Further, a USB port 22 that can be connected to a USB memory or the like is provided on the front surface.

ユーザは、表示装置2のタッチパネル21の画面に表示されているボタンを選択することにより、画像処理センサの動作を制御する。そして、検査対象物の検査を実行する「検査モード」と、画像処理センサの条件設定を行う「設定モード」との切り替えを行うこともできる。言い換えると、本実施の形態に係る画像処理センサは、検査対象物の良否を判定する検査モード(Runモード)と、検査に用いる各種パラメータ(撮像パラメータ、照明パラメータ、画像処理パラメータ等)の設定を行う設定モード(非Runモード)とを切り替えるためのモード切替部を有している。図5は、本発明の実施の形態に係る画像処理センサの表示装置2のモード切り替え画面の例示図である。   The user controls the operation of the image processing sensor by selecting a button displayed on the screen of the touch panel 21 of the display device 2. It is also possible to switch between an “inspection mode” for inspecting an inspection object and a “setting mode” for setting conditions of the image processing sensor. In other words, the image processing sensor according to the present embodiment sets an inspection mode (Run mode) for determining the quality of an inspection object and various parameters (imaging parameters, illumination parameters, image processing parameters, etc.) used for the inspection. A mode switching unit for switching between setting modes to be performed (non-Run mode) is provided. FIG. 5 is an exemplary view of a mode switching screen of the display device 2 of the image processing sensor according to the embodiment of the present invention.

図5(a)は、「検査モード」の画面表示の例示図である。図5(a)に示すように、検査対象物表示領域51に、撮像装置1が撮像した検査対象物の画像を表示する。左下の「センサ設定」ボタン52がモード切替部として機能し、「センサ設定」ボタン52が選択された場合、「設定モード」へと切り替わり、図5(b)に示す画面へと画面遷移する。   FIG. 5A is a view showing an example of the screen display of “inspection mode”. As shown in FIG. 5A, the inspection object image captured by the imaging apparatus 1 is displayed in the inspection object display area 51. The lower left “sensor setting” button 52 functions as a mode switching unit, and when the “sensor setting” button 52 is selected, the mode is switched to “setting mode”, and the screen transitions to the screen shown in FIG.

図5(b)は、「設定モード」の画面表示の例示図である。図5(b)に示すように、プログラム選択領域53にて、検査対象物の種類又は検査環境を選択する。ここで、「プログラム」とは、検査対象物の種類又は検査環境に応じて設定された一連のデータ群(パラメータ値の組み合わせ)を意味しており、検査対象物の種類又は検査環境ごとに異なるデータ群をプログラムとして記憶することができる。   FIG. 5B is an exemplary view of a screen display of “setting mode”. As shown in FIG. 5B, in the program selection area 53, the type of inspection object or the inspection environment is selected. Here, the “program” means a series of data groups (combination of parameter values) set in accordance with the type of inspection object or the inspection environment, and varies depending on the type of inspection object or the inspection environment. A group of data can be stored as a program.

また、検査対象物と比較する基準となるマスタ画像(基準画像)が記憶されている場合、マスタ画像表示領域54にマスタ画像が表示される。「設定ナビ」ボタン55が選択された場合、詳細な設定を行う設定画面に画面遷移する。左下の「運転開始」ボタン56はモード切替部として機能し、「運転開始」ボタン56が選択された場合、「検査モード」へと切り替わり、図5(a)に示す画面へと画面遷移する。   When a master image (reference image) serving as a reference to be compared with the inspection object is stored, the master image is displayed in the master image display area 54. When the “setting navigation” button 55 is selected, the screen transitions to a setting screen for performing detailed settings. The “start operation” button 56 in the lower left functions as a mode switching unit. When the “start operation” button 56 is selected, the mode is switched to “inspection mode” and the screen transitions to the screen shown in FIG.

図6は、特徴量としてエッジ点の個数を計数する場合、従来のエッジ点の個数の計数処理の問題点を示す例示図である。図6(a)に示すような直角二等辺三角形のエッジが抽出された場合、互いに直交する辺61、62の方向が、それぞれ画面上に配列されている画素の縦方向、横方向と一致している。したがって、辺61、62については、縦方向、横方向の画素数がエッジ点の個数として計数される。   FIG. 6 is an exemplary diagram illustrating a problem of the conventional counting process of the number of edge points when the number of edge points is counted as the feature amount. When edges of a right isosceles triangle as shown in FIG. 6A are extracted, the directions of the sides 61 and 62 orthogonal to each other coincide with the vertical and horizontal directions of the pixels arranged on the screen, respectively. ing. Therefore, for the sides 61 and 62, the number of pixels in the vertical and horizontal directions is counted as the number of edge points.

それに対して斜めの辺63は、画面上に配列されている画素の縦方向、横方向とは異なる方向であるので、線幅の平均値が1画素以上となり、エッジ点の個数が余分に計数される。図6(a)の例では、エッジ点の個数は、辺61について22点、辺62について21点、辺63について39点として、それぞれ計数されており、エッジ点の個数の総計は82点として計数されている。   On the other hand, the oblique side 63 is a direction different from the vertical direction and the horizontal direction of the pixels arranged on the screen, so that the average value of the line width is 1 pixel or more, and the number of edge points is counted extra. Is done. In the example of FIG. 6A, the number of edge points is counted as 22 points for side 61, 21 points for side 62, and 39 points for side 63, and the total number of edge points is 82 points. It is counted.

一方、全く同一の直角二等辺三角形の傾斜角度を変更した場合を図6(b)に示している。図6(b)では、辺63の方向が、画面上に配列されている画素の横方向と一致している。したがって、辺63については、横方向の画素数がエッジ点の個数として計数される。   On the other hand, FIG. 6B shows a case where the tilt angle of the same right isosceles triangle is changed. In FIG. 6B, the direction of the side 63 coincides with the horizontal direction of the pixels arranged on the screen. Therefore, for the side 63, the number of pixels in the horizontal direction is counted as the number of edge points.

それに対して他の二辺61、62は、画面上に配列されている画素の縦方向、横方向とは異なる方向であるので、線幅の平均値が1画素以上となり、エッジ点の個数が余分に計数される。図6(b)の例では、エッジ点の個数は、辺61について29点、辺62について29点、辺63について31点として、それぞれ計数されており、総計89点として計数されている。   On the other hand, the other two sides 61 and 62 are different from the vertical and horizontal directions of the pixels arranged on the screen, so the average line width is 1 pixel or more, and the number of edge points is It is counted extra. In the example of FIG. 6B, the number of edge points is counted as 29 points for the side 61, 29 points for the side 62, and 31 points for the side 63, and is counted as a total of 89 points.

このように、全く同一の形状を有するエッジが抽出された場合であっても、抽出されたエッジ角度によって計数されるエッジ点の個数が相違しており、エッジ点の個数の大小により検査対象物の良否判定を行っている場合には、しきい値次第では良品を不良品であると誤判定するおそれがあるという問題点が生じていた。   In this way, even when edges having exactly the same shape are extracted, the number of edge points counted according to the extracted edge angle is different, and the inspection object depends on the number of edge points. However, depending on the threshold value, there is a problem that a good product may be erroneously determined as a defective product.

そこで、本発明の実施の形態に係る画像処理センサでは、抽出されたエッジ角度を検出して、エッジ角度に応じて計数されたエッジ点の個数を補正することにより、エッジ角度によらず高い精度で良否判定を行うことができるよう工夫した。   Therefore, the image processing sensor according to the embodiment of the present invention detects the extracted edge angle and corrects the number of edge points counted according to the edge angle, thereby achieving high accuracy regardless of the edge angle. It was devised to be able to make a pass / fail judgment.

図7は、本発明の実施の形態に係る画像処理センサの機能ブロック図である。図7において、カラー画像取得部701は、カメラモジュール(撮像手段)14のCMOS基板142で撮像されたカラー画像の画素値(色成分値)を取得する。また、撮像された画像は表示装置2に表示される。   FIG. 7 is a functional block diagram of the image processing sensor according to the embodiment of the present invention. In FIG. 7, the color image acquisition unit 701 acquires pixel values (color component values) of a color image captured by the CMOS substrate 142 of the camera module (imaging unit) 14. In addition, the captured image is displayed on the display device 2.

指定受付部702は、良否判定の基準となる基準画像の指定を受け付ける。もちろん、事前に基準画像を記憶しておいても良い。抽出領域設定部703は、指定を受け付けた基準画像に対して、エッジの抽出領域を設定する。   The designation accepting unit 702 accepts designation of a reference image that is a criterion for pass / fail judgment. Of course, the reference image may be stored in advance. The extraction region setting unit 703 sets an edge extraction region for the reference image that has received the designation.

図8は、本発明の実施の形態に係る画像処理センサの、各種設定を受け付ける画面の例示図である。設定モードにおいて、図8(a)に示す設定画面には、撮像された検査対象物の画像が表示されている。良否判定のための演算ツールを追加する「ツール追加」ボタン81の選択を受け付けた場合、図8(b)のツール選択画面へと遷移する。   FIG. 8 is an exemplary view of a screen for receiving various settings of the image processing sensor according to the embodiment of the present invention. In the setting mode, a captured image of the inspection object is displayed on the setting screen shown in FIG. When the selection of the “add tool” button 81 for adding a calculation tool for pass / fail judgment is accepted, the screen shifts to the tool selection screen of FIG.

図8(b)に示すツール選択画面では、例えばエッジ点の個数を計数するツールである「エッジピクセル」ボタン82の選択を受け付ける。「エッジピクセル」ボタン82の選択を受け付けた場合、エッジ点の個数を計数するのに必要となる情報の設定を行う図8(c)の設定画面へと遷移する。   In the tool selection screen shown in FIG. 8B, for example, selection of an “edge pixel” button 82 which is a tool for counting the number of edge points is accepted. When the selection of the “edge pixel” button 82 is accepted, the screen shifts to the setting screen shown in FIG. 8C where information necessary for counting the number of edge points is set.

図8(c)は、「エッジピクセル」ボタン82の選択受付時の設定画面の例示図である。ここでは、「ウインドウ編集」ボタン83、「エッジ感度調整」ボタン84、「しきい値調整」ボタン85が準備されている。   FIG. 8C is an exemplary diagram of a setting screen when the selection of the “edge pixel” button 82 is accepted. Here, a “window edit” button 83, an “edge sensitivity adjustment” button 84, and a “threshold adjustment” button 85 are prepared.

「ウインドウ編集」ボタン83の選択を受け付けた場合、図8(d)に示す設定画面へと遷移し、抽出領域86の設定を受け付ける。これにより、検査対象物の画像を確実に含む領域をエッジの抽出領域として設定することができる。   When selection of the “edit window” button 83 is accepted, the screen transitions to the setting screen shown in FIG. As a result, an area that reliably includes the image of the inspection object can be set as an edge extraction area.

「エッジ感度調整」ボタン84の選択を受け付けた場合、図8(e)、(f)に示す設定画面へと遷移し、「感度設定」ボタン87により、エッジの検出感度を設定することができる。図8(e)に示すように「標準」の選択を受け付けた場合には感度を標準に設定し、図8(f)に示すように「高感度」の選択を受け付けた場合には感度を高感度に設定する。   When selection of the “edge sensitivity adjustment” button 84 is accepted, the screen shifts to the setting screen shown in FIGS. 8E and 8F, and the edge detection sensitivity can be set by the “sensitivity setting” button 87. . As shown in FIG. 8E, the sensitivity is set to the standard when the selection of “standard” is accepted, and the sensitivity is set when the selection of “high sensitivity” is accepted as shown in FIG. Set to high sensitivity.

「しきい値調整」ボタン85の選択を受け付けた場合、図8(g)に示す設定画面へと遷移し、良品であると判定するエッジ点の個数の下限値と上限値とを設定することができる。例えば下限値設定領域88に下限値を、上限値設定領域89に上限値を、それぞれ設定することにより、良品であると判定するエッジ点の個数の範囲を設定することができる。図8(g)の例では、例えば基準画像におけるエッジ点の個数を100%とした場合、計数したエッジ点の個数が基準画像におけるエッジ点の個数の90%(下限値)以上110%(上限値)以下である場合には良品であると判定するよう設定している。   When selection of the “threshold adjustment” button 85 is accepted, the screen shifts to the setting screen shown in FIG. 8G, and the lower limit value and the upper limit value of the number of edge points determined to be non-defective are set. Can do. For example, by setting the lower limit value in the lower limit value setting area 88 and the upper limit value in the upper limit value setting area 89, the range of the number of edge points determined to be non-defective can be set. In the example of FIG. 8G, for example, when the number of edge points in the reference image is 100%, the counted number of edge points is 90% (lower limit value) or more and 110% (upper limit) of the number of edge points in the reference image. Value) or less, it is set to determine that the product is non-defective.

図7に戻って、エッジ抽出部704は、撮像された検査対象物の画像からエッジを抽出する。エッジの抽出領域が設定されている場合には、設定されたエッジの抽出領域内においてエッジを抽出する。   Returning to FIG. 7, the edge extraction unit 704 extracts an edge from the imaged inspection object. If an edge extraction area is set, an edge is extracted within the set edge extraction area.

特徴量算出部705は、抽出されたエッジを構成するエッジ画素の特徴量を算出する。本実施の形態では、特徴量としてエッジを構成するエッジ点の個数(エッジ画素数)を計数する。   The feature amount calculation unit 705 calculates the feature amount of the edge pixel that constitutes the extracted edge. In the present embodiment, the number of edge points (number of edge pixels) constituting the edge is counted as a feature amount.

角度算出部706は、抽出されたエッジのエッジ角度を画素ごとに算出する。エッジ角度は、画面上に配列されている画素の縦方向を0度として、配列されている画素の縦方向からの傾きとして算出する。   The angle calculation unit 706 calculates the edge angle of the extracted edge for each pixel. The edge angle is calculated as the inclination of the arranged pixels from the vertical direction, where the vertical direction of the pixels arranged on the screen is 0 degree.

図9は、本発明の実施の形態に係る画像処理センサの、エッジ抽出によるエッジ強度画像及びエッジ角度画像の例示図である。図9(a)に示す検査対象物の画像に対してエッジの抽出を行い、図9(b)に示すエッジ強度画像及び図9(c)に示すエッジ角度画像を生成する。   FIG. 9 is an exemplary view of an edge intensity image and an edge angle image by edge extraction of the image processing sensor according to the embodiment of the present invention. Edge extraction is performed on the inspection target image shown in FIG. 9A to generate an edge strength image shown in FIG. 9B and an edge angle image shown in FIG. 9C.

図9(b)に示すエッジ強度画像では、濃淡又は色によりエッジ強度の強弱を画素ごとに表示している。図9(c)に示すエッジ角度画像では、矢印によりエッジ角度を画素ごとに表示している。エッジ角度は、エッジの延伸方向に直交する方向である。   In the edge strength image shown in FIG. 9B, the strength of the edge strength is displayed for each pixel by shading or color. In the edge angle image shown in FIG. 9C, the edge angle is displayed for each pixel by an arrow. The edge angle is a direction orthogonal to the extending direction of the edge.

なお、本実施の形態では、特徴量がエッジ点の個数であるので、図7に示すエッジの幅を細線化する細線化部707を設けて、抽出されたエッジを構成するエッジ画素の特徴量及びエッジ角度をより高い精度で算出することができるようにしている。例えば本実施の形態では特徴量がエッジ点の個数であるので、エッジの幅が狭いほど細線化されたエッジを構成するエッジ画素の個数(エッジ点の個数)の計数誤差が少なくなる。もちろん、特徴量が他の特徴量、例えばエッジ角度ごとの強度和である場合等には、細線化部707は必要ないことは言うまでもない。   In the present embodiment, since the feature amount is the number of edge points, a thinning unit 707 for thinning the edge width shown in FIG. 7 is provided, and the feature amount of the edge pixel constituting the extracted edge is provided. In addition, the edge angle can be calculated with higher accuracy. For example, since the feature amount is the number of edge points in the present embodiment, the smaller the edge width, the smaller the counting error of the number of edge pixels (number of edge points) constituting the thinned edge. Of course, it is needless to say that the thinning unit 707 is not necessary when the feature amount is another feature amount, for example, the sum of intensity for each edge angle.

図10は、本発明の実施の形態に係る画像処理センサの細線化処理の内容の説明図である。図10(a)は、図9に示す検査対象物について、枠91内のエッジ強度を数値化して示している。エッジ強度が‘0’である部分は、エッジが存在していない領域であることを示している。   FIG. 10 is an explanatory diagram of the contents of the thinning process of the image processing sensor according to the embodiment of the present invention. FIG. 10A shows the edge strength in the frame 91 as a numerical value for the inspection object shown in FIG. A portion having an edge strength of “0” indicates a region where no edge exists.

図9(c)を見ればわかるように、枠91内のエッジについてはエッジ角度が180度(下向き)であることから、上下方向のエッジ強度と比較してエッジ強度が最大である画素のみを残していく。例えば画素92については、エッジ強度が‘180’であり、上下の画素のエッジ強度が、それぞれ‘52’、‘76’であるので、画素92は残す。一方、画素93については、エッジ強度が‘79’であり、上下の画素のエッジ強度が、それぞれ‘180’、‘0’であることから、画素93は削除する。   As can be seen from FIG. 9C, since the edge angle of the edge in the frame 91 is 180 degrees (downward), only the pixel having the maximum edge strength compared to the edge strength in the vertical direction is selected. I will leave it. For example, for the pixel 92, the edge strength is “180”, and the edge strengths of the upper and lower pixels are “52” and “76”, respectively, so the pixel 92 remains. On the other hand, the pixel 93 is deleted because the edge strength of the pixel 93 is “79” and the edge strengths of the upper and lower pixels are “180” and “0”, respectively.

上述した処理を、エッジ角度に応じて画素ごとに行った結果を図10(b)に示している。これにより、エッジ角度方向に最大のエッジ強度を有する画素のみで構成され、エッジの幅が細線化された細線を生成することができる。   FIG. 10B shows a result of performing the above-described processing for each pixel according to the edge angle. As a result, it is possible to generate a thin line that includes only pixels having the maximum edge strength in the edge angle direction and has a thinned edge width.

図11は、本発明の実施の形態に係る画像処理センサの、細線化された状態でのエッジ強度画像及びエッジ角度画像の例示図である。図11(a)、(b)は、図9に示す検査対象物について、図10に示す細線化処理を行った後の、エッジ強度画像及びエッジ角度画像をそれぞれ示している。   FIG. 11 is an exemplary view of an edge intensity image and an edge angle image in a thinned state of the image processing sensor according to the embodiment of the present invention. FIGS. 11A and 11B show an edge strength image and an edge angle image after the thinning process shown in FIG. 10 is performed on the inspection object shown in FIG.

図9と比較しても明らかなように、画面上に配列されている画素の縦方向、横方向に対して傾斜している斜めの辺についても、余分な画素が排除されていることがわかる。図12は、本発明の実施の形態に係る画像処理センサの、細線化された状態でのエッジ点の個数のヒストグラムである。図12に示すように、エッジ角度が0度、90度、225度において、エッジ点の個数が累積されている。   As is clear from comparison with FIG. 9, it can be seen that extra pixels are also excluded from the oblique sides inclined with respect to the vertical and horizontal directions of the pixels arranged on the screen. . FIG. 12 is a histogram of the number of edge points in the thinned state of the image processing sensor according to the embodiment of the present invention. As shown in FIG. 12, the number of edge points is accumulated when the edge angle is 0 degrees, 90 degrees, and 225 degrees.

なお、説明を簡単にするために、上下方向のエッジ強度と比較して細線化する場合について説明しているが、エッジ角度に基づいて隣接する画素のエッジ強度と比較して細線化処理を行えば良い。図13は、比較対象となるエッジ画素の例示図である。   To simplify the description, the case of thinning compared to the edge strength in the vertical direction has been described. However, thinning processing is performed in comparison with the edge strength of adjacent pixels based on the edge angle. Just do it. FIG. 13 is an exemplary diagram of edge pixels to be compared.

エッジ角度が上下方向である場合、図13(a)の○印で示すように対象画素1301の上下に隣接する画素のエッジ強度と比較してエッジの幅の細線化処理を行う。同様に、エッジ角度が左右方向である場合、図13(c)の○印で示すように対象画素1301の左右に隣接する画素のエッジ強度と比較してエッジの幅の細線化処理を行う。また、エッジ角度が傾斜している場合、エッジ角度に応じて図13(b)又は(d)のいずれかを選択して、対象画素1301の周辺に位置する画素のエッジ強度と比較してエッジの幅の細線化処理を行う。   When the edge angle is in the vertical direction, thinning processing of the edge width is performed as compared with the edge strengths of pixels adjacent to the upper and lower sides of the target pixel 1301 as indicated by the circles in FIG. Similarly, when the edge angle is in the left-right direction, the edge width is thinned as compared with the edge strengths of the pixels adjacent to the left and right of the target pixel 1301 as indicated by the circles in FIG. Further, when the edge angle is inclined, either one of FIGS. 13B and 13D is selected according to the edge angle, and the edge is compared with the edge strength of the pixel located around the target pixel 1301. The line width is reduced.

図7に戻って、特徴量補正部708は、算出されたエッジ角度に基づいて、算出された特徴量を補正する。具体的には、エッジ角度ごとの補正係数を記憶装置に記憶しておき、特徴量補正部708は、記憶されている補正係数をエッジ角度に基づいて読み出し、算出された特徴量を補正する。本実施の形態では、エッジ角度ごとに、特徴量であるエッジ点の個数を補正する補正係数を記憶している。図14は、本発明の実施の形態に係る画像処理センサのエッジ幅の例示図である。図14では、図6(a)に示す検査対象物について、エッジ角度とエッジ幅との関係を示している。   Returning to FIG. 7, the feature amount correction unit 708 corrects the calculated feature amount based on the calculated edge angle. Specifically, the correction coefficient for each edge angle is stored in the storage device, and the feature amount correction unit 708 reads the stored correction coefficient based on the edge angle, and corrects the calculated feature amount. In the present embodiment, a correction coefficient for correcting the number of edge points, which is a feature amount, is stored for each edge angle. FIG. 14 is a view showing an example of the edge width of the image processing sensor according to the embodiment of the present invention. FIG. 14 shows the relationship between the edge angle and the edge width for the inspection object shown in FIG.

図14(a)は、検査対象物の画像から抽出された3つの辺(エッジ)61、62、63を示している。図14(a)からも分かるように、エッジ角度が45度である斜めの辺63については、エッジ幅が√2と大きくなる。これは図14(b)に示すように、エッジ角度が存在する場合には、エッジ角度をθとしてエッジ幅が(sinθ+cosθ)となる。   FIG. 14A shows three sides (edges) 61, 62, 63 extracted from the image of the inspection object. As can be seen from FIG. 14A, the edge width of the oblique side 63 with an edge angle of 45 degrees is as large as √2. As shown in FIG. 14B, when an edge angle exists, the edge angle is θ and the edge width is (sin θ + cos θ).

したがって、エッジ幅を画面上に配列されている画素の縦方向あるいは横方向と同一となるように補正するには、エッジ幅が大きくなった割合の逆数を乗算すれば良い。図15は、本発明の実施の形態に係る画像処理センサの補正係数の例示図である。図15では、図6(a)に示す検査対象物について、エッジ角度と補正係数との関係を示している。   Therefore, in order to correct the edge width so as to be the same as the vertical direction or the horizontal direction of the pixels arranged on the screen, the reciprocal of the ratio of the increased edge width may be multiplied. FIG. 15 is an illustration of correction coefficients of the image processing sensor according to the embodiment of the present invention. FIG. 15 shows the relationship between the edge angle and the correction coefficient for the inspection object shown in FIG.

図15では、エッジ角度ごとの補正係数を示しており、図14(b)に示すエッジ幅の逆数として求めている。したがって、エッジ角度が存在する場合には、エッジ角度をθとして補正係数は1/(sinθ+cosθ)となる。これにより、エッジ角度が0度、90度以外の角度についてはエッジ点の個数が減少する。   FIG. 15 shows the correction coefficient for each edge angle, which is obtained as the reciprocal of the edge width shown in FIG. Therefore, when there is an edge angle, the correction coefficient is 1 / (sin θ + cos θ), where θ is the edge angle. This reduces the number of edge points for angles other than 0 degrees and 90 degrees.

図16は、本発明の実施の形態に係る画像処理センサの、細線化された状態でのエッジ点の個数のヒストグラムである。図16では、図12に示すヒストグラムから、エッジ角度が225度について、累積されるエッジ点の個数が減少している。   FIG. 16 is a histogram of the number of edge points in the thinned state of the image processing sensor according to the embodiment of the present invention. In FIG. 16, from the histogram shown in FIG. 12, the number of accumulated edge points is decreased for the edge angle of 225 degrees.

つまり、エッジ点の個数を計数した時点で、エッジ角度の頻度分布としてヒストグラムを記憶装置に記憶しておき、特徴量補正部708は、エッジ角度が0度、90度以外のエッジ角度について、エッジ角度の頻度(エッジ点の個数)を減少させる。これにより、検査対象物の画像が傾斜角度を有している場合であっても、抽出されたエッジのエッジ点の個数が増加することがない。   That is, when the number of edge points is counted, a histogram is stored as a frequency distribution of edge angles in the storage device, and the feature amount correction unit 708 performs edge detection for edge angles other than 0 degrees and 90 degrees. Decrease the angle frequency (number of edge points). Thereby, even if the image of the inspection object has an inclination angle, the number of edge points of the extracted edges does not increase.

例えば図6(a)に示すような直角二等辺三角形のエッジが抽出された場合、エッジ点の個数は、辺61について22点、辺62について21点、辺63について39点として、それぞれ計数されており、エッジ点の個数の総計は82点として計数されていた。それに対して、今回の補正係数を乗算することで、辺61について22点、辺62について21点であるのに対して、辺63については(39/√2)=28点として計数される。したがって、エッジ点の個数の総計は71点として計数される。   For example, when an edge of a right isosceles triangle as shown in FIG. 6A is extracted, the number of edge points is counted as 22 points for the side 61, 21 points for the side 62, and 39 points for the side 63, respectively. The total number of edge points was counted as 82 points. On the other hand, by multiplying the correction coefficient this time, 22 points for side 61 and 21 points for side 62 are counted as (39 / √2) = 28 points for side 63. Therefore, the total number of edge points is counted as 71 points.

一方、全く同一の直角二等辺三角形の傾斜角度を変更した図6(b)の場合、エッジ点の個数は、辺61について29点、辺62について29点、辺63について31点として、それぞれ計数されており、総計89点として計数されていた。それに対して、今回の補正係数を乗算することで、辺61については(29/√2)=20.5点、辺62についても(29/√2)=20.5点であるのに対して、辺63については31点として計数される。したがって、エッジ点の個数の総計は72点として計数されるので、傾斜角度が変更された場合であってもエッジ点の個数に大きなばらつきが生じていないことが分かる。したがって、良否判定の安定性が高く、識別性能の向上を図ることができる。   On the other hand, in the case of FIG. 6B in which the inclination angle of exactly the same right isosceles triangle is changed, the number of edge points is 29 points for side 61, 29 points for side 62, and 31 points for side 63, respectively. It was counted as a total of 89 points. On the other hand, by multiplying this correction coefficient, (29 / √2) = 20.5 points for the side 61 and (29 / √2) = 20.5 points for the side 62 as well. Thus, the side 63 is counted as 31 points. Therefore, since the total number of edge points is counted as 72 points, it can be seen that there is no large variation in the number of edge points even when the inclination angle is changed. Therefore, the pass / fail judgment is highly stable and the discrimination performance can be improved.

なお、エッジ角度ごとの補正係数を記憶装置に記憶しておくことに限定されるものではなく、計算式として記憶装置に記憶しておいても良い。この場合、特徴量補正部708は、記憶されている補正係数の計算式をエッジ角度に基づいて読み出し、算出された特徴量を補正する。例えばエッジ角度をθとして、計算式(補正係数=1/(sinθ+cosθ))を記憶しておけば良い。   The correction coefficient for each edge angle is not limited to being stored in the storage device, but may be stored in the storage device as a calculation formula. In this case, the feature amount correction unit 708 reads the stored calculation formula of the correction coefficient based on the edge angle, and corrects the calculated feature amount. For example, the calculation formula (correction coefficient = 1 / (sin θ + cos θ)) may be stored with the edge angle as θ.

もちろん、細線化処理は、上述した処理に限定されるものではない。図17は、比較対象となるエッジ画素の他の例示図である。   Of course, the thinning process is not limited to the process described above. FIG. 17 is another exemplary diagram of edge pixels to be compared.

図17に示すように、エッジ角度に応じて、図17(a)の○印で示すように対象画素1301の上下に隣接する画素のエッジ強度と比較してエッジの幅の細線化処理を行うか、あるいは図17(b)の○印で示すように対象画素1301の左右に隣接する画素のエッジ強度と比較してエッジの幅の細線化処理を行う。これにより、図13に示すパターンで細線化処理を行った場合よりも、よりエッジの幅を細線化することができる。   As shown in FIG. 17, in accordance with the edge angle, as shown by circles in FIG. 17A, edge width thinning processing is performed in comparison with the edge strength of pixels adjacent to the upper and lower sides of the target pixel 1301 Alternatively, as shown by the circles in FIG. 17B, the edge width is thinned in comparison with the edge strengths of the pixels adjacent to the left and right of the target pixel 1301. Thereby, the width of the edge can be made thinner than when the thinning process is performed with the pattern shown in FIG.

図18は、細線化処理の違いによるエッジパターンの例示図である。図18に示すように、図13に示すパターンで細線化処理を行った場合、ハッチング画素1801が残留した状態で細線化処理される。それに対して、図17に示すパターンで細線化処理を行った場合、ハッチング画素1801は確実に消去され、図13に示すパターンでエッジの幅の細線化処理を行った場合よりも細くなるようエッジの幅の細線化処理を行うことが可能となる。   FIG. 18 is an illustration of edge patterns due to differences in thinning processing. As shown in FIG. 18, when the thinning process is performed with the pattern shown in FIG. 13, the thinning process is performed with hatched pixels 1801 remaining. On the other hand, when thinning processing is performed with the pattern shown in FIG. 17, the hatched pixels 1801 are surely erased, and the edges are made thinner than when thinning processing of the edge width is performed with the pattern shown in FIG. It is possible to perform a thinning process with a width of.

図19は、本発明の実施の形態に係る画像処理センサの細線化処理結果の比較図である。図19(a)は、図13に示すパターンでエッジの幅の細線化処理を行った場合の処理結果を、図19(b)は、図17に示すパターンでエッジの幅の細線化処理を行った場合の処理結果を、それぞれ示している。図19(b)の方が、斜めの辺を示す画素がより細かく表示されていることがわかる。   FIG. 19 is a comparison diagram of thinning processing results of the image processing sensor according to the embodiment of the present invention. FIG. 19A shows the processing result when the edge width thinning process is performed with the pattern shown in FIG. 13, and FIG. 19B shows the edge width thinning process with the pattern shown in FIG. The processing results when performed are shown respectively. In FIG. 19B, it can be seen that the pixels indicating the oblique sides are displayed more finely.

なお、特徴量がエッジ点の個数である場合には細線化することは必要ですが、他の特徴量である場合には必ずしも必要ではない。例えば特徴量がエッジ強度和である場合、エッジ角度ごとのエッジ強度和のヒストグラムを生成すれば良い。   It should be noted that thinning is necessary when the feature amount is the number of edge points, but is not necessarily necessary when it is another feature amount. For example, when the feature quantity is the edge intensity sum, a histogram of the edge intensity sum for each edge angle may be generated.

図20は、本発明の実施の形態に係る画像処理センサの細線化処理を行わない場合のエッジ抽出結果の例示図である。図20(a)は、エッジ強度を、図20(b)は、エッジ角度を、それぞれ示している。   FIG. 20 is an exemplary diagram of the edge extraction result when the thinning process of the image processing sensor according to the embodiment of the present invention is not performed. 20A shows the edge strength, and FIG. 20B shows the edge angle.

細線化処理を行っていないので、図20(c)に示すように、ヒストグラムにおいてエッジ強度和が分布するエッジ角度に幅が生じる。これは、エッジ角度に応じてエッジ強度に差がでやすいからである。   Since the thinning process is not performed, as shown in FIG. 20C, a width is generated in the edge angle where the edge intensity sum is distributed in the histogram. This is because the difference in edge strength is likely to occur depending on the edge angle.

図21は、本発明の実施の形態に係る画像処理センサの撮像装置1のメイン基板13のDSP132の、特徴量補正処理の手順を示すフローチャートである。本実施の形態では、エッジ点の個数の補正処理の手順を示している。   FIG. 21 is a flowchart showing the procedure of the feature amount correction process of the DSP 132 of the main board 13 of the imaging device 1 of the image processing sensor according to the embodiment of the present invention. In the present embodiment, the procedure for correcting the number of edge points is shown.

図21において、撮像装置1のメイン基板13のDSP132は、図7における、カラー画像取得部701と同様、撮像されたカラー画像の画素値(色成分値)を取得し(ステップS2101)、撮像された画像を表示装置2に表示する(ステップS2102)。   In FIG. 21, the DSP 132 of the main board 13 of the imaging device 1 acquires the pixel value (color component value) of the captured color image (step S <b> 2101), similarly to the color image acquisition unit 701 in FIG. 7. The displayed image is displayed on the display device 2 (step S2102).

DSP132は、良否判定の基準となる基準画像の指定を受け付ける(ステップS2103)。もちろん、事前に記憶してある基準画像を読み出しても良い。DSP132は、指定を受け付けた基準画像に対して、エッジの抽出領域の設定を受け付ける(ステップS2104)。   The DSP 132 accepts designation of a reference image serving as a reference for pass / fail determination (step S2103). Of course, a reference image stored in advance may be read out. The DSP 132 accepts the setting of the edge extraction region for the reference image for which designation has been accepted (step S2104).

DSP132は、撮像された検査対象物の画像からエッジを抽出する(ステップS2105)。エッジの抽出領域が設定されている場合には、設定されたエッジの抽出領域内においてエッジを抽出する。   The DSP 132 extracts an edge from the imaged inspection object (step S2105). If an edge extraction area is set, an edge is extracted within the set edge extraction area.

DSP132は、抽出されたエッジを構成するエッジ画素の特徴量を算出し(ステップS2106)、抽出されたエッジの画素ごとのエッジ角度を算出する(ステップS2107)。エッジ角度は、画面上に配列されている画素の縦方向を0度として、配列されている画素の縦方向からの傾きとして算出する。   The DSP 132 calculates the feature amount of the edge pixel constituting the extracted edge (step S2106), and calculates the edge angle for each pixel of the extracted edge (step S2107). The edge angle is calculated as the inclination of the arranged pixels from the vertical direction, where the vertical direction of the pixels arranged on the screen is 0 degree.

DSP132は、抽出されたエッジの幅を細線化し(ステップS2108)、算出されたエッジ角度に基づいて、算出された特徴量を補正する(ステップS2109)。具体的には、エッジ角度ごとの補正係数を記憶装置に記憶しておき、DSP132は、記憶されている補正係数をエッジ角度に基づいて読み出し、算出された特徴量を補正する。   The DSP 132 thins the width of the extracted edge (step S2108), and corrects the calculated feature amount based on the calculated edge angle (step S2109). Specifically, the correction coefficient for each edge angle is stored in the storage device, and the DSP 132 reads out the stored correction coefficient based on the edge angle and corrects the calculated feature value.

図22は、本発明の実施の形態に係る画像処理センサの良否判定結果の例示図である。図22(a)と図22(b)とでは、同一の検査対象物に対して撮像されている角度が相違している。   FIG. 22 is a view showing an example of the pass / fail judgment result of the image processing sensor according to the embodiment of the present invention. In FIG. 22A and FIG. 22B, the angles taken for the same inspection object are different.

従来の方法であれば、エッジ点の個数に差が生じるため、しきい値の設定によってはいずれかが「不良品(NG)」であると判定されるおそれがあった。しかし、本実施の形態によれば、計数されるエッジ点の個数が補正されることで、検査対象物が撮像される角度の相違によるエッジ点の個数の変動を抑制することができる。したがって、いずれも「良品(OK)」であると判定されている。   In the case of the conventional method, there is a difference in the number of edge points, and depending on the setting of the threshold value, there is a possibility that one of them is determined as “defective product (NG)”. However, according to the present embodiment, by correcting the number of edge points to be counted, it is possible to suppress fluctuations in the number of edge points due to differences in angles at which the inspection object is imaged. Therefore, both are determined to be “good (OK)”.

以上のように本実施の形態によれば、補正された特徴量に基づいて検査対象物の良否判定を行うことにより、撮像された検査対象物の傾斜角度が相違している場合であっても、同じ長さのエッジであれば略同一のエッジ点の個数として計数することができ、検査対象物の良否判定を高い精度で行うことが可能となる。   As described above, according to the present embodiment, even when the inclination angles of the imaged inspection object are different by performing pass / fail determination of the inspection object based on the corrected feature amount. If the edges have the same length, they can be counted as the number of substantially the same edge points, and the quality of the inspection object can be determined with high accuracy.

なお、本発明は上記実施例に限定されるものではなく、本発明の趣旨の範囲内であれば多種の変更、改良等が可能である。例えば撮像装置1と表示装置2とは、接続ケーブル3で直結されている形態に限定されるものではなく、LAN、WAN等のネットワーク網を介して接続されていても良いことは言うまでもない。また、本実施の形態では撮像装置1と表示装置2とは別体となっているが、両者が一体として構成された画像処理センサであっても良い。   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. For example, the imaging device 1 and the display device 2 are not limited to the form directly connected by the connection cable 3, and needless to say, they may be connected via a network network such as a LAN or a WAN. Further, in the present embodiment, the imaging device 1 and the display device 2 are separate bodies, but an image processing sensor in which both are integrated may be used.

また、細線化処理についても、上述した実施例に記載された方法に限定されるものではなく、周知の方法であれば何でも良い。例えば、角度によりエッジ幅が大きくなるか否か、補正係数が上述した式で表されるか否か等は、どのような細線化の手法を採用するかに依存する。   Further, the thinning process is not limited to the method described in the above-described embodiment, and any known method may be used. For example, whether or not the edge width is increased depending on the angle and whether or not the correction coefficient is expressed by the above-described formula depend on what thinning method is used.

1 撮像装置(撮像手段)
2 表示装置(表示手段)
3 接続ケーブル
13 メイン基板
14 カメラモジュール
15 照明基板
21 タッチパネル
132 DSP
701 カラー画像取得部
702 指定受付部
703 抽出領域設定部
704 エッジ抽出部
705 特徴量算出部
706 角度算出部
707 細線化部
708 特徴量補正部
1 Imaging device (imaging means)
2. Display device (display means)
3 Connection Cable 13 Main Board 14 Camera Module 15 Illumination Board 21 Touch Panel 132 DSP
701 Color image acquisition unit 702 Specification reception unit 703 Extraction area setting unit 704 Edge extraction unit 705 Feature amount calculation unit 706 Angle calculation unit 707 Thinning unit 708 Feature amount correction unit

Claims (13)

検査対象物を撮像する撮像手段と、
該撮像手段で撮像された画像を表示する表示手段と、
該表示手段で表示された画像からエッジを抽出して、抽出されたエッジに基づいて画像処理を行う画像処理手段と、
該画像処理手段の処理結果に基づいて、検査対象物の良否判定を行う良否判定手段と、
該良否判定手段の判定結果を外部へ出力する出力手段と
を有する画像処理センサにおいて、
前記画像処理手段は、
撮像された検査対象物の画像からエッジを抽出するエッジ抽出手段と、
抽出されたエッジを構成するエッジ画素の特徴量を算出する特徴量算出手段と、
抽出されたエッジ角度を画素ごとに算出する角度算出手段と、
算出されたエッジ角度に基づいて、算出された特徴量を補正する特徴量補正手段と
を備えることを特徴とする画像処理センサ。
An imaging means for imaging an inspection object;
Display means for displaying an image captured by the imaging means;
Image processing means for extracting an edge from an image displayed by the display means and performing image processing based on the extracted edge;
A pass / fail determination means for determining pass / fail of the inspection object based on the processing result of the image processing means;
An image processing sensor having output means for outputting the determination result of the pass / fail determination means to the outside;
The image processing means includes
Edge extraction means for extracting an edge from the image of the imaged inspection object;
Feature amount calculating means for calculating the feature amount of the edge pixel constituting the extracted edge;
An angle calculating means for calculating the extracted edge angle for each pixel;
An image processing sensor comprising: a feature amount correcting unit that corrects the calculated feature amount based on the calculated edge angle.
エッジの幅を細線化する細線化手段を備え、
前記特徴量算出手段は、細線化されたエッジを構成するエッジ画素の個数を算出することを特徴とする請求項1に記載の画像処理センサ。
A thinning means for thinning the width of the edge is provided,
The image processing sensor according to claim 1, wherein the feature amount calculating unit calculates the number of edge pixels constituting the thinned edge.
エッジ角度ごとの補正係数を記憶しておき、
前記特徴量補正手段は、記憶されているエッジ角度に基づいて特定された補正係数を用いて、算出された特徴量を補正することを特徴とする請求項1又は2に記載の画像処理センサ。
Store the correction coefficient for each edge angle,
The image processing sensor according to claim 1, wherein the feature amount correcting unit corrects the calculated feature amount using a correction coefficient specified based on a stored edge angle.
エッジ角度に基づいて補正係数を算出する計算式を記憶しておき、
前記特徴量補正手段は、記憶されている計算式に基づいて、算出された特徴量を補正することを特徴とする請求項1又は2に記載の画像処理センサ。
Store the calculation formula for calculating the correction coefficient based on the edge angle,
The image processing sensor according to claim 1, wherein the feature amount correcting unit corrects the calculated feature amount based on a stored calculation formula.
良否判定の基準となる基準画像の指定を受け付ける指定受付手段と、
指定を受け付けた基準画像に対して、エッジの抽出領域を設定する抽出領域設定手段と
を備え、
前記画像処理手段は、設定されたエッジの抽出領域内の特徴量を算出することを特徴とする請求項1乃至4のいずれか一項に記載の画像処理センサ。
A designation accepting means for accepting designation of a reference image as a reference for pass / fail judgment;
An extraction area setting means for setting an extraction area of an edge with respect to a reference image for which designation has been received,
5. The image processing sensor according to claim 1, wherein the image processing unit calculates a feature amount in a set edge extraction region. 6.
エッジ角度の頻度分布を記憶しておき、
前記特徴量補正手段は、エッジ角度の頻度を減少させることを特徴とする請求項1乃至5のいずれか一項に記載の画像処理センサ。
Remember the frequency distribution of the edge angle,
The image processing sensor according to claim 1, wherein the feature amount correction unit decreases the frequency of the edge angle.
検査対象物を撮像する撮像手段と、
該撮像手段で撮像された画像を表示する表示手段と
を備え、
該表示手段で表示された画像からエッジを抽出して、抽出されたエッジに基づいて画像処理を行い、
画像処理の処理結果に基づいて、検査対象物の良否判定を行い、
良否判定の判定結果を外部へ出力する画像処理センサで実行することが可能な画像処理方法において、
前記画像処理センサは、
撮像された検査対象物の画像からエッジを抽出するステップと、
抽出されたエッジを構成するエッジ画素の特徴量を算出するステップと、
抽出されたエッジ角度を画素ごとに算出するステップと、
算出されたエッジ角度に基づいて、算出された特徴量を補正するステップと
を含むことを特徴とする画像処理方法。
An imaging means for imaging an inspection object;
Display means for displaying an image picked up by the image pickup means,
Extracting an edge from the image displayed by the display means, performing image processing based on the extracted edge;
Based on the processing result of the image processing, pass / fail judgment of the inspection object is performed,
In an image processing method that can be executed by an image processing sensor that outputs a determination result of pass / fail determination to the outside,
The image processing sensor
Extracting an edge from the image of the imaged inspection object;
Calculating a feature quantity of edge pixels constituting the extracted edge;
Calculating the extracted edge angle for each pixel;
An image processing method comprising: correcting the calculated feature amount based on the calculated edge angle.
前記画像処理センサは、
エッジの幅を細線化するステップを含み、
細線化されたエッジを構成するエッジ画素の個数を算出することを特徴とする請求項7に記載の画像処理方法。
The image processing sensor
Including thinning the edge width,
The image processing method according to claim 7, wherein the number of edge pixels constituting the thinned edge is calculated.
前記画像処理センサは、
エッジ角度ごとの補正係数を記憶しておき、
記憶されているエッジ角度に基づいて特定された補正係数を用いて、算出された特徴量を補正することを特徴とする請求項7又は8に記載の画像処理方法。
The image processing sensor
Store the correction coefficient for each edge angle,
The image processing method according to claim 7, wherein the calculated feature amount is corrected using a correction coefficient specified based on the stored edge angle.
前記画像処理センサは、
エッジ角度に基づいて補正係数を算出する計算式を記憶しておき、
記憶されている計算式に基づいて、算出された特徴量を補正することを特徴とする請求項7又は8に記載の画像処理方法。
The image processing sensor
Store the calculation formula for calculating the correction coefficient based on the edge angle,
9. The image processing method according to claim 7, wherein the calculated feature amount is corrected based on a stored calculation formula.
前記画像処理センサは、
良否判定の基準となる基準画像の指定を受け付けるステップと、
指定を受け付けた基準画像に対して、エッジの抽出領域を設定するステップと
を含み、
設定されたエッジの抽出領域内の特徴量を算出することを特徴とする請求項7乃至10のいずれか一項に記載の画像処理方法。
The image processing sensor
Receiving a designation of a reference image as a reference for pass / fail judgment;
A step of setting an edge extraction region for a reference image for which designation has been received, and
The image processing method according to claim 7, wherein a feature amount in a set edge extraction region is calculated.
前記画像処理センサは、
エッジ角度の頻度分布を記憶しておき、
エッジ角度の頻度を減少させることを特徴とする請求項7乃至11のいずれか一項に記載の画像処理方法。
The image processing sensor
Remember the frequency distribution of the edge angle,
The image processing method according to claim 7, wherein the frequency of the edge angle is reduced.
検査対象物を撮像する撮像手段と、
該撮像手段で撮像された画像を表示する表示手段と、
該表示手段で表示された画像からエッジを抽出して、抽出されたエッジに基づいて画像処理を行う画像処理手段と、
該画像処理手段の処理結果に基づいて、検査対象物の良否判定を行う良否判定手段と、
該良否判定手段の判定結果を外部へ出力する出力手段と
を有する画像処理センサで実行することが可能なコンピュータプログラムにおいて、
前記画像処理手段を、
撮像された検査対象物の画像からエッジを抽出するエッジ抽出手段、
抽出されたエッジを構成するエッジ画素の特徴量を算出する特徴量算出手段、
抽出されたエッジ角度を画素ごとに算出する角度算出手段、及び
算出されたエッジ角度に基づいて、算出された特徴量を補正する特徴量補正手段
として機能させることを特徴とするコンピュータプログラム。
An imaging means for imaging an inspection object;
Display means for displaying an image captured by the imaging means;
Image processing means for extracting an edge from an image displayed by the display means and performing image processing based on the extracted edge;
A pass / fail determination means for determining pass / fail of the inspection object based on the processing result of the image processing means;
In a computer program that can be executed by an image processing sensor having output means for outputting the determination result of the pass / fail determination means to the outside,
The image processing means;
Edge extraction means for extracting an edge from the image of the imaged inspection object;
A feature amount calculating means for calculating a feature amount of an edge pixel constituting the extracted edge;
A computer program that functions as an angle calculation unit that calculates an extracted edge angle for each pixel, and a feature amount correction unit that corrects the calculated feature amount based on the calculated edge angle.
JP2015201849A 2015-10-13 2015-10-13 Image processing sensor, image processing method, and computer program Active JP6587894B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015201849A JP6587894B2 (en) 2015-10-13 2015-10-13 Image processing sensor, image processing method, and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015201849A JP6587894B2 (en) 2015-10-13 2015-10-13 Image processing sensor, image processing method, and computer program

Publications (2)

Publication Number Publication Date
JP2017076168A true JP2017076168A (en) 2017-04-20
JP6587894B2 JP6587894B2 (en) 2019-10-09

Family

ID=58550290

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015201849A Active JP6587894B2 (en) 2015-10-13 2015-10-13 Image processing sensor, image processing method, and computer program

Country Status (1)

Country Link
JP (1) JP6587894B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220207731A1 (en) * 2019-09-24 2022-06-30 Nuvasive, Inc. Systems and Methods for Adjusting Appearance of Objects in Medical Images

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03266621A (en) * 1990-03-16 1991-11-27 Toyo Mach & Metal Co Ltd Injection molding machine
JP2000209431A (en) * 1999-01-18 2000-07-28 Canon Inc Method for extracting contour and storage medium
JP2010223809A (en) * 2009-03-24 2010-10-07 Sharp Corp Inspection apparatus, inspection method, program and recording medium
JP2012021914A (en) * 2010-07-15 2012-02-02 Keyence Corp Image processing system and visual inspection method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03266621A (en) * 1990-03-16 1991-11-27 Toyo Mach & Metal Co Ltd Injection molding machine
JP2000209431A (en) * 1999-01-18 2000-07-28 Canon Inc Method for extracting contour and storage medium
JP2010223809A (en) * 2009-03-24 2010-10-07 Sharp Corp Inspection apparatus, inspection method, program and recording medium
JP2012021914A (en) * 2010-07-15 2012-02-02 Keyence Corp Image processing system and visual inspection method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220207731A1 (en) * 2019-09-24 2022-06-30 Nuvasive, Inc. Systems and Methods for Adjusting Appearance of Objects in Medical Images
US11748858B2 (en) * 2019-09-24 2023-09-05 Nuvasive, Inc. Systems and methods for adjusting appearance of objects in medical images

Also Published As

Publication number Publication date
JP6587894B2 (en) 2019-10-09

Similar Documents

Publication Publication Date Title
US9291450B2 (en) Measurement microscope device, image generating method, measurement microscope device operation program, and computer-readable recording medium
CN1212004C (en) Image processing device and method
KR101352349B1 (en) Exposure control apparatus and image pickup apparatus
JP4665780B2 (en) Face importance degree determination apparatus, method, and imaging apparatus
JP5841427B2 (en) Image processing apparatus and image processing method
US8878977B2 (en) Image processing apparatus having a candidate focus position extracting portion and corresponding focus adjusting method
CN110196576B (en) Image processing system and setting method
JP5818651B2 (en) Image processing device
JP4310317B2 (en) Visible component ratio calculation method and optical instrument using the same
JP6587894B2 (en) Image processing sensor, image processing method, and computer program
JP5014966B2 (en) Magnifying observation device
JP6045429B2 (en) Imaging apparatus, image processing apparatus, and image processing method
JP2019133311A (en) Image processing sensor and image processing method and computer program
JP2013108798A (en) Image processing device and determination threshold setting method to be used in the same
JP2019102986A (en) Endoscope system
JP6390163B2 (en) Information processing apparatus, information processing method, and program
JP2013140053A (en) Image processor and image processing method
JP2016065875A (en) Image processing device and image processing method
JP5282461B2 (en) Imaging device
US8532378B2 (en) Imaging device, method of adjusting color shift of display monitor and color shift adjuster of display monitor
JP5934516B2 (en) Inspection area display device and inspection area display method
JP5826612B2 (en) Image processing apparatus, image processing method, and computer program
JP5921190B2 (en) Image processing apparatus and image processing method
JP5924577B2 (en) Position detection device
JP6196148B2 (en) Defocus control device and defocus control method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180831

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190709

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: 20190820

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190911

R150 Certificate of patent or registration of utility model

Ref document number: 6587894

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250