JP4581424B2 - Appearance inspection method and image processing apparatus - Google Patents

Appearance inspection method and image processing apparatus Download PDF

Info

Publication number
JP4581424B2
JP4581424B2 JP2004048607A JP2004048607A JP4581424B2 JP 4581424 B2 JP4581424 B2 JP 4581424B2 JP 2004048607 A JP2004048607 A JP 2004048607A JP 2004048607 A JP2004048607 A JP 2004048607A JP 4581424 B2 JP4581424 B2 JP 4581424B2
Authority
JP
Japan
Prior art keywords
value
pixels
differential
equal
bubble
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
JP2004048607A
Other languages
Japanese (ja)
Other versions
JP2005241304A (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.)
Panasonic Corp
Panasonic Electric Works Co Ltd
Original Assignee
Panasonic Corp
Matsushita Electric Works Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Panasonic Corp, Matsushita Electric Works Ltd filed Critical Panasonic Corp
Priority to JP2004048607A priority Critical patent/JP4581424B2/en
Publication of JP2005241304A publication Critical patent/JP2005241304A/en
Application granted granted Critical
Publication of JP4581424B2 publication Critical patent/JP4581424B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Description

本発明は容器内の液体の外観を検査する外観検査方法及び画像処理装置に関するものである。 The present invention relates to an appearance inspection method and an image processing apparatus for inspecting the appearance of a liquid in a container.

従来、容器内の液体に対する異物を検知する検査方法として、複数の照明(2台)と複数の撮像カメラ(4台)で照明・撮像方向を切り替え、微分処理によって気泡と異物を検出する検査方法(例えば特許文献1)や、透過光と、反射光の光量を相対的に調節し、気泡を高輝度に、異物に低輝度にそれぞれ表出させることにより、異物と気泡とを輝度の相違により判別する検査方法(例えば特許文献2)、更に時系列画像の各画素最小輝度を用いて泡を除去した比較検査画像を生成し、この差分画像より異物を検出方法(例えば特許文献3)があった。
特開平9−325122号公報(図1,段落番号0021) 特開2001−116703号公報 特許3295628号公報
Conventionally, as an inspection method for detecting a foreign matter with respect to a liquid in a container, an inspection method for detecting bubbles and foreign matters by switching illumination / imaging directions with a plurality of illuminations (2 units) and a plurality of imaging cameras (4 units) and performing differential processing. (For example, Patent Document 1) or by adjusting the amount of transmitted light and reflected light relative to each other to cause bubbles to be exposed with high brightness and to allow foreign objects to be exposed with low brightness. There is an inspection method for discriminating (for example, Patent Document 2), a comparative inspection image from which bubbles are removed using the minimum luminance of each pixel of a time-series image, and a method for detecting foreign matter from this difference image (for example, Patent Document 3). It was.
Japanese Patent Laid-Open No. 9-325122 (FIG. 1, paragraph number 0021) JP 2001-116703 A Japanese Patent No. 3295628

前記従来例の内、特許文献1の方法では、複数台の撮影カメラと、照明とを必要とし、装置の大型化やコスト高が避けられないという問題があった。また特許文献2の方法では、透過光の光源と、反射光の光源とを必要とするとともに照明の光量を調節する手段を必要とした。また更に特許文献3の方法では、検査対象となる液体が入った容器を回転テーブル上に載せ、容器の回転と停止とを繰り返したり、容器を移動させることで、液体内の異物を旋回させ、その旋回画像を捉えようとするものであり、容器を回転や移動させる手段が必要であった。   Among the conventional examples, the method of Patent Document 1 requires a plurality of photographing cameras and illumination, and there is a problem in that the size and cost of the apparatus cannot be avoided. The method of Patent Document 2 requires a light source for transmitted light and a light source for reflected light, and also requires means for adjusting the amount of illumination light. Furthermore, in the method of Patent Document 3, the container containing the liquid to be inspected is placed on the rotary table, and the container is rotated and stopped repeatedly, or the container is moved to turn the foreign matter in the liquid, It is intended to capture the turning image, and means for rotating and moving the container is necessary.

本発明は、上述の点に鑑みて為されたもので、その目的とするところは、容器を回転させることなく、静止した状態で容器内の液体内の泡を精度良く検出することができる外観検査方法及び画像処理装置を提供することにある。 The present invention has been made in view of the above points, and its object is to provide an external appearance capable of accurately detecting bubbles in a liquid in a container in a stationary state without rotating the container. An object is to provide an inspection method and an image processing apparatus .

上述の目的を達成するために、請求項1の発明では、外部から内部が撮像可能な透明若しくは半透明な容器に封入された液体の外観検査法において、該容器外から液体を撮像手段で撮像し、濃淡画像として保持する撮像過程と、撮像した濃淡画像の中で、予め設定された検査領域内の各画素について空間的な微分処理を行って微分値画像及び微分方向値画像を生成する微分処理過程と、微分値画像の検査領域内をラスタ走査し、所定の微分値以上の値を持つ画素を探索し、この探索で抽出した画素を泡候補点とする泡候補点抽出過程と、抽出した泡候補点を始点として、周辺画素に他の泡候補点が存在する場合はこれら泡候補点を連結処理して泡の輪郭を抽出して泡候補部とする泡候補部の輪郭抽出過程と、抽出された泡候補部の輪郭に外接する外接矩形を設定する泡外接矩形設定過程と、設定された泡外接矩形内部に縦方向と横方向のうち少なくともいずれかの方向に検査ラインを設定し、該検査ラインが交差する泡候補部の輪郭の数、該検査ライン上の画素のうち所定の微分値以上の値を持つ画素の微分方向値の種別数、該検査ライン上の画素のうち所定の微分値以上の値を持つ画素の総和、または、該検査ライン上の画素のうち所定の微分値以上の値を持つ画素の追跡処理において始点に戻る追跡ラインのいずれかを用いて、泡候補部に泡が存在するか否かを判定する判定過程とを有することを特徴とする。 To achieve the above object, the invention of claim 1, in the appearance inspection how the liquid inside is sealed in a transparent or translucent container capable imaging externally, by the imaging means of liquid from the vessel outside An imaging process of capturing and holding as a grayscale image, and generating a differential value image and a differential direction value image by performing spatial differential processing on each pixel in a preset inspection region in the captured grayscale image A differential processing process, a raster scan within the inspection area of the differential value image, search for a pixel having a value equal to or greater than a predetermined differential value, and a bubble candidate point extraction process using the pixel extracted in this search as a bubble candidate point; When the extracted bubble candidate point is the starting point, if there are other bubble candidate points in the surrounding pixels, these bubble candidate points are concatenated to extract the bubble outline and use it as the bubble candidate part. And outside the outline of the extracted bubble candidate part A bubble circumscribed rectangle setting process for setting a circumscribed rectangle to be set, and an inspection line is set in at least one of the vertical direction and the horizontal direction inside the set bubble circumscribed rectangle, and the bubble candidate portion where the inspection line intersects is set. The number of contours, the number of types of differential direction values of pixels having a value greater than or equal to a predetermined differential value among the pixels on the inspection line, and the total sum of pixels having a value greater than or equal to the predetermined differential value among pixels on the inspection line Or using any of the tracking lines that return to the start point in the tracking process of pixels having a value equal to or greater than a predetermined differential value among the pixels on the inspection line, to determine whether or not bubbles exist in the bubble candidate portion And a determination process.

請求項1の発明によれば、検査領域内の微分処理により、泡候補部の輪郭の内部に設定した検査ラインを設定して、その検査ライン上の各画素を用いて泡候補部にが存在するか否かを判定するので、単なる二値化処理などと比較して、精度良い検出ができる。 According to the first aspect of the present invention, the inspection line set inside the outline of the bubble candidate portion is set by differential processing in the inspection region, and the bubbles are formed in the bubble candidate portion using each pixel on the inspection line. since but to determine whether there is, in comparison with such a mere binarization processing, it is accuracy better detection.

請求項2の発明では、請求項1の発明において、前記判定過程において、設定した検査ラインが交差する泡候補部の輪郭の数により、泡候補部にが存在するか否かを判定することを特徴とする。 In the invention of claim 2, determined in the invention of claim 1, in the determining step, the number of the contour of the bubble candidate section inspection lines set intersect, whether bubbles are present in the bubble candidate section It is characterized by doing.

請求項2の発明によれば、検査ライン上のラスタ走査による画素のカウントを行うことのみで、泡を検出することが可能であり、高速で泡の検出ができる。   According to the second aspect of the present invention, it is possible to detect bubbles only by counting pixels by raster scanning on the inspection line, and it is possible to detect bubbles at high speed.

請求項3の発明では、請求項1の発明において、前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとり、その種別数の値が所定の閾値以上であれば、泡候補部にが存在すると判定することを特徴とする。 According to a third aspect of the present invention, in the first aspect of the invention, in the determination process, the number of types of differential direction values of pixels having a value equal to or greater than a predetermined differential value is determined for the pixels on the set inspection line. If the value of the number is equal to or greater than a predetermined threshold, it is determined that bubbles are present in the bubble candidate portion .

請求項3の発明によれば、泡の輪郭線の内側と外側で、微分方向値が異なる特徴を利用して、検査ライン上に異なる微分方向値の画素が複数存在すると仮定しているので、精度の高い泡の検出ができる。 According to the invention of claim 3, since it is assumed that there are a plurality of pixels having different differential direction values on the inspection line by utilizing the feature that the differential direction values are different between the inside and the outside of the outline of the bubble . It can be detected with high accuracy foam.

請求項4の発明では、請求項1の発明において、前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の総和をとり、その総和の値が所定の閾値以上であれば、泡候補部にが存在すると判定することを特徴とする。 According to a fourth aspect of the present invention, in the first aspect of the present invention, in the determination process, the sum of pixels having a value equal to or greater than a predetermined differential value is calculated among the pixels on the set inspection line, and the total value is a predetermined value. If it is more than a threshold value, it will determine with a bubble existing in a bubble candidate part, It is characterized by the above-mentioned.

請求項4の発明によれば、泡候補部の輪郭内部の局所的に低い微分値が存在する部分のようなノイズを除去することで、泡部の安定した検出ができる。   According to the fourth aspect of the present invention, it is possible to stably detect the bubble portion by removing noise such as a portion where a locally low differential value exists within the outline of the bubble candidate portion.

請求項5の発明では、請求項1の発明において、前記判定過程において、設定した検査ライン上の画素で、1本の検査ライン毎の、所定の微分値以上の値を持つ画素の微分方向値の種別数をとり、その種別数の値が所定値以上である検査ラインの総和が所定の閾値以上であれば、泡候補部にが存在すると判定することを特徴とする。 According to a fifth aspect of the present invention, in the first aspect of the invention, in the determination process, the differential direction value of a pixel having a value equal to or greater than a predetermined differential value for each inspection line in the set inspection line. It is characterized in that it is determined that bubbles are present in the bubble candidate portion if the sum of the inspection lines whose value of the number of types is equal to or greater than a predetermined value is equal to or greater than a predetermined threshold.

