JP6207008B2 - Inspection apparatus and inspection method - Google Patents
Inspection apparatus and inspection method Download PDFInfo
- Publication number
- JP6207008B2 JP6207008B2 JP2013109963A JP2013109963A JP6207008B2 JP 6207008 B2 JP6207008 B2 JP 6207008B2 JP 2013109963 A JP2013109963 A JP 2013109963A JP 2013109963 A JP2013109963 A JP 2013109963A JP 6207008 B2 JP6207008 B2 JP 6207008B2
- Authority
- JP
- Japan
- Prior art keywords
- inspection
- image
- mask
- pixel
- unit
- 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.)
- Active
Links
Images
Landscapes
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Description
本発明は、検査技術に関し、特に搬送される被検査物を撮影した画像から検査範囲が含まれる部分画像を切り出し、部分画像に基づいて検査を行う技術に関する。
技術に関する。
The present invention relates to an inspection technique, and more particularly to a technique for cutting out a partial image including an inspection range from an image obtained by photographing an object to be conveyed and performing an inspection based on the partial image.
Regarding technology.
従来、生産工場のラインでは生産物を搬送装置で搬送しつつ、生産物の外観検査を行っている。この検査は、検査員により目視で行われていたが、検査員の負担、検査が主観に頼ることに起因する検査精度のばらつき等の問題があった。そのため、画像処理等による自動検査が提案されている。 Conventionally, in a production factory line, the appearance of a product is inspected while the product is conveyed by a conveying device. This inspection has been carried out visually by an inspector, but there are problems such as a burden on the inspector and a variation in inspection accuracy due to the subject's inspection relying on subjectivity. Therefore, automatic inspection by image processing or the like has been proposed.
例えば、ペットボトル等の検査技術として特許文献1から4、容器に付されたラベルの検査技術として特許文献5がある。これらの技術はいずれも被検査物を搬送しつつ、検査部位をカメラにより撮影して画像を取得し、その画像に基づいて疵等の検査を行っている。
For example, there are
特許文献1および2では、疵のない検査部位の画像と被検査物の検査部位の画像とを比較する、いわゆるテンプレートマッチングにより疵の有無が検査される。一方、特許文献3から5では、被検査物の検査部位の画像を2値化し、その面積に基づいて疵の有無が検査される。
In
上述した特許文献の技術では、画像処理により被検査物の疵の有無を自動的に検査することができる。しかしながら、これらの技術では、検査部位は画像中で同じ位置にあることを前提としている。例えば、製造ラインでは多くの製品が流れており、製品が搬送ベルト上のどの位置を流れるかによってカメラからの距離や角度が異なる。このような場合、画像中における検査部位が想定している位置からずれてしまい、検査精度が低下するおそれがある。特に、テンプレートマッチングでは検査精度はテンプレートを配置する位置の精度に依存している。位置精度の依存性をなくすためには、画像中でテンプレート位置を変更しつつテンプレートマッチングを行う必要があるが、処理時間が増大するという問題が生じる。 With the technique of the patent document mentioned above, it can test | inspect automatically the presence or absence of the flaw of a to-be-inspected object by image processing. However, in these techniques, it is assumed that the examination site is in the same position in the image. For example, many products are flowing on the production line, and the distance and angle from the camera differ depending on which position on the conveyor belt the product flows. In such a case, the inspection site in the image is displaced from the assumed position, and the inspection accuracy may be reduced. In particular, in the template matching, the inspection accuracy depends on the accuracy of the position where the template is arranged. In order to eliminate the dependency of the position accuracy, it is necessary to perform template matching while changing the template position in the image, but there is a problem that the processing time increases.
本発明の目的は、上記課題に鑑み、画像中の検査部位の位置が変化しても的確に検査を行うことができる検査技術を提供することである。 In view of the above problems, an object of the present invention is to provide an inspection technique capable of accurately inspecting even if the position of an inspection site in an image changes.
前記課題を解決するために、本発明の検査装置は、搬送される被検査物を撮影し画像を取得する撮影部と、前記画像中に前記被検査物の検査部位を含む検査領域を設定する検査領域設定部と、前記検査領域に含まれる前記画像の画素値を2値化し、2値画像を生成する2値画像生成部と、前記2値画像中の所定の一方の画素値を有する領域に基づいて検査マスクを生成する検査マスク生成部と、前記画像に対して前記検査マスクを設定し、当該画像中で当該検査マスクに含まれる画素の画素値に基づいて前記被検査物の瑕疵の有無を判定する疵判定部と、を備え、前記撮影部は前記被検査物に対して側方に突出する前記検査部位に対して仰角を有する仰角位置または俯角を有する俯角位置に設置されており、前記検査マスク生成部は、前記撮影部が仰角位置にある際には前記検査マスクの下端を上方に収縮させ、前記撮影部が俯角位置にある際には前記検査マスクの上端を下方に収縮させる。 In order to solve the above-described problem, an inspection apparatus according to the present invention sets an imaging unit that captures an image of an object to be transported and acquires an image, and an inspection region that includes an inspection site of the object to be inspected in the image. An inspection area setting unit, a binary image generation unit that binarizes pixel values of the image included in the inspection area and generates a binary image, and an area having a predetermined one pixel value in the binary image An inspection mask generation unit that generates an inspection mask based on the image, and sets the inspection mask for the image, and sets the inspection mask in accordance with the pixel value of the pixel included in the inspection mask in the image. A heel determination unit that determines presence or absence, and the imaging unit is installed at an elevation angle position having an elevation angle or an depression position having a depression angle with respect to the examination site protruding laterally with respect to the inspection object. The inspection mask generator generates the imaging. Part upward by contracting the lower end of the test mask when in the elevation position, when the imaging unit is in the depression angle position to contract the upper end of the inspection mask downward.
この構成では、被検査物を撮影した画像中に検査領域が設定され、検査領域内の画素に基づいて瑕疵の有無が検査されるため、検査部位が検査領域内で移動しても対応することができる。また、検査領域内の画素を2値化した2値画像中の領域に基づいて検査マスクを生成し、検査マスク内の画素に基づいて瑕疵の有無を判定しているため、検査領域に検査部位以外の部位や背景が含まれていても、的確に検査部位の瑕疵を判定することができる。 In this configuration, an inspection area is set in an image obtained by imaging the inspection object, and the presence or absence of wrinkles is inspected based on the pixels in the inspection area. Can do. In addition, since the inspection mask is generated based on the region in the binary image obtained by binarizing the pixels in the inspection region and the presence or absence of wrinkles is determined based on the pixels in the inspection mask, the inspection region is included in the inspection region. Even if a part or background other than is included, it is possible to accurately determine wrinkles of the examination part.
この構成では、検査部位に対する撮影部の位置に応じて検査マスクを収縮させることにより、検査部位の下面または上面を含まなくしている。そのため、このような検査マスクに含まれる画素の画素値に基づいて瑕疵の有無を判定すれば、検査部位の側面の瑕疵を判定することができる。 In this configuration, the inspection mask is contracted according to the position of the imaging unit with respect to the inspection region, so that the lower surface or the upper surface of the inspection region is not included. Therefore, if the presence or absence of wrinkles is determined based on the pixel values of the pixels included in such an inspection mask, wrinkles on the side surface of the inspection site can be determined.
また、本発明の検査装置の技術的特徴は、同様の検査方法にも適用することができる。例えば、撮影部により撮影された搬送される被検査物の画像の中に前記被検査物の検査部位を含む検査領域を設定する検査領域設定ステップと、前記検査領域に含まれる前記画像の画素値を2値化し、2値画像を生成する2値化ステップと、前記2値画像中の所定の一方の画素値を有する領域に基づいて検査マスクを生成する検査マスク生成ステップと、前記画像に対して前記検査マスクを設定し、当該画像中で当該検査マスクに含まれる画素の画素値に基づいて前記被検査物の瑕疵の有無を判定する疵判定ステップと、を備え、前記撮影部は前記被検査物に対して側方に突出する前記検査部位に対して仰角を有する仰角位置または俯角を有する俯角位置に設置されており、前記撮影部が仰角位置にある際には前記検査マスクの下端を上方に収縮させ、前記撮影部が俯角位置にある際には前記検査マスクの上端を下方に収縮させる検査方法に用いることができる。 The technical features of the inspection apparatus of the present invention can also be applied to similar inspection methods. For example, an inspection area setting step for setting an inspection area including an inspection site of the inspection object in an image of the inspection object to be conveyed imaged by the imaging unit, and a pixel value of the image included in the inspection area A binarization step for generating a binary image, an inspection mask generation step for generating an inspection mask based on a region having a predetermined one pixel value in the binary image, and the image set the test mask Te, and a flaw determining step determines the presence or absence of defects in the inspection object based on the pixel values of pixels included in the inspection mask in the image, the imaging unit is the object It is installed at an elevation angle position having an elevation angle or an depression angle position having a depression angle with respect to the examination site protruding laterally with respect to the inspection object, and when the imaging unit is at the elevation angle position, the lower end of the inspection mask is Upward By condensation, when the imaging unit is in the depression angle position can be used in the inspection method of contracting the upper end of the inspection mask downward.
以下に、図面を用いて本発明の検査装置の実施形態を説明する。なお、本実施形態では、被検査物をペットボトル、検査部位をネックリング、瑕疵をネックリングの疵として説明する。当然ながら、被検査物および検査部位はこれらに限定されるものではなく、被検査物をビン等の容器やダンボール等の梱包資材とすることもでき、検査部位をキャップ、被検査物に付されたラベルやシール等とすることもできる。また、瑕疵とは検査部位に生じた異常を示すものであり、検査部位をラベルやシールとした場合には、疵だけでなく剥がれ等の異常状態をも含んでいる。 Embodiments of the inspection apparatus of the present invention will be described below with reference to the drawings. In the present embodiment, the inspection object will be described as a plastic bottle, the inspection site as a neck ring, and the bag as a neck ring bag. Of course, the inspection object and the inspection part are not limited to these, and the inspection object can be a container such as a bottle or a packaging material such as cardboard, and the inspection part is attached to the cap or the inspection object. Labels and stickers can also be used. Further, wrinkles indicate an abnormality that has occurred in an examination site. When the examination site is a label or a seal, it includes not only wrinkles but also abnormal conditions such as peeling.
〔全体構成〕
図1は本発明の検査装置の外観図、図2は検査装置の機能ブロック図である。図1に示すように、被検査物であるペットボトルPは搬送装置Cのベルト上に載置され、図中右方向に搬送される。搬送装置Cの搬送経路上にはペットボトルPを検知するセンサSが備えられている。センサSの出力は後述する制御部1に入力されている。
〔overall structure〕
FIG. 1 is an external view of an inspection apparatus according to the present invention, and FIG. 2 is a functional block diagram of the inspection apparatus. As shown in FIG. 1, a plastic bottle P, which is an object to be inspected, is placed on the belt of the transport device C and transported in the right direction in the figure. A sensor S for detecting the plastic bottle P is provided on the transport path of the transport apparatus C. The output of the sensor S is input to the
また、搬送方向におけるセンサSと同位置の搬送装置Cの側方には検査部位であるペットボトルPのネックリングを撮影するカメラ2が設置されている。本実施形態では、カメラ2はネックリングよりも下方で、光軸がネックリングに向くように設置されている。したがって、本実施形態でのカメラ2はネックリングに対して仰角を有している。カメラ2は処理装置Tに接続されている。
In addition, a
〔処理装置〕
処理装置Tは汎用コンピュータからなり、その内部にソフトウェアにより各機能部が構成されている。当然ながら、各機能部はハードウェアまたはソフトウェアとハードウェアとにより構成しても構わない。
[Processing equipment]
The processing device T comprises a general-purpose computer, and each functional unit is configured by software. Of course, each functional unit may be configured by hardware or software and hardware.
図2に示すように、処理装置Tは各種制御を行う制御部1、カメラ2の出力に基づき画像を取得する画像取得部3、画像取得部3により取得された画像に検査領域を設定する検査領域設定部4、検査領域に含まれる画素の画素値を2値化した2値画像を生成する2値画像生成部5、2値画像中の所定の一方の画素値を有する領域に基づいて検査マスクを生成する検査マスク生成部6、検査マスクに含まれる画素の画素値に基づいて疵の有無を判定する疵判定部7を備えている。
As illustrated in FIG. 2, the processing device T includes a
制御部1は、各種制御を行う機能を有している。例えば、センサSによるペットボトルPの検出信号を受けた際に、カメラ2および画像取得部3に対して画像を取得する指示を行う。また、疵判定部7により疵があると判定された際に、その旨をオペレータ等に通知する、図示しない排出手段に対して疵があると判定されたペットボトルPを搬送装置Cから排出するように指示を出す等の制御を行う。
The
カメラ2は、上述したようにペットボトルPのネックリングを下方から仰角を持って撮影する。本実施形態では、カメラ2はモノクロのデジタルスチルカメラを用いるが、カラーのデジタルスチルカメラやデジタルムービーカメラを用いても構わない。また、アナログカメラを用いても構わない。この場合には、画像取得部3はA/D変換機能が必要である。
As described above, the
画像取得部3は、カメラ2からの出力を受けて画像を取得する機能を備えている。上述したように、本実施形態ではカメラ2はモノクロのデジタルスチルカメラであるため、本実施形態の画像取得部3は単にカメラ2から出力される画像データの入力手段として機能する。カメラ2がカラーのデジタルスチルカメラであれば画像取得部3は、カメラ2から取得したカラー画像データを濃淡画像に変換する。また、カメラ2がデジタルムービーカメラの場合には、画像取得部3は動画データから所定のフレームを抽出する。なお、カメラ2および画像取得部3により、本発明の撮影部が構成されている。
The
検査領域設定部4は、画像取得部3により取得された画像中に検査領域を設定する機能を有している。検査領域とは、画像中で検査部位を含む領域であり、後の処理対象となる領域である。検査領域の設定は、撮影された画像を見ながらオペレータが設定することもできるが、本実施形態では予め設定されている位置、大きさの検査領域を設定する。上述したように、ペットボトルPは搬送装置Cのベルト上に載置されて搬送されるため、位置ずれは所定値以下に抑えられる。したがって、ペットボトルPが搬送方向に直交する方向の両端にずれた状態で撮影された画像中でのネックリング位置を含むように検査領域の位置および大きさを設定しておけばよい。
The inspection
2値画像生成部5は、画像取得部2に取得された画像の画素のうち、検査領域に含まれる画素の画素値を2値化する機能を有している。2値化とは、画素の画素値が所定の閾値以下であればその画素の画素値を一方の画素値(例えば、0)に設定し、画素の画素値が所定の閾値よりも大きければその画素の画素値を他方の画素値(例えば、1)に設定する処理である。したがって、閾値が決定できれば画像の2値化を行うことができる。閾値の決定方法は様々な方法を用いることができる。例えば、実験的に求めてもよいし、判別分析法のような統計的な手法により求めることもできる。
The binary
検査マスク生成部6は、2値画像生成部5により生成された2値画像から検査マスクを生成する機能を有している。検査マスクとは、疵の判定時に検査部位に対応する画素以外の画素をマスキングするために用いられるマスク画像である。検査マスク生成部6は、2値画像を同じ画素値を持ち、隣接する画素からなる領域に分割し、その領域分割結果から検査マスクを生成する。
The inspection
疵判定部7は、画像に対して検査マスクを設定し、画像中で検査マスクに含まれる画素の画素値に基づいて検査部位の疵の有無を判定する機能を有している。
The
図3は、本実施例における検査装置の処理の流れを表すフローチャートである。センサSが搬送装置C上を搬送されるペットボトルPを検出すると(#01のYes分岐)、センサSからの信号が制御部1に入力される。制御部1は、その信号を受けてカメラ2および画像取得部3に対して画像を取得するよう指示を送信し、カメラ2および画像取得部3はその指示を受けてペットボトルPのネックリングを含む画像を取得する(#02)。図4は、このようにして撮影された画像の例である。上述したように、本実施形態ではカメラ2はネックリングより下方に仰角を有するように設置しているため、画像にはネックリングの下面および側面が含まれている。また、このネックリングには図中に円で囲む位置に疵Dが生じている。当然ながら、カメラ2の設置位置は被検査物、検査部位に応じて適宜変更可能である。
FIG. 3 is a flowchart showing the flow of processing of the inspection apparatus in the present embodiment. When the sensor S detects the plastic bottle P transported on the transport apparatus C (Yes branch of # 01), a signal from the sensor S is input to the
検査領域設定部4は、上述のようにして撮影された画像に対して検査領域Rを設定する(#03、図5参照)。図から明らかなように、検査領域Rの高さは画像中におけるネックリングの高さに比べて大きく設定されている。したがって、搬送装置C上のペットボトルPの位置ずれに起因して画像中のネックリングの位置がずれても、ネックリングを検査領域Rに含めることができる。
The inspection
2値画像生成部5は、画像中の検査領域Rに含まれる画素に対して2値化処理を行い、2値画像を生成する(#04、図6参照)。本実施例では、この2値画像は検査領域Rと同じサイズの画像として得られる。
The binary
上述したように、2値化閾値は種々の方法により求めることができる。判別分析法等の統計的手法によれば、望ましい閾値が変動しても的確に閾値を求めることができるが、演算量が増大するという問題点がある。一方、固定閾値では望ましい閾値が変動した際に、検査精度を低下させるおそれがある。そのため、固定閾値を中心とした所定範囲において判別分析法を適用して閾値を決定すると好適である。 As described above, the binarization threshold can be obtained by various methods. Statistical methods such as discriminant analysis can accurately determine the threshold even if the desired threshold fluctuates, but there is a problem that the amount of calculation increases. On the other hand, when the desired threshold value varies with the fixed threshold value, the inspection accuracy may be reduced. Therefore, it is preferable to determine the threshold value by applying the discriminant analysis method within a predetermined range centered on the fixed threshold value.
図5に示すように、ネックリングは他の部分に比べて輝度値が低くなっている。そのため、本実施形態では、図6に示すように閾値以下の画素値を1(白)、閾値よりも大きい画素値を0(黒)として2値化を行っている。 As shown in FIG. 5, the neck ring has a lower luminance value than the other parts. For this reason, in this embodiment, as shown in FIG. 6, binarization is performed by setting a pixel value equal to or less than the threshold to 1 (white) and a pixel value greater than the threshold to 0 (black).
検査マスク生成部6は、2値画像生成部5により生成された2値画像に基づいて検査マスクを生成する(#05)。具体的には、図7のフローチャートの処理が行われる。
The inspection
先ず、検査マスク生成部6は2値画像中の一方の画素値を持つ画素に対してラベリング処理を行う(#11)。上述したように、本実施形態では、検査部位であるネックリングは2値画像中で白画素として表現されている。したがって、ここでは2値画像中の白画素に対してラベリングを行う。当然ながら、検査部位が2値画像中で黒画素として表現されている場合には、2値画像中の黒画素に対してラベリングを行う。例えば、図6の2値画像には2つの領域m1,m2が含まれており、ラベリングによりこれらの領域を判別することができる。
First, the inspection
ここで図5と図6とを比較すると、領域m1はネックリングであり、領域m2はキャップであることが分かる。したがって、後の疵判定処理の精度を高めるためには、検査マスクにはネックリングに対応する領域m1のみを含ませることが望ましい。そのため、検査マスク生成部6は、検査部位に対応しない領域(この例では領域m2)を検査マスクから除外する(#12〜#15)。
Here, comparing FIG. 5 with FIG. 6, it can be seen that the region m1 is a neck ring and the region m2 is a cap. Therefore, in order to increase the accuracy of the subsequent wrinkle determination process, it is desirable to include only the region m1 corresponding to the neck ring in the inspection mask. Therefore, the inspection
検査マスク生成部6は、ラベリングにより得られた各領域の特徴量を算出する(#12)。特徴量とは、例えば、面積、フィレ径、外接矩形のアスペクト比等、検査部位を表現しうる値であれば種々の値を用いることができる。
The
検査マスク生成部6は、一の領域を選択し、その領域の特徴量と予め設定された検査部位を表す2値画像の特徴量とを比較することにより、その領域が検査マスクとして適した領域であるか否かを判定し(#13)、適していないと判定された場合には2値画像からその領域を削除(画素値を0に設定)する(#14)。上述の例の場合、図6の2値画像から領域m2が除外され、図8に示す検査マスクが得られる。この処理を全ての領域に対して行う(#12〜#15)。
The inspection
さらに、検査マスク生成部6は、上述の処理により得られた検査マスクを補正する(#16)。この補正処理は必須ではないが、ここまでの処理で得られた検査マスクは、単に2値画像を基準として生成しているため、撮影時のノイズや2値化閾値のずれ等の原因により、マスク中に穴が含まれていたり、検査マスクの輪郭線が検査部位からずれていたりしているおそれがある。それを補うために、本実施例では検査マスクの輪郭線を補正している。
Further, the inspection
本実施例では、検査マスクに対して膨張、収縮処理を施している。このようにして図8の検査マスクから図9に示す検査マスクが得られる。これらの図を対比すると明らかなように、検査マスクの上方の輪郭線が補正により滑らかな曲線となっている。当然ながら、検査マスクの補正方法はこれに限定されるものではなく、平均化+2値化等他の方法を用いても構わない。 In this embodiment, the inspection mask is expanded and contracted. In this way, the inspection mask shown in FIG. 9 is obtained from the inspection mask of FIG. As is clear from comparison of these figures, the contour line above the inspection mask becomes a smooth curve by correction. Of course, the inspection mask correction method is not limited to this, and other methods such as averaging + binarization may be used.
このようにして検査マスクが生成されと、疵判定部7は、画像上に検査マスクを設定し、検査マスクの画素値が1である画素の座標に対応する画像中の画素の画素値に基づいて疵を判定する(#06)。
When the inspection mask is generated in this way, the
上述したように、本実施例では2値画像は検査領域Rと同じサイズの画像であるため、検査マスクを表す画像も検査領域と同じサイズである。したがって、画像上に検査マスクを設定する際には、検査マスクと検査領域とが一致するように設定する。 As described above, in this embodiment, the binary image is an image having the same size as that of the inspection region R, and thus the image representing the inspection mask is also the same size as the inspection region. Therefore, when setting the inspection mask on the image, the inspection mask and the inspection area are set to coincide with each other.
本実施例では以下の処理により疵の有無を判定するとともに疵を表す疵画像を生成する。先ず、処理に先立ち、初期化処理が行われる(#21)。本実施例では、検査部位を示す画素の数を表す検査部位画素数Nおよび疵を示す画素の数を表す疵画素数NDを0で初期化するとともに疵を示す疵画像の初期化(全ての画素値を0に設定)を行う。 In the present embodiment, the presence or absence of wrinkles is determined by the following processing, and a wrinkle image representing wrinkles is generated. First, an initialization process is performed prior to the process (# 21). In this embodiment, the inspection site pixel number N indicating the number of pixels indicating the inspection region and the 疵 pixel number N D indicating the number of pixels indicating 疵 are initialized to 0 and the 疵 image indicating 疵 is initialized (all The pixel value is set to 0).
続いて前処理として、画像中の画素のうち検査マスクの画素値が1である画素の座標に対応する全ての画素の画素値を取得し、統計量を算出する(#22)。なお、本実施例では統計量として平均および標準偏差を用いる。 Subsequently, as preprocessing, the pixel values of all the pixels corresponding to the coordinates of the pixel whose inspection mask pixel value is 1 among the pixels in the image are acquired, and the statistics are calculated (# 22). In this embodiment, the average and standard deviation are used as statistics.
次に、画像中の画素のうち検査マスクの画素値が1である画素の座標に対応する一の画素を選択し(#23)、その画素に対して統計量に基づく評価値を計算する(#24)。本実施例では、評価値として偏差値を用いる。このとき、併せて検査部位画素数Nをインクリメントする。 Next, among the pixels in the image, one pixel corresponding to the coordinates of the pixel whose pixel value of the inspection mask is 1 is selected (# 23), and an evaluation value based on the statistic is calculated for that pixel (# 23). # 24). In this embodiment, a deviation value is used as the evaluation value. At this time, the inspection site pixel number N is also incremented.
選択された画素の評価値は所定の条件と比較され、その画素が疵であるか否かが判定される(#25)。本実施例では、標準偏差が下限閾値以下または上限閾値以上である場合に疵として判定し、疵画素数NDをインクリメントする(#26)。また、併せて疵と判定された画素の画素値を疵画像の対応する画素の画素値として設定する(#27)。 The evaluation value of the selected pixel is compared with a predetermined condition, and it is determined whether or not the pixel is habit (# 25). In this embodiment, the standard deviation is determined as a flaw if the lower limit threshold value or less or the upper threshold or more, increments the flaw pixel number N D (# 26). In addition, the pixel value of the pixel determined to be 疵 is set as the pixel value of the corresponding pixel of the 疵 image (# 27).
この処理が全ての画素に対して行われると(#23〜#28)、疵判定部7は検査部位に疵があるか否かを判定する(#29)。本実施例では、検査部位画素数Nに対する疵画素数NDの割合が所定の閾値以上であれば、疵があると判定している。
When this process is performed for all the pixels (# 23 to # 28), the
当然ながら、疵の判定方法はこれに限定されるものではなく、他の方法を用いても構わない。 Of course, the method for determining wrinkles is not limited to this, and other methods may be used.
このようにして判定された結果は制御部1に伝達される。制御部1は、検査部位に疵が生じているとの情報を取得した際には、そのペットボトルPを搬送装置から排除するように制御してもよいし、疵がある旨をオペレータに通知する等しても構わない。また、オペレータに通知する際には、図11に示すような疵位置を明示した画像を提示すると、オペレータが目視により疵の確認を行う際の助けとなり、好適である。この画像は疵判定処理により作成した疵画像を用いることにより作成することができる。
The determination result is transmitted to the
本実施例における処理は実施例1における処理と検査マスクの補正処理のみが異なっている。そのため、検査マスクの補正処理のみを説明する。 The processing in this embodiment is different from the processing in the first embodiment only in the inspection mask correction processing. Therefore, only the inspection mask correction process will be described.
上述したように、本実施形態ではカメラ2はネックリングの下方から仰角を有するように設置されている。そのため、撮影された画像にはネックリングの下面および側面が含まれている。このような画像に基づいて疵を判定すると、ネックリングの側面のみに生じている疵を看過するおそれがある。特に、実施例1のように面積比で疵を判定する場合には、ネックリングの側面のみに生じている疵は看過され易くなる。そのため、本実施例では検査マスクをネックリングの側面を示す画素に適合するように補正している。
As described above, in this embodiment, the
図12は本実施例における検査マスクの生成処理の流れを表すフローチャートである。#31から#36は図7における#11から#16と同様である。本実施例では、このようにして得られた検査マスク(図9参照)に対して、再度補正を行っている。 FIG. 12 is a flowchart showing the flow of inspection mask generation processing in this embodiment. # 31 to # 36 are the same as # 11 to # 16 in FIG. In this embodiment, the inspection mask (see FIG. 9) obtained in this way is corrected again.
本実施例では、検査マスクのうち下部がネックリングの下面に対応し、上部がネックリングの側面に対応している。そのため、検査マスクの下端を上方に所定割合収縮させている(#37)。これにより、ネックリングの側面に対応した検査マスクが得られる(図13参照)。なお、収縮させる割合はネックリングの大きさやカメラ2の仰角に応じて適宜設定される。また、収縮させる割合は一定でなくとも構わない。例えば、中央部付近を小さく、端部付近を大きく設定しても構わない。
In this embodiment, the lower part of the inspection mask corresponds to the lower surface of the neck ring, and the upper part corresponds to the side surface of the neck ring. Therefore, the lower end of the inspection mask is contracted upward by a predetermined percentage (# 37). Thereby, an inspection mask corresponding to the side surface of the neck ring is obtained (see FIG. 13). The rate of contraction is appropriately set according to the size of the neck ring and the elevation angle of the
なお、本実施例ではカメラ2が仰角を有する位置に設置されているため検査マスクの下端を上方に収縮させたが、カメラ2が俯角を有する位置に設置されている場合には検査マスクの上端を下方に収縮させる。
In this embodiment, since the
本発明は、搬送されるペットボトル等の容器、ダンボール等の梱包資材の部位の疵やこれらに付されたラベルやシール等の貼付状態の検査技術に用いることができる。 INDUSTRIAL APPLICABILITY The present invention can be used for inspection technology for containers such as PET bottles to be conveyed, bags for packaging materials such as corrugated cardboard, and labels and seals attached to these.
P:ペットボトル(被検査物)
R:検査領域
2:カメラ(撮影部)
3:画像取得部(撮影部)
4:検査領域設定部
5:2値画像生成部
6:検査マスク生成部
7:疵判定部
P: PET bottle (inspection object)
R: Inspection area 2: Camera (imaging part)
3: Image acquisition unit (shooting unit)
4: Inspection region setting unit 5: Binary image generation unit 6: Inspection mask generation unit 7: Wrinkle determination unit
Claims (2)
前記画像中に前記被検査物の検査部位を含む検査領域を設定する検査領域設定部と、
前記検査領域に含まれる前記画像の画素値を2値化し、2値画像を生成する2値画像生成部と、
前記2値画像中の所定の一方の画素値を有する領域に基づいて検査マスクを生成する検査マスク生成部と、
前記画像に対して前記検査マスクを設定し、当該画像中で当該検査マスクに含まれる画素の画素値に基づいて前記被検査物の瑕疵の有無を判定する疵判定部と、を備え、
前記撮影部は前記被検査物に対して側方に突出する前記検査部位に対して仰角を有する仰角位置または俯角を有する俯角位置に設置されており、
前記検査マスク生成部は、前記撮影部が仰角位置にある際には前記検査マスクの下端を上方に収縮させ、前記撮影部が俯角位置にある際には前記検査マスクの上端を下方に収縮させることを特徴とする検査装置。 A photographing unit for photographing an object to be conveyed and acquiring an image;
An inspection region setting unit for setting an inspection region including an inspection part of the inspection object in the image;
A binary image generation unit that binarizes pixel values of the image included in the inspection area and generates a binary image;
An inspection mask generation unit that generates an inspection mask based on a region having a predetermined one pixel value in the binary image;
A wrinkle determination unit that sets the inspection mask for the image and determines whether or not the inspection object has wrinkles based on a pixel value of a pixel included in the inspection mask in the image ,
The imaging unit is installed at an elevation angle position having an elevation angle or an depression angle position having a depression angle with respect to the examination site protruding laterally with respect to the inspection object,
The inspection mask generation unit contracts the lower end of the inspection mask upward when the imaging unit is in the elevation position, and contracts the upper end of the inspection mask downward when the imaging unit is in the depression position. Inspection apparatus characterized by that.
前記検査領域に含まれる前記画像の画素値を2値化し、2値画像を生成する2値化ステップと、
前記2値画像中の所定の一方の画素値を有する領域に基づいて検査マスクを生成する検査マスク生成ステップと、
前記画像に対して前記検査マスクを設定し、当該画像中で当該検査マスクに含まれる画素の画素値に基づいて前記被検査物の瑕疵の有無を判定する疵判定ステップと、を備え、
前記撮影部は前記被検査物に対して側方に突出する前記検査部位に対して仰角を有する仰角位置または俯角を有する俯角位置に設置されており、
前記撮影部が仰角位置にある際には前記検査マスクの下端を上方に収縮させ、前記撮影部が俯角位置にある際には前記検査マスクの上端を下方に収縮させることを特徴とする検査方法。 An inspection region setting step for setting an inspection region including an inspection region of the inspection object in an image of the inspection object to be conveyed imaged by the imaging unit;
A binarization step of binarizing pixel values of the image included in the inspection area to generate a binary image;
An inspection mask generating step for generating an inspection mask based on an area having one predetermined pixel value in the binary image;
A wrinkle determination step that sets the inspection mask for the image, and determines whether or not the inspection object has wrinkles based on a pixel value of a pixel included in the inspection mask in the image ,
The imaging unit is installed at an elevation angle position having an elevation angle or an depression angle position having a depression angle with respect to the examination site protruding laterally with respect to the inspection object,
An inspection method, wherein the lower end of the inspection mask is contracted upward when the imaging unit is at the elevation position, and the upper end of the inspection mask is contracted downward when the imaging unit is at the depression position. .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2013109963A JP6207008B2 (en) | 2013-05-24 | 2013-05-24 | Inspection apparatus and inspection method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2013109963A JP6207008B2 (en) | 2013-05-24 | 2013-05-24 | Inspection apparatus and inspection method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2014228466A JP2014228466A (en) | 2014-12-08 |
| JP6207008B2 true JP6207008B2 (en) | 2017-10-04 |
Family
ID=52128427
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2013109963A Active JP6207008B2 (en) | 2013-05-24 | 2013-05-24 | Inspection apparatus and inspection method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6207008B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP7040972B2 (en) * | 2018-03-27 | 2022-03-23 | 倉敷紡績株式会社 | Support ring inspection device and support ring inspection method for containers with support rings |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH0212646U (en) * | 1988-07-06 | 1990-01-26 | ||
| JPH02109241U (en) * | 1989-02-16 | 1990-08-31 | ||
| JP3283356B2 (en) * | 1993-09-22 | 2002-05-20 | マツダ株式会社 | Surface inspection method |
| JP3241666B2 (en) * | 1998-07-03 | 2001-12-25 | 東洋ガラス株式会社 | Glass container defect inspection equipment |
| JP5453350B2 (en) * | 2011-06-23 | 2014-03-26 | 株式会社 システムスクエア | Packaging inspection equipment |
-
2013
- 2013-05-24 JP JP2013109963A patent/JP6207008B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| JP2014228466A (en) | 2014-12-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR102168724B1 (en) | Method And Apparatus for Discriminating Normal and Abnormal by using Vision Inspection | |
| CN103698337B (en) | A kind of adhesion defect of label of flat wine bottle automatic testing method | |
| CN104024792B (en) | Tire shape inspection method and tire shape inspection device | |
| US20140286563A1 (en) | Accurate detection of low-contrast defects in transparent material | |
| US11506615B2 (en) | Method and system for testing and inspecting containers using one or more light reflections and positional data | |
| Felipe et al. | Vision-based liquid level detection in amber glass bottles using OpenCV | |
| CN106841229A (en) | A kind of online PE bottles of detection method of bottle sealing defect based on machine vision | |
| JP2016217989A (en) | Defect inspection device and defect inspection method | |
| JP4882268B2 (en) | Defect detection method for metal cap and defect inspection apparatus for metal cap | |
| US12106468B2 (en) | Foreign material inspection system | |
| JP6619547B2 (en) | Inspection device | |
| JP6207008B2 (en) | Inspection apparatus and inspection method | |
| JP6566903B2 (en) | Surface defect detection method and surface defect detection apparatus | |
| JPH07332951A (en) | Apparatus and method for inspecting image | |
| JP2017166865A (en) | Appearance inspection device and appearance inspection method | |
| JP2019066198A (en) | Container opening inspection device and container opening inspection method | |
| JP3761313B2 (en) | Tablet appearance inspection method, tablet appearance inspection device and blister sheet packaging machine | |
| JPH11287763A (en) | Automatic inspection method of egg, transfer-controlling device of egg suited for it, and automatic inspection device of egg | |
| JP3700241B2 (en) | Cap inspection device | |
| JP2001147199A (en) | PET bottle cap tightening inspection method and device | |
| JP2005009981A (en) | Method and apparatus for inspecting superimposed state of superimposition | |
| JP5974575B2 (en) | Mouth inspection device and mouth inspection method | |
| JP2016166826A (en) | Inspection device, inspection method, and program for inspection device | |
| JP5380223B2 (en) | Circular lens inspection apparatus and method | |
| JP3577194B2 (en) | Tablet appearance inspection method and tablet appearance inspection device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160308 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20170118 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20170124 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20170324 |
|
| 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: 20170808 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20170901 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 6207008 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |