JPH05215513A - Image center measuring apparatus and fitting apparatus using same - Google Patents

Image center measuring apparatus and fitting apparatus using same

Info

Publication number
JPH05215513A
JPH05215513A JP4056679A JP5667992A JPH05215513A JP H05215513 A JPH05215513 A JP H05215513A JP 4056679 A JP4056679 A JP 4056679A JP 5667992 A JP5667992 A JP 5667992A JP H05215513 A JPH05215513 A JP H05215513A
Authority
JP
Japan
Prior art keywords
image
center
measuring
center position
run length
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP4056679A
Other languages
Japanese (ja)
Inventor
Hitoshi Naito
均 内藤
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.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
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 Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP4056679A priority Critical patent/JPH05215513A/en
Publication of JPH05215513A publication Critical patent/JPH05215513A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To obtain an image-center measuring apparatus, which can adequately measure the position of the center of an image even if a missing part is present in the image of an object and to obtain a fitting device, which can fit another body into the recess part of one body. CONSTITUTION:An image-center measuring apparatus 10 is constituted of a TV camera 5 and an image processing device 6. The central position is measured for the image part of each lead inserting hole of a substrate 1. A position determining device 4 aligns the position of the lead of an electronic component 2 for the lead inserting hole. Then, a working device 7 inserts the lead of the electronic component 2 into the lead inserting hole. The image-center measuring device 10 performs raster scanning for the image part of the lead inserting hole in the orthognally intersecting two directions and measures the coordinates of the central position. In this measurement, only the measured data for the image part other than the missing part are selected and used for the computation of the coordinates.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、例えば物体の表面に
設けられた凹部に対し、他の物体を正しく嵌入するため
の技術であって、前記物体を撮像して得られた前記凹部
などの画像部分の中心位置を計測するのに用いられる画
像中心計測装置およびその装置が用いられた嵌め合い装
置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a technique for correctly fitting another object into a recess provided on the surface of an object, such as the recess obtained by imaging the object. The present invention relates to an image center measuring device used to measure the center position of an image portion and a fitting device using the device.

【0002】[0002]

【従来の技術】たとえばプリント基板上に電子部品を実
装する場合に、リード挿入孔を有するプリント基板と電
子部品との少なくとも一方を相手部材へ導き、電子部品
のリードをプリント基板のリード挿入孔へ位置合わせし
て挿入することが行われている。
2. Description of the Related Art For example, when mounting an electronic component on a printed circuit board, at least one of the printed circuit board having the lead insertion hole and the electronic component is guided to a mating member, and the lead of the electronic component is inserted into the lead insertion hole of the printed circuit board. It is being done by aligning and inserting.

【0003】図8は、基板40に設けられた所定の円形
孔41に対し、端面が円形の棒状体42を挿入する状態
を示している。この挿入作業に先立ち、テレビカメラに
より前記円形孔41を含む視野で前記基板40を上方位
置より撮像して、図9に示すような2値画像43を生成
し、その2値画像43につき円形孔の画像部分44の重
心位置G1を画像中心として計測した後、その画像中心
に相当する円形孔41の中心位置に棒状体42の中心線
を位置合わせして、棒状体42を円形孔41へ挿入す
る。
FIG. 8 shows a state in which a rod-shaped body 42 having a circular end surface is inserted into a predetermined circular hole 41 provided in a substrate 40. Prior to this insertion work, the substrate 40 is imaged from above by a television camera in a field of view including the circular hole 41 to generate a binary image 43 as shown in FIG. After measuring the center of gravity G1 of the image portion 44 as the image center, the center line of the rod-shaped body 42 is aligned with the center position of the circular hole 41 corresponding to the image center, and the rod-shaped body 42 is inserted into the circular hole 41. To do.

【0004】[0004]

【発明が解決しようとする課題】しかしながらこの方法
では、前記円形孔41の孔周縁にバリなどの突起が存在
していると、円形孔の画像部分44に突起に対応する欠
け部分45が生ずるため、計測される重心位置G2は突
起がないときの適正な重心位置G1から位置ずれし、円
形孔41への棒状体42の挿入を円滑に行うことが困難
となり、物体の破損や変形を招く虞がある。
However, in this method, when a protrusion such as a burr is present on the peripheral edge of the circular hole 41, a missing portion 45 corresponding to the protrusion is generated in the image portion 44 of the circular hole. The measured center-of-gravity position G2 deviates from the proper center-of-gravity position G1 when there is no protrusion, and it becomes difficult to smoothly insert the rod-shaped body 42 into the circular hole 41, which may lead to damage or deformation of the object. There is.

【0005】また前記棒状体42の端面を撮像して得ら
れた画像より画像中心を計測する場合も、前記棒状体4
2の端面に欠けなどが存在していると、棒状体の端面の
画像部分に欠け部分が生ずるため、同様に計測される重
心位置は欠けがないときの適正な重心位置から位置ずれ
し、円形孔41への棒状体42の挿入を円滑に行うこと
が困難である。
Also, when the image center is measured from the image obtained by picking up the end face of the rod-shaped body 42, the rod-shaped body 4 is also measured.
If there is a chip on the end face of No. 2, a chip is generated on the image part of the end face of the rod-shaped body. Therefore, the center of gravity position measured in the same way is displaced from the proper center of gravity position when there is no chip, and the circle It is difficult to smoothly insert the rod-shaped body 42 into the hole 41.

【0006】この発明は、上記問題に着目してなされた
もので、対象物を撮像して得られた画像に欠け部分が存
在していても、画像中心の位置を適正に計測できる画像
中心計測装置を提供することを目的とする。またこの発
明は、上記画像中心計測装置を用いることにより、第1
の物体の表面に設けられた凹部に対し、第2の物体を円
滑に嵌入することが可能な嵌め合い装置を提供すること
を目的とする。
The present invention has been made in view of the above-mentioned problems, and image center measurement capable of appropriately measuring the position of the image center even if there is a missing portion in the image obtained by imaging the object. The purpose is to provide a device. Further, according to the present invention, by using the image center measuring device,
It is an object of the present invention to provide a fitting device capable of smoothly fitting the second object into the concave portion provided on the surface of the object.

【0007】[0007]

【課題を解決するための手段】請求項1にかかる発明
は、対象物を撮像して得られた画像の中心位置を計測す
るための画像中心計測装置であって、前記入力画像を2
値化処理して2値画像を生成する2値化回路と、前記2
値画像を直交する2方向へラスタ走査して2値画像にお
ける対象物の画像部分の中心位置座標を計測する直交座
標計測回路とを備えたものである。前記直交座標計測回
路は、各走査線上の対象物の画像部分につき対象物の不
良部位にかかる画像部分を除く画像部分についてのラン
レングスを走査方向毎に選択して計測するランレングス
計測手段と、前記ランレングス計測手段により計測され
た走査方向毎のすべてのランレングスについて中心位置
の座標の平均値を対象物の画像部分の中心位置座標とし
て算出する演算手段とを備えている。
The invention according to claim 1 is an image center measuring apparatus for measuring the center position of an image obtained by imaging an object, wherein
A binarizing circuit for binarizing to generate a binary image;
And a Cartesian coordinate measuring circuit for measuring the center position coordinates of the image portion of the object in the binary image by raster scanning the value image in two orthogonal directions. The Cartesian coordinate measurement circuit, for the image portion of the object on each scanning line, the run length measuring means for selecting and measuring the run length of the image portion excluding the image portion of the defective portion of the object, for each scanning direction, And an arithmetic means for calculating an average value of the coordinates of the center position for all the run lengths for each scanning direction measured by the run length measuring means, as the center position coordinates of the image portion of the object.

【0008】請求項2にかかる発明は、第1の物体の表
面に設けられた凹部に対し第2の物体を嵌入するための
嵌め合い装置であって、第1の物体を撮像して得られた
前記凹部の画像部分の中心位置を計測するための画像中
心計測装置と、前記画像中心計測装置による計測結果に
基づき第1の物体の凹部に対して第2の物体を位置合わ
せする位置決め装置と、前記位置決め装置による位置合
わせ後に、第2の物体を第1の物体の凹部へ嵌入する作
業装置とから成る。前記画像中心計測装置は、前記入力
画像を2値化処理して2値画像を生成する2値化回路
と、前記2値画像を直交する2方向へラスタ走査して2
値画像における凹部の画像部分の中心位置座標を計測す
る直交座標計測回路とを備えており、前記直交座標計測
回路は、各走査線上の凹部の画像部分につき凹部の不良
部位にかかる画像部分を除く画像部分についてのランレ
ングスを走査方向毎に選択して計測するランレングス計
測手段と、前記ランレングス計測手段により計測された
走査方向毎のすべてのランレングスについて中心位置の
座標の平均値を凹部の画像部分の中心位置座標として算
出する演算手段とを備えている。
According to a second aspect of the present invention, there is provided a fitting device for fitting the second object into the concave portion provided on the surface of the first object, which is obtained by imaging the first object. An image center measuring device for measuring the center position of the image portion of the recess, and a positioning device for aligning the second object with the recess of the first object based on the measurement result by the image center measuring device. And a working device for fitting the second object into the recess of the first object after the positioning by the positioning device. The image center measuring device binarizes a binary image of the input image to generate a binary image, and rasterizes the binary image in two orthogonal directions.
And a Cartesian coordinate measuring circuit for measuring the center position coordinates of the image portion of the concave portion in the value image, wherein the Cartesian coordinate measuring circuit excludes the image portion related to the defective portion of the concave portion for the image portion of the concave portion on each scanning line. Run length measuring means for selecting and measuring the run length of the image portion for each scanning direction, and an average value of the coordinates of the center position of the concave portion for all the run lengths for each scanning direction measured by the run length measuring means. And a calculation means for calculating the center position coordinates of the image portion.

【0009】[0009]

【作用】入力画像の2値画像を直交する2方向へラスタ
走査して、各走査線上の対象物の画像部分につき対象物
の不良部位にかかる画像部分を除く画像部分についての
ランレングスを走査方向毎に選択して計測し、計測され
た走査方向毎のすべてのランレングスについて中心位置
の座標の平均値を画像の中心位置座標として算出するの
で、たとえ入力画像に欠け部分が存在していても、画像
中心の位置を適正に計測できる。また対象物が物体に設
けられた凹部である場合、前記凹部の画像の中心位置を
適正に計測した後、その計測結果に基づき凹部に対して
物体を位置合わせしてその物体を凹部へ嵌入するので、
円滑な嵌入が可能であって、物体の破損や変形が生ずる
虞はない。
The binary image of the input image is raster-scanned in two orthogonal directions, and the run lengths of the image portions of the object on each scanning line except the image portion of the defective portion of the object are scanned. Select and measure for each, and calculate the average value of the coordinates of the center position for all run lengths measured for each scanning direction as the center position coordinates of the image, so even if there are missing parts in the input image , The position of the image center can be measured appropriately. When the object is a recess provided in the object, after properly measuring the center position of the image of the recess, the object is aligned with the recess based on the measurement result and the object is fitted into the recess. So
Smooth fitting is possible, and there is no risk of damage or deformation of the object.

【0010】[0010]

【実施例】図1は、この発明にかかる画像中心計測装置
および嵌め合い装置を電子部品実装装置に適用した例を
示す。図示例の電子部品実装装置は、プリント基板(以
下「基板」という)1上に電子部品2を実装するための
ものであり、搬送機構3,位置決め装置4,テレビカメ
ラ5,画像処理装置6,作業装置7より成る。前記基板
1には電子部品2のリードを挿入するための複数のリー
ド挿入孔が貫通して設けられている。
1 shows an example in which an image center measuring device and a fitting device according to the present invention are applied to an electronic component mounting device. The electronic component mounting apparatus of the illustrated example is for mounting an electronic component 2 on a printed circuit board (hereinafter referred to as a “board”) 1, and includes a transport mechanism 3, a positioning device 4, a television camera 5, an image processing device 6, and the like. It comprises a working device 7. The board 1 is provided with a plurality of lead insertion holes for inserting the leads of the electronic component 2.

【0011】前記搬送機構3は基板1を位置決め装置4
へ搬入するための基板搬入用の搬送コンベヤ8と、部品
実装後の基板1を位置決め装置4より搬出する基板搬出
用の搬送コンベヤ9とから成る。
The transfer mechanism 3 positions the substrate 1 by a positioning device 4
It comprises a board-carrying conveyor 8 for carrying in the board, and a board-carrying conveyor 9 for carrying out the board 1 after mounting the components from the positioning device 4.

【0012】前記テレビカメラ5および画像処理装置6
は、基板1の各リード挿入孔の画像の中心位置を計測す
る画像中心計測装置10を構成する。テレビカメラ5は
CCDカメラなどであり、画像処理装置6は画像処理部
11とビデオモニタ12とを含む。
The television camera 5 and the image processing device 6
Constitutes an image center measuring device 10 for measuring the center position of the image of each lead insertion hole of the substrate 1. The television camera 5 is a CCD camera or the like, and the image processing device 6 includes an image processing unit 11 and a video monitor 12.

【0013】前記作業装置7は、位置決め装置4の上方
に位置し、電子部品2を吸着または把持などの方法で保
持して、電子部品2のリードを基板1の所定のリード挿
入孔へ挿入する。
The working device 7 is located above the positioning device 4, holds the electronic component 2 by a method such as suction or gripping, and inserts the lead of the electronic component 2 into a predetermined lead insertion hole of the substrate 1. ..

【0014】前記位置決め装置4は、XYステージ13
の上面に搬送コンベヤ14を配置して成る。この搬送コ
ンベヤ14は左右の搬送ベルトより成り、この搬送ベル
ト間に設けられた一対の支持板15,15上に基板1の
前後を支持する。この位置決め装置4は、基板1をテレ
ビカメラ5の観測位置へ導きかつ各リード挿入孔をテレ
ビカメラ5の観測視野内に順次位置決めすると共に、基
板1をテレビカメラ5の観測位置から作業装置7の作業
位置へ移動させかつ前記画像中心計測装置10による計
測結果に基づき基板1の各リード挿入孔に対して所定の
電子部品2のリードを位置合わせする。
The positioning device 4 includes an XY stage 13
The conveyor 14 is arranged on the upper surface of the. The transfer conveyor 14 is composed of left and right transfer belts, and supports the front and rear of the substrate 1 on a pair of support plates 15 and 15 provided between the transfer belts. The positioning device 4 guides the substrate 1 to the observation position of the television camera 5 and positions each lead insertion hole in the observation field of view of the television camera 5 sequentially, and at the same time, moves the substrate 1 from the observation position of the television camera 5 to the working device 7 The lead of the predetermined electronic component 2 is aligned with each lead insertion hole of the substrate 1 based on the measurement result of the image center measuring device 10 after being moved to the work position.

【0015】図2は、前記画像処理装置6の画像処理部
11の回路構成を示す。テレビカメラ5は基板1を上方
より撮像して入力画像を生成し、画像処理部11は前記
入力画像の画像信号を入力して各リード挿入孔の画像部
分の中心位置を計測する。
FIG. 2 shows a circuit configuration of the image processing section 11 of the image processing apparatus 6. The television camera 5 images the substrate 1 from above to generate an input image, and the image processing unit 11 inputs the image signal of the input image and measures the center position of the image portion of each lead insertion hole.

【0016】前記画像処理部11は、A/D変換器2
0,2値化回路21,画像メモリ22,表示インターフ
ェイス23,マイクロコンピュータ24などを含んでお
り、A/D変換器20はアナログ量の画像信号をディジ
タル化し、2値化回路21はディジタル量の画像信号を
所定の2値化しきい値で2値化して2値画像を生成す
る。画像メモリ22は前記2値画像を画素単位で記憶
し、表示インターフェイス23は濃淡の入力画像または
2値画像をアナログ化してビデオモニタ12へ出力して
表示させる。
The image processing section 11 includes an A / D converter 2
The A / D converter 20 digitizes analog image signals, and the binarization circuit 21 digitizes the digital signals. The image signal is binarized with a predetermined binarization threshold value to generate a binary image. The image memory 22 stores the binary image on a pixel-by-pixel basis, and the display interface 23 converts the grayscale input image or the binary image into an analog form and outputs it to the video monitor 12 for display.

【0017】マイクロコンピュータ24は、画像中心の
計測や位置決め装置4および作業装置7の動作制御を行
うためのもので、制御・演算の主体であるCPU25
と、このCPU25にバス28を介して接続されるRO
M26およびRAM27とを有する。また、前記バス2
8には前記画像メモリ22が接続される。前記ROM2
6には、CPU25による制御手順がプログラム化して
格納され、RAM27にはCPU25が前記制御手順を
実行する上で必要なデータが書き込まれる。
The microcomputer 24 is for measuring the center of the image and controlling the operation of the positioning device 4 and the working device 7. The CPU 25 is the main body of control and calculation.
And the RO connected to the CPU 25 via the bus 28.
It has M26 and RAM27. Also, the bus 2
The image memory 22 is connected to 8. ROM2
A control procedure by the CPU 25 is programmed and stored in the RAM 6, and data necessary for the CPU 25 to execute the control procedure is written in the RAM 27.

【0018】図5および図6は、リード挿入孔の画像部
分30の中心位置を計測する原理を示す。このリード挿
入孔の画像部分30には、リード挿入孔の開口縁に存在
するバリに起因した欠け部分31が含まれる。なお同図
中、32は画像上に設定されるXY座標系である。
FIGS. 5 and 6 show the principle of measuring the center position of the image portion 30 of the lead insertion hole. The image portion 30 of the lead insertion hole includes a chipped portion 31 due to a burr existing at the opening edge of the lead insertion hole. In the figure, reference numeral 32 is an XY coordinate system set on the image.

【0019】同図において、33はリード挿入孔の画像
部分30に設定された計測領域であって、図5はこの計
測領域33内をX方向へラスタ走査する状態を、図6は
この計測領域33内をY方向へラスタ走査する状態を、
それぞれ示す。なお34はX方向に沿う各走査線であ
り、35はY方向に沿う各走査線である。
In the figure, reference numeral 33 denotes a measurement region set in the image portion 30 of the lead insertion hole. FIG. 5 shows a state in which the measurement region 33 is raster-scanned in the X direction, and FIG. 6 shows this measurement region. The state of raster scanning inside 33 in the Y direction is
Shown respectively. Incidentally, 34 is each scanning line along the X direction, and 35 is each scanning line along the Y direction.

【0020】リード挿入孔の画像部分30の中心位置を
求めるには、まず計測領域33内の画像をX方向に走査
し、各走査線34毎にリード挿入孔の画像部分30の開
始点Sおよび終了点Eの各X座標XSj,XEjを検出し、
開始点Sと終了点Eとの間の距離、すなわち各走査線3
4上のリード挿入孔の画像部分30のランレングスLXj
を求める。
In order to obtain the center position of the image portion 30 of the lead insertion hole, first, the image in the measurement area 33 is scanned in the X direction, and the starting point S and the start point S of the image portion 30 of the lead insertion hole are set for each scanning line 34. Detect each X coordinate X Sj , X Ej of the end point E,
The distance between the start point S and the end point E, that is, each scan line 3
Run length L Xj of the image part 30 of the lead insertion hole on 4
Ask for.

【0021】このランレングスLXjが1個計測されたと
きは、そのランレングスLXjの中心点CのX座標XCj
算出し、前回の走査線34上のランレングスLX(j-1)
中心点CのX座標XC(j-1)と比較する。その結果、両者
の差が所定のしきい値d以下であれば、そのランレング
スLXjおよび中心点CのX座標XCjをひとつの集合の中
に登録する。
When one run length L Xj is measured, the X coordinate X Cj of the center point C of the run length L Xj is calculated, and the run length L X (j-1 on the previous scanning line 34 is calculated. ) Of the center point C of X ) is compared with the X coordinate X C (j-1) . As a result, if the difference between the two is less than or equal to the predetermined threshold value d, the run length L Xj and the X coordinate X Cj of the center point C are registered in one set.

【0022】もし両者の差がしきい値を越えた場合は、
リード挿入孔の画像部分30に欠け部分31が存在する
と判断し、加えてこれまでの登録データの集合が欠け部
分31についてのものであるか、またはこれ以後の登録
データが欠け部分31についてのものであるかのいずれ
かであると判断して、以後、あらたな登録データの集合
を生成する。
If the difference between the two exceeds a threshold value,
It is judged that the missing portion 31 exists in the image portion 30 of the lead insertion hole, and additionally, the set of registration data so far is for the missing portion 31, or the registration data thereafter is for the missing portion 31. Then, a new set of registration data is generated thereafter.

【0023】また1走査線上にランレングスが複数個計
測された場合は、その走査線34上に欠け部分31が存
在すると判断し、その走査線34についての計測データ
は無効として採用しない。
When a plurality of run lengths are measured on one scanning line, it is judged that the missing portion 31 exists on the scanning line 34, and the measurement data for the scanning line 34 is invalid and is not adopted.

【0024】最後に、いずれの登録データの集合が、欠
け部分31を除く適正なリード挿入孔の画像部分30に
ついてのものであるかを判断し、適正な登録データの集
合よりリード挿入孔の画像部分30の中心位置のX座標
C を算出する。
Finally, it is judged which set of registration data is for the image portion 30 of the proper lead insertion hole excluding the missing portion 31, and the image of the lead insertion hole is obtained from the proper set of registration data. The X coordinate X C of the center position of the portion 30 is calculated.

【0025】このようにして中心位置のX座標XC が求
まると、つぎに計測領域35内の画像をY方向に走査し
て同様の処理を実行すれば、リード挿入孔の画像部分3
0の中心位置のY座標Yc が求まる。
When the X coordinate X C of the center position is obtained in this way, the image in the measurement area 35 is then scanned in the Y direction and the same processing is executed.
The Y coordinate Y c of the center position of 0 is obtained.

【0026】図3は、上記原理に基づく前記CPU25
による画像中心計測のための制御手順をステップ1(図
中、「ST1」で示す)〜ステップ18で示す。まず同
図のスタート時点において、基板1が搬送コンベヤ8に
より位置決め装置4の搬送コンベヤ14上に搬入される
と、搬送コンベヤ14が作動して、基板1をテレビカメ
ラ5の観測位置へ導いた後、XYステージ13を作動さ
せてテレビカメラ5の観測視野内に最初のリード挿入孔
を位置決めする。
FIG. 3 shows the CPU 25 based on the above principle.
The control procedure for measuring the image center by means of step 1 (shown as "ST1" in the figure) to step 18 is shown. First, at the start of the figure, when the substrate 1 is loaded onto the transport conveyor 14 of the positioning device 4 by the transport conveyor 8, the transport conveyor 14 operates to guide the substrate 1 to the observation position of the television camera 5. , XY stage 13 is operated to position the first lead insertion hole within the observation field of view of the television camera 5.

【0027】つぎにテレビカメラ5により基板1が撮像
されて入力画像が生成され、その画像信号は画像処理装
置6の画像処理部11に取り込まれて、A/D変換器2
0によりディジタル化され、さらに2値化回路21によ
り2値化処理されて、その2値画像は画像メモリ22に
格納される。
Next, the television camera 5 captures an image of the substrate 1 to generate an input image, and the image signal thereof is taken into the image processing section 11 of the image processing apparatus 6 and the A / D converter 2 is supplied.
The image is digitized by 0, further binarized by the binarization circuit 21, and the binary image is stored in the image memory 22.

【0028】つぎにステップ1では、CPU25は集合
の番号を計数するためのカウンタiとY座標を計数する
ためのカウンタjとを「1」に、また各集合の登録デー
タ数を計数するためのカウンタNi を「0」にセット
し、さらに前記のしきい値dとして「1」(画素数)を
セットする。これらデータの計数や記憶はCPU25ま
たはRAM27の記憶領域を用いて行われる。
Next, in step 1, the CPU 25 sets the counter i for counting the number of the set and the counter j for counting the Y coordinate to "1", and the number of registered data of each set. and sets a counter N i to "0", further sets "1" (the number of pixels) as the threshold d. The counting and storage of these data are performed using the storage area of the CPU 25 or the RAM 27.

【0029】つぎにCPU25は画像メモリ22に格納
された2値画像に対して計測領域を設定して、その計測
領域内の画像をX方向へラスタ走査する。その結果、Y
座標が「1」(j=1)の走査線上にリード挿入孔の画
像部分が存在していない場合、ステップ3の判定が「N
O」となってステップ14へ進み、カウンタjをインク
リメントし、ステップ15を経てステップ2へ戻る。以
下、カウンタjをインクリメントしながらラスタ走査を
進行させる。
Next, the CPU 25 sets a measurement area for the binary image stored in the image memory 22, and rasterizes the image in the measurement area in the X direction. As a result, Y
When the image portion of the lead insertion hole does not exist on the scanning line whose coordinates are “1” (j = 1), the determination in step 3 is “N”.
It becomes "O" and proceeds to step 14, increments the counter j, returns to step 2 through step 15. Thereafter, the raster scanning is advanced while incrementing the counter j.

【0030】この走査過程において、たとえば5行目
(j=5)の走査線上にリード挿入孔の画像部分の開始
点Sおよび終了点Eが検出されると、ステップ3の判定
が「YES」となり、つぎのステップ4において、CP
U25はこれらの点が2対以上検出されたか否かにより
走査線上の画像部分が欠け部分により分割されているか
否かを判定する。その判定が「NO」であれば、CPU
25は開始点SのX座標XS5と終了点EのX座標XE5
の差によりランレングスLX5を求めると共に、つぎの
式によりX座標XS5, XE5の平均値XC5、すなわちラン
レングスLX5の中心点CのX座標XC5を算出する。
In this scanning process, if the starting point S and the ending point E of the image portion of the lead insertion hole are detected on the scanning line of the fifth line (j = 5), for example, the determination at step 3 becomes "YES". , In the next step 4, CP
U25 determines whether or not two or more pairs of these points are detected and the image portion on the scanning line is divided by the missing portion. If the determination is “NO”, the CPU
25 is the difference between the X coordinate X S5 of the start point S and the X coordinate X E5 of the end point E, and the run length L X5 is obtained. The average value X C5 of the X coordinates X S5 , X E5 , that is, the run The X coordinate X C5 of the center point C of the length L X5 is calculated.

【0031】[0031]

【数1】 [Equation 1]

【0032】つぎのステップ6では、CPU25は今回
得られたデータが最初のものであるか否か、すなわち前
回の走査により前記平均値が算出されているか否かを判
定しており、この場合その判定は「NO」であり、ステ
ップ9へ進んで、カウンタNi をインクリメントし、続
くステップ10で前記平均値XC5およびランレングスL
X5をそのままRAM27の第1の集合領域G(1)に登
録し、さらにステップ14でカウンタjをインクリメン
トする。
In the next step 6, the CPU 25 determines whether or not the data obtained this time is the first one, that is, whether or not the average value has been calculated by the previous scan. The judgment is “NO”, the routine proceeds to step 9, where the counter N i is incremented, and at the following step 10, the average value X C5 and the run length L.
X5 is directly registered in the first aggregation area G (1) of the RAM 27, and the counter j is incremented in step 14.

【0033】つぎの6行目の走査において、リード挿入
孔の画像部分の開始点および終了点が検出され、しかも
これらの点が1対である場合は、ステップ3が「YE
S」、ステップ4が「NO」となってステップ5へ進
み、同様の方法でランレングスLX6および平均値CX6
算出される。
In the next scanning of the sixth line, the start point and the end point of the image portion of the lead insertion hole are detected, and when these points are a pair, step 3 is "YE".
S ”, step 4 becomes“ NO ”and the process proceeds to step 5, and the run length L X6 and the average value C X6 are calculated by the same method.

【0034】つぎのステップ6は、前回の走査により前
記平均値CX5が算出されているから、その判定は「YE
S」であり、ステップ7へ進み、CPU25は今回の走
査で得られた平均値CX6と前回の走査で得られた平均値
X5との差の絶対値を算出し、その算出値が前記のしき
い値d以下であるか否かを判定する。もしその判定が
「YES」であれば、ステップ9へ進んで、カウンタN
i をインクリメントし、続くステップ10で前記平均値
X6およびランレングスLX6をRAM27の第1の集合
領域G(1)に登録し、さらにステップ14でカウンタ
jをインクリメントする。
In the next step 6, since the average value C X5 has been calculated by the previous scanning, the judgment is "YE".
S ”, the CPU 25 proceeds to step 7 and calculates the absolute value of the difference between the average value C X6 obtained by the current scanning and the average value C X5 obtained by the previous scanning, and the calculated value is the above-mentioned value. Is less than or equal to the threshold value d. If the determination is “YES”, the process proceeds to step 9 and the counter N
i is incremented, and in the following step 10, the average value C X6 and run length L X6 are registered in the first aggregation area G (1) of the RAM 27, and in step 14, the counter j is incremented.

【0035】つぎの7行目の走査において、リード挿入
孔の画像部分の開始点および終了点がそれぞれ2個検出
されたと仮定すると、ステップ3が「YES」、つぎの
ステップ4も「YES」となり、第1の集合領域G
(1)のデータ数記憶領域GR(1)にカウンタNi
値(この場合「2」)を書き込んでカウンタNi をクリ
アし、カウンタiをインクリメントした後、つぎの行の
走査に移行する(ステップ11〜14)。
If it is assumed that two starting points and two ending points of the image portion of the lead insertion hole are detected in the next scanning of the seventh row, step 3 becomes "YES" and step 4 also becomes "YES". , The first gathering area G
(1) is cleared to data number storage area GR (1) the counter N i values (in this case "2") writes the counter N i of, after incrementing the counter i, the process proceeds to scan the next line (Steps 11-14).

【0036】またj行目の走査において、リード挿入孔
の画像部分の開始点および終了点がそれぞれ1個検出さ
れたとき、ステップ3が「YES」、ステップ4が「N
O」となってステップ5へ進み、同様の方法でランレン
グスLXjおよび平均値XCjが算出される。つぎのステッ
プ6において、前回の走査により前記平均値XC(j-1)
算出されたと判定され、しかもステップ7で算出された
今回の走査で得られた平均値XCjと前回の走査で得られ
た平均値XC(j-1)との差の絶対値が前記しきい値dより
大きいと判定されたとき、ステップ8が「NO」とな
り、同様にi番目の集合領域G(i)のデータ数記憶領
域GR(i)にカウンタNi の値を書き込んでカウンタ
i をクリアし、カウンタiをインクリメントする(ス
テップ11〜13)。
When one start point and one end point of the image portion of the lead insertion hole are detected in the scanning of the j-th row, step 3 is "YES" and step 4 is "N".
Then, the run length L Xj and the average value X Cj are calculated by the same method. In the next step 6, it is determined that the average value X C (j-1) has been calculated in the previous scan, and the average value X Cj obtained in the current scan calculated in step 7 and the previous scan When it is determined that the absolute value of the difference from the obtained average value X C (j−1) is larger than the threshold value d, step 8 becomes “NO”, and similarly, the i-th collective area G (i the number of data storage area GR (i) writes the value of the counter N i) of the counter is cleared N i, increments the counter i (step 11-13).

【0037】走査を進行しつつ同様の手順を繰り返し実
行することにより、例えば図7に示すように、RAM2
7には登録データの集合が複数個生成されることにな
る。かくして計測領域内の画像につき走査が完了する
と、ステップ15の判定が「YES」となり、CPU2
5は各集合毎にランレングスの合計値を算出し、その合
計値が最大となる登録データの集合が欠け部分を除く適
正なリード挿入孔の画像部分についてのものであると判
断し、つぎの式によりその集合に含まれる全てのX座
標XCjを登録データ数Ni で割って、リード挿入孔の画
像部分の中心位置のX座標XC を算出する。
By repeating the same procedure while the scanning is in progress, for example, as shown in FIG.
In 7, a plurality of sets of registration data will be generated. Thus, when the scanning of the image in the measurement region is completed, the determination in step 15 is “YES”, and the CPU 2
5 calculates the run length total value for each set, judges that the set of registered data having the maximum total value is for the image portion of the appropriate lead insertion hole excluding the missing portion, and All the X-coordinates X Cj included in the set are divided by the number of registered data N i by the formula to calculate the X-coordinate X C of the center position of the image portion of the lead insertion hole.

【0038】[0038]

【数2】 [Equation 2]

【0039】このようにして中心位置のX座標XC が求
まると、つぎに計測領域内の画像をY方向に走査して同
様の手順を実行すれば、リード挿入孔の画像部分の中心
位置のY座標YC が求まる。このY座標YC を算出する
制御手順も図3および図4と同様であり、ここでは図示
および説明を省略する。
When the X coordinate X C of the center position is obtained in this way, the image in the measurement area is then scanned in the Y direction and the same procedure is performed to determine the center position of the image portion of the lead insertion hole. The Y coordinate Y C is obtained. The control procedure for calculating the Y coordinate Y C is similar to that in FIGS. 3 and 4, and illustration and description thereof are omitted here.

【0040】このようにして基板1の全てのリード挿入
孔について中心位置が計測されると、画像処理部11は
位置決め装置4の搬送コンベヤ14を作動させて基板1
を作業位置へ搬送する。作業位置では、作業装置7が所
定の電子部品2を保持し、一方、XYステージ13が駆
動して、前記画像中心計測装置10による計測結果に基
づいて基板1のリード挿入孔と電子部品2のリードとを
位置合わせして、前記電子部品2のリードがリード挿入
孔へ挿入される。
When the center positions of all the lead insertion holes of the substrate 1 are measured in this way, the image processing section 11 operates the transport conveyor 14 of the positioning device 4 to operate the substrate 1.
To the work position. At the working position, the working device 7 holds a predetermined electronic component 2, while the XY stage 13 is driven, and based on the measurement result by the image center measuring device 10, the lead insertion hole of the substrate 1 and the electronic component 2 are The leads of the electronic component 2 are inserted into the lead insertion holes by aligning the leads with each other.

【0041】なお上記実施例は、リード挿入孔の画像部
分の中心位置を算出するものであるが、この発明の画像
中心計測装置10は、リード挿入孔のような凹部の画像
部分に限らず、軸端面などの画像の中心位置を計測する
ような装置にも実施できる。また上記実施例は、基板1
のリード挿入孔へ電子部品2のリードを挿入する電子部
品実装装置であるが、この発明の嵌め合い装置は、電子
部品の実装に限らず、ある物体の凹部へ他の物体を嵌入
することが必要な任意の装置に広く適用できる。
Although the above embodiment calculates the center position of the image portion of the lead insertion hole, the image center measuring apparatus 10 of the present invention is not limited to the image portion of the recess such as the lead insertion hole. It can also be implemented in a device that measures the center position of an image such as a shaft end face. In addition, in the above-described embodiment, the substrate 1
Although the electronic component mounting apparatus inserts the lead of the electronic component 2 into the lead insertion hole of the electronic component, the fitting apparatus of the present invention is not limited to mounting the electronic component, and can insert another object into the recess of an object. Widely applicable to any required device.

【0042】[0042]

【発明の効果】この発明は上記の如く、入力画像の2値
画像を直交する2方向へラスタ走査して、各走査線上の
対象物の画像部分につき対象物の不良部位にかかる画像
部分を除く画像部分についてのランレングスを走査方向
毎に選択して計測し、計測された走査方向毎のすべての
ランレングスについて中心位置の座標の平均値を画像の
中心位置座標として算出するように構成したから、たと
え入力画像に欠け部分が存在していても、画像中心の位
置を適正に計測することができる。
As described above, according to the present invention, the binary image of the input image is raster-scanned in two orthogonal directions, and the image portion of the target object on each scanning line is excluded. The run length for the image portion is selected and measured for each scanning direction, and the average value of the coordinates of the center position for all the measured run lengths for each scanning direction is calculated as the center position coordinate of the image. Even if the input image has a missing portion, the position of the image center can be properly measured.

【0043】また対象物が物体に設けられた凹部である
場合に、上記により前記凹部の画像の中心位置を計測し
た後、その計測結果に基づき凹部に対して物体を位置合
わせした後、その物体を凹部へ嵌入するように構成した
から、ある物体の凹部へ他の物体を円滑に嵌入すること
が可能であり、物体の破損や変形が生ずる虞がないな
ど、発明目的を達成した顕著な効果を奏する。
When the object is a recess provided in the object, the center position of the image of the recess is measured as described above, the object is aligned with the recess based on the measurement result, and then the object Since it is configured to be fitted into the recess, it is possible to smoothly fit another object into the recess of one object, and there is no risk of damage or deformation of the object, etc. Play.

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

【図1】この発明が実施された電子部品実装装置の全体
構成を示す説明図である。
FIG. 1 is an explanatory diagram showing an overall configuration of an electronic component mounting apparatus embodying the present invention.

【図2】画像処理部の回路構成例を示すブロック図であ
る。
FIG. 2 is a block diagram illustrating a circuit configuration example of an image processing unit.

【図3】画像処理部のCPUの制御手順を示すフローチ
ャートである。
FIG. 3 is a flowchart showing a control procedure of a CPU of an image processing unit.

【図4】画像処理部のCPUの制御手順を示すフローチ
ャートである。
FIG. 4 is a flowchart showing a control procedure of a CPU of an image processing unit.

【図5】画像中心の計測原理を示す説明図である。FIG. 5 is an explanatory diagram showing the principle of measuring the image center.

【図6】画像中心の計測原理を示す説明図である。FIG. 6 is an explanatory diagram showing a measurement principle of an image center.

【図7】RAMの登録データを示す説明図である。FIG. 7 is an explanatory diagram showing registration data in a RAM.

【図8】円形孔へ棒状体を挿入する状態を示す斜面図で
ある。
FIG. 8 is a perspective view showing a state where a rod-shaped body is inserted into a circular hole.

【図9】円形孔の2値画像を示す説明図である。FIG. 9 is an explanatory diagram showing a binary image of a circular hole.

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

4 位置決め装置 5 テレビカメラ 6 画像処理装置 7 作業装置 10 画像中心計測装置 13 XYステージ 14 搬送コンベヤ 21 A/D変換器 24 マイクロコンピュータ 25 CPU 26 ROM 27 RAM 4 Positioning Device 5 Television Camera 6 Image Processing Device 7 Working Device 10 Image Center Measuring Device 13 XY Stage 14 Transport Conveyor 21 A / D Converter 24 Microcomputer 25 CPU 26 ROM 27 RAM

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 対象物を撮像して得られた画像の中心位
置を計測するための画像中心計測装置であって、 前記入力画像を2値化処理して2値画像を生成する2値
化回路と、 前記2値画像を直交する2方向へラスタ走査して2値画
像における対象物の画像部分の中心位置座標を計測する
直交座標計測回路とを備え、 前記直交座標計測回路は、 各走査線上の対象物の画像部分につき対象物の不良部位
にかかる画像部分を除く画像部分についてのランレング
スを走査方向毎に選択して計測するランレングス計測手
段と、 前記ランレングス計測手段により計測された走査方向毎
のすべてのランレングスについて中心位置の座標の平均
値を対象物の画像部分の中心位置座標として算出する演
算手段とを備えて成る画像中心計測装置。
1. An image center measuring device for measuring a center position of an image obtained by picking up an image of an object, wherein the input image is binarized to generate a binary image. A circuit and a Cartesian coordinate measuring circuit that raster-scans the binary image in two orthogonal directions to measure the center position coordinates of the image portion of the object in the binary image. For the image portion of the object on the line, the run length measuring means for selecting and measuring the run length of the image portion excluding the image portion related to the defective part of the object, and the run length measuring means measured the run length. An image center measuring device, comprising: an arithmetic means for calculating an average value of coordinates of a center position for all run lengths in each scanning direction as coordinates of a center position of an image portion of an object.
【請求項2】 第1の物体の表面に設けられた凹部に対
し第2の物体を嵌入するための嵌め合い装置であって、 第1の物体を撮像して得られた前記凹部の画像部分の中
心位置を計測するための画像中心計測装置と、 前記画像中心計測装置による計測結果に基づき第1の物
体の凹部に対して第2の物体を位置合わせする位置決め
装置と、 前記位置決め装置による位置合わせ後に、第2の物体を
第1の物体の凹部へ嵌入する作業装置とから成り、 前記画像中心計測装置は、 前記入力画像を2値化処理して2値画像を生成する2値
化回路と、 前記2値画像を直交する2方向へラスタ走査して2値画
像における凹部の画像部分の中心位置座標を計測する直
交座標計測回路とを備え、 前記直交座標計測回路は、 各走査線上の凹部の画像部分につき凹部の不良部位にか
かる画像部分を除く画像部分についてのランレングスを
走査方向毎に選択して計測するランレングス計測手段
と、 前記ランレングス計測手段により計測された走査方向毎
のすべてのランレングスについて中心位置の座標の平均
値を凹部の画像部分の中心位置座標として算出する演算
手段とを備えて成る嵌め合い装置。
2. A fitting device for fitting a second object into a concave part provided on the surface of a first object, wherein an image portion of the concave part obtained by imaging the first object. An image center measuring device for measuring the center position of the object, a positioning device for aligning a second object with a concave portion of the first object based on a measurement result by the image center measuring device, and a position by the positioning device And a working device for fitting the second object into the concave portion of the first object after the matching, wherein the image center measuring device binarizes the input image to generate a binary image. And a Cartesian coordinate measurement circuit that raster-scans the binary image in two orthogonal directions to measure the center position coordinates of the image portion of the recess in the binary image. Concave per image part of concave Run length measuring means for selecting and measuring the run lengths of the image parts excluding the image part related to the defective part for each scanning direction, and centering all run lengths for each scanning direction measured by the run length measuring means A fitting device comprising an arithmetic means for calculating an average value of position coordinates as center position coordinates of the image portion of the recess.
JP4056679A 1992-02-06 1992-02-06 Image center measuring apparatus and fitting apparatus using same Pending JPH05215513A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4056679A JPH05215513A (en) 1992-02-06 1992-02-06 Image center measuring apparatus and fitting apparatus using same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4056679A JPH05215513A (en) 1992-02-06 1992-02-06 Image center measuring apparatus and fitting apparatus using same

Publications (1)

Publication Number Publication Date
JPH05215513A true JPH05215513A (en) 1993-08-24

Family

ID=13034119

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4056679A Pending JPH05215513A (en) 1992-02-06 1992-02-06 Image center measuring apparatus and fitting apparatus using same

Country Status (1)

Country Link
JP (1) JPH05215513A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009236786A (en) * 2008-03-27 2009-10-15 Ohm Denki Kk Method and apparatus for inspecting through-hole
JP2010535680A (en) * 2007-08-08 2010-11-25 ポスコ Slab center of gravity measuring device and method
CN114531789A (en) * 2022-02-21 2022-05-24 浙江蓝晶芯微电子有限公司 Quartz crystal resonator pin positioning process with limiting mechanism

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010535680A (en) * 2007-08-08 2010-11-25 ポスコ Slab center of gravity measuring device and method
US8413491B2 (en) 2007-08-08 2013-04-09 Posco Apparatus and method for measuring center of gravity of slabs
JP2009236786A (en) * 2008-03-27 2009-10-15 Ohm Denki Kk Method and apparatus for inspecting through-hole
CN114531789A (en) * 2022-02-21 2022-05-24 浙江蓝晶芯微电子有限公司 Quartz crystal resonator pin positioning process with limiting mechanism

Similar Documents

Publication Publication Date Title
US6748104B1 (en) Methods and apparatus for machine vision inspection using single and multiple templates or patterns
JP3711599B2 (en) Mounting component inspection equipment
JP3266429B2 (en) Pattern detection method
JPH05215513A (en) Image center measuring apparatus and fitting apparatus using same
JPH11125514A (en) Bending angle detecting device
JP2011043998A (en) Method and apparatus for analyzing image
US20080008381A1 (en) Coordinate acquisition apparatus for test of printed board, and coordinate acquisition method and program for test thereof
JP3627249B2 (en) Image processing device
JP4860452B2 (en) Mark positioning method and apparatus using template matching
JPH07263897A (en) Part recognition device and part mounting device
JP4380864B2 (en) Component detection method and apparatus
JP3342171B2 (en) Component position recognition method and position recognition device
JP2000194861A (en) Method and device for recognizing image
JP2004118467A (en) Member inclination recognizing method, member inclination recognition control program, readable recording medium, and shape recognizing device
JP2004363262A (en) Device and method for processing picked-up image of electronic-part mounting machine
JPH11132737A (en) Image processing method
JP2006112930A (en) Object-shape discriminating method and apparatus
JPH06137837A (en) Part attitude judgement method for visual attitude selection device
JPH01251176A (en) Pattern position recognizing device
JPH06260794A (en) Method and equipment for recognizing position of electronic part
JP2517570B2 (en) Pattern detection method
JPH05272945A (en) Apparatus for inspecting bent part of lead
JP3111432B2 (en) Image processing device
JPH11259641A (en) Method for observing body, body observing device using the same method, and vehicle observing device
JP2001175865A (en) Image processing method and its device