請求項5の発明によれば、検査ライン上に複数の微分方向値を持つ場合に、泡が存在すると予測できるが、複数の検査ラインの情報を用いることにより、より精度の高い泡の検出ができる。   According to the invention of claim 5, it can be predicted that bubbles exist when there are a plurality of differential direction values on the inspection line, but by using the information of the plurality of inspection lines, detection of bubbles with higher accuracy can be performed. it can.

請求項6の発明では、請求項1の発明において、前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとるとともに、その微分方向値を持つ画素間に存在する画素の濃淡値を測定し、その測定値が所定の閾値以下の値を持つ場合に、泡候補部に泡が存在すると判定することを特徴とする。 According to a sixth aspect of the invention, in the first aspect of the invention, in the determination process, the number of types of differential direction values of pixels having a value equal to or greater than a predetermined differential value is obtained in the pixels on the set inspection line. A gray value of pixels existing between pixels having a differential direction value is measured, and when the measured value has a value equal to or smaller than a predetermined threshold, it is determined that bubbles exist in the bubble candidate portion.

請求項6の発明によれば、検査ライン上に複数の微分方向値及び輪郭上の濃淡データを用いることにより安定した泡の検出ができる。 According to the sixth aspect of the present invention , stable bubble detection can be performed by using a plurality of differential direction values and density data on the contour on the inspection line.

請求項7の発明では、請求項1の発明において、前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとるとともに、その微分方向値を持つ画素間に存在する画素の濃淡値を測定し、その測定値が所定値以上である画素で囲まれた領域の面積が所定の閾値以上の場合に、泡候補部に泡が存在すると判定することを特徴とする。 In the invention of claim 7, in the invention of claim 1, in the determination process, the number of types of differential direction values of pixels having a value greater than or equal to a predetermined differential value is obtained in the pixels on the set inspection line. When the gray value of pixels existing between pixels having a differential direction value is measured, and the area of the region surrounded by the pixels whose measured value is equal to or greater than a predetermined value is equal to or greater than a predetermined threshold, bubbles are generated in the bubble candidate portion. It is determined that it exists.

請求項7の発明によれば、泡候補部の輪郭の濃淡値及び泡候補部の輪郭の幅が予めある程度特定できる場合に、泡を安定して検出することができる。 According to the seventh aspect of the present invention , bubbles can be stably detected when the shade value of the outline of the bubble candidate part and the width of the outline of the bubble candidate part can be specified to some extent in advance.

請求項8の発明では、請求項1の発明において、前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとり、その微分方向値を持つ画素間に存在する画素の濃淡値を測定し、その測定値が所定値以上である画素で囲まれた領域の面積が所定の閾値以上、且つ前記領域の外周囲長が所定の閾値以上の場合に、泡候補部に泡が存在すると判定することを特徴とする。 According to an eighth aspect of the present invention, in the first aspect of the invention, in the determination process, the number of types of differential direction values of pixels having a value equal to or greater than a predetermined differential value is determined for the pixels on the set inspection line. measuring the gray value of the pixels existing between the pixels having the direction value, at which measurements are Jo Tokoro threshold above the area of the region surrounded by the pixel is greater than or equal to a predetermined value, and the outer perimeter of the area When the value is equal to or greater than a predetermined threshold, it is determined that bubbles exist in the bubble candidate portion.

請求項8の発明によれば、輪郭部の濃淡値及び輪郭部の幅が予めある程度特定できる場合に、面積及び周囲長を併せて判定条件とすることにより、安定した泡の検出ができる。 According to the invention of claim 8, when the width of the gray value and the contour of the contour portion can be pre-specified to some extent, by the judgment condition along the area and perimeter can detect stable foam.

請求項9の発明では、請求項1の発明において、前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとるとともに、その微分方向値を持つ画素間に存在する画素の濃淡値を測定し、その測定値が所定値以下である画素で囲まれる領域の面積が、所定の閾値以上の値を持ち、且つ前記領域の平均濃淡値が、所定の閾値以下を持つ場合に、泡候補部に泡が存在すると判定することを特徴とする。 In the invention of claim 9, in the invention of claim 1, in the determination process, the number of types of differential direction values of pixels having a value greater than or equal to a predetermined differential value is obtained in the pixels on the set inspection line. Measures the gray value of pixels existing between pixels having a differential direction value, and the area of the region surrounded by the pixels whose measured value is less than or equal to a predetermined value has a value equal to or greater than a predetermined threshold, and the average of the regions When the gray value has a predetermined threshold value or less , it is determined that bubbles exist in the bubble candidate portion.

請求項9の発明によれば、泡候補部の輪郭の濃淡値及び泡候補部の輪郭の幅が予めある程度特定できる場合に、面積及び輪郭上に存在する複数の画素の濃淡値データを用いることにより泡の安定した検出ができる。 According to the invention of claim 9, when the width of the contour of the gray values and foam candidate portions of the contour of the bubble candidate parts can be pre-specified to some extent, the use of the gray value data of a plurality of pixels existing on the area and the contour Can stably detect bubbles.

請求項10の発明では、請求項1の発明において、前記判定過程において、設定した検査ライン上の画素で、1検査ライン毎に、所定の微分値以上の値を持つ画素の微分方向値の種別数をとり、その種別数の値が所定値以上の検査ラインについて、その検査ラインが連続する数が所定の閾値以上を持つ場合に、泡候補部にが存在すると判定することを特徴とする。 According to a tenth aspect of the present invention, in the first aspect of the invention, in the determination process, the type of differential direction value of a pixel having a value greater than or equal to a predetermined differential value for each inspection line in the pixels on the set inspection line. take the number, for the value of the type number is a predetermined value or more test lines, and wherein the determining the number of the inspection lines are consecutive when having a predetermined threshold value or more, the foam is present in the bubble candidate section To do.

請求項10の発明によれば、泡の輪郭線の内側と外側で、微分方向値が異なる特徴を利用して、検査ライン上に異なる微分方向値の画素が複数存在すると仮定しており、更に複数の検査ラインにまたがる連続性を考慮するので、泡の検出を安定して行うことができる。   According to the invention of claim 10, it is assumed that there are a plurality of pixels having different differential direction values on the inspection line by utilizing a feature having different differential direction values inside and outside the outline of the bubble, Since continuity across a plurality of inspection lines is taken into account, the detection of bubbles can be performed stably.

請求項11の発明では、請求項1の発明において、前記判定過程において、設定した検査ライン上の画素で、1検査ライン毎に、所定の微分値以上の値を持つ画素の微分方向値の種別数をとり、前の検査ライン上に2より大きい予め設定された所定数以上の方向の微分方向値を持つ画素が存在し、次の検査ライン上に1方向か、或いは2方向の微分方向値を持つ画素しか存在しない場合に、或いは前の検査ライン上に1方向か、2方向の微分方向値を持つ画素が存在し、次の検査ライン上に前記の所定数以上の方向の微分方向値を持つ画素が存在する場合に、泡候補部にが存在すると判定することを特徴とする。 According to an eleventh aspect of the present invention, in the first aspect of the invention, in the determination step, the type of differential direction value of a pixel having a value greater than or equal to a predetermined differential value for each inspection line in the pixels on the set inspection line. A pixel having a differential direction value in a predetermined direction greater than a predetermined number greater than 2 is present on the previous inspection line, and the differential direction value in one direction or two directions is present on the next inspection line. Or there is a pixel having a differential direction value in one direction or two directions on the previous inspection line, and a differential direction value in the direction equal to or greater than the predetermined number on the next inspection line. When there is a pixel having, it is determined that a bubble is present in the bubble candidate portion .

請求項11の発明によれば、泡の輪郭線の内側と外側で、微分方向値が異なる特徴を利用して、検査ライン上に異なる微分方向値の画素が複数存在すると仮定しており、更に複数の検査ラインの連続性の情報を用いているので精度の高い泡の検出ができる。   According to the invention of claim 11, it is assumed that there are a plurality of pixels having different differential direction values on the inspection line by using a feature having different differential direction values inside and outside the outline of the bubble. Since information on the continuity of a plurality of inspection lines is used, it is possible to detect bubbles with high accuracy.

請求項12の発明では、請求項1の発明において、前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとるとともに、その微分方向値を持つ画素間に存在する画素の濃淡値を測定し、その測定値が所定値以上である画素で囲まれる領域の面積が、所定の閾値以上の値を持ち、且つ前記領域の平均濃淡値が、オフセットを設定した所定の閾値以上の値を持つ場合に、泡候補部に泡が存在すると判定することを特徴とする。 In the invention of claim 12, in the invention of claim 1, in the determination process, the number of types of differential direction values of the pixels having a value equal to or greater than a predetermined differential value is obtained in the pixels on the set inspection line. The gray value of pixels existing between pixels having a differential direction value is measured, and the area of the region surrounded by pixels whose measured value is equal to or greater than a predetermined value has a value equal to or greater than a predetermined threshold, and the average of the regions When the gray value has a value equal to or greater than a predetermined threshold value for which an offset is set, it is determined that bubbles are present in the bubble candidate portion.

請求項12の発明によれば、泡候補部の輪郭の濃淡値及び泡候補部の輪郭の幅が予めある程度特定できる場合に、面積及び輪郭上に存在する複数の画素の濃淡値データを用い、また平均濃淡値のマージンを考慮して、柔軟な泡の検出ができる。 According to the invention of claim 12, when the width of the contour of the gray values and foam candidate portions of the contour of the bubble candidate parts can be pre-specified to some extent, using the gray value data of a plurality of pixels existing on the area and contour, In addition, flexible bubbles can be detected in consideration of the margin of the average gray value.

請求項13の発明では、請求項1の発明において、前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとり、その種別数の値が所定値以上の場合の微分方向値を持つ画素の両側に濃淡値測定用画素を設定して2つの濃淡値測定用画素間の濃淡差を求め、その濃淡差の絶対が所定の閾値以上の値を持つ場合に、泡候補部に泡が存在すると判定することを特徴とする。 According to a thirteenth aspect of the present invention, in the first aspect of the invention, in the determination process, the number of types of differential direction values of pixels having a value equal to or greater than a predetermined differential value is determined for the pixels on the set inspection line. the value of the number to set the gray value measurement pixels on either side of a pixel having a differential direction value of not less than a predetermined value obtains a shading difference between two gray values the measuring pixel, the absolute value of the shading difference is Tokoro When it has a value equal to or greater than a certain threshold value, it is determined that bubbles exist in the bubble candidate portion.

請求項13の発明によれば、泡候補部の輪郭の両側に位置する画素間の濃淡差を測定することにより、泡候補の境界の情報をより精度良く調べることができ、安定した泡の検出が可能である。   According to the invention of claim 13, by measuring the density difference between pixels located on both sides of the outline of the bubble candidate portion, the information on the boundary of the bubble candidate can be examined more accurately, and stable bubble detection is possible. Is possible.

