JP5666894B2 - Appearance inspection apparatus and appearance inspection method - Google Patents

Appearance inspection apparatus and appearance inspection method Download PDF

Info

Publication number
JP5666894B2
JP5666894B2 JP2010276033A JP2010276033A JP5666894B2 JP 5666894 B2 JP5666894 B2 JP 5666894B2 JP 2010276033 A JP2010276033 A JP 2010276033A JP 2010276033 A JP2010276033 A JP 2010276033A JP 5666894 B2 JP5666894 B2 JP 5666894B2
Authority
JP
Japan
Prior art keywords
value
reference value
existence
image
amount
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
Application number
JP2010276033A
Other languages
Japanese (ja)
Other versions
JP2012122965A (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.)
Japan Transport Engineering Co
Original Assignee
Japan Transport Engineering Co
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 Japan Transport Engineering Co filed Critical Japan Transport Engineering Co
Priority to JP2010276033A priority Critical patent/JP5666894B2/en
Publication of JP2012122965A publication Critical patent/JP2012122965A/en
Application granted granted Critical
Publication of JP5666894B2 publication Critical patent/JP5666894B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、物体の外観を検査するための外観検査装置及び外観検査方法に関する。   The present invention relates to an appearance inspection apparatus and an appearance inspection method for inspecting the appearance of an object.

従来の外観検査装置としては、例えば特許文献1に記載されているものが知られている。このような外観検査装置では、物体の表面(被検査面)に光源から光を照射して所定の明暗パターンを形成し、当該表面の画像をCCDカメラで取得する。そして、取得した画像に基づいて表面上に存在する表面欠陥(例えば、凹凸欠陥、塗料ブツ、キズ及び汚れ等)を検出し、これにより、物体の外観異常を判定する。   As a conventional appearance inspection apparatus, for example, the one described in Patent Document 1 is known. In such an appearance inspection apparatus, the surface (inspected surface) of an object is irradiated with light from a light source to form a predetermined light / dark pattern, and an image of the surface is acquired by a CCD camera. Then, based on the acquired image, surface defects (for example, uneven defects, paint defects, scratches, dirt, and the like) existing on the surface are detected, and thereby the appearance abnormality of the object is determined.

特開平11−63959号公報Japanese Patent Laid-Open No. 11-63959

しかしながら、上述したような外観検査装置では、複雑な画像処理や演算が必要であり、また、光源等の設定条件が厳しいものとなる場合がある。さらに、検査対象となる物体の違いによって調整や閾値設定が困難になってしまう問題がある。   However, in the appearance inspection apparatus as described above, complicated image processing and computation are required, and setting conditions such as a light source may be severe. Furthermore, there is a problem that adjustment and threshold setting become difficult due to differences in objects to be inspected.

そこで、本発明は、物体の外観異常を容易に検査することができる外観検査装置及び外観検査方法を提供することを課題とする。   Therefore, an object of the present invention is to provide an appearance inspection apparatus and an appearance inspection method capable of easily inspecting an appearance abnormality of an object.

上記課題を達成するために、本発明に係る外観検査装置は、物体の外観を検査するための外観検査装置であって、物体の画像を取得する画像取得部と、画像取得部で取得した画像に二値化処理を施し、複数の画素が第1値又は第2値で構成された二値化画像を取得する二値化処理部と、二値化処理部で取得した二値化画像に基づいて、物体の外観異常の有無を判定する異常判定部と、を備え、異常判定部は、二値化画像における一方向に並ぶ複数の画素ごとにおいて、第1値の数としての一方向存在量と、一方向に隣接する2つの画素が第1値及び第2値の間で変化する数としての一方向変化量と、をそれぞれ算出すると共に、二値化画像における一方向と直交する他方向に並ぶ複数の画素ごとにおいて、第1値の数としての他方向存在量と、他方向に隣接する2つの画素が第1値及び第2値の間で変化する数としての他方向変化量と、をそれぞれ算出し、算出した複数の一方向存在量の総和、複数の一方向変化量の総和、複数の他方向存在量の総和、及び複数の他方向変化量の総和のそれぞれが、予め設定された一方向存在量基準値、一方向変化量基準値、他方向存在量基準値、及び他方向変化量基準値のそれぞれに対し不一致の場合、外観異常が有ると判定すること、を特徴とする。なお、例えば存在量としては、「白又は黒の何れかの画素の数」が挙げられ、例えば変化量としては、「白から黒、又は黒から白に画素の分布が変わる回数」が挙げられる。   In order to achieve the above object, an appearance inspection apparatus according to the present invention is an appearance inspection apparatus for inspecting the appearance of an object, and includes an image acquisition unit that acquires an image of the object, and an image acquired by the image acquisition unit. A binarization processing unit that obtains a binarized image in which a plurality of pixels are configured by the first value or the second value, and a binarized image acquired by the binarization processing unit An abnormality determination unit that determines whether there is an abnormality in the appearance of the object, and the abnormality determination unit exists in one direction as the number of first values for each of a plurality of pixels arranged in one direction in the binarized image. Calculating the amount and the unidirectional change amount as the number of two pixels adjacent in one direction changing between the first value and the second value, respectively, and orthogonal to the one direction in the binarized image For each of a plurality of pixels arranged in the direction, the other direction existence amount as the number of first values The other direction change amount is calculated as the number of two pixels adjacent to each other in the other direction changing between the first value and the second value. The sum of the change amount, the sum of the plurality of other direction existence amounts, and the sum of the plurality of other direction change amounts are set in advance as one-way existence amount reference value, one-way change amount reference value, and other direction existence amount reference, respectively. When there is a discrepancy with respect to each of the value and the other direction change amount reference value, it is determined that there is an appearance abnormality. For example, the abundance includes “the number of pixels of either white or black”, and the variation includes, for example, “the number of times the distribution of pixels changes from white to black or from black to white”. .

この本発明の外観検査装置では、物体の画像に二値化処理を施し、複数の画素が二値化され単純化された二値化画像を取得する。そして、この二値化画像の第1値及び第2値についての空間分布を、一方向存在量と一方向変化量と他方向存在量と他方向変化量として単純化して算出し、これにより、物体の外観異常を判定する。つまり、複雑な画像処理や演算を要せず、外観検査に係る異常判定をシンプルなものにして精度よく実施できる。加えて、物体の表面に明暗パターンを形成する必要もなく、ひいては光源等の設定や調整も不要となる。従って、本発明によれば、物体の外観異常を容易に検査することが可能となる。   In the appearance inspection apparatus according to the present invention, a binarization process is performed on an object image, and a binarized image obtained by binarizing a plurality of pixels and obtaining a simplified image is obtained. Then, the spatial distribution for the first value and the second value of the binarized image is simply calculated as a one-way existence amount, a one-way change amount, another direction existence amount, and another direction change amount, Determine the appearance abnormality of the object. That is, complicated image processing and computation are not required, and abnormality determination relating to appearance inspection can be simplified and performed with high accuracy. In addition, it is not necessary to form a light and dark pattern on the surface of the object, and therefore, setting and adjustment of the light source and the like are not necessary. Therefore, according to the present invention, it is possible to easily inspect the appearance abnormality of the object.

このとき、異常判定部は、正常な物体の二値化画像についての複数の一方向存在量の総和、複数の一方向変化量の総和、複数の他方向存在量の総和、及び複数の他方向変化量の総和のそれぞれを、一方向存在量基準値、一方向変化量基準値、他方向存在量基準値、及び他方向変化量基準値のそれぞれとして予め設定する場合がある。   At this time, the abnormality determination unit includes a sum of a plurality of unidirectional existence amounts, a sum of a plurality of unidirectional change amounts, a sum of a plurality of other direction existence amounts, and a plurality of other directions for a binarized image of a normal object. In some cases, the total sum of the change amounts is set in advance as a one-way existence reference value, a one-way change reference value, another direction existence reference value, and another direction change reference value.

また、物体には加工部が形成されており、異常判定部は、加工部の位置ズレ異常の有無を判定する位置ズレ判定部を有し、位置ズレ判定部は、二値化画像における一方向に並ぶ複数の画素ごとにおいて、当該複数の画素に関する他方向の座標値により一方向存在量又は一方向変化量を除した値としての一方向比をそれぞれ算出すると共に、二値化画像における他方向に並ぶ複数の画素ごとにおいて、当該複数の画素に関する一方向の座標値により他方向存在量又は他方向変化量を除した値としての他方向比をそれぞれ算出し、算出した複数の一方向比の総和、及び他方向比の総和のそれぞれが、予め設定された一方向比基準値、及び他方向比基準値のそれぞれに対し不一致の場合、加工部の位置ズレ異常が有ると判定すること、が好ましい。この場合、物体の加工部の位置ズレ異常を容易に検査することが可能となる。   In addition, a processing unit is formed on the object, the abnormality determination unit includes a position shift determination unit that determines the presence or absence of a positional shift abnormality of the processing unit, and the position shift determination unit is one direction in the binarized image. For each of the plurality of pixels arranged in the same direction, a one-way ratio is calculated as a value obtained by dividing the one-way existence amount or the one-way change amount by the coordinate value in the other direction for the plurality of pixels, and the other direction in the binarized image. For each of the plurality of pixels arranged in the same direction, the other direction ratio as a value obtained by dividing the other direction existence amount or the other direction change amount by the coordinate value of the one direction related to the plurality of pixels is calculated. When each of the sum and the sum of the other direction ratios does not match the preset one-way ratio reference value and each of the other direction ratio reference values, it is determined that there is a positional deviation abnormality of the processing part. preferable. In this case, it is possible to easily inspect the positional deviation abnormality of the processed part of the object.

このとき、異常判定部は、正常な物体の二値化画像についての複数の一方向比の総和、及び複数の他方向比の総和のそれぞれを、一方向比基準値、及び他方向比基準値のそれぞれとして予め設定する場合がある。   At this time, the abnormality determination unit calculates the one-way ratio reference value and the other-direction ratio reference value for each of the plurality of one-way ratio sums and the plurality of other-direction ratio sums for the binarized image of the normal object. May be set in advance.

また、二値化処理部は、画像取得部で取得した画像についての階調に関する明度分布を取得し、明度分布において、明度が最も高い第1ピーク値のときの第1階調と、明度が第1ピーク値の次に高い第2ピーク値のときの第2階調と、を導出し、第1及び第2階調の間の値を、二値化処理を行うための閾値となる二値化レベルとして、画像に二値化処理を施すこと、が好ましい。ここで、画像において、物体の表面本来の部分における明度と、加工部や表面欠陥等(以下、単に「加工部等」という)における明度とでは、階調が互いに異なるピーク値をそれぞれ有することが見出される。よって、本発明のように、明度が第1及び第2ピーク値のときの第1及び第2階調を導出し、これらの間の値を二値化レベルとして二値化処理を施すと、加工部等を好適に識別可能な二値化画像を取得することができる。   In addition, the binarization processing unit acquires a lightness distribution related to the gradation for the image acquired by the image acquisition unit, and the lightness distribution has the first gradation at the first peak value with the highest lightness and the lightness. The second gradation at the second peak value that is the second highest next to the first peak value is derived, and the value between the first and second gradations is a threshold value for performing binarization processing. As the binarization level, it is preferable to binarize the image. Here, in the image, the lightness in the original part of the surface of the object and the lightness in the processed part, surface defect, etc. (hereinafter simply referred to as “processed part etc.”) may have different peak values. Found. Therefore, as in the present invention, when the first and second gradations when the lightness is the first and second peak values are derived, and the binarization process is performed with the value between these as the binarization level, It is possible to obtain a binarized image that can appropriately identify the processing unit and the like.

また、本発明に係る外観検査方法は、物体の外観を検査するための外観検査方法であって、物体の画像を取得する画像取得工程と、画像取得工程で取得した画像に二値化処理を施し、複数の画素が第1値又は第2値で構成された二値化画像を取得する二値化処理工程と、二値化処理工程で取得した二値化画像に基づいて、物体の異常の有無を判定する異常判定工程と、を備え、異常判定工程では、二値化画像における一方向に並ぶ複数の画素ごとにおいて、第1値の数としての一方向存在量と、一方向に隣接する2つの画素が第1値及び第2値の間で変化する数としての一方向変化量と、をそれぞれ算出すると共に、二値化画像における一方向と直交する他方向に並ぶ複数の画素ごとにおいて、第1値の数としての他方向存在量と、他方向に隣接する2つの画素が第1値及び第2値の間で変化する数としての他方向変化量と、をそれぞれ算出し、算出した複数の一方向存在量の総和、複数の一方向変化量の総和、複数の他方向存在量の総和、及び複数の他方向変化量の総和のそれぞれが、予め設定された一方向存在量基準値、一方向変化量基準値、他方向存在量基準値、及び他方向変化量基準値のそれぞれに対し不一致の場合、異常が有ると判定すること、を特徴とする。   An appearance inspection method according to the present invention is an appearance inspection method for inspecting the appearance of an object, and includes an image acquisition step of acquiring an image of the object, and binarization processing on the image acquired in the image acquisition step. A binarization processing step for obtaining a binarized image in which a plurality of pixels are configured with the first value or the second value, and an abnormality of the object based on the binarized image acquired in the binarization processing step An abnormality determination step for determining the presence or absence of the image, and in the abnormality determination step, for each of a plurality of pixels arranged in one direction in the binarized image, the one-way existence amount as the number of first values and adjacent in one direction For each of a plurality of pixels arranged in the other direction orthogonal to one direction in the binarized image, while calculating one direction change amount as the number of the two pixels that change between the first value and the second value In the other direction as the number of the first value and in the other direction The other direction change amount is calculated as the number of the two pixels in contact with each other changing between the first value and the second value, and the calculated sum of the one-way existence amounts and the sum of the plurality of one-way change amounts are calculated. , A sum of a plurality of other direction existence amounts, and a sum of a plurality of other direction change amounts are set in advance as a one-way existence amount reference value, a one-way change amount reference value, another direction existence amount reference value, and the like. When there is no coincidence with each of the direction change amount reference values, it is determined that there is an abnormality.

この本発明の外観検査方法では、物体の画像に二値化処理を施し、複数の画素が二値化され単純化された二値化画像を取得する。そして、この二値化画像の第1値及び第2値についての空間分布を、一方向存在量と一方向変化量と他方向存在量と他方向変化量として単純化して算出し、これにより、物体の外観異常を判定する。つまり、複雑な画像処理や演算を要せず、外観検査に係る異常判定をシンプルなものにして精度よく実施できる。加えて、物体の表面に明暗パターンを形成する必要もなく、ひいては光源等の設定や調整も不要となる。従って、本発明においても、物体の外観異常を容易に検査できるという上記効果が奏される。   In the appearance inspection method of the present invention, a binarization process is performed on an object image, and a binarized image obtained by binarizing a plurality of pixels and obtaining a simplified image is obtained. Then, the spatial distribution for the first value and the second value of the binarized image is simply calculated as a one-way existence amount, a one-way change amount, another direction existence amount, and another direction change amount, Determine the appearance abnormality of the object. That is, complicated image processing and computation are not required, and abnormality determination relating to appearance inspection can be simplified and performed with high accuracy. In addition, it is not necessary to form a light and dark pattern on the surface of the object, and therefore, setting and adjustment of the light source and the like are not necessary. Therefore, also in the present invention, the above-described effect that the appearance abnormality of the object can be easily inspected is exhibited.

このとき、一方向存在量基準値、一方向変化量基準値、他方向存在量基準値、及び他方向変化量基準値を予め設定する第1前処理工程を備え、第1前処理工程では、正常な物体の二値化画像についての複数の一方向存在量の総和、複数の一方向変化量の総和、複数の他方向存在量の総和、及び複数の他方向変化量の総和のそれぞれを、一方向存在量基準値、一方向変化量基準値、他方向存在量基準値、及び他方向変化量基準値のそれぞれとして予め設定する場合がある。   At this time, the unidirectional presence amount reference value, the unidirectional change amount reference value, the other direction presence amount reference value, and the first direction change amount reference value are set in advance. A total of a plurality of unidirectional existence amounts, a plurality of unidirectional change amounts, a plurality of other direction existence amounts, and a plurality of other direction change amounts for each of a normal object binarized image, There are cases where the unidirectional existence amount reference value, the unidirectional change amount reference value, the other direction existence amount reference value, and the other direction change amount reference value are set in advance.

また、物体には加工部が形成されており、異常判定工程は、加工部の位置ズレ異常の有無を判定する位置ズレ判定工程を有し、位置ズレ判定工程では、二値化画像における一方向に並ぶ複数の画素ごとにおいて、当該複数の画素に関する他方向の座標値により一方向存在量又は一方向変化量を除した値としての一方向比をそれぞれ算出すると共に、二値化画像における他方向に並ぶ複数の画素ごとにおいて、当該複数の画素に関する一方向の座標値により他方向存在量又は他方向変化量を除した値としての他方向比をそれぞれ算出し、算出した複数の一方向比の総和、及び他方向比の総和のそれぞれが、予め設定された一方向比基準値、及び他方向比基準値のそれぞれに対し不一致の場合、加工部の位置ズレ異常が有ると判定すること、が好ましい。この場合、物体の加工部の位置ズレ異常を容易に検査することが可能となる。   In addition, the processing part is formed on the object, and the abnormality determination step includes a position shift determination step for determining presence / absence of a position shift abnormality of the processing unit. In the position shift determination step, one direction in the binarized image is obtained. For each of the plurality of pixels arranged in the same direction, a one-way ratio is calculated as a value obtained by dividing the one-way existence amount or the one-way change amount by the coordinate value in the other direction for the plurality of pixels, and the other direction in the binarized image. For each of the plurality of pixels arranged in the same direction, the other direction ratio as a value obtained by dividing the other direction existence amount or the other direction change amount by the coordinate value of the one direction related to the plurality of pixels is calculated. When each of the sum and the sum of the other direction ratios does not match the preset one-way ratio reference value and each of the other direction ratio reference values, it is determined that there is a positional deviation abnormality of the processing part. Good Arbitrariness. In this case, it is possible to easily inspect the positional deviation abnormality of the processed part of the object.

このとき、一方向比基準値、及び他方向比基準値を予め設定する第2前処理工程を備え、第2前処理工程では、正常な物体の二値化画像についての複数の一方向比の総和、及び複数の他方向比の総和のそれぞれを、一方向比基準値、及び他方向比基準値のそれぞれとして予め設定する場合がある。   At this time, it comprises a second pre-processing step for presetting the one-way ratio reference value and the other-direction ratio reference value. In the second pre-processing step, a plurality of unidirectional ratios for a binarized image of a normal object are provided. Each of the sum and the sum of the other direction ratios may be set in advance as the one-way ratio reference value and the other direction ratio reference value.

また、二値化処理工程では、画像取得部で取得した画像についての階調に関する明度分布を取得し、明度分布において、明度が最も高い第1ピーク値のときの第1階調と、明度が第1ピーク値の次に高い第2ピーク値のときの第2階調と、を導出し、第1及び第2階調の間の値を、二値化処理を行うための閾値となる二値化レベルとして、画像に二値化処理を施すこと、が好ましい。この場合、上述したように、画像において物体の表面本来の部分における明度と加工部等における明度とでは、階調が互いに異なるピーク値をそれぞれ有することから、本発明のように、明度が第1及び第2ピーク値のときの第1及び第2階調を導出し、これらの間の値を二値化レベルとして二値化処理を施すと、加工部等を好適に識別可能な二値化画像を取得することができる。   In the binarization processing step, a brightness distribution related to the gradation of the image acquired by the image acquisition unit is acquired, and the first gradation at the first peak value having the highest brightness in the brightness distribution and the brightness are The second gradation at the second peak value that is the second highest next to the first peak value is derived, and the value between the first and second gradations is a threshold value for performing binarization processing. As the binarization level, it is preferable to binarize the image. In this case, as described above, the lightness at the original portion of the surface of the object and the lightness at the processed portion in the image have different peak values from each other, so that the lightness is the first as in the present invention. When the first and second gradations at the time of the second peak value are derived, and the binarization process is performed with the value between them as the binarization level, the binarization that can identify the processing part etc. suitably Images can be acquired.

本発明によれば、物体の外観異常を容易に検査することが可能となる。   According to the present invention, it is possible to easily inspect the appearance abnormality of an object.

一実施形態に係る外観検査装置の構成を示す概略ブロック図である。It is a schematic block diagram which shows the structure of the external appearance inspection apparatus which concerns on one Embodiment. 一実施形態に係る外観検査装置による外観検査方法を示すフローチャートである。It is a flowchart which shows the external appearance inspection method by the external appearance inspection apparatus which concerns on one Embodiment. 基準画像の一例を示す図である。It is a figure which shows an example of a reference | standard image. 明度のヒストグラムの一例を示す図である。It is a figure which shows an example of the histogram of a brightness. 基準二値化画像の一例を示す図である。It is a figure which shows an example of a reference | standard binarization image. 検査用画像の一例を示す図である。It is a figure which shows an example of the image for a test | inspection. 検査用二値化画像の一例を示す図である。It is a figure which shows an example of the binarized image for a test | inspection. 検査用二値化画像の他の一例を示す図である。It is a figure which shows another example of the binarized image for a test | inspection. 検査用二値化画像のさらに他の一例を示す図である。It is a figure which shows another example of the binarized image for a test | inspection. 検査用二値化画像の別の一例を示す図である。It is a figure which shows another example of the binarized image for a test | inspection. 検査用二値化画像のさらに別の一例を示す図である。It is a figure which shows another example of the binarized image for a test | inspection.

以下、図面を参照しながら、本発明の好適な実施形態について詳細に説明する。なお、以下の説明では、同一又は相当要素には同一符号を付し、重複する説明は省略する。   Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the drawings. In the following description, the same or equivalent elements will be denoted by the same reference numerals, and redundant description will be omitted.

図1は、本発明の一実施形態に係る外観検査装置の構成を示す概略ブロック図である。図1に示すように、外観検査装置1は、物体10の外観を検査し、外観異常を判別するものである。本実施形態の外観検査装置1は、例えば抵抗スポット溶接痕である加工部Z(図3参照)が形成された物体10の表面10aを検査する。物体10としては、特に限定されるものではなく、車両(鉄道車両、軌道、リニアモータ、自動車等)における窓ガラスや外壁等が挙げられる。   FIG. 1 is a schematic block diagram showing the configuration of an appearance inspection apparatus according to an embodiment of the present invention. As shown in FIG. 1, the appearance inspection apparatus 1 inspects the appearance of an object 10 and determines an appearance abnormality. The appearance inspection apparatus 1 of this embodiment inspects the surface 10a of the object 10 on which the processed portion Z (see FIG. 3), which is a resistance spot welding mark, for example, is formed. The object 10 is not particularly limited, and examples thereof include a window glass and an outer wall of a vehicle (railway vehicle, track, linear motor, automobile, etc.).

この外観検査装置1は、画像取得部2、画像解析部3及び報知部4を備えている、画像取得部2は、物体10の表面10aのデジタル画像(以下、単に「画像」という)を取得するための撮像部である。この画像取得部2は、画像解析部3に接続されており、取得した画像を画像解析部3に出力する。画像取得部2としては、CCDカメラ、デジタルカメラ及びスキャナ等が用いられている。   The appearance inspection apparatus 1 includes an image acquisition unit 2, an image analysis unit 3, and a notification unit 4. The image acquisition unit 2 acquires a digital image (hereinafter simply referred to as “image”) of the surface 10a of the object 10. It is an imaging part for doing. The image acquisition unit 2 is connected to the image analysis unit 3 and outputs the acquired image to the image analysis unit 3. As the image acquisition unit 2, a CCD camera, a digital camera, a scanner, or the like is used.

画像解析部3は、画像取得部2で取得した画像に二値化処理を施して二値化画像を取得する二値化部(二値化処理部)3aと、二値化画像に基づいて物体10の外観異常の有無を判定する異常判定部3bと、加工部Zの位置ズレ異常の有無を判定する位置ズレ判定部3cと、を含んで構成されている。この画像解析部3は、報知部4に接続されており、異常が有りと判定した場合に異常報知指令を報知部4に出力する。画像解析部3としては、パソコンのECUが利用され、例えばCPU、ROM及びRAM等を含んで構成されている。   The image analysis unit 3 performs binarization processing on the image acquired by the image acquisition unit 2 and acquires a binarized image (binarization processing unit) 3a, and based on the binarized image. An abnormality determination unit 3b that determines the presence / absence of an appearance abnormality of the object 10 and a position shift determination unit 3c that determines the presence / absence of a position shift abnormality of the processing unit Z are configured. The image analysis unit 3 is connected to the notification unit 4 and outputs an abnormality notification command to the notification unit 4 when it is determined that there is an abnormality. As the image analysis unit 3, an ECU of a personal computer is used, and includes, for example, a CPU, a ROM, a RAM, and the like.

報知部4は、画像解析部3から出力された異常報知指令に基づいて検査者に異常を報知通知)するものである。報知部4としては、例えばスピーカ、ブザー、警告灯、パソコンのディスプレイ(モニタ)等が利用されている。   The notification unit 4 notifies the inspector of abnormality based on the abnormality notification command output from the image analysis unit 3. As the notification unit 4, for example, a speaker, a buzzer, a warning light, a personal computer display (monitor), or the like is used.

次に、図2のフローチャートを参照しつつ、上述した外観検査装置1によって物体10の外観を検査する外観検査方法について説明する。なお、ここでは、一例として、加工部Zが形成されている物体10の外観を検査する場合を例示する。   Next, an appearance inspection method for inspecting the appearance of the object 10 by the above-described appearance inspection apparatus 1 will be described with reference to the flowchart of FIG. Here, as an example, a case where the appearance of the object 10 on which the processed portion Z is formed is inspected.

まず、前処理工程として、外観異常を判定するための基準値(X方向存在量基準値αx、X方向変化量基準値βx、Y方向存在量基準値αy、及びY方向変化量基準値βy)を算出する。これと共に、加工部Zの位置ズレ異常を判定するための基準値(X方向比基準値γx、及びY方向比基準値γy)を算出する。   First, as pre-processing steps, reference values for determining an appearance abnormality (X direction existence amount reference value αx, X direction change amount reference value βx, Y direction existence amount reference value αy, and Y direction change amount reference value βy). Is calculated. At the same time, reference values (X-direction ratio reference value γx and Y-direction ratio reference value γy) for determining a misalignment abnormality of the machining part Z are calculated.

すなわち、加工部Zが正常に形成された物体10を、画像取得部2によって撮像する。これにより、物体10において正常な加工部Zを含む表面10aのデジタル画像である基準画像を取得する(S1)。図3に示すように、ここでの基準画像11では、正常な加工部Zとして、正円リング状の抵抗スポット溶接痕が表面10aに形成されている。   That is, the image acquisition unit 2 captures an image of the object 10 on which the processing unit Z is normally formed. Thereby, the reference image which is a digital image of the surface 10a including the normal processing part Z in the object 10 is acquired (S1). As shown in FIG. 3, in the reference image 11 here, as a normal processed portion Z, a resistance ring weld mark having a circular ring shape is formed on the surface 10 a.

続いて、画像解析部3により、基準画像11の明度のヒストグラムを導出する(S2)。具体的には、図4に示すように、画像11についてグレースケール画像を作成し、各ピクセルの明度(明るさ)を求め、256階調に関する明度分布を基準ヒストグラム12として求める。このとき、各ピクセルの明度は、例えば「明度=0.299×R成分+0.587×G成分+0.144×B成分」とする式で求められる。ここでの基準ヒストグラム12では、横軸に階調が示されており、当該階調は、0から255までの256階調で表現されている。また、縦軸に明度が示されており、当該明度は、ピクセル(px)で表現されている。   Subsequently, a histogram of brightness of the reference image 11 is derived by the image analysis unit 3 (S2). Specifically, as shown in FIG. 4, a grayscale image is created for the image 11, the brightness (brightness) of each pixel is obtained, and the brightness distribution for 256 gradations is obtained as the reference histogram 12. At this time, the lightness of each pixel is obtained by an expression such as “lightness = 0.299 × R component + 0.587 × G component + 0.144 × B component”. In the reference histogram 12 here, gradation is shown on the horizontal axis, and the gradation is expressed by 256 gradations from 0 to 255. The lightness is shown on the vertical axis, and the lightness is expressed in pixels (px).

続いて、基準ヒストグラム12において、明度が最も高い第1ピーク値P1のときの第1階調12Hと、明度が第1ピーク値P1の次に高い第2ピーク値P2のときの第2階調12Lと、を導出する。そして、これら第1及び第2階調12H,12Lの中央値12Mを、二値化処理を行うための閾値となる二値化レベルとして設定する(S3)。続いて、設定した二値化レベルに基づいて基準画像11に二値化処理を施し、複数の画素が1値(第1値)又は0値(第2値)のみで構成された二値化画像である基準二値化画像13を取得する(S4)。   Subsequently, in the reference histogram 12, the first gradation 12H at the first peak value P1 having the highest lightness and the second gradation at the second peak value P2 having the lightness next to the first peak value P1. 12L is derived. Then, the median value 12M of the first and second gradations 12H and 12L is set as a binarization level serving as a threshold for performing binarization processing (S3). Subsequently, binarization processing is performed on the reference image 11 based on the set binarization level, and binarization in which a plurality of pixels are configured with only one value (first value) or zero value (second value). A reference binarized image 13 which is an image is acquired (S4).

図5は、基準二値化画像の一例を示す図である。図中では、基準二値化画像13は、その画素Gが12行11列の非正方行列とされている。この基準二値化画像13では、その図示左上の隅位置が画素Gの座標基準に設定され(つまり、原点(0,0)とされ)、図示左右方向がX方向にされ、図示上下方向がX方向に直交するY方向(他方向)に設定されている。また、図中では、説明の便宜上、基準二値化画像13に加工部Zの画像を重ねて現わすものとする。これらについては、図7〜11において同様である。図5に示すように、基準二値化画像13では、加工部Zに対応する画素Gが1値となり、その他の画素Gが0値となっているのがわかる。   FIG. 5 is a diagram illustrating an example of a reference binarized image. In the figure, the reference binarized image 13 is a non-square matrix whose pixels G are 12 rows and 11 columns. In the reference binarized image 13, the upper left corner position in the figure is set as the coordinate reference of the pixel G (that is, the origin (0, 0)), the left and right direction in the figure is set to the X direction, and the vertical direction in the figure is set. It is set in the Y direction (other direction) orthogonal to the X direction. In the drawing, for convenience of explanation, it is assumed that the image of the processing portion Z is superimposed on the reference binarized image 13. These are the same in FIGS. As shown in FIG. 5, in the reference binarized image 13, it can be seen that the pixel G corresponding to the processed portion Z has a 1 value and the other pixels G have a 0 value.

続いて、画像解析部3により、基準二値化画像13におけるX方向に並ぶ複数の画素G(以下、「X画素群」という)ごとにおいて、1値の数としてのX方向存在量Axと、X方向に隣接する2つの画素Gが1値及び0値の間で変化する数としてのX方向変化量Bxと、をそれぞれ算出する(S5)。換言すると、X列に並ぶ複数の画素Gのうちで1値の数をX方向存在量Axとし、X列に並ぶ複数の画素GをX方向一方側から他方側に順に見たときに1値→0値(又は、0値→1値)となる数をX方向変化量Bxとする。   Subsequently, the image analysis unit 3 uses the X direction existence amount Ax as the number of one value for each of a plurality of pixels G arranged in the X direction in the reference binarized image 13 (hereinafter referred to as “X pixel group”), An X-direction change amount Bx is calculated as the number of changes in the two pixels G adjacent in the X direction between 1 value and 0 value (S5). In other words, among the plurality of pixels G arranged in the X column, the number of one value is the X-direction existence amount Ax, and one value is obtained when the plurality of pixels G arranged in the X column are viewed in order from one side to the other side in the X direction. A number that becomes 0 value (or 0 value → 1 value) is defined as an X-direction change amount Bx.

例えば図5中の例に示すX画素群Gx1では、1値の数が5つ存在し、よって、X方向存在量Axは「5」となる。また、X画素群Gx1では、0から1に変化する箇所と、1から0に変化する箇所と、がそれぞれ1箇所ずつ存在し、よって、X方向変化量Bxは「2」となる。   For example, in the X pixel group Gx1 shown in the example in FIG. 5, there are five values of one value, and thus the X-direction existence amount Ax is “5”. Further, in the X pixel group Gx1, there are one place that changes from 0 to 1 and one place that changes from 1 to 0. Therefore, the X-direction change amount Bx is “2”.

