JP2006155248A - Method for detecting gravity center of object - Google Patents

Method for detecting gravity center of object Download PDF

Info

Publication number
JP2006155248A
JP2006155248A JP2004345115A JP2004345115A JP2006155248A JP 2006155248 A JP2006155248 A JP 2006155248A JP 2004345115 A JP2004345115 A JP 2004345115A JP 2004345115 A JP2004345115 A JP 2004345115A JP 2006155248 A JP2006155248 A JP 2006155248A
Authority
JP
Japan
Prior art keywords
pixels
pixel
value
center
gravity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2004345115A
Other languages
Japanese (ja)
Other versions
JP4614746B2 (en
Inventor
Chieko Wakabayashi
千恵子 若林
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.)
Juki Corp
Original Assignee
Juki 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 Juki Corp filed Critical Juki Corp
Priority to JP2004345115A priority Critical patent/JP4614746B2/en
Publication of JP2006155248A publication Critical patent/JP2006155248A/en
Application granted granted Critical
Publication of JP4614746B2 publication Critical patent/JP4614746B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a gravity center detecting method capable of correctly detecting a gravity center of an object without being influenced by the shape of the object or image capturing conditions. <P>SOLUTION: A gravity center is calculated by totaling moments at each pixel position, setting the number of pixels to 1 for a pixel (245-264) of the object, to a value between 0 and 1 (0.854...), for a pixel (265) near an edge, and to 0 for a pixel in background, and totalling the number of the pixels of the object. According to this configuration, since the number of pixels near the edge of the object is set to a value smaller than the number of pixel corresponding to one pixel, the moment near the edge can be calculated by a unit (sub-pixel unit) finer than resolution of one pixel, which makes it possible to correctly detect the gravity center of the object. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、対象物の重心検出方法、更に詳細には、電子部品などの対象物の画像をサブピクセル単位(画素の分解能よりも細かな単位)で画像処理して対象物の重心を検出する方法に関する。   The present invention relates to a method for detecting the center of gravity of an object, and more specifically, detects the center of gravity of an object by subjecting an image of the object such as an electronic component to image processing in sub-pixel units (units finer than pixel resolution). Regarding the method.

従来から、電子部品実装機においては、部品供給装置で吸着された電子部品をCCDカメラで撮像し、その画像を処理することにより、電子部品の重心(部品中心)を求め、吸着姿勢を補正して電子部品を回路基板に搭載することが行われている。   Conventionally, in an electronic component mounting machine, an electronic component picked up by a component supply device is imaged by a CCD camera, and the image is processed to obtain the center of gravity (component center) of the electronic component and correct the suction posture. Electronic components are mounted on circuit boards.

ここで、電子部品などの対象物を撮像して、その画像パターン(図形)の重心位置を検出する方法は、例えば特許文献1などで知られており、重心座標(p,q)は画像の各画素の濃度値を重みとして(二値画像の場合重みを1とする)、モーメントを用いて以下の式で表現できる。   Here, a method of capturing an image of an object such as an electronic component and detecting the position of the center of gravity of the image pattern (graphics) is known, for example, in Patent Document 1, and the center of gravity coordinates (p, q) are the values of the image. The density value of each pixel is used as a weight (in the case of a binary image, the weight is set to 1), and can be expressed by the following equation using a moment.

p=M(1,0)/M(0,0),q=M(0,1)/M(0,0)
M(0,0):図形の面積
M(1,0):Y軸に対するモーメント,M(0,1):X軸に対するモーメント
電子部品実装機では、電子部品の重心を求める際に、電子部品を撮像し、所定のウィンドウ領域を設定してこのウィンドウ領域を多数のラインに沿って走査し、電子部品の画像を多値画像データとしており、例えば、図4(A)には、1ライン分(261番目のライン;Y座標)に対して「240」から「270」の画素位置(X座標)において多値化されたデータ(0〜255)が示されている。この多値画像データは、図4(B)に示したように、所定のしきい値(=109)より小さなデータに対しては「0」とし、それ以上にものに対しては「255」として二値化し、続いて図4(C)に示すように、ノイズを除去した画像データを背景と対象物に分けて、対象物の最初と最後の座標(エッジ)を抽出し(図4(D))、対象物の画素に対してはその画素数(その画素の重みに相当)を1とし、また背景の画素に対してはその画素数を0として、1ライン分の各画素位置「240」〜「270」におけるモーメント(当該位置の画素数×座標値)の総和と、画素数(ピクセル数)の総和を求めている(図5の右側)。そして、これを全てのライン「255」から「285」に対して求めて、各ラインごとに得られたモーメントの総和と対象物の画素数の総和から重心を求めている(図7の右側)。
特公平7−113975
p = M (1,0) / M (0,0), q = M (0,1) / M (0,0)
M (0, 0): Area of figure M (1, 0): Moment with respect to Y-axis, M (0, 1): Moment with respect to X-axis In the electronic component mounting machine, when calculating the center of gravity of the electronic component, the electronic component , A predetermined window area is set, the window area is scanned along a number of lines, and an image of the electronic component is used as multivalued image data. For example, in FIG. Multi-valued data (0 to 255) is shown at pixel positions (X coordinate) from “240” to “270” with respect to (261st line; Y coordinate). As shown in FIG. 4B, this multi-valued image data is “0” for data smaller than a predetermined threshold (= 109), and “255” for data larger than that. As shown in FIG. 4C, the image data from which noise has been removed is divided into a background and an object, and the first and last coordinates (edges) of the object are extracted (FIG. 4 ( D)), the number of pixels (corresponding to the weight of the pixel) is set to 1 for the pixel of the object, and the number of pixels is set to 0 for the background pixel. The sum of moments (number of pixels at the position × coordinate value) and the sum of the number of pixels (number of pixels) in “240” to “270” is obtained (right side in FIG. 5). Then, this is obtained for all lines “255” to “285”, and the center of gravity is obtained from the sum of the moments obtained for each line and the sum of the number of pixels of the object (right side in FIG. 7). .
7-113975

しかしながら、従来の二値画像データによる重心の検出は、撮像した対象物の画像データ上でのエッジ部分が1画素単位での処理となるため、すなわち、その画素に対する重みを1画素に対応する値(画素数1)にして重心を演算しているために、ミクロン単位での精度が求められる現在では、対象物や撮像状態によっては十分な精度が得られないという問題点があった。   However, the conventional detection of the center of gravity using binary image data is because the edge portion on the image data of the captured object is processed in units of one pixel, that is, the weight corresponding to the pixel is a value corresponding to one pixel. Since the center of gravity is calculated with (the number of pixels being 1), there is a problem in that sufficient accuracy cannot be obtained depending on the object and the imaging state at present when accuracy in micron units is required.

図6で説明すると、二値画像データによる重心の検出は、しきい値以上の場合、しきい値に近い濃度値の位置(エッジ付近)でも、しきい値よりもかなり高い濃度値の位置(対象物の中央)でも(図6(A))、画素数1という同等の扱いになり(図6(B))、エッジ近辺の濃度値の変化が生かされず、検出した重心の位置に誤差が発生する場合があった。   Referring to FIG. 6, the detection of the center of gravity based on binary image data is performed when the density value is higher than the threshold value (near the edge) even when the density value is close to the threshold value (near the edge). Even in the center of the object (FIG. 6A), the number of pixels is equivalent (FIG. 6B), and the change in the density value near the edge is not utilized, and an error occurs in the position of the detected center of gravity. It may occur.

又、同様の条件で順次撮像した画像データでも、各位置の濃度値はその都度変わり、その結果しきい値が変わった場合や、指定ウィンドウ領域を変更したことによりしきい値が変わった場合等、しきい値の変化による誤差(ばらつき)が二値重心では大きくなる、という問題があった。   In addition, even in the case of image data taken sequentially under the same conditions, the density value at each position changes each time. As a result, the threshold value changes, or the threshold value changes because the specified window area is changed, etc. There is a problem that an error (variation) due to a change in threshold value becomes large at the binary centroid.

本発明は、このような問題点を解決するもので、対象物の形状や撮像条件に影響されず、対象物の重心を正確に検出することができる重心検出方法を提供することをその課題とする。   The present invention solves such problems, and its object is to provide a center-of-gravity detection method that can accurately detect the center of gravity of an object without being affected by the shape of the object and imaging conditions. To do.

本発明は、
指定ウィンドウ領域内の画像データを画素ごとに多値化し、所定のしきい値以上の画素を対象物の画素としてその画素位置を求め、また対象物の画素に対して画素数を設定し、各画素位置におけるモーメントの総和と対象物の画素数の総和から対象物の重心を検出する重心検出方法において、
対象物のエッジ部以外の各画素に対しては、その画素数を第1の数値に、またエッジ部の画素に対してその画素数を第1の数値より小さな値で0より大きな第2の数値に設定して前記モーメントの総和並びに画素数の総和を求め、求めた各総和から対象物の重心を検出することを特徴とする。
The present invention
The image data in the specified window area is multi-valued for each pixel, the pixel position is determined by setting the pixel above the predetermined threshold as the pixel of the object, and the number of pixels is set for the pixel of the object. In the centroid detection method for detecting the centroid of the object from the sum of moments at the pixel position and the sum of the number of pixels of the object,
For each pixel other than the edge portion of the object, the number of pixels is set to the first numerical value, and for the pixels of the edge portion, the number of pixels is smaller than the first numerical value and is larger than 0 The sum of moments and the sum of the number of pixels are obtained by setting numerical values, and the center of gravity of the object is detected from each of the obtained sums.

本発明では、上記しきい値を第1のしきい値とし、該第1のしきい値より所定の値だけ大きい第2のしきい値を設定し、第1と第2のしきい値間の値を有する画素を、エッジ部の画素とする。そして、前記第2のしきい値以上の画素に対しては画素数を1に、第1のしきい値未満の画素に対しては画素数を0に、また第1と第2のしきい値間の画素に対しては画素数を1と0の間の値に設定して、重心を検出する。   In the present invention, the threshold value is set as the first threshold value, a second threshold value that is larger than the first threshold value by a predetermined value is set, and the interval between the first and second threshold values is set. A pixel having a value of is set as a pixel in the edge portion. The number of pixels is set to 1 for pixels greater than or equal to the second threshold, the number of pixels is set to 0 for pixels less than the first threshold, and the first and second thresholds are set. For pixels between values, the number of pixels is set to a value between 1 and 0, and the center of gravity is detected.

本発明によれば、対象物のエッジ部の画素数を1画素に相当する画素数よりも小さな値に設定するので、エッジ部ないしエッジ付近のモーメントを1画素の分解能より細かな単位(サブピクセル単位)で演算することができ、対象物の形状、あるいは対象物の撮像条件に影響されることなく、対象物の重心を正確に求めることができる。   According to the present invention, since the number of pixels at the edge portion of the object is set to a value smaller than the number of pixels corresponding to one pixel, the moment near the edge portion or the edge is sub-unit (subpixel) smaller than the resolution of one pixel. The center of gravity of the object can be accurately obtained without being affected by the shape of the object or the imaging conditions of the object.

本発明は、対象物の画素に対して画素数を1に設定して、対象物の各画素位置におけるモーメントの総和と対象物の画素数の総和(対象物の面積に相当)から対象物の重心を検出するもので、その場合、背景部に隣接する対象物のエッジ部の画素数を1と0の間の値に設定し、その部分の分解能を高めて重心検出を行うもので、以下に、添付図面を参照して本発明を詳細に説明する。   In the present invention, the number of pixels is set to 1 for the pixel of the object, and the object is calculated from the sum of moments at each pixel position of the object and the sum of the number of pixels of the object (corresponding to the area of the object). In this case, the number of pixels of the edge portion of the object adjacent to the background portion is set to a value between 1 and 0, and the center of gravity is detected by increasing the resolution of the portion. The present invention will be described in detail with reference to the accompanying drawings.

図1は、本発明の一実施例を示す電子部品実装機20と、撮像された電子部品の画像を処理する画像処理装置12の構成を概略示している。   FIG. 1 schematically shows configurations of an electronic component mounting machine 20 according to an embodiment of the present invention and an image processing apparatus 12 that processes a captured image of the electronic component.

同図において、吸着ノズル1は、マシン制御装置13により制御されてX、Y軸方向に移動して部品供給装置(不図示)から供給される電子部品2を吸着する。マシン制御装置13は、電子部品2を吸着した吸着ノズル1を、撮像位置へ移動させ、そこで、照明装置3により照明された電子部品2が、電子部品の種類に応じて標準のCCDカメラ4あるいは高解像度のCCDカメラ5のいずれかにより撮像される。   In the figure, the suction nozzle 1 is controlled by a machine control device 13 and moves in the X and Y axis directions to suck an electronic component 2 supplied from a component supply device (not shown). The machine control device 13 moves the suction nozzle 1 that sucks the electronic component 2 to the imaging position, where the electronic component 2 illuminated by the illumination device 3 is replaced with a standard CCD camera 4 or The image is picked up by one of the high-resolution CCD cameras 5.

撮像された電子部品の画像は、後述するように、画像処理装置12において画像処理され、部品認識が行われ、部品中心(重心)や吸着角度が演算されて部品の吸着姿勢が検出される。その後、電子部品2は、マシン制御装置13により基板14の位置に移動され、吸着姿勢が補正されて回路基板14の所定位置に搭載される。   As will be described later, the captured image of the electronic component is subjected to image processing in the image processing device 12, component recognition is performed, the component center (center of gravity) and the suction angle are calculated, and the suction posture of the component is detected. Thereafter, the electronic component 2 is moved to the position of the substrate 14 by the machine control device 13, the suction posture is corrected, and the electronic component 2 is mounted at a predetermined position on the circuit board 14.

基板14には、基板マークが形成されており、この基板マークは、吸着ノズル1を設けたヘッドに取り付けられる基板認識カメラ15により撮影され、そのマーク画像が画像処理装置12で処理され、基板位置が検出される。基板14に位置ずれがある場合には、その位置ずれが補正されるので、電子部品2は、高精度で基板14上に搭載される。   A substrate mark is formed on the substrate 14, and this substrate mark is photographed by a substrate recognition camera 15 attached to a head provided with the suction nozzle 1, and the mark image is processed by the image processing device 12 to obtain a substrate position. Is detected. If the substrate 14 is misaligned, the misalignment is corrected, so that the electronic component 2 is mounted on the substrate 14 with high accuracy.

画像処理装置12は、カメラ4、5、15からの画像をデジタル値に変換するA/Dコンバータ6と、デジタル画像に変換された電子部品2や基板マークなどの対象物の画像を格納する画像メモリ7、作業用メモリ(RAM)8、重心検出プログラム9、CPU10、インターフェース11から構成されており、撮像された電子部品2や基板14のマークの画像は、画像メモリ7に格納される。CPU10は、重心検出プログラム9を読み込んでそれを実行し、画像メモリ7に格納されている電子部品2あるいは基板マークなどの対象物の画像を含む所定の大きさのウィンドウを指定し、その指定されたウィンドウ領域内の画像を処理して、対象物の重心を検出する。   The image processing apparatus 12 stores an image of an object such as an A / D converter 6 that converts an image from the cameras 4, 5, and 15 into a digital value, and an electronic component 2 or a board mark that has been converted into a digital image. The memory 7 includes a memory 7, a working memory (RAM) 8, a gravity center detection program 9, a CPU 10, and an interface 11. The captured image of the electronic component 2 and the mark of the board 14 is stored in the image memory 7. The CPU 10 reads and executes the center-of-gravity detection program 9 and designates a window having a predetermined size including an image of an object such as the electronic component 2 or the board mark stored in the image memory 7 and is designated. The image in the window area is processed to detect the center of gravity of the object.

重心位置が正常に検出されれば、モニタ16に重心位置を表示し、インタフェース11を介し、マシン制御装置13にその結果を返答する。正常に検出されなかった場合、エラーであったことを返答する。マシン制御装置13は、正常に重心位置の結果を受け取った場合、その情報に従って上記吸着姿勢、あるいは基板位置を補正する補正量を演算して、その補正量に従って吸着ノズル1の移動量を制御し、上述したように、電子部品2を基板14の所定位置に搭載する。   If the center of gravity position is detected normally, the center of gravity position is displayed on the monitor 16 and the result is returned to the machine control device 13 via the interface 11. If it is not detected normally, it returns an error. When the machine control device 13 normally receives the result of the center of gravity position, the machine control device 13 calculates a correction amount for correcting the suction posture or the substrate position according to the information, and controls the movement amount of the suction nozzle 1 according to the correction amount. As described above, the electronic component 2 is mounted on the substrate 14 at a predetermined position.

次に、重心を検出するための画像処理の流れを、図2に従って説明する。   Next, the flow of image processing for detecting the center of gravity will be described with reference to FIG.

まず、画像処理装置12は、指定されたカメラ4又は5又は15を制御し、電子部品2や基板14に形成されたマークなどの対象物の画像を撮像し(ステップS1)、それをA/Dコンバータ6でデジタル化し、画像メモリ7に多値画像データとして記憶し、その画像をモニタ16に表示する。   First, the image processing apparatus 12 controls the designated camera 4, 5, or 15 to capture an image of an object such as a mark formed on the electronic component 2 or the substrate 14 (step S 1). Digitized by the D converter 6, stored as multivalued image data in the image memory 7, and displayed on the monitor 16.

画像メモリ7に記憶される多値画像データの1ライン分(261(Y座標値)のライン)が、図4(A)に示されており、上に示した「240」〜「270」は、該1ラインに沿った画素位置(X座標値)を示し、その画素位置での濃度データが画像データ「0」〜「255」として多値化されている。   One line (261 (Y coordinate value) lines) of the multivalued image data stored in the image memory 7 is shown in FIG. 4A, and “240” to “270” shown above are The pixel position (X coordinate value) along the one line is shown, and the density data at the pixel position is multivalued as image data “0” to “255”.

続いて、重心検出プログラム9は、画像メモリ7のデータについて、指定されたウィンドウ領域内のヒストグラムを作成する。そして、判別分析法により、対象物と背景部を区別するしきい値を算出する(ステップS2)。   Subsequently, the center-of-gravity detection program 9 creates a histogram in the designated window area for the data in the image memory 7. And the threshold value which distinguishes a target object and a background part by a discriminant analysis method is calculated (step S2).

この算出方法が、図3に示されており、同図には、ウィンドウ領域の画像の各濃度値に対してその濃度を有する画素がいくつあるか(頻度)を示したヒストグラムが図示されている。Minは画像の最小濃度値、Maxはその最大濃度値であり、対象物とその背景部を区切るしきい値をThrとすると、そのしきい値Thr以上で最大濃度値Maxまでの濃度値が対象物M2の濃度値であり、しきい値Thr未満で最小濃度値Minまでの濃度値が背景部M1の濃度値である。   This calculation method is shown in FIG. 3, which shows a histogram showing how many pixels having the density (frequency) for each density value of the image in the window area. . Min is the minimum density value of the image, Max is the maximum density value, and if the threshold value that separates the object and the background portion is Thr, the density value up to the maximum density value Max above the threshold Thr is the target. The density value of the object M2 is the density value of the background portion M1 that is less than the threshold Thr and reaches the minimum density value Min.

ここで、しきい値Thrを最小濃度値Minから最大濃度値Maxまで変化させ、各しきい値Thrでの背景部M1の平均濃度値に相当する下限しきい値ThrMinと対象物M2の平均濃度値に相当する上限しきい値ThrMaxを求め、背景部M1の画素数をPMin、対象物M2の画素数をPMaxとして、背景部M1と対象物M2間の分散D、
D=PMin×PMax×{(ThrMin−ThrMax)の2乗}
を求め、その分散が最大になるようなしきい値Thrを求める。
Here, the threshold value Thr is changed from the minimum density value Min to the maximum density value Max, and the lower limit threshold value ThrMin corresponding to the average density value of the background portion M1 at each threshold value Thr and the average density of the object M2 An upper threshold value ThrMax corresponding to the value is obtained, and the variance D between the background part M1 and the object M2 is set, where PMin is the number of pixels of the background part M1 and PMax is the number of pixels of the object M2.
D = PMin × PMax × {(ThrMin−ThrMax) squared}
And a threshold value Thr that maximizes the variance is obtained.

図3には、このようにして分散が最大になるときのしきい値Thr、上限しきい値ThrMax、下限しきい値ThrMinが示されている。   FIG. 3 shows the threshold value Thr, the upper limit threshold value ThrMax, and the lower limit threshold value ThrMin when the variance becomes maximum in this way.

本実施例では、重心の検出にしきい値Thrと上限しきい値ThrMaxを使用しているが、対象物のエッジ部の濃度値がしきい値に近い場合等、対象物の特性や撮像条件等によっては、下限しきい値ThrMinとしきい値Thrの中間値や3/4の値を使用する等の調整も可能である。   In this embodiment, the threshold value Thr and the upper limit threshold value ThrMax are used to detect the center of gravity. However, when the density value of the edge portion of the target object is close to the threshold value, the characteristics of the target object, the imaging conditions, etc. Depending on the case, it is possible to make adjustments such as using an intermediate value between the lower limit threshold value ThrMin and the threshold value Thr or a value of 3/4.

次に、ステップS3において、しきい値の取得判定を行い、指定ウィンドウ領域内の最大濃度値が、重心検出処理の実行が指示された時に情報として渡されていたしきい値の参考値よりも低い場合、指定ウィンドウ領域内には背景しかないと判断し、判別分析法によるしきい値の取得を行わないで、重心検出プログラム9はインタフェース11を介してマシン制御装置13にエラーを通知して(ステップS9)処理を終了する。   Next, in step S3, threshold value acquisition determination is performed, and the maximum density value in the specified window area is lower than the reference value of the threshold value that was passed as information when the execution of the centroid detection process was instructed. In this case, it is determined that there is only a background in the designated window area, and the center-of-gravity detection program 9 notifies the machine control device 13 of an error via the interface 11 without acquiring the threshold value by the discriminant analysis method ( Step S9) The process is terminated.

また、画像データに対してフィルタ処理を行い(ステップS4)、指定ウィンドウ領域内にノイズがあった場合のために、ステップS2で取得したしきい値で多値画像データを二値化し、AND−ORフィルタをかけたデータを作成し、作業用メモリ8に格納しておく。この二値化したデータが図4(B)に示されており、ここでは、しきい値を「109」として、図4(A)の画像データで「109」より小さいデータを「0」(背景)、それ以上のデータを「255」(対象物)として二値化している。また、フィルタ処理により、図4(C)に示したように、画素位置「244」、「266」、「267」の画像データが対象物のデータ「255」に、画素位置「270」のデータが背景データ「0」に変換されている。   Also, filtering is performed on the image data (step S4), and when there is noise in the designated window area, the multi-value image data is binarized with the threshold value acquired in step S2, and AND− Data subjected to the OR filter is created and stored in the work memory 8. The binarized data is shown in FIG. 4B, where the threshold value is “109” and the image data in FIG. 4A is less than “109” and “0” ( (Background), the data more than that is binarized as “255” (object). Further, as shown in FIG. 4C, the image data at the pixel positions “244”, “266”, and “267” is changed to the data “255” of the object, and the data at the pixel position “270” is obtained by the filtering process. Is converted into background data “0”.

続いて、ステップS5において、重心検出を行う。この場合、重心のX座標を検出する場合、指定ウィンドウ領域のY方向に1ライン毎に、又Y座標を検出する場合X方向に1ライン毎に、各画素位置の濃度値と判別分析法で取得した2種類のしきい値、つまりしきい値Thrと上限しきい値ThrMaxを用い以下の条件で比較して、各画素位置を分類する。   Subsequently, in step S5, the center of gravity is detected. In this case, when detecting the X coordinate of the center of gravity, the density value and the discriminant analysis method for each pixel position are detected for each line in the Y direction of the designated window region, and when detecting the Y coordinate, for each line in the X direction. Each pixel position is classified by comparing the obtained two kinds of threshold values, that is, the threshold value Thr and the upper limit threshold value ThrMax under the following conditions.

この分類は、注目する画素位置の濃度値をNとして、
N < Thrならば、「0」
ThrMax ≦ N ならば「1」
Thr ≦ N < ThrMaxならば「2」
と分類して、分類値を画素に付与する。
In this classification, the density value of the pixel position of interest is N,
If N <Thr, “0”
"1" if ThrMax ≤ N
If Thr ≦ N <ThrMax, “2”
And a classification value is assigned to the pixel.

しきい値が「109」、上限しきい値が「170」となる場合で図4(A)に示す多値画像データを上述のアルゴリズムで分類したものが、図4(E)に図示されており、しきい値「109」未満を「0」、上限しきい値「170」以上を「1」、しきい値「109」以上で上限しきい値「170」未満を「2」に分類する。この時、フィルタをかけたデータの該当位置を参照し、分類「1」又は「2」であっても、フィルタをかけたデータ(C)が「0」の場合には、分類「0」とする。画素位置「270」の場合がこの例である。   When the threshold value is “109” and the upper limit threshold value is “170”, the multi-valued image data shown in FIG. 4A is classified by the above algorithm as shown in FIG. The threshold value less than “109” is classified as “0”, the upper threshold value “170” or more is classified as “1”, the threshold value “109” or more and less than the upper threshold value “170” is classified as “2”. . At this time, referring to the corresponding position of the filtered data, even if the classification is “1” or “2”, if the filtered data (C) is “0”, the classification is “0”. To do. The case of the pixel position “270” is this example.

続いて、1ライン分のデータが作成できたら、分類1の先頭位置(ファーストエッジ)と最終位置(セカンドエッジ)で挟まれた内部を、全て分類1に置き換える。これは、対象物の内部に濃度値が低い部分があった場合、内部を対象物として扱うためである。この状態が図4(F)に示されており、画素位置「253」、「256」、「259」〜「262」は、対象物内部のデータとして「1」に置き換えられている。   Subsequently, when data for one line is created, the inside of the first position (first edge) and the last position (second edge) of classification 1 is replaced with classification 1. This is because when there is a portion having a low density value inside the object, the inside is handled as the object. This state is shown in FIG. 4F, and the pixel positions “253”, “256”, “259” to “262” are replaced with “1” as data inside the object.

次にこの1ライン分のデータを見て、分類1の画素に対してはその画素数を1とし、また分類0の画素に対してはその画素数を0とし、分類2の画素に対しては、対象物のエッジ部ないしエッジ近辺の画素であるとして、以下の式により、1画素より細かなサブピクセル単位の画素数(P)を設定する。   Next, looking at the data for one line, the number of pixels for classification 1 pixels is set to 1, the number of pixels for classification 0 is set to 0, and the number of pixels for classification 2 is set to 0. Is set to a pixel number (P) in units of sub-pixels that is finer than one pixel, by assuming that the pixel is an edge portion of the object or a pixel near the edge.

P=(N−(Thr−1))/(ThrMax−(Thr−1))
この時算出される値(画素数)は、0.0 < P < 1.0であり、図4(G)に示したように、画素位置「265」は、エッジ部のデータとして画素数が「0.854...」に算出されている。
P = (N− (Thr−1)) / (ThrMax− (Thr−1))
The value (number of pixels) calculated at this time is 0.0 <P <1.0. As shown in FIG. 4G, the pixel position “265” has the number of pixels as edge data. It is calculated as "0.854 ...".

ここで、画素数1は、その画素位置での画素の数を1(1画素)とするものであり、画素数0は画素なしとするものであり、画素数が「0.0」と「1.0」の間にある場合には、1画素をその値に応じて細分化して得られるサブピクセルの数に相当する。言葉を変えると、画素数は、重心を演算する場合の当該画素位置にある画素の重みを示しており、対象物のエッジ部以外の画素に対しては、その画素の重みを1にし、また背景の画素に対してはその重みを0とし、エッジ部の画素に対しては、「0.0」と「1.0」の間の重みを付与していることになる。   Here, the number of pixels 1 means that the number of pixels at the pixel position is 1 (1 pixel), the number of pixels 0 means no pixels, and the number of pixels is “0.0” and “ When it is between 1.0, it corresponds to the number of sub-pixels obtained by subdividing one pixel according to its value. In other words, the number of pixels indicates the weight of the pixel at the pixel position when calculating the center of gravity. For pixels other than the edge portion of the object, the weight of the pixel is set to 1, The background pixel is assigned a weight of 0, and the edge pixel is assigned a weight between “0.0” and “1.0”.

このようにして、図4(F)の例では、画素位置「265」では、分類2であるので、そのモーメントMは、M=P×Cの式(P=0.854..;C=261)に従って求め、また他の画素位置に対してはPを分類値に従って0あるいは1の値にしてそれぞれ画素位置ごとにモーメントを求め、その1ライン分のモーメントの合計(総和)と、画素数(ピクセル)の合計(総和)を求める。その結果が図5に図示されている。なお、同図において、比較のために、従来技術に従って、図4(D)の画像データに基づいて算出されたものが右側に示されている。   In this way, in the example of FIG. 4F, since the pixel position “265” is the classification 2, the moment M is expressed by the equation M = P × C (P = 0.854. 261), and for other pixel positions, P is set to 0 or 1 according to the classification value to obtain moments for each pixel position, and the sum (sum) of moments for one line and the number of pixels Calculate the sum (total) of (pixels). The result is shown in FIG. In the figure, for comparison, what is calculated based on the image data of FIG. 4D according to the prior art is shown on the right side.

図6には、指定ウィンドウ領域内のX方向、Y方向の全ライン分のデータが図示されており、255ラインから285ライン(Y方向)に対して各画素位置「240」〜「270」(X方向)のデータが図示されている。なお、煩雑さをさけるために、259〜261ラインのデータのみが図示されている。図6(A)は、多値画像データであり、(B)は従来技術による例であり、(C)は本発明に従って、上述したように、エッジ部ないしエッジ付近の画素をサブピクセル化したもので、259ラインと260ラインでは、画素位置「266」の画素が、また261ラインでは、画素位置「265」の画素がサブピクセル化され、その画素数が1と0の間の値となっている。   FIG. 6 shows data for all lines in the X direction and Y direction in the designated window area. The pixel positions “240” to “270” (from 255 lines to 285 lines (Y direction)) are shown. Data in the X direction) are shown. In order to avoid complexity, only the data of 259 to 261 lines are shown. FIG. 6A is multi-value image data, FIG. 6B is an example of the prior art, and FIG. 6C is a pixel sub-pixel of the edge portion or the vicinity of the edge as described above according to the present invention. In the 259th and 260th lines, the pixel at the pixel position “266” is converted into a subpixel, and in the 261 line, the pixel at the pixel position “265” is converted into a subpixel, and the number of pixels is a value between 1 and 0. ing.

続いて、ライン毎に求めたモーメント総和とピクセルの総和について、指定ウィンドウ領域の全ラインの合計(総和)を求め、MSumをモーメント総和,PSumをピクセル総和として、G=MSum/PSumの式により重心(G)を求める。この例が図7に示されている。なお、図7の右側には、従来例の場合、すなわち図6(B)を用いた場合の例が示されている。   Subsequently, for the sum of moments and the sum of pixels obtained for each line, the sum (sum) of all lines in the specified window area is obtained, and MSm is the sum of moments and PSum is the sum of pixels. (G) is obtained. An example of this is shown in FIG. The right side of FIG. 7 shows an example in the case of the conventional example, that is, the case of using FIG.

以上は、重心のY座標値であるが、X座標値についても、Y軸に対するモーメントをそれぞれ算出することにより求めることができる。すなわち、1ラインについて各画素位置でのモーメント(画素数とX座標値の積)を求めて、その総和を求め、それを全ラインに対して求め、全ライン分のモーメントの総和(MSum)と、全画素数の総和(PSum)から、X座標値を求める。   The above is the Y coordinate value of the center of gravity, but the X coordinate value can also be obtained by calculating the moment with respect to the Y axis. That is, the moment (the product of the number of pixels and the X coordinate value) at each pixel position for one line is obtained, the sum is obtained and obtained for all lines, and the sum of moments for all lines (MSum) is obtained. The X coordinate value is obtained from the total sum (PSum) of the total number of pixels.

また、図8には、同じ画像データで指定ウィンドウ領域を変更し、しきい値が「99」となり、上限しきい値が「168」となる場合の例が図示されている。   FIG. 8 shows an example in which the designated window area is changed with the same image data, the threshold value is “99”, and the upper threshold value is “168”.

尚、濃度値がしきい値や上限しきい値と一致した場合について、例えば以下のような条件にすることもできる。   In the case where the density value matches the threshold value or the upper threshold value, for example, the following conditions can be used.

0:N ≦ Thr
1:ThrMax ≦ N
2:Thr < N < ThrMax
この場合、分類2の画素数は以下のようになる。
0: N ≦ Thr
1: ThrMax ≦ N
2: Thr <N <ThrMax
In this case, the number of pixels in category 2 is as follows.

P=(N−Thr)/(ThrMax−Thr)
このように、条件によって、画素数を求める式を変えることにより、濃度値がしきい値と一致した場合にどう扱っているか(背景側として扱っているか対象物側として扱っているか)等、その時々の画像処理の仕様に合わせることができる。
P = (N-Thr) / (ThrMax-Thr)
In this way, by changing the formula for obtaining the number of pixels depending on conditions, how to handle when the density value matches the threshold (whether it is handled as the background side or the object side), etc. It can be adapted to the image processing specifications from time to time.

このようにして、求めた重心検出の良否をステップS6で判定する。対象物がウィンドウ内に収まっていない場合や、指定ウィンドウ領域が1画素しかなかった場合等、重心の検出が不可能な場合には、重心検出プログラム9はインタフェース11を介してマシン制御装置13にエラーを通知し(ステップS9)処理を終了する。   In this way, the quality of the obtained center of gravity detection is determined in step S6. When the center of gravity cannot be detected, such as when the object does not fit within the window or when the designated window area has only one pixel, the center of gravity detection program 9 is sent to the machine controller 13 via the interface 11. An error is notified (step S9) and the process is terminated.

また、重心の検出が成功した場合、モニタ16に表示されている画像上に重心位置を表示し(ステップS7)、重心検出プログラム9はインタフェース11を介してマシン制御装置13に重心位置を通知し(ステップS8)、処理を終了する。   If the center of gravity is detected successfully, the center of gravity is displayed on the image displayed on the monitor 16 (step S7), and the center of gravity detection program 9 notifies the machine controller 13 of the center of gravity through the interface 11. (Step S8), the process ends.

なお、上述した実施例では、対象物のエッジ部以外の画素に対してその画素数を1にしているが、1.5や2など正の数値n(実数)とすることもできる。この場合、エッジ部の画素数Pは、上述した式により得られる画素数のn倍にすればよい。   In the above-described embodiment, the number of pixels other than the edge portion of the object is set to 1, but it may be a positive numerical value n (real number) such as 1.5 or 2. In this case, the number of pixels P in the edge portion may be n times the number of pixels obtained by the above-described formula.

部品実装機と画像処理装置の構成を示したブロック図である。It is the block diagram which showed the structure of the component mounting machine and the image processing apparatus. 対象物の重心を求める流れを示したフローチャートである。It is the flowchart which showed the flow which calculates | requires the gravity center of a target object. 判別分析法によりしきい値を求める方法を示した説明図である。It is explanatory drawing which showed the method of calculating | requiring a threshold value by discriminant analysis. 指定ウィンドウ領域の1ライン分のデータの遷移を示した説明図である。It is explanatory drawing which showed the transition of the data for 1 line of a designation | designated window area | region. 1ライン分のモーメントを求める例を示した表図である。It is a table | surface figure which showed the example which calculates | requires the moment for 1 line. 指定ウィンドウ領域の全ライン分のデータの遷移を示した説明図である。It is explanatory drawing which showed the transition of the data for all the lines of a designation | designated window area | region. 全ライン分のモーメントを求める例を示した表図である。It is the table | surface which showed the example which calculates | requires the moment for all the lines. しきい値を変えた場合の全ライン分のデータの遷移を示した説明図である。It is explanatory drawing which showed the transition of the data for all the lines at the time of changing a threshold value. 図8の例で全ライン分のモーメントを求める例を示した表図である。FIG. 9 is a table showing an example of obtaining moments for all lines in the example of FIG. 8.

符号の説明Explanation of symbols

1 吸着ノズル
2 電子部品
7 画像メモリ
9 重心検出プログラム
12 画像処理装置
13 マシン制御装置
14 基板
DESCRIPTION OF SYMBOLS 1 Adsorption nozzle 2 Electronic component 7 Image memory 9 Center-of-gravity detection program 12 Image processing apparatus 13 Machine control apparatus 14 Board | substrate

Claims (5)

指定ウィンドウ領域内の画像データを画素ごとに多値化し、所定のしきい値以上の画素を対象物の画素としてその画素位置を求め、また対象物の画素に対して画素数を設定し、各画素位置におけるモーメントの総和と対象物の画素数の総和から対象物の重心を検出する重心検出方法において、
対象物のエッジ部以外の各画素に対しては、その画素数を第1の数値に、またエッジ部の画素に対してその画素数を第1の数値より小さな値で0より大きな第2の数値に設定して前記モーメントの総和並びに画素数の総和を求め、求めた各総和から対象物の重心を検出することを特徴とする対象物の重心検出方法。
The image data in the specified window area is multi-valued for each pixel, the pixel position is determined by setting the pixel above the predetermined threshold as the pixel of the object, and the number of pixels is set for the pixel of the object. In the centroid detection method for detecting the centroid of the object from the sum of moments at the pixel position and the sum of the number of pixels of the object,
For each pixel other than the edge portion of the object, the number of pixels is set to the first numerical value, and for the pixels of the edge portion, the number of pixels is set to a second value larger than 0 with a value smaller than the first numerical value. A method for detecting the center of gravity of an object, wherein a sum of the moments and a sum of the number of pixels are set to numerical values, and the center of gravity of the object is detected from each of the obtained sums.
前記しきい値を第1のしきい値とし、該第1のしきい値より所定の値だけ大きい第2のしきい値を設定し、第1と第2のしきい値間の値を有する画素を、前記エッジ部の画素とすることを特徴とする請求項1に記載の対象物の重心検出方法。   The threshold value is set as a first threshold value, a second threshold value that is larger than the first threshold value by a predetermined value is set, and has a value between the first and second threshold values. The center-of-object center-of-gravity detection method according to claim 1, wherein a pixel is the pixel of the edge portion. 前記第1と第2のしきい値を判別分析法により求めることを特徴とする請求項1又は2に記載の対象物の重心検出方法。   3. The method for detecting the center of gravity of an object according to claim 1, wherein the first and second threshold values are obtained by a discriminant analysis method. 前記第2のしきい値以上の画素に対しては画素数を1に、第1のしきい値未満の画素に対しては画素数を0に、また第1と第2のしきい値間の画素に対しては画素数を1と0の間の値に設定することを特徴とする請求項1から3のいずれか1項に記載の対象物の重心検出方法。   The number of pixels is 1 for pixels greater than or equal to the second threshold, the number of pixels is 0 for pixels less than the first threshold, and between the first and second thresholds. 4. The method for detecting the center of gravity of an object according to claim 1, wherein the number of pixels is set to a value between 1 and 0. 5. 前記第1と第2のしきい値間の画素に対する画素数が第1と第2のしきい値に基づいて求められることを特徴とする請求項4に記載の対象物の重心検出方法。   5. The method for detecting the center of gravity of an object according to claim 4, wherein the number of pixels for the pixels between the first and second threshold values is obtained based on the first and second threshold values.
JP2004345115A 2004-11-30 2004-11-30 Method for detecting the center of gravity of an object Active JP4614746B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004345115A JP4614746B2 (en) 2004-11-30 2004-11-30 Method for detecting the center of gravity of an object

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004345115A JP4614746B2 (en) 2004-11-30 2004-11-30 Method for detecting the center of gravity of an object

Publications (2)

Publication Number Publication Date
JP2006155248A true JP2006155248A (en) 2006-06-15
JP4614746B2 JP4614746B2 (en) 2011-01-19

Family

ID=36633474

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004345115A Active JP4614746B2 (en) 2004-11-30 2004-11-30 Method for detecting the center of gravity of an object

Country Status (1)

Country Link
JP (1) JP4614746B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007286930A (en) * 2006-04-18 2007-11-01 Juki Corp Method for detecting gravity center of object
JP2008198111A (en) * 2007-02-15 2008-08-28 Namco Bandai Games Inc Instructed position calculation system, instruction object, and game system
JP2008198112A (en) * 2007-02-15 2008-08-28 Namco Bandai Games Inc Indication position operation system, indication body, and game system
CN104715491A (en) * 2015-04-09 2015-06-17 大连理工大学 Subpixel edge detection method based on one-dimensional gray moment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62228103A (en) * 1986-03-29 1987-10-07 Toshiba Corp Apparatus for measuring substrate
JPS6354680A (en) * 1986-08-26 1988-03-09 Canon Inc Position detector
JPH05181953A (en) * 1991-04-19 1993-07-23 Fuji Photo Film Co Ltd Method for determining image pint in object image
JPH08271223A (en) * 1995-02-03 1996-10-18 Kobe Steel Ltd Device for recognizing object position

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62228103A (en) * 1986-03-29 1987-10-07 Toshiba Corp Apparatus for measuring substrate
JPS6354680A (en) * 1986-08-26 1988-03-09 Canon Inc Position detector
JPH05181953A (en) * 1991-04-19 1993-07-23 Fuji Photo Film Co Ltd Method for determining image pint in object image
JPH08271223A (en) * 1995-02-03 1996-10-18 Kobe Steel Ltd Device for recognizing object position

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007286930A (en) * 2006-04-18 2007-11-01 Juki Corp Method for detecting gravity center of object
JP4707598B2 (en) * 2006-04-18 2011-06-22 Juki株式会社 Method for detecting the center of gravity of an object
JP2008198111A (en) * 2007-02-15 2008-08-28 Namco Bandai Games Inc Instructed position calculation system, instruction object, and game system
JP2008198112A (en) * 2007-02-15 2008-08-28 Namco Bandai Games Inc Indication position operation system, indication body, and game system
US8290214B2 (en) 2007-02-15 2012-10-16 Namco Bandai Games Inc. Indication position calculation system, indicator for indication position calculation system, game system, and indication position calculation method for user input in dynamic gaming systems
CN104715491A (en) * 2015-04-09 2015-06-17 大连理工大学 Subpixel edge detection method based on one-dimensional gray moment
CN104715491B (en) * 2015-04-09 2017-07-21 大连理工大学 A kind of sub-pixel edge detection method based on one-dimensional Gray Moment

Also Published As

Publication number Publication date
JP4614746B2 (en) 2011-01-19

Similar Documents

Publication Publication Date Title
CN109785316B (en) Method for detecting apparent defects of chip
CN109870461B (en) Electronic components quality detection system
CN105718931B (en) System and method for determining clutter in acquired images
CN107452028A (en) A kind of method and device for determining target image positional information
JP2007141222A (en) Image processor and image processing method
CN110009615A (en) The detection method and detection device of image angle point
KR100647750B1 (en) Image processing apparatus
JP4707598B2 (en) Method for detecting the center of gravity of an object
JP4614746B2 (en) Method for detecting the center of gravity of an object
JP4890904B2 (en) Component position detection method and apparatus
JP2021039457A (en) Image processing method, edge model creation method, robot system, and article manufacturing method
CN107535090B (en) Device and method for generating component orientation determination data
JP2007132868A (en) Apparatus and method for measuring shape of cell on gravure plate
JP4566686B2 (en) Method and apparatus for determining shape of object
US11080860B2 (en) Image inspection method
JP4860452B2 (en) Mark positioning method and apparatus using template matching
JP2004325146A (en) Method and device for recognizing part
KR100213345B1 (en) Apparatus for adjusting adjustable component and method for detecting adjusting groove
JP4380864B2 (en) Component detection method and apparatus
JP2008181261A (en) Method and device for extracting contour line of object
US20010049876A1 (en) Mounting electronic component method and apparatus
JP4660205B2 (en) Component recognition method and apparatus
JPH0674714A (en) Substrate position detecting method
JPH11351835A (en) Method for extracting contour line of cutting edge by processing taken image of tool
JP2006234793A (en) Part position detecting method and device

Legal Events

Date Code Title Description
A521 Written amendment

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

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100624

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100629

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100824

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

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

R150 Certificate of patent or registration of utility model

Ref document number: 4614746

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

Year of fee payment: 3