請求項14の発明では、請求項1の発明において、前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとり、その種別数の値が所定値以上の場合の微分方向値を持つ画素の両側に、濃淡値測定用画素を設定して2つの濃淡値測定用画素間の濃淡差を求め、その濃淡差の値が所定値以上である検査ラインが連続して存在するか否かを調べ、濃淡差の値が所定値以上である検査ラインが所定の閾値以上連続して存在する場合に、泡候補部に泡が存在すると判定することを特徴とする。 In the invention of claim 14, in the invention of claim 1, in the determination process, the number of types of differential direction values of pixels having a value equal to or greater than a predetermined differential value is determined for the pixels on the set inspection line. A gray value measurement pixel is set on both sides of a pixel having a differential direction value when the value of the number is equal to or greater than a predetermined value, and a gray level difference between the two gray value measurement pixels is obtained. checks whether the test line is a value or more continuously present, when the inspection line values of shading difference is the predetermined value or more is present to continue the predetermined threshold value than the upper communication, foam bubble candidate section It is characterized by determining that exists.

請求項14の発明によれば、泡候補部の輪郭の両側に位置する画素間の濃淡差を測定することにより、泡候補の境界の情報をより精度良く調べることができ、また複数の検査ラインの情報を用いて連続性を判定することにより、安定した泡の検出ができる。   According to the invention of claim 14, by measuring the density difference between the pixels located on both sides of the outline of the bubble candidate portion, it is possible to check the boundary information of the bubble candidate more accurately, and a plurality of inspection lines By determining the continuity using the information, stable foam can be detected.

請求項15の発明では、請求項1の発明において、前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素について、その微分方向値に基づいて追跡処理を行い、始点に戻る追跡ラインが2本以上存在する場合に、泡候補部にが存在すると判定することを特徴とする。 According to a fifteenth aspect of the present invention, in the first aspect of the invention, in the determination process, a pixel having a value greater than or equal to a predetermined differential value among the pixels on the set inspection line is subjected to tracking processing based on the differential direction value. If there are two or more tracking lines that return to the starting point, it is determined that bubbles are present in the bubble candidate portion .

請求項15の発明によれば、泡候補部の輪郭が外側と内側の2本存在することを仮定して、輪郭上の画素を追跡することにより単純な処理で泡の判定ができる。
請求項16の発明では、外部から内部が撮像可能な透明若しくは半透明な容器に封入された液体の外観検査装置に、該容器外から液体を撮像する撮像手段とともに用いられる画像処理装置において、演算部と、画像メモリ領域と、微分画像メモリ領域と、微分方向画像メモリ領域とを備え、演算部は、撮像手段で撮像された濃淡画像を原画像とし、原画像のデータを画像メモリ領域に格納させる過程と、撮像された濃淡画像の中で、予め設定された検査領域内の各画素について空間的な微分処理を行って微分値画像及び微分方向値画像を生成し、微分値画像の画像データを微分画像メモリ領域に格納させ、微分方向値画像の画像データを微分方向画像メモリ領域に格納させる微分処理過程と、微分値画像の検査領域内をラスタ走査し、所定の微分値以上の値を持つ画素を探索し、この探索で抽出した画素を泡候補点とする泡候補点抽出過程と、抽出した泡候補点を始点として、周辺画素に他の泡候補点が存在する場合はこれら泡候補点を連結処理して泡の輪郭を抽出して泡候補部とする泡候補部の輪郭抽出過程と、抽出された泡候補部の輪郭に外接する外接矩形を設定する泡外接矩形設定過程と、設定された泡外接矩形内部に縦方向と横方向のうち少なくともいずれかの方向に検査ラインを設定し、該検査ラインが交差する泡候補部の輪郭の数、該検査ライン上の画素のうち所定の微分値以上の値を持つ画素の微分方向値の種別数、該検査ライン上の画素のうち所定の微分値以上の値を持つ画素の総和、または、該検査ライン上の画素のうち所定の微分値以上の値を持つ画素の追跡処理において始点に戻る追跡ラインのいずれかを用いて、泡候補部に泡が存在するか否かを判定する判定過程との各過程の処理を行うことを特徴とする。
請求項16の発明によれば、検査領域内の微分処理により、泡候補部の輪郭の内部に設定した検査ラインを設定して、その検査ライン上の各画素を用いて、泡候補部に泡が存在するか否かを判定するので、単なる二値化処理などと比較して、精度良い検出ができる。
According to the fifteenth aspect of the present invention, it is possible to determine a bubble by a simple process by tracking the pixels on the contour on the assumption that there are two contours of the foam candidate portion on the outer side and the inner side.
According to the sixteenth aspect of the present invention, in an image processing apparatus used for an appearance inspection apparatus for a liquid sealed in a transparent or translucent container capable of imaging the inside from the outside, together with an imaging means for imaging the liquid from the outside of the container, Unit, an image memory area, a differential image memory area, and a differential direction image memory area, and the arithmetic unit uses the grayscale image captured by the imaging means as the original image and stores the data of the original image in the image memory area And a differential image and differential direction value image are generated by performing spatial differential processing on each pixel in a preset inspection region in the captured grayscale image, and image data of the differential image Is stored in the differential image memory area, the differential processing step of storing the image data of the differential direction value image in the differential direction image memory area, and raster scanning in the inspection area of the differential value image, Search for pixels with a value greater than or equal to the fractional value, and use the extracted bubbles as candidate points to extract the bubble candidate points, and other bubble candidate points exist in the surrounding pixels starting from the extracted bubble candidate points When the bubble candidate points are connected, the bubble extraction is performed to extract the bubble outline, and the bubble candidate part outline extraction process is set, and the circumscribed rectangle that circumscribes the extracted bubble candidate part outline is set. The circumscribed rectangle setting process, the inspection line is set in at least one of the vertical direction and the horizontal direction inside the set bubble circumscribed rectangle, and the number of the contours of the bubble candidate portion where the inspection line intersects, the inspection line The number of types of differential direction values of pixels having a value greater than or equal to a predetermined differential value among the upper pixels, the sum of pixels having a value greater than or equal to the predetermined differential value among the pixels on the inspection line, or on the inspection line A pixel with a value greater than or equal to a predetermined differential value Using any of the tracking line back to the starting point in the sense, and performs processing of each process with the determination process whether bubbles are present in the foam candidate section.
According to the sixteenth aspect of the present invention, an inspection line set inside the outline of the bubble candidate portion is set by differential processing in the inspection region, and bubbles are added to the bubble candidate portion using each pixel on the inspection line. Therefore, it is possible to detect with high accuracy compared with a simple binarization process.

本発明は、検査領域内の微分処理により、泡候補部の輪郭の内部に設定した検査ラインを設定して、その検査ライン上の各画素について、泡候補部にが存在するか否かを判定するので、単なる二値化処理などと比較して、精度良い検出が可能となるという効果がある。 The present invention sets the inspection line set inside the outline of the bubble candidate part by differential processing in the inspection region, and for each pixel on the inspection line, whether or not bubbles exist in the bubble candidate part. since the determination, as compared with such a mere binarization processing, there is an effect that accuracy better detection becomes possible.

図6は、本発明の外観検査方法を実施する外観検査装置の概略構成を示す。この外観検査装置における、透明又は半透明の容器1に封入された液体が被検査対象であって、容器1を挟んで照明装置2と、容器1外から内部の液体を撮像する撮像手段としてCCDカメラ3を配置する。CCDカメラで撮像された画像データは画像処理装置4に取り込まれ、画像処理装置4は、取り込んだ画像データを用いて各種演算処理を行うとともに、その演算処理結果を用いて判定処理した結果を画像モニタ装置5やPLCなどの外部機器6に出力して、機器の制御を行う。   FIG. 6 shows a schematic configuration of an appearance inspection apparatus for implementing the appearance inspection method of the present invention. In this appearance inspection apparatus, the liquid enclosed in the transparent or translucent container 1 is the object to be inspected, and the CCD is used as an imaging device for imaging the liquid inside the illumination apparatus 2 and the container 1 with the container 1 in between. A camera 3 is arranged. The image data picked up by the CCD camera is taken into the image processing device 4, and the image processing device 4 performs various arithmetic processing using the acquired image data, and the result of the determination processing using the arithmetic processing result is converted into an image. The data is output to an external device 6 such as a monitor device 5 or PLC to control the device.

図7は画像処理装置4の内部構成を詳細に示したものであって、CCDカメラ3からのアナログの画像データをA/D変換するA/D変換器7と、画像を画像モニタ装置5に映し出すためにデジタル化された画像データを保持するVRAM8と、VRAM8で保持された画像データをD/A変換して画像モニタ装置5へ出力するD/A変換器9と、主メモリ部10と、データやプログラムを格納しているフラッシュロム11と、演算処理を行うためのCPU等からなる演算部12と、VRAM8、RAM等からなる主メモリ部10及び演算部12に対してクロック等を与える信号制御部13と、演算部12の制御の下で外部機器6を制御するためのコマンドなどを外部機器6へ送る外部制御部14とで構成され、主メモリ部10は、画像データを格納する画像メモリ領域10aと、後述する微分画像を格納する微分画像データを格納する微分画像メモリ領域10bと、微分方向画像データを格納する微分方向画像メモリ領域10cと、フラッシュロム11から読み出された画像処理プログラムやデータを格納するための画像処理プログラムメモリ領域10dの各領域が設定される。   FIG. 7 shows the internal configuration of the image processing device 4 in detail. An A / D converter 7 for A / D converting analog image data from the CCD camera 3 and an image to the image monitor device 5 are shown. A VRAM 8 that holds digitized image data for projection; a D / A converter 9 that D / A converts the image data held in the VRAM 8 and outputs the converted image data to the image monitor device 5; Flash ROM 11 storing data and programs, an arithmetic unit 12 including a CPU for performing arithmetic processing, a signal for giving a clock and the like to the main memory unit 10 and the arithmetic unit 12 including VRAM 8 and RAM The control unit 13 and an external control unit 14 that sends commands for controlling the external device 6 under the control of the calculation unit 12 to the external device 6. The main memory unit 10 includes image data. Is read from the flash ROM 11, the differential image memory area 10 b for storing differential image data for storing differential images to be described later, the differential direction image memory area 10 c for storing differential direction image data, and the flash ROM 11. Each area of the image processing program memory area 10d for storing the processed image processing program and data is set.

以上のように構成される外観検査装置を用い、液体よりも灰色に見え、また径が所定以下の小さい泡以外は、内部に液体と同様の明るさを持ち、且つ微分方向画像では二重になるという泡の特徴と、液体よりも灰色から黒色であって、内部には明るくないという異物の特徴とを用いて泡と異物を識別するという本発明の外観検査方法を一実施形態により説明する。   Using the appearance inspection apparatus configured as described above, it has the same brightness as the liquid inside, except for bubbles that appear grayer than the liquid and have a diameter smaller than a predetermined value, and double in the differential direction image. An embodiment of the appearance inspection method of the present invention for identifying bubbles and foreign matters using the feature of bubbles and the feature of foreign matters that are gray to black rather than liquid and not bright inside is explained by an embodiment. .

本実施形態では、図1に示すフローチャートによる手順により外観検査が進められることになる。   In the present embodiment, the appearance inspection is advanced by the procedure according to the flowchart shown in FIG.

最初のステップS1では検査対象である液体が封入されている容器1をCCDカメラ3で撮像するステップであって、この撮像はオペレータの操作により行われる。   The first step S1 is a step in which the CCD camera 3 images the container 1 in which the liquid to be inspected is sealed, and this imaging is performed by an operator's operation.