また上記S5では、基準二値化画像13におけるY方向に並ぶ複数の画素G(以下、「Y画素群」という)ごとにおいて、1値の数としてのY方向存在量Ayと、Y方向に隣接する2つの画素Gが1値及び0値の間で変化する数としてのY方向変化量Byと、をそれぞれ算出する。換言すると、Y列に並ぶ複数の画素Gのうちで1値の数をY方向存在量Ayとし、Y列に並ぶ複数の画素GをY方向一方側から他方側に順に見たときに1値→0値(又は、0値→1値)となる数をY方向変化量Byとする。   In S5, for each of a plurality of pixels G arranged in the Y direction in the reference binarized image 13 (hereinafter referred to as “Y pixel group”), the Y direction existence amount Ay as the number of values is adjacent to the Y direction. The Y direction change amount By as the number of the two pixels G to be changed between the 1 value and the 0 value is calculated. In other words, the number of one value among the plurality of pixels G arranged in the Y column is defined as the Y-direction existence amount Ay, and one value is obtained when the plurality of pixels G arranged in the Y column are viewed in order from one side to the other side in the Y direction. A number that becomes 0 value (or 0 value → 1 value) is defined as a Y-direction change amount By.

例えば図5中の例に示すY画素群Gy1では、1値の数が6つ存在し、よって、X方向存在量Ayは「6」となる。また、X画素群Gy1では、0から1に変化する箇所と、1から0に変化する箇所と、がそれぞれ1箇所ずつ存在し、よって、Y方向変化量Byは「2」となる。   For example, in the Y pixel group Gy1 shown in the example in FIG. 5, there are six 1-values, and therefore the X-direction existence amount Ay is “6”. Further, in the X pixel group Gy1, there are one place that changes from 0 to 1 and one place that changes from 1 to 0, and thus the Y-direction change amount By becomes “2”.

さらにまた、上記S5では、複数のX画素群において、Y方向の座標値によりX方向存在量Axを除した値としてのX方向比Cxをそれぞれ算出する。また、複数のY画素群において、X方向の座標値によりY方向存在量Ayを除した値としてのY方向比Cyをそれぞれ算出する。換言すると、X方向存在量Axと当該X方向存在量AxについてのY方向の位置情報(Y座標)との比を、X方向比Cxとする。また、Y方向存在量Ayと当該Y方向存在量AyについてのX方向の位置情報(X座標)との比を、Y方向比Cyとする。   In S5, the X direction ratio Cx is calculated as a value obtained by dividing the X direction existence amount Ax by the coordinate value in the Y direction in the plurality of X pixel groups. Further, in the plurality of Y pixel groups, the Y direction ratio Cy is calculated as a value obtained by dividing the Y direction existence amount Ay by the X direction coordinate value. In other words, the ratio between the X direction existence amount Ax and the Y direction position information (Y coordinate) for the X direction existence amount Ax is defined as an X direction ratio Cx. Further, the ratio between the Y direction existence amount Ay and the X direction position information (X coordinate) for the Y direction existence amount Ay is defined as a Y direction ratio Cy.

例えば、図5中の例に示すX画素群Gx1では、そのY座標値「2」によりX方向存在量Ax「5」を除した「2.5」が、X方向比Cxとなる。一方、Y画素群Gy1では、そのX座標値「2」によりY方向存在量Ay「6」を除した「3」が、Y方向比Cyとなる。   For example, in the X pixel group Gx1 shown in the example of FIG. 5, “2.5” obtained by dividing the X direction existence amount Ax “5” by the Y coordinate value “2” is the X direction ratio Cx. On the other hand, in the Y pixel group Gy1, “3” obtained by dividing the Y-direction existence amount Ay “6” by the X-coordinate value “2” is the Y-direction ratio Cy.

続いて、複数のX方向存在量Axの総和ΣAxをX方向存在量基準値αxと設定し、複数のY方向存在量Ayの総和ΣAyをY方向存在量基準値αyと設定する。また、複数のX方向変化量Bxの総和ΣBxをX方向変化量基準値βxと設定し、複数のY方向変化量Byの総和ΣByをY方向変化量基準値βyと設定する。そして、複数のX方向比Cxの総和ΣCxをX方向比基準値γxと設定し、複数のY方向比Cyの総和ΣCyをY方向比基準値γyと設定する(S6)。   Subsequently, the sum ΣAx of the plurality of X-direction existence amounts Ax is set as the X-direction existence amount reference value αx, and the sum ΣAy of the plurality of Y-direction existence amounts Ay is set as the Y-direction existence amount reference value αy. Further, the sum ΣBx of the plurality of X-direction change amounts Bx is set as the X-direction change amount reference value βx, and the sum ΣBy of the plurality of Y-direction change amounts By is set as the Y-direction change amount reference value βy. Then, the sum ΣCx of the plurality of X direction ratios Cx is set as the X direction ratio reference value γx, and the sum ΣCy of the plurality of Y direction ratios Cy is set as the Y direction ratio reference value γy (S6).

次に、本工程として、上記S6にて設定した各基準値を用い、検査用の物体10の外観を検査する。すなわち、まず、検査用の物体10を画像取得部2によって撮像し、加工部Zを含む表面10aのデジタル画像である検査用画像を取得する(S11)。図6に例示する検査用画像21では、例えば溶接条件の悪化により、加工部Zが図示左右方向に潰れるたような楕円形状になっている。   Next, in this step, the appearance of the inspection object 10 is inspected using each reference value set in S6. That is, first, the inspection object 10 is imaged by the image acquisition unit 2, and an inspection image which is a digital image of the surface 10a including the processing unit Z is acquired (S11). In the inspection image 21 illustrated in FIG. 6, for example, due to deterioration of welding conditions, the processed portion Z has an elliptical shape that is crushed in the horizontal direction in the drawing.

続いて、上記S2〜S4と同様にして、画像解析部3により、検査用画像21の明度のヒストグラムを導出し、二値化レベルを設定し、当該二値化レベルに基づいて検査用画像21に二値化処理を施し、検査用二値化画像23を取得する(S12〜S14)。   Subsequently, in the same manner as in S2 to S4, the image analysis unit 3 derives a brightness histogram of the inspection image 21, sets a binarization level, and based on the binarization level, the inspection image 21. A binarization process is performed to obtain a binarized image for inspection 23 (S12 to S14).

図7は、検査用二値化画像の一例を示す図である。図7に示すように、この検査用二値化画像23は、上記図6の検査用画像21に対応する例であり、ここでは、楕円形状の加工部Zに対応する画素Gが1値となり、その他の画素Gが0値となっている。   FIG. 7 is a diagram illustrating an example of a binarized image for inspection. As shown in FIG. 7, the binarized image for inspection 23 is an example corresponding to the inspection image 21 of FIG. 6, and here, the pixel G corresponding to the elliptical processed portion Z becomes one value. The other pixels G have 0 values.

続いて、画像解析部3により、検査用二値化画像23におけるX画素群ごとにおいて、X方向存在量Axと、X方向変化量Bxと、をそれぞれ算出する(S15)。図7中の例に示すX画素群Gx2では、1値の数が5つ存在し、よって、X方向存在量Axは「5」となる。また、X画素群Gx1では、0から1に変化する箇所と、1から0に変化する箇所と、がそれぞれ1箇所ずつ存在し、よって、X方向変化量Bxは「2」となる。   Subsequently, the image analysis unit 3 calculates the X-direction existence amount Ax and the X-direction change amount Bx for each X pixel group in the inspection binary image 23 (S15). In the X pixel group Gx2 shown in the example in FIG. 7, there are five values of one value, and therefore the X-direction existence amount Ax is “5”. Further, in the X pixel group Gx1, there are one place that changes from 0 to 1 and one place that changes from 1 to 0. Therefore, the X-direction change amount Bx is “2”.

また上記S15では、検査用二値化画像23におけるY画素群ごとにおいて、Y方向存在量Ayと、Y方向変化量Byと、をそれぞれ算出する。図7中の例に示すY画素群Gy2では、1値の数が存在せず、よって、X方向存在量Ayは「0」となる。また、X画素群Gy2では、0から1に変化する箇所及び1から0に変化する箇所が存在せず、よって、Y方向変化量Byは「0」となる。   In S15, the Y-direction existence amount Ay and the Y-direction change amount By are calculated for each Y pixel group in the inspection binarized image 23. In the Y pixel group Gy2 shown in the example in FIG. 7, there is no number of one value, and therefore the X-direction existence amount Ay is “0”. Further, in the X pixel group Gy2, there is no portion that changes from 0 to 1 and there is no portion that changes from 1 to 0. Therefore, the Y-direction change amount By is “0”.

さらにまた、上記S15では、複数のX画素群においてX方向比Cxをそれぞれ算出すし、複数のY画素群においてY方向比Cyをそれぞれ算出する。図7中の例に示すX画素群Gx2では、そのY座標値「2」によりX方向存在量Ax「5」を除した「2.5」が、X方向比Cxとなる。一方、Y画素群Gy2では、そのX座標値「2」によりX方向存在量Ax「0」を除した「0」が、X方向比Cxとなる。   In S15, the X direction ratio Cx is calculated for each of the plurality of X pixel groups, and the Y direction ratio Cy is calculated for each of the plurality of Y pixel groups. In the X pixel group Gx2 shown in the example in FIG. 7, “2.5” obtained by dividing the X direction existence amount Ax “5” by the Y coordinate value “2” is the X direction ratio Cx. On the other hand, in the Y pixel group Gy2, “0” obtained by dividing the X-direction existence amount Ax “0” by the X-coordinate value “2” is the X-direction ratio Cx.

続いて、存在量Ax,Ay及び変化量Bx,Byに基づいて外観異常を判定する。具体的には、複数のX方向存在量Axを合計し、X方向存在量Axの総和ΣAxを算出すると共に、複数のX方向変化量Bxを合計し、X方向変化量Bxの総和ΣBxを算出する。また、複数のY方向存在量Ayを合計し、Y方向存在量Ayの総和ΣAyを算出すると共に、複数のY方向変化量Byを合計し、Y方向変化量Byの総和ΣByを算出する。そして、これら総和ΣAx,ΣBx,ΣAy,ΣByが、上記6にて予め設定した基準値αx,βx,αy,βyに対し、それぞれ一致するか否かを判定する(S16)。   Subsequently, the appearance abnormality is determined based on the existence amounts Ax, Ay and the change amounts Bx, By. Specifically, the plurality of X-direction existence amounts Ax are summed to calculate the sum ΣAx of the X-direction existence amounts Ax, and the plurality of X-direction change amounts Bx are summed to calculate the sum ΣBx of the X-direction change amounts Bx. To do. Further, the plurality of Y-direction existence amounts Ay are summed to calculate the sum ΣAy of the Y-direction existence amounts Ay, and the plurality of Y-direction change amounts By are summed to calculate the sum ΣBy of the Y-direction change amounts By. Then, it is determined whether or not these sums ΣAx, ΣBx, ΣAy, ΣBy match the reference values αx, βx, αy, βy set in advance in 6 above (S16).

上記S16において、総和ΣAx,ΣBx,ΣAy,ΣByのそれぞれが基準値αx,βx,αy,βyと一致しない場合、「外観異常有り」として、報知部4によりその旨の報知を実施する(S17)。   In S16, when each of the sums ΣAx, ΣBx, ΣAy, ΣBy does not match the reference values αx, βx, αy, βy, “notification of appearance” is notified by the notification unit 4 (S17). .

図7の例では、Y方向存在量の総和ΣAyが「32」であり、Y方向存在量基準値αyの「36」(図5参照)と一致していない。また、Y方向変化量の総和ΣByが「28」であり、Y方向存在量基準値αyの「32」(図5参照)と一致していない。よって、この場合、加工部Zの外観異常が判定され、報知されることとなる。このように、本実施形態では、加工部Zの外観異常が存在する場合、かかる外観異常が精度よく検出され報知される。   In the example of FIG. 7, the total sum ΣAy of the Y direction existence amount is “32”, which does not coincide with “36” (see FIG. 5) of the Y direction existence amount reference value αy. Further, the sum ΣBy of the Y direction change amounts is “28”, which does not coincide with “32” (see FIG. 5) of the Y direction existence amount reference value αy. Therefore, in this case, the appearance abnormality of the processed part Z is determined and notified. Thus, in the present embodiment, when there is an abnormality in the appearance of the processed part Z, the abnormality in the appearance is detected and notified with high accuracy.

他方、上記S16において、総和ΣAx,ΣBx,ΣAy,ΣByのそれぞれが基準値αx,βx,αy,βyと一致する場合、加工部Zの位置ズレ異常を判定する。具体的には、複数のX方向比Cxを合計し、X方向比Cxの総和ΣCxを算出すると共に、複数のY方向比Cyを合計し、Y方向比Cyの総和ΣCyを算出する。そして、これら総和ΣCx,ΣCyが、上記6にて予め設定した基準値γx,γyに対しそれぞれ一致するか否かを判定する(S18)。   On the other hand, if the sums ΣAx, ΣBx, ΣAy, ΣBy coincide with the reference values αx, βx, αy, βy in S16, the positional deviation abnormality of the machining part Z is determined. Specifically, the plurality of X direction ratios Cx are summed to calculate the sum ΣCx of the X direction ratios Cx, and the plurality of Y direction ratios Cy are summed to calculate the sum ΣCy of the Y direction ratios Cy. Then, it is determined whether or not these sums ΣCx, ΣCy respectively match the reference values γx, γy set in advance in 6 (S18).

上記S19において、総和ΣCx,ΣCyのそれぞれが基準値γx,γyと一致しない場合、「位置ズレ有り」として、報知部4によりその旨の報知を実施する(S19)。他方、総和ΣCx,ΣCyのそれぞれが基準値γx,γyと一致する場合、物体10の外観に異常が存在しないと判断し、報知部4により正常である旨の報知を実施する(S20)。   If the sums ΣCx and ΣCy do not match the reference values γx and γy in S19, the notification unit 4 notifies that there is “position shift” (S19). On the other hand, when each of the sums ΣCx and ΣCy matches the reference values γx and γy, it is determined that there is no abnormality in the appearance of the object 10, and a notification that the notification unit 4 is normal is performed (S20).

図8は、検査用二値化画像の他の一例を示す図である。ここでの物体10では、加工部Zに位置ズレが生じており、図8に示すように、取得した検査用二値化画像23に加工部Zの図示左側への位置ズレが生じている。この図8に示す例では、Y方向比の総和ΣCyが「12.6」であり、Y方向比基準値γyの「8.1」(図5参照)と一致していない。よって、この場合、上記S18,S19において加工部Zの位置ズレ異常が判定され、報知されることとなる。このように、本実施形態では、加工部Zの位置ズレ異常が存在する場合、かかる位置ズレが精度よく検出され報知される。   FIG. 8 is a diagram illustrating another example of the binarized image for inspection. In the object 10 here, a positional deviation occurs in the processing part Z, and as shown in FIG. 8, a positional deviation of the processing part Z toward the left side of the processing part Z occurs in the acquired binarized image 23 for inspection. In the example shown in FIG. 8, the sum ΣCy of the Y direction ratio is “12.6”, which does not coincide with “8.1” (see FIG. 5) of the Y direction ratio reference value γy. Therefore, in this case, the positional deviation abnormality of the processed part Z is determined and notified in S18 and S19. As described above, in the present embodiment, when there is a positional deviation abnormality of the processing part Z, the positional deviation is accurately detected and notified.

以上、本実施形態では、物体10の検査用画像21を取得し、この検査用画像21に二値化処理を施すことにより、複数の画素が二値化され単純化された検査用二値化画像23を取得する。そして、この検査用二値化画像23の1値及び0値についての空間分布を、X方向存在量AxとX方向変化量BxとY方向存在量AyとY方向変化量Byとして単純化して算出することにより、物体10の外観異常を判定する。つまり、複雑な画像処理や演算を要せず、外観検査に係る異常判定をシンプルなものにして精度よく実施できる。さらには、光源等により物体10を照らす必要もなく、物体10の表面10aに明暗パターンを形成する必要もなく、ひいては光源等の設定や調整も不要となる。従って、本実施形態によれば、物体10の外観異常を容易に検査することが可能となる。   As described above, in this embodiment, the inspection image 21 of the object 10 is acquired, and the binarization process is performed on the inspection image 21, thereby binarizing the plurality of pixels and simplifying the inspection. An image 23 is acquired. Then, the spatial distribution of the 1-value and 0-value of the inspection binarized image 23 is simplified and calculated as the X-direction existence amount Ax, the X-direction change amount Bx, the Y-direction existence amount Ay, and the Y-direction change amount By. By doing so, the appearance abnormality of the object 10 is determined. That is, complicated image processing and computation are not required, and abnormality determination relating to appearance inspection can be simplified and performed with high accuracy. Furthermore, it is not necessary to illuminate the object 10 with a light source or the like, it is not necessary to form a light / dark pattern on the surface 10a of the object 10, and it becomes unnecessary to set or adjust the light source or the like. Therefore, according to the present embodiment, it is possible to easily inspect the appearance abnormality of the object 10.

また、本実施形態では、上述したように、検査用二値化画像23の1値及び0値についての空間分布のズレを、X方向比Cx及びY方向比Cyとして単純化して算出し、これにより、加工部Zの位置ズレ異常を判定している。よってこの場合、物体10の加工部Zの位置ズレ異常を容易に検査することが可能となる。   In the present embodiment, as described above, the spatial distribution shift for the 1-value and 0-value of the inspection binarized image 23 is simply calculated as the X-direction ratio Cx and the Y-direction ratio Cy. Thus, the positional deviation abnormality of the processed part Z is determined. Therefore, in this case, it is possible to easily inspect the positional deviation abnormality of the processing part Z of the object 10.

ところで、画像11,21において、物体10の表面本来の部分における明度と、それ以外の加工部等における明度とでは、階調が互いに異なるピーク値をそれぞれ有することが見出される。この点、本実施形態では、上述したように、二値化画像13,23を取得する際、画像21の階調に関する明度分布をヒストグラム12,22として取得し、その第1及び第2ピーク値P1,P2の第1及び第2階調12L,12Hの中央値12Mを二値化レベルとし、画像11,21に二値化処理を施している。よって、加工部等を好適に識別可能な二値化画像13,23を取得することができる。換言すると、複数の画素において加工部等に対応する画素が精度よく1値となるような二値化画像13,23を取得できる。特に、このように中央値12Mを二値化レベルに設定することで、二値化画像13,23では表面10a部分と加工部等の部分とが好適に区別され易くなる。   By the way, in the images 11 and 21, it is found that the lightness in the original part of the surface of the object 10 and the lightness in the other processed parts have different peak values. In this regard, in the present embodiment, as described above, when acquiring the binarized images 13 and 23, the brightness distribution relating to the gradation of the image 21 is acquired as the histograms 12 and 22, and the first and second peak values thereof are acquired. The median value 12M of the first and second gradations 12L and 12H of P1 and P2 is set to a binarization level, and binarization processing is performed on the images 11 and 21. Therefore, it is possible to obtain the binarized images 13 and 23 that can appropriately identify the processed part or the like. In other words, it is possible to acquire the binarized images 13 and 23 in which the pixels corresponding to the processing part or the like have a single value with high accuracy among a plurality of pixels. In particular, by setting the median value 12M to the binarization level in this way, in the binarized images 13 and 23, the surface 10a portion and the portion such as the processed portion can be easily distinguished.

なお、上記においては、外観異常として加工部Zの変形を検査する例を説明したが、本実施形態はこれに限定されるものではない。例えば以下に示すように、「加工部Zの欠け」、「汚れ又はキズ」、「未加工」等の外観異常を検査することもできる。   In the above description, the example in which the deformation of the processed portion Z is inspected as an appearance abnormality has been described. However, the present embodiment is not limited to this. For example, as shown below, it is also possible to inspect the appearance abnormality such as “the chipped portion Z”, “dirt or scratch”, “unprocessed”, and the like.

図9は、検査用二値化画像のさらに他の一例を示す図である。ここでの物体10では、加工部Zに欠けが生じており、図9に示すように、取得した検査用二値化画像23には、図示右上部分が欠けた加工部Zが現れている。   FIG. 9 is a diagram illustrating still another example of the binarized image for inspection. In the object 10 here, the processing part Z is chipped, and as shown in FIG. 9, the acquired inspection binary image 23 has a processing part Z whose top right part is not shown.

この図9に示す例では、X方向存在量の総和ΣAxが「26」及びY方向存在量の総和ΣAyが「26」であり、X方向存在量基準値αxの「34」及びY方向存在量基準値αyの「36」に対してそれぞれ一致していない(図5参照)。また、X方向変化量の総和ΣBxが「28」及びY方向変化量の総和ΣByが「26」であり、X方向存在量基準値αxの「36」及びY方向存在量基準値αyの「32」に対してそれぞれ一致していない(図5参照)。よって、この場合でも、上記S16,S17において加工部Zの外観異常が判定され、報知されることとなる。   In the example shown in FIG. 9, the total sum ΣAx of the X direction existence amount is “26” and the sum total ΣAy of the Y direction existence amount is “26”, and “34” of the X direction existence amount reference value αx and the Y direction existence amount. The reference values αy do not match “36” (see FIG. 5). Further, the sum ΣBx of the X-direction change amounts is “28”, the sum ΣBy of the Y-direction change amounts is “26”, “36” of the X-direction existence amount reference value αx, and “32” of the Y-direction existence amount reference value αy. ”(See FIG. 5). Therefore, even in this case, the appearance abnormality of the processed part Z is determined and notified in S16 and S17.

図10は、検査用二値化画像の別の一例を示す図である。ここでの物体10では、加工部Zに汚れ(又は、キズ)が生じており、図10に示すように、取得した検査用二値化画像23には、リング状の略中央部分に汚れZa(又は、キズZa)を有する加工部Zが現れている。   FIG. 10 is a diagram illustrating another example of the binarized image for inspection. In the object 10 here, dirt (or scratches) occurs in the processed portion Z, and as shown in FIG. 10, the acquired binarized image 23 for inspection has a dirt Za at a substantially ring-shaped central portion. A processed part Z having (or scratches Za) appears.

この図10に示す例では、X方向存在量の総和ΣAxが「35」及びY方向存在量の総和ΣAyが「37」であり、X方向存在量基準値αxの「34」及びY方向存在量基準値αyの「36」に対してそれぞれ一致していない(図5参照)。また、X方向変化量の総和ΣBxが「38」及びY方向変化量の総和ΣByが「34」であり、X方向存在量基準値αxの「36」及びY方向存在量基準値αyの「32」に対してそれぞれ一致していない(図5参照)。よって、この場合でも、上記S16,S17において加工部Zの外観異常が判定され、報知されることとなる。   In the example shown in FIG. 10, the sum ΣAx of the X direction existence amount is “35” and the sum ΣAy of the Y direction existence amount is “37”, and “34” of the X direction existence amount reference value αx and the Y direction existence amount. The reference values αy do not match “36” (see FIG. 5). Further, the total sum ΣBx of the X direction change amounts is “38” and the total sum ΣBy of the Y direction change amounts is “34”, “36” of the X direction existence amount reference value αx and “32” of the Y direction existence amount reference value αy. ”(See FIG. 5). Therefore, even in this case, the appearance abnormality of the processed part Z is determined and notified in S16 and S17.

図11は、検査用二値化画像のさらに別の一例を示す図である。ここでの物体10では、加工部Zが形成されておらず(未加工)、図10に示すように、取得した検査用二値化画像23には、加工部Zが現れていない。   FIG. 11 is a diagram illustrating still another example of the binarized image for inspection. In the object 10 here, the processed part Z is not formed (unprocessed), and as shown in FIG. 10, the processed part Z does not appear in the acquired binarized image 23 for inspection.

この図11に示す例では、X方向存在量の総和ΣAxが「0」及びY方向存在量の総和ΣAyが「0」であり、X方向存在量基準値αxの「34」及びY方向存在量基準値αyの「36」に対してそれぞれ一致していない(図5参照)。また、X方向変化量の総和ΣBxが「0」及びY方向変化量の総和ΣByが「0」であり、X方向存在量基準値αxの「36」及びY方向存在量基準値αyの「32」に対してそれぞれ一致していない(図5参照)。よって、この場合でも、上記S16,S17において加工部Zの外観異常が判定されて報知されることとなる。   In the example shown in FIG. 11, the total sum ΣAx of the X-direction existence amount is “0” and the total sum ΣAy of the Y-direction existence amount is “0”, and “34” of the X-direction existence amount reference value αx and the Y-direction existence amount. The reference values αy do not match “36” (see FIG. 5). Further, the sum ΣBx of the X-direction change amounts is “0” and the sum ΣBy of the Y-direction change amounts is “0”, “36” of the X-direction existence amount reference value αx and “32” of the Y-direction existence amount reference value αy. ”(See FIG. 5). Therefore, even in this case, the appearance abnormality of the processed part Z is determined and notified in S16 and S17.

以上、本発明の好適な実施形態について説明したが、本発明は上記実施形態に限定されるものではない。例えば、上記実施形態では、第1及び第2階調12L,12Hの中央値12Mを二値化レベルとして設定したが、これに代えて、第1及び第2ピーク値P1,P2の平均値における明度のときの階調を二値化レベルとして設定してもよい。要は、二値化レベルは、第1及び第2階調12L,12Hの間の値であればよい。   The preferred embodiment of the present invention has been described above, but the present invention is not limited to the above embodiment. For example, in the above embodiment, the median value 12M of the first and second gradations 12L and 12H is set as the binarization level, but instead of this, the average value of the first and second peak values P1 and P2 The gradation at lightness may be set as a binarization level. In short, the binarization level may be a value between the first and second gradations 12L and 12H.

また、明度のヒストグラム12,22には、2つのピーク値(つまり、第1及び第2ピーク値P1,P2)が現れているが、3つ以上のピーク値が現れる場合、これらのピーク値の上位2つが第1及び第2ピーク値となる。また、物体10は、可視光に対し透明なガラス等の透明体であってもよいし、可視光に対し不透明(不透過)な金属等の不透明体であってもよい。これら何れの場合でも、本発明では物体10の外観を検査できる。   In addition, two peak values (that is, the first and second peak values P1 and P2) appear in the lightness histograms 12 and 22. When three or more peak values appear, the peak values of these peak values are displayed. The top two are the first and second peak values. The object 10 may be a transparent body such as glass that is transparent to visible light, or may be an opaque body such as a metal that is opaque (non-transparent) to visible light. In either case, the present invention can inspect the appearance of the object 10.

また、上記実施形態では、Y方向の座標値でX方向存在量Axを除してなるX方向比Cxをそれぞれ算出したが、X方向比Cxは、Y方向の座標値でX方向変化量Bxを除した値としてもよい。同様に、上記実施形態では、X方向の座標値でY方向存在量Ayを除してなるY方向比Cyをそれぞれ算出したが、Y方向比Cyは、X方向の座標値でY方向変化量Byを除した値としてもよい。つまり、X方向比Cx及びY方向比Cyは、存在量に基づき算出してもよいし、変化量に基づき算出してもよい。   In the above embodiment, the X direction ratio Cx obtained by dividing the X direction existence amount Ax by the Y direction coordinate value is calculated. However, the X direction ratio Cx is the X direction change value Bx by the Y direction coordinate value. It is good also as the value which remove | divided. Similarly, in the above embodiment, the Y direction ratio Cy obtained by dividing the Y direction existence amount Ay by the X direction coordinate value is calculated, but the Y direction ratio Cy is the X direction coordinate value and the Y direction change amount. It may be a value obtained by dividing By. That is, the X direction ratio Cx and the Y direction ratio Cy may be calculated based on the existence amount or may be calculated based on the change amount.

また、本発明は、表面10aに加工部Zが形成されていない物体10を検査対象とし、表面10aのキズや汚れ等の表面欠陥のみを検知することも可能である。なお、この場合、図11に示す検査用二値化画像23が基準二値化画像(正常データ)とされ、当該基準二値化画像から基準値が設定される。また、加工部Zは、上記実施形態のものに限定されず、種々の形状・態様のものであってもよい。   In the present invention, it is also possible to detect only surface defects such as scratches and dirt on the surface 10a using the object 10 on which the processed portion Z is not formed on the surface 10a. In this case, the inspection binarized image 23 shown in FIG. 11 is set as a reference binarized image (normal data), and a reference value is set from the reference binarized image. Moreover, the process part Z is not limited to the thing of the said embodiment, The thing of various shapes and aspects may be sufficient.

ここで、上記実施形態では、加工部Zの位置ズレの有無を判定(上記S18)に加え、算出したX方向比Cx及びY方向比Cyそれぞれの大きさ(偏り)に基づくことで、加工部Zの位置ズレの方向を判定することが可能となる。   Here, in the above embodiment, in addition to determining whether or not the processing portion Z is misaligned (S18), the processing portion is based on the calculated sizes (bias) of the X direction ratio Cx and the Y direction ratio Cy. It is possible to determine the direction of the Z misalignment.

具体的には、以下に示すように、X方向比Cxに下限閾値Lx及び上限閾値Hxを設定し、X方向比Cxが下限閾値Lxよりも小さい場合には、加工部Zが右方向に位置ズレしたと判別し、X方向比Cxが上限閾値Hxよりも大きい場合には、加工部Zが左方向に位置ズレしたと判別する。また、Y方向比Cyに下限閾値Ly及び上限閾値Hyを設定し、Y方向比Cyが下限閾値Lyよりも小さい場合には、加工部Zが下方向に位置ズレしたと判別し、Y方向比Cyが上限閾値Hyよりも大きい場合には、加工部Zが上方向に位置ズレしたと判別する。その結果、これらを合わせると、加工部Zの位置ズレを「上」「下」「左」「右」「左上」「右上」「左下」「右下」の8方向により判定することができる。
X方向比Cx<下限閾値Lx → 右方向の位置ズレ
上限閾値Hx<X方向比Cx → 左方向の位置ズレ
Y方向比Cy<下限閾値Ly → 下方向の位置ズレ
上限閾値Hy<Y方向比Cy → 上方向の位置ズレ
Specifically, as shown below, when the lower limit threshold Lx and the upper limit threshold Hx are set in the X direction ratio Cx, and the X direction ratio Cx is smaller than the lower limit threshold Lx, the processing part Z is positioned in the right direction. If it is determined that the X direction ratio Cx is larger than the upper limit threshold value Hx, it is determined that the processed portion Z is displaced in the left direction. In addition, when the lower limit threshold Ly and the upper limit threshold Hy are set in the Y direction ratio Cy, and the Y direction ratio Cy is smaller than the lower limit threshold Ly, it is determined that the processed portion Z has been displaced downward, and the Y direction ratio When Cy is larger than the upper limit threshold value Hy, it is determined that the processing unit Z has been displaced in the upward direction. As a result, when these are combined, it is possible to determine the position shift of the processing portion Z by eight directions of “up”, “down”, “left”, “right”, “upper left”, “upper right”, “lower left”, and “lower right”.
X direction ratio Cx <lower threshold Lx → right position shift
Upper limit threshold Hx <X direction ratio Cx → left position shift
Y direction ratio Cy <lower limit threshold Ly → downward position shift
Upper limit threshold value Hy <Y direction ratio Cy → upward misalignment

これら下限閾値Lx,Ly及び上限閾値Hx,Hyは、基準二値化画像13等に基づいて適宜設定することができる。例えば、図5に示す基準二値化画像13の場合であってX方向比Cx及びY方向比Cyが存在量に基づき算出されるときには、X方向比CxとY方向比Cyと位置ズレ方向とは、下表1に示す関係となる。これにより、上限閾値Hxを10.0、下限閾値Lxを7.0、上限閾値Hyを10.0、及び下限閾値Lyを6.0とすることで、加工部Zの位置ズレ方向を判定できることがわかる。
These lower limit threshold values Lx and Ly and upper limit threshold values Hx and Hy can be appropriately set based on the reference binarized image 13 and the like. For example, in the case of the reference binarized image 13 shown in FIG. 5, when the X-direction ratio Cx and the Y-direction ratio Cy are calculated based on the abundance, the X-direction ratio Cx, the Y-direction ratio Cy, the positional deviation direction, Is the relationship shown in Table 1 below. Thereby, the positional deviation direction of the processing part Z can be determined by setting the upper limit threshold Hx to 10.0, the lower limit threshold Lx to 7.0, the upper limit threshold Hy to 10.0, and the lower limit threshold Ly to 6.0. I understand.

一方、図5に示す基準二値化画像13の場合であってX方向比Cx及びY方向比Cyが変化量に基づき算出されるときには、X方向比CxとY方向比Cyと位置ズレ方向とは、下表2に示す関係となる。これにより、上限閾値Hxを8.0、下限閾値Lxを5.5、上限閾値Hyを8.0、及び下限閾値Lyを5.5とすることで、加工部Zの位置ズレ方向を判定できることがわかる。
On the other hand, in the case of the reference binarized image 13 shown in FIG. 5, when the X direction ratio Cx and the Y direction ratio Cy are calculated based on the amount of change, the X direction ratio Cx, the Y direction ratio Cy, the positional deviation direction, Is the relationship shown in Table 2 below. Accordingly, the misalignment direction of the processing portion Z can be determined by setting the upper limit threshold Hx to 8.0, the lower limit threshold Lx to 5.5, the upper limit threshold Hy to 8.0, and the lower limit threshold Ly to 5.5. I understand.

1…外観検査装置、2…画像取得部、3a…二値化部(二値化処理部)、3b…異常判定部、3c…位置ズレ判定部、10…物体、11…(画像)、12…基準ヒストグラム(ヒストグラム)、12H…第1階調、12L…第2階調、13…基準二値化画像(二値化画像)、21…(画像)、22…検査用ヒストグラム(ヒストグラム)、23…検査用二値化画像(二値化画像)、Ax…X方向存在量(一方向存在量)、Ay…Y方向存在量(他方向存在量)、Bx…X方向変化量(一方向変化量)、By…Y方向変化量(他方向変化量)、Cx…X方向比(一方向比)、Cy…Y方向比(他方向比)、P1…第1ピーク値、P2…第2ピーク値、Z…加工部、αx…X方向存在量基準値(一方向存在量基準値)、αy…Y方向存在量基準値(他方向存在量基準値)、βx…X方向変化量基準値(一方向変化量基準値)、βy…Y方向変化量基準値(他方向変化量基準値)、γx…X方向比基準値(一方向比基準値)、γy…Y方向比基準値(他方向比基準値)、ΣAx…X方向存在量の総和(一方向存在量の総和)、ΣAy…Y方向存在量の総和(他方向存在量の総和)、ΣBx…X方向変化量の総和(一方向変化量の総和)、ΣBy…Y方向変化量の総和(他方向変化量の総和)、ΣCx…(一方向比の総和)、ΣCy…(他方向比の総和)。   DESCRIPTION OF SYMBOLS 1 ... Appearance inspection apparatus, 2 ... Image acquisition part, 3a ... Binarization part (binarization process part), 3b ... Abnormality determination part, 3c ... Position shift determination part, 10 ... Object, 11 ... (Image), 12 ... reference histogram (histogram), 12H ... first gradation, 12L ... second gradation, 13 ... reference binary image (binarized image), 21 ... (image), 22 ... inspection histogram (histogram), 23... Binary image for inspection (binarized image), Ax... X direction existence amount (one direction existence amount), Ay... Y direction existence amount (other direction existence amount), Bx. Change amount), By ... Y direction change amount (other direction change amount), Cx ... X direction ratio (one direction ratio), Cy ... Y direction ratio (other direction ratio), P1 ... first peak value, P2 ... second. Peak value, Z ... machined part, αx ... X direction existence amount reference value (one direction existence amount reference value), αy ... Y direction existence amount reference value ( Other direction existence reference value), βx... X direction change reference value (one direction change reference value), βy... Y direction change reference value (other direction change reference value), γx. Unidirectional ratio reference value), γy... Y direction ratio reference value (other direction ratio reference value), .SIGMA.Ax... X direction existence amount sum (one direction existence amount sum), .SIGMA.Ay. Sum of existing amounts), ΣBx... Sum of X direction change amounts (sum of one direction change amounts), ΣBy... Sum of Y direction change amounts (sum of other direction change amounts), ΣCx... (Sum of one direction ratios), ΣCy (sum of other direction ratios).

Claims (10)

物体の外観を検査するための外観検査装置であって、
前記物体の画像を取得する画像取得部と、
前記画像取得部で取得した前記画像に二値化処理を施し、複数の画素が第1値又は第2値で構成された二値化画像を取得する二値化処理部と、
前記二値化処理部で取得した前記二値化画像に基づいて、前記物体の外観異常の有無を判定する異常判定部と、を備え、
前記異常判定部は、
前記二値化画像における一方向に並ぶ複数の前記画素ごとにおいて、前記第1値の数としての一方向存在量と、前記一方向に隣接する2つの前記画素が前記第1値及び前記第2値の間で変化する数としての一方向変化量と、をそれぞれ算出すると共に、
前記二値化画像における前記一方向と直交する他方向に並ぶ複数の前記画素ごとにおいて、前記第1値の数としての他方向存在量と、前記他方向に隣接する2つの前記画素が前記第1値及び前記第2値の間で変化する数としての他方向変化量と、をそれぞれ算出し、
算出した複数の前記一方向存在量の総和、複数の前記一方向変化量の総和、複数の前記他方向存在量の総和、及び複数の前記他方向変化量の総和のそれぞれが、予め設定された一方向存在量基準値、一方向変化量基準値、他方向存在量基準値、及び他方向変化量基準値のそれぞれに対し不一致の場合、外観異常が有ると判定すること、を特徴とする外観検査装置。
An appearance inspection apparatus for inspecting the appearance of an object,
An image acquisition unit for acquiring an image of the object;
A binarization processing unit that performs binarization processing on the image acquired by the image acquisition unit, and acquires a binarized image in which a plurality of pixels are configured with a first value or a second value;
An abnormality determination unit that determines the presence or absence of an appearance abnormality of the object based on the binarized image acquired by the binarization processing unit;
The abnormality determination unit
For each of the plurality of pixels arranged in one direction in the binarized image, the unidirectional existence amount as the number of the first values, and the two pixels adjacent in the one direction are the first value and the second And calculating the unidirectional change amount as the number that changes between the values,
For each of the plurality of pixels arranged in the other direction orthogonal to the one direction in the binarized image, the other direction existence amount as the number of the first values and the two pixels adjacent to the other direction are the first number. Calculating the amount of change in the other direction as a number that changes between 1 value and the second value,
Each of the calculated sum of the plurality of one-direction existence amounts, the sum of the plurality of one-direction change amounts, the plurality of other direction existence amounts, and the plurality of other direction change amounts is preset. Appearance characterized by determining that there is an appearance abnormality when there is a discrepancy with respect to each of the one-way existence amount reference value, the one-direction change amount reference value, the other direction existence amount reference value, and the other direction change amount reference value Inspection device.
前記異常判定部は、正常な前記物体の前記二値化画像についての複数の前記一方向存在量の総和、複数の前記一方向変化量の総和、複数の前記他方向存在量の総和、及び複数の前記他方向変化量の総和のそれぞれを、前記一方向存在量基準値、前記一方向変化量基準値、前記他方向存在量基準値、及び前記他方向変化量基準値のそれぞれとして予め設定すること、を特徴とする請求項1記載の外観検査装置。   The abnormality determination unit includes a sum of a plurality of the one-direction existence amounts, a plurality of the one-direction change amounts, a plurality of the other-direction existence amounts, and a plurality of the binarized images of the normal object. Are set in advance as the one-way existence reference value, the one-way change reference value, the other-direction existence reference value, and the other-direction change reference value, respectively. The visual inspection apparatus according to claim 1. 前記物体には加工部が形成されており、
前記異常判定部は、前記加工部の位置ズレ異常の有無を判定する位置ズレ判定部を有し、
前記位置ズレ判定部は、
前記二値化画像における前記一方向に並ぶ複数の前記画素ごとにおいて、当該複数の画素に関する前記他方向の座標値により前記一方向存在量又は前記一方向変化量を除した値としての一方向比をそれぞれ算出すると共に、
前記二値化画像における前記他方向に並ぶ複数の前記画素ごとにおいて、当該複数の画素に関する前記一方向の座標値により前記他方向存在量又は前記他方向変化量を除した値としての他方向比をそれぞれ算出し、
算出した複数の前記一方向比の総和、及び前記他方向比の総和のそれぞれが、予め設定された一方向比基準値、及び他方向比基準値のそれぞれに対し不一致の場合、前記加工部の位置ズレ異常が有ると判定すること、を特徴とする請求項1又は2記載の外観検査装置。
A processed part is formed on the object,
The abnormality determination unit includes a position shift determination unit that determines presence / absence of a position shift abnormality of the processing unit,
The positional deviation determination unit
For each of the plurality of pixels arranged in the one direction in the binarized image, a one-way ratio as a value obtained by dividing the one-way existence amount or the one-way change amount by the coordinate value in the other direction related to the plurality of pixels. Respectively,
For each of the plurality of pixels arranged in the other direction in the binarized image, the other direction ratio as a value obtained by dividing the other direction existence amount or the other direction change amount by the coordinate value of the one direction related to the plurality of pixels. Respectively,
When the calculated sum of the one-way ratios and the sum of the other direction ratios do not match the preset one-way ratio reference value and the other direction ratio reference value, respectively, The appearance inspection apparatus according to claim 1, wherein it is determined that there is a positional deviation abnormality.
前記位置ズレ判定部は、正常な前記物体の前記二値化画像についての複数の前記一方向比の総和、及び複数の前記他方向比の総和のそれぞれを、前記一方向比基準値、及び前記他方向比基準値のそれぞれとして予め設定すること、を特徴とする請求項3記載の外観検査装置。   The positional deviation determination unit includes a plurality of one-way ratio sums and a plurality of other direction ratio sums for the binarized image of the normal object, the one-way ratio reference value, and the The appearance inspection apparatus according to claim 3, wherein each of the other direction ratio reference values is preset. 前記二値化処理部は、
前記画像取得部で取得した前記画像についての階調に関する明度分布を取得し、
前記明度分布において、前記明度が最も高い第1ピーク値のときの第1階調と、前記明度が前記第1ピーク値の次に高い第2ピーク値のときの第2階調と、を導出し、
前記第1及び第2階調の間の値を、前記二値化処理を行うための閾値となる二値化レベルとして、前記画像に前記二値化処理を施すこと、を特徴とする請求項1〜4の何れか一項記載の外観検査装置。
The binarization processing unit
Obtaining a lightness distribution relating to the gradation of the image obtained by the image obtaining unit;
In the lightness distribution, a first gradation when the lightness is the highest first peak value and a second gradation when the lightness is the second highest peak value after the first peak value are derived. And
The binarization process is performed on the image by using a value between the first and second gradations as a binarization level that serves as a threshold for performing the binarization process. The external appearance inspection apparatus as described in any one of 1-4.
物体の外観を検査するための外観検査方法であって、
前記物体の画像を取得する画像取得工程と、
前記画像取得工程で取得した前記画像に二値化処理を施し、複数の画素が第1値又は第2値で構成された二値化画像を取得する二値化処理工程と、
前記二値化処理工程で取得した前記二値化画像に基づいて、前記物体の外観異常の有無を判定する異常判定工程と、を備え、
前記異常判定工程では、
前記二値化画像における一方向に並ぶ複数の前記画素ごとにおいて、前記第1値の数としての一方向存在量と、前記一方向に隣接する2つの前記画素が前記第1値及び前記第2値の間で変化する数としての一方向変化量と、をそれぞれ算出すると共に、
前記二値化画像における前記一方向と直交する他方向に並ぶ複数の前記画素ごとにおいて、前記第1値の数としての他方向存在量と、前記他方向に隣接する2つの前記画素が前記第1値及び前記第2値の間で変化する数としての他方向変化量と、をそれぞれ算出し、
算出した複数の前記一方向存在量の総和、複数の前記一方向変化量の総和、複数の前記他方向存在量の総和、及び複数の前記他方向変化量の総和のそれぞれが、予め設定された一方向存在量基準値、一方向変化量基準値、他方向存在量基準値、及び他方向変化量基準値のそれぞれに対し不一致の場合、外観異常が有ると判定すること、を特徴とする外観検査方法。
An appearance inspection method for inspecting the appearance of an object,
An image acquisition step of acquiring an image of the object;
A binarization processing step of performing binarization processing on the image acquired in the image acquisition step, and acquiring a binarized image in which a plurality of pixels are configured with a first value or a second value;
An abnormality determination step of determining the presence or absence of an appearance abnormality of the object based on the binarized image acquired in the binarization processing step,
In the abnormality determination step,
For each of the plurality of pixels arranged in one direction in the binarized image, the unidirectional existence amount as the number of the first values, and the two pixels adjacent in the one direction are the first value and the second And calculating the unidirectional change amount as the number that changes between the values,
For each of the plurality of pixels arranged in the other direction orthogonal to the one direction in the binarized image, the other direction existence amount as the number of the first values and the two pixels adjacent to the other direction are the first number. Calculating the amount of change in the other direction as a number that changes between 1 value and the second value,
Each of the calculated sum of the plurality of one-direction existence amounts, the sum of the plurality of one-direction change amounts, the plurality of other direction existence amounts, and the plurality of other direction change amounts is preset. Appearance characterized by determining that there is an appearance abnormality when there is a discrepancy with respect to each of the one-way existence amount reference value, the one-direction change amount reference value, the other direction existence amount reference value, and the other direction change amount reference value Inspection method.
前記一方向存在量基準値、前記一方向変化量基準値、前記他方向存在量基準値、及び前記他方向変化量基準値を予め設定する第1前処理工程を備え、
前記第1前処理工程では、
正常な前記物体の前記二値化画像についての複数の前記一方向存在量の総和、複数の前記一方向変化量の総和、複数の前記他方向存在量の総和、及び複数の前記他方向変化量の総和のそれぞれを、前記一方向存在量基準値、前記一方向変化量基準値、前記他方向存在量基準値、及び前記他方向変化量基準値のそれぞれとして予め設定すること、を特徴とする請求項6記載の外観検査方法。
A first preprocessing step of presetting the one-way existence reference value, the one-direction change reference value, the other-direction existence reference value, and the other-direction change reference value;
In the first pretreatment step,
The sum of a plurality of the one-direction existence amounts, the sum of the plurality of one-direction change amounts, the sum of the plurality of other direction existence amounts, and the plurality of other direction change amounts for the binarized image of the normal object. Are set in advance as the one-way existence reference value, the one-direction change reference value, the other-direction existence reference value, and the other-direction change reference value, respectively. The appearance inspection method according to claim 6.
前記物体には加工部が形成されており、
前記異常判定工程は、前記加工部の位置ズレ異常の有無を判定する位置ズレ判定工程を有し、
前記位置ズレ判定工程では、
前記二値化画像における前記一方向に並ぶ複数の前記画素ごとにおいて、当該複数の画素に関する前記他方向の座標値により前記一方向存在量又は前記一方向変化量を除した値としての一方向比をそれぞれ算出すると共に、
前記二値化画像における前記他方向に並ぶ複数の前記画素ごとにおいて、当該複数の画素に関する前記一方向の座標値により前記他方向存在量又は前記他方向変化量を除した値としての他方向比をそれぞれ算出し、
算出した複数の前記一方向比の総和、及び前記他方向比の総和のそれぞれが、予め設定された一方向比基準値、及び他方向比基準値のそれぞれに対し不一致の場合、前記加工部の位置ズレ異常が有ると判定すること、を特徴とする請求項6又は7記載の外観検査方法。
A processed part is formed on the object,
The abnormality determination step includes a position deviation determination step for determining presence / absence of a position deviation abnormality of the processing unit,
In the positional deviation determination step,
For each of the plurality of pixels arranged in the one direction in the binarized image, a one-way ratio as a value obtained by dividing the one-way existence amount or the one-way change amount by the coordinate value in the other direction related to the plurality of pixels. Respectively,
For each of the plurality of pixels arranged in the other direction in the binarized image, the other direction ratio as a value obtained by dividing the other direction existence amount or the other direction change amount by the coordinate value of the one direction related to the plurality of pixels. Respectively,
When the calculated sum of the one-way ratios and the sum of the other direction ratios do not match the preset one-way ratio reference value and the other direction ratio reference value, respectively, The appearance inspection method according to claim 6 or 7, wherein it is determined that there is a positional deviation abnormality.
前記一方向比基準値、及び前記他方向比基準値を予め設定する第2前処理工程を備え、
前記第2前処理工程では、
正常な前記物体の前記二値化画像についての複数の前記一方向比の総和、及び複数の前記他方向比の総和のそれぞれを、前記一方向比基準値、及び前記他方向比基準値のそれぞれとして予め設定すること、を特徴とする請求項8記載の外観検査方法。
A second pre-processing step of presetting the one-way ratio reference value and the other-direction ratio reference value;
In the second pretreatment step,
The sum of a plurality of the one-way ratios and the sum of the plurality of other-direction ratios for the binarized image of the normal object are respectively set to the one-way ratio reference value and the other-direction ratio reference value. The visual inspection method according to claim 8, wherein the visual inspection method is set in advance.
前記二値化処理工程では、
前記画像取得部で取得した前記画像についての階調に関する明度分布を取得し、
前記明度分布において、前記明度が最も高い第1ピーク値のときの第1階調と、前記明度が前記第1ピーク値の次に高い第2ピーク値のときの第2階調と、を導出し、
前記第1及び第2階調の間の値を、前記二値化処理を行うための閾値となる二値化レベルとして、前記画像に前記二値化処理を施すこと、を特徴とする請求項6〜9の何れか一項記載の外観検査方法。
In the binarization process,
Obtaining a lightness distribution relating to the gradation of the image obtained by the image obtaining unit;
In the lightness distribution, a first gradation when the lightness is the highest first peak value and a second gradation when the lightness is the second highest peak value after the first peak value are derived. And
The binarization process is performed on the image by using a value between the first and second gradations as a binarization level that serves as a threshold for performing the binarization process. The appearance inspection method according to any one of 6 to 9.
JP2010276033A 2010-12-10 2010-12-10 Appearance inspection apparatus and appearance inspection method Active JP5666894B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010276033A JP5666894B2 (en) 2010-12-10 2010-12-10 Appearance inspection apparatus and appearance inspection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010276033A JP5666894B2 (en) 2010-12-10 2010-12-10 Appearance inspection apparatus and appearance inspection method

Publications (2)

Publication Number Publication Date
JP2012122965A JP2012122965A (en) 2012-06-28
JP5666894B2 true JP5666894B2 (en) 2015-02-12

Family

ID=46504533

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010276033A Active JP5666894B2 (en) 2010-12-10 2010-12-10 Appearance inspection apparatus and appearance inspection method

Country Status (1)

Country Link
JP (1) JP5666894B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014224779A (en) * 2013-05-17 2014-12-04 清水建設株式会社 Inspection apparatus
JP2015064285A (en) * 2013-09-25 2015-04-09 株式会社総合車両製作所 Method for evaluating welded part

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6186639A (en) * 1984-10-05 1986-05-02 Hitachi Ltd Pattern inspecting method
IL79098A0 (en) * 1985-07-15 1986-09-30 Visionetics Corp Fine flaw detector for printed circuit boards
JPH04337444A (en) * 1991-05-14 1992-11-25 Canon Inc Printing evaluation equipment
JPH05164703A (en) * 1991-12-17 1993-06-29 Honda Motor Co Ltd Inspecting method for surface of workpiece
JP3322958B2 (en) * 1993-09-22 2002-09-09 株式会社東芝 Print inspection equipment
JPH08327560A (en) * 1995-05-30 1996-12-13 Sanyo Electric Co Ltd Device and method for inspecting shape
JPH09231362A (en) * 1996-02-27 1997-09-05 Fuji Electric Co Ltd Appearance inspecting device and its method
JP3503130B2 (en) * 1997-08-25 2004-03-02 日産自動車株式会社 Surface inspection equipment
JP2000055830A (en) * 1998-08-03 2000-02-25 Fuji Electric Co Ltd Device for inspecting mouth part of container
GB2362459A (en) * 2000-05-16 2001-11-21 Lloyd Doyle Ltd Method and apparatus for inspection of printed wiring boards
JP2004317190A (en) * 2003-04-14 2004-11-11 Neomax Co Ltd Surface inspection method capable of judging unevenness at high speed and surface inspection system
US20100165094A1 (en) * 2006-08-10 2010-07-01 I-Pulse Kabushiki Kaisha Inspecting apparatus, and inspecting method
JP4799329B2 (en) * 2006-09-07 2011-10-26 株式会社東芝 Unevenness inspection method, display panel manufacturing method, and unevenness inspection apparatus

Also Published As

Publication number Publication date
JP2012122965A (en) 2012-06-28

Similar Documents

Publication Publication Date Title
US9230318B2 (en) Analysis of the digital image of the external surface of a tyre and processing of false measurement points
JP4150390B2 (en) Appearance inspection method and appearance inspection apparatus
CN109472271B (en) Printed circuit board image contour extraction method and device
CN113781424B (en) Surface defect detection method, device and equipment
KR20180115646A (en) Bead recognition apparatus using vision camera and method thereof
JP4230880B2 (en) Defect inspection method
JP5772675B2 (en) Gray image edge extraction method, edge extraction device, and gray image edge extraction program
JP5666894B2 (en) Appearance inspection apparatus and appearance inspection method
JP4244046B2 (en) Image processing method and image processing apparatus
JP2007155405A (en) Visual inspection method and visual inspection device
JP2005106725A (en) Method and apparatus for visual inspection of object to be inspected
JP2017142219A (en) Image inspection device, image inspection program, recording medium readable by computer and recording apparatus
JP2019120644A (en) Surface inspection device and surface inspection method
JP2019215206A (en) Surface inspection device and surface inspection method
JP5452035B2 (en) Defect inspection method and defect inspection apparatus
JP2011069742A (en) Defect detector and defect detection method
JP4420796B2 (en) Container appearance inspection method
JP5033077B2 (en) Method and apparatus for inspecting appearance of molded product
JP2003329428A (en) Device and method for surface inspection
JP5217868B2 (en) Appearance inspection apparatus and appearance inspection method
JP6595800B2 (en) Defect inspection apparatus and defect inspection method
JP4821647B2 (en) Electronic component terminal position detection method
JP2006201135A (en) Defect inspection device, defect inspection method, and defect inspection program
JP2012122964A (en) Method of detecting surface defect
JP2710685B2 (en) Defect detection method by visual inspection

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20120712

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20120712

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120713

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20131028

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140326

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140422

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141211

R150 Certificate of patent (=grant) or registration of utility model

Ref document number: 5666894

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150