JPH0772098A - Visual inspection of welded part - Google Patents

Visual inspection of welded part

Info

Publication number
JPH0772098A
JPH0772098A JP1677994A JP1677994A JPH0772098A JP H0772098 A JPH0772098 A JP H0772098A JP 1677994 A JP1677994 A JP 1677994A JP 1677994 A JP1677994 A JP 1677994A JP H0772098 A JPH0772098 A JP H0772098A
Authority
JP
Japan
Prior art keywords
pixels
image
differential
pixel
edge
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP1677994A
Other languages
Japanese (ja)
Other versions
JP2758823B2 (en
Inventor
Mitsuru Shirasawa
満 白澤
Michio Otsuka
倫生 大塚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP1677994A priority Critical patent/JP2758823B2/en
Publication of JPH0772098A publication Critical patent/JPH0772098A/en
Application granted granted Critical
Publication of JP2758823B2 publication Critical patent/JP2758823B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PURPOSE:To collectively judge of whether or not a welded part is good on the basis of an image, by detecting the presence/absence of a welded part and detecting the position and a welding strength. CONSTITUTION:Density of each pixel of an image taken by an image input device 1 is A/D converted 2 and processed in a pretreatment part 3. In other words, a differential image (in a differential direction) is formed on the basis of an original image which has a differential value corresponding to a changing ratio (changing direction) of density of a pixel to that of an adjacent pixel as the value of the pixel. Pixels having larger differential values than those of surrounding pixels are coupled to extract edges of a width of one pixel to obtain an edge image. The obtained images are stored in memories 4-7 respectively for the original image, differential image, differential direction image and edge image. An operating/processing part 8 detects, on the basis of the images, the presence/absence of a welded part, the presence/absence of the welded part at a predetermined position of a to-be-inspected object, and a welding strength from the gloss of the part. Accordingly, an inspection for parts other than the welded part is avoided, and whether or not the position and strength of the welded part are good can be judged.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、溶接物である検査対象
物を撮像した画像に対して画像処理を施すことによっ
て、溶接状態の良否を判定する溶接部外観検査方法に関
するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a welded portion appearance inspection method for determining the quality of a welded state by performing image processing on an image of an inspection object which is a welded object.

【0002】[0002]

【従来の技術】本発明者らは溶接状態の良否を判定する
技術として、溶接箇所を含む検査対象物の画像に基づい
て、溶接箇所の境界線上の画素についての微分方向値の
度数分布を求め、この度数分布をあらかじめ求められら
れている良品の度数分布と比較することによって、溶接
状態の良否を判定する方法を提案した(特開平5−54
107号公報)。
2. Description of the Related Art As a technique for determining the quality of a welded state, the present inventors have obtained a frequency distribution of differential direction values for pixels on a boundary line of a welded place based on an image of an inspection object including the welded place. A method has been proposed in which the quality of the welded state is judged by comparing this frequency distribution with the frequency distribution of a non-defective product which is obtained in advance (Japanese Patent Laid-Open No. 5-54).
No. 107).

【0003】[0003]

【発明が解決しようとする課題】上記技術は、溶接箇所
の有無を検出し、溶接形状を反映している微分方向値の
度数分布に基づいて良否の判定を行うものであるから、
溶接部位ではなくても良品と同様の形状を有する箇所が
あれば良品と誤認する可能性があり、また、溶接位置の
ずれや溶接強度などについては、良否の判別ができない
という問題を残していた。
The above-mentioned technique detects the presence or absence of a welded portion and judges the quality based on the frequency distribution of the differential direction values reflecting the welded shape.
Even if it is not a welded part, there is a possibility that it will be mistaken for a good product if there is a part with the same shape as a good product, and there is a problem that it is impossible to judge the quality of the welding position deviation and welding strength etc. .

【0004】本発明は上記問題点の解決を目的とするも
のであり、画像に基づいて溶接箇所を識別して認識すべ
き箇所を正確に特定し、かつ溶接箇所の位置ずれや溶接
強度についても良否判定が行えるようにして、溶接部位
についての良否を総合的に判定できるようにした溶接部
外観検査方法を提供しようとするものである。
The present invention is intended to solve the above-mentioned problems, and to identify a welded portion on the basis of an image to accurately specify a portion to be recognized, and also regarding positional deviation of the welded portion and welding strength. An object of the present invention is to provide a welded part appearance inspection method that enables the quality of a welded part to be comprehensively determined by enabling the quality determination.

【0005】[0005]

【課題を解決するための手段】請求項1の発明は、溶接
部位を有する検査対象物に対して溶接部位と溶接部位の
周部との照度に差が生じるように光を照射した状態で溶
接部位を含む領域を撮像し、撮像された画像に対して画
像処理を施すことによって溶接部の外観による溶接状態
の評価を行う溶接部外観検査方法において、溶接部位の
有無を検出する過程と、溶接部位が検査対象物の所要位
置に位置するか否かを判定する過程と、溶接部位の光沢
に基づいて溶接強度を判定する過程とを有することを特
徴とするものである。
According to a first aspect of the present invention, welding is performed in a state where light is applied to an inspection object having a welded portion so that a difference in illuminance occurs between the welded portion and a peripheral portion of the welded portion. A process of detecting the presence / absence of a welded part in a welded part appearance inspection method in which a region including a part is imaged and the imaged image is subjected to image processing to evaluate the welded state based on the appearance of the welded part. The method is characterized by including a step of determining whether or not the portion is located at a required position of the inspection object, and a step of determining the welding strength based on the gloss of the welding portion.

【0006】請求項2の発明は、請求項1において、濃
淡画像である原画像に基づいて、隣接画素との濃度の変
化率に相当する微分値を各画素の値とした微分画像と、
隣接画素との濃度の変化方向に対応する微分方向値を各
画素の値とした微分方向画像とを作成し、複数画素を含
む検査ウインドウを画像内に設定し、検査ウインドウ内
の画素を走査ラインを移動させて走査して各画素の微分
値と微分方向値との少なくとも一方に基づいて溶接部位
のエッジとみなされるエッジ候補点を求め、次に、隣接
するエッジ候補点を微分値と微分方向値との少なくとも
一方に基づいて順次求め、エッジ候補点の個数が規定の
しきい値を越えるときには検査ウインドウ内に溶接部位
が存在すると判定することを特徴とする。
According to a second aspect of the present invention, in the first aspect, based on the original image that is a grayscale image, a differential image in which a differential value corresponding to a rate of change in density between adjacent pixels is used as a value of each pixel,
A differential direction image in which the differential direction value corresponding to the change direction of the density with the adjacent pixel is used as the value of each pixel, an inspection window including a plurality of pixels is set in the image, and the pixels in the inspection window are scanned lines. Is moved and scanned to find edge candidate points that are considered to be the edges of the welding site based on at least one of the differential value and the differential direction value of each pixel, and then the adjacent edge candidate points are differentiated and the differential direction. It is characterized in that it is sequentially obtained on the basis of at least one of the values and it is determined that a welding site exists in the inspection window when the number of edge candidate points exceeds a prescribed threshold value.

【0007】請求項3の発明は、請求項2において、検
査ウインドウ内にさらに方向探索ウインドウを設定し、
方向探索ウインドウ内の画素を走査して各画素の微分値
が規定のしきい値以上である画素について微分方向値の
度数分布を求め、度数の多い方向に沿って走査ラインを
設定し、度数の少ない方向を走査ラインの移動方向とす
ることを特徴とする。
According to a third aspect of the present invention, in the second aspect, a direction search window is further set in the inspection window,
The pixels in the direction search window are scanned to obtain the frequency distribution of the differential direction value for the pixels whose differential value of each pixel is greater than or equal to the specified threshold, and the scanning line is set along the direction with the highest frequency, It is characterized in that the smaller number of directions is the moving direction of the scanning line.

【0008】請求項4の発明は、溶接された一方の部材
のエッジとなる端子基準線を設定し、端子基準線と請求
項2の方法により求めたエッジ候補点との間の画素の総
数を求め、この総数を規定のしきい値と比較することに
よって溶接部位の位置の適否を判定することを特徴とす
る。請求項5の発明は、溶接された一方の部材のエッジ
となる端子基準線を設定し、請求項2の方法により求め
たエッジ候補点を連続させた溶接部エッジ線と端子基準
線との間の面積を求め、この面積を規定のしきい値と比
較することによって溶接部位の位置の適否を判定するこ
とを特徴とする。
According to a fourth aspect of the present invention, a terminal reference line serving as an edge of one of the welded members is set, and the total number of pixels between the terminal reference line and the edge candidate point obtained by the method of the second aspect is set. It is characterized in that the suitability of the position of the welded part is determined by obtaining this value and comparing this total number with a prescribed threshold value. According to the invention of claim 5, a terminal reference line which is an edge of one of the welded members is set, and the edge candidate point obtained by the method of claim 2 is continuous between the welded edge line and the terminal reference line. Is determined and the suitability of the position of the welded portion is determined by comparing this area with a prescribed threshold value.

【0009】請求項6の発明は、請求項4または請求項
5において、検査ウインドウ内での走査によって各画素
の微分値と微分方向値との少なくとも一方に基づいて溶
接された一方の部材のエッジ上の画素を求め、同条件を
満たす画素が規定個数以上連続して存在するときに、連
続した画素を端子基準線とすることを特徴とする。請求
項7の発明は、請求項4または請求項5の発明におい
て、規定の探索開始点から始めて溶接された一方の部材
のエッジに略直交する方向に走査し、走査した線上での
画素の濃度の増減の傾向に基づいて濃度に対するしきい
値を設定し、走査した線上でしきい値に対して濃度の高
低が反転した画素を端子点とし、同手順で求めた2個の
端子点を通る直線を端子基準線とすることを特徴とす
る。
According to a sixth aspect of the present invention, in the fourth or fifth aspect, the edge of one member welded based on at least one of the differential value and the differential direction value of each pixel by scanning in the inspection window. The above pixel is obtained, and when a specified number or more of pixels satisfying the same condition are continuously present, the consecutive pixels are used as the terminal reference line. According to a seventh aspect of the present invention, in the fourth or fifth aspect of the invention, the density of the pixels on the scanned line is scanned in a direction substantially orthogonal to the edge of one of the welded members starting from the prescribed search start point. A threshold value for density is set based on the tendency of increase and decrease of, and a pixel whose density level is inverted with respect to the threshold value on the scanned line is used as a terminal point, and the pixel passes through two terminal points obtained by the same procedure. It is characterized in that a straight line is used as the terminal reference line.

【0010】請求項8の発明は、請求項7の溶接部外観
検査方法において、探索開始点から始めて走査した線上
に端子点が存在しないときに、走査方向に対して直交す
る方向に所定画素分ずらした新たな探索開始点を設定
し、この探索開始点に対して端子点を求めることを特徴
とする。請求項9の発明は、請求項2の方法により求め
た各エッジ候補点と検査対象物に対して定位置に設定し
た検査ウインドウの規定の一辺との間の画素の総数を求
め、この総数を規定のしきい値と比較することによって
溶接部位の位置の適否を判定することを特徴とする。
According to an eighth aspect of the present invention, in the welded portion visual inspection method according to the seventh aspect, when there is no terminal point on a line scanned starting from the search start point, a predetermined pixel portion is formed in a direction orthogonal to the scanning direction. It is characterized in that a new shifted start point is set and a terminal point is obtained for this new start point. According to the invention of claim 9, the total number of pixels between each edge candidate point obtained by the method of claim 2 and a prescribed side of the inspection window set at a fixed position with respect to the inspection object is calculated, and this total number is calculated. It is characterized in that the suitability of the position of the welded portion is determined by comparing with a prescribed threshold value.

【0011】請求項10の発明は、請求項2の方法によ
り求めた各エッジ候補点を連結した溶接部エッジ線と検
査対象物に対して定位置に設定した検査ウインドウの規
定の一辺との間の面積を求め、この面積を規定のしきい
値と比較することによって溶接部位の位置の適否を判定
することを特徴とする。請求項11の発明は、請求項1
の発明において、濃淡画像である原画像に溶接部位を含
むように設定した検査ウインドウ内で各画素に対応した
受光光量を求め、検査ウインドウ内の全画素の平均光量
に規定のオフセット値を加算したしきい値よりも受光光
量の少ない画素について平均光量を求め、この平均光量
が規定のしきい値よりも大きいときには光沢不足であっ
て溶接強度が不良と判定することを特徴とする。
According to a tenth aspect of the present invention, between the weld edge line connecting the edge candidate points obtained by the method of the second aspect and a prescribed side of the inspection window set at a fixed position with respect to the inspection object. Is determined and the suitability of the position of the welded portion is determined by comparing this area with a prescribed threshold value. The invention of claim 11 relates to claim 1.
In the invention, the received light amount corresponding to each pixel is obtained in the inspection window set to include the welding part in the original image which is a grayscale image, and the specified offset value is added to the average light amount of all the pixels in the inspection window. An average amount of light is calculated for a pixel having a smaller amount of received light than a threshold value, and when the average amount of light is larger than a prescribed threshold value, the gloss is insufficient and the welding strength is determined to be poor.

【0012】請求項12の発明は、請求項1の発明にお
いて、濃淡画像である原画像に溶接部位を含むように設
定した検査ウインドウ内で各画素に対応した受光光量を
求め、検査ウインドウ内の全画素の平均光量に規定のオ
フセット値を加算したしきい値よりも受光光量の多い画
素の総数が規定のしきい値よりも大きいときには溶接強
度について良品と判定することを特徴とする。
According to a twelfth aspect of the present invention, in the first aspect of the invention, the amount of received light corresponding to each pixel is obtained within the inspection window set so that the original image, which is a grayscale image, includes the welding portion, It is characterized in that the welding strength is determined to be non-defective when the total number of pixels whose received light amount is larger than the threshold value obtained by adding the specified offset value to the average light amount of all pixels is larger than the specified threshold value.

【0013】請求項13の発明は、請求項1の発明にお
いて、濃淡画像である原画像に溶接部位を含むように探
索方向を規定するマスクを設定し、受光光量がしきい値
以上である画素が探索方向について規定個数以上連続し
て存在するときに溶接強度について良品と判定すること
を特徴とする。請求項14の発明は、請求項11ないし
請求項13の発明において、正反射光が撮像される光源
と、拡散反射光が撮像される光源とを異なるタイミング
で点灯させ、各光源からの光に基づいて溶接部位の光沢
の良否を判定することを特徴とする。
According to a thirteenth aspect of the present invention, in the first aspect of the present invention, a mask for defining the search direction is set so that the original image, which is a grayscale image, includes a welding portion, and the amount of received light is a threshold value or more. Is determined to be non-defective in terms of welding strength when a predetermined number or more continuously exist in the search direction. According to a fourteenth aspect of the invention, in the invention of the eleventh to thirteenth aspects, the light source for which specular reflection light is imaged and the light source for which diffuse reflection light is imaged are turned on at different timings, and light from each light source is changed. It is characterized in that the quality of the gloss of the welded part is determined based on the above.

【0014】請求項15の発明は、請求項1の発明にお
いて、溶接部位の有無の判定結果と、溶接部位の位置の
適否の判定結果と、溶接部位の光沢に基づく溶接強度の
判定結果との少なくともいずれかを用いて溶接装置の動
作の修正、溶接位置の補正を行うことを特徴とする。
According to a fifteenth aspect of the present invention, in the first aspect of the present invention, there are provided a determination result of presence / absence of a welded portion, a determination result of appropriateness of a position of the welded portion, and a determination result of welding strength based on gloss of the welded portion. It is characterized in that the operation of the welding apparatus is corrected and the welding position is corrected using at least one of them.

【0015】[0015]

【作用】本発明では、溶接部位の有無を検出する過程
と、溶接部位が検査対象物の所要位置に位置するか否か
を判定する過程と、溶接部位の光沢に基づいて溶接強度
を判定する過程とを有していることによって、溶接部位
について総合的な判定を行うことができ、溶接に関して
的確な良否判定が行えるのである。
In the present invention, the process of detecting the presence / absence of a welded part, the process of determining whether or not the welded part is located at the required position of the inspection object, and the weld strength based on the gloss of the welded part are determined. By having the process, it is possible to make a comprehensive judgment on the welded part and to make an accurate judgment on the quality of welding.

【0016】また、溶接に関しての的確な判定が行える
ことによって、溶接装置の動作の管理や溶接位置の補正
を行うことが可能になり、溶接部位を有した製品の品質
向上、すなわち歩留りの向上につながるのである。
Further, since it is possible to make an accurate determination regarding welding, it is possible to manage the operation of the welding apparatus and correct the welding position, and to improve the quality of products having welded parts, that is, to improve the yield. It connects.

【0017】[0017]

【実施例】検査対象物である溶接部位には、溶接部位と
周囲との照度に差が生じて陰影が形成されるように斜め
方向から光が照射され、溶接部位を含む領域がITVカ
メラのような画像入力装置によって撮像される。したが
って、画像入力装置から取り込んだ画像にはコントラス
トが得られる。本発明は、このような画像のコントラス
トを利用して溶接状態の良否を判定するものである。
[Example] The welding site to be inspected is irradiated with light from an oblique direction so that a difference in the illuminance between the welding site and the surrounding occurs and a shadow is formed, and the region including the welding site is the area of the ITV camera. An image is captured by such an image input device. Therefore, contrast can be obtained in the image captured from the image input device. The present invention utilizes such image contrast to determine the quality of the welded state.

【0018】画像入力装置1により取り込まれた画像
は、図6に示すように、各画素の濃度がアナログ−デジ
タル変換部2においてデジタル信号に変換され、前処理
部3において以下の前処理が施されることによって、ア
ナログ−デジタル変換部2の出力として得られる原画像
のほかに、微分画像、微分方向画像、エッジ画像が得ら
れる。
As shown in FIG. 6, the density of each pixel of the image captured by the image input device 1 is converted into a digital signal in the analog-digital converter 2, and the following preprocessing is performed in the preprocessor 3. By doing so, in addition to the original image obtained as the output of the analog-digital conversion unit 2, a differential image, a differential direction image, and an edge image are obtained.

【0019】すなわち、検査対象物を含む空間領域を撮
像して得られる原画像は濃淡画像であり、この濃淡画像
から検査対象物の輪郭線等のエッジを抽出する処理は、
「エッジは濃度変化が大きい部分に対応している」とい
う考え方に基づいている。したがって、濃度を微分する
ことによってエッジの抽出を行なう。微分処理は、図7
に示すように、原画像P1 を3×3画素の局所並列ウイ
ンドウWに分割して行なう。つまり、原画像P1 の中で
注目する画素Eを中心として、その画素Eの周囲の8画
素(8近傍)A〜D,F〜Iとで局所並列ウインドウW
を形成し、局所並列ウインドウW内の画素A〜Iの濃度
の縦方向の濃度変化ΔVと横方向の濃度変化ΔHとを次
式によって求める。
That is, the original image obtained by imaging the spatial region including the inspection object is a grayscale image, and the processing for extracting the edge such as the contour line of the inspection target from the grayscale image is
It is based on the idea that "the edge corresponds to a portion where the density change is large". Therefore, the edge is extracted by differentiating the density. The differential processing is shown in FIG.
The original image P 1 is divided into 3 × 3 pixel local parallel windows W as shown in FIG. That is, with the pixel E of interest in the original image P 1 as the center, the eight pixels (8 neighborhoods) A to D and F to I around the pixel E have a local parallel window W.
And the vertical density change ΔV and the horizontal density change ΔH of the pixels A to I in the local parallel window W are calculated by the following equation.

【0020】ΔV=(A+B+C)−(G+H+I) ΔH=(A+D+G)−(C+F+I) ただし、A〜Iは対応する画素の濃度を示している。さ
らに、画素Eについての微分値abs(E) と微分方向値de
g(E) とを次式によって求める。 abs(E) =(ΔV2 +ΔH2 1/2 deg(E) =tan -1(ΔV/ΔH)+(π/2) 微分値abs(E) は、原画像の注目する画素Eの近傍領域
における濃度の変化率を表し、微分方向値deg(E) は、
同近傍領域における濃度変化の方向に直交する方向を表
している。以上の演算を原画像P1 の全画素について行
なうことにより、検査対象物の輪郭線のような濃度変化
が大きい部分と、その変化の方向とを抽出することがで
きるのである。ここに、各画素の値が、微分値abs(E)
である画像を微分画像、微分方向値deg(E) である画像
を微分方向画像と呼ぶ。
ΔV = (A + B + C)-(G + H + I) ΔH = (A + D + G)-(C + F + I) where A to I represent the densities of the corresponding pixels. Furthermore, the differential value abs (E) for pixel E and the differential direction value de
g (E) and are calculated by the following equation. abs (E) = (ΔV 2 + ΔH 2 ) 1/2 deg (E) = tan −1 (ΔV / ΔH) + (π / 2) The differential value abs (E) is in the vicinity of the pixel E of interest in the original image. It represents the rate of change of density in the region, and the differential direction value deg (E) is
The direction orthogonal to the direction of density change in the vicinity region is shown. By performing the above calculation for all the pixels of the original image P 1 , it is possible to extract a portion such as the contour line of the inspection object where the density change is large and the direction of the change. Here, the value of each pixel is the differential value abs (E)
Is called a differential image, and an image having a differential direction value deg (E) is called a differential direction image.

【0021】次に細線化処理が施される。細線化処理
は、微分値が大きいほど濃度変化が大きいことを表わし
ている点に着目して行なわれる。すなわち、各画素の微
分値を周囲の画素の微分値と比較し、周囲の画素よりも
大きくなるものを連結していくことにより、1画素の幅
を有したエッジを抽出するのである。図8に示すよう
に、各画素の位置をX−Y座標で表わし、微分値をZ座
標で表した微分画像P2 を考えれば、細線化処理は、こ
の曲面における稜線を求めることに相当する。ここまで
の処理により、微分値の大小にかかわらず、すべての稜
線が抽出される。この段階で得られている稜線には、ノ
イズ等による不要な小さな山も含まれているから、図9
に示すように、適宜しきい値SLを設定し、このしきい
値SL以上の値のみを採用してノイズ成分を除去する。
この処理で得られた画像は、原画像のコントラストが不
十分であるときやノイズが多いようなときには不連続線
になりやすい。そこで、エッジ延長処理を行なう。エッ
ジ延長処理では、不連続線の端点から始めて、注目する
画素とその周囲の画素とを比較し、次式で表わされる評
価関数f(J) がもっとも大きくなる方向に線を延長し、
他の線の端点に衝突するまでこれを続ける。
Next, a thinning process is performed. The thinning process is performed by paying attention to the fact that the larger the differential value, the larger the density change. That is, the differential value of each pixel is compared with the differential value of the surrounding pixels, and those having a larger value than the surrounding pixels are connected to extract an edge having a width of one pixel. As shown in FIG. 8, considering a differential image P 2 in which the position of each pixel is represented by XY coordinates and the differential value is represented by Z coordinates, the thinning processing corresponds to finding the ridgeline on this curved surface. . By the processing up to this point, all ridgelines are extracted regardless of the magnitude of the differential value. Since the ridge line obtained at this stage also includes unnecessary small mountains due to noise or the like, FIG.
As shown in, the threshold value SL is appropriately set, and only the value equal to or higher than the threshold value SL is adopted to remove the noise component.
The image obtained by this processing tends to be a discontinuous line when the contrast of the original image is insufficient or when there is a lot of noise. Therefore, edge extension processing is performed. In the edge extension processing, starting from the end point of the discontinuous line, the pixel of interest and surrounding pixels are compared, and the line is extended in the direction in which the evaluation function f (J) represented by the following equation becomes the largest,
Continue doing this until you hit the endpoint of the other line.

【0022】f(J) =abs(J)・cos(deg(J)−deg(0)) ・
cos((J−1)π/4−deg(O)) ここに、deg(O)は中心画素(局所並列ウインドウWのE
に相当する)の微分方向値、deg(J)は隣接画素(局所並
列ウインドウWの8近傍に相当する)の微分方向値、ab
s(J)は隣接画素の微分値である。ただし、J=1,2,
……,8。以上の処理により、原画像P1 において濃度
変化が大きい部分の輪郭をなぞるようなエッジ画像が得
られる。こうして、図10に示すように、原画像P1
微分画像P2 、微分方向画像P3 、エッジ画像P4 の4
種類の画像が得られ、各画像が原画像メモリ4、微分画
像メモリ5、微分方向画像メモリ6、エッジ画像メモリ
7にそれぞれ格納される。以下の説明では、各画像P1
〜P4 の画素の位置をX−Y座標で表現するものとし、
各画像における画素の値をそれぞれf1(x,y) 、f
2(x,y) 、f3(x,y) 、f4(x,y) とする。
F (J) = abs (J) .cos (deg (J) -deg (0)).
cos ((J−1) π / 4−deg (O)) where deg (O) is the central pixel (E of the local parallel window W).
Deg (J) is the differential direction value of an adjacent pixel (corresponding to 8 neighborhoods of the local parallel window W), ab
s (J) is the differential value of the adjacent pixel. However, J = 1, 2,
…, 8. Through the above processing, an edge image that traces the contour of the portion of the original image P 1 where the density change is large can be obtained. Thus, as shown in FIG. 10, the original image P 1 ,
Differential image P 2 , differential direction image P 3 , and edge image P 4 4
Images of different types are obtained, and each image is stored in the original image memory 4, the differential image memory 5, the differential direction image memory 6, and the edge image memory 7, respectively. In the following description, each image P 1
The pixel positions of ~ P 4 are represented by XY coordinates, and
The pixel values in each image are f 1 (x, y) and f, respectively.
Let 2 (x, y), f 3 (x, y), and f 4 (x, y).

【0023】原画像は濃淡画像であって、各画素の濃度
a(=f1(x,y) )は、たとえば8ビットで表されて
0≦a≦255となる。また、微分画像の各画素の微分
値b(=f2(x,y) )は、たとえば6ビットで表され
て0≦b≦63となり、微分方向画像の各画素の微分方
向値c(=f3(x,y) )は、たとえば16方向で表さ
れて0≦c≦15となる。エッジ画像については、線の
有無のみであるから、線となる画素の値は「1」、それ
以外の画素の値は「0」になる。つまり、f4(x,y)
の値域は{0,1}になる。
The original image is a grayscale image, and the density a (= f 1 (x, y)) of each pixel is represented by, for example, 8 bits and 0 ≦ a ≦ 255. Further, the differential value b (= f 2 (x, y)) of each pixel of the differential image is represented by 6 bits, for example, 0 ≦ b ≦ 63, and the differential direction value c (= of each pixel of the differential direction image f 3 (x, y) is expressed in 16 directions, for example, and 0 ≦ c ≦ 15. As for the edge image, only the presence / absence of a line is present, and therefore the value of the pixel forming the line is “1” and the value of the other pixels is “0”. That is, f 4 (x, y)
The value range of is {0, 1}.

【0024】演算処理部8は、マイクロコンピュータに
よる画像処理を施す部分であって、以下に説明する処理
を行う部分である。演算処理部8での処理は、基本的に
溶接部位の有無を検出する過程と、溶接部位が検査対象
物の所要位置に位置するか否かを判定する過程と、溶接
部位の光沢に基づいて溶接強度を判定する過程とからな
る。このような3過程によって、溶接部位以外を検査す
るのを防止することができ、かつ溶接部位の位置、およ
び溶接強度について良否の判定が行えるのである。以下
では、各過程についての処理手順について説明する。
The arithmetic processing section 8 is a section for performing image processing by a microcomputer, and is a section for performing the processing described below. The processing in the arithmetic processing unit 8 is basically based on the process of detecting the presence / absence of a welding site, the process of determining whether or not the welding site is located at a required position of the inspection object, and the gloss of the welding site. And the process of determining the welding strength. By these three processes, it is possible to prevent inspection of parts other than the welded part, and it is possible to judge the position of the welded part and the weld strength. The processing procedure for each process will be described below.

【0025】 溶接部位の有無の判定 (方法1−1)溶接部位の有無を判定するには、エッジ
画像と微分画像と微分方向画像とを用いる。まず、図2
に示すように溶接された検査対象物11の溶接部位12
を撮像した画像内に、図3のような矩形状の検査ウイン
ドウW1 を設定する。検査ウインドウW1 の中で水平方
向に走査ラインL1 を設定し、この走査ラインL1 を上
向きに1画素ずつ走査していき、各位置で走査ラインL
1 の上の画素を走査する。すなわち、検査ウインドウW
1 の中でラスタ走査することになる。このとき、走査ラ
インL1 を走査すれば、エッジ画像の中でエッジを構成
している画素(すなわち、エッジ画像で値が「1」であ
る画素。以下、エッジフラグと呼ぶ)Xに走査ラインL
1 が接触するから、このエッジフラグXについて微分値
および微分方向値を求める。微分値が規定のしきい値以
上であるという条件、および微分方向値が規定の範囲内
(ここでは走査ラインL1 を上方向に走査しているか
ら、微分方向値としては横方向のものを求める)である
という条件が満たされると、その画素は溶接部位のエッ
ジである可能性が高いとして、この画素をエッジ候補点
Yとする。
Determination of Presence / Absence of Welded Site (Method 1-1) To determine the presence / absence of a welded site, an edge image, a differential image, and a differential direction image are used. First, FIG.
Welded portion 12 of inspection object 11 welded as shown in FIG.
A rectangular inspection window W 1 as shown in FIG. 3 is set in the captured image. The scan line L 1 is set in the inspection window W 1 in the horizontal direction, the scan line L 1 is scanned upward pixel by pixel, and the scan line L 1 is scanned at each position.
Scan the pixel above 1 . That is, the inspection window W
Raster scanning will be performed in 1 . At this time, if the scanning line L 1 is scanned, a pixel forming an edge in the edge image (that is, a pixel whose value is “1” in the edge image; hereinafter referred to as edge flag) X is scanned line. L
Since 1 touches, the differential value and the differential direction value are obtained for this edge flag X. The condition that the differential value is greater than or equal to the specified threshold value, and the differential direction value is within the specified range (here, since the scanning line L 1 is scanned in the upward direction, the differential direction value is the lateral direction value). If the condition of “get” is satisfied, it is highly possible that the pixel is the edge of the welded part, and this pixel is set as the edge candidate point Y.

【0026】次に、図4に示すように、求めたエッジ候
補点Yを角の画素とするように矩形状の探索ウインドウ
L ,WR を左右に設定する。ここで、探索ウインドウ
L,WR の画素数について図4では縦横が等しくなっ
ているが、縦横で画素数が異なっていてもよい。このよ
うに探索ウインドウWL ,WR が設定されると探索ウイ
ンドウWL ,WR の範囲内で走査ラインL1 を走査し、
エッジ画像のエッジフラグXについて微分値および微分
方向値を評価してエッジ候補点Yを求める。探索ウイン
ドウWL ,WR の中での走査ラインL1 の走査が終了す
れば、右の探索ウインドウWR ならば、図5に示すよう
に、右端のエッジ候補点Yを角の画素とするように次の
探索ウインドウWR2を設定し、左の探索ウインドウWL
であれば、左端のエッジ候補点Yを角の画素とするよう
に次の探索ウインドウを設定する。
Next, as shown in FIG. 4, the rectangular search windows W L and W R are set to the left and right so that the obtained edge candidate point Y is a corner pixel. Here, the numbers of pixels of the search windows W L and W R are the same in the vertical and horizontal directions in FIG. 4, but the numbers of pixels may be different in the vertical and horizontal directions. When the search windows W L and W R are set in this way, the scan line L 1 is scanned within the range of the search windows W L and W R ,
The differential value and the differential direction value of the edge flag X of the edge image are evaluated to obtain the edge candidate point Y. When the scanning of the scan line L 1 in the search windows W L and W R is completed, in the right search window W R , the edge candidate point Y at the right end is set as a corner pixel as shown in FIG. The next search window W R2 is set as follows, and the left search window W L is set.
If so, the next search window is set such that the left edge candidate point Y is a corner pixel.

【0027】エッジ候補点Yが溶接部位12の境界線を
示しているときには、エッジ候補点Yが連続的に並んで
いるはずであるから、上述のような処理を繰り返すこと
によって、連続したエッジ候補点Yを求めることができ
る。設定した探索ウインドウWL ,WR の中にエッジ候
補点Yが存在しないか、探索ウインドウWL ,WR が検
査ウインドウW1 から外に出た場合には、エッジ候補点
Yの探索を中止し、最初のエッジ候補点Yを見つけた時
点からのエッジ候補点Yの個数Aを求める。
When the edge candidate points Y indicate the boundary line of the welded portion 12, the edge candidate points Y should be lined up continuously, so that the above-described processing is repeated to obtain continuous edge candidates. The point Y can be obtained. If the edge candidate point Y does not exist in the set search windows W L and W R , or if the search windows W L and W R go out of the inspection window W 1 , the search for the edge candidate point Y is stopped. Then, the number A of edge candidate points Y from the time when the first edge candidate point Y is found is obtained.

【0028】この個数Aが規定のしきい値Sよりも多い
場合には(A>S)、求めたエッジ候補点Yの連なりを
溶接部位12の境界線を表すものと判定する。また、A
>Sが成立しないときには、検査ウインドウW1 の中で
走査ラインL1 の未走査部位について走査ラインL1
走査を継続して同様の処理を行う。ここで、検査ウイン
ドウW1 の全域に亙って走査ラインL1 を走査した後に
もA>Sの条件が満たされない場合には、溶接部位12
は検査ウインドウW1 の中には存在しないと判定するの
である。
When the number A is larger than the specified threshold value S (A> S), it is determined that the obtained continuation of the edge candidate points Y represents the boundary line of the welded portion 12. Also, A
When> S is not satisfied, the scanning line L 1 is continuously scanned for the unscanned portion of the scanning line L 1 in the inspection window W 1 , and the same processing is performed. Here, if the condition of A> S is not satisfied even after the scan line L 1 is scanned over the entire inspection window W 1 , the welded portion 12
Is determined not to exist in the inspection window W 1 .

【0029】以上説明したように、検査ウインドウW1
の中でエッジ画像のエッジフラグXがエッジ候補点Yか
否かを判定し、かつエッジ候補点Yの連なる個数が規定
のしきい値以上である場合について、溶接部位12が存
在すると判定するのであって、溶接部位12の存否を確
実に検出することができるのである。上記動作をまとめ
ると、図1のようになる。すなわち、設定した検査ウイ
ンドウW1 の中で走査ラインL1 を1画素ずつ移動させ
(S1)、走査ラインL1 の上でエッジフラグを探索す
る。エッジ画像の中で微分値が規定のしきい値以上であ
り、かつ微分方向値が規定の範囲内であるエッジフラグ
を求め(S2)、走査ラインL1 の走査開始位置にもっ
とも近いエッジフラグをエッジ候補点Yとして抽出する
(S3)。このエッジフラグの近傍に探索ウインドウW
R ,WL を設定し、各探索ウインドウWR ,WL の中で
の走査によって、エッジ画像の中で微分値が規定のしき
い値以上であり、かつ微分方向値が規定の範囲内である
エッジフラグをエッジ候補点Yとして求める(S4)。
さらに、探索ウインドウWR ,WL を順次設定してエッ
ジ候補点Yの探索を継続する(S5)。設定した探索ウ
インドウWR ,WLの中にエッジフラグが存在しない
か、設定した探索ウインドウWR ,WL が検査ウインド
ウW1 から外に出た場合にはエッジフラグの探索を中止
し、それまでに求めたエッジ候補点Yの個数を求める
(S6)。求めたエッジ候補点Yの個数Aを規定のしき
い値Sと比較してA>Sが成立すれば、求めたエッジ候
補点Yが溶接部位12の境界線であると判断するのであ
る(S7)。
As described above, the inspection window W 1
It is determined that the welded portion 12 exists when it is determined whether the edge flag X of the edge image is the edge candidate point Y, and when the number of consecutive edge candidate points Y is equal to or greater than the specified threshold value. Therefore, the presence or absence of the welded portion 12 can be reliably detected. The above operation is summarized as shown in FIG. That is, the scanning line L 1 is moved pixel by pixel in the set inspection window W 1 (S1), and the edge flag is searched for on the scanning line L 1 . An edge flag whose differential value is greater than or equal to a specified threshold value in the edge image and whose differential direction value is within a specified range is obtained (S2), and the edge flag closest to the scanning start position of the scanning line L 1 is determined. It is extracted as an edge candidate point Y (S3). In the vicinity of this edge flag, the search window W
By setting R and W L and performing scanning in each search window W R and W L , the differential value in the edge image is greater than or equal to the specified threshold value, and the differential direction value is within the specified range. A certain edge flag is obtained as the edge candidate point Y (S4).
Further, the search windows W R and W L are sequentially set and the search for the edge candidate point Y is continued (S5). Setting the search window W R, or not an edge flag is present in the W L, discontinue the search for the edge flag when the set search window W R, where W L goes out from the inspection window W 1, it The number of edge candidate points Y obtained up to this point is obtained (S6). The obtained number A of edge candidate points Y is compared with a prescribed threshold value S, and if A> S is satisfied, it is determined that the obtained edge candidate points Y are the boundaries of the welded portion 12 (S7). ).

【0030】本方法では、微分値と微分方向値との両方
の条件が満たされた場合にエッジ候補点Yと判定してい
るが、微分値と微分方向値との一方のみについて条件が
満たされた場合にエッジ候補点Yと判定するようにして
もよい。 (方法1−2)本方法は、図1におけるステップS1で
の走査ラインL1 の移動方向を自動的に選択する方法を
示す。この処理では、検査ウインドウW1 の中にさらに
図11に示すような方向探索ウインドウW2 を設定す
る。次に、設定した方向探索ウインドウW2 の中を走査
し、方向探索ウインドウW2 の中のすべてのエッジフラ
グを抽出した後、微分値が規定のしきい値以上であるエ
ッジフラグについて微分方向値の度数分布を求める。こ
こで、上述したように微分方向値は16方向で表されて
いるのであって、たとえば図12のように各微分方向値
が割り当てられているとすれば、微分方向値が、0,
1,14,15,6,7,8,9の範囲であれば溶接部
位12の境界線の方向が略水平方向であると考えられ、
2,3,4,5,10,11,12,13の範囲であれ
ば溶接部位12の境界線の方向が略垂直方向であると考
えられる。そこで、度数分布によって、溶接部位12の
境界線が水平方向か垂直方向であるかの目安を求め、水
平方向であれば垂直方向の走査ラインL1 を水平方向に
走査し、垂直方向であれば水平方向の走査ラインL1
垂直方向に走査するように、走査ラインL1 の方向およ
び移動方向を自動設定するのである。他の技術について
は、方法1−1と同様である。
In this method, the edge candidate point Y is determined when both the differential value and the differential direction value are satisfied, but the condition is satisfied only for one of the differential value and the differential direction value. In this case, the edge candidate point Y may be determined. (Method 1-2) This method shows a method of automatically selecting the moving direction of the scanning line L 1 in step S1 in FIG. In this process, a direction search window W 2 as shown in FIG. 11 is further set in the inspection window W 1 . Then, to scan through the direction search window W 2 is set, after extracting all edges flag in the direction search window W 2, the differential value is defined for the edge flag differential direction value is not less than the threshold value Find the frequency distribution of. Here, as described above, the differential direction value is represented by 16 directions, and if each differential direction value is assigned as shown in FIG. 12, for example, the differential direction value is 0,
In the range of 1, 14, 15, 6, 7, 8, and 9, the direction of the boundary line of the welded portion 12 is considered to be substantially horizontal,
In the range of 2, 3, 4, 5, 10, 11, 12, and 13, it is considered that the direction of the boundary line of the welded portion 12 is substantially vertical. Therefore, a guideline for determining whether the boundary line of the welded portion 12 is the horizontal direction or the vertical direction is obtained from the frequency distribution, and if the horizontal direction, the scanning line L 1 in the vertical direction is scanned in the horizontal direction, and if it is the vertical direction. The direction of the scanning line L 1 and the moving direction are automatically set so that the scanning line L 1 in the horizontal direction is scanned in the vertical direction. Other techniques are the same as those in Method 1-1.

【0031】 溶接位置の判定 (方法2−1)溶接部位12か否かを判定した後には、
求めた溶接部位12の位置が所定位置であるか否かを判
定する。この処理では、まず溶接部位12を求める処理
において得られたエッジ候補点Yの位置をそれぞれメモ
リ内に領域設定したバッファ内に格納する。次に、図1
4に示すように、あらかじめ設定された2つの探索開始
点st1,st2から始めて検査対象物11の境界線に
略直交するように垂直方向ないし水平方向に走査する。
この走査において微分値が規定のしきい値以上、かつ微
分方向値が規定の範囲内であるエッジ画像内でのエッジ
フラグを求め、求めた各エッジフラグを端子点p1,p
2とする。検査対象物11のエッジが直線であると仮定
すれば、求めた端子点p1,p2を通る直線は検査対象
物11のエッジであると考えられるから、この直線を端
子点p1,p2の位置座標に基づいて端子基準線L2
して求める。ここに、端子基準線L2 は溶接部位12を
通過するように設定しなければならないから、その条件
を満たす端子基準線L2 を求めることができるように探
索開始点st1,st2を設定する。
Judgment of Welding Position (Method 2-1) After judging whether or not it is the welded portion 12,
It is determined whether the obtained position of the welded portion 12 is a predetermined position. In this process, first, the positions of the edge candidate points Y obtained in the process of obtaining the welded portion 12 are stored in the buffers whose regions are set in the memory. Next, FIG.
As shown in FIG. 4, scanning is started from two preset search start points st1 and st2 in the vertical direction or the horizontal direction so as to be substantially orthogonal to the boundary line of the inspection object 11.
In this scanning, an edge flag in an edge image in which the differential value is equal to or larger than a specified threshold value and the differential direction value is within the specified range, and the obtained edge flags are respectively set to the terminal points p1 and p.
Set to 2. Assuming that the edge of the inspection object 11 is a straight line, the straight line passing through the obtained terminal points p1 and p2 is considered to be the edge of the inspection object 11, and thus this straight line is used as the position coordinates of the terminal points p1 and p2. The terminal reference line L 2 is obtained based on Since the terminal reference line L 2 must be set so as to pass through the welded portion 12, the search start points st1 and st2 are set so that the terminal reference line L 2 satisfying the condition can be obtained.

【0032】溶接部位12の位置が所望位置であれば、
溶接部位12を端子基準線L2 で切ったときの端子基準
線L2 の一側で溶接部位12が占める面積が所定範囲内
であることが必須である。そこで、溶接部位12のエッ
ジ候補点Yのうちで端子基準線L2 を挟んで片側に配列
されているエッジ候補点Yについて、図15に示すよう
に、それぞれ端子基準線L2 との距離を各エッジ候補点
Yと端子基準線L2 との間の画素数として求め、求めた
画素数の総和を求める。この画素数の総和は、エッジ候
補点Yを連結した曲線と端子基準線L2 とによって囲ま
れる部分の面積を反映している。
If the position of the welded portion 12 is the desired position,
It is essential that the area welded part 12 occupies one side of the terminal base line L 2 when the cut welded part 12 in the terminal base line L 2 is within a predetermined range. Therefore, the edge candidate points Y that are arranged on one side across the terminals reference line L 2 among the edge candidate point Y of the welded part 12, as shown in FIG. 15, respectively the distance between the terminal reference line L 2 It is calculated as the number of pixels between each edge candidate point Y and the terminal reference line L 2, and the total of the calculated number of pixels is calculated. This total number of pixels reflects the area of the portion surrounded by the curve connecting the edge candidate points Y and the terminal reference line L 2 .

【0033】そこで、画素の総数Bを規定の閾値MSと
比較し、B>MSが成立すれば検査対象物11の上で溶
接部位12は正常な位置であると判断するのである。上
述した条件が成立しない場合には、溶接部位12の位置
について不良であると判断することができる。上記手順
をまとめると図13のようになる。すなわち、2つの探
索開始点st1,st2から走査を開始して検査対象物
11のエッジ上の2つの端子点p1,p2を求め、両端
子点p1,p2を通るように端子基準線L2 を設定する
(S1)。次に、端子基準線L2 と各エッジ候補点Yと
の間の画素数を求め(S2)、この画素数の総和Bを求
める(S3)。画素の総数Bが規定のしきい値MSより
も多い場合には、溶接部位12について良品と判断する
のである(S4)。
Therefore, the total number B of pixels is compared with a prescribed threshold value MS, and if B> MS is established, it is determined that the welding site 12 is a normal position on the inspection object 11. If the above conditions are not satisfied, it can be determined that the position of the welded portion 12 is defective. The above procedure is summarized in FIG. That is, scanning is started from two search start points st1 and st2 to obtain two terminal points p1 and p2 on the edge of the inspection object 11, and the terminal reference line L 2 is set so as to pass through both terminal points p1 and p2. Set (S1). Next, the number of pixels between the terminal reference line L 2 and each edge candidate point Y is calculated (S2), and the sum B of this number of pixels is calculated (S3). If the total number B of pixels is larger than the specified threshold value MS, the welded portion 12 is determined to be non-defective (S4).

【0034】(方法2−2)本方法は基本的には方法2
−1と同様であって、端子基準線L2 を求める手順は方
法2−1と同じである。また、本方法では、図16に示
すように、エッジ候補点Yを連結して溶接部エッジ線L
3 を求める。このようにして求めた溶接部エッジ線L3
と端子基準線L2 とによって囲まれる部分の面積Cを演
算して求め、求めた結果について方法2−1と同様に規
定のしきい値MSと比較し、C>MSが成立したとき
に、溶接部位12の位置が正常であると判定するのであ
る。すなわち、方法2−1のように画素数によって面積
を求めるものに対して、より精度よく面積Cを求めよう
としているのであって、他の点は方法2−1と同様であ
る。
(Method 2-2) This method is basically Method 2.
The procedure for obtaining the terminal reference line L 2 is the same as that for Method 2-1. Further, in this method, as shown in FIG. 16, the weld edge line L is formed by connecting the edge candidate points Y.
Ask for 3 . The weld edge line L 3 obtained in this way
The area C surrounded by the terminal reference line L 2 is calculated, and the obtained result is compared with a prescribed threshold value MS in the same manner as in Method 2-1, and when C> MS is satisfied, The position of the welded portion 12 is determined to be normal. That is, the area C is to be obtained more accurately than the method 2-1 in which the area is obtained by the number of pixels, and the other points are the same as the method 2-1.

【0035】(方法2−3)方法2−1および方法2−
2では、端子基準線L2 を2つの端子点p1,p2を通
る直線として求めていたが、本方法では、図17に矢印
で示すように、検査ウインドウW1 の中で規定の方向に
走査を行い、エッジ画像の中で微分値が規定のしきい値
以上であり、かつ微分方向値が規定の範囲内であるエッ
ジフラグを求める。このエッジフラグは端子点p1,p
2に相当するものであるが、求めたエッジフラグを通る
ように直線を設定する代わりに、図18に示すように、
求めたエッジフラグZを含むように所定画素数(縦横に
複数画素)の連結性確認ウインドウW3 を設定し、連結
性確認ウインドウW3 の中で、微分値が規定のしきい値
以上であり、かつ微分方向値が規定の範囲内であるエッ
ジ画像内のエッジフラグZを求める。このようにして連
続するエッジフラグZを求め、連続するエッジフラグZ
の個数Dが規定のしきい値NSに対して、D>NSとな
れば、連続しているエッジフラグZを端子基準線L2
するのである。また、上記条件が成立しなければ、検査
ウインドウW1 の中での走査を継続することによって、
端子基準線L2 を求めるのである。他の点は方法2−1
と同様である。
(Method 2-3) Method 2-1 and Method 2-
2, the terminal reference line L 2 was obtained as a straight line passing through the two terminal points p1 and p2, but in this method, as shown by the arrow in FIG. 17, scanning is performed in the prescribed direction within the inspection window W 1. Then, an edge flag whose differential value is equal to or larger than a specified threshold value in the edge image and whose differential direction value is within a specified range is obtained. This edge flag is assigned to the terminal points p1 and p
Although it is equivalent to 2, instead of setting a straight line so as to pass through the obtained edge flag, as shown in FIG.
A connectivity confirmation window W 3 having a predetermined number of pixels (a plurality of pixels in the vertical and horizontal directions) is set so as to include the obtained edge flag Z, and in the connectivity confirmation window W 3 , the differential value is equal to or more than a specified threshold value. , And the edge flag Z in the edge image whose differential direction value is within the specified range. Thus, the continuous edge flag Z is obtained, and the continuous edge flag Z
When the number D of the above is D> NS with respect to the prescribed threshold NS, the continuous edge flag Z is set as the terminal reference line L 2 . If the above conditions are not satisfied, by continuing scanning in the inspection window W 1 ,
The terminal reference line L 2 is obtained. Other points are Method 2-1
Is the same as.

【0036】(方法2−4)方法2−1ないし方法2−
3では、端子基準線L2 を求めるにあたってエッジフラ
グを用いているが、エッジフラグを求めることができる
のは検査対象物11と背景との間のコントラストが比較
的大きい場合であり、このコントラストが小さいとエッ
ジフラグを確実に得られない場合がある。そこで本方法
では、エッジフラグを用いることなく端子基準線L2
求める手順を示す。
(Method 2-4) Method 2-1 to Method 2-
In FIG. 3, the edge flag is used to obtain the terminal reference line L 2 , but the edge flag can be obtained only when the contrast between the inspection object 11 and the background is relatively large. If it is small, the edge flag may not be surely obtained. Therefore, in this method, a procedure for obtaining the terminal reference line L 2 without using the edge flag will be shown.

【0037】すなわち、図20に示すように、あらかじ
め設定した2個の探索開始点st1,st2から始めて
検査対象物11の境界線に略直交するように垂直方向な
いし水平方向に所定範囲だけ走査する。ここで、走査す
る線上の各画素の濃度(光量)を原画像から求め、濃度
が増加傾向が減少傾向かをあらかじめ判定する。このよ
うにして濃度の増減の傾向を考慮することで検査対象物
11の境界線を判定するためのしきい値PSを設定す
る。しきい値PSは、濃度が増加傾向であれば探索開始
点st1,st2の濃度よりも高く設定し、濃度が減少
傾向であれば低く設定する。次に、図21に示すよう
に、走査する線上において探索開始点st1,st2か
ら始めて濃度の高低がしきい値PSに対して最初に反転
する画素を求める。すなわち、濃度が増加傾向であれば
濃度がしきい値PSを越える画素を求め、濃度が減少傾
向であれば濃度がしきい値PSよりも小さくなる画素を
求めるのである。こうして2個の画素を求め両画素を検
査対象物11の境界線上の端子点p1,p2とみなすの
である。
That is, as shown in FIG. 20, starting from two preset search start points st1 and st2, a predetermined range is scanned vertically or horizontally so as to be substantially orthogonal to the boundary line of the inspection object 11. . Here, the density (light amount) of each pixel on the line to be scanned is obtained from the original image, and it is determined in advance whether the density is increasing or decreasing. In this way, the threshold value PS for determining the boundary line of the inspection object 11 is set by considering the tendency of increase and decrease of the density. The threshold value PS is set higher than the densities of the search start points st1 and st2 if the density tends to increase, and set lower if the density tends to decrease. Next, as shown in FIG. 21, a pixel in which the level of the density first inverts with respect to the threshold value PS starting from the search start points st1 and st2 on the scanning line is obtained. That is, when the density tends to increase, the pixel whose density exceeds the threshold PS is obtained, and when the density tends to decrease, the pixel whose density becomes smaller than the threshold PS is obtained. In this way, two pixels are obtained and both pixels are regarded as the terminal points p1 and p2 on the boundary line of the inspection object 11.

【0038】以後の手順は方法2−1と同様であって、
両端子点p1,p2を通る直線を端子基準線L2 とし、
端子基準線L2 に対する溶接部位12の位置判定を行な
うのである。上述したように、本方法ではエッジフラグ
を用いることなく画素の濃度変化のみによって検査対象
物11の境界線を判定して端子基準線L2 を求めるか
ら、コントラストが小さくエッジフラグが得られていな
いような箇所でも端子点p1,p2を求めることが可能
になる。
The subsequent procedure is the same as that of the method 2-1.
A straight line passing through both terminal points p1 and p2 is set as a terminal reference line L 2 ,
The position of the welded portion 12 with respect to the terminal reference line L 2 is determined. As described above, in this method, the boundary line of the inspection object 11 is determined only by the density change of the pixel without using the edge flag to obtain the terminal reference line L 2, so that the contrast is small and the edge flag is not obtained. It is possible to obtain the terminal points p1 and p2 even in such a place.

【0039】以上の処理をまとめると、図19のように
なる。すなわち、まず探索開始点st1,st2より始
めて検査対象物11に向かって走査し、走査した線上で
の各画素の濃度を求め、同時に濃度の増減の傾向を求め
る(S1)。次に、濃度が増加傾向であれば探索開始点
st1,st2の濃度よりも高いしきい値PSを設定
し、減少傾向であれば探索開始点st1,st2の濃度
よりも低いしきい値PSを設定する(S2)。濃度が増
加傾向であれば探索開始点st1,st2から始めて走
査した線上で濃度がしきい値PSを越える最初の画素を
端子点p1,p2とし、減少傾向であれば濃度がしきい
値PSより小さくなる最初の画素を端子点p1,p2と
する(S3)。
The above processing is summarized as shown in FIG. That is, first, scanning is started from the search start points st1 and st2 toward the inspection object 11, the density of each pixel on the scanned line is obtained, and at the same time, the tendency of increase or decrease in density is obtained (S1). Next, if the density tends to increase, a threshold value PS higher than the density at the search start points st1 and st2 is set, and if the density tends to decrease, a threshold value PS lower than the density at the search start points st1 and st2 is set. Set (S2). If the density tends to increase, the first pixel on the line scanned from the search start points st1 and st2 where the density exceeds the threshold value PS is the terminal point p1 or p2. If the density tends to decrease, the density is lower than the threshold value PS. The first pixel that becomes smaller is set to the terminal points p1 and p2 (S3).

【0040】(方法2−5)方法2−4では、探索開始
点st1,st2を2点としているが、場合によって
は、両探索開始点st1,st2についてそれぞれ端子
点p1,p2を決定できないこともある。そこで、2個
の端子点p1,p2を決定できない場合には、決定でき
なかった探索開始点st1,st2の位置を走査する方
向とは直交する方向に所定画素分ずらした探索開始点s
t1,st2を設定し、同様の手順で端子点p1,p2
を求めるようにする。このようにして、2個の端子点p
1,p2が求まるまで探索開始点st1,st2をずら
しながら上記手順を繰り返すことによって、端子基準線
2 を確実に求めることができるのである。他の手順に
ついては方法2−4と同様である。
(Method 2-5) In Method 2-4, the search start points st1 and st2 are set to two points, but in some cases, the terminal points p1 and p2 cannot be determined for both search start points st1 and st2. There is also. Therefore, when the two terminal points p1 and p2 cannot be determined, the search start point s obtained by shifting the positions of the search start points st1 and st2, which cannot be determined, by a predetermined number of pixels in the direction orthogonal to the scanning direction.
Set t1 and st2 and follow the same procedure to set terminal points p1 and p2.
To ask for. In this way, the two terminal points p
By repeating the above procedure while shifting the search start points st1 and st2 until 1 and p2 are obtained, the terminal reference line L 2 can be reliably obtained. Other procedures are the same as those in Method 2-4.

【0041】(方法2−6)本方法では、端子基準線L
2 を設定する代わりに、図23に示すように、検査対象
物11に対して定位置に設定した検査ウインドウW1
うちの規定の一辺を基準線L4 とし、各エッジ候補点Y
について、それぞれ基準線L4 との距離を各エッジ候補
点Yと基準線L4 との間の画素数として求め、求めた画
素数の総和を求める。この総和は両端のエッジ候補点Y
から基準線L4 に下ろした2本の垂線とエッジ候補点Y
を連結した曲線と基準線L4 とによって囲まれる部位の
面積を反映している。ここにおいて、検査ウインドウW
1 の設定の仕方によっては基準線L4 に直交する直線上
に複数のエッジ候補点Yが存在する場合もあるが、その
場合は各エッジ候補点のうちで基準線L4 との間の画素
数が最大になるものを採用する。
(Method 2-6) In this method, the terminal reference line L
Instead of setting 2 , the prescribed one side of the inspection window W 1 set at a fixed position with respect to the inspection object 11 is set as a reference line L 4 and each edge candidate point Y is set as shown in FIG.
For each determined distance between the reference line L 4 as the number of pixels between each edge candidate point Y and the reference line L 4, obtaining the sum of the number of pixels determined. This sum is the edge candidate points Y at both ends.
From the base line L 4 to the reference line L 4 and the edge candidate point Y
It reflects the area of the part surrounded by the curve connecting the lines and the reference line L 4 . Here, the inspection window W
Depending on how 1 is set, there may be a plurality of edge candidate points Y on a straight line orthogonal to the reference line L 4 , but in that case, among the edge candidate points, pixels between the reference line L 4 and Use the one that maximizes the number.

【0042】以上のようにして求めた画素の総数B′を
規定の閾値MS′と比較し、B′>MS′が成立すれば
検査対象11の上で溶接部位12は正常な位置であると
判断できるのである。また、上記条件が成立しなけれ
ば、溶接部位12について不良であると判断するのであ
る。要するに、端子基準線L2 を設定する代わりに検査
ウインドウW1 の一辺を基準線L4 として用いた点が方
法2−1と相違する点であって、他の手順は方法2−1
と同様である。
The total number of pixels B'obtained as described above is compared with a prescribed threshold value MS ', and if B'> MS 'is established, the welded portion 12 is on the inspection object 11 at a normal position. You can judge. If the above conditions are not satisfied, the welded part 12 is determined to be defective. In short, the method is different from Method 2-1 in that one side of the inspection window W 1 is used as the reference line L 4 instead of setting the terminal reference line L 2 , and the other procedure is Method 2-1.
Is the same as.

【0043】以上の手順をまとめると、図22に示すよ
うになる。すなわち、検査ウインドウW1 の一辺を基準
線L4 として各エッジ候補点Yと基準線L4 との間の画
素数を求め(S1)、この画素数の総和B′を求める
(S2)。画素数の総和B′が規定のしきい値MS′よ
りも多い場合には、溶接部位12について良品と判断す
るのである(S3)。
The above procedure is summarized as shown in FIG. That is, the number of pixels between each edge candidate point Y and the reference line L 4 is obtained by using one side of the inspection window W 1 as the reference line L 4 (S1), and the sum B ′ of the number of pixels is obtained (S2). If the total B'of the number of pixels is larger than the prescribed threshold value MS ', the welded portion 12 is judged to be non-defective (S3).

【0044】方法2−1などのように端子点p1,p2
を求める場合には、端子基準線L2の位置が一定しない
から、同じ検査対象物11について検査を行なっても結
果にばらつきが生じることがあるが、検査対象物11に
対する検査ウインドウW1 の位置を一定にして本方法で
溶接部位12の位置の適否を判定すれば、結果が一定す
ることになり、溶接部位12の位置判定をより高い精度
で行なうことができるのである。
Terminal points p1 and p2 as in method 2-1
In the case of obtaining, the position of the terminal reference line L 2 is not constant, so even if the same inspection object 11 is inspected, the result may vary, but the position of the inspection window W 1 with respect to the inspection object 11 If the appropriateness of the position of the welded portion 12 is determined by this method with constant, the result will be constant, and the position determination of the welded portion 12 can be performed with higher accuracy.

【0045】(方法2−7)本方法は、図25に示すよ
うに、方法2−6と同様に検査対象物11に対して定位
置に設定した検査ウインドウW1 の規定の一辺を基準線
4 とし、、方法2−2と同様にエッジ候補点Yを連結
して溶接部エッジ線L3 を求め、求めた溶接部エッジ線
3 と基準線L4 との間の部分の面積C′を演算して求
め、求めた結果について方法2−1と同様に規定のしき
い値MS′と比較し、C′>MS′が成立したときに、
溶接部位12の位置が正常であると判定するのである。
また、この条件が成立しなければ不良と判定する。他の
手順については方法2−1と同様である。
(Method 2-7) In this method, as shown in FIG. 25, one side defined by the inspection window W 1 set at a fixed position with respect to the inspection object 11 is set as a reference line as in the method 2-6. L 4 and similarly by connecting edge candidate point Y and ,, method 2-2 obtains the weld edge line L 3, the area of the portion between the weld edge line L 3 and the reference line L 4 obtained C ′ Is calculated and compared, and the obtained result is compared with a prescribed threshold value MS ′ in the same manner as in method 2-1, and when C ′> MS ′ is satisfied,
The position of the welded portion 12 is determined to be normal.
Further, if this condition is not established, it is determined to be defective. Other procedures are the same as those in Method 2-1.

【0046】以上の手順をまとめると、図24に示すよ
うになる。すなわち、検査ウインドウW1 の一辺を基準
線L4 とし、エッジ候補点Yを連結した溶接部エッジ線
3と基準線L4 とに囲まれる部位の面積C′(画素数
でもよい)を求め(S1)、この面積C′が規定のしき
い値MS′よりも多い場合には、溶接部位12について
良品と判断するのである(S2)。
The above procedure is summarized as shown in FIG. That is, one side of the inspection window W 1 is set as the reference line L 4, and the area C ′ (may be the number of pixels) of the portion surrounded by the weld edge line L 3 connecting the edge candidate points Y and the reference line L 4 is obtained. (S1) If the area C'is larger than the prescribed threshold value MS ', the welded portion 12 is judged to be non-defective (S2).

【0047】 溶接強度の判定 (方法3−1)溶接強度の判定には、溶接部位12の光
沢を判定する。すなわち、溶接部位12にすが入って多
数の凹凸が形成されている場合には溶接部位12を照明
したときに表面で乱反射が生じるから、画像上では溶接
部位12が明るくなるという性質と、溶接部位12が良
好である場合には溶接部位12の表面が鏡面となって正
反射が生じるから、溶接部位12の一部が明るく他の部
分が暗くなるという性質とを利用する。
Judgment of Welding Strength (Method 3-1) To judge the welding strength, the gloss of the welded portion 12 is judged. That is, when a lot of unevenness is formed in the welded part 12 due to the inclusion of soot, diffuse reflection occurs on the surface when the welded part 12 is illuminated, so that the welded part 12 becomes bright on the image. When the portion 12 is good, the surface of the welded portion 12 becomes a mirror surface and specular reflection occurs, so that the property that part of the welded portion 12 is bright and the other portion is dark is used.

【0048】まず、溶接部位12を含む検査ウインドウ
1 を設定し、検査ウインドウW1の中の全画素の平均
光量(平均濃度)Eを測定する。この平均光量Eに対し
て、図28に示すように、規定のオフセット値Fを加算
することによって(E+F)、しきい値PSを設定す
る。溶接部位12の周囲では図27に示すように、正反
射部R1 と非正反射部R2 とが形成されるから、しきい
値PSは正反射部R1 からの反射光の成分を除去できる
ように設定される。すなわち、オフセット値Fは正反射
部R1 からの光量に対応するようにあらかじめ設定して
おく。このしきい値PSを用いて、図29に示すよう
に、正反射部R1 からの反射光の成分を除去する。すな
わち、原画像内に設定した検査ウインドウW1 の中の画
素からしきい値PSを越える光量に対応した画素を除去
する。残った画素について平均光量Gを求めた後、この
平均光量Gと規定のしきい値QSとを比較し、G>QS
が成立すれば、光沢が不足しているものと判断できるか
ら、溶接強度が不良であると判定する。
First, the inspection window W 1 including the welded portion 12 is set, and the average light amount (average density) E of all the pixels in the inspection window W 1 is measured. As shown in FIG. 28, the threshold value PS is set by adding a prescribed offset value F to this average light quantity E (E + F). As shown in FIG. 27, the regular reflection portion R 1 and the non-regular reflection portion R 2 are formed around the welded portion 12, so that the threshold value PS removes the component of the reflected light from the regular reflection portion R 1. It is set to be possible. That is, the offset value F is preset so as to correspond to the amount of light from the specular reflection portion R 1 . Using this threshold value PS, as shown in FIG. 29, the component of the reflected light from the specular reflection portion R 1 is removed. That is, the pixels corresponding to the light amount exceeding the threshold value PS are removed from the pixels in the inspection window W 1 set in the original image. After obtaining the average light intensity G for the remaining pixels, the average light intensity G is compared with a prescribed threshold value QS, and G> QS
If is satisfied, it can be determined that the gloss is insufficient, and thus the welding strength is determined to be poor.

【0049】要するに、図26に示すように、検査ウイ
ンドウW1 を設定した後(S1)、検査ウインドウW1
の中の平均光量(平均濃度)Eを求め(S2)、平均光
量Eにオフセット値Fを加算してしきい値PSを決定す
る(S3)。検査ウインドウW1 の中の画素からしきい
値PSよりも明るい画素を除去し(S4)、検査ウイン
ドウW1 の中で残った画素の平均光量(平均濃度)Gを
求める(S5)。この平均光量Gを規定のしきい値QS
と比較して、G>QSが成立すれば、光沢不良と判定す
るのである(S6)。
In short, as shown in FIG. 26, after setting the inspection window W 1 (S1), the inspection window W 1
The average light amount (average density) E of the above is calculated (S2), and the offset value F is added to the average light amount E to determine the threshold value PS (S3). From the pixels in the inspection windows W 1 to remove the pixels brighter than the threshold value PS (S4), obtaining an average light intensity (average density) G pixels remaining in the examining window W 1 (S5). This average light intensity G is defined as a threshold value QS
In comparison, if G> QS is established, it is determined that the gloss is poor (S6).

【0050】(方法3−2)本方法は、正反射部R1
存在していれば光沢について良品と判定する方法であ
る。すなわち、方法3−1と同様に、検査ウインドウW
1 を設定した後、平均光量Eを求め、この平均光量Eに
オフセット値Fを加算して、しきい値PSを設定する。
しきい値PSよりも明るい画素の個数Hを求め、画素の
個数Hが規定のしきい値RSよりも大きいとき、すなわ
ちH>RSのときに、溶接部位12には正反射部R1
存在していて光沢が良好であり、溶接強度についても良
品であると判定するのである。光沢不良の場合には、図
30のような関係になってしきい値PSよりも明るい画
素が存在しないか、存在しても少数であるから、光沢の
良否を容易に判定できる。
(Method 3-2) This method is a method of judging that the gloss is a good product if the specular reflection portion R 1 is present. That is, like the method 3-1, the inspection window W
After setting 1 , the average light quantity E is obtained, and the offset value F is added to this average light quantity E to set the threshold value PS.
The number H of pixels brighter than the threshold value PS is determined, and when the number H of pixels is larger than a prescribed threshold value RS, that is, when H> RS, the specular reflection portion R 1 exists in the welded portion 12. Therefore, the gloss is good, and the welding strength is also judged to be a good product. In the case of poor gloss, the relationship shown in FIG. 30 is established, and there are no pixels brighter than the threshold value PS, or even if there are a few pixels, it is possible to easily determine whether the gloss is good or bad.

【0051】(方法3−3)本方法では、マスクを用い
て探索方向を決定し、しきい値PSよりも明るい画素を
順次追跡し、そのような画素が探索方向について連続し
て存在しているか否かを判定するものである。すなわ
ち、方法2−3の技術を導入することによって、明るさ
の条件を満たす画素について連続性についても判定する
ことになり、方法3−2に比較して一層正確に光沢の良
否を判定するものである。他の点については方法3−2
と同様である。
(Method 3-3) In this method, a search direction is determined using a mask, pixels brighter than the threshold value PS are sequentially tracked, and such pixels are continuously present in the search direction. It is to determine whether or not there is. That is, by introducing the technique of Method 2-3, it is also possible to determine the continuity of pixels satisfying the condition of brightness, and to determine the quality of gloss more accurately as compared with Method 3-2. Is. Method 3-2 for other points
Is the same as.

【0052】(方法3−4)方法3−1ないし方法3−
3の技術では、検査対象物11に対して照明光を導入す
る方法が重要な要素になる。そこで、本方法は照明光に
ついて、画像入力装置1に対して正反射光を導入するこ
とができる第1の照明と、拡散反射光を導入する第2の
照明とを切り換えて用いるようにしている。両照明を切
り換えて用いることによって、反射光の性質を加味して
光沢の良否判定ができるのであり、一層正確な判定が可
能になる。他の点は方法3−1ないし方法3−3の技術
と同様である。
(Method 3-4) Method 3-1 to Method 3-
In the technique of No. 3, the method of introducing the illumination light to the inspection object 11 is an important element. Therefore, in the present method, the illumination light is switched between the first illumination capable of introducing the specular reflected light and the second illumination capable of introducing the diffuse reflected light to the image input device 1. . By switching between the two illuminations, the quality of the gloss can be determined in consideration of the property of the reflected light, and a more accurate determination can be performed. The other points are the same as those of the methods 3-1 to 3-3.

【0053】上述した各過程によって、溶接部位12の
存否、溶接部位12の位置の適否、溶接部位12の強度
についての判定を行うことができるのであり、これらの
判定結果を溶接作業にフィードバックすることによっ
て、溶接の品質を向上させることができる。すなわち、
各過程により不良と判定されたときに、不良について種
類別の発生率等を求めることによって、溶接状態の総合
的な評価を行う。たとえば、溶接部位12が存在しない
という不良が多発していれば、溶接装置に異常が存在す
る可能性が高いから、溶接装置の点検を指示する報知を
行う。また、溶接部位12の位置に関する不良が多発し
ていれば、溶接部位12の位置を修正するように指示す
ればよい。このように、上述した良否判定の結果を用い
て溶接条件や溶接装置の動作にフィードバックすれば、
溶接を行った製品の歩留りを向上させることができるの
である。
By the above-mentioned processes, it is possible to judge the presence or absence of the welded portion 12, the appropriateness of the position of the welded portion 12, and the strength of the welded portion 12, and the results of these determinations should be fed back to the welding operation. By this, the quality of welding can be improved. That is,
When a defect is determined in each process, a comprehensive evaluation of the welding state is performed by determining the occurrence rate of each defect for each type. For example, if there are a lot of defects that the welding part 12 does not exist, there is a high possibility that there is an abnormality in the welding device, so a notification is issued to instruct inspection of the welding device. Further, if there are many defects relating to the position of the welded portion 12, it may be instructed to correct the position of the welded portion 12. In this way, by feeding back to the welding conditions and the operation of the welding device using the result of the quality judgment described above,
The yield of welded products can be improved.

【0054】[0054]

【発明の効果】本発明は上述したように、、溶接部位の
有無を検出する過程と、溶接部位が検査対象物の所要位
置に位置するか否かを判定する過程と、溶接部位の光沢
に基づいて溶接強度を判定する過程とを有しているの
で、溶接部位について総合的な判定を行うことができ、
溶接に関して的確な良否判定が行えるという利点があ
る。その結果、溶接装置の動作の管理や溶接位置の補正
を行うことが可能になり、溶接部位を有した製品の品質
向上、すなわち歩留りの向上につながるという利点を有
する。
As described above, according to the present invention, the process of detecting the presence / absence of a welded part, the process of determining whether or not the welded part is located at a required position of the inspection object, and the gloss of the welded part are determined. Since it has a process of judging the welding strength based on, it is possible to make a comprehensive judgment on the welded part,
There is an advantage that an accurate pass / fail judgment can be made regarding welding. As a result, it becomes possible to manage the operation of the welding apparatus and correct the welding position, which has the advantage of improving the quality of the product having the welded portion, that is, improving the yield.

【図面の簡単な説明】[Brief description of drawings]

【図1】方法1−1の手順を示す説明図である。FIG. 1 is an explanatory diagram showing a procedure of method 1-1.

【図2】方法1−1の検査対象物の例を示す図である。FIG. 2 is a diagram showing an example of an inspection object of Method 1-1.

【図3】方法1−1の走査ラインとエッジフラグとの関
係を示す図である。
FIG. 3 is a diagram showing a relationship between scan lines and edge flags in method 1-1.

【図4】方法1−1における探索ウインドウの概念を説
明する図である。
FIG. 4 is a diagram illustrating the concept of a search window in method 1-1.

【図5】方法1−1における探索ウインドウの連結の概
念を説明する図である。
FIG. 5 is a diagram illustrating a concept of connecting search windows in method 1-1.

【図6】実施例に用いる処理回路のブロック図である。FIG. 6 is a block diagram of a processing circuit used in the embodiment.

【図7】実施例における局所並列ウインドウの概念を示
し、(a)は画像内での位置、(b)は局所並列ウイン
ドウの画素の構成を示す図である。
FIG. 7 is a diagram showing a concept of a local parallel window in the embodiment, (a) is a position in an image, and (b) is a diagram showing a pixel configuration of the local parallel window.

【図8】実施例における微分画像の概念を示す図であ
る。
FIG. 8 is a diagram showing a concept of a differential image in the embodiment.

【図9】実施例において微分画像からエッジ画像を得る
処理の説明図である。
FIG. 9 is an explanatory diagram of a process of obtaining an edge image from a differential image in the embodiment.

【図10】実施例における原画像、微分画像、微分方向
画像、エッジ画像の関係を示す図である。
FIG. 10 is a diagram showing a relationship among an original image, a differential image, a differential direction image, and an edge image in the example.

【図11】方法1−2に用いる方向探索ウインドウを説
明する図である。
FIG. 11 is a diagram illustrating a direction search window used in method 1-2.

【図12】方法1−2における微分方向値の設定例を示
す図である。
FIG. 12 is a diagram showing an example of setting a differential direction value in method 1-2.

【図13】方法2−1の手順を示す説明図である。FIG. 13 is an explanatory diagram showing a procedure of method 2-1.

【図14】方法2−1の概念を示す図である。FIG. 14 is a diagram showing a concept of Method 2-1.

【図15】方法2−1で判断基準についての概念を示す
図である。
FIG. 15 is a diagram showing the concept of a criterion in Method 2-1.

【図16】方法2−2での判断基準についての概念を示
す図である。
FIG. 16 is a diagram showing the concept of a criterion in Method 2-2.

【図17】方法2−3の概念を示す図である。FIG. 17 is a diagram showing a concept of Method 2-3.

【図18】方法2−3で用いる連結性確認ウインドウの
説明図である。
FIG. 18 is an explanatory diagram of a connectivity confirmation window used in method 2-3.

【図19】方法2−4の手順を示す説明図である。FIG. 19 is an explanatory diagram showing a procedure of method 2-4.

【図20】方法2−4の概念を示す図である。FIG. 20 is a diagram showing the concept of Method 2-4.

【図21】方法2−4の判定例を示す図である。FIG. 21 is a diagram showing a determination example of method 2-4.

【図22】方法2−6の手順を示す説明図である。FIG. 22 is an explanatory diagram showing the procedure of method 2-6.

【図23】方法2−6の概念を示す図である。FIG. 23 is a diagram showing the concept of Method 2-6.

【図24】方法2−7の手順を示す説明図である。FIG. 24 is an explanatory diagram showing the procedure of method 2-7.

【図25】方法2−7の概念を示す図である。FIG. 25 is a diagram showing the concept of method 2-7.

【図26】方法3−1の手順を示す説明図である。FIG. 26 is an explanatory diagram showing the procedure of method 3-1.

【図27】方法3−1の原理を説明する図である。FIG. 27 is a diagram illustrating the principle of method 3-1.

【図28】方法3−1での平均光量としきい値との関係
を示す図である。
FIG. 28 is a diagram showing a relationship between an average light amount and a threshold value in method 3-1.

【図29】方法3−1による良品に対する処理結果を示
す図である。
FIG. 29 is a diagram showing a result of processing a non-defective product by the method 3-1.

【図30】方法3−2による不良品に対する処理結果を
示す図である。
FIG. 30 is a diagram showing a processing result of a defective product by the method 3-2.

【符号の説明】[Explanation of symbols]

1 画像入力装置 2 アナログ−ディジタル変換部 3 前処理部 4 原画像メモリ 5 微分画像メモリ 6 微分方向画像メモリ 7 エッジ画像メモリ 8 演算処理部 1 Image Input Device 2 Analog-Digital Converter 3 Pre-Processing Unit 4 Original Image Memory 5 Differential Image Memory 6 Differential Direction Image Memory 7 Edge Image Memory 8 Arithmetic Processing Unit

Claims (15)

【特許請求の範囲】[Claims] 【請求項1】 溶接部位を有する検査対象物に対して溶
接部位と溶接部位の周部との照度に差が生じるように光
を照射した状態で溶接部位を含む領域を撮像し、撮像さ
れた画像に対して画像処理を施すことによって溶接部の
外観による溶接状態の評価を行う溶接部外観検査方法に
おいて、溶接部位の有無を検出する過程と、溶接部位が
検査対象物の所要位置に位置するか否かを判定する過程
と、溶接部位の光沢に基づいて溶接強度を判定する過程
とを有することを特徴とする溶接部外観検査方法。
1. A region including a welded portion is imaged by irradiating light on an inspection object having the welded portion so that a difference in illuminance occurs between the welded portion and a peripheral portion of the welded portion. In the weld appearance inspection method, which evaluates the welding state by the appearance of the weld by performing image processing on the image, the process of detecting the presence or absence of a weld and the weld is located at the required position of the inspection object. A welded portion appearance inspection method, comprising: a step of determining whether or not it is, and a step of determining welding strength based on the gloss of a welded portion.
【請求項2】 濃淡画像である原画像に基づいて、隣接
画素との濃度の変化率に相当する微分値を各画素の値と
した微分画像と、隣接画素との濃度の変化方向に対応す
る微分方向値を各画素の値とした微分方向画像とを作成
し、複数画素を含む検査ウインドウを画像内に設定し、
検査ウインドウ内の画素を走査ラインを移動させて走査
して各画素の微分値と微分方向値との少なくとも一方に
基づいて溶接部位のエッジとみなされるエッジ候補点を
求め、次に、隣接するエッジ候補点を微分値と微分方向
値との少なくとも一方に基づいて順次求め、エッジ候補
点の個数が規定のしきい値を越えるときには検査ウイン
ドウ内に溶接部位が存在すると判定することを特徴とす
る請求項1記載の溶接部外観検査方法。
2. A differential image in which the value of each pixel is a differential value corresponding to the rate of change in density with respect to an adjacent pixel, based on an original image which is a grayscale image, and the direction of change in density between adjacent pixels. Create a differential direction image with the differential direction value as the value of each pixel, set an inspection window containing multiple pixels in the image,
The scanning line is moved to scan the pixels in the inspection window to find edge candidate points considered to be the edges of the welded portion based on at least one of the differential value and the differential direction value of each pixel, and then the adjacent edge A candidate point is sequentially obtained based on at least one of a differential value and a differential direction value, and when the number of edge candidate points exceeds a prescribed threshold value, it is determined that a welding site exists in the inspection window. Item 1. A welded part appearance inspection method according to Item 1.
【請求項3】 検査ウインドウ内にさらに方向探索ウイ
ンドウを設定し、方向探索ウインドウ内の画素を走査し
て各画素の微分値が規定のしきい値以上である画素につ
いて微分方向値の度数分布を求め、度数の多い方向に沿
って走査ラインを設定し、度数の少ない方向を走査ライ
ンの移動方向とすることを特徴とする請求項2記載の溶
接部外観検査方法。
3. A direction search window is further set in the inspection window, pixels in the direction search window are scanned, and a frequency distribution of differential direction values is calculated for pixels whose differential value is greater than or equal to a specified threshold value. 3. The method for inspecting the appearance of a welded part according to claim 2, wherein the scanning line is set along the direction of high frequency and the direction of low frequency is set as the moving direction of the scanning line.
【請求項4】 溶接された一方の部材のエッジとなる端
子基準線を設定し、請求項2の方法により求めた各エッ
ジ候補点と端子基準線との間の画素の総数を求め、この
総数を規定のしきい値と比較することによって溶接部位
の位置の適否を判定することを特徴とする溶接部外観検
査方法。
4. A terminal reference line which is an edge of one of the welded members is set, and the total number of pixels between each edge candidate point and the terminal reference line obtained by the method of claim 2 is obtained, and this total number is obtained. The weld appearance inspection method is characterized in that the suitability of the position of the welded portion is determined by comparing with the prescribed threshold value.
【請求項5】 溶接された一方の部材のエッジとなる端
子基準線を設定し、請求項2の方法により求めたエッジ
候補点を連続させた溶接部エッジ線と端子基準線との間
の面積を求め、この面積を規定のしきい値と比較するこ
とによって溶接部位の位置の適否を判定することを特徴
とする溶接部外観検査方法。
5. An area between a welded edge line and a terminal reference line in which a terminal reference line serving as an edge of one welded member is set and edge candidate points obtained by the method of claim 2 are continuous. And the suitability of the position of the welded portion is determined by comparing this area with a prescribed threshold value.
【請求項6】 検査ウインドウ内での走査によって各画
素の微分値と微分方向値との少なくとも一方に基づい
て、溶接された一方の部材のエッジ上の画素を求め、同
条件を満たす画素が規定個数以上連続して存在するとき
に、連続した画素を端子基準線とすることを特徴とする
請求項4または請求項5記載の溶接部外観検査方法。
6. A pixel on the edge of one welded member is obtained based on at least one of a differential value and a differential direction value of each pixel by scanning in an inspection window, and a pixel satisfying the same condition is defined. The welded portion appearance inspection method according to claim 4 or 5, wherein when the number of consecutive pixels is equal to or more than one, the consecutive pixels are used as the terminal reference line.
【請求項7】 規定の探索開始点から始めて溶接された
一方の部材のエッジに略直交する方向に走査し、走査し
た線上での画素の濃度の増減の傾向に基づいて濃度に対
するしきい値を設定し、走査した線上でしきい値に対し
て濃度の高低が反転した画素を端子点とし、同手順で求
めた2個の端子点を通る直線を端子基準線とすることを
特徴とする請求項4または請求項5記載の溶接部外観検
査方法。
7. A threshold value for density is set based on a tendency of increase or decrease in density of pixels on a scanned line by scanning in a direction substantially orthogonal to an edge of one member welded starting from a prescribed search start point. It is characterized in that a pixel whose density level is inverted with respect to a threshold value on a line set and scanned is used as a terminal point and a straight line passing through the two terminal points obtained by the same procedure is used as a terminal reference line. Item 4. The method for inspecting the appearance of a welded part according to claim 4 or claim 5.
【請求項8】 請求項7の溶接部外観検査方法におい
て、探索開始点から始めて走査した線上に端子点が存在
しないときに、走査方向に対して直交する方向に所定画
素分ずらした新たな探索開始点を設定し、この探索開始
点に対して端子点を求めることを特徴とする溶接部外観
検査方法。
8. The welded portion appearance inspection method according to claim 7, wherein when there is no terminal point on a line scanned from the search start point, a new search is performed by shifting a predetermined pixel in a direction orthogonal to the scanning direction. A method for inspecting the appearance of a weld, which sets a starting point and obtains a terminal point with respect to this search starting point.
【請求項9】 請求項2の方法により求めた各エッジ候
補点と検査対象物に対して定位置に設定した検査ウイン
ドウの規定の一辺との間の画素の総数を求め、この総数
を規定のしきい値と比較することによって溶接部位の位
置の適否を判定することを特徴とする溶接部外観検査方
法。
9. The total number of pixels between each edge candidate point obtained by the method of claim 2 and a prescribed side of an inspection window set at a fixed position with respect to the inspection object, and the total number is defined. A method for inspecting the appearance of a weld, characterized by determining the suitability of the position of the welded portion by comparing with a threshold value.
【請求項10】 請求項2の方法により求めた各エッジ
候補点を連結した溶接部エッジ線と検査対象物に対して
定位置に設定した検査ウインドウの規定の一辺との間の
面積を求め、この面積を規定のしきい値と比較すること
によって溶接部位の位置の適否を判定することを特徴と
する溶接部外観検査方法。
10. An area between a weld edge line connecting each edge candidate point obtained by the method of claim 2 and a prescribed side of an inspection window set at a fixed position with respect to an inspection object, A weld appearance inspection method characterized by determining the suitability of the position of a welded portion by comparing this area with a prescribed threshold value.
【請求項11】 濃淡画像である原画像に溶接部位を含
むように設定した検査ウインドウ内で各画素に対応した
受光光量を求め、検査ウインドウ内の全画素の平均光量
に規定のオフセット値を加算したしきい値よりも受光光
量の少ない画素について平均光量を求め、この平均光量
が規定のしきい値よりも大きいときには光沢不足であっ
て溶接強度が不良と判定することを特徴とする請求項1
記載の溶接部外観検査方法。
11. A received light amount corresponding to each pixel is obtained within an inspection window which is set so as to include a welded portion in an original image which is a grayscale image, and a prescribed offset value is added to the average light amount of all pixels within the inspection window. The average light amount is obtained for pixels whose received light amount is smaller than the threshold value, and when the average light amount is larger than a prescribed threshold value, it is determined that the gloss is insufficient and the welding strength is poor.
The weld appearance inspection method described.
【請求項12】 濃淡画像である原画像に溶接部位を含
むように設定した検査ウインドウ内で各画素に対応した
受光光量を求め、検査ウインドウ内の全画素の平均光量
に規定のオフセット値を加算したしきい値よりも受光光
量の多い画素の総数が規定のしきい値よりも大きいとき
には溶接強度について良品と判定することを特徴とする
請求項1記載の溶接部外観検査方法。
12. The amount of received light corresponding to each pixel is determined within an inspection window which is set so as to include a welding portion in an original image which is a grayscale image, and a prescribed offset value is added to the average amount of light of all the pixels within the inspection window. 2. The weld appearance inspection method according to claim 1, wherein when the total number of pixels whose received light amount is larger than the threshold value is larger than the specified threshold value, the weld strength is judged to be good.
【請求項13】 濃淡画像である原画像に溶接部位を含
むように探索方向を規定するマスクを設定し、受光光量
がしきい値以上である画素が探索方向について規定個数
以上連続して存在するときに溶接強度について良品と判
定することを特徴とする請求項1記載の溶接部外観検査
方法。
13. A mask for defining a search direction is set so as to include a welding part in an original image which is a grayscale image, and pixels having a received light amount equal to or larger than a threshold value are continuously present in a specified number or more in the search direction. The weld appearance inspection method according to claim 1, wherein the weld strength is determined to be good.
【請求項14】 正反射光が撮像される光源と、拡散反
射光が撮像される光源とを異なるタイミングで点灯さ
せ、各光源からの光に基づいて溶接部位の光沢の良否を
判定することを特徴とする請求項11ないし請求項13
のいずれかに記載の溶接部外観検査方法。
14. A light source for which specular reflection light is imaged and a light source for which diffuse reflection light is imaged are turned on at different timings, and the quality of the gloss of the welded part is determined based on the light from each light source. Claim 11 thru | or Claim 13 characterized by the above-mentioned.
The visual inspection method for welded parts according to any one of 1.
【請求項15】 溶接部位の有無の判定結果と、溶接部
位の位置の適否の判定結果と、溶接部位の光沢に基づく
溶接強度の判定結果との少なくともいずれかを用いて溶
接装置の動作の修正、溶接位置の補正を行うことを特徴
とする請求項1記載の溶接部外観検査方法。
15. The operation of the welding apparatus is corrected by using at least one of a determination result of presence / absence of a welding site, a determination result of suitability of a position of the welding site, and a determination result of welding strength based on gloss of the welding site. The welding portion appearance inspection method according to claim 1, wherein the welding position is corrected.
JP1677994A 1993-06-25 1994-02-10 Weld appearance inspection method Expired - Lifetime JP2758823B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1677994A JP2758823B2 (en) 1993-06-25 1994-02-10 Weld appearance inspection method

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP5-155773 1993-06-25
JP15577393 1993-06-25
JP1677994A JP2758823B2 (en) 1993-06-25 1994-02-10 Weld appearance inspection method

Publications (2)

Publication Number Publication Date
JPH0772098A true JPH0772098A (en) 1995-03-17
JP2758823B2 JP2758823B2 (en) 1998-05-28

Family

ID=26353176

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1677994A Expired - Lifetime JP2758823B2 (en) 1993-06-25 1994-02-10 Weld appearance inspection method

Country Status (1)

Country Link
JP (1) JP2758823B2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007155578A (en) * 2005-12-07 2007-06-21 Omron Corp Welding quality inspection device, welding quality inspection method, and program
JP2008026186A (en) * 2006-07-21 2008-02-07 Matsushita Electric Works Ltd Method and apparatus for detecting gaps by image processing
JP2009156613A (en) * 2007-12-25 2009-07-16 Mitsutoyo Corp Optical displacement measuring instrument
JP2010054246A (en) * 2008-08-26 2010-03-11 Panasonic Electric Works Co Ltd Method for detecting joint and method for inspecting external appearance of joint using the method
WO2010044473A1 (en) * 2008-10-17 2010-04-22 日本軽金属株式会社 Joining quality management method and joining quality management apparatus
JP2014059229A (en) * 2012-09-18 2014-04-03 Dainippon Printing Co Ltd Inspection device, inspection method, and inspection program

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007155578A (en) * 2005-12-07 2007-06-21 Omron Corp Welding quality inspection device, welding quality inspection method, and program
JP2008026186A (en) * 2006-07-21 2008-02-07 Matsushita Electric Works Ltd Method and apparatus for detecting gaps by image processing
JP2009156613A (en) * 2007-12-25 2009-07-16 Mitsutoyo Corp Optical displacement measuring instrument
JP2010054246A (en) * 2008-08-26 2010-03-11 Panasonic Electric Works Co Ltd Method for detecting joint and method for inspecting external appearance of joint using the method
WO2010044473A1 (en) * 2008-10-17 2010-04-22 日本軽金属株式会社 Joining quality management method and joining quality management apparatus
CN102171552A (en) * 2008-10-17 2011-08-31 日本轻金属株式会社 Joining quality management method and joining quality management apparatus
JP5357891B2 (en) * 2008-10-17 2013-12-04 日本軽金属株式会社 Bonding quality control method
JP2014059229A (en) * 2012-09-18 2014-04-03 Dainippon Printing Co Ltd Inspection device, inspection method, and inspection program

Also Published As

Publication number Publication date
JP2758823B2 (en) 1998-05-28

Similar Documents

Publication Publication Date Title
US9075026B2 (en) Defect inspection device and defect inspection method
KR100759950B1 (en) Device and method for inspection external appearance
US20050002560A1 (en) Defect inspection apparatus
JPH0772098A (en) Visual inspection of welded part
JP2000163579A (en) Appearance inspection method and device
JP3890844B2 (en) Appearance inspection method
JP4743231B2 (en) Appearance inspection method and appearance inspection apparatus
JP4293653B2 (en) Appearance inspection method
JP2002243655A (en) Method and equipment for visual inspection of electronic component
JP3508518B2 (en) Appearance inspection method
JPH03175343A (en) Method for extracting flaw by inspection appearance
JP2010054246A (en) Method for detecting joint and method for inspecting external appearance of joint using the method
JPH0718811B2 (en) Defect inspection method
JP2745778B2 (en) Wiring pattern inspection equipment
JP2686053B2 (en) Defect inspection method by visual inspection
JP4178923B2 (en) Appearance inspection method and appearance inspection apparatus
JPH0554107A (en) Welding state judging method with appearance inspection
JPH109835A (en) Surface flaw inspection apparatus
JP3494006B2 (en) Appearance inspection method
JP2710685B2 (en) Defect detection method by visual inspection
JP2008233106A (en) Visual examination method and visual examination device
JPH02187651A (en) Image processing method
JP3189604B2 (en) Inspection method and device
JP3038092B2 (en) Appearance inspection method
JP3391163B2 (en) Circular container inner surface inspection device

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19980224

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

Free format text: PAYMENT UNTIL: 20080313

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20090313

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20090313

Year of fee payment: 11

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

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

Free format text: PAYMENT UNTIL: 20090313

Year of fee payment: 11

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20100313

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20100313

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20110313

Year of fee payment: 13

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

Free format text: PAYMENT UNTIL: 20120313

Year of fee payment: 14

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

Free format text: PAYMENT UNTIL: 20120313

Year of fee payment: 14

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

Free format text: PAYMENT UNTIL: 20130313

Year of fee payment: 15

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

Free format text: PAYMENT UNTIL: 20130313

Year of fee payment: 15

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

Free format text: PAYMENT UNTIL: 20140313

Year of fee payment: 16

EXPY Cancellation because of completion of term