この撮像によって得られた濃淡画像からなる原画像は、図2(a)に示すようになる。この図2(a)で示す原画像中、矩形部20は容器1と背景との境界部であり、また液体中に泡や異物があると、液体に対して暗い輪郭を持つ部位21が原画像に存在することになる。   An original image composed of grayscale images obtained by this imaging is as shown in FIG. In the original image shown in FIG. 2A, a rectangular portion 20 is a boundary portion between the container 1 and the background, and if there are bubbles or foreign matter in the liquid, a portion 21 having a dark outline with respect to the liquid is generated. Will be present in the image.

さて画像処理装置4では、演算処理ブログラムに沿って動作する演算部12の制御の下で、原画像データをVRAM8に保持した上で画像モニタ装置5に原画像を表示させるとともに画像メモリ領域10aに格納する。   In the image processing apparatus 4, under the control of the arithmetic unit 12 operating along the arithmetic processing program, the original image data is held in the VRAM 8, the original image is displayed on the image monitor apparatus 5, and the image memory area 10a is displayed. To store.

オペレータは原画像を見ながら矩形部20内に検査領域22を図2(b)に示すように設定する。この設定は、例えば演算部12の制御下で作られるGUI環境を利用してマウス等のポインティングデバイスを用いて画面上に設定すれば設定情報が演算部12に取り込まれることになる。   The operator sets the inspection area 22 in the rectangular portion 20 while viewing the original image as shown in FIG. For example, if the setting is set on the screen using a pointing device such as a mouse using a GUI environment created under the control of the calculation unit 12, the setting information is taken into the calculation unit 12.

さてオペレータが前記GUI環境を通じて提示される手順に沿って、まず検査領域22内の各画素について微分処理を指示すると、演算部12は検査領域22内の各画素について微分処理(ステップS2)を行って、微分値画像及び微分方向値画像を生成し、それらの画像データを対応するメモリ領域10b、10cに格納する。   When the operator first instructs differentiation processing for each pixel in the inspection region 22 in accordance with the procedure presented through the GUI environment, the calculation unit 12 performs differentiation processing (step S2) for each pixel in the inspection region 22. Thus, a differential value image and a differential direction value image are generated, and these image data are stored in the corresponding memory areas 10b and 10c.

ここで前記輪郭部位21を含む16×16画素の領域23内を拡大する操作を行うと、図2(b)に示す原画像の領域23内の各画素の濃淡値が図3(a)に示すような場合には、微分画像の各画素の微分値は図3(b)に示すようになり、また微分方向画像の各画素の微分方向値は図3(c)に示すようになる。尚濃淡値は256階調として、25が黒を、0が白を示す。 When an operation of enlarging the area 23 of 16 × 16 pixels including the contour portion 21 is performed, the gray value of each pixel in the area 23 of the original image shown in FIG. 2B is shown in FIG. In such a case, the differential value of each pixel of the differential image is as shown in FIG. 3B, and the differential value of each pixel of the differential image is as shown in FIG. The gradation value is 256 gradations, 2 5 5 indicates black, and 0 indicates white.

さて微分処理が終了すると演算部12は、図2(c)に示すように検査領域22内のラスタ走査を行う(ステップS3)。このラスタ走査による処理は図示するように検査領域22の左上端の位置から右下端までを走査して、所定の微分値以上を持つ画素を探索し(ステップS4)、この探索により抽出した画素を泡候補点とする(ステップS5)。   When the differentiation process is completed, the arithmetic unit 12 performs raster scanning in the inspection area 22 as shown in FIG. 2C (step S3). As shown in the figure, the raster scanning process scans from the upper left position to the lower right end of the inspection area 22 to search for pixels having a predetermined differential value or more (step S4), and to extract the pixels extracted by this search. It is set as a bubble candidate point (step S5).

このラスタ走査では所定の微分値以上を持つ画素の内、輪郭の外側に位置する画素と内側に位置する画素を泡候補点として抽出する細線処理を行う。   In this raster scan, thin line processing is performed to extract pixels located outside and outside the contour of pixels having a predetermined differential value or more as bubble candidate points.

このようにして検査領域22内のラスタ走査が行われ、ステップS6でラスタ走査が終了したと判定されると、次のステップS7以降で、泡候補点の連結処理を行う。   In this way, when the raster scan in the inspection region 22 is performed and it is determined in step S6 that the raster scan has been completed, the bubble candidate point connecting process is performed in the next step S7 and subsequent steps.

つまり再度検査領域22内のラスタ走査を開始し、先に抽出した泡候補点を探索し(ステップS8)、泡候補点が存在すると、泡候補点を中心としてその周囲の8画素内に他の泡候補点が存在すれば、泡の輪郭であるとして連結する処理をステップS9で行う。そしてステップS10で検査領域22内のラスタ走査が終了したと判定されると、ステップS11へ遷移する。   In other words, raster scanning in the inspection region 22 is started again, and the previously extracted bubble candidate points are searched (step S8). If bubble candidate points exist, other bubble pixels around the bubble candidate points are located within the surrounding eight pixels. If a bubble candidate point exists, a process of connecting as a bubble outline is performed in step S9. If it is determined in step S10 that the raster scanning in the inspection area 22 has been completed, the process proceeds to step S11.

ステップS11では、図4に示す泡候補部の各輪郭に対して、演算部12は、図示するような外接矩形30を設定し、次のステップS12では外接矩形30内に図5に示すように検査ラインL1…Lnを設定し、ステップS13で設定した検査ライン上の画素の特徴を各画素(図5では○で示す)の微分値若しくは微分方向値を基に調べる。そしてその特徴が上述した泡の特徴を満たすか否かをチェックし(ステップS14)、満たす場合には検査領域22内に泡が存在すると判定し(ステップS15)、満たさない場合は検査領域22に泡が存在しないと判定する(ステップS16)。つまり泡が存在しないと判定した場合、輪郭21の起因が泡によるものではない、つまり異物によるものであると判定することができる。   In step S11, the computing unit 12 sets a circumscribed rectangle 30 as shown in the figure for each contour of the bubble candidate portion shown in FIG. 4, and in the next step S12, as shown in FIG. Inspection lines L1... Ln are set, and the characteristics of the pixels on the inspection line set in step S13 are examined based on the differential value or differential direction value of each pixel (indicated by ◯ in FIG. 5). Then, it is checked whether or not the feature satisfies the above-described bubble feature (step S14). If the feature is satisfied, it is determined that the bubble is present in the inspection region 22 (step S15). It determines with a bubble not existing (step S16). That is, when it is determined that there is no bubble, it can be determined that the cause of the contour 21 is not due to the bubble, that is, due to foreign matter.

そして演算部12は、判定結果を画像モニタ装置5にて表示させるとともに、外部機器6へ判定結果に基づいた制御出力を出す。このように上述した輪郭21が泡によるものか否かを判定することで、異物を確実に検出することができるのである。   The calculation unit 12 displays the determination result on the image monitor device 5 and outputs a control output based on the determination result to the external device 6. In this way, it is possible to reliably detect foreign matter by determining whether or not the above-described contour 21 is caused by bubbles.

次に前記の泡の判定処理の例について説明する。
(例1)
前記の泡候補点の連結で得られた泡候補部の輪郭は、泡の特徴から図4に示すように内側の輪郭と外側の輪郭からなる。この泡候補部の輪郭が外側と内側に現れることを利用して、本例では、泡の検出を行う。つまり検査ラインL1…Lnを水平方向に設定した場合、図8に示すように斜線を入れている各画素の連結線で示される泡候補部の輪郭が内側、外側の両側に存在すると、例えば検査ラインL5と交差する泡候補部の輪郭上の画素が4画素存在することになる。そこで演算部12が泡を判定する場合の基準値として、予め決めた所定の検査ライン、例えばL5と交差する画素数を設定し、ラスタ走査において検査ラインL5を走査したときに交差する画素数をカウントし、このカウント値が前記基準値と一致した場合に泡と判定する。
Next, an example of the bubble determination process will be described.
(Example 1)
As shown in FIG. 4, the outline of the foam candidate portion obtained by connecting the foam candidate points includes an inner outline and an outer outline as shown in FIG. In this example, bubbles are detected by utilizing the fact that the outline of the bubble candidate portion appears on the outside and the inside. That is, when the inspection lines L1... Ln are set in the horizontal direction, if the outlines of the bubble candidate portions indicated by the connecting lines of the hatched pixels are present on both the inner side and the outer side as shown in FIG. There are four pixels on the outline of the bubble candidate portion that intersects the line L5. Therefore, a predetermined number of pixels that intersect with a predetermined inspection line, for example, L5 is set as a reference value when the calculation unit 12 determines bubbles, and the number of pixels that intersect when the inspection line L5 is scanned in raster scanning is set. Counting is performed, and when the count value matches the reference value, it is determined as a bubble.

以上のように本例では、泡の特徴を用いて、検査ライン上のラスタ走査による画素のカウントを行うことのみで、泡を検出することができるもので、高速で泡を検出することを可能としたものである。
(例2)
本例では、上述のように泡候補部の輪郭が外側と内側に現れ、また、内側と外側で微分方向値が異なるという泡の特徴を用いて、泡の検出を行う。
As described above, in this example, bubbles can be detected only by counting pixels by raster scanning on the inspection line using the characteristics of the bubbles, and bubbles can be detected at high speed. It is what.
(Example 2)
In this example, as described above, the outline of the bubble candidate portion appears on the outside and the inside, and bubbles are detected using the feature of the bubbles that have different differential direction values on the inside and outside.

つまり、例えば図9に示すように検査ラインL5を水平方向に設定した場合、泡候補部の輪郭が内側、外側の両側に存在すると、検査ラインL5と交差する泡候補部の輪郭上に存在する画素の微分方向値は、図示例では6,2,8,4の4種類がある。そこで演算部12は例えば検査ラインL5と交差する画素の微分方向値の種別数をカウントし、予め設定しておいた所定の閾値(例えば4)以上であると、泡が存在すると判定するのである。   That is, for example, when the inspection line L5 is set in the horizontal direction as shown in FIG. 9, if the contour of the bubble candidate portion exists on both the inner side and the outer side, it exists on the contour of the bubble candidate portion that intersects the inspection line L5. In the illustrated example, there are four types of differential direction values of pixels: 6, 2, 8, and 4. Therefore, for example, the calculation unit 12 counts the number of types of differential direction values of the pixels that intersect the inspection line L5, and determines that bubbles are present if the number is greater than a predetermined threshold value (for example, 4) set in advance. .

以上のように本例では、泡の輪郭線の内側と外側で、微分方向値が異なる特徴を利用して、検査ライン上に異なる微分方向値の画素が複数存在すると仮定しているので、泡の特徴に基づいて精度の高い泡の検出を可能としたものである。
(例3)
本例では、図10に示すように泡候補部の輪郭X1,X2の内側に、泡候補部の輪郭X1,X2より濃淡差は小さいが、光量のムラαなどにより、濃淡差が発生し、微分値がある程度の大きさを持つ部分が現れる可能性があるという泡の特徴を用いたものである。
As described above, in this example, it is assumed that there are a plurality of pixels having different differential direction values on the inspection line by using the feature having different differential direction values inside and outside the outline of the bubble. This makes it possible to detect bubbles with high accuracy based on the above characteristics.
(Example 3)
In this example, as shown in FIG. 10, the density difference is smaller than the outline X1 and X2 of the bubble candidate part inside the outline X1 and X2 of the bubble candidate part, but the density difference occurs due to unevenness α of the light amount, It uses the feature of bubbles that there is a possibility that a portion having a certain size of the differential value may appear.

