JPS6234004A - Method for detecting center point of circle and circular arc - Google Patents
Method for detecting center point of circle and circular arcInfo
- Publication number
- JPS6234004A JPS6234004A JP17235185A JP17235185A JPS6234004A JP S6234004 A JPS6234004 A JP S6234004A JP 17235185 A JP17235185 A JP 17235185A JP 17235185 A JP17235185 A JP 17235185A JP S6234004 A JPS6234004 A JP S6234004A
- Authority
- JP
- Japan
- Prior art keywords
- image
- center
- center point
- data
- point
- 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
Links
Landscapes
- Length Measuring Devices By Optical Means (AREA)
- Length Measuring Devices With Unspecified Measuring Means (AREA)
Abstract
Description
【発明の詳細な説明】
(産業上の利用分野)
本発明は円および円弧の中心点を検出する方法に関し、
特に、産業用ロボット等に設けられたカメラから、円形
又は円弧形の輪郭を持つ被加工物の画像を入力し、その
画像を処理し、その円又は円弧の中心点を検出する方法
に関する。DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a method for detecting the center point of a circle and an arc;
In particular, the present invention relates to a method of inputting an image of a workpiece having a circular or arcuate outline from a camera installed on an industrial robot, processing the image, and detecting the center point of the circle or arc.
(従来の技術)
近年、コンピュータの形成的な発展に伴って、産業用ロ
ボットにカメラを接続し、人間と同様の視覚を与えるこ
とによって、被加工物の形状や位置等を計測させ、柔軟
性のある加工作業を可能とした、いわゆる人工知能を有
する産業用ロボットの開発が盛んに行なわれている。(Conventional technology) In recent years, with the formative development of computers, industrial robots are connected to cameras and given vision similar to humans, allowing them to measure the shape and position of workpieces, increasing flexibility. Industrial robots with so-called artificial intelligence, which can perform certain processing tasks, are being actively developed.
ところで、産業用ロボットに接続されたカメラから入力
した視覚画像の情報処理方法としては、現在では、2値
画像処理が実用的な視覚システムで最も広く用いられて
いる。By the way, as a method for processing visual images input from a camera connected to an industrial robot, binary image processing is currently most widely used in practical visual systems.
前記した2値画像処理とは、以下に記すような処理を示
す。The binary image processing described above refers to the following processing.
第9図(a)のようにカメラ1によって被加工物2を写
し、この画像をコンピュータに入力し、この画像をMX
N個の画素に分解して前記画像の温度値と、その温度値
に対する画素3の数のヒストグラムを求める。As shown in FIG. 9(a), the workpiece 2 is photographed by the camera 1, this image is input into the computer, and this image is converted into MX.
The temperature value of the image is decomposed into N pixels, and a histogram of the number of pixels 3 with respect to the temperature value is obtained.
前記コンピュータで計紳したヒストグラムの結果は、第
9図(d)に示すようになり、背景に相当する山と被加
工物2に相当する山とが現われる。The result of the histogram calculated by the computer is as shown in FIG. 9(d), in which a peak corresponding to the background and a peak corresponding to the workpiece 2 appear.
この2つの山の間の谷の所の濃度値を閾値tとし、1面
像処理の基準濃度とする。The density value at the valley between these two peaks is set as a threshold value t, and is used as the reference density for single-plane image processing.
そして、各画素毎に閾値tよりも濃度が大きいか小さい
かを判別し、大きければ、画素3に対応するメモリを1
に小さければメモリをOにセラ[・する。Then, it is determined for each pixel whether the density is larger or smaller than the threshold value t, and if it is larger, the memory corresponding to pixel 3 is
If it is smaller than 0, the memory is set to O.
すなわち、2値画像処理とは、被JJO工物の各画素毎
の濃度値が閾値しよりも大きいか小さいかによって、各
画素に対応したメモリを1かOにセットする画像処理方
法である。That is, binary image processing is an image processing method in which a memory corresponding to each pixel is set to 1 or 0 depending on whether the density value of each pixel of the JJO object is larger or smaller than a threshold value.
以上に説明したような2値画像処理を用いて、被加工物
2の円の中心点を検出するには、次のような方法によっ
て行なっていた。The following method has been used to detect the center point of the circle of the workpiece 2 using the binary image processing described above.
第9図(a)に示すように、カメラ1によって被加工物
2を写し、その画像を、大きさMXN画素のデジタル画
像を有するコンピュータに人力する。このようにして入
力された画像は、同図(b)のように示される。As shown in FIG. 9(a), a workpiece 2 is photographed by a camera 1, and the image is manually input to a computer having a digital image having a size of MXN pixels. The image input in this way is shown as shown in FIG. 2(b).
次に、前記デジタル画像の画素3毎の濃度値と前記閾値
tを比較し、デジタル画像を作成する。Next, the density value of each pixel 3 of the digital image is compared with the threshold t to create a digital image.
その計綿結果は同図(C)のように表わされる。The measurement results are shown in the figure (C).
そして同図(C)で示される図形の断面−次モーメント
S(x、y)、前記図形の面積(斜線部分の画素数)Δ
、さらに前記図形の周囲長等を求め、指定された半径を
持つ円と思われる被加工物を判別し、S(x、y)/△
を計痺することにより、前記図形の小心、つまり被加工
物2の円の中心点に相当する画素の座標を求めるように
なっている。Then, the cross-sectional moment of inertia S (x, y) of the figure shown in FIG.
, further determine the circumference of the figure, identify the workpiece that is considered to be a circle with the specified radius, and calculate S(x, y)/△
By measuring , the coordinates of a pixel corresponding to the small center of the figure, that is, the center point of the circle of the workpiece 2 are determined.
(発明が解決しようとづる問題点)
しかしながら、このような従来の円の中心点検出方法に
おっては、被加工物とその背罎のコントラストを利用し
た2値画像処理によって行なっていたために、正確な円
の中心点を検出するには、被加工物とその背景のコント
ラストが良好でおること、かつ被加工物をカメラで写し
出す場合における照明条件ができるだけ一定であること
等厳しい必要限定条1′1がめった。(Problems to be Solved by the Invention) However, in this conventional method for detecting the center point of a circle, binary image processing using the contrast between the workpiece and its back line is used. In order to accurately detect the center point of a circle, there are strict requirements such as the contrast between the workpiece and its background being good, and the illumination conditions when photographing the workpiece with a camera being as constant as possible. '1 was rare.
例えば、第10図<a)に示すような而J(1(り加工
のされた中空円筒形状の被加工物4の円の中心点を検出
する場合を考える。For example, consider the case of detecting the center point of a circle of a hollow cylindrical workpiece 4 that has been machined by J(1) as shown in FIG.
被加工物4をカメラ1で写すと、同図(b)のような画
像がコンピュータに入力される。そしてこのような画像
では、被加工物4の中空部分の濃度値が大きいために、
比較的コントラストが悪く、その濃度値と画素数とのヒ
ストグラムは、第10図(d>に示すようになり、はっ
きりとした閾値t′が設定しにくくなる。When the workpiece 4 is photographed by the camera 1, an image like that shown in FIG. 2(b) is input to the computer. In such an image, since the density value of the hollow part of the workpiece 4 is large,
The contrast is relatively poor, and the histogram of the density value and the number of pixels becomes as shown in FIG. 10 (d>), making it difficult to set a clear threshold value t'.
このように、コントラストの悪い被加工物4を2値画像
処理す°ると、照明条件の影響を受は易いために、コン
ピュータは、照明条件の変化等により、第10図(C)
に示すような画像を計算結果として出力してしまうこと
も考えられ、このような場合には、被加工物4の円の中
心点を誤って検出することになる。In this way, when binary image processing is performed on the workpiece 4 with poor contrast, it is easily affected by the lighting conditions, so the computer may process the image as shown in FIG.
It is also conceivable that an image such as that shown in FIG.
このように、円形の輪郭を持つ部分の内部の明るさが均
一でない被加工物を、画像としてコンピュータに入力し
たり、この被加工物の周囲の照明条件が変化したりする
と、コンピュータで間違った処理がされる可能性があり
、その被加工物の中心点の検出に誤差を生じるという問
題点がおった。In this way, if a workpiece with a circular outline whose interior brightness is not uniform is input into a computer as an image, or if the lighting conditions around this workpiece change, the computer will There is a possibility that processing may occur, and there is a problem that an error may occur in detecting the center point of the workpiece.
本発明は上記のような問題点に鑑みてなされたものであ
り、被加工物の濃淡画像又は輪郭線画像を算出すること
により、被加工物のコントラストの良否にかかわらず、
指定された半径の円又は円弧の中心点を、誤差を生ずる
ことなく検出しうるようにすることを目的とする。The present invention has been made in view of the above-mentioned problems, and by calculating a gray scale image or a contour image of the workpiece, it is possible to calculate the contrast of the workpiece, regardless of the quality of the contrast of the workpiece.
It is an object of this invention to be able to detect the center point of a circle or arc of a specified radius without causing any error.
(問題点を解決するための手段〉
上記目的を達成するために、本発明では、円形輪郭線を
有する被検出体を、画像メモリに記憶し、当該画像メモ
リに記憶されている画像の輪郭線上の一点を通る接線を
算出し、当該接線と直交し、かつ当該一点を通る直線を
算出し、当該直線上に・当該一点から指定半径だけ離れ
た中心候補点を源出し、前記中心候補点の算出を、当該
輪郭線上の全周について行うことによって得られた点を
記憶して中心候補点領域とし、当該中心候補点領域内に
あける点のF、密集点を指定半径の円中心とすることを
特徴とする。(Means for Solving the Problems) In order to achieve the above object, in the present invention, a detected object having a circular contour is stored in an image memory, and the detected object having a circular contour is Calculate a tangent line passing through one point, calculate a straight line that is perpendicular to the tangent line and passing through the one point, find a center candidate point on the straight line and a specified radius away from the one point, and calculate the center candidate point of the center candidate point. The points obtained by performing the calculation for the entire circumference on the contour line are memorized and set as the center candidate point area, and the points F and the dense points are set as the center of a circle with a specified radius in the center candidate point area. It is characterized by
(実施例)
以下に、本発明に係る実施例を、図面に基づいて詳細に
説明する。(Example) Below, an example according to the present invention will be described in detail based on the drawings.
第1図は、本発明に係る円の中心点を検出するS置のブ
ロック図でおる。FIG. 1 is a block diagram of an S position for detecting the center point of a circle according to the present invention.
同図に示すように、この装置は、被加工物を写すテレビ
カメラ1から送られるアナログ画像を、△/Dコンバー
タ6によってデジタル符号に変換し、このデジタル符号
を記憶する画像メモリ7と、画像メモリ7の記憶データ
に基づいて、前記被加工物の輪郭を計算し、抽出する輪
郭抽出部8と、輪郭抽出部8の計算結果を記憶する画像
メモリ9と、画像メモリ7、画像メモリ9及び半径入力
部5の人力データにより、前記被加工物の仮の中心点を
算出する中心候補点算出部10と、中心候補点算出部1
0で計算されたデータを記憶する画像メモリ11と、画
像メモリ]1のデータにより、・閾値を算出する閾値算
出部]3と、画像メモリ11及び閾値算出部13のデー
タにより、前記加工物の中心点を確定する中心点抽出部
12と、中心点抽出部12で算出された結果を、CRT
やプリンタ又は機械の制御装置に出力する出力部14と
で構成されている。As shown in the figure, this device converts an analog image sent from a television camera 1 that captures a workpiece into a digital code using a Δ/D converter 6, and includes an image memory 7 that stores this digital code, and an image memory 7 that stores the digital code. a contour extraction section 8 that calculates and extracts the contour of the workpiece based on the data stored in the memory 7; an image memory 9 that stores the calculation results of the contour extraction section 8; a center candidate point calculation section 10 that calculates a temporary center point of the workpiece based on human data from the radius input section 5; and a center candidate point calculation section 1
The image memory 11 stores the data calculated in 0, and the data in the image memory] 1, the threshold value calculation unit that calculates the threshold value] 3, and the data in the image memory 11 and the threshold value calculation unit 13. A center point extraction unit 12 that determines the center point and a result calculated by the center point extraction unit 12 are
and an output unit 14 for outputting to a printer or a control device of the machine.
次に、このように構成された装置によって、円形輪郭線
を有する被加工物の中心点を算出する過程を、第4図か
ら第8図を参照しつつ、第2歯と第3図のフローチャー
トに塁づいて詳細に説明する。Next, with reference to FIGS. 4 to 8, the process of calculating the center point of a workpiece having a circular outline using the apparatus configured as described above will be described with reference to FIGS. 2 and 3. This will be explained in detail based on the following.
TEP1
まず、プログラムがスタートすると、テレビカメラ1か
ら円形輪郭線を含んだ被加工物の映像信号が、A/Dコ
ンバータ6に送られ、ここで前記映像信号が、各画素毎
にデジタル信号に変換され、その信号が画像メモリ70
指定アドレスに順次送られる。TEP1 First, when the program starts, a video signal of the workpiece including a circular outline is sent from the television camera 1 to the A/D converter 6, where the video signal is converted into a digital signal for each pixel. The signal is stored in the image memory 70.
It will be sent to the specified address in sequence.
例えば1画面が255X240画素で構成されている画
面に、テレビカメラ1から、第5図(a)に示すような
円柱形状を有する被加工物の映像信号が送られると、こ
の映像信号が、8ビツトの分解能(白から黒までの濃淡
度合をO〜255までの256段階に分解してデジタル
化できる能力。)を有するA/Dコンバータ6でデジタ
ル化される。For example, when a video signal of a workpiece having a cylindrical shape as shown in FIG. The data is digitized by an A/D converter 6 having a bit resolution (ability to decompose and digitize the degree of gradation from white to black into 256 steps from 0 to 255).
A/Dコンバータ6でデジタル化された各画素毎の濃度
値は、画像メモリ7の各画素に対応した番地に順次送ら
れる。The density value for each pixel digitized by the A/D converter 6 is sequentially sent to an address corresponding to each pixel in the image memory 7.
TEP2
S T E P 1で説明したように、デジタル化され
た各画素毎の濃度値は、RAMで構成されている画像メ
モリ7の所定番地に夫々格納される。この画像メモリ7
に記憶されている画像は、8ビツトで量子化された濃淡
画像である。As explained in TEP2 S T E P 1, the digitized density value of each pixel is stored in a predetermined location of the image memory 7 constituted by RAM. This image memory 7
The image stored in is an 8-bit quantized grayscale image.
TEP3
画像メモリ7からデータを取り出し、このデータを空間
微分法により2次微分して、被加工物の輪郭線のみを抽
出した輪郭線画像を作成する。ここで、2次微分つまり
、ラプラシアンは、エツジの方向に依存しない2次の微
分オペレータで、画像処理ではよく用いられる。ここで
は、ラプラシアンの詳細な説明は省略する。TEP3 Data is taken out from the image memory 7, and this data is second-order differentiated using the spatial differential method to create a contour image in which only the contour of the workpiece is extracted. Here, the second-order differential, that is, the Laplacian, is a second-order differential operator that does not depend on the edge direction, and is often used in image processing. A detailed explanation of the Laplacian will be omitted here.
このラプラシアンを用いて、画像エツジを求めると、シ
ャープなエツジの場合は、第4図(a)に示すようなラ
プラシアンの曲線が得られ、また、ぼけたエツジの場合
には、同図(b)に示すようなラプラシアンの曲線が得
られる。When image edges are determined using this Laplacian, in the case of sharp edges, a Laplacian curve as shown in Figure 4 (a) is obtained, and in the case of blurred edges, the Laplacian curve shown in Figure 4 (b) is obtained. ) is obtained.
つまり、ラプラシアンの曲線は、エツジの下端と上端で
それぞれ正と負のピークを生じる。従ってエツジの位置
を求めるには、ラプラシアンの曲線の正負両ピーク間の
中央でラプラシアンがOになる場所を探せばよい。In other words, the Laplacian curve has positive and negative peaks at the bottom and top of the edge, respectively. Therefore, in order to find the edge position, it is sufficient to find the place where the Laplacian becomes O at the center between the positive and negative peaks of the Laplacian curve.
以上のように、画像メモリ7に記憶された濃淡画像のラ
プラシアンを計算すると、第5図(b)に示すような輪
郭線画像が得られる。As described above, when the Laplacian of the grayscale image stored in the image memory 7 is calculated, a contour image as shown in FIG. 5(b) is obtained.
PEP4
S T E P 3で処理したラプラシアンによる輪郭
線の抽出においては、雑音に弱く、エツジよりも、細い
線や孤立点に強く反応するという性質を有している。従
って、正確な被加工物の輪郭線を抽出するためには、画
像のノイズ除去が必要となってくる。Contour extraction using the Laplacian processed by PEP4 STEP 3 has the property of being sensitive to noise and responding more strongly to thin lines and isolated points than to edges. Therefore, in order to extract an accurate contour of the workpiece, it is necessary to remove noise from the image.
このノイズを除去するために、本発明では、局所領域の
濃度和の差分を計算するオペレータを用いて、X、Y方
向のノイズを除去している。In order to remove this noise, in the present invention, noise in the X and Y directions is removed using an operator that calculates the difference between the sums of concentrations in local regions.
TEP5
ノイズが除去されて、より鮮明となった輪郭線画像の輪
郭線を、濃淡度の最高値255に、そして背景をOに2
値化する。TEP5 The contour line of the contour image, which has been made clearer by removing noise, is set to the maximum density value of 255, and the background is set to O2.
Value.
つまり、ノイズ除去後の輪郭線画像を、2値画@処理に
よって2値化し、より鮮明な輪郭線画像を作成する。That is, the contour image after noise removal is binarized by binary image @ processing to create a clearer contour image.
以上、S T E P 3から5TEP5の処理は、輪
郭抽出部8で行なわれる。As described above, the processes of STEP 3 to 5TEP5 are performed by the contour extraction section 8.
S T E P 6
STEP5でノイズレスの濃淡画像を2値画像に変換処
理した後の各画素毎の2値化データを、画像メモリ9の
所定番地に夫々格納する。S T E P 6 After converting the noiseless grayscale image into a binary image in STEP 5, the binarized data for each pixel is stored in a predetermined location in the image memory 9, respectively.
TEP7
テレビカメラ1の複写体である円形輪郭線を有する被加
工物の半径rが、半径入力部5、つまり端末機であるキ
ーボード等のようなデータ入力装首によって、中心候補
点算出部10に入力される。TEP7 The radius r of the workpiece having a circular outline, which is a copy of the television camera 1, is input to the center candidate point calculation unit 10 by the radius input unit 5, that is, by the data input head such as a terminal device such as a keyboard. is input.
8TEP8
8ビツトで組子化された濃淡画像が記憶されている画像
メモリ7と、画像メモリ7のデータを2値化した輪郭線
画像が記憶されている′画像メモリ9との記′巴データ
、かつ、半径人力部5から入力された被加工物の半径r
のデータに基づいて、中心候補点算出部10で、後述す
る中心点検出プログラムのザブルーチンでおる中心候補
点検出プログラムを処理することによって、前記被7J
OT物の中心候補点群の画像を作成する。8TEP8 Memory data of the image memory 7 in which the 8-bit muntinated grayscale image is stored and the image memory 9 in which the contour image obtained by binarizing the data in the image memory 7 is stored; And the radius r of the workpiece input from the radius manual section 5
Based on the data, the center candidate point calculation unit 10 processes the center candidate point detection program, which is a subroutine of the center point detection program described later,
Create an image of the center candidate point group of the OT object.
つまり、座像メ七り9に格納されている輪郭線画像の輪
郭線の画素毎に、中心候補点とみなされる画素のX、Y
座標を、輪郭線上の画素の全てについて求めると、第7
図に示づような画像が作成されることになる。In other words, for each pixel of the contour of the contour image stored in the sitting image memo 9, the X, Y
When the coordinates are calculated for all pixels on the contour line, the seventh
An image like the one shown in the figure will be created.
そして、当該画像を作成する時には、中心候補点とみな
される画素の濃度値を1づつ増加して、中心候補点群の
画像とする。Then, when creating the image, the density value of each pixel considered as a center candidate point is increased by 1 to form an image of a group of center candidate points.
TEP9
STEP8で作成した中心候補点群を含む輪郭線画像の
画素毎のデータを画像メモリ11の所定番地に夫々格納
する。TEP9 The data for each pixel of the contour image including the center candidate point group created in STEP8 is stored at a predetermined location in the image memory 11, respectively.
TEP10
閾値算出部13で、予め設定されている闇値t1を中心
点抽出部12に入力する。TEP10 The threshold calculation unit 13 inputs the preset darkness value t1 to the center point extraction unit 12.
5TEPi十
第7図に示す画像を格納している画像メモリ11から、
画素毎のデータを取り出し、閾値算出部13から出力さ
れた閾値t1と、各画素毎のデータとが比較され、閾値
t1よりも小ざい濃度値を有する画素を濃度値Oに設定
する。5TEPi1 From the image memory 11 storing the image shown in FIG.
The data for each pixel is extracted, and the threshold value t1 output from the threshold value calculation unit 13 is compared with the data for each pixel, and pixels having a density value smaller than the threshold value t1 are set to the density value O.
つまり、閾値t1よりも小さい濃度値を有する画素は、
消去されることになる。In other words, a pixel having a density value smaller than the threshold value t1 is
It will be deleted.
5TEP12
STEPI 1で処理された画像は、再び、画像メモリ
110所定番地に更新記憶する。5TEP12 The image processed in STEPI 1 is updated and stored in the image memory 110 at a predetermined location again.
TEP13
閾値算出部13で、再び予め設定されている閾値t2を
中心点抽出部12に入力する。TEP13 The threshold calculation unit 13 inputs the preset threshold t2 to the center point extraction unit 12 again.
STEPI4
STEPI 1と同様に、5TEP12で画像メモリ1
1に格納した画像のデータを取り出し、閾値算出部13
から出力された閾値t2と、各画素毎のデータとが比較
され、閾値t2よりも小さい濃度値を有する画素を消去
する。STEPI4 Similar to STEPI 1, image memory 1 is set to 5TEP12.
1, and extracts the image data stored in the threshold value calculation unit 13.
The threshold value t2 outputted from the threshold value t2 is compared with the data for each pixel, and pixels having density values smaller than the threshold value t2 are erased.
S丁t:P’15
STEP14で処理された閾値t2よりも大きい濃度値
を有する画素の集合体の画像の中で、最も濃度値の大き
い画素の座標を求め、この座標を被加工物の中心とし、
出力部14にその座標を出力する。St t: P'15 Find the coordinates of the pixel with the largest density value in the image of the collection of pixels having density values greater than the threshold value t2 processed in STEP 14, and set these coordinates to the center of the workpiece. year,
The coordinates are output to the output unit 14.
次にステップ8で処理されるサブルーチンのプログラム
について詳述する。Next, the subroutine program processed in step 8 will be described in detail.
5TEP20,5TEP21
S T E P 8で画像メモリ7、画像メモリ9及び
半径入力部5からデータが入力されると、画素のX、Y
座標X1とYlがOに初期化される。5TEP20, 5TEP21 When data is input from the image memory 7, image memory 9, and radius input section 5 in STEP 8, the X, Y of the pixel
Coordinates X1 and Yl are initialized to O.
S T E P 22
STl=P5で2値画像処理された輪郭線画像のデータ
が格納されている画像メモリ9のX、Y座標位置にあけ
る濃度値が、Oで必るかどうかが判断される。この濃度
値がOであれば、5TEP28が、Oでなければ5TE
P23が処理される。S T E P 22 It is determined whether the density value provided at the X and Y coordinate positions of the image memory 9 where the data of the contour image subjected to the binary image processing is stored at STl=P5 must be O. . If this concentration value is O, 5TEP28 is
P23 is processed.
S T’ E P 23
S1EP25で、おる座標における画素の濃度値がOで
なければ、第5図(b)に示すように、この座標A (
Xl、Yl)の画素は、輪郭線上におり、画像メモリ7
に格納されているデータに阜づいて、当該画素の周囲8
画素を、第5図(a)のように区分し、その各画素毎の
濃度値を下記のようにマトリックスとして取り出ずど、
一般式として、
のように書くことができる。ST' E P 23 In S1EP25, if the density value of the pixel at the current coordinate is not O, as shown in FIG. 5(b), this coordinate A (
The pixels Xl, Yl) are on the contour line and are stored in the image memory 7.
Based on the data stored in the pixel,
The pixels are divided as shown in FIG. 5(a), and the density values of each pixel are extracted as a matrix as shown below.
As a general expression, it can be written as.
そして、8画素の濃度値のX、Y方向の変化分△X、△
Yを求めるために、前記マトリックスに、下記に示すX
方向変化分算出オペレータとY方向変化分オペレータを
掛は合せる。Then, the changes in the density values of 8 pixels in the X and Y directions △X, △
In order to find Y, the following X is added to the matrix.
Multiply the direction change amount calculation operator and the Y direction change amount operator.
X方向変化分算出オペレータは、
Y方向変化分算出オペレータは、
この計算を5obe lオペレータを用いて整理すると
濃度値のX方向変化分△Xは、
=−(a 11+ 2 a 2亡a 31)+ (a
13+ 2 a 23+ a 33>・・・(1)
また、濃度値のY方向変化分△Yは、
=−(a 11+ 2 a 12 + a 13)、”
(a 31+ 2832+ 833>・・・(2)
このようにして、輪郭線上のある画素△(Xl。The operator for calculating the change in the X direction is the operator for calculating the change in the Y direction.If this calculation is organized using the 5obel operator, the change in the concentration value in the X direction △X is = - (a 11 + 2 a 2 a 31) + (a
13+ 2 a 23+ a 33>...(1) Also, the change in density value in the Y direction ΔY is =-(a 11+ 2 a 12 + a 13),"
(a 31+ 2832+ 833>...(2) In this way, a certain pixel Δ(Xl.
Yl)についてその周辺の濃度値のX、Y方向変化分△
X、△Yが求められる。Yl), the change in the density value around it in the X and Y directions △
X and △Y are found.
TEP24
S1EP25で求められた輪郭線上のある画素A(Xl
、Yl)におけるX、Y方向の濃度値の変化分ΔX、△
Yに基づいて、当該画素にあける接線(第6図中[て示
される)に垂直な直線の傾きθを求める。TEP24 A certain pixel A (Xl
, Yl) in the X and Y directions ΔX, Δ
Based on Y, the slope θ of a straight line perpendicular to the tangent to the pixel (indicated by [in FIG. 6) is determined.
当該直線の傾きθは、(1)、(2)式で算出した数値
によって第6図に示すように、近似的にθ−Ti1m−
1 ΔY/ΔXで求めることができる。The slope θ of the straight line is approximately θ−Ti1m− as shown in FIG.
1 It can be determined by ΔY/ΔX.
S T E P 25
次に、5TEP7で入力された被加工物の半径rに基づ
いて、中心候補点及び中心候補点より2r fI!Aす
れた点のX座標を求める。S T E P 25 Next, based on the radius r of the workpiece input in 5TEP7, from the center candidate point and the center candidate point, 2r fI! Find the X coordinate of the point that passed A.
第6図に示すように、輪郭線上の必る画素AのX座標X
1を通り、5TFP24で求めた傾きθの直線上、Xl
よりrだけ離れた点、つまり中心候補点と、この中心候
補点より2r離れた点のX座標は、
X=X1r+cosθ(復号同類)
で求めることができる。As shown in Figure 6, the necessary X coordinate of pixel A on the contour line
1, on the straight line with the slope θ determined by 5TFP24, Xl
The X coordinates of a point r away from the center candidate point, that is, a point 2r away from the center candidate point, can be found as follows: X=X1r+cosθ (decoding similarity).
S T E P 26
S1EP25と同様に、中心候補点及び中心候補点より
2rは離れた点のY座標を求める。S T E P 26 Similar to S1EP25, find the Y coordinates of the center candidate point and a point 2r away from the center candidate point.
第6図に示すように、中心候補点と、この中心候補点よ
り2r姐れた点のY座標は、
Y=Y1±rsiηθ(復号同順)
で求めることができる。As shown in FIG. 6, the Y coordinates of the center candidate point and a point 2r smaller than the center candidate point can be determined as follows: Y=Y1±rsiηθ (same order of decoding).
8丁1=P27
S1EP25及びS −1−E P 26で算出された
輪郭線上のおる画素△に対する中心候補点の座標X。8-cho1=P27 Coordinates X of the center candidate point for the pixel Δ on the contour calculated in S1EP25 and S-1-EP26.
Yに相当する画素をプロットする。当該画素のプロット
時には、この画素の9度値を、輪郭線を形成する画素の
濃度値よりも、1ランク、インクリメント(増加〉する
。Plot the pixels corresponding to Y. When plotting the pixel, the 9 degree value of this pixel is incremented (increased) by one rank compared to the density value of the pixel forming the contour line.
TEP28
S T E l) 22において、ある座標の画素の濃
度値がOであると判断された場合、又は5TEP27の
処理後に0、画素のX座標が255になったかどうか判
断される。In TEP28 S T E l) 22, if it is determined that the density value of a pixel at a certain coordinate is O, or after the processing in 5TEP27, it is determined whether the density value of the pixel has become 0 and the X coordinate of the pixel has become 255.
X座標が255ならば5TEP29に、255でなけれ
ば5TEP30にそれぞれ進む。If the X coordinate is 255, proceed to 5TEP29, and if not 255, proceed to 5TEP30.
TEP29
STEP28で画素のX座標が255でないと判断され
ると、画素のX座標を1だけ増加する。TEP29 If it is determined in STEP28 that the pixel's X coordinate is not 255, the pixel's X coordinate is increased by one.
この式は、X1=X1+1で表わせる。This formula can be expressed as X1=X1+1.
そして、S T l:= P 29が実行されると、S
−1−EP22に戻り、前述した処理を、画素の座標
(0゜0)から(255,0>まで行なうことになる。Then, when S T l:= P 29 is executed, S
-1- Returning to EP22, the above-described processing is performed from the pixel coordinates (0°0) to (255,0>).
TEP30
S T E l) 28で画素のX座標が255でおる
と判断されると、強制的に、画素のX座標をOに初期化
する。TEP30 S T E l) When it is determined in step 28 that the pixel's X coordinate is 255, the pixel's X coordinate is forcibly initialized to O.
TEP31
S1ヒP31の処理後に、画素のY座標が240になっ
たかどうか判断される。TEP31 After the processing of S1-P31, it is determined whether the Y coordinate of the pixel has reached 240 or not.
Y座標が240ならばメインルーチンのステップ9に、
240でな(ブれば8TEP32に夫々進む。If the Y coordinate is 240, go to step 9 of the main routine.
If it is 240, proceed to 8TEP32.
STE:P32
S1ヒP31で画素のY座標が240でないと判断され
ると、画素のY座標を1だけ増加する。STE: P32 If it is determined in P31 that the Y coordinate of the pixel is not 240, the Y coordinate of the pixel is increased by 1.
これは、Y1=Yl+1という式で表わされる。This is expressed by the formula Y1=Yl+1.
そして、S T E P 32が実行されると、5TE
P22に戻り、前述した処理を、画素の座標(0゜0)
から(0,240)まで行なうことになる。Then, when S T E P 32 is executed, 5TE
Return to P22 and repeat the process described above with the pixel coordinates (0°0)
This will be performed from (0,240).
以上説明したサブルーチンプログラムを要約ず′ると、
255x 240の画素で構成された画面の全画素につ
いて、濃度値のOでない画素を抽出し、当該画素の座標
に基づいて中心候補点とみなされた座標の画素をプロッ
トする。To summarize the subroutine program explained above,
For all pixels of a screen composed of 255 x 240 pixels, pixels whose density value is not O are extracted, and based on the coordinates of the pixel, the pixels whose coordinates are considered to be the center candidate point are plotted.
このプロット時には、画素のG度値を輪郭線を形成する
画素の濃度値よりも1ランクインクリメントし、中心候
補点群の画像を作成する。During this plotting, the G degree value of the pixel is incremented by one rank compared to the density value of the pixel forming the contour line, and an image of the center candidate point group is created.
なお、5TEP22(7)V2 (Xi、Yl)は、
画像メモリ9の(Xi、Yl)の座標の画素を示し、5
TEP23のVlは画像メモリ7を、5TEP27のv
3は画像メモリ11をそれぞれ表わしている。In addition, 5TEP22(7)V2 (Xi, Yl) is
Indicates the pixel at the coordinates (Xi, Yl) of the image memory 9, 5
Vl of TEP23 is the image memory 7, Vl of 5TEP27 is
3 represents the image memory 11, respectively.
ざらに、第8図には、本発明の円および円弧の中心点検
出方法を用いて、シリンダヘッドのシリンダの中心を求
める過程が示されている。(a )に示される画像は、
テレビカメラ1で写したシリンダヘッドをA/Dコンバ
ータ6でデジタル変換し、画像メモリ7に記憶した画像
である。そして、この画像は、輪郭線抽出部8によって
空間微分処理され、(b)に示すように、輪郭線だけが
抽出されて、この画像が画像メモリ9に記憶される。Briefly, FIG. 8 shows the process of finding the center of the cylinder of the cylinder head using the method for detecting the center point of circles and arcs of the present invention. The image shown in (a) is
This image is a cylinder head photographed by a television camera 1, digitally converted by an A/D converter 6, and stored in an image memory 7. Then, this image is subjected to spatial differentiation processing by the contour line extraction section 8, and only the contour line is extracted as shown in FIG.
次に(a)及び(b)の画像と、半径入力部5で入力さ
れたシリンダの半径rに基づいて、中心候補点痺出部1
0で算出された中心候補点を含む(C)に示ずような画
像が作成され、この画像が画像メモリ11に記憶される
。そして、閾値算出部13で中心点抽出部12に入力し
た閾値以下の濃度値を有する画素を消去して作成された
のが(d)に示す画像でおる。ざらに、再度閾値算出部
13で中心点抽出部12に入力した閾値以下の濃度値を
有する画素を消去し、残った画素の中で最も濃度値の大
きい画素の座標を求める。この最終的な処理がなされた
画像が(e)に示す画像である。Next, based on the images (a) and (b) and the radius r of the cylinder input in the radius input unit 5, the center candidate point numbing area 1
An image as shown in (C) including the center candidate point calculated as 0 is created, and this image is stored in the image memory 11. Then, the image shown in (d) is created by the threshold calculation unit 13 erasing pixels having density values below the threshold input to the center point extraction unit 12. Roughly speaking, the threshold calculation unit 13 again erases pixels having a density value that is less than the threshold value input to the center point extraction unit 12, and calculates the coordinates of the pixel with the largest density value among the remaining pixels. The image that has undergone this final processing is the image shown in (e).
次に、他の実施例としては、輪郭線画像を抽出せずに、
画像メモリ7に記憶されている濃淡画像のみから被加工
物の中心点を検出する方法がある。Next, as another example, without extracting the contour image,
There is a method of detecting the center point of the workpiece only from the gray scale image stored in the image memory 7.
この方法は、濃淡画像の全画素について、前述した実施
例に示すプログラムと同様の処理を行なうものであり、
画像メモリの容量が小さい場合に有効な方法である。This method performs the same processing as the program shown in the above-mentioned embodiment for all pixels of a grayscale image,
This method is effective when the capacity of the image memory is small.
また、その他の実施例としては、画像メモリ9に記憶さ
れている輪郭線画像のみから検出する方法がある。Further, as another example, there is a method of detecting only from the contour image stored in the image memory 9.
この方法は、円の接線を求める際に、輪郭線の傾きから
近似値的に接線の傾きを求め、その接線から中心点を求
める方法である。In this method, when determining a tangent to a circle, the slope of the tangent is approximated from the slope of the contour line, and the center point is determined from the tangent.
そして、上記した3つの実施例は、円の中心点弾出につ
いてのみ説明したが、閾値算出部13から中心点抽出部
12に出力する閾値t2を、円の中心点を搾出する場合
の閾値よりも小ざい値とすることにより、円弧形状を有
する円弧の中心も求めることが可能になる。In the three embodiments described above, only the center point extraction of the circle has been described, but the threshold value t2 output from the threshold value calculation unit 13 to the center point extraction unit 12 is the threshold value for extracting the center point of the circle. By setting a value smaller than , it becomes possible to also find the center of an arc having a circular arc shape.
(発明の効果)
以上の説明より明らかなように、本発明では、濃淡画像
と輪郭線画像に基づいて、円形輪郭線を有する被検出体
の円中心を検出するようにしたので、前記被検出体の輪
郭部とその背景のコン[〜ラストが良好でない画像にお
いても、照明条件等の変化に影響されることがなくなり
、常に正確な円又は円弧の中心点を検出することができ
るようになった。(Effects of the Invention) As is clear from the above description, in the present invention, the center of a circle of a detected object having a circular contour is detected based on a grayscale image and a contour image. Even in images with poor contrast between the contours of the body and its background, it is no longer affected by changes in lighting conditions, etc., and it is now possible to always accurately detect the center point of a circle or arc. Ta.
第1図は本発明に係る円および円弧の中心点を検出する
装置のブロック図、第2図は、第1図に示した装置に内
蔵されているコンピュータのプログラムのフローチセ−
1〜、第3図は第1図に示した装置の中心候補点算出後
で処理されるプログラムのフローチャート、第4図(a
)、(b)は、−Tツジ断面をラプラシアンで処理した
ときの曲線を示す図、第5図及び第6図は中心候補点を
非出する場合の説明図、第7図は中心候補点算出後の画
像を示す図、第8図は本発明の中心点検出方法によって
、実際の画像が処理される過程を示す説明図、第9図及
び第10図は従来の2値画像処理によって中心を搾出す
る場合の説明図で必る。
1・・・テレビカメラ、 2,4・・・被加工物、3・
・・画素。
特許出願人 日産自動車株式会社第4図
工゛7ジ1バリ ラフ諏ンアン
@5図
(a) (b
)第6図
第7図
第8図
(a)(d)
(b)(e)
(C)
、。) 第9図 (b)
(d)
(す
(c)
図 1.。
(d)
大(、!、t’ −J及値FIG. 1 is a block diagram of a device for detecting the center points of circles and arcs according to the present invention, and FIG. 2 is a flowchart of a computer program built in the device shown in FIG.
1 to 3 are flowcharts of the program processed after calculating the center candidate point of the apparatus shown in FIG. 1, and FIG.
), (b) are diagrams showing the curves when the -T Tsuji cross section is processed with Laplacian, Figures 5 and 6 are explanatory diagrams when the center candidate point is not output, and Figure 7 is the center candidate point Figure 8 shows the image after calculation. Figure 8 is an explanatory diagram showing the process by which an actual image is processed by the center point detection method of the present invention. Figures 9 and 10 show the center point detected by conventional binary image processing. It is necessary for explanatory diagram when squeezing out. 1... TV camera, 2, 4... Workpiece, 3.
...pixel. Patent Applicant: Nissan Motor Co., Ltd. 4th Drawing 7th 1st Variation Rough End @ 5 (a) (b
) Figure 6 Figure 7 Figure 8 (a) (d) (b) (e) (C) . ) Fig. 9 (b) (d) (su(c) Fig. 1.. (d) Large (,!, t' -J and value
Claims (1)
当該画像メモリに記憶されている画像の輪郭線上の一点
を通る接線を算出し、当該接線と直交し、かつ当該一点
を通る直線を算出し、当該直線上に当該一点から指定半
径だけ離れた中心候補点を算出し、前記中心候補点の算
出を、当該輪郭線上の全周について行うことによって得
られた点を記憶して中心候補点領域とし、当該中心候補
点領域内における点の最密集点を指定半径の円中心とす
る円および円弧の中心点検出方法。storing a detected object having a circular contour in an image memory;
Calculate a tangent that passes through a point on the outline of the image stored in the image memory, calculate a straight line that is perpendicular to the tangent and passes through the point, and find a center on the straight line that is a specified radius away from the point. A candidate point is calculated, and the points obtained by calculating the center candidate point for the entire circumference on the contour line are stored and set as a center candidate point area, and the most dense point of points within the center candidate point area is stored. A method for detecting the center point of circles and arcs whose center is a circle with a specified radius.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP60172351A JPH0619245B2 (en) | 1985-08-07 | 1985-08-07 | Circle and arc center point detection method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP60172351A JPH0619245B2 (en) | 1985-08-07 | 1985-08-07 | Circle and arc center point detection method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS6234004A true JPS6234004A (en) | 1987-02-14 |
| JPH0619245B2 JPH0619245B2 (en) | 1994-03-16 |
Family
ID=15940287
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP60172351A Expired - Lifetime JPH0619245B2 (en) | 1985-08-07 | 1985-08-07 | Circle and arc center point detection method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0619245B2 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112147143A (en) * | 2020-09-23 | 2020-12-29 | 西安热工研究院有限公司 | An anatomical measurement method for the arc radius of the root of a common thread |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS5635005A (en) * | 1979-08-29 | 1981-04-07 | Mitsubishi Electric Corp | Detector for center position of object to be measured |
| JPS56132506A (en) * | 1980-03-22 | 1981-10-16 | Ando Electric Co Ltd | Measuring device for center position of hole |
-
1985
- 1985-08-07 JP JP60172351A patent/JPH0619245B2/en not_active Expired - Lifetime
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS5635005A (en) * | 1979-08-29 | 1981-04-07 | Mitsubishi Electric Corp | Detector for center position of object to be measured |
| JPS56132506A (en) * | 1980-03-22 | 1981-10-16 | Ando Electric Co Ltd | Measuring device for center position of hole |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112147143A (en) * | 2020-09-23 | 2020-12-29 | 西安热工研究院有限公司 | An anatomical measurement method for the arc radius of the root of a common thread |
Also Published As
| Publication number | Publication date |
|---|---|
| JPH0619245B2 (en) | 1994-03-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108345881B (en) | Document quality detection method based on computer vision | |
| EP1430446B1 (en) | Image processing method for appearance inspection | |
| CN110211101A (en) | A kind of rail surface defect rapid detection system and method | |
| DE102015113434A1 (en) | Method for object localization and pose estimation for an object of interest | |
| CN109781737B (en) | Detection method and detection system for surface defects of hose | |
| US5621825A (en) | Image processor, image processing method and apparatus applying same | |
| CN116797602A (en) | Surface defect identification method and device for industrial product detection | |
| JP2003143401A (en) | Automatic real time recovering method of original image | |
| JP3627249B2 (en) | Image processing device | |
| CN108961248A (en) | It is a kind of applied to the cabinet surface scratch detection method comprising complex information | |
| JPH0664611B2 (en) | Circle and arc center point detection method | |
| JP7712268B2 (en) | Estimate support device, estimate support method, and program | |
| JPH0718812B2 (en) | Foreign object detection method | |
| JP3223385B2 (en) | Pattern matching device for grayscale images | |
| JPH0619245B2 (en) | Circle and arc center point detection method | |
| CN114266748A (en) | A method and device for judging the surface integrity of a craft board in the field of rail transit maintenance | |
| JPH0688789A (en) | Method for extracting density fluctuation constitution picture element in image and method for judging concentration fluctuation mass | |
| JPH0431751A (en) | Defect detecting method by visual inspection | |
| JPH0827841B2 (en) | Appearance inspection method | |
| JPS59201180A (en) | Detecting system of feature of contour | |
| JPS625480A (en) | Edge detection system | |
| JPH05225336A (en) | Method for extracting boundary and device therefor | |
| Lee et al. | Generating Datasets from 3D CAD Models for Object Detection | |
| Zheng et al. | Computer vision system for inspecting defects in welding seams based on x-ray pictures | |
| JPH0544725Y2 (en) |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| EXPY | Cancellation because of completion of term |