JPH0451874B2 - - Google Patents
Info
- Publication number
- JPH0451874B2 JPH0451874B2 JP61073405A JP7340586A JPH0451874B2 JP H0451874 B2 JPH0451874 B2 JP H0451874B2 JP 61073405 A JP61073405 A JP 61073405A JP 7340586 A JP7340586 A JP 7340586A JP H0451874 B2 JPH0451874 B2 JP H0451874B2
- Authority
- JP
- Japan
- Prior art keywords
- straight lines
- direction codes
- image
- codes
- image sensor
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
- 238000000034 method Methods 0.000 claims description 13
- 239000011159 matrix material Substances 0.000 claims description 6
- 239000000284 extract Substances 0.000 claims description 3
- 230000036544 posture Effects 0.000 description 5
- 238000005259 measurement Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 239000000758 substrate Substances 0.000 description 1
Landscapes
- Image Analysis (AREA)
Description
[産業上の利用分野]
本発明は、イメージセンサ等によって得られた
画像における図形角部の2直線を分離し、それら
の直線の情報を個別的に抽出する方法に関するも
のである。
[従来の技術]
生産ラインにおける各種組付け作業、例えば、
自動車の車体や家電製品の本体、あるいはIC基
板等に対する各種部品の組付け作業を自動化する
場合、その自動車の車体、家電製品の本体、IC
基板等を対象とした自動認識を行うことになる
が、それらの認識対象は、通常、実質的に矩形状
をなし、または少なくともその外形状の一部に認
識の基準とすることが可能な直角部分を備えてい
る。さらに、認識対象物自体が矩形状でなくて
も、矩形状の台車に載せて移動させるとか、その
対象物上に矩形部分が存在する場合が多い。
従って、実質的に矩形状をなす部分、さらに詳
しくは、その形状の一部をなす直角部分等を基準
として、対象物の基準位置に対する位置ずれ、及
び基準姿勢に対する姿勢角の傾きを検出すれば、
対象物の認識を容易に行うことができる。
そこで、本発明者らは、矩形状対象物の直角部
分をイメージセンサにより観察し、互いに直交す
る2直線の方程式を求めて、対象物の位置ずれや
姿勢角を計測する方法を別途提案している。
この場合に、単一のイメージセンサの画像中に
おける図形角部の2直線の情報をできるだけ簡単
な処理によって分離抽出することが必要となる
が、既存の技術では必ずしも満足な分離抽出を行
うことができない。
[発明が解決しようとする問題点]
本発明は、ITVカメラその他のイメージセン
サによって得られた対象物の2次元画像における
図形角部の2直線を、簡単な手段により分離し、
それらの直線の情報を個別的に抽出する方法を提
供するものである。
[問題点を解決するための手段]
上記目的を達成するため、本発明においては、
イメージセンサ等によって得られた2直線の交差
により形成される図形角部の画像を全体的に2値
化したうえで、空間フイルタにより、n×nの微
小マトリツクスにおけるいずれの側に図形の実部
があるかを示す方向コードを抽出し、上記図形角
部における直線部分の姿勢角に対比する方向コー
ドの組合わせ毎に、その方向コードの総数を加算
して、最大値を示す方向コードの組合わせ成分を
抽出し、その組合わせ成分の中で上記2直線に対
応する方向コードを分離し、分離した各方向コー
ドに対応するデータに基づいて上記2直線の直線
式を算出するという技術的手段を採用している。
[実施例]
以下に図面を参照して本発明の方法をさらに具
体的に説明する。
第1図に示すように、いま、位置ずれ及び姿勢
角の計測対象物Aが存在する空間に、A0として
表示した対象物の基準位置があるものとする。対
象物Aは、実質的に矩形状をなすものであり、第
1図においては、基準位置における矩形状対象物
A0の角部をP1,P2,P3及びP4、任意姿勢をとる
対象物Aの角部をP1′,P2′,P3′及びP4′とし、ま
た、上記計測対象物Aの各辺を、直線l,m,s
及びtによって示している。
上記対象物Aの位置ずれ及び姿勢角を計測する
計測域には、基準位置にある矩形状の対象物A0
の直交する二辺(直線l,m)の交点P2を視野
内のほぼ中央におさめるITVカメラその他適宜
のイメージセンサV1が配置される。このイメー
ジセンサは、対象物A0の他の角部P1,P3または
P4に配置することもできる。
上記対象物Aがベルトコンベア等により移送さ
れ、上記計測域に達したときには、通常、第1図
に示すように、基準位置に対する任意量の位置ず
れ及び任意量の姿勢角の傾きを有している。即
ち、対象物Aの中心がx軸及びy軸方向にそれぞ
れΔx及びΔyだけの位置ずれをもち、また角θだ
け対象物の基準姿勢に対して傾斜している。
そこで、上記位置ずれ及び姿勢角の計測のた
め、上記イメージセンサV1により、対象物Aの
二辺、即ち2直線l,mの交差により形成される
図形角部の画像を検出し、それらの2直線の方程
式を求めれば、簡単な演算により対象物の位置ず
れ及び姿勢角を計測することができる。
本発明は、このようなイメージセンサ等の画像
を処理して、2直線の方程式を求めるためのもの
で、第2図にその処理過程をフローチャートによ
って示している。
即ち、上記画像の処理に際してイメージセンサ
V1により画像処理装置内に取込んだ対象物Aの
画像は、2直線の交差により形成される図形角部
の形状に示し、この画像情報については、まず、
図形の実部内とそれ以外の部分の明るさの差によ
って全体的に2値化する。
次いで、その2値化画像から、空間フイルタに
より、n×nの微小マトリツクスにおけるいずれ
の側に図形の実部があるかを示す方向コードを抽
出する。
第2図は、2×2のマスクパターンとそれに付
した0〜9の方向コードとの関係を例示するもの
で、この例においては、2×2の領域が全て0の
場合をコード0、全て1の場合をコード1、左側
のみが1の場合をコード2、右側のみが1の場合
をコード3とし、以下、2×2のマトリツクスに
おけるいずれの側に図形の実部、即ち2値化情報
の1があるかによって、それぞれ別異のコードを
付している。
なお、ここではマスクパターンが2×2の微小
マトリツクスの場合について説明したが、これに
限るものではなく、例えば、3×3等のマトリツ
クスとすることもできる。
このような方向コードの抽出を行った後、以下
に説明したように、図形角部の二つの直線部分の
姿勢に対応する方向コードの組合わせ毎に、その
方向コードの総数を加算して、最大値を示す方向
コードの組合わせ成分を抽出し、画像内に2直線
が存在するか否かを判定したうえで、2直線が存
在する場合には、その方向コードの組合わせ成分
の中で上記2直線の成分をそれに対応する方向コ
ードの差異により分離する。
即ち、第1図に示したように、イメージセンサ
V1を対象物A0の角部P2に配置した場合、2値化
画像から空間フイルタにより抽出した方向コード
は、図形の姿勢角θに応じて、第1表のP2の段
に記載したようになる。
第1表は、矩形状対象物A0の角部P1,P2,P3
またはP4にイメージセンサを配置した場合につ
いて、図形の姿勢角θと、その姿勢角θの一定の
角度範囲において成分合計が最大となる交差2直
線の方向コードの組合わせ(α,β)との関係を
示すもので、αは、θ=0のときに水平の直線成
分、βはθ=0のときに垂直の直線成分を意味し
ている。
[Industrial Field of Application] The present invention relates to a method of separating two straight lines at the corners of a figure in an image obtained by an image sensor or the like and individually extracting information on these straight lines. [Prior art] Various assembly operations on a production line, for example,
When automating the assembly of various parts to the body of a car, the body of a home appliance, or an IC board, etc., it is necessary to
Automatic recognition is performed for substrates, etc., but the recognition target usually has a substantially rectangular shape, or at least a part of its outer shape has a right angle that can be used as a reference for recognition. It has portions. Furthermore, even if the recognition target itself is not rectangular, it is often moved on a rectangular trolley or has a rectangular portion on the target. Therefore, by using a substantially rectangular part, more specifically, a right-angled part forming a part of the shape, as a reference, the positional deviation of the object with respect to the reference position and the inclination of the attitude angle with respect to the reference posture are detected. ,
Objects can be easily recognized. Therefore, the present inventors separately proposed a method for measuring the positional deviation and posture angle of a rectangular object by observing the right angle part of the object using an image sensor and finding the equations of two mutually orthogonal lines. There is. In this case, it is necessary to separate and extract the information of the two straight lines at the corners of the figure in the image of a single image sensor using the simplest possible processing, but existing techniques cannot always perform satisfactory separation and extraction. Can not. [Problems to be Solved by the Invention] The present invention separates two straight lines at the corners of a figure in a two-dimensional image of an object obtained by an ITV camera or other image sensor by a simple means,
This provides a method for individually extracting information about those straight lines. [Means for solving the problems] In order to achieve the above object, in the present invention,
After the image of the corner of the figure formed by the intersection of two straight lines obtained by an image sensor or the like is completely binarized, a spatial filter is used to calculate the real part of the figure on either side of the n×n micro matrix. For each combination of direction codes that contrast with the attitude angle of the straight line part at the corner of the figure, add the total number of direction codes, and then find the set of direction codes that shows the maximum value. A technical means of extracting combined components, separating direction codes corresponding to the two straight lines from among the combined components, and calculating a linear equation of the two straight lines based on data corresponding to each separated direction code. is adopted. [Example] The method of the present invention will be explained in more detail below with reference to the drawings. As shown in FIG. 1, it is assumed that there is a reference position of the object indicated as A 0 in the space where the object A whose positional deviation and attitude angle are to be measured exists. The object A is substantially rectangular, and in FIG. 1, the object A is a rectangular object at the reference position.
Let the corners of A 0 be P 1 , P 2 , P 3 , and P 4 , and the corners of object A in any posture be P 1 ′, P 2 ′, P 3 ′, and P 4 ′, and the above measurement Each side of object A is defined by straight lines l, m, s
and t. The measurement area for measuring the positional deviation and attitude angle of the object A includes a rectangular object A 0 at the reference position.
An ITV camera or other appropriate image sensor V 1 is arranged to place the intersection P 2 of two orthogonal sides (straight lines l and m) approximately in the center of the field of view. This image sensor detects other corners P 1 , P 3 or
It can also be placed on P 4 . When the object A is transported by a belt conveyor or the like and reaches the measurement area, it usually has an arbitrary amount of positional deviation and an arbitrary amount of attitude angle inclination with respect to the reference position, as shown in FIG. There is. That is, the center of the object A is shifted by Δx and Δy in the x-axis and y-axis directions, respectively, and is tilted by an angle θ with respect to the reference posture of the object. Therefore, in order to measure the positional deviation and attitude angle, the image sensor V1 detects the image of the corner of the figure formed by the intersection of the two sides of the object A, that is, the two straight lines l and m, and If the equations of the two straight lines are found, the positional deviation and attitude angle of the object can be measured by simple calculations. The present invention is for processing images from such an image sensor, etc., to obtain equations of two straight lines, and FIG. 2 shows the processing process in the form of a flowchart. In other words, when processing the above image, the image sensor
The image of object A taken into the image processing device by V 1 is shown in the shape of the corner of a figure formed by the intersection of two straight lines, and this image information is first
The entire image is binarized based on the difference in brightness between the real part of the figure and the other parts. Next, from the binarized image, a spatial filter extracts a direction code indicating on which side of the n×n minute matrix the real part of the figure is located. FIG. 2 illustrates the relationship between a 2×2 mask pattern and the direction codes 0 to 9 attached to it. In this example, if the 2×2 area is all 0, code 0 means If it is 1, it is code 1, if only the left side is 1, it is code 2, if only the right side is 1, it is code 3, and hereinafter, the real part of the figure, that is, the binarized information, is shown on either side of the 2 × 2 matrix. Different codes are assigned depending on whether 1 is present. Although the case where the mask pattern is a 2×2 minute matrix has been described here, the mask pattern is not limited to this, and may be a 3×3 matrix, for example. After extracting such direction codes, as explained below, the total number of direction codes is added up for each combination of direction codes corresponding to the postures of the two straight line portions of the figure corner. After extracting the combined component of the direction code that shows the maximum value and determining whether or not two straight lines exist in the image, if there are two straight lines, among the combined components of the direction code, The components of the two straight lines are separated based on the difference in their corresponding direction codes. That is, as shown in Figure 1, the image sensor
When V 1 is placed at the corner P 2 of the object A 0 , the direction code extracted from the binarized image by the spatial filter is listed in the P 2 column of Table 1 according to the attitude angle θ of the figure. It becomes like that. Table 1 shows the corners P 1 , P 2 , P 3 of the rectangular object A 0
Or, for the case where the image sensor is placed at P 4 , the attitude angle θ of the figure and the combination (α, β) of the direction code of two intersecting straight lines that has the maximum component sum within a certain angular range of the attitude angle θ. , α means a horizontal straight line component when θ=0, and β means a vertical straight line component when θ=0.
【表】
第1表のP2の段の記載からわかるように、第
1図の対象物の姿勢角θが、例えば、−90〜−45゜
の範囲内にある場合、特に、−90゜側において方向
コードの組合わせ(2,5)が支配的となり、ま
た−45゜を中心として方向コードの組合わせ(8,
7)が支配的となるため、結局、上記−90〜−
45゜の角度範囲では、方向コードの組合わせ(2
+8,5+7)だけが存在することになり、本質
的には、0及び1を除く他の方向コードは存在し
ない筈である。なお、ここで、方向コード2及び
8は直線l上の成分であり、方向コード5及び7
は直線m上の成分である。
さらに、姿勢角θが−45〜0゜の範囲では、−45゜
を中心として上記のように方向コードの組合わせ
(8,7)が支配的であり、また0゜を中心として
方向コードの組合わせ(4,2)が支配的である
ため、上記−45〜0゜の角度範囲では、本質的には
(4+8,2+7)だけが存在することになる。
そこで、画面の全体における各方向コードの成
分の個数を個別的に全て計算し、その上で、角度
範囲−90〜−45゜内にある筈の方向コード2,8,
5,7角度範囲−45〜0゜にある筈の方向コード
4,8,2,7、角度範囲0〜45°にある筈の方
向コード4,6,2,8等についての、それぞれ
の方向コードの個数の合計値を算出し、それらの
合計値のうちで最大のものを求める。
この最大値を示す方向コードの組合わせを求め
ると、それにより概略的な姿勢角がわかると同時
に、2直線の方向コードの成分も決まることにな
る。例えば、方向コード4,8,2,7の合計値
が最大であれば、姿勢角が−45〜0゜の角度範囲内
にあり、直線lの成分の方向コードは4及び8で
あり、直線mの成分の方向コードは2及び7であ
ることがわかる。
このようにして、個数の合計値が最大を示す方
向コードの組合わせを求め、その中に直線l、m
の成分あがることを検出すれば、画像内に2直線
が存在したことになり、この方向コードの差異に
基づいて各直線の方向コード成分を分離すること
ができ、即ち画像における直線l及びm上の点列
を分離し抽出することができる。そして、分離し
た各方向コード成分に基づいて、上記2直線の式
を算出することができる。
即ち、上述したように、各直線毎にそれらの点
列を構成する各点の座標を求め、それらの座標値
を直線l,mの方程式に代入して勾配及び切片を
求めればよい。
例えば、直線lの方程式を、
y=A1x+B1
とし、直線l上の点列を構成する各点(x1i,y1i)
をそれに代入して、平均的な勾配A1及び切片B1
を求めると、それらは、
によつて与えられる。
直線mの方程式も同様にして求められる。
このように、上記方法によれば、イメージセン
サV1等に接続した演算処理装置で上述した簡単
な処理を行うことによつて、画像における2直線
を分離することができる。
[発明の効果]
このような本発明の方法によれば、対象物の角
部にイメージセンサ等を配置し、その出力画像に
基づいて、画像内における2直線についての直線
式を簡単且つ正確に求めることができる。
また、このように簡単に計測できるため、画像
を処理するための装置をナードウエア化すること
が容易であるばかりでなく、実時間処理を行うこ
とができる。[Table] As can be seen from the description in column P 2 of Table 1, when the attitude angle θ of the object in Fig. 1 is within the range of -90 to -45°, especially -90° The direction code combination (2, 5) is dominant on the side, and the direction code combination (8, 5) is dominant around -45°.
7) becomes dominant, so in the end, the above −90 to −
In the angular range of 45°, the direction code combination (2
+8, 5+7), and essentially there should be no other direction codes other than 0 and 1. Note that direction codes 2 and 8 are components on the straight line l, and direction codes 5 and 7 are components on the straight line l.
is the component on the straight line m. Furthermore, in the range of attitude angle θ from -45 to 0°, the combination of direction codes (8, 7) centered around -45° is dominant, and the combination of direction codes (8, 7) centered around 0° is dominant. Since the combination (4, 2) is predominant, essentially only (4+8, 2+7) exists in the above angle range of -45 to 0 degrees. Therefore, the number of components of each direction code in the entire screen is calculated individually, and then the direction codes 2, 8, which should be within the angular range of -90 to -45 degrees,
5,7 The respective directions for direction codes 4, 8, 2, 7, which should be in the angular range -45 to 0 degrees, and direction codes 4, 6, 2, 8, etc., which should be in the angular range 0 to 45 degrees. Calculate the total number of codes, and find the largest one among those totals. By finding the combination of direction codes that indicate this maximum value, the approximate attitude angle can be determined, and at the same time, the components of the direction codes of the two straight lines can also be determined. For example, if the total value of direction codes 4, 8, 2, and 7 is maximum, the attitude angle is within the angle range of -45 to 0 degrees, and the direction codes of the components of straight line l are 4 and 8, and the straight line It can be seen that the direction codes of the components of m are 2 and 7. In this way, find the combination of direction codes with the maximum total number, and include the straight lines l, m.
If it is detected that the components of The point sequence of can be separated and extracted. Then, the equations of the two straight lines can be calculated based on the separated directional code components. That is, as described above, the coordinates of each point constituting the point sequence are determined for each straight line, and the slope and intercept are determined by substituting these coordinate values into the equations of the straight lines l and m. For example, let the equation of straight line l be y = A 1 x + B 1 , and each point (x 1i , y 1i ) that makes up the sequence of points on straight line l
Substituting into it, we get the average slope A 1 and intercept B 1
If you ask for given by. The equation of the straight line m can be found in the same way. In this manner, according to the above method, two straight lines in an image can be separated by performing the above-mentioned simple processing with the arithmetic processing device connected to the image sensor V1 or the like. [Effects of the Invention] According to the method of the present invention, an image sensor or the like is placed at the corner of the object, and based on the output image, a linear equation for two straight lines in the image can be easily and accurately calculated. You can ask for it. In addition, since measurement can be performed easily in this way, it is not only easy to use a device for processing images as a NerdWare device, but also real-time processing can be performed.
第1図は本発明に係る2直線の分離方法の適用
例を示す説明図、第2図は本発明の方法による処
理の過程を示すフローチヤート、第3図は2×2
のマスクパターンと方向コードとの関係について
の説明図である。
V1……イメージセンサ、A……対象物。
Fig. 1 is an explanatory diagram showing an application example of the method for separating two straight lines according to the present invention, Fig. 2 is a flowchart showing the process of processing by the method of the present invention, and Fig. 3 is a 2
FIG. 2 is an explanatory diagram of the relationship between the mask pattern and the direction code. V 1 ...Image sensor, A...Object.
Claims (1)
交差により形成される図形角部の画像を全体的に
2値化したうえで、空間フイルタにより、n×n
の微小マトリツクスにおけるいずれの側に図形の
実部があるかを示す方向コードを抽出し、上記図
形角部における直線部分の姿勢角に対応する方向
コードの組合わせ毎に、その方向コードの総数を
加算して、最大値を示す方向コードの組合わせ成
分を抽出し、その組合わせ成分の中で上記2直線
に対応する方向コードを分離し、分離した各方向
コードに対応するデータに基づいて上記2直線の
直線式を算出することを特徴とする画像における
2直線の分離方法。1 After the image of the corner of the figure formed by the intersection of two straight lines obtained by an image sensor etc. is completely binarized, it is converted to n×n by a spatial filter.
Extract the direction codes that indicate which side of the micro matrix the real part of the figure is on, and calculate the total number of direction codes for each combination of direction codes that correspond to the attitude angle of the straight line part at the corner of the figure. The combined components of the direction codes that show the maximum value are extracted, the direction codes corresponding to the two straight lines are separated from the combined components, and the above is calculated based on the data corresponding to each separated direction code. A method for separating two straight lines in an image, the method comprising calculating a linear equation for the two straight lines.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP61073405A JPS62231390A (en) | 1986-03-31 | 1986-03-31 | Separation of two straight lines in image |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP61073405A JPS62231390A (en) | 1986-03-31 | 1986-03-31 | Separation of two straight lines in image |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS62231390A JPS62231390A (en) | 1987-10-09 |
| JPH0451874B2 true JPH0451874B2 (en) | 1992-08-20 |
Family
ID=13517250
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP61073405A Granted JPS62231390A (en) | 1986-03-31 | 1986-03-31 | Separation of two straight lines in image |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS62231390A (en) |
-
1986
- 1986-03-31 JP JP61073405A patent/JPS62231390A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS62231390A (en) | 1987-10-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11046530B2 (en) | Article transfer apparatus, robot system, and article transfer method | |
| EP0218259B1 (en) | Method and apparatus for calculating position and orientation by combination of features of partial shapes | |
| EP0205628B1 (en) | Method for identifying three-dimensional objects using two-dimensional images | |
| US10347005B2 (en) | Object state identification method, object state identification apparatus, and carrier | |
| US10163225B2 (en) | Object state identification method, object state identification apparatus, and carrier | |
| US8565479B2 (en) | Extraction of skeletons from 3D maps | |
| CN110926330B (en) | Image processing apparatus, image processing method, and program | |
| Fan et al. | A shape-based stereo matching algorithm for binocular vision | |
| KR100528489B1 (en) | Spreader pose determination using camera and laser sensor | |
| JPH0451874B2 (en) | ||
| JP2558096B2 (en) | Automatic measurement method of posture and size of object with straight line part | |
| JPH0410002B2 (en) | ||
| JPH06147828A (en) | Position/attitude measuring equipment | |
| KR100824744B1 (en) | Magnetic Position Detection System and Method of Mobile Robot Using Edge Shape | |
| JPH0816605B2 (en) | Automatic measurement method of position deviation and posture angle of an object with straight line part | |
| JPH065545B2 (en) | Figure recognition device | |
| JPH0816606B2 (en) | Automatic measurement method of position deviation and posture angle of an object with right angle part | |
| JPS60183509A (en) | visual device | |
| JPH07329894A (en) | Aircraft position / attitude detection device | |
| JPH0810129B2 (en) | Automatic measurement method of posture and dimension of target object | |
| JPS63304791A (en) | Straight line pattern corresponding system in camera calibration | |
| JPH10232937A (en) | Method and instrument for measuring meal tray | |
| JPS62185105A (en) | Automatic measurement method of object posture and dimensions using directional reference marks, etc. | |
| Choo et al. | Uncertainty Analysis in Depth Measurement of Stereo Vision System for Sensor Fusion | |
| JPS62229009A (en) | Automatic measuring method for attitude and dimensions of object with line sensor |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313117 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| EXPY | Cancellation because of completion of term |