JPH0668257A - Detecting method for edge of object in image and detecting method for distance between edges - Google Patents

Detecting method for edge of object in image and detecting method for distance between edges

Info

Publication number
JPH0668257A
JPH0668257A JP4217743A JP21774392A JPH0668257A JP H0668257 A JPH0668257 A JP H0668257A JP 4217743 A JP4217743 A JP 4217743A JP 21774392 A JP21774392 A JP 21774392A JP H0668257 A JPH0668257 A JP H0668257A
Authority
JP
Japan
Prior art keywords
edge
image
distance
curve
size
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.)
Pending
Application number
JP4217743A
Other languages
Japanese (ja)
Inventor
Takehiro Yazaki
雄大 矢崎
Kenji Suzuki
健司 鈴木
Shigesato Adachi
茂聡 足立
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.)
JFE Steel Corp
Original Assignee
Kawasaki Steel Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kawasaki Steel Corp filed Critical Kawasaki Steel Corp
Priority to JP4217743A priority Critical patent/JPH0668257A/en
Publication of JPH0668257A publication Critical patent/JPH0668257A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

PURPOSE:To enable the sure detection of an edge by performing a cumulative addition of the density value of a picture element around an edge in a direction being orthogonally crossed with the edge, determining a curve having a cumulative value as a value along a coordinate axis and defining the feature point of this curve as an edge location. CONSTITUTION:In the image of a printed board 12 obtained by a camera 20, when the edge 24A of a land 24 is detected within a cumulative addition area, the location of an edge is hidden behind noise when the density value of each picture element in each picture element column and the location of the picture element column are expressed by a vertical axis and a lateral axis, respectively if the edge is noticed for every picture element column parallel to an X-axis. In an image processor 22, noise cancels with each other because noise generates at random as density differential value is integrated vertically to an X-axis, but the edge 24A of the land 24 exists on the same location on the X-axis and is emphasized, and a curve can be obtained. By determining the feature points of this curve such as a minimum value, a maximum changed point, etc., as an edge, the detection of the edge becomes possible.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、イメージセンサ等に
より得た画像を処理して、画像中の物体のエッジ及びエ
ッジ間距離を検出する方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method of processing an image obtained by an image sensor or the like to detect edges of an object in the image and a distance between the edges.

【0002】[0002]

【従来の技術】画像処理の過程で、得られたデジタル画
像に基づいてエッジを検出する方法としては、画像の濃
度等の特徴が急激に変化する位置を探し出す方法が一般
的であり、例えば、田村秀行著「コンピュータ画像処理
入門」昭和60年3月10日総研出版発行、第5章、1
19〜122頁に記載されるような、近傍画素領域内の
濃度の和や平均値の差を用いてエッジを検出するものが
ある。
2. Description of the Related Art As a method of detecting an edge based on an obtained digital image in the process of image processing, a method of searching for a position where a characteristic such as density of the image changes rapidly is common. Hideyuki Tamura, "Introduction to Computer Image Processing," March 10, 1960, published by Soken Shuppan, Chapter 5, 1.
Some of them, as described on pages 19 to 122, detect an edge by using the sum of densities in a neighboring pixel region or the difference of average values.

【0003】更に、例えば特開昭62−202290号
公報に開示されるように、画像の明るさの差によって重
み付けした荷重平均によって、明るさの変化が最大とな
る位置をエッジとして求めるようにしたものがある。
Further, as disclosed in, for example, Japanese Unexamined Patent Publication No. 62-202290, the position where the change in brightness is maximum is determined as an edge by weighted averaging weighted by the difference in image brightness. There is something.

【0004】又、相対位置情報を用いて目的とする画像
中でのエッジを検出するものがある。例えば特開平4−
47467号公報に開示されるように、集積回路内の両
端リードの先端位置座標を用いて中間リードの先端の存
在必然位置を算出し、存在必然領域の近傍のみを探索し
て中間リード先端位置を算出するものがある。又、特開
平2−116908号公報に開示されるものは、処理速
度を速くするため、相対位置情報を利用して探索範囲を
狭くしている。
There is also a method of detecting an edge in a target image by using relative position information. For example, JP-A-4-
As disclosed in Japanese Patent No. 47467, the inevitable position of the tip of the intermediate lead is calculated using the tip position coordinates of both ends of the lead in the integrated circuit, and only the vicinity of the inevitable area is searched to determine the tip position of the intermediate lead. There is something to calculate. Further, the one disclosed in Japanese Patent Laid-Open No. 2-116908 uses the relative position information to narrow the search range in order to increase the processing speed.

【0005】画像での目標点間距離を検出する方法とし
ては、例えば特開昭60−263804号公報に開示さ
れるように、長さが既知の部分を計測して補正係数を求
め、目標点間部分のキャリブレーションを行う方法があ
る。これは図7に示されるように、長さが既知のマーク
Mの実際の長さLs と画像処理によって計測されたl s
により、補正係数αを、α=Ls /l s として求め、目
標点AB間部分の長さLを画像処理により求めた長さl
とαを用いて、式L=α×l により求めるようにしてい
る。図7の符号1は物体、2はその画像、3はカメラを
示す。
As a method for detecting the distance between target points in an image
Are disclosed in, for example, JP-A-60-263804.
As shown in the figure, measure the part of known length and obtain the correction coefficient.
Therefore, there is a method to calibrate the area between target points.
It This is a mark of known length, as shown in Figure 7.
Actual length of M LsAnd measured by image processing s
The correction coefficient α by α = Ls/ LsAsking for, eyes
The length l obtained by image processing of the length L between the reference points AB
And α are used to obtain by the formula L = α × l
It In FIG. 7, reference numeral 1 is an object, 2 is an image thereof, and 3 is a camera.
Show.

【0006】[0006]

【発明が解決しようとする課題】上記「コンピュータ画
像処理入門」に記載されたエッジ検出方法では、小領域
内で、エッジによる濃度変化が、ノイズによる濃度変化
と比べて急激なときには適用できるが、同程度の場合は
ノイズに埋もれてしまい適用できないという問題点があ
る。
The edge detection method described in the "Introduction to Computer Image Processing" can be applied when the density change due to the edge is sharper than the density change due to the noise in the small area. In the case of the same level, there is a problem that it is buried in noise and cannot be applied.

【0007】更に、前記特開昭62−202290号公
報に開示される方法は、荷重平均をとる際の範囲の設定
方法が開示されていないため、設定を誤った場合に間違
ったエッジ位置を検出してしまうという問題点がある。
Further, the method disclosed in Japanese Patent Laid-Open No. 62-202290 does not disclose a method of setting the range when the weighted average is taken. Therefore, when the setting is erroneous, the wrong edge position is detected. There is a problem that it does.

【0008】又、前記特開平4−47467や特開平2
−116908号公報に開示されるものは、存在必然領
域内に同様な特徴を持った他のエッジが存在せず、各エ
ッジ間の区別が明確な場合には適用できるが、類似した
特徴を持ったエッジが複数存在して、各エッジの区別が
困難な場合は、存在必然領域の設定方法が考慮されてい
ないため、適用できないという問題点がある。
Further, the above-mentioned Japanese Patent Laid-Open Nos. 4-47467 and 2
The one disclosed in Japanese Patent Laid-Open No. 116908 can be applied when other edges having similar features do not exist in the inevitable existence region and the distinction between the edges is clear, but they have similar features. If there are a plurality of edges and it is difficult to distinguish each edge, there is a problem in that it cannot be applied because the method of setting the existence-necessary area is not taken into consideration.

【0009】更に又、前記特開昭60−263804号
公報に開示される方法は、既知のマークMから求めた補
正係数を目標点にそのまま適用するために、補正係数α
を求める際に用いるマークからカメラ(イメージセン
サ)までの距離と、目標点からカメラまでの距離が等し
い場合にのみ適用でき、マークの設定が非常に困難であ
るという問題点がある。
Furthermore, in the method disclosed in the above-mentioned Japanese Patent Laid-Open No. 60-263804, since the correction coefficient obtained from the known mark M is directly applied to the target point, the correction coefficient α
This is applicable only when the distance from the mark used to obtain the distance to the camera (image sensor) is equal to the distance from the target point to the camera, and there is a problem in that it is very difficult to set the mark.

【0010】第1発明は、上記従来の問題点に鑑みてな
されたものであって、画像において、エッジによる濃度
変化に乏しく、ノイズとの区別が困難な場合でもエッジ
を検出することができる画像中の物体のエッジ検出方法
を提供することを目的とする。
The first aspect of the present invention has been made in view of the above-mentioned problems of the prior art. In an image, an edge can be detected even when the density change due to the edge is poor and it is difficult to distinguish it from noise. An object of the present invention is to provide an edge detection method for an object inside.

【0011】又、第2発明は、画像中での、エッジ存在
必然領域内に似たような特徴の複数のエッジが存在して
も目的のエッジを確実に検出することができる画像中の
物体のエッジ検出方法を提供することを目的とする。
The second aspect of the present invention is an object in an image for which a target edge can be surely detected even if there are a plurality of edges having similar characteristics in the area where the edges are necessarily present in the image. It is an object of the present invention to provide an edge detection method of

【0012】又、第3発明は、エッジ間距離検出に際し
て、参照物からカメラまでの距離と目標エッジ間部分か
らカメラまでの距離が異なる場合でも、容易にエッジ間
距離を検出することができる画像中の物体のエッジ間距
離検出方法を提供することを目的とする。
Further, according to the third aspect of the present invention, when the distance between edges is detected, even if the distance from the reference object to the camera and the distance from the target edge portion to the camera are different, the image can easily detect the edge distance. An object is to provide a method for detecting a distance between edges of an inside object.

【0013】[0013]

【課題を解決するための手段】第1発明は、直線状のエ
ッジを有する物体の画像における該エッジ周辺の画素の
濃度値をエッジと直交する方向に累積加算し、画像中の
エッジと直交する方向の座標軸に沿って前記累積値を値
とする曲線を求め、この曲線の特徴点をエッジ位置とし
て求めることを特徴とする画像中の物体のエッジ検出方
法により上記目的を達成するものである。
According to a first aspect of the present invention, the density values of pixels around an edge of an object having a linear edge are cumulatively added in a direction orthogonal to the edge and are orthogonal to the edge in the image. The above object is achieved by a method for detecting an edge of an object in an image, which is characterized in that a curve having the cumulative value as a value is obtained along a coordinate axis of a direction, and a characteristic point of the curve is obtained as an edge position.

【0014】又、前記特徴点近傍の前記累積値の3点を
通る近似曲線を求め、この曲線の頂点をエッジ位置とす
るようにしてもよい。
It is also possible to obtain an approximate curve passing through the three points of the accumulated value near the characteristic point and set the apex of this curve as the edge position.

【0015】第2発明は、物体の画像中の特徴点の位置
を検出する過程と、この特徴点からの相対位置が予め判
っているエッジの相対位置情報から、該エッジの探索範
囲の位置及び大きさを、該エッジ以外のエッジが入らな
いように設定する過程と、この探索範囲内の画像データ
の処理により該エッジを検出する過程と、この求められ
たエッジ位置からの相対位置情報を用いて、他のエッジ
の探索範囲の位置及び大きさを決定する過程と、この探
索範囲内の画像データの処理により該他のエッジを検出
する過程と、を有してなり、前記エッジの探索範囲の位
置及び大きさ決定、検出の過程を繰返し、最終的に目的
とするエッジを検出する画像中の物体のエッジ検出方法
により上記目的を達成するものである。
According to a second aspect of the invention, the process of detecting the position of a feature point in the image of an object and the relative position information of the edge whose relative position from this feature point is known in advance are used to determine the position of the search range of the edge and Using the process of setting the size so that no edges other than the edge are included, the process of detecting the edge by processing the image data in the search range, and the relative position information from the obtained edge position. And a step of determining the position and size of a search range of another edge, and a step of detecting the other edge by processing image data in this search range. The object of the present invention is achieved by a method of detecting an edge of an object in an image, in which the process of determining the position and size of the above is repeated, and the target edge is finally detected.

【0016】第3発明は、画像中の、大きさが一定の物
体を参照物とし、この参照物の画像中での画素単位での
大きさと、目標エッジ間距離の画素単位と実寸法との比
を示す換算係数を、様々な参照物の画像中での大きさに
対して予め求めた表を作成しておき、目標エッジ間距離
の計測を行う際、画素単位で目標エッジ間距離と参照物
の大きさを計測して、前記予め作成しておいた表と参照
物の画素単位での大きさから換算係数を求め、該換算係
数を画素単位での目標エッジ間距離に乗じて目標エッジ
間の実寸法を求めることを特徴とする画像中の物体のエ
ッジ間距離検出方法により上記目的を達成するものであ
る。
According to a third aspect of the present invention, an object having a constant size in the image is used as a reference object, and the reference object size in the image, the target edge distance in pixel units, and the actual size are defined. Create a table in which the conversion factor indicating the ratio is calculated in advance for the sizes of various reference objects in the image, and when measuring the target edge distance, refer to the target edge distance in pixel units. The size of the object is measured, a conversion coefficient is calculated from the size of the reference table and the reference object in pixel units, and the target edge is calculated by multiplying the conversion coefficient by the target edge distance in pixel units. The object is achieved by a method for detecting a distance between edges of an object in an image, which is characterized in that an actual size of the space is obtained.

【0017】[0017]

【作用及び効果】請求項1の第1発明によれば、画像の
エッジによる濃度変化が乏しく、ノイズとの区別が付き
難いエッジの場合でも、ノイズはランダムに発生してい
て、打消し合うのに対して、エッジは直線であり、同一
位置に必ず存在して強調されるので、エッジ周辺の画素
濃度値をエッジと垂直方向に累積加算して得られた値
は、S/N比が高く、この値に基づく曲線から確実にエ
ッジを検出することができる。
According to the first aspect of the present invention, noise is randomly generated and cancels each other even in the case of an edge in which the density change due to the edge of the image is poor and it is difficult to distinguish from the noise. On the other hand, since the edge is a straight line and always exists at the same position and is emphasized, the value obtained by cumulatively adding the pixel density values around the edge in the direction perpendicular to the edge has a high S / N ratio. , The edge can be reliably detected from the curve based on this value.

【0018】請求項2によれば、曲線を求める際に、特
徴点近傍の累積値の3点を通る近似曲線の頂点をエッジ
としているので、正確なエッジ位置を求めることができ
る。
According to the second aspect, when the curve is obtained, the apex of the approximate curve passing through the three accumulated values in the vicinity of the characteristic points is used as the edge, so that the accurate edge position can be obtained.

【0019】請求項3の第2発明によれば、最終的に他
のエッジが入らないような探索範囲の位置と大きさを決
定してから、この探索範囲内の画像データを処理するの
で、類似した特徴を持ったエッジが複数存在しても確実
に目的のエッジを検出することができる。
According to the second aspect of the present invention, since the position and size of the search range where other edges do not enter are finally determined, the image data within this search range is processed. Even if there are a plurality of edges having similar characteristics, the target edge can be reliably detected.

【0020】請求項4の第3発明によれば、参照物から
カメラ(イメージセンサ)までの距離と目標エッジ間部
分からカメラまでの距離を同一に設定する必要がないた
めに、目標エッジに付随する部品や、背景の一部を参照
物として利用でき、容易に参照物を設定することができ
る。
According to the third aspect of the present invention, since it is not necessary to set the distance from the reference object to the camera (image sensor) and the distance from the target edge portion to the camera to the same value, the target edge is attached. It is possible to use a part to be edited or a part of the background as a reference object, and to easily set the reference object.

【0021】[0021]

【実施例】以下、本発明に係る方法を図面を参照して詳
細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The method according to the present invention will be described in detail below with reference to the drawings.

【0022】まず、図1に示される、本発明に係る画像
中の物体のエッジ検出方法を利用するプリント基板の実
装ライン10の全体のシステム構成について説明する。
First, the overall system configuration of the printed circuit board mounting line 10 shown in FIG. 1 which utilizes the method for detecting an edge of an object in an image according to the present invention will be described.

【0023】このプリント基板の実装ライン10は画像
処理によりプリント基板12上のパターンの位置を自動
計測し、このデータに基づきプリント基板12上に電子
部品を自動搭載するものである。
The printed circuit board mounting line 10 automatically measures the position of a pattern on the printed circuit board 12 by image processing, and automatically mounts electronic components on the printed circuit board 12 based on this data.

【0024】位置計測の対象となるプリント基板12
は、搬送機(ベルトコンベア)14により実装機16の
前面位置に送られ、ここで位置決め機構18によってお
おまかに位置決めされたプリント基板12を、上方から
カメラ20により撮影し、得られた画像を画像処理装置
22に送り、この画像処理装置22では画像処理によっ
て、プリント基板12上のランド24の位置を求め、求
められた位置に、搭載ヘッド26により、実装機16上
に置かれているLSI等の電子部品17を自動搭載する
ものである。
Printed circuit board 12 which is the object of position measurement
Is sent to the front position of the mounting machine 16 by a carrier (belt conveyor) 14, and the printed board 12 roughly positioned by the positioning mechanism 18 is photographed by a camera 20 from above, and the obtained image is an image. The image is sent to the processing device 22, and the image processing device 22 obtains the position of the land 24 on the printed circuit board 12 by image processing. The mounting head 26 places the land 24 on the mounting machine 16 at the obtained position. The electronic component 17 is automatically mounted.

【0025】ここで、前記位置決め機構18は「がた」
があり、プリント基板12上への電子部品17の搭載に
十分な精度では位置決めができない。又、プリント基板
12の外形と電子部品17を搭載するランド24との間
にも製造誤差による位置誤差があり、このため、プリン
ト基板12を正確に位置決めできても、電子部品17を
ランド24上の正しい位置に搭載することができない。
Here, the positioning mechanism 18 has a "play".
Therefore, the positioning cannot be performed with sufficient accuracy for mounting the electronic component 17 on the printed circuit board 12. Further, there is a positional error between the outer shape of the printed circuit board 12 and the land 24 on which the electronic component 17 is mounted due to a manufacturing error. Therefore, even if the printed circuit board 12 can be accurately positioned, the electronic component 17 is placed on the land 24. Can not be mounted in the correct position.

【0026】そこで、前述の如くカメラ20により撮影
された画像を画像処理装置22で処理することによりラ
ンド24の位置、正確にはそのエッジの位置を直接求め
る必要がある。
Therefore, it is necessary to directly determine the position of the land 24, more precisely, the position of the edge thereof, by processing the image photographed by the camera 20 by the image processing device 22 as described above.

【0027】次に、ランド24の、搬送機14による送
り方向の位置を検出する過程について説明する。なお、
これと直交方向の位置決めも同様の方法で行う。
Next, the process of detecting the position of the land 24 in the feed direction by the carrier 14 will be described. In addition,
Positioning in the direction orthogonal to this is also performed by the same method.

【0028】ランド24のエッジ24Aは直線状である
が、背景となるプリント基板12の上面の濃度がランド
24の濃度に近いとき、画像中では明確に見えないた
め、搬送機14の送り方向での画像の濃度変化からは該
エッジを求めることはできない。
Although the edge 24A of the land 24 is linear, when the density of the upper surface of the printed circuit board 12 which is the background is close to the density of the land 24, it cannot be clearly seen in the image, and therefore, in the feeding direction of the carrier 14. The edge cannot be obtained from the change in the density of the image.

【0029】しかし、ランド24のエッジ24Aが、プ
リント基板12の外形エッジ、及び位置決め機構18の
エッジ18Aと同一方向であるので、カメラ入力におい
て、画面上の横方向(図1において搬送機14の送り方
向)であるX軸に直交するように設定した。画像処理装
置22では、ランド24の検出に、累積加算によるエッ
ジ検出方法を用いる。
However, since the edge 24A of the land 24 is in the same direction as the outer edge of the printed circuit board 12 and the edge 18A of the positioning mechanism 18, in the camera input, the horizontal direction on the screen (in FIG. It was set so as to be orthogonal to the X axis which is the feeding direction). The image processing device 22 uses the edge detection method by cumulative addition to detect the land 24.

【0030】例えば図2の、カメラ20で得られたプリ
ント基板12の画像13において破線で示される累積加
算領域28内でランド24のエッジ24Aを検出する場
合、X軸に平行な1本の画素列毎に注目とすると、各画
素列での各画素の濃度値を縦軸に、画素列の位置(画面
座標)を横軸に表わしたとき、図3で破線で示されるエ
ッジ位置は、ノイズに隠れて検出できない。
For example, when the edge 24A of the land 24 is detected in the cumulative addition area 28 indicated by the broken line in the image 13 of the printed circuit board 12 obtained by the camera 20 shown in FIG. 2, one pixel parallel to the X axis is used. Focusing on each column, when the density value of each pixel in each pixel column is represented on the vertical axis and the position (screen coordinates) of the pixel column is represented on the horizontal axis, the edge position indicated by the broken line in FIG. It cannot be detected because it is hidden in.

【0031】この実施例の画像処理装置22では、X軸
に垂直に濃度微分値を積算しているので、ノイズがラン
ダムに発生していることからこれらは打消し合うのに対
して、ランド24のエッジ24AはX軸上の同一位置に
必ず存在しているため、強調され、図3(B)のような
曲線を得ることができる。この得られた曲線の特徴点、
例えば最小値、最大変化点等をエッジとして求めること
によりエッジ検出が可能となる。なお、図の実施例では
最大値をエッジとして検出している。
In the image processing apparatus 22 of this embodiment, since the density differential values are integrated perpendicularly to the X-axis, noises are randomly generated, and therefore these cancel each other out. Since the edge 24A is always present at the same position on the X-axis, it is emphasized and a curve as shown in FIG. 3B can be obtained. The characteristic points of this obtained curve,
For example, the edge can be detected by obtaining the minimum value, the maximum change point, and the like as the edge. In the illustrated embodiment, the maximum value is detected as an edge.

【0032】ここでは、図3(C)のように生データの
累積加算値の曲線の最大変化点をエッジとして求めるよ
うにしてもよい。
Here, as shown in FIG. 3C, the maximum change point of the curve of the cumulative addition value of raw data may be obtained as an edge.

【0033】ところで、ランド24上に正しく電子部品
を搭載するためには、該ランド24の位置を±0.1mm
の精度で求める必要があるが、画像中では1画素が約2
mmに相当するため、0.1mm単位の計測を行うには、1
画素未満の精度でエッジ24Aの位置を求める必要があ
る。
By the way, in order to properly mount electronic parts on the land 24, the position of the land 24 should be ± 0.1 mm.
It is necessary to calculate with the accuracy of
Since it corresponds to mm, to measure in 0.1 mm units, 1
It is necessary to obtain the position of the edge 24A with an accuracy of less than pixels.

【0034】前述の如く、画像処理装置22では、エッ
ジ24Aと直交する方向の座標に対する画素の濃度変化
の累積加算値を値とする曲線を扱っている。
As described above, the image processing apparatus 22 handles a curve whose value is the cumulative addition value of the density change of the pixel with respect to the coordinate in the direction orthogonal to the edge 24A.

【0035】得られた累積加算値による実際の曲線は、
図4において符号Bで示されるように折曲げ線形状とな
るのに対して、画像での分解能を無限大としたときの理
想的な曲線は図5に符号Aで示されるように滑らかな2
次曲線に類似したものになると想定される。
The actual curve by the obtained cumulative addition value is
In contrast to the bent line shape shown by the symbol B in FIG. 4, an ideal curve when the resolution in the image is infinite is smooth as shown by the symbol A in FIG.
It is expected to be similar to a quadratic curve.

【0036】符号Aで示される滑らかな曲線の極小点X
a と折曲げ曲線Bの極小点Xb とのずれが標本化誤差と
なる。実施例の画像処理装置22では、折曲げ曲線Bの
極小点Xb 付近の3点B1 、B2 、B3 を2次式で近似
し、この3点を通る曲線の頂点をエッジ24Aの位置と
して求めるようにされている。この場合、折曲げ曲線B
の極小点Xb 付近の局所的な形状は多項式により十分で
あり、又、近似計算時間が短くて済み、且つ、確実に頂
点が得られるという利点がある。
The minimum point X of the smooth curve indicated by the symbol A
The deviation between a and the minimum point Xb of the bending curve B becomes a sampling error. In the image processing apparatus 22 of the embodiment, the three points B1, B2, B3 near the minimum point Xb of the bending curve B are approximated by a quadratic equation, and the vertex of the curve passing through these three points is determined as the position of the edge 24A. Has been In this case, bending curve B
The local shape near the minimum point Xb of is sufficient by the polynomial, and the approximation calculation time is short, and the vertices can be obtained with certainty.

【0037】なお、曲線Aを表わす式が求められれば理
想的ではあるが、該曲線Aは、プリント基板12の照明
光に加え、周辺の機器からの複雑な反射光の合成に基づ
いて形成されていて、曲線Aを表わす式の推定は非常に
困難である。
Although it is ideal if the equation expressing the curve A is obtained, the curve A is formed based on the combination of the illumination light of the printed board 12 and the complicated reflected light from the peripheral equipment. However, it is very difficult to estimate the equation representing the curve A.

【0038】次に、ランド24のエッジ24Aに近い位
置に、これと類似した構成のエッジが存在する場合に、
目標とするエッジを検出する場合について説明する。
Next, when an edge having a similar structure to the edge 24A of the land 24 is present,
A case of detecting a target edge will be described.

【0039】ランド24のエッジ24の隣りには、図5
に示されるように、隣りのランド25のエッジ25Aが
存在し、しかも、エッジ24A、25Aはいずれも、プ
リンント基板12の樹脂と金属パターンの境界であるの
で、画像上での周辺からの濃度変化が全く同一となり、
濃度変化からエッジ24A、25A間を弁別することは
不可能である。
Next to the edge 24 of the land 24, as shown in FIG.
As shown in FIG. 5, the edge 25A of the adjacent land 25 exists, and since both the edges 24A and 25A are boundaries between the resin and the metal pattern of the print substrate 12, the density change from the periphery on the image. Are exactly the same,
It is impossible to distinguish between the edges 24A and 25A from the change in density.

【0040】ここで、エッジ24Aと25Aの距離が、
位置決め機構18によるプリント基板12の位置決め誤
差と該プリント基板12の製作誤差によるプリント基板
12の外形とランド24の間の誤差との和よりも小さい
場合は、なおさら弁別が困難となる。例えば、位置決め
機構18のがたを、例えば±4mm、プリント基板12の
製作誤差による該プリント基板12の外形とパターンの
位置ずれを±3mmとすると、画面内におけるランド24
のエッジ24Aの位置のばらつきは、エッジ24Aと2
5A間の距離5mmよりも大きくなるため、上記のような
適切な探索範囲を設定することが不可能である。
Here, the distance between the edges 24A and 25A is
When it is smaller than the sum of the positioning error of the printed circuit board 12 by the positioning mechanism 18 and the error between the outer shape of the printed circuit board 12 and the land 24 due to the manufacturing error of the printed circuit board 12, the discrimination becomes more difficult. For example, when the rattling of the positioning mechanism 18 is ± 4 mm and the positional deviation between the outer shape of the printed circuit board 12 and the pattern due to a manufacturing error of the printed circuit board 12 is ± 3 mm, the land 24 in the screen is changed.
The variation in the position of the edge 24A of the
Since the distance between 5A is larger than 5 mm, it is impossible to set an appropriate search range as described above.

【0041】この実施例において、画像処理装置22で
は、ランド24のエッジ24Aを検出する際に、隣接す
るランド25のエッジ25Aが入らないような探索範囲
を設定している。
In this embodiment, the image processing apparatus 22 sets a search range such that the edge 25A of the adjacent land 25 does not enter when detecting the edge 24A of the land 24.

【0042】まず、搬送機14上に、カメラ20に対し
て固定された位置にある位置決め機構18の取付部のエ
ッジ18Aに着目し、これを利用している。
First, the edge 18A of the mounting portion of the positioning mechanism 18 at the position fixed to the camera 20 on the carrier 14 is noticed and used.

【0043】前記位置決め機構18のエッジ18Aは、
カメラ20との相対位置(X、Y方向)が固定されてい
て、画像処理装置22における画面内のほぼ同じ位置に
必ず現われ、周辺に同一又は類似のエッジが存在しない
ため、該エッジ18Aを探索する範囲を広く設定するこ
とができ、他のエッジと混同することがない。
The edge 18A of the positioning mechanism 18 is
Since the relative position with respect to the camera 20 (X and Y directions) is fixed and always appears at almost the same position in the screen of the image processing device 22 and there is no same or similar edge in the periphery, the edge 18A is searched. The range to be set can be set wide, and it will not be confused with other edges.

【0044】画像処理装置22では、前記位置決め機構
18のエッジ18Aからの相対位置情報を利用して、プ
リント基板12の外形のエッジ12A(エッジ18Aと
平行)の探索範囲を設定する。ここで、位置決め機構1
8の誤差は位置決め機構18の誤差±4mmとなるので、
これに基づいて、エッジ12Aの探索範囲は幅8mmとす
る。この範囲には、パターン等の他のエッジは存在しな
い。
The image processing device 22 uses the relative position information from the edge 18A of the positioning mechanism 18 to set the search range of the edge 12A (parallel to the edge 18A) of the outer shape of the printed circuit board 12. Here, the positioning mechanism 1
Since the error of 8 is ± 4 mm of the positioning mechanism 18,
Based on this, the search range of the edge 12A is set to have a width of 8 mm. No other edges such as patterns exist in this range.

【0045】画像処理装置22では、プリント基板12
の外形エッジ12Aからの相対位置情報を利用して、ラ
ンド24のエッジ24Aの探索範囲を設定する。ランド
24の、エッジ12Aに対する位置のばらつきは、プリ
ント基板12の製作誤差±3mmと同一であるので、エッ
ジ24Aの探索範囲は幅6mmと設定する。エッジ24A
と25Aの距離は5mmであり、±3mm内であり、従って
この探索範囲の幅の中にエッジ25Aが現われることが
ない。
In the image processing device 22, the printed circuit board 12
The search range of the edge 24A of the land 24 is set using the relative position information from the outer edge 12A. Since the variation in the position of the land 24 with respect to the edge 12A is the same as the manufacturing error of the printed circuit board ± 3 mm, the search range of the edge 24A is set to be 6 mm wide. Edge 24A
The distance between and 25A is 5 mm, which is within ± 3 mm, so that the edge 25A does not appear in the width of this search range.

【0046】以上のようにして、画面中でのばらつき範
囲を考慮しても確実に検出できるエッジ18Aの検出か
ら始め、該検出されたエッジ18Aからの相対位置情報
を用いて他のエッジ12Aの探索範囲を設定し、更に、
これを基準として目的のランド24のエッジ24Aのエ
ッジ検出探索範囲を適切に設定し検出する。
As described above, starting from the detection of the edge 18A which can be surely detected even in consideration of the variation range in the screen, the relative position information from the detected edge 18A is used to detect other edges 12A. Set the search range, and
Based on this, the edge detection search range of the edge 24A of the target land 24 is appropriately set and detected.

【0047】次に、上記のように画像処理によって求め
られたランド24のエッジ24Aとプリント基板12の
エッジ12Aとの実寸距離、更にはエッジ24Aと25
A間の実寸距離を求める過程について説明する。
Next, the actual size distance between the edge 24A of the land 24 and the edge 12A of the printed board 12 obtained by the image processing as described above, and further the edges 24A and 25.
The process of obtaining the actual size distance between A will be described.

【0048】ランド24のエッジ24Aについて求めら
れた座標の単位は画素であり、これをミリメートルに変
換して初めて実寸が得られる。まず、オフラインでプリ
ント基板12を位置決め機構18により固定し、該位置
決め機構18の取付け部のエッジ18Aとランド24の
エッジ24Aの距離の実寸を正確に実測しておく。
The unit of the coordinates obtained for the edge 24A of the land 24 is a pixel, and the actual size can be obtained only when this is converted into millimeters. First, the printed circuit board 12 is fixed off-line by the positioning mechanism 18, and the actual size of the distance between the edge 18A of the mounting portion of the positioning mechanism 18 and the edge 24A of the land 24 is accurately measured.

【0049】次に、プリント基板12からのカメラ20
の距離、即ちカメラ距離を適宜変化させ、画像処理によ
りこの距離とプリント基板12上のコンデンサ30の直
径Dを画素単位(画素数)で計測する。この結果から、
直径Dの画素単位での長さと、位置決め機構18取付部
のエッジ18Aとランド24のエッジ24Aの間の距離
の画素単位と実寸との比Pを示す図6のようなルックア
ップテーブルを予め作成しておく。
Next, the camera 20 from the printed circuit board 12
The distance, that is, the camera distance is appropriately changed, and this distance and the diameter D of the capacitor 30 on the printed circuit board 12 are measured in pixel units (the number of pixels) by image processing. from this result,
A look-up table as shown in FIG. 6 is created in advance, which shows the length D in pixel units and the ratio P in pixel units and the actual size of the distance between the edge 18A of the positioning mechanism 18 attachment portion and the edge 24A of the land 24. I'll do it.

【0050】ここで図6のDの値は、カメラ20とプリ
ント基板12の距離即ちカメラ距離によって変わり、カ
メラ距離が短いほどDの値は大きくなる。又、図6の計
測位置1〜3は、カメラ20からプリント基板12まで
の距離を同一としたとき、該プリント基板12上のカメ
ラ20からの距離が異なる3個の計測位置を示す。
Here, the value of D in FIG. 6 changes depending on the distance between the camera 20 and the printed circuit board 12, that is, the camera distance. The shorter the camera distance, the larger the value of D. Further, measurement positions 1 to 3 in FIG. 6 indicate three measurement positions on the printed circuit board 12 which are different in distance from each other when the distance from the camera 20 to the printed circuit board 12 is the same.

【0051】画像処理により、各画像毎にDの画素単位
での長さと、各計測位置1〜3の一部又は全部でのエッ
ジ24Aと18Aの画素単位の距離を求め、図6のルッ
クアップテーブルを参考にして変換係数p の値を求め、
このp を画素単位でのエッジ24Aと18Aの距離に掛
けて距離の実寸を求める。ここで、電子部品はランド2
4とカメラ20との距離が異なるため、画像入力の都度
変換係数を求め、これによって正確なランド位置の実寸
計測を行うことができる。
By the image processing, the length in D pixel units and the distance in pixel units between the edges 24A and 18A at some or all of the measurement positions 1 to 3 are obtained for each image, and the lookup in FIG. 6 is performed. Calculate the value of the conversion coefficient p referring to the table,
This p is multiplied by the distance between the edges 24A and 18A in pixel units to obtain the actual distance. Here, the electronic component is the land 2
Since the distance between 4 and the camera 20 is different, it is possible to obtain a conversion coefficient each time an image is input, and to accurately measure the actual land position.

【0052】前記位置決め機構18のエッジ18Aの位
置は不動であるので、ここから、エッジ24Aの絶対位
置が求まり、この情報に基づいてランド24上の正しい
位置に、搭載ヘッド26によって電子部品が正しく搭載
される。従来は、予めプリント基板上にキャリブレーシ
ョン用のマークを付けておき、これを参考にして画像毎
に変換係数p を求めていたが、この実施例では、キャリ
ブレーション用のマークは不要であり、基板上にある大
きさが常に変わらず、且つ確実に画像中に確認すること
ができる部分である、既に搭載された電子部品上のコン
デンサ30を利用して変換係数を求め、より実装密度を
向上させることができる。
Since the position of the edge 18A of the positioning mechanism 18 is immovable, the absolute position of the edge 24A can be obtained from this position, and based on this information, the mounting head 26 can correct the electronic component at the correct position on the land 24. It will be installed. Conventionally, a calibration mark was previously attached on the printed circuit board, and the conversion coefficient p was calculated for each image with reference to this, but in this embodiment, the calibration mark is unnecessary, The size on the board does not change at all times, and the conversion coefficient is obtained by using the capacitor 30 on the already mounted electronic parts, which is the part that can be surely confirmed in the image, and the mounting density is further improved. Can be made.

【0053】上記実施例は、プリント基板の実装ライン
に本発明を適用したものであるが、本発明はこれに限定
されるものでなく、自動的に部品を搭載したり、又、存
在を確認したり、部品の消耗を検出するための画像処理
過程で、目的物のエッジを検出する際に、一般的に適用
されるものである。
Although the present invention is applied to the mounting line of the printed circuit board in the above-mentioned embodiment, the present invention is not limited to this, and the components are automatically mounted and the existence is confirmed. And is generally applied when detecting an edge of an object in an image processing process for detecting wear of a component.

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

【図1】本発明を適用したプリント基板の実装ラインを
示す斜視図
FIG. 1 is a perspective view showing a mounting line of a printed circuit board to which the present invention is applied.

【図2】同実装ラインにおける画像処理装置でのプリン
ト基板の画像を示す平面図
FIG. 2 is a plan view showing an image of a printed circuit board in the image processing apparatus on the mounting line.

【図3】プリント基板上のエッジ近傍での画面座標と画
素の濃度値及び累積加算値との関係を示す線図
FIG. 3 is a diagram showing the relationship between the screen coordinates near the edge on the printed circuit board, the pixel density value, and the cumulative addition value.

【図4】累積加算値によりランドのエッジを、2次式に
よる曲線近似を用いて求める際の線図
FIG. 4 is a diagram for obtaining an edge of a land by a cumulative addition value using curve approximation by a quadratic equation.

【図5】相対位置情報を用いてエッジを検出する際、及
び、キャリブレーション方式でエッジ間距離を検出する
ときに補正係数の基準となる一定長さ部分を含むエッジ
周辺の画像を示す平面図
FIG. 5 is a plan view showing an image around an edge including a fixed length portion that serves as a reference of a correction coefficient when detecting an edge using relative position information and when detecting an inter-edge distance by a calibration method.

【図6】キャリブレーション用のルックアップテーブル
を示す図
FIG. 6 is a diagram showing a lookup table for calibration.

【図7】従来のキャリブレーション方式を示す略示斜視
FIG. 7 is a schematic perspective view showing a conventional calibration method.

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

10…プリント基板の実装ライン 12…プリント基板 12A、18A、24A、25A…エッジ 14…搬送機(コンベア) 16…実装機 18…位置決め機構 20…カメラ 22…画像処理装置 24、25…ランド 26…搭載ヘッド 28…累積加算領域 30…コンデンサ 10 ... Printed circuit board mounting line 12 ... Printed circuit board 12A, 18A, 24A, 25A ... Edge 14 ... Conveyor (conveyor) 16 ... Mounting machine 18 ... Positioning mechanism 20 ... Camera 22 ... Image processing device 24, 25 ... Land 26 ... Mounting head 28 ... Cumulative addition area 30 ... Capacitor

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】直線状のエッジを有する物体の画像におけ
る該エッジ周辺の画素の濃度値をエッジと直交する方向
に累積加算し、画像中のエッジと直交する方向の座標軸
に沿って前記累積値を値とする曲線を求め、この曲線の
特徴点をエッジ位置として求めることを特徴とする画像
中の物体のエッジ検出方法。
1. A density value of pixels around an edge in an image of an object having a linear edge is cumulatively added in a direction orthogonal to the edge, and the cumulative value is obtained along a coordinate axis in a direction orthogonal to the edge in the image. A method for detecting an edge of an object in an image, characterized in that a curve having a value of is obtained, and a characteristic point of this curve is obtained as an edge position.
【請求項2】請求項1において、前記特徴点近傍の前記
累積値の3点を通る近似曲線を求め、この曲線の頂点を
エッジ位置とすることを特徴とする画像中の物体のエッ
ジ検出方法。
2. An edge detection method for an object in an image according to claim 1, wherein an approximate curve passing through three points of said cumulative value in the vicinity of said characteristic point is obtained, and a vertex of this curve is set as an edge position. .
【請求項3】物体の画像中の特徴点の位置を検出する過
程と、この特徴点からの相対位置が予め判っているエッ
ジの相対位置情報から、該エッジの探索範囲の位置及び
大きさを、該エッジ以外のエッジが入らないように設定
する過程と、この探索範囲内の画像データの処理により
該エッジを検出する過程と、この求められたエッジ位置
からの相対位置情報を用いて、他のエッジの探索範囲の
位置及び大きさを決定する過程と、この探索範囲内の画
像データの処理により該他のエッジを検出する過程と、
を有してなり、前記エッジの探索範囲の位置及び大きさ
決定、検出の過程を繰返し、最終的に目的とするエッジ
を検出する画像中の物体のエッジ検出方法。
3. The position and size of the search range of the edge are calculated from the process of detecting the position of the feature point in the image of the object and the relative position information of the edge whose relative position from this feature point is known in advance. , A step of setting an edge other than the edge so as not to enter, a step of detecting the edge by processing the image data in the search range, and a relative position information from the obtained edge position, A step of determining the position and size of the edge search range, and a step of detecting the other edge by processing the image data within the search range,
An edge detection method for an object in an image, wherein the steps of determining the position and size of the edge search range and detecting the edge are repeated to finally detect the target edge.
【請求項4】画像中の、大きさが一定の物体を参照物と
し、この参照物の画像中での画素単位での大きさと、目
標エッジ間距離の画素単位と実寸法との比を示す換算係
数を、様々な参照物の画像中での大きさに対して予め求
めた表を作成しておき、目標エッジ間距離の計測を行う
際、画素単位で目標エッジ間距離と参照物の大きさを計
測して、前記予め作成しておいた表と参照物の画素単位
での大きさから換算係数を求め、該換算係数を画素単位
での目標エッジ間距離に乗じて目標エッジ間の実寸法を
求めることを特徴とする画像中の物体のエッジ間距離検
出方法。
4. An object having a constant size in an image is used as a reference object, and a size of the reference object in a pixel unit and a ratio of a target edge distance between the pixel unit and an actual size are shown. When a table is created in which the conversion factors are calculated in advance for the sizes of various reference objects in the image and the target edge distance is measured, the target edge distance and the reference object size are calculated in pixel units. The conversion factor is obtained from the table created in advance and the size of the reference object in pixel units, and the conversion factor is multiplied by the target edge distance in pixel units to calculate the actual distance between the target edges. A method for detecting a distance between edges of an object in an image, which is characterized by obtaining a dimension.
JP4217743A 1992-08-17 1992-08-17 Detecting method for edge of object in image and detecting method for distance between edges Pending JPH0668257A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4217743A JPH0668257A (en) 1992-08-17 1992-08-17 Detecting method for edge of object in image and detecting method for distance between edges

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4217743A JPH0668257A (en) 1992-08-17 1992-08-17 Detecting method for edge of object in image and detecting method for distance between edges

Publications (1)

Publication Number Publication Date
JPH0668257A true JPH0668257A (en) 1994-03-11

Family

ID=16709063

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4217743A Pending JPH0668257A (en) 1992-08-17 1992-08-17 Detecting method for edge of object in image and detecting method for distance between edges

Country Status (1)

Country Link
JP (1) JPH0668257A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6997572B2 (en) 2002-08-12 2006-02-14 Nec Corporation Illumination structure for pushbutton and electronic device with pushbutton having illumination structure
JP2007194733A (en) * 2006-01-17 2007-08-02 Kyocera Corp Image data processor and processing method
US10540866B2 (en) 2018-02-07 2020-01-21 Omron Corporation Door switch

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6997572B2 (en) 2002-08-12 2006-02-14 Nec Corporation Illumination structure for pushbutton and electronic device with pushbutton having illumination structure
JP2007194733A (en) * 2006-01-17 2007-08-02 Kyocera Corp Image data processor and processing method
JP4611212B2 (en) * 2006-01-17 2011-01-12 京セラ株式会社 Image data processing method and image data processing apparatus
US10540866B2 (en) 2018-02-07 2020-01-21 Omron Corporation Door switch

Similar Documents

Publication Publication Date Title
US5008743A (en) Telecentric imaging system optical inspection machine using the same and method for correcting optical distortion produced thereby
JP4901903B2 (en) 3D inspection system
US6549648B1 (en) Method for determining a position of a structural element on a substrate
JP2000252203A (en) Alignment mark and alignment method
KR100288330B1 (en) How to Search for the Center of Band Area
JPH0668257A (en) Detecting method for edge of object in image and detecting method for distance between edges
US8538187B2 (en) Defocus calibration module for light-sensing system and method thereof
JP2004536300A5 (en)
JP2001124700A (en) Calibration method of inspection machine with line sensor camera
JPH116711A (en) Method for measuring calibration value of image pickup unit for measurement
JP3124535B2 (en) Surface mount component inspection system
JP3166816B2 (en) Pattern position finding method and apparatus by image recognition
JP2793947B2 (en) Appearance inspection method of soldering condition
JPS6311804A (en) Mark position detection system for positioning
US5899965A (en) Parts identifying method
JP3369235B2 (en) Calibration method for measuring distortion in three-dimensional measurement
JPH10105719A (en) Optical measurement method for hole position
JP3059446B2 (en) High accuracy position measurement method
JP4205044B2 (en) Printed solder inspection equipment
JPH06281411A (en) Measuring method for hole position
KR101787387B1 (en) Measuring Device Of Pattern Shape and Print Characteristics Using Printing Process
JP2795790B2 (en) Sensor coordinate correction method for three-dimensional measuring device
JP3119688B2 (en) Tilt detection method
JP2755885B2 (en) Method for detecting the position of a light beam incident on a CCD
JP2705458B2 (en) Mounting board appearance inspection device