つまり本例の場合、設定した検査ラインL1…Ln上でラスタ走査する際に、演算部12は図10で示す検査ラインL上で、前記ムラαの微分値よりも大きな予め設定している所定値を越えている画素の数をカウントするとともに、ラスタ走査終了後、カウント値の総和と、予め設定している所定の閾値とを比較し、総和が閾値以上の場合に泡と判定するのである。   In other words, in the case of this example, when raster scanning is performed on the set inspection lines L1... Ln, the arithmetic unit 12 sets a predetermined value larger than the differential value of the unevenness α on the inspection line L shown in FIG. The number of pixels exceeding the value is counted, and after the raster scan is completed, the sum of the count values is compared with a predetermined threshold value, and if the sum is equal to or greater than the threshold value, a bubble is determined. .

以上のように本例では、泡候補部の輪郭内部の局所的に低い微分値が存在する部分のようなノイズ(光量ムラ)を除去することで、泡の安定した検出を可能としたものである。
(例4)
本例では、例2と同様に泡の特徴として、輪郭線が外側と内側に現れ、且つ内側と外側で微分方向値が異なること利用して、泡の検出を行う。
As described above, in this example, it is possible to stably detect bubbles by removing noise (light quantity unevenness) such as a portion having a locally low differential value inside the contour of the bubble candidate portion. is there.
(Example 4)
In this example, the bubble is detected by utilizing the fact that the outline appears on the outside and the inside, and the differential direction values are different between the inside and the outside, as in the case of Example 2.

つまり図9において、検査ラインL1…Lnを水平方向に設定した場合、図示するように、泡候補部の輪郭が内側、外側の両側に存在し、その微分方向値が複数種存在すると、この検査ライン上に泡が存在することが予測できる。   That is, in FIG. 9, when the inspection lines L1... Ln are set in the horizontal direction, as shown in the figure, the outline of the bubble candidate portion exists on both the inner side and the outer side, and there are multiple types of differential direction values. It can be predicted that bubbles are present on the line.

そして例2では検査ラインL5についてのみ利用したが、例えば検査ラインL6においてもL5と同様に種類の微分方向値を持つすると、4種類の微分方向値を持つ条件を満たす検査ラインが複数存在することになる。 And although only utilized for Example 2, the inspection line L5, for example, with L5 similarly to the four differential direction value even in the inspection line L6 Then, plurality of satisfying test line having four differential direction value Will do.

そこで本例では、演算部12が例えば4種類の微分方向値を持つ検査ライン数をカウントして、そのカウント値が予め設定してある閾値以上である場合、泡が存在すると判定するのである。   Therefore, in this example, the calculation unit 12 counts the number of inspection lines having, for example, four types of differential direction values, and determines that bubbles are present when the count value is equal to or greater than a preset threshold value.

以上のように本例では、検査ライン上に複数の微分方向値を持つ場合に泡が存在すると予測できる点と、複数の検査ラインの情報を用いることにより、より精度の高い泡の検出を可能としたものである。
(例5)
本例でも、泡の特徴として、例2,例4と同様に、輪郭線が外側と内側に現れ、また内側と外側で微分方向値が異なるという泡の特徴を利用して、泡の検出を行う。
As described above, in this example, it is possible to detect bubbles more accurately by using the information that can be predicted that bubbles exist when there are multiple differential direction values on the inspection line and information on the plurality of inspection lines. It is what.
(Example 5)
In this example, as in the case of Example 2 and Example 4, the detection of the bubble is performed by utilizing the feature of the bubble that the outline appears on the outside and the inside and the differential direction value is different between the inside and the outside. Do.

つまり、検査ラインL1…Lnを水平方向に設定した場合、図9に示すように、泡候補部の輪郭が内側、外側の両側に存在すると、例2で説明したように例えば検査ラインL5と交差する泡候補部の輪郭上に存在する画素の微分方向値が、6,2,8,4の4種類存在する。   That is, when the inspection lines L1... Ln are set in the horizontal direction, as shown in FIG. 9, if the outlines of the bubble candidate portions exist on both the inner and outer sides, as described in Example 2, for example, intersect with the inspection line L5. There are four types of differential direction values of 6, 2, 8, and 4 for the pixels existing on the outline of the bubble candidate portion to be performed.

そして微分方向値が6と2及び8と4の間の画素の濃淡値を測定した場合、検査ラインL5上の画素A〜D(図9参照)の濃淡値は図11に示すように画素A,B間及びC,D間の濃淡値が所定値以下となる(輪郭部は暗くなる)。   When the grayscale values of the pixels whose differential direction values are 6 and 2 and 8 and 4 are measured, the grayscale values of the pixels A to D (see FIG. 9) on the inspection line L5 are the pixel A as shown in FIG. , B and between C and D become less than a predetermined value (the contour portion becomes dark).

而して本例では、前記の特徴を生かすために、演算部12が微分方向値の濃淡値を測定し、その測定値と、予め設定してある所定の閾値とを比較することにより、測定値が閾値以下の場合に泡と判定する。   Thus, in this example, in order to make use of the above characteristics, the calculation unit 12 measures the gray value of the differential direction value, and compares the measured value with a predetermined threshold value which is set in advance. When the value is less than or equal to the threshold value, it is determined as a bubble.

以上のように本例では、 検査ライン上の微分方向値及び泡候補部の輪郭上に存在する画素の濃淡値のデータを用いることにより、泡の特徴を用いた安定した泡の検出ができるようにしたものである。
(例6)
本例は、演算部5は例5における濃淡値が所定値以下の画素の数をカウントする処理を行う。この処理は、検査ラインL5以外で、検査ライン上の画素の微分方向値が4種類以上ある他の検査ライン(図9ではL6)においても濃淡値を測定して所定値以下の画素数をカウントする処理を行う。そしてこのように処理を行った複数の検査ラインにおける画素数の総和をとることにより、つまり前記所定値以下の画素で囲まれた領域の面積値とする
そしてこの面積値を予め設定してある閾値と比較し、面積値が閾値以上ある場合に泡と判定するのである。
As described above, in this example, by using the differential direction value on the inspection line and the gray value data of the pixels existing on the outline of the bubble candidate portion, it is possible to detect bubbles stably using the characteristics of the bubbles. It is a thing.
(Example 6)
In this example, the calculation unit 5 performs a process of counting the number of pixels in which the gray value in Example 5 is equal to or less than a predetermined value. In this process, in addition to the inspection line L5, the gray value is measured in other inspection lines (L6 in FIG. 9) having four or more kinds of differential direction values of the pixels on the inspection line, and the number of pixels equal to or smaller than the predetermined value is counted. Perform the process. And by taking the sum of the number of pixels in a plurality of inspection lines have been processed in this manner, that is, the area value of the enclosed at a predetermined value or less of the pixel area.
Then, this area value is compared with a preset threshold value, and when the area value is equal to or greater than the threshold value, it is determined as a bubble.

以上のように本例では、泡候補部の輪郭の濃淡値及び泡候補部の輪郭の幅が予めある程度特定できる場合に、泡を安定して検出することを可能としたものである。
(例7)
本例では、例6で説明した領域を図12に示すように演算部12が領域Yとして抽出して、この抽出した領域Y内の面積及びその領域Yの外周囲長を測定する処理を行い、これら測定値が、予め設定しているそれぞれの閾値以上の場合に泡が存在すると判定するのである。
As described above, in this example, it is possible to stably detect bubbles when the gradation value of the outline of the bubble candidate portion and the width of the outline of the bubble candidate portion can be specified to some extent in advance.
(Example 7)
In this example, the processing unit 12 extracts the region described in Example 6 as the region Y as shown in FIG. 12, and performs processing for measuring the area in the extracted region Y and the outer perimeter of the region Y. When these measured values are equal to or greater than the preset threshold values, it is determined that bubbles are present.

以上のように本例では、泡の特徴として、泡候補部の輪郭の濃淡値及び幅が予めある程度特定できる場合に、微分方向値の濃淡値の測定値が所定値以下の画素で囲まれる領域Yの面積と、その領域Yの外周囲長とを併せて判定条件とすることにより、安定した泡の検出を可能としたものである。
(例8)
例7では、泡判定の条件に上述した領域Yの面積と、その外周囲長を用いたが、本例では、外周囲長の代わりに領域Y、つまり図11のA画素−B画素と、C画素−画素D間の平均濃淡値を求め、その平均濃淡値が予め設定した閾値以下の場合に泡の輪郭であると判定する。
As described above, in this example, as the feature of the bubble, when the gray value and width of the outline of the bubble candidate portion can be specified to some extent in advance, the region surrounded by the pixels whose measured value of the gray value of the differential direction value is a predetermined value or less By combining the area of Y and the outer perimeter of the region Y as a determination condition, stable bubble detection is possible.
(Example 8)
In Example 7, the area of the region Y described above and the outer peripheral length thereof are used as the bubble determination condition. However, in this example, instead of the outer peripheral length, the region Y, that is, the A pixel-B pixel in FIG. An average gray value between the C pixel and the pixel D is obtained, and when the average gray value is equal to or less than a preset threshold value, it is determined that the contour is a bubble.

以上のように本例では、泡候補輪郭部の濃淡値及び泡候補部の輪郭の幅が予めある程度特定できる場合に面積及び輪郭上に存在する複数の画素の濃淡値データを用いることにより泡の安定した検出を可能としたものである。
(例9)
上述したように図9で示す如く、泡候補部の輪郭が内側、外側の両側に存在すると、例えば検査ラインL5と交差する泡候補部の輪郭上に存在する画素の微分方向値が、6,2,8,4の4種類存在する。この種別数が予め設定しておいた閾値(例えば4)以上であるとして、泡が存在すると判定するのが例2であった。
As described above, in this example, when the gray value of the bubble candidate contour portion and the width of the contour of the bubble candidate portion can be specified to some extent in advance, by using the gray value data of the plurality of pixels existing on the area and the contour, Stable detection is possible.
(Example 9)
As described above, as shown in FIG. 9, when the outline of the bubble candidate part exists on both the inner and outer sides, for example, the differential direction value of the pixel existing on the outline of the bubble candidate part intersecting the inspection line L5 is 6, There are four types, 2, 8, and 4. In Example 2, it is determined that bubbles are present, assuming that the number of types is equal to or greater than a preset threshold value (for example, 4).

これに対して本例では、演算部12が検査ライン5の前後の検査ラインL4,L6,L7についても同様に処理を行って、泡の存在と判定した検査ラインの連続する数をカウントし、そのカウント値が予め設定した閾値(例えば4)以上あると、泡が存在すると判定するのである。   On the other hand, in this example, the calculation unit 12 performs the same processing for the inspection lines L4, L6, and L7 before and after the inspection line 5, and counts the number of consecutive inspection lines determined as the presence of bubbles, If the count value is equal to or greater than a preset threshold value (for example, 4), it is determined that bubbles are present.

以上のように本例では、泡の輪郭線の内側と外側で、微分方向値が異なる特徴を利用して、検査ライン上に異なる微分方向値の画素が複数存在すると仮定しており、また、複数の検査ラインにまたがる連続性を考慮することで、泡の検出を安定して行うことを可能としたものである。
(例10)
上述したように図9で示す如く、泡候補部の輪郭が内側、外側の両側に存在すると、例えば検査ラインL5では交差する泡候補部の輪郭上に存在する画素の微分方向値が、6,2,8,4の4種類存在する。この種別数が予め設定しておいた閾値(例えば4)以上であるとして、泡が存在すると判定するのが例2であった。
As described above, in this example, it is assumed that there are a plurality of pixels having different differential direction values on the inspection line, using the feature that the differential direction values are different between the inside and the outside of the outline of the bubble, By considering the continuity across a plurality of inspection lines, it is possible to stably detect bubbles.
(Example 10)
As described above, as shown in FIG. 9, when the contour of the bubble candidate portion exists on both the inner and outer sides, for example, in the inspection line L5, the differential direction value of the pixel existing on the contour of the intersecting bubble candidate portion is 6, There are four types, 2, 8, and 4. In Example 2, it is determined that bubbles are present, assuming that the number of types is equal to or greater than a preset threshold value (for example, 4).

一方図9において、例えば検査ラインL1では画素の微分方向値が、6,5,4の3種類存在するが、次の検査ラインL2では6,4の2種類しか存在しない。また検査ラインL10では8,2の2種類しか存在しないが、次の検査ライン11では8,1,2の3種類が存在する。   On the other hand, in FIG. 9, for example, there are three types of pixel differential direction values of 6, 5, and 4 in the inspection line L1, but there are only two types of 6 and 4 in the next inspection line L2. The inspection line L10 has only two types of 8, 2 but the next inspection line 11 has three types of 8, 1, 2.

本例ではこのような検査ラインの連続性のデータを用いて泡の判定を行うもので、演算部12は、例えば前の検査ラインで微分方向値の種類が1種類若しくは2種類しか存在しないが、次の検査ラインでは微分方向値の種類が例えば3種類以上存在する場合、又は前の検査ラインで微分方向値の種類が3種類以上存在して、次に検査ラインでは1種類若しくは2種類しか存在しない場合の何れかの条件が満足されていると、泡が存在すると判定するのである。   In this example, the determination of bubbles is performed using data on the continuity of such an inspection line. For example, the calculation unit 12 has only one or two types of differential direction values in the previous inspection line. In the next inspection line, for example, there are three or more types of differential direction values, or there are three or more types of differential direction values in the previous inspection line, and then only one type or two types in the next inspection line. If any condition in the absence is satisfied, it is determined that bubbles are present.

以上のように本例では、泡の輪郭線の内側と外側で、微分方向値が異なる特徴を利用して、検査ライン上に異なる微分方向値の画素が複数存在すると仮定しており、更に複数の検査ラインの連続性の情報を用いていることで、精度の高い泡の検出を可能としたものである。
(例11)
例8では平均濃淡値が所定の閾値以上あれば泡と判定しているが、本例では、演算部12の制御の下で、閾値にオフセットを設定できるようにし、演算部12がこのオフセットを設定した閾値と、例8と同様に求めた平均濃淡値とを比較して平均濃淡値が閾値以上の場合に泡と判定するのである。
As described above, in this example, it is assumed that there are a plurality of pixels having different differential direction values on the inspection line by using a feature having different differential direction values inside and outside the outline of the bubble. By using the information on the continuity of the inspection line, it is possible to detect bubbles with high accuracy.
(Example 11)
In Example 8, if the average gray value is equal to or greater than the predetermined threshold value, it is determined as a bubble. However, in this example, an offset can be set to the threshold value under the control of the calculation unit 12, and the calculation unit 12 sets the offset. The set threshold value is compared with the average gray value obtained in the same manner as in Example 8, and when the average gray value is equal to or larger than the threshold value, it is determined as a bubble.

以上のように本例では、輪郭部の濃淡値及び輪郭部の幅が予めある程度特定できる場合に面積及び輪郭上に存在する複数の画素の平均濃淡値を用い、また平均濃淡値のマージンを考慮した閾値を用いることで、柔軟な泡の検出を可能としたものである。
(例12)
上述したように図9で示すように検査ラインL1…Lnを水平方向に設定した場合、泡候補部の輪郭が内側、外側の両側に存在すると、例えば検査ラインL5と交差する泡候補部の輪郭上に存在する画素の微分方向値が、6,5,4の4種類存在する。
As described above, in this example, when the gradation value of the contour portion and the width of the contour portion can be specified to some extent in advance, the average gradation value of a plurality of pixels existing on the area and the contour is used, and the margin of the average gradation value is considered. By using the threshold value, flexible bubbles can be detected.
(Example 12)
As described above, when the inspection lines L1... Ln are set in the horizontal direction as shown in FIG. 9, if the contours of the bubble candidate portions exist on both the inner and outer sides, for example, the contour of the bubble candidate portion that intersects the inspection line L5. There are four types of differential direction values of the pixels existing above: 6, 5, and 4.

本例では、演算部12が例えば、図13に示すように検査ラインL5上の微分方向値が6の画素の両側に濃淡測定用画素(O部の内部が斜線の画素)a1,a2を設定して、画素a1,a2問の濃淡差を測定し、その絶対値が予め設定している閾値以上の場合に、泡が存在すると判定する。   In this example, as shown in FIG. 13, for example, the calculation unit 12 sets the grayscale measurement pixels (pixels inside the O portion are hatched) a1 and a2 on both sides of the pixel having the differential direction value 6 on the inspection line L5. Then, the density difference between the pixels a1 and a2 is measured, and when the absolute value is greater than or equal to a preset threshold value, it is determined that bubbles are present.

以上のように本例では、泡候補部の輪郭の両側に位置する画素間の濃淡差を測定することにより、泡候補の境界の情報をより精度良く調べることができ、安定した泡の検出を可能としたものである。
(例13)
例12では、1本の検査ライン、例えばL5に濃淡測定用画素a1、a2を設定して、その画素a1,2間の濃淡差を測定し、その絶対値が予め設定した閾値以上の場合泡が存在すると判定していたが、本例では、演算部12は、例えば検査ラインL5で泡の存在の判定した上で、次に検査ライン、例えばL6についても図13に示すように同様に濃淡測定用画素b1,b2を設定して、その画素b1,b2間の濃淡差を測定し、その濃淡差が所定の閾値以上の場合、泡が存在する判定する処理を行い、この処理後、泡と判定された検査ラインが連続している場合に、最終的に泡の存在を判定するのである。
As described above, in this example, by measuring the difference in density between pixels located on both sides of the outline of the bubble candidate portion, it is possible to examine the information on the boundary of the bubble candidate more accurately, and to detect stable bubbles. It is possible.
(Example 13)
In Example 12, a single inspection line, for example L5 sets the density measurement pixels a1, a2 to measure the shading difference between the pixel a1,2, when the absolute value thereof is equal to or greater than a preset threshold value Although it has been determined that bubbles are present, in this example, the calculation unit 12 determines the presence of bubbles in, for example, the inspection line L5, and then the inspection line, for example, L6, as shown in FIG. Set the density measurement pixels b1 and b2, measure the density difference between the pixels b1 and b2, and if the density difference is greater than or equal to a predetermined threshold, perform a process of determining the presence of bubbles, When the inspection lines determined as bubbles are continuous, the presence of bubbles is finally determined.

以上のように本例では、泡候補部の輪郭の両側に位置する画素間の濃淡差を測定することにより、泡候補の境界の情報をより精度良く調べることができ、また複数の検査ラインの情報を用いて連続性を判定することにより、安定した泡の検出を可能としているものである。
(例14)
本例は、泡候補部の輪郭が外側と内側とに現れ、また内側と外側の方向値が異なるという泡の特徴とを利用するもので、検査ラインを水平方向に設定した場合、図14に示すように、演算部12によりラスタ走査を行うときに泡候補部の輪郭の画素を始点Iから順に矢印で示すように追跡処理して、終点IIを経由して始点Iに戻ってくるような場合、その追跡線が外側と内側に2本存在する場合(場合によってはノイズなどの影響で3本以上存在する可能性もある)、泡が存在すると判定する。
As described above, in this example, by measuring the difference in density between pixels located on both sides of the outline of the bubble candidate portion, the information on the boundary of the bubble candidate can be examined more accurately, and more than one inspection line By determining continuity using information, stable bubble detection is possible.
(Example 14)
In this example, the outline of the bubble candidate portion appears on the outer side and the inner side, and the feature of the bubbles that the direction values on the inner side and the outer side are different is used. When the inspection line is set in the horizontal direction, FIG. As shown in the figure, when raster scanning is performed by the calculation unit 12, the pixels of the outline of the bubble candidate portion are tracked in order from the start point I as indicated by arrows, and returned to the start point I via the end point II. In the case where two tracking lines exist outside and inside (possibly there may be three or more due to the influence of noise or the like), it is determined that bubbles are present.

以上のように本例によれば、泡候補部の輪郭が外側と内側の2本存在することを仮定して、輪郭上の画素を追跡することにより単純な処理で泡の判定を可能としたものである。   As described above, according to this example, assuming that there are two outlines of the foam candidate part, the outer and inner sides, it is possible to determine the foam by a simple process by tracking pixels on the outline. Is.

本発明の一実施形態の基本処理のフローチャートである。It is a flowchart of the basic processing of one Embodiment of this invention. (a)は同上を用いる外観検査装置のCCDカメラで撮影した原画像例図、(b)は検査領域を設定時の画像例図、(c)は設定された検査領域に対するラスタ走査の状態図である。(A) is an example of an original image taken by a CCD camera of an appearance inspection apparatus using the same as above, (b) is an example of an image when an inspection area is set, and (c) is a state diagram of raster scanning for the set inspection area. It is. (a)は同上の泡部位の各画素の濃度値を示す拡大図、(b)は同上の泡部位の各画素の微分値を示す拡大図、(c)は同上の泡部位の各画素の微分方向値を示す拡大図である。(A) is an enlarged view showing the density value of each pixel of the bubble part, (b) is an enlarged view showing the differential value of each pixel of the bubble part, (c) is a picture of each pixel of the bubble part. It is an enlarged view which shows a differential direction value. 同上の泡候補部の輪郭を示す拡大図である。It is an enlarged view which shows the outline of a foam candidate part same as the above. 同上の検査ラインの設定説明図である。It is setting explanatory drawing of an inspection line same as the above. 同上に用いる外観検査装置の構成図である。It is a block diagram of the external appearance inspection apparatus used for the same as the above. 同上に用いる外観検査装置の画像処理装置の構成図である。It is a block diagram of the image processing apparatus of the external appearance inspection apparatus used for the same as the above. 同上に用いる泡判定方法の例1の説明図である。It is explanatory drawing of Example 1 of the bubble determination method used for the same as the above. 同上に用いる泡判定方法の例2、例4、例5、例6、例9、例10の説明図である。It is explanatory drawing of Example 2, Example 4, Example 5, Example 6, Example 9, and Example 10 of the bubble determination method used for the same as the above. 同上に用いる泡判定方法の例3の説明図である。It is explanatory drawing of the example 3 of the bubble determination method used for the same as the above. 同上に用いる泡判定方法の例5、例8の説明図である。It is explanatory drawing of Example 5 and Example 8 of the bubble determination method used for the same as the above. 同上に用いる泡判定方法の例7の説明図である。It is explanatory drawing of the example 7 of the bubble determination method used for the same as the above. 同上に用いる泡判定方法の例12、例13の説明図である。It is explanatory drawing of the example 12 and the example 13 of the bubble determination method used for the same as the above. 同上に用いる泡判定方法の例14の説明図である。It is explanatory drawing of Example 14 of the bubble determination method used for the same as the above.

Claims (16)

外部から内部が撮像可能な透明若しくは半透明な容器に封入された液体の外観検査方法において、
該容器外から液体を撮像手段で撮像し、濃淡画像として保持する撮像過程と、
撮像した濃淡画像の中で、予め設定された検査領域内の各画素について空間的な微分処理を行って微分値画像及び微分方向値画像を生成する微分処理過程と、
微分値画像の検査領域内をラスタ走査し、所定の微分値以上の値を持つ画素を探索し、この探索で抽出した画素を泡候補点とする泡候補点抽出過程と、
抽出した泡候補点を始点として、周辺画素に他の泡候補点が存在する場合はこれら泡候補点を連結処理して泡の輪郭を抽出して泡候補部とする泡候補部の輪郭抽出過程と、
抽出された泡候補部の輪郭に外接する外接矩形を設定する泡外接矩形設定過程と、
設定された泡外接矩形内部に縦方向と横方向のうち少なくともいずれかの方向に検査ラインを設定し、該検査ラインが交差する泡候補部の輪郭の数、該検査ライン上の画素のうち所定の微分値以上の値を持つ画素の微分方向値の種別数、該検査ライン上の画素のうち所定の微分値以上の値を持つ画素の総和、または、該検査ライン上の画素のうち所定の微分値以上の値を持つ画素の追跡処理において始点に戻る追跡ラインのいずれかを用いて、泡候補部に泡が存在するか否かを判定する判定過程と
を有することを特徴とする外観検査方法。
In the visual inspection method of liquid sealed in a transparent or translucent container that can be imaged from the outside,
An imaging process in which a liquid is imaged from outside the container by an imaging means and held as a grayscale image;
Differentiating process of generating a differential value image and a differential direction value image by performing a spatial differential process for each pixel in a preset inspection region in the captured grayscale image,
A raster scan within the inspection area of the differential image, searching for pixels having a value greater than or equal to a predetermined differential value, and a bubble candidate point extraction process using the pixel extracted in this search as a bubble candidate point;
When the extracted bubble candidate point is the starting point, if there are other bubble candidate points in the surrounding pixels, these bubble candidate points are concatenated to extract the bubble outline and use it as the bubble candidate part. When,
A bubble circumscribed rectangle setting process for setting a circumscribed rectangle circumscribing the outline of the extracted bubble candidate part;
An inspection line is set in at least one of the vertical direction and the horizontal direction inside the set bubble circumscribed rectangle, the number of the contours of the bubble candidate portion where the inspection line intersects, the predetermined number of pixels on the inspection line The number of types of differential direction values of pixels having a value greater than or equal to the differential value, the sum of pixels having a value greater than or equal to a predetermined differential value among pixels on the inspection line, or a predetermined number of pixels on the inspection line And a determination process for determining whether or not bubbles are present in the bubble candidate portion using any of the tracking lines that return to the starting point in the tracking processing of pixels having a value greater than or equal to the differential value. Method.
前記判定過程において、設定した検査ラインが交差する泡候補部の輪郭の数により、泡候補部に泡が存在するか否かを判定することを特徴とする請求項1記載の外観検査方法。   The appearance inspection method according to claim 1, wherein in the determination process, it is determined whether or not bubbles exist in the bubble candidate portion based on the number of contours of the bubble candidate portion where the set inspection lines intersect. 前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとり、その種別数の値が所定の閾値以上であれば、泡候補部に泡が存在すると判定することを特徴とする請求項1記載の外観検査方法。   In the determination process, the number of types of differential direction values of pixels having a value greater than or equal to a predetermined differential value is taken for pixels on the set inspection line, and if the value of the number of types is equal to or greater than a predetermined threshold, bubble candidates The appearance inspection method according to claim 1, wherein it is determined that bubbles are present in the part. 前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の総和をとり、その総和の値が所定の閾値以上であれば、泡候補部に泡が存在すると判定することを特徴とする請求項1記載の外観検査方法。   In the determination process, the pixels on the set inspection line are summed up with pixels having a value greater than or equal to a predetermined differential value, and if the sum is greater than or equal to a predetermined threshold, bubbles are present in the bubble candidate portion. The appearance inspection method according to claim 1, wherein determination is made. 前記判定過程において、設定した検査ライン上の画素で、1本の検査ライン毎の、所定の微分値以上の値を持つ画素の微分方向値の種別数をとり、その種別数の値が所定値以上である検査ラインの総和が所定の閾値以上であれば、泡候補部に泡が存在すると判定することを特徴とする請求項1記載の外観検査方法。   In the determination process, the number of types of differential direction values of pixels having a value greater than or equal to a predetermined differential value for each inspection line in the pixels on the set inspection line is taken, and the value of the number of types is a predetermined value The appearance inspection method according to claim 1, wherein if the sum of the above inspection lines is equal to or greater than a predetermined threshold value, it is determined that bubbles are present in the bubble candidate portion. 前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとるとともに、その微分方向値を持つ画素間に存在する画素の濃淡値を測定し、その測定値が所定の閾値以下の値を持つ場合に、泡候補部に泡が存在すると判定することを特徴とする請求項1記載の外観検査方法。   In the determination process, the pixels on the set inspection line take the number of types of differential direction values of pixels having a value greater than or equal to a predetermined differential value, and the gray value of pixels existing between pixels having the differential direction value The appearance inspection method according to claim 1, wherein when the measured value has a value equal to or less than a predetermined threshold value, it is determined that bubbles are present in the bubble candidate portion. 前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとるとともに、その微分方向値を持つ画素間に存在する画素の濃淡値を測定し、その測定値が所定値以上である画素で囲まれた領域の面積が所定の閾値以上の場合に、泡候補部に泡が存在すると判定することを特徴とする請求項1記載の外観検査方法。   In the determination process, the pixels on the set inspection line take the number of types of differential direction values of pixels having a value greater than or equal to a predetermined differential value, and the gray value of pixels existing between pixels having the differential direction value 2. The method according to claim 1, wherein when the area of a region surrounded by pixels whose measured values are equal to or greater than a predetermined value is equal to or greater than a predetermined threshold, it is determined that bubbles are present in the bubble candidate portion. Appearance inspection method. 前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとり、その微分方向値を持つ画素間に存在する画素の濃淡値を測定し、その測定値が所定値以上である画素で囲まれた領域の面積が所定の閾値以上で、且つ前記領域の外周囲長が所定の閾値以上の場合に、泡候補部に泡が存在すると判定することを特徴とする請求項1記載の外観検査方法。   In the determination process, the number of types of differential direction values of pixels having a value greater than or equal to a predetermined differential value among the pixels on the set inspection line is taken, and the gray value of the pixel existing between the pixels having the differential direction value is obtained. A bubble is present in the bubble candidate portion when the area of a region surrounded by pixels whose measured values are equal to or greater than a predetermined value is equal to or greater than a predetermined threshold and the outer perimeter of the region is equal to or greater than a predetermined threshold. The visual inspection method according to claim 1, wherein the visual inspection method is determined. 前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとるとともに、その微分方向値を持つ画素間に存在する画素の濃淡値を測定し、その測定値が所定値以下である画素で囲まれる領域の面積が、所定の閾値以上の値を持ち、且つ前記領域の平均濃淡値が、所定の閾値以下を持つ場合に、泡候補部に泡が存在すると判定することを特徴とする請求項1記載の外観検査方法。   In the determination process, the pixels on the set inspection line take the number of types of differential direction values of pixels having a value greater than or equal to a predetermined differential value, and the gray value of pixels existing between pixels having the differential direction value When the area of a region surrounded by pixels whose measured values are equal to or smaller than a predetermined value has a value equal to or larger than a predetermined threshold value, and the average gray value of the region has a predetermined threshold value or less, The appearance inspection method according to claim 1, wherein it is determined that bubbles exist in the candidate portion. 前記判定過程において、設定した検査ライン上の画素で、1検査ライン毎に、所定の微分値以上の値を持つ画素の微分方向値の種別数をとり、その種別数の値が所定値以上の検査ラインについて、その検査ラインが連続する数が所定の閾値以上を持つ場合に、泡候補部に泡が存在すると判定することを特徴とする請求項1記載の外観検査方法。   In the determination process, for each pixel on the set inspection line, the number of types of differential direction values of pixels having a value equal to or greater than a predetermined differential value is taken for each inspection line, and the value of the number of types is equal to or greater than a predetermined value. The appearance inspection method according to claim 1, wherein when the number of consecutive inspection lines has a predetermined threshold value or more, it is determined that bubbles are present in the bubble candidate portion. 前記判定過程において、設定した検査ライン上の画素で、1検査ライン毎に、所定の微分値以上の値を持つ画素の微分方向値の種別数をとり、前の検査ライン上に2より大きい予め設定された所定数以上の方向の微分方向値を持つ画素が存在し、次の検査ライン上に1方向か、或いは2方向の微分方向値を持つ画素しか存在しない場合に、或いは前の検査ライン上に1方向か、2方向の微分方向値を持つ画素が存在し、次の検査ライン上に前記の所定数以上の方向の微分方向値を持つ画素が存在する場合に、泡候補部に泡が存在すると判定することを特徴とする請求項1記載の外観検査方法。   In the determination process, the number of types of differential direction values of pixels having a value greater than or equal to a predetermined differential value is obtained for each pixel on the set inspection line, and a value larger than 2 is previously set on the previous inspection line. When there is a pixel having a differential direction value in a direction equal to or greater than a predetermined number set, and there is only a pixel having a differential direction value in one direction or two directions on the next inspection line, or the previous inspection line When a pixel having a differential direction value in one direction or two directions is present on the upper side and a pixel having a differential direction value in the direction equal to or larger than the predetermined number is present on the next inspection line, a bubble is generated in the bubble candidate portion. The appearance inspection method according to claim 1, wherein it is determined that an image exists. 前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとるとともに、その微分方向値を持つ画素間に存在する画素の濃淡値を測定し、その測定値が所定値以上である画素で囲まれる領域の面積が、所定の閾値以上の値を持ち、且つ前記領域の平均濃淡値が、オフセットを設定した所定の閾値以上の値を持つ場合に、泡候補部に泡が存在すると判定することを特徴とする請求項1記載の外観検査方法。   In the determination process, the pixels on the set inspection line take the number of types of differential direction values of pixels having a value greater than or equal to a predetermined differential value, and the gray value of pixels existing between pixels having the differential direction value The area of a region surrounded by pixels whose measured values are equal to or greater than a predetermined value has a value equal to or greater than a predetermined threshold, and the average gray value of the region is equal to or greater than a predetermined threshold for which an offset is set. The appearance inspection method according to claim 1, wherein it is determined that bubbles are present in the bubble candidate portion. 前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとり、その種別数の値が所定値以上の場合の微分方向値を持つ画素の両側に濃淡値測定用画素を設定して2つの濃淡値測定用画素間の濃淡差を求め、その濃淡差の絶対値が所定の閾値以上の値を持つ場合に、泡候補部に泡が存在すると判定することを特徴とする請求項1記載の外観検査方法。   In the determination process, the number of types of differential direction values of pixels having a value greater than or equal to a predetermined differential value is taken for pixels on the set inspection line, and the differential direction value when the value of the number of types is equal to or greater than the predetermined value. If the grayscale value measurement pixel is set on both sides of the pixel to obtain the grayscale difference between the two grayscale value measurement pixels, and the absolute value of the grayscale difference has a value equal to or greater than a predetermined threshold value, The appearance inspection method according to claim 1, wherein it is determined that bubbles are present. 前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素の微分方向値の種別数をとり、その種別数の値が所定値以上の場合の微分方向値を持つ画素の両側に、濃淡値測定用画素を設定して2つの濃淡値測定用画素間の濃淡差を求め、その濃淡差の値が所定値以上である検査ラインが連続して存在するか否かを調べ、濃淡差の値が所定値以上である検査ラインが所定の閾値以上連続して存在する場合に、泡候補部に泡が存在すると判定することを特徴とする請求項1記載の外観検査方法。   In the determination process, the number of types of differential direction values of pixels having a value greater than or equal to a predetermined differential value is taken for pixels on the set inspection line, and the differential direction value when the value of the number of types is equal to or greater than the predetermined value. Whether or not there are continuous inspection lines in which the density difference between the two density value measurement pixels is determined by setting the density value measurement pixels on both sides of the pixel, and the density difference value is a predetermined value or more. 2. The appearance according to claim 1, wherein when the inspection line having a density difference value equal to or greater than a predetermined value exists continuously for a predetermined threshold value or more, it is determined that bubbles are present in the bubble candidate portion. Inspection method. 前記判定過程において、設定した検査ライン上の画素で、所定の微分値以上の値を持つ画素について、その微分方向値に基づいて追跡処理を行い、始点に戻る追跡ラインが2本以上存在する場合に、泡候補部に泡が存在すると判定することを特徴とする請求項1記載の外観検査方法。   In the determination process, when there are two or more tracking lines that return to the starting point by performing tracking processing based on the differential direction value of pixels on the set inspection line that have a value greater than or equal to a predetermined differential value 2. The appearance inspection method according to claim 1, wherein it is determined that bubbles are present in the bubble candidate portion. 外部から内部が撮像可能な透明若しくは半透明な容器に封入された液体の外観検査装置に、該容器外から液体を撮像する撮像手段とともに用いられる画像処理装置において、In an image processing apparatus used together with an imaging means for imaging a liquid from outside the container, in a liquid appearance inspection apparatus enclosed in a transparent or translucent container capable of imaging the inside from the outside,
演算部と、画像メモリ領域と、微分画像メモリ領域と、微分方向画像メモリ領域とを備え、A calculation unit, an image memory area, a differential image memory area, and a differential direction image memory area;
演算部は、The calculation unit
撮像手段で撮像された濃淡画像を原画像とし、原画像のデータを画像メモリ領域に格納させる過程と、The process of storing the grayscale image captured by the imaging means as the original image and storing the original image data in the image memory area;
撮像された濃淡画像の中で、予め設定された検査領域内の各画素について空間的な微分処理を行って微分値画像及び微分方向値画像を生成し、微分値画像の画像データを微分画像メモリ領域に格納させ、微分方向値画像の画像データを微分方向画像メモリ領域に格納させる微分処理過程と、A differential image and a differential direction value image are generated by performing spatial differential processing on each pixel in a preset inspection region in the captured grayscale image, and the differential image memory stores the differential image image data. A differential process for storing the image data of the differential direction value image in the differential direction image memory area,
微分値画像の検査領域内をラスタ走査し、所定の微分値以上の値を持つ画素を探索し、この探索で抽出した画素を泡候補点とする泡候補点抽出過程と、A raster scan within the inspection area of the differential image, searching for pixels having a value greater than or equal to a predetermined differential value, and a bubble candidate point extraction process using the pixel extracted in this search as a bubble candidate point;
抽出した泡候補点を始点として、周辺画素に他の泡候補点が存在する場合はこれら泡候補点を連結処理して泡の輪郭を抽出して泡候補部とする泡候補部の輪郭抽出過程と、When the extracted bubble candidate point is the starting point, if there are other bubble candidate points in the surrounding pixels, these bubble candidate points are concatenated to extract the bubble outline and use it as the bubble candidate part. When,
抽出された泡候補部の輪郭に外接する外接矩形を設定する泡外接矩形設定過程と、A bubble circumscribed rectangle setting process for setting a circumscribed rectangle circumscribing the outline of the extracted bubble candidate part;
設定された泡外接矩形内部に縦方向と横方向のうち少なくともいずれかの方向に検査ラインを設定し、該検査ラインが交差する泡候補部の輪郭の数、該検査ライン上の画素のうち所定の微分値以上の値を持つ画素の微分方向値の種別数、該検査ライン上の画素のうち所定の微分値以上の値を持つ画素の総和、または、該検査ライン上の画素のうち所定の微分値以上の値を持つ画素の追跡処理において始点に戻る追跡ラインのいずれかを用いて、泡候補部に泡が存在するか否かを判定する判定過程との各過程の処理を行うAn inspection line is set in at least one of the vertical direction and the horizontal direction inside the set bubble circumscribed rectangle, the number of the contours of the bubble candidate portion where the inspection line intersects, the predetermined number of pixels on the inspection line The number of types of differential direction values of pixels having a value greater than or equal to the differential value, the sum of pixels having a value greater than or equal to a predetermined differential value among pixels on the inspection line, or a predetermined number of pixels on the inspection line In the tracking process of pixels having a value equal to or greater than the differential value, the process of each process including the determination process for determining whether or not a bubble exists in the bubble candidate portion is performed using any of the tracking lines that return to the starting point.
ことを特徴とする画像処理装置。An image processing apparatus.
JP2004048607A 2004-02-24 2004-02-24 Appearance inspection method and image processing apparatus Expired - Fee Related JP4581424B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004048607A JP4581424B2 (en) 2004-02-24 2004-02-24 Appearance inspection method and image processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004048607A JP4581424B2 (en) 2004-02-24 2004-02-24 Appearance inspection method and image processing apparatus

Publications (2)

Publication Number Publication Date
JP2005241304A JP2005241304A (en) 2005-09-08
JP4581424B2 true JP4581424B2 (en) 2010-11-17

Family

ID=35023200

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004048607A Expired - Fee Related JP4581424B2 (en) 2004-02-24 2004-02-24 Appearance inspection method and image processing apparatus

Country Status (1)

Country Link
JP (1) JP4581424B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102866157A (en) * 2011-06-30 2013-01-09 芝浦机械电子装置股份有限公司 Laminating plate-shaped body detection apparatus and method
TWI485358B (en) * 2011-06-30 2015-05-21 Shibaura Mechatronics Corp Closure plate body inspection apparatus and method

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4529728B2 (en) * 2005-02-23 2010-08-25 パナソニック電工株式会社 Method and apparatus for inspecting foreign matter in container
JP4765890B2 (en) * 2006-10-19 2011-09-07 株式会社デンソー Foreign object detection device
JP2008309627A (en) * 2007-06-14 2008-12-25 Olympus Corp Blood analyzer and program
JP5046285B2 (en) * 2007-08-29 2012-10-10 一般財団法人電力中央研究所 Bubble counting system
JP5017617B2 (en) * 2007-11-06 2012-09-05 キリンテクノシステム株式会社 Bottle residual liquid inspection method
JP5033077B2 (en) * 2008-07-28 2012-09-26 パナソニック株式会社 Method and apparatus for inspecting appearance of molded product
JP5033076B2 (en) * 2008-07-28 2012-09-26 パナソニック株式会社 Appearance inspection method and apparatus

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03175343A (en) * 1989-09-14 1991-07-30 Matsushita Electric Works Ltd Method for extracting flaw by inspection appearance
JPH04359106A (en) * 1991-06-06 1992-12-11 Hitachi Ltd Device for detecting foam in transparent article

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03175343A (en) * 1989-09-14 1991-07-30 Matsushita Electric Works Ltd Method for extracting flaw by inspection appearance
JPH04359106A (en) * 1991-06-06 1992-12-11 Hitachi Ltd Device for detecting foam in transparent article

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102866157A (en) * 2011-06-30 2013-01-09 芝浦机械电子装置股份有限公司 Laminating plate-shaped body detection apparatus and method
TWI485358B (en) * 2011-06-30 2015-05-21 Shibaura Mechatronics Corp Closure plate body inspection apparatus and method
CN102866157B (en) * 2011-06-30 2015-11-25 芝浦机械电子装置股份有限公司 Device and method are looked in the health check-up of laminating tabular

Also Published As

Publication number Publication date
JP2005241304A (en) 2005-09-08

Similar Documents

Publication Publication Date Title
KR100361244B1 (en) Image processing device and method, medium on which program for image processing is stored, and inspecting device
JP3132565B2 (en) Defect inspection method and apparatus
JP4150390B2 (en) Appearance inspection method and appearance inspection apparatus
JP4724056B2 (en) Inspection device
JPH0736001B2 (en) Bottle defect inspection method
JP4581424B2 (en) Appearance inspection method and image processing apparatus
JP3324699B2 (en) Method and apparatus for measuring fiber diameter distribution
JP2005345290A (en) Streak-like flaw detecting method and streak-like flaw detector
JP2008014842A (en) Method and apparatus for detecting stain defects
JP2008224523A (en) Inspection device and inspection method of screw component
JP3890844B2 (en) Appearance inspection method
TWI427263B (en) Method and apparatus of measuring height of projections, and program therefor
JP2010151762A (en) Defect detection method and device
JP7362324B2 (en) Inspection method, manufacturing method and inspection device for image display device
JP4956077B2 (en) Defect inspection apparatus and defect inspection method
JPH03291507A (en) Inspection instrument for cylindrical body
JP2007104296A (en) Method, apparatus, and program for measuring resolution
JPH09161056A (en) Inspecting method for inner surface of circular container
JP2005189167A (en) Bridge inspection device of cap
JP3043530B2 (en) Dot pattern inspection equipment
JP6747692B2 (en) External wall inspection device
JPH0319990B2 (en)
JPH0781962B2 (en) Foreign object detection method
JPH02187651A (en) Image processing method
JP2513528Y2 (en) Gray image processor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20061213

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090428

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090526

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090727

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100105

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100217

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100222

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20100628

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100816

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

Free format text: PAYMENT UNTIL: 20130910

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees