JP2825359B2 - Pattern recognition method - Google Patents

Pattern recognition method

Info

Publication number
JP2825359B2
JP2825359B2 JP3050872A JP5087291A JP2825359B2 JP 2825359 B2 JP2825359 B2 JP 2825359B2 JP 3050872 A JP3050872 A JP 3050872A JP 5087291 A JP5087291 A JP 5087291A JP 2825359 B2 JP2825359 B2 JP 2825359B2
Authority
JP
Japan
Prior art keywords
straight line
area
approximate straight
boundary
approximate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP3050872A
Other languages
Japanese (ja)
Other versions
JPH04286085A (en
Inventor
智 山内
正通 森本
隆 清水
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP3050872A priority Critical patent/JP2825359B2/en
Publication of JPH04286085A publication Critical patent/JPH04286085A/en
Application granted granted Critical
Publication of JP2825359B2 publication Critical patent/JP2825359B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Image Processing (AREA)
  • Supply And Installment Of Electrical Components (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、表面実装用電子部品の
位置や傾きを検出するために、撮像手段によって撮像さ
れた画像内の対象物と背景の境界点を直線近似すること
によって対象物の輪郭を検出するパターン認識方法に関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for detecting the position and inclination of a surface-mounted electronic component by linearly approximating a boundary point between the object and a background in an image picked up by an image pickup means. The present invention relates to a pattern recognition method for detecting an outline of a pattern.

【0002】[0002]

【従来の技術】以下図5〜図7を参照しながら、従来の
直線近似を用いて対象物(QFP)の傾きと中心を検出
するパターン認識方法の一例について説明する。
2. Description of the Related Art An example of a conventional pattern recognition method for detecting the inclination and center of an object (QFP) using linear approximation will be described below with reference to FIGS.

【0003】図5の(a) のような画像11において、粗中
心検出領域12を水平方向と垂直方向に設定する。そし
て、水平方向の粗中心検出領域12の両端から検索して対
象物の水平方向の両端を検出することにより水平方向の
中心を求める。また、垂直方向の粗中心検出領域12の両
端から検索して対象物の垂直方向の両端を抽出すること
により垂直方向の中心を求め、水平方向の中心と垂直方
向の中心とから対象物の粗中心13を検出することができ
る。上記で得られた粗中心13と対象物の寸法から図5の
(b) に示すように、対象物のリード14を含む検出領域15
を対象物(QFP)の4辺に設定する。次に、検出領域
15でリード14の先端を検出できる方向から検索すること
により、図6の(a) に示すように境界点16を抽出するこ
とができる。上記のようにして得られた境界点16に関し
て最小2乗法を適用することにより、図6の(b) に示す
ような直線を得ることができる。前記の直線から各境界
点16までの距離があらかじめ定められた基準距離以上離
れている場合、その境界点16を雑音点と見なして除去
し、基準距離以内の境界点16に関して最小2乗法を適用
することによって、図6の(c) のような近似直線17を検
出することができる。以上の処理を対象物(QFP)の
4辺について行うことによって、図7に示すような、4
辺の近似直線17を検出することができる。そして、前記
の4つの近似直線17のとなり合う直線間で交点を求め、
その交点の重心を求めることが対象物の中心位置検出と
なる。
In an image 11 as shown in FIG. 5A, a coarse center detection area 12 is set in a horizontal direction and a vertical direction. Then, the center in the horizontal direction is obtained by searching from both ends of the coarse center detection area 12 in the horizontal direction and detecting both ends in the horizontal direction of the object. In addition, the vertical center is obtained by searching from both ends of the vertical coarse center detection area 12 and extracting the vertical both ends of the object, and the rough of the object is obtained from the horizontal center and the vertical center. The center 13 can be detected. From the coarse center 13 obtained above and the dimensions of the object, FIG.
(b) As shown in FIG.
Are set to the four sides of the object (QFP). Next, the detection area
By searching the lead 15 from the direction in which the tip of the lead 14 can be detected, the boundary point 16 can be extracted as shown in FIG. By applying the least squares method to the boundary points 16 obtained as described above, a straight line as shown in FIG. 6B can be obtained. If the distance from the straight line to each boundary point 16 is more than a predetermined reference distance, the boundary point 16 is regarded as a noise point and removed, and the least square method is applied to the boundary point 16 within the reference distance. By doing so, an approximate straight line 17 as shown in FIG. 6 (c) can be detected. By performing the above processing on the four sides of the object (QFP), the four sides as shown in FIG.
The approximate line 17 of the side can be detected. Then, an intersection is obtained between the straight lines adjacent to the four approximate straight lines 17,
Finding the center of gravity of the intersection is the detection of the center position of the object.

【0004】[0004]

【発明が解決しようとする課題】しかし、上記した構成
のでは、本来の境界点16でない雑音点が多くなると正確
な近似直線を検出することが難しくなる。
However, with the above configuration, it becomes difficult to detect an accurate approximate straight line when the number of noise points other than the original boundary point 16 increases.

【0005】たとえば、図8の(a) に示すような画像の
場合、検出領域15を設定すると図8の(b) に示すような
境界点16が検出される。この図8の(b) に従来技術を適
用すると、図9に示すような近似直線17となって、対象
物の中心位置を検出することができない問題があった本
発明は上記課題を解決するもので、対象物の輪郭を示す
近似直線を設定することができるパターン認識方法を提
供することを目的とする。
For example, in the case of an image as shown in FIG. 8A, when a detection area 15 is set, a boundary point 16 as shown in FIG. 8B is detected. When the prior art is applied to FIG. 8B, the approximate straight line 17 as shown in FIG. 9 is obtained, and the present invention has a problem that the center position of the object cannot be detected. An object of the present invention is to provide a pattern recognition method capable of setting an approximate straight line indicating the contour of an object.

【0006】[0006]

【課題を解決するための手段】上記課題を解決するため
に本発明のパターン認識方法は、撮像手段で対象物を撮
像して得られる画像において、あらかじめ定められた領
域内で対象物と背景の境を境界点としてすべての境界点
を検出し、前記のあらかじめ定められた領域を一定方向
に複数分割し、前記の複数分割された領域の一つの領域
内において、最小2乗法により境界点を近似する近似直
線を求め、この近似直線からあらかじめ定められた基準
距離以上離れた境界点を雑音点として除外し、残った境
界点で再度近似直線を求め、前記領域内の近似直線から
それ以外の領域内に存在する境界点のばらつきを前記領
域内の評価値とし、前記の評価値があらかじめ定められ
た基準値に最も近い評価値を持つ領域の直線を検出し、
上記で得られた領域の近似直線をあらかじめ定められた
領域内の直線とし、この直線から前記境界点までの距離
があらかじめ定められた基準距離よりも大きな境界点を
削除し、上記で残った境界点から最小2乗法により近似
直線を求めた構成としたものである。
In order to solve the above-mentioned problems, a pattern recognition method according to the present invention provides an image obtained by capturing an image of an object by an image pickup means, in an image obtained by imaging the object and a background within a predetermined area. Detecting all boundary points with the boundary as a boundary point, dividing the predetermined area into a plurality of parts in a certain direction, and approximating the boundary points by the least square method within one of the plurality of divided areas. A boundary point separated from the approximate line by a predetermined reference distance or more is excluded as a noise point, and an approximate line is obtained again at the remaining boundary points. The variation of the boundary points present in the as the evaluation value in the area, the evaluation value is detected straight line of the area having the evaluation value closest to the predetermined reference value,
The approximate line of the region obtained above is defined as a straight line in a predetermined region, and a boundary point whose distance from the straight line to the boundary point is larger than a predetermined reference distance is deleted. In this configuration, an approximate straight line is obtained from the points by the least square method.

【0007】[0007]

【作用】上記した構成によれば、検出領域を複数領域に
分割するので、分割領域のうち幾つかの領域の近似直線
は、対象物の輪郭位置を示すこととなる。そこで、上記
の領域を検出することにより、対象物の輪郭を示す近似
直線を設定することができる。
According to the above arrangement, since the detection area is divided into a plurality of areas, the approximate straight lines of some of the divided areas indicate the contour positions of the object. Therefore, an approximate straight line indicating the contour of the target object can be set by detecting the above-mentioned area.

【0008】[0008]

【実施例】以下、本発明の一実施例のパターン認識方法
について、図1〜図4を参照しながら説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A pattern recognition method according to one embodiment of the present invention will be described below with reference to FIGS.

【0009】前述した従来と同じ方法により、図2の
(a) に示すように、対象物の粗中心を求めて粗中心から
検出領域15を設定する。この検出領域15で対象物の輪郭
を示す近似直線を図1に示すフローチャートに従って設
定する。
By the same method as the above-mentioned conventional one, FIG.
As shown in (a), the rough center of the object is obtained, and the detection area 15 is set from the rough center. In this detection area 15, an approximate straight line indicating the contour of the object is set according to the flowchart shown in FIG.

【0010】はじめに、フローチャートの境界点検出1
では、検出領域15のリード14の先端方向からスキャンし
て、境界点16を検出する。次に、フローチャートの領域
分割2では、図2の(b) に示すように、検出領域15を一
定方向に3等分に分割して、それぞれの領域を領域、
領域、領域とする。
First, boundary point detection 1 in the flowchart
Then, scanning is performed from the leading end of the lead 14 in the detection area 15 to detect the boundary point 16. Next, in the region division 2 of the flowchart, as shown in FIG. 2B, the detection region 15 is divided into three equal parts in a certain direction, and each region is divided into regions,
Region, region.

【0011】そして、フローチャートの分割領域内直線
近似3では、はじめに領域の境界点16に関して最小2
乗法による直線近似を行うと図2の(c) に示すようにな
る。この近似直線と各境界点16間の距離が、あらかじめ
定められた基準距離以上の境界点16を除外し、基準距離
以内の境界点16に関して直線近似を行うと、図3の(a)
の近似直線を検出できる。この近似直線抽出を、図3の
(b) に示すように、領域と領域についても行うこ
とにより、図3の(c) に示すように、3つの領域のそれ
ぞれの近似直線が検出できる。
In the linear approximation 3 in the divided area of the flowchart, first, the minimum 2
When the linear approximation by the multiplication method is performed, the result is as shown in FIG. Excluding the boundary points 16 whose distance between the approximate straight line and each boundary point 16 is equal to or greater than a predetermined reference distance and performing linear approximation on the boundary points 16 within the reference distance, FIG.
Can be detected. By performing this approximation line extraction for regions as shown in FIG. 3B, the approximation lines of the three regions can be detected as shown in FIG. 3C.

【0012】次に、フローチャートの評価値計算4で
は、領域の近似直線と領域および領域の境界点16
との分散を評価値として求める。つまり、一つの直線か
らの境界点16の散らばりぐあいを求めるものである。そ
して、領域の近似直線と領域および領域の境界点
16との評価値と領域の近似直線と領域および領域
の境界点16との評価値を求める。
Next, in the evaluation value calculation 4 of the flowchart, the approximate line of the region, the region and the boundary point 16 of the region are determined.
Is obtained as an evaluation value. That is, the scatter of the boundary points 16 from one straight line is determined. Then, the approximate line of the region, the region and the boundary point of the region
An evaluation value of 16 and an evaluation value of the approximate straight line of the area and the boundary point 16 of the area and the area are obtained.

【0013】そして、フローチャートの最適近似直線検
出5で、最も評価値の良い、つまり一つの直線からの境
界点16のばらつきが最も少ない近似直線を検出する。さ
らに、フローチャートの雑音点除去6では、検出領域15
において上記の近似直線と境界点16との距離があらかじ
め定められた基準距離以上の境界点16を除外する。そし
て、上記で残った境界点16を使って最小2乗法による直
線近似を行い、図4に示すような、近似直線17を検出す
る。
Then, in the optimum approximate straight line detection 5 of the flowchart, an approximate straight line having the best evaluation value, that is, the variation of the boundary point 16 from one straight line is minimized. Further, in noise point removal 6 in the flowchart, the detection area 15
In the above, the boundary points 16 in which the distance between the approximate straight line and the boundary points 16 is equal to or longer than a predetermined reference distance are excluded. Then, a straight line approximation by the least squares method is performed using the remaining boundary points 16 to detect an approximate straight line 17 as shown in FIG.

【0014】たとえば、図8(a) の画像に対して、従来
技術の場合には対象物の輪郭を検出することができなか
ったが、本発明のパターン認識方法を採用することによ
り、図10の(a) および図10の(b) のように、対象物の輪
郭を示す境界点16のみを結ぶ近似直線を求めることがで
きる。
For example, in the case of the prior art, the contour of the object could not be detected from the image of FIG. 8A, but by employing the pattern recognition method of the present invention, FIG. As shown in (a) of FIG. 10 and (b) of FIG. 10, an approximate straight line connecting only the boundary points 16 indicating the outline of the object can be obtained.

【0015】[0015]

【発明の効果】以上述べたように、本発明のパターン認
識方法によれば、検出領域を複数領域に分割することに
より、分割領域のうち幾つかの領域の近似直線は、対象
物の輪郭位置を示すこととなるので、上記の領域を検出
することで対象物の輪郭を示す近似直線を設定できる。
As described above, according to the pattern recognition method of the present invention, by dividing the detection area into a plurality of areas, the approximate straight lines of some of the divided areas are located at the contour positions of the object. Thus, an approximate straight line indicating the outline of the target object can be set by detecting the above-described area.

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

【図1】本発明の一実施例におけるパターン認識方法の
概略を示したフローチャート図である。
FIG. 1 is a flowchart schematically showing a pattern recognition method according to an embodiment of the present invention.

【図2】(a) 、(b) 、(c) はそれぞれ同実施例における
近似直線検出の手順の一部を示した図である。
FIGS. 2 (a), (b), and (c) are diagrams each showing a part of a procedure of approximate line detection in the embodiment.

【図3】(a) 、(b) 、(c) はそれぞれ同実施例における
近似直線検出の手順一部を示した図である。
FIGS. 3A, 3B, and 3C are diagrams each showing a part of the procedure of approximate straight line detection in the embodiment.

【図4】同実施例における近似直線検出の手順の一部を
示した図である。
FIG. 4 is a diagram showing a part of a procedure of approximate line detection in the embodiment.

【図5】(a) 、(b) はそれぞれ従来のパターン認識方
法における手順の一部を示した図である。
FIGS. 5A and 5B are diagrams each showing a part of a procedure in a conventional pattern recognition method.

【図6】(a) 、(b) 、(c) はそれぞれ従来のパターン認
識方法における手順の一部を示した図である。
FIGS. 6 (a), (b), and (c) are diagrams each showing a part of a procedure in a conventional pattern recognition method.

【図7】従来のパターン認識方法における手順の一部を
示した図である。
FIG. 7 is a diagram showing a part of a procedure in a conventional pattern recognition method.

【図8】(a) 、(b) は従来のパターン認識方法による手
順の一部を示した図である。
FIGS. 8A and 8B are diagrams showing a part of a procedure according to a conventional pattern recognition method.

【図9】従来のパターン認識方法による近似直線抽出結
果を示した図である。
FIG. 9 is a diagram showing an approximate straight line extraction result by a conventional pattern recognition method.

【図10】本発明一実施例による近似直線抽出結果を示し
た図である。
FIG. 10 is a diagram showing an approximate straight line extraction result according to an embodiment of the present invention.

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

11 画像 12 粗中心検索領域 14 QFPのリード 15 検出領域 16 境界点 17 近似直線 11 Image 12 Coarse center search area 14 QFP lead 15 Detection area 16 Boundary point 17 Approximate line

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭61−29979(JP,A) 特開 平2−10476(JP,A) (58)調査した分野(Int.Cl.6,DB名) G06T 5/00 G06T 7/00────────────────────────────────────────────────── ─── Continuation of the front page (56) References JP-A-61-29979 (JP, A) JP-A-2-10476 (JP, A) (58) Fields investigated (Int. Cl. 6 , DB name) G06T 5/00 G06T 7/00

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 撮像手段で対象物を撮像して得られる画
像において、あらかじめ定められた領域内で対象物と背
景の境を境界点としてすべての境界点を検出し、前記の
あらかじめ定められた領域を一定方向に複数分割し、前
記の複数分割された領域の一つの領域内において、最小
2乗法により境界点を近似する近似直線を求め、この近
似直線からあらかじめ定められた基準距離以上離れた境
界点を雑音点として除外し、残った境界点で再度近似直
線を求め、前記領域内の近似直線からそれ以外の領域内
に存在する境界点のばらつきを前記領域内の評価値と
し、前記の評価値があらかじめ定められた基準値に最も
近い評価値を持つ領域の直線を検出し、上記で得られた
領域の近似直線をあらかじめ定められた領域内の直線と
し、この直線から前記境界点までの距離があらかじめ定
められた基準距離よりも大きな境界点を削除し、上記で
残った境界点から最小2乗法により近似直線を求めたこ
とを特徴とするパターン認識方法。
In an image obtained by imaging an object by an imaging means, all boundary points are detected using a boundary between the object and the background as a boundary point in a predetermined area, and the predetermined point is detected. The area is divided into a plurality of areas in a certain direction, and within one of the divided areas, an approximate straight line approximating the boundary point is obtained by the least square method, and the approximate straight line is separated from the approximate straight line by a predetermined reference distance or more. Exclude the boundary points as noise points, obtain an approximate straight line again at the remaining boundary points, and from the approximate straight line in the area, the variation of the boundary points existing in other areas as the evaluation value in the area, The evaluation value is detected as a straight line in an area having an evaluation value closest to a predetermined reference value, and an approximate straight line of the area obtained above is set as a straight line in a predetermined area. A pattern recognition method, wherein a boundary point whose distance to a boundary point is larger than a predetermined reference distance is deleted, and an approximate straight line is obtained from the remaining boundary points by a least square method.
JP3050872A 1991-03-15 1991-03-15 Pattern recognition method Expired - Fee Related JP2825359B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3050872A JP2825359B2 (en) 1991-03-15 1991-03-15 Pattern recognition method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3050872A JP2825359B2 (en) 1991-03-15 1991-03-15 Pattern recognition method

Publications (2)

Publication Number Publication Date
JPH04286085A JPH04286085A (en) 1992-10-12
JP2825359B2 true JP2825359B2 (en) 1998-11-18

Family

ID=12870815

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3050872A Expired - Fee Related JP2825359B2 (en) 1991-03-15 1991-03-15 Pattern recognition method

Country Status (1)

Country Link
JP (1) JP2825359B2 (en)

Also Published As

Publication number Publication date
JPH04286085A (en) 1992-10-12

Similar Documents

Publication Publication Date Title
JPH02285475A (en) Method and equipment for extracting edge and line
JPH0552987B2 (en)
JPH09311905A (en) Line detecting method and character recognition device
US6885770B2 (en) Irradiation field extracting method and apparatus and recording medium
JP2825359B2 (en) Pattern recognition method
JP3269170B2 (en) Electronic component position detection method
JP3066137B2 (en) Pattern matching method
JP3281469B2 (en) Document image inclination detecting method and apparatus
JP2855913B2 (en) Pattern recognition method
JP3311551B2 (en) Image data input processing method and apparatus
JPH06168331A (en) Patter matching method
JP3196559B2 (en) Line recognition method
JP3632088B2 (en) Vehicle detection method
JP3447751B2 (en) Pattern recognition method
JP3031069B2 (en) Appearance inspection method
JP2904228B2 (en) Pattern recognition method
JP2000269700A (en) Recognizing method for pattern matching
JPH06281411A (en) Measuring method for hole position
JPH0760459B2 (en) Corner detector
JP2514257B2 (en) Road guide line feature calculation point setting device
JP3473296B2 (en) In-vehicle driving environment recognition device
JPH05312543A (en) Pattern matching method
JPH04188379A (en) Picture pattern recognizing method
JPH065544B2 (en) Figure recognition device
JP3570201B2 (en) Image recognition device and image recognition method

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees