JP4566686B2 - Method and apparatus for determining shape of object - Google Patents
Method and apparatus for determining shape of object Download PDFInfo
- Publication number
- JP4566686B2 JP4566686B2 JP2004300917A JP2004300917A JP4566686B2 JP 4566686 B2 JP4566686 B2 JP 4566686B2 JP 2004300917 A JP2004300917 A JP 2004300917A JP 2004300917 A JP2004300917 A JP 2004300917A JP 4566686 B2 JP4566686 B2 JP 4566686B2
- Authority
- JP
- Japan
- Prior art keywords
- shape
- contour point
- contour
- image
- evaluation value
- 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
Links
Landscapes
- Supply And Installment Of Electrical Components (AREA)
- Image Analysis (AREA)
- Length Measuring Devices By Optical Means (AREA)
- Image Processing (AREA)
Description
本発明は、対象物の形状判別方法及び装置、更に詳細には、基板上に搭載される電子部品に設けられた部品極性判別用のボール、ランドもしくはマークなどの対象物の形状を判別する方法及び装置に関する。 The present invention relates to a method and apparatus for determining the shape of an object, and more specifically, a method for determining the shape of an object such as a ball, land, or mark for component polarity determination provided on an electronic component mounted on a substrate. And an apparatus.
従来より、電子部品(以下単に部品という)を基板上に実装する部品実装機では、吸着された電子チップ部品(以下単に部品という)の画像をCCDカメラなどの撮像手段から取り込み、この部品の画像を認識することにより部品の位置を検出し、必要に応じて吸着ノズルによる部品の姿勢を補正することにより部品の位置決めを行ない、基板上の所定位置に部品の搭載を行なっている。 2. Description of the Related Art Conventionally, in a component mounter that mounts an electronic component (hereinafter simply referred to as a component) on a substrate, an image of an adsorbed electronic chip component (hereinafter simply referred to as a component) is captured from an imaging means such as a CCD camera, and the image of this component is captured. The position of the component is detected by recognizing the component, and the component is positioned by correcting the posture of the component by the suction nozzle as necessary, and the component is mounted at a predetermined position on the board.
また、部品に極性がある場合には、部品の向きを考慮して部品搭載を行う必要があり、そのために部品の角部に部品の極性を示す切り欠きを形成し、部品認識のときに、その角部の切り欠きの位置検出して部品の極性を判別し、部品を正しい向きで、つまり切り欠けのある角部が所定の方向(基板上で右上方向など)に向くように基板上に搭載することが行われている(特許文献1)。 In addition, if the part has polarity, it is necessary to mount the part in consideration of the direction of the part.For this purpose, a notch indicating the polarity of the part is formed at the corner of the part, and at the time of part recognition, The position of the corner notch is detected to determine the polarity of the component, and the component is placed on the board in the correct orientation, that is, the corner with the notch is oriented in a predetermined direction (such as the upper right direction on the board). It is carried out (Patent Document 1).
また、部品の極性を示すために、部品の角部に極性判別可能なボール、ランドもしくはマークを形成することが行われており、例えば、図8(A)、(B)に示すように、マトリックス状に配置された多数のボール電極30b、31bを有する部品30、31の角部に矩形あるいは円形のマーク30a、31aを形成している。そして、予めその形状、サイズ、部品中心からの位置(相対座標)などを部品データとして記憶しておき、部品の位置検出時に、これらの部品データを元に、装置内でモデルテンプレート画像データを作成し、正規化相関マッチングを行い、算出される相関値により、部品角部のマークの検出及び形状の判定を行っていた。その場合、マークが円形である場合には、例えば、円であるか否かを判別するのに複数方向の径の長さを比較して行う判別方式が提案されている(特許文献2)。
従来の基板上にマークを形成してそれにより部品の極性を判別する場合、正規化相関マッチングでは、例えば、マークが円形状あるいは矩形状であるとその形状の差は認識が困難で、どちらも高い相関値を返答する。両者の差は、サイズの誤差による変動に埋もれてしまうレベルであるので相関値の判定で位置検出の有無判定は行えるが、形状の判別までは困難であった。 When a mark is formed on a conventional substrate and the polarity of the component is discriminated by it, in normalized correlation matching, for example, if the mark is circular or rectangular, the difference in shape is difficult to recognize. Returns a high correlation value. The difference between the two is a level that is buried in the fluctuation due to the size error, so that the presence / absence of position detection can be determined by determining the correlation value, but it is difficult to determine the shape.
また、位置決めのために撮像される画像データでは、極性判別に用いようとする対象物(ボール、ランド、もしくはマーク)は、5〜8画素程度で形状判別に十分なサイズではなく、例えば、図7(A)に示したように、矩形状の各マーク32(左側の6個)、円形状の各マーク33(右側の4個)は、画像データとしてデジタル化されているので、その境界線が明瞭でなく、円であってもその境界線を曲線と見なすのは困難である。また、これらの画像を二値化画像に変換すると、図7(B)に示したように、輪郭が本来の輪郭と異なる画像のマーク32’、33’となって、認識がさらに困難になる。 Further, in the image data picked up for positioning, the object (ball, land, or mark) to be used for polarity discrimination is about 5 to 8 pixels and is not a sufficient size for shape discrimination. As shown in FIG. 7A, each rectangular mark 32 (six on the left side) and each circular mark 33 (four on the right side) are digitized as image data. Is not clear, and even if it is a circle, it is difficult to consider its boundary as a curve. Further, when these images are converted into binarized images, as shown in FIG. 7B, the contours become marks 32 ′ and 33 ′ of images different from the original contours, making recognition more difficult. .
このような画像データでは、径長、周囲長、面積などといった形状特徴値も精度よく求めることができず、これらを評価値として形状を判別するのも困難であった。 In such image data, shape feature values such as the diameter length, perimeter length, and area cannot be obtained with high accuracy, and it is difficult to determine the shape using these as evaluation values.
従って、本発明は、このような問題点を解決するためになされたもので、円形あるいは矩形(正方形又は長方形)状の対象物の形状を高精度で判別できる対象物の形状判別方法及び装置を提供することを課題とする。 Accordingly, the present invention has been made to solve such problems, and an object shape discrimination method and apparatus capable of accurately discriminating the shape of a circular or rectangular (square or rectangular) object. The issue is to provide.
本発明(請求項1)は、
基板上に搭載される電子部品に設けられた対象物の形状を判別する方法であって、
対象物を撮像し、対象物の大きさに応じて、画像データをデジタル補間により拡大し、拡大処理をした場合には、対象物の画像の中心から放射線状に走査線を設定して該走査線の画像データをサンプリングし、サンプリングした区間を2つに分離した際に分離度が一番高くなる点を輪郭点として抽出し、各輪郭点を結ぶことにより得られる輪郭線の周囲長並びに該輪郭線で囲まれた部分の面積を求め、
前記求めた周囲長並びに面積から円形度を示す第1の評価値を算出し、
対象物のモデルを設定し、前記対象物の輪郭点での勾配ベクトルと、該輪郭点に対応するモデルの輪郭点での勾配ベクトルとの一致度を示す第2の評価値を、前記対象物の形状と前記モデルの形状との差違が大きな部分の勾配ベクトルの重みを重くした加重平均にて算出し、
対象物の形状サイズ、形状判別条件に応じて、各評価値に対して重み係数を変動させて設定し、第1と第2の評価値をそれぞれ設定された重み係数で重み付けを行って、
対象物が円形であるか否かを判別することを特徴とする。
The present invention (Claim 1)
A method for determining the shape of an object provided on an electronic component mounted on a substrate,
When the object is imaged, and the image data is enlarged by digital interpolation according to the size of the object, and the enlargement process is performed, a scanning line is set radially from the center of the image of the object and the scanning is performed. When sampling line image data and separating the sampled section into two, a point having the highest degree of separation is extracted as a contour point, and the perimeter of the contour line obtained by connecting each contour point Find the area of the part surrounded by the outline,
A first evaluation value indicating circularity is calculated from the obtained perimeter and area,
A model of the object is set, and a second evaluation value indicating the degree of coincidence between the gradient vector at the contour point of the object and the gradient vector at the contour point of the model corresponding to the contour point is set as the object. Calculated by a weighted average obtained by increasing the weight of the gradient vector of the portion where the difference between the shape of the model and the shape of the model is large ,
In accordance with the shape size of the object and the shape determination condition, the weighting coefficient is set to vary for each evaluation value, and the first and second evaluation values are respectively weighted with the set weighting coefficient,
It is characterized by determining whether a target object is circular.
また、本発明(請求項2)は、
基板上に搭載される電子部品に設けられた対象物の形状を判別する装置であって、
対象物を撮像する撮像手段と、
対象物の大きさに応じて、画像データをデジタル補間により拡大する画像拡大手段と、
拡大処理をした場合には、対象物の画像の中心から放射線状に走査線を設定して該走査線の画像データをサンプリングし、サンプリングした区間を2つに分離した際に分離度が一番高くなる点を輪郭点として抽出する輪郭点抽出手段と、
各輪郭点を結ぶことにより得られる輪郭線の周囲長並びに該輪郭線で囲まれた部分の面積を算出する算出手段と、
前記求めた周囲長並びに面積から円形度を示す第1の評価値を算出する算出手段と、
対象物のモデルを設定し、前記対象物の輪郭点での勾配ベクトルと、該輪郭点に対応するモデルの輪郭点での勾配ベクトルとの一致度を示す第2の評価値を、前記対象物の形状と前記モデルの形状との差違が大きな部分の勾配ベクトルの重みを重くした加重平均にて算出する算出手段と、
対象物の形状サイズ、形状判別条件に応じて、各評価値に対して重み係数を変動させて設定し、第1と第2の評価値をそれぞれ設定された重み係数で重み付けを行う重み付け手段とを有し、
対象物が円形であるか否かを判別することを特徴とする。
The present invention (Claim 2 )
An apparatus for determining the shape of an object provided on an electronic component mounted on a substrate,
An imaging means for imaging an object;
Image enlarging means for enlarging the image data by digital interpolation according to the size of the object;
When the enlargement process is performed, the scanning line is set radially from the center of the image of the object, the image data of the scanning line is sampled, and the degree of separation is the highest when the sampled section is separated into two. Contour point extraction means for extracting a point that becomes higher as a contour point;
Calculating means for calculating the perimeter of the contour line obtained by connecting each contour point and the area of the portion surrounded by the contour line;
Calculating means for calculating a first evaluation value indicating circularity from the obtained perimeter and area;
A model of the object is set, and a second evaluation value indicating the degree of coincidence between the gradient vector at the contour point of the object and the gradient vector at the contour point of the model corresponding to the contour point is set as the object. Calculating means for calculating a weighted average obtained by increasing the weight of the gradient vector of a portion where the difference between the shape of the model and the shape of the model is large ;
Weighting means for setting a weighting coefficient for each evaluation value in accordance with the shape size and shape discrimination condition of the object, and weighting each of the first and second evaluation values with the set weighting coefficient ; Have
It is characterized by determining whether a target object is circular.
本発明では、円形度を示す評価値のほかに、対象物の輪郭点での勾配ベクトルと、該輪郭点に対応するモデルの輪郭点での勾配ベクトルとの一致度を示す評価値の2つの評価値を用いて、対象物が円形であるか否かを判別しているので、判別精度が向上し、電子部品の極性判別に円形又は矩形のマークなどを部品の角部に設けている場合に、マークの誤認識がなくなり、誤搭載が防止できる。 In the present invention, in addition to the evaluation value indicating the circularity, two evaluation values indicating the degree of coincidence between the gradient vector at the contour point of the object and the gradient vector at the contour point of the model corresponding to the contour point are used. When the evaluation value is used to determine whether or not the object is circular, the accuracy of the determination is improved, and circular or rectangular marks are provided at the corners of the component to determine the polarity of the electronic component In addition, erroneous recognition of the mark is eliminated, and erroneous mounting can be prevented.
また、円形と矩形の電極が混在する部品の場合、円形の電極と矩形の電極を判別して部品認識することができるので、認識精度が向上する。 In addition, in the case of a component in which a circular electrode and a rectangular electrode are mixed, since the component can be recognized by discriminating between the circular electrode and the rectangular electrode, the recognition accuracy is improved.
本発明は、部品の極性判別に用いられるボール、ランド、もしくはマークなどの対象物を高精度で認識でき、また円形の電極と矩形の電極を高精度で判別できるもので、以下に、図面に示す実施例に基づいて本発明を詳細に説明する。 The present invention can recognize an object such as a ball, a land, or a mark used for determining the polarity of a component with high accuracy, and can discriminate between a circular electrode and a rectangular electrode with high accuracy. The invention will be described in detail on the basis of the examples shown.
図1は本発明の形状判別方法を実施するのに用いられるシステムの構成図である。このシステムは、部品2を吸着し、撮像位置へセットするための吸着ノズル1と、吸着ノズル1の移動や照明装置3の駆動など部品の基板(不図示)上への搭載動作を制御するマシン制御装置13と、部品2を撮像するための標準カメラ4及び高解像度カメラ5と、撮像された画像を処理して部品認識し、画像内のある位置に存在する部品に設けられた対象物の形状を判別する画像処理装置12とによって構成される。 FIG. 1 is a block diagram of a system used to implement the shape discrimination method of the present invention. This system picks up a component 2 and picks up a nozzle 2 for setting the image pickup position, and a machine for controlling the mounting operation of the component on a substrate (not shown) such as moving the suction nozzle 1 and driving the illumination device 3. The control device 13, the standard camera 4 and the high-resolution camera 5 for imaging the component 2, and processing the captured image to recognize the component and detect the object provided at the component existing at a certain position in the image. And an image processing device 12 for determining the shape.
画像処理装置12は、カメラ4、5で撮像された部品の画像をデジタル画像に変換するA/Dコンバータ6、デジタル画像に変換された画像を格納する画像メモリ7、作業用メモリ8、画像メモリ8のデータを演算処理する演算装置9、部品データ格納メモリ10、インターフェース11並びに、各装置ないしメモリ間のデータの流れを制御するとともに、部品搭載に必要なデータを演算する制御装置4から構成され、演算装置9並びに制御装置4は、CPUなどで構成される。 The image processing apparatus 12 includes an A / D converter 6 that converts an image of a part captured by the cameras 4 and 5 into a digital image, an image memory 7 that stores the image converted into a digital image, a work memory 8, and an image memory. 8 includes an arithmetic unit 9 that performs arithmetic processing on data, a component data storage memory 10, an interface 11, and a control unit 4 that controls the flow of data between each unit or memory and calculates data necessary for component mounting. The arithmetic device 9 and the control device 4 are constituted by a CPU or the like.
マシン制御装置13は、予め部品の電極の情報、極性判別用エレメント情報及び判別しきい値など(以降、部品データと呼ぶ)をインタフェース11を介して画像処理装置12へ送信する。画像処理装置12は受信した部品データを部品データ格納メモリ10に格納する。 The machine control device 13 transmits in advance information on the electrode of the component, element information for polarity determination, a determination threshold value and the like (hereinafter referred to as component data) to the image processing device 12 via the interface 11. The image processing device 12 stores the received component data in the component data storage memory 10.
マシン制御装置13は、通常、部品の電極サイズによって、標準カメラ4あるいは高解像度カメラ5を選択し、部品2を吸着ノズル1で吸着し、選択したカメラの撮像位置にセットする。このとき、照明装置3を選択したカメラで撮像できるように移動、点灯させ、画像処理装置12にインタフェース11を介して、選択したカメラチャネル情報とともに処理実行を指示する。 The machine control device 13 normally selects the standard camera 4 or the high-resolution camera 5 depending on the electrode size of the component, sucks the component 2 with the suction nozzle 1, and sets it at the imaging position of the selected camera. At this time, the illumination device 3 is moved and lit so that it can be imaged by the selected camera, and the image processing device 12 is instructed to execute processing together with the selected camera channel information via the interface 11.
画像処理装置12は、指定されたカメラ4もしくは5を制御し、撮像された部品2の画像を、A/Dコンバータ6でデジタル化し、画像メモリ7に多値画像データとして記憶させる。そして、演算装置9は、画像メモリ7のデータを処理し、部品2の位置検出を行い、部品中心と吸着中心間のずれ、並びに部品の吸着傾きを演算するとともに、部品の供給方向が間違っていないか極性判別のためのボール、ランド、もしくはマークなどの対象物を検出して、その形状判別検査を行う。検査結果がOKであれば、位置検出結果をインタフェース11を介し、マシン制御装置13に返答する。検査結果がNGであれば、極性判別がエラーであったことを返答する。 The image processing device 12 controls the designated camera 4 or 5, digitizes the captured image of the component 2 by the A / D converter 6, and stores it in the image memory 7 as multivalued image data. Then, the arithmetic unit 9 processes the data in the image memory 7, detects the position of the component 2, calculates the deviation between the component center and the adsorption center, and the component adsorption inclination, and the component supply direction is incorrect. An object such as a ball, land, or mark for polarity discrimination is detected and the shape discrimination inspection is performed. If the inspection result is OK, the position detection result is returned to the machine control device 13 via the interface 11. If the inspection result is NG, it returns a response that the polarity determination is an error.
マシン制御装置13は、正常に位置決め結果を受け取った場合、吸着ノズル1を搭載位置に移動させ、部品認識結果に従って部品の吸着ずれ(部品中心と吸着中心間のずれ並びに吸着角度ずれ)を補正し、また正しい極性で部品2を基板上に搭載する。一方、極性判別エラーを受け取った場合には、マシン制御装置13は部品の向きを補正してリトライするか、あるいはその部品を廃棄する。 When the machine control device 13 receives the positioning result normally, the machine control device 13 moves the suction nozzle 1 to the mounting position and corrects the component suction displacement (deviation between the component center and the suction center and the suction angle displacement) according to the component recognition result. The component 2 is mounted on the board with the correct polarity. On the other hand, when a polarity determination error is received, the machine control device 13 corrects the orientation of the component and performs a retry, or discards the component.
次に、図2を参照して、画像処理装置12での処理の流れを詳細に説明する。ここで画像処理装置12の演算装置9は、輪郭線の周囲長、その輪郭線で囲まれた部分の面積、形状判別のための評価値など形状判別に必要な各種データを算出する算出手段となっている。 Next, the flow of processing in the image processing apparatus 12 will be described in detail with reference to FIG. Here, the arithmetic unit 9 of the image processing apparatus 12 includes calculation means for calculating various data necessary for shape discrimination such as the perimeter of the contour line, the area of the portion surrounded by the contour line, and the evaluation value for shape discrimination. It has become.
ステップS1において、画像処理装置12は、指定されたカメラ(撮像手段)4もしくは5を制御し、部品並びに部品に設けられている対象物を撮像し、撮像された画像を、A/Dコンバータ6でデジタル化し、画像メモリ7に多値画像データとして記憶させる。 In step S <b> 1, the image processing apparatus 12 controls the designated camera (imaging unit) 4 or 5 to image the component and the object provided in the component, and the captured image is converted into the A / D converter 6. Is digitized and stored in the image memory 7 as multivalued image data.
続いて、画像処理装置12の演算装置9は、部品データ格納メモリ10に記憶された電極情報をもとに画像メモリ7のデータを処理し、電極中心位置を検出し、部品の中心、傾きを算出し、部品の位置決めをする(ステップS2)。画像処理装置12は、位置決めに失敗した場合(ステップS3のN)、マシン制御装置13にその旨を通知し、以降の処理を中断し、次のコマンド待ち状態となる。一方、位置決めに成功した場合には(ステップS3のY)、ステップS4以降の極性判別処理に移る。 Subsequently, the arithmetic unit 9 of the image processing device 12 processes the data in the image memory 7 based on the electrode information stored in the component data storage memory 10, detects the electrode center position, and determines the center and inclination of the component. Calculate and position the component (step S2). When the positioning fails (N in step S3), the image processing apparatus 12 notifies the machine control apparatus 13 of that, interrupts the subsequent processing, and enters a state of waiting for the next command. On the other hand, if the positioning is successful (Y in step S3), the process proceeds to the polarity determination process in step S4 and subsequent steps.
ステップS4では、部品データ格納メモリ10に記憶された極性判別エレメント(ボール、ランド、もしくはマークなどの対象物)の部品中心からの相対座標と、ステップS2で求めた部品の位置決め結果から極性判別エレメントの位置を予測し、画像メモリ7のデータを処理し、エレメント中心と、その径の検出を行う。画像処理装置12は、この検出に失敗した場合、マシン制御装置13にその旨を通知し、以降の処理を中断し、次のコマンド待ち状態となる。検出に成功した場合、以下の形状判別処理に移る。 In step S4, the polarity discriminating element is determined from the relative coordinates from the center of the part of the polarity discriminating element (object such as a ball, land, or mark) stored in the part data storage memory 10 and the positioning result of the part obtained in step S2. Is predicted, the data in the image memory 7 is processed, and the element center and its diameter are detected. If this detection fails, the image processing device 12 notifies the machine control device 13 of the failure, interrupts the subsequent processing, and waits for the next command. If the detection is successful, the process proceeds to the following shape discrimination process.
形状判別可能なエレメントのサイズは、最低8画素×8画素、できれば32画素×32画素のサイズがあればよいので、ステップS4で求めたエレメントの径が32画素×32画素未満であれば、画像メモリ7から部分画像を切出し、作業用メモリ8にデジタル補間処理によりエレメントの拡大画像を生成する。このとき、部品傾きが取得できているので、同時に傾き0°の姿勢への正規化を行えば、処理が行いやすくなる。以上の処理がステップS5の処理である(補正手段)。 The size of the element whose shape can be discriminated should be at least 8 pixels × 8 pixels, preferably 32 pixels × 32 pixels. Therefore, if the element diameter obtained in step S4 is less than 32 pixels × 32 pixels, the image A partial image is cut out from the memory 7 and an enlarged image of the element is generated in the work memory 8 by digital interpolation processing. At this time, since the component inclination has been acquired, if the normalization to the posture with the inclination of 0 ° is performed at the same time, the processing becomes easier. The above process is the process of step S5 (correction means).
続いて、ステップS6において、形状判定対象物(エレメント)の輪郭データ(輪郭点、勾配ベクトル)を抽出する。本発明では、撮像画像に対してやや高倍率のデジタル補間による拡大処理を行うため、エッジがボケた画像となる。このような画像に対して輪郭を抽出するために、特開2000−205838に記載の手法を利用する。 Subsequently, in step S6, contour data (contour points, gradient vectors) of the shape determination object (element) is extracted. In the present invention, since the enlargement process is performed by slightly high-magnification digital interpolation on the captured image, the image is blurred. In order to extract a contour from such an image, a method described in Japanese Patent Laid-Open No. 2000-205838 is used.
例えば、図4(A)、(B)において、符号40は、部品の角部に形成されたボール、ランド、もしくはマークなどの極性判別用の円形の対象物(図8のマーク31aに相当)の画像、符号41は、矩形(正方形または長方形)状の対象物(図8のマーク30aに相当)の画像とし、検出ウインドウWを設定して、画像の中心40a、41aから放射線状に走査線m1を設定し、その走査線m1の画像データをサンプリングする。サンプリング区間は単調増加もしくは、単調減少するものとする。この区間を2つに分離する点を始点から終点に向かって順次設定し、分離度が一番高くなる点を輪郭点p1とする。そして、各方向について走査線m2、m3、.....を設定し、同様な処理で輪郭点p2、p3、.....を求め、これらをつなぎ合わせて輪郭線40b、41bとする。この輪郭線の抽出は、エッジが明瞭であれば(コントラストがよければ)、エッジ検出フィルタを用いた輪郭抽出でも、二値化境界追跡による輪郭抽出でも構わない。 For example, in FIGS. 4A and 4B, reference numeral 40 denotes a circular object for polarity discrimination such as a ball, a land, or a mark formed at a corner of a component (corresponding to the mark 31a in FIG. 8). image, reference numeral 41 is rectangular (square or rectangular) shape of an object and the image (corresponding to the mark 30a in FIG. 8), sets the detection window W, the scanning line center 40a of the image, from 41a to radiation form m1 is set, and the image data of the scanning line m1 is sampled. Sampling interval shall be monotonously increasing or monotonically decreasing. Points that separate this section into two are sequentially set from the start point to the end point, and the point having the highest degree of separation is defined as a contour point p1. Then, the scanning lines m2, m3,. . . . . And contour points p2, p3,. . . . . Are connected to form contour lines 40b and 41b. As long as the edge is clear (if the contrast is good), this contour line may be extracted using an edge detection filter or contour extraction by binarized boundary tracking.
次に、各輪郭点p1、p2、.....において3×3のSobelフィルタを適用し、x、y方向のベクトル成分を求め、勾配ベクトルとする。そして、このようにして求めた輪郭点、勾配ベクトルの輪郭データを、作業用メモリ8に格納する。 Next, each contour point p1, p2,. . . . . A 3 × 3 Sobel filter is applied to obtain vector components in the x and y directions to obtain gradient vectors. Then, the contour data of the contour points and gradient vectors obtained in this way are stored in the work memory 8.
次に、ステップS6で求めた輪郭データを作業用メモリ8から取り出し、輪郭点の点間距離の総和を求めて周囲長とし、輪郭線40b、41bで囲まれる部分の画素数をカウントし、面積とする(ステップS7)。 Next, the contour data obtained in step S6 is taken out from the work memory 8, the sum of the distances between the contour points is obtained as the perimeter, and the number of pixels in the portion surrounded by the contour lines 40b and 41b is counted. (Step S7).
なお、走査ラインに対して凹な部分がある場合には、影になる画素が発生するので、xyの2方向の走査を行い、矩形内の対象物外部の画素をカウントし、矩形面積から差し引くことで対象物の面積を求める。その処理は以下のようにして行われる。 In addition, when there is a concave portion with respect to the scanning line, a shadowed pixel is generated. Therefore, scanning in two directions of xy is performed, the pixels outside the object in the rectangle are counted, and subtracted from the rectangular area. To determine the area of the object. The process is performed as follows.
まず、ステップS6で求めた輪郭データ(輪郭点座標列)を作業用メモリ8から読み出し、輪郭点間をデジタル線分補間し、作業用メモリ8上に線画データを生成し、輪郭線を包み込む矩形を求める。続いて、X方向に矩形の左右の端からラスタ走査し、ワーク(対象物)の左右のエッジ画素を検出する。そのとき、x方向走査時にカウントした画素には済みマークをつけ、次のy方向走査時にはカウントをスキップできるようにしておく。次に、多値画像データを用いて、サブピクセル演算を行い、実数値の座標を求め、続いて、y方向に矩形の上下の端からラスタ走査し、ワークの上下のエッジ画素を検出し、矩形内の対象物外部のx方向走査で漏れた画素をカウントし、エンベロプ矩形面積から対象物外の画素カウンタを差し引き、面積とする。 First, the contour data (contour point coordinate sequence) obtained in step S6 is read from the work memory 8, digital line segment interpolation is performed between the contour points, line drawing data is generated on the work memory 8, and a rectangle that wraps the contour line. Ask for. Subsequently, raster scanning is performed from the left and right ends of the rectangle in the X direction to detect left and right edge pixels of the work (object). At that time, a mark is added to the pixels counted during the x-direction scanning so that the counting can be skipped during the next y-direction scanning. Next, sub-pixel calculation is performed using multi-valued image data to obtain real-valued coordinates, and then raster scanning is performed from the upper and lower ends of the rectangle in the y direction to detect upper and lower edge pixels of the work, Pixels leaked in the x-direction scan outside the object inside the rectangle are counted, and a pixel counter outside the object is subtracted from the envelope rectangular area to obtain an area.
このようにして、対象物の面積を求めた後、ステップS8において、その円形度を算出する。その場合、円形度の評価値e(第1の評価値)として、
e=4πS/(L*L) (0<e≦1)
S:面積、L:周囲長
を用いる。真円の場合、e=1となり、正方形の場合、e=0.785となる。輪郭が複雑になるほどeは小さくなる。
Thus, after calculating | requiring the area of a target object, the circularity is calculated in step S8. In that case, as the evaluation value e (first evaluation value) of the circularity,
e = 4πS / (L * L) (0 <e ≦ 1)
S: area, L: perimeter are used. In the case of a perfect circle, e = 1, and in the case of a square, e = 0.785. As the contour becomes more complicated, e becomes smaller.
なお、図5に示したように、円か否かは、対象物41の輪郭点p1、p2、.....の勾配ベクトルv1、v2、.....の方向とモデル円42の勾配ベクトルv1’、v2’、.....の方向の(輪郭点検出のための放射線)の一致度(cosθ)でも判定できるので、ステップS9において、ベクトル相関演算を行う。このベクトル相関演算は、次のように行われる。まず、対象物41に対してモデル42(モデル円)を設定し、対象物41の各輪郭点とそれに対応するモデル円42での各輪郭点での勾配ベクトルv1、v2、.....(実線);v1’、v2’、.....(点線)を求める。例えば、対象物41の輪郭点A(=p2)と、それに対応するモデル円42の輪郭点B上での勾配ベクトルv2、v2’のベクトル成分を、
v2(A) =(x0,y0)
v2’(B)=(x1,y1)
とすると、2つのベクトルの角度θは、2つのベクトルの内積をそれぞれのベクトルの長さの積で割ることにより求めることができる。
As shown in FIG. 5, whether or not the object is a circle is determined by the contour points p1, p2,. . . . . Gradient vectors v1, v2,. . . . . And the gradient vector v1 ′, v2 ′,. . . . . Since the degree of coincidence (cos θ) in the direction of (radiation for detecting contour points) can also be determined, a vector correlation calculation is performed in step S9. This vector correlation calculation is performed as follows. First, a model 42 (model circle) is set for the object 41, and gradient vectors v1, v2,... At each contour point of the object 41 and the corresponding contour points on the model circle 42 are set. . . . . (Solid line); v1 ′, v2 ′,. . . . . (Dotted line) is obtained. For example, the vector component of the gradient vector v2, v2 ′ on the contour point A (= p2) of the object 41 and the contour point B of the model circle 42 corresponding thereto is
v2 (A) = (x0, y0)
v2 ′ (B) = (x1, y1)
Then, the angle θ between the two vectors can be obtained by dividing the inner product of the two vectors by the product of the lengths of the respective vectors.
cosθ=(v2・v2’)/(|v2||v2’|)
=(x0*x1+y0*y1)/(sqrt(x0*x0+y0*y0)*sqrt(x1*x1+y1*y1))
(−1≦cosθ≦1)
を演算することにより、その一致度c(第2の評価値)、
c=|cosθ|(0≦c≦1)を求めることができる。なお上式で、sqrtは2乗の平方根を意味する。この一致度を各輪郭点でそれぞれ取得し、その平均値d=Σci/nを評価値(これを第2の評価値としてもよい)とする。
cos θ = (v2 · v2 ′) / (| v2 || v2 ′ |)
= (X0 * x1 + y0 * y1) / (sqrt (x0 * x0 + y0 * y0) * sqrt (x1 * x1 + y1 * y1))
(-1 ≦ cos θ ≦ 1)
, The degree of coincidence c (second evaluation value),
c = | cos θ | (0 ≦ c ≦ 1) can be obtained. In the above formula, sqrt means the square root of the square. The degree of coincidence is acquired at each contour point, and the average value d = Σci / n is used as the evaluation value (this may be the second evaluation value).
また、対象物の形状が円形か、矩形かを判別する場合、差異が大きな箇所をサンプリング点にする、もしくは、ウエイト配分を変動させるなどの手法により感度を上げることができる。例えば、矩形の場合、図5に示したように、22.5°≦θ1<45°、45°<θ2≦67.5°にサンプリング点を設けると感度が向上する。 Further, when determining whether the shape of the object is a circle or a rectangle, the sensitivity can be increased by using a method such as making a sampling point a location where the difference is large or changing the weight distribution. For example, in the case of a rectangle, as shown in FIG. 5, if the sampling points are provided at 22.5 ° ≦ θ1 <45 ° and 45 ° <θ2 ≦ 67.5 °, the sensitivity is improved.
続いて、ステップS8とS9で求めた2つの評価値からそれぞれの評価値に対してワーク(対象物)の状態に応じて重み付けを変動させ、加重平均をとり、最終的な評価値を求める(ステップS10)。例えば、対象物の状態に応じて、図6に示したような重み係数を、それぞれ円形度から求めた評価値と、ベクトル相関演算から求めた評価値に乗算し、その加重平均を求める。図6で、「ワークサイズ」は、対象物(ワーク)を撮像したときその大きさが画素単位でどのくらいの大きさかを示しており、例えば、32*32は、32画素*32画素の大きさであることを示している。また、「拡大」と「傾き」は、ステップS5でそれぞれ拡大処理、あるい回転補正が行われたかを示しており、「比較形状」は、単に円形か否かを判断するだけなのか、あるいは円形であるのか、矩形であるのかを判断するのかを示している。そして、これらの条件に従って、「円形度」に示したような重み係数、「ベクトル相関」に示したような重み係数で、それぞれ円形度を示す評価値(e)と、ベクトル相関演算から求めた評価値に重み付けを行い、その加重平均を求めて最終的な評価値とする。 Subsequently, from the two evaluation values obtained in steps S8 and S9, the weighting is varied according to the state of the workpiece (object) with respect to each evaluation value, and a weighted average is obtained to obtain a final evaluation value ( Step S10). For example, according to the state of the object, the weighting coefficient as shown in FIG. 6 is multiplied by the evaluation value obtained from the circularity and the evaluation value obtained from the vector correlation calculation, respectively, and the weighted average is obtained. In FIG. 6, “work size” indicates how large the object (work) is in pixel units, for example, 32 * 32 is the size of 32 pixels * 32 pixels. It is shown that. “Enlargement” and “Inclination” indicate whether enlargement processing or rotation correction has been performed in step S5, respectively. “Comparison shape” merely determines whether or not the shape is a circle, or Whether to determine whether the shape is a circle or a rectangle is shown. Then, according to these conditions, the weighting factor as shown in “Circularity” and the weighting factor as shown in “Vector correlation” were obtained from the evaluation value (e) indicating the circularity and the vector correlation calculation, respectively. The evaluation value is weighted, and the weighted average is obtained as the final evaluation value.
次に、ステップS10で求めた評価値を、予め設定していたしきい値と比較し、形状判別を行う(ステップS11)。そして、しきい値以上の場合には、円形であると判定、OKを返答し(ステップS11、S12)、しきい値未満の場合、円形でない(矩形である)と判定、NGを返答する(ステップS11、S13)。 Next, the evaluation value obtained in step S10 is compared with a preset threshold value to perform shape discrimination (step S11). If it is equal to or greater than the threshold value, it is determined that it is circular, and OK is returned (steps S11 and S12). If it is less than the threshold value, it is determined that it is not circular (rectangular), and NG is returned ( Steps S11 and S13).
ここで、上記評価値判別用のしきい値は、ティーチングにより予め実測し、設定すると判定精度が向上するので、図3に示した流れに沿ってしきい値を求める。この処理は、利用しようとしている形状が判別可能かどうか予め調べるための処理でもある。 Here, the threshold value for evaluation value determination is measured in advance by teaching, and if set, the determination accuracy is improved. Therefore, the threshold value is obtained along the flow shown in FIG. This process is also a process for examining in advance whether or not the shape to be used can be determined.
まず、形状が良好な形状(OK)とするいくつかのワークの画像で評価値を算出し、その最小値(a)を取得する(ステップS20、S21)。続いて、形状が不良な形状(NG)とするいくつかのワークの画像で評価値を算出し、その最大値(b)を取得する(ステップS22、S23)。次に、aとbを比較し(ステップS24)、a>bならば、aとbの平均値をしきい値に設定し、形状判別が可能であることを通知し(ステップS25)、a≦bのときは、判別不可能な形状であることを通知する(ステップS26)。 First, evaluation values are calculated from images of several workpieces having a good shape (OK), and the minimum value (a) is obtained (steps S20 and S21). Subsequently, an evaluation value is calculated from images of several workpieces having a defective shape (NG), and the maximum value (b) is obtained (steps S22 and S23). Next, a and b are compared (step S24). If a> b, the average value of a and b is set as a threshold value to notify that shape discrimination is possible (step S25). When ≦ b, it is notified that the shape is indistinguishable (step S26).
2 電子部品
12 画像処理装置
13 マシン制御装置
40、41 対象物の画像
42 モデル円
2 Electronic parts 12 Image processing device 13 Machine control device 40, 41 Image of object 42 Model circle
Claims (2)
対象物を撮像し、対象物の大きさに応じて、画像データをデジタル補間により拡大し、拡大処理をした場合には、対象物の画像の中心から放射線状に走査線を設定して該走査線の画像データをサンプリングし、サンプリングした区間を2つに分離した際に分離度が一番高くなる点を輪郭点として抽出し、各輪郭点を結ぶことにより得られる輪郭線の周囲長並びに該輪郭線で囲まれた部分の面積を求め、
前記求めた周囲長並びに面積から円形度を示す第1の評価値を算出し、
対象物のモデルを設定し、前記対象物の輪郭点での勾配ベクトルと、該輪郭点に対応するモデルの輪郭点での勾配ベクトルとの一致度を示す第2の評価値を、前記対象物の形状と前記モデルの形状との差違が大きな部分の勾配ベクトルの重みを重くした加重平均にて算出し、
対象物の形状サイズ、形状判別条件に応じて、各評価値に対して重み係数を変動させて設定し、第1と第2の評価値をそれぞれ設定された重み係数で重み付けを行って、
対象物が円形であるか否かを判別することを特徴とする対象物の形状判別方法。 A method for determining the shape of an object provided on an electronic component mounted on a substrate,
When the object is imaged, and the image data is enlarged by digital interpolation according to the size of the object, and the enlargement process is performed, a scanning line is set radially from the center of the image of the object and the scanning is performed. When sampling line image data and separating the sampled section into two, a point having the highest degree of separation is extracted as a contour point, and the perimeter of the contour line obtained by connecting each contour point Find the area of the part surrounded by the outline,
A first evaluation value indicating circularity is calculated from the obtained perimeter and area,
A model of the object is set, and a second evaluation value indicating the degree of coincidence between the gradient vector at the contour point of the object and the gradient vector at the contour point of the model corresponding to the contour point is set as the object. Calculated by a weighted average obtained by increasing the weight of the gradient vector of the portion where the difference between the shape of the model and the shape of the model is large ,
In accordance with the shape size of the object and the shape determination condition, the weighting coefficient is set to vary for each evaluation value, and the first and second evaluation values are respectively weighted with the set weighting coefficient,
A method for discriminating the shape of an object, comprising discriminating whether or not the object is circular.
対象物を撮像する撮像手段と、
対象物の大きさに応じて、画像データをデジタル補間により拡大する画像拡大手段と、
拡大処理をした場合には、対象物の画像の中心から放射線状に走査線を設定して該走査線の画像データをサンプリングし、サンプリングした区間を2つに分離した際に分離度が一番高くなる点を輪郭点として抽出する輪郭点抽出手段と、
各輪郭点を結ぶことにより得られる輪郭線の周囲長並びに該輪郭線で囲まれた部分の面積を算出する算出手段と、
前記求めた周囲長並びに面積から円形度を示す第1の評価値を算出する算出手段と、
対象物のモデルを設定し、前記対象物の輪郭点での勾配ベクトルと、該輪郭点に対応するモデルの輪郭点での勾配ベクトルとの一致度を示す第2の評価値を、前記対象物の形状と前記モデルの形状との差違が大きな部分の勾配ベクトルの重みを重くした加重平均にて算出する算出手段と、
対象物の形状サイズ、形状判別条件に応じて、各評価値に対して重み係数を変動させて設定し、第1と第2の評価値をそれぞれ設定された重み係数で重み付けを行う重み付け手段とを有し、
対象物が円形であるか否かを判別することを特徴とする対象物の形状判別装置。 An apparatus for determining the shape of an object provided on an electronic component mounted on a substrate,
An imaging means for imaging an object;
Image enlarging means for enlarging the image data by digital interpolation according to the size of the object;
When the enlargement process is performed, the scanning line is set radially from the center of the image of the object, the image data of the scanning line is sampled, and the degree of separation is the highest when the sampled section is separated into two. Contour point extraction means for extracting a point that becomes higher as a contour point;
Calculating means for calculating the perimeter of the contour line obtained by connecting each contour point and the area of the portion surrounded by the contour line;
Calculating means for calculating a first evaluation value indicating circularity from the obtained perimeter and area;
A model of the object is set, and a second evaluation value indicating the degree of coincidence between the gradient vector at the contour point of the object and the gradient vector at the contour point of the model corresponding to the contour point is set as the object. Calculating means for calculating a weighted average obtained by increasing the weight of the gradient vector of a portion where the difference between the shape of the model and the shape of the model is large ;
Weighting means for setting a weighting coefficient for each evaluation value in accordance with the shape size and shape discrimination condition of the object, and weighting each of the first and second evaluation values with the set weighting coefficient ; Have
An object shape discriminating apparatus for discriminating whether or not an object is circular.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004300917A JP4566686B2 (en) | 2004-10-15 | 2004-10-15 | Method and apparatus for determining shape of object |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004300917A JP4566686B2 (en) | 2004-10-15 | 2004-10-15 | Method and apparatus for determining shape of object |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2006112930A JP2006112930A (en) | 2006-04-27 |
JP4566686B2 true JP4566686B2 (en) | 2010-10-20 |
Family
ID=36381553
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004300917A Expired - Fee Related JP4566686B2 (en) | 2004-10-15 | 2004-10-15 | Method and apparatus for determining shape of object |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4566686B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9251400B2 (en) | 2011-08-26 | 2016-02-02 | Canon Kabushiki Kaisha | Learning apparatus, method for controlling learning apparatus, detection apparatus, method for controlling detection apparatus and storage medium |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008122259A (en) * | 2006-11-14 | 2008-05-29 | Juki Corp | Method and apparatus for determining shape of object |
JP6397292B2 (en) * | 2014-09-26 | 2018-09-26 | Nok株式会社 | Item identification and image discrimination method by image processing |
JP7108480B2 (en) * | 2018-07-10 | 2022-07-28 | Juki株式会社 | Image processing device, mounting device, image processing method and program |
CN115488876A (en) * | 2022-06-22 | 2022-12-20 | 湖北商贸学院 | Robot sorting method and device based on machine vision |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08315152A (en) * | 1995-05-22 | 1996-11-29 | Sony Corp | Image recognition device |
JP4160192B2 (en) * | 1999-01-07 | 2008-10-01 | Juki株式会社 | Object shape recognition method and apparatus |
JP2003240539A (en) * | 2002-02-14 | 2003-08-27 | Mitsubishi Electric Corp | Method and apparatus for testing surface shape |
-
2004
- 2004-10-15 JP JP2004300917A patent/JP4566686B2/en not_active Expired - Fee Related
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9251400B2 (en) | 2011-08-26 | 2016-02-02 | Canon Kabushiki Kaisha | Learning apparatus, method for controlling learning apparatus, detection apparatus, method for controlling detection apparatus and storage medium |
Also Published As
Publication number | Publication date |
---|---|
JP2006112930A (en) | 2006-04-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100932316B1 (en) | Wafer center detection method and recording medium recording the method | |
CN103279956B (en) | A kind of method detecting chip mounter components and parts positioning precision | |
JP2008036918A (en) | Screen printing apparatus and image recognition alignment method | |
JP4707249B2 (en) | Component position detection method and apparatus | |
JP5160366B2 (en) | Pattern matching method for electronic parts | |
JP4566686B2 (en) | Method and apparatus for determining shape of object | |
CN112150541A (en) | A Multi-LED Wafer Positioning Algorithm | |
WO2020217970A1 (en) | Wire shape measurement device, wire three-dimensional image generation method, and wire shape measurement method | |
JP4890904B2 (en) | Component position detection method and apparatus | |
JP4201321B2 (en) | Member inclination recognition method, member inclination recognition control program, readable recording medium, and outer shape recognition apparatus | |
JP4106301B2 (en) | Component recognition method and apparatus | |
JP3632461B2 (en) | Image recognition method | |
JPH0953915A (en) | Method for recognizing overlapping state | |
JP2000180138A (en) | Calibration plate and calibration device for visual sensor using the same | |
JP2008122259A (en) | Method and apparatus for determining shape of object | |
JP4380864B2 (en) | Component detection method and apparatus | |
JPH10150298A (en) | Electronic component correction angle correction method and electronic component mounting apparatus using the same | |
JP3342171B2 (en) | Component position recognition method and position recognition device | |
JP3680578B2 (en) | Image recognition method and inspection method | |
JPH10332333A (en) | Method for detecting angle of rotation and position of object | |
JPH10117100A (en) | Component position detection method | |
JP4660205B2 (en) | Component recognition method and apparatus | |
JP3925255B2 (en) | Image processing device | |
JPH09147121A (en) | Robot object recognition method and apparatus | |
JP2006234793A (en) | Component position detection method and apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A821 Effective date: 20070202 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20070202 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20071010 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20091218 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20091222 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100219 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100413 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A821 Effective date: 20100610 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20100720 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20100804 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4566686 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130813 Year of fee payment: 3 |
|
LAPS | Cancellation because of no payment of annual fees |