Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP2613645B2 - Visual processing method - Google Patents
[go: Go Back, main page]

JP2613645B2 - Visual processing method - Google Patents

Visual processing method

Info

Publication number
JP2613645B2
JP2613645B2 JP63314736A JP31473688A JP2613645B2 JP 2613645 B2 JP2613645 B2 JP 2613645B2 JP 63314736 A JP63314736 A JP 63314736A JP 31473688 A JP31473688 A JP 31473688A JP 2613645 B2 JP2613645 B2 JP 2613645B2
Authority
JP
Japan
Prior art keywords
measurement target
gravity
camera
shape
extracted
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
Application number
JP63314736A
Other languages
Japanese (ja)
Other versions
JPH02159506A (en
Inventor
俊一 石川
冬彦 吉倉
久雄 山口
吉二 山本
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.)
Toyota Motor Corp
Toyoda Koki KK
Original Assignee
Toyota Motor Corp
Toyoda Koki KK
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 Toyota Motor Corp, Toyoda Koki KK filed Critical Toyota Motor Corp
Priority to JP63314736A priority Critical patent/JP2613645B2/en
Publication of JPH02159506A publication Critical patent/JPH02159506A/en
Application granted granted Critical
Publication of JP2613645B2 publication Critical patent/JP2613645B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION 【産業上の利用分野】[Industrial applications]

本発明は、複雑な形状をした物体をカメラを用いて認
識する視覚処理方法に関する。
The present invention relates to a visual processing method for recognizing an object having a complicated shape using a camera.

【従来技術】[Prior art]

従来、視覚処理を行う場合、特徴量の検出のし易さか
ら、円を用いてきた。円を円と認識するために、円らし
さを見る。この円らしさとは如何に真円に近いかという
ことであり、一般に、外周距離の変動比〔円の重心を求
め、その重心から外周までの距離(半径)の最大値と重
心から外周までの距離(半径)の最小値の差を重心から
外周までの距離(半径)の平均値で割った値〕が零に近
い程、真円に近いと判断できる。そして、2円の重心の
位置を知り、それらの重心を結ぶ直線を求めて対象物体
の傾きを知るという方法を採ってきた。
Conventionally, when performing visual processing, circles have been used because of easy detection of feature amounts. In order to recognize a circle as a circle, we look at the character of the circle. The circularity is how close to a perfect circle is. Generally, the variation ratio of the outer circumference distance [determines the center of gravity of the circle, and determines the maximum value of the distance (radius) from the center of gravity to the outer circumference and the distance from the center of gravity to the outer circumference. The value obtained by dividing the difference between the minimum values of the distance (radius) by the average value of the distance (radius) from the center of gravity to the outer periphery] is closer to zero, it can be determined that the shape is closer to a perfect circle. Then, a method has been adopted in which the positions of the centers of gravity of the two circles are known, and a straight line connecting the centers of gravity is determined to determine the inclination of the target object.

【発明が解決しようとする課題】[Problems to be solved by the invention]

特に複雑な形状をしているエンジンシリンダヘッドの
粗材(鋳物)等の対象物体も、その対象物体における2
〜3ヶの穴をCCDカメラで撮像し2値化させてその円ら
しき及び色彩の変化を抽出することにより認識させてい
た。しかし、粗材においては穴の周囲にバリが多く、そ
のバリは円らしさの認識不良を生じさせる。そして、数
ヶ所の穴の中心(重心)座標点を同時に探索すると、そ
の中心座標点はCCDカメラの光軸に対して斜め方向のそ
れぞれ異なった角度に存在する。その角度の違いにより
それぞれの穴の見え方が異なると共に証明光源の反射角
も異なるので、その輝度がそれぞれの穴周囲について異
なる2値化処理が困難となることが多い。又、対象物体
の色彩が熱処理等により部分毎に若干異なる2値化処理
が困難となることも非常に多い。従って、上記の場合等
にはCCDカメラによる認識(視覚処理)エラーとなり視
覚処理ができなかった。 本発明は、上記の課題を解決するために成されたもの
であり、その目的とするところは、対象物体に対する視
覚処理における認識不良時には、カメラを対象物体に対
して移動させ、その視覚角度を変更し認識させ視覚処理
エラー要因を吸収させて安定的な対象物体の認識を行う
ことである。
Particularly, a target object such as a coarse material (casting) of an engine cylinder head having a complicated shape is also included in the target object.
Approximately three holes were imaged with a CCD camera, binarized, and recognized by extracting the roundness and color change. However, in a rough material, there are many burrs around a hole, and the burrs cause poor recognition of circularity. When the center (center of gravity) coordinate points of several holes are simultaneously searched, the center coordinate points are present at different angles obliquely to the optical axis of the CCD camera. Since the appearance of each hole differs due to the difference in the angle and the reflection angle of the proof light source also differs, it is often difficult to perform a binarization process in which the brightness differs around each hole. Also, it is very often difficult to perform a binarization process in which the color of the target object is slightly different for each part due to heat treatment or the like. Therefore, in the above case, a recognition (visual processing) error by the CCD camera occurs and visual processing cannot be performed. The present invention has been made in order to solve the above-described problems, and an object of the present invention is to move a camera with respect to a target object when visual recognition of the target object is poor in visual processing, and to set the visual angle thereof. It is to perform stable recognition of the target object by changing and recognizing the visual processing error factors.

【課題を解決するための手段】[Means for Solving the Problems]

上記課題を解決するための発明の構成は、カメラで撮
像された2値化画面より対象物体に設けられた基準形状
の重心を算出し、前記カメラの光軸をその重心位置に移
動し、その重心位置にて前記カメラで撮像された2値化
画面における、所定面積範囲にある領域の中から所定特
徴量を有する計測対象形状を抽出し、前記領域のうちで
計測対象形状として認識されないものがある場合には、
前記カメラの光軸を前記重心位置と前記認識されなかっ
た領域との略中央まで移動させ、新たに前記カメラで撮
像された2値化画面におけるその領域が前記所定特徴量
を有する計測対象形状として認識されるものを抽出し、
抽出された前記計測対象形状と前記基準形状との重心間
距離を予め設定された値にて比較判定し、比較判定にて
特定された一組の計測対象形状から前記対象物体の傾き
を算出することを特徴とする。
The configuration of the invention for solving the above-mentioned problem calculates a center of gravity of a reference shape provided on a target object from a binarized screen imaged by a camera, and moves the optical axis of the camera to the position of the center of gravity. In a binarized screen imaged by the camera at the position of the center of gravity, a measurement target shape having a predetermined feature amount is extracted from a region within a predetermined area range, and a region that is not recognized as a measurement target shape among the regions is extracted. In some cases,
The optical axis of the camera is moved to substantially the center between the position of the center of gravity and the unrecognized area, and the area on the binarized screen newly captured by the camera is used as a measurement target shape having the predetermined feature amount. Extract what is recognized,
The distance between the centers of gravity of the extracted measurement target shape and the reference shape is compared and determined using a preset value, and the inclination of the target object is calculated from the set of measurement target shapes specified in the comparison determination. It is characterized by the following.

【作用】[Action]

カメラにて対象物体を撮像し、その2値化画面より対
象物体に設けられた基準形状の重心を算出する。そし
て、カメラの光軸を算出されたその重心に合わせる。す
ると、この時点でカメラと対象物体とは相対的な回転方
向の角度ズレを残して位置関係が明らかになる。カメラ
が基準形状の重心位置にあってカメラの2値化画面にお
ける対象物体の所定面積範囲にある領域の中から所定特
徴量を有する計測対象形状を抽出する。この領域のうち
で計測対象形状として認識されないものについては、カ
メラの光軸を基準形状の重心位置からその領域の略中央
まで移動した後、再びその領域を撮像した2値化画面に
て所定特徴量を有する計測対象形状と認識されるものを
抽出する。このように、カメラの光軸を認識不可の領域
近くに移動することにより、カメラの視覚処理における
条件が良くなる。つまり、カメラの光軸と領域との角度
の減少及び照明光源の均一性等が達成される。結果とし
て、計測対象形状が漏れなく抽出でき、更に、それらの
計測対象形状と基準形状との重心間距離を設定値と比較
判定した後、一組の計測対象形状を認識する。従って、
その特定された一組の計測対象形状の重心位置を結ぶ直
線を求めることにより対象物体の傾きが算出され、この
時点でカメラと対象物体とは相対的な回転方向の角度ズ
レが明らかになる。
The target object is imaged by the camera, and the center of gravity of the reference shape provided on the target object is calculated from the binarized screen. Then, the optical axis of the camera is adjusted to the calculated center of gravity. Then, at this point, the positional relationship between the camera and the target object is clarified except for the angular deviation in the relative rotation direction. A measurement target shape having a predetermined feature amount is extracted from an area within a predetermined area range of the target object on the binarized screen of the camera at the position of the center of gravity of the reference shape. Of the regions that are not recognized as a measurement target shape, the camera moves the optical axis from the center of gravity of the reference shape to approximately the center of the region, and then performs a predetermined feature on a binarized screen in which the region is imaged again. An object which is recognized as a measurement target shape having an amount is extracted. As described above, by moving the optical axis of the camera closer to the unrecognizable area, the conditions in the visual processing of the camera are improved. That is, the angle between the optical axis of the camera and the region is reduced, and the uniformity of the illumination light source is achieved. As a result, the shapes to be measured can be extracted without omission, and further, the distance between the centers of gravity of the shapes to be measured and the reference shape is compared with a set value, and a set of shapes to be measured is recognized. Therefore,
The inclination of the target object is calculated by obtaining a straight line connecting the positions of the centers of gravity of the specified set of measurement target shapes, and at this point, the relative angular deviation between the camera and the target object in the rotational direction becomes clear.

【実施例】【Example】

以下、本発明の具体的な実施例に基づいて説明する。 第1図(a)及び第1図(b)は本実施例の視覚処理
方法を説明するための説明図である。第1図(a)は視
覚処理すためのエンジンシリンダヘッドである対象物体
11とその位置及び傾きを計測するため縦240,横256の合
計61440画素から成るCCDカメラ12との位置関係を表して
いる。上記エンジンシリンダヘッドは粗材(鋳物)であ
り、一般的に、工程途中においてはバリが多く、又、熱
処理等による色ムラがある。第1図(b)はそのCCDカ
メラ12の視覚画面のウィンドウ20を表しており、対象物
体11の基準形状としての基準穴21、CCDカメラ12の光軸
が対象物体11の基準穴21の重心位置にある場合が示され
ている。基準穴21とその左には対象物体11の計測対象形
状22とから成るAグループ、又、基準穴21とその右には
対象物体11の計測対象形状23とから成るBグループが示
されている。そして、Aグループの計測対象形状22はこ
のカメラ位置で認識不可(破線)で、Bグループの計測
対象形状23はこのカメラ位置で認識可能(実線)を表し
ている。又、Aグループ或いはBグループが認識不可の
時にCCDカメラ12の光軸が移動される位置をA−或い
はB−で表している。尚、視覚処理における図示しな
い制御装置は、認識精度を向上するための自動のフィル
ター機能、2値化レベル調節及びレベル調節に伴う学習
機能等を持っている。 次に、第2図(a)及び第2図(b)のフローチャー
トに基づいて本実施例の視覚処理方法について述べる。 第2図(a)は、CCDカメラ12の光軸を基準穴21へ移
動させるプログラムである。 先ず、ステップ100にて、CCDカメラ12の視覚画面のウ
ィンドウ20にて対象物体11を撮像し、その2値化画面を
取り込む。次にステップ102に移行して、取り込まれた
対象物体11の2値化画面において予め設定された値に対
応する基準穴21を抽出する。この基準穴21としては、例
え対象物体11がエンジンシリンダヘッド等の粗材(鋳
物)であっても間違い無く抽出できる程度に真円に近い
形状を有し、その対象物体11の略中央にある穴が選定さ
れている。次にステップ104に移行して、基準穴21の重
心を算出する。そして、次にステップ106に移行し、算
出された重心位置にCCDカメラ12の光軸を移行し、本プ
ログラムを終了する。 上述のプログラムを実行された後、第2図(b)の対
象物体の11の傾きを求めるプログラムが実行される。 ステップ200で、CCDカメラ12の視覚画面のウィンドウ
20にて対象物体11を撮像し、その2値化画面を取り込
む。次にステップ202に移行して、一次特徴量抽出とし
てCCDカメラ12にて取り込まれた対象物体11の2値化画
面における領域のうち、領域の面積が12画素以下はノイ
ズであるとして削除し、領域の面積が13画素以上のもの
を全て抽出する。次にステップ204に移行して、抽出さ
れた領域のうちで面積が8000画素を越えるものが在るか
否かが判定される。 つまり、真の領域(計測対象形状)の面積は画素数換
算で13〜8000画素となるように予め設定されており、抽
出された領域の面積も同じ画素数範囲に在るとする。そ
して、ステップ204において、ステップ202で抽出された
領域の面積が8000画素を越えてオーバーフローしている
場合はYESと判定され、ステップ206に移行し、計測回数
が3回未満か否かが判定される。ステップ206で計測回
数が3回未満でありYESと判定されるとステップ208に移
行し、2値化レベルが適切でないので、2値化レベルの
変更が行われ、再びステップ202に移行する。ステップ2
06で計測回数が3回となりNOと判定されると、計測不可
として視覚処理がNGであることを知らせる。 ステップ204で抽出された領域の面積が8000画素を越
えていなければオーバーフローしていないので判定はNO
であり、ステップ210に移行し、二次特徴量抽出とし
て、ステップ202の一時特徴量抽出で抽出された領域に
ついて、予め設定された計測対象形状の面積許容範囲に
領域の面積が存在して、予め設定された計測対象形状の
主軸長・副軸長(縦・横長さ)から成る外接長方形の許
容範囲に対象物体11の領域に外接する主軸長・副軸長か
ら成る外接長方形が存在している領域を計測対象形状と
して抽出すると同時に、それらの抽出された計測対象形
状の重心位置をそれぞれ算出する。 ここで、前述したように、一般に、領域(計測対象形
状)が穴であれば、円らしさを計測することで認識可能
である。しかし、対象物体11が粗材(鋳物)でありその
穴の周囲にバリ等が多く真円に程遠い場合には、円を認
識する方法によりその重心を導き出すことは誤差が多く
て用いることができない。従って、このような対象物体
11の場合には、第1図(b)に示したように、領域(計
測対象形状)に対して外接する主軸長ML及び副軸長SLか
ら成る外接長方形CRを求め、予め設定されている領域
(計測対象形状)の主軸長ML及び副軸長SLによる外接長
方形CRを利用してその上下限公差よりそれらの認識可否
を判断する方法は誤差が少なくなり有効である。次にス
テップ212に移行して、ステップ204の時点で抽出されて
おり、ステップ210における二次特徴量抽出処理で除外
された領域が有るか否定かが判定される。 除外された領域が有る場合にはステップ212の判定はY
ESとなり、ステップ214に移行し、CCDカメラ12の光軸を
基準穴21の重心位置と除外された抽出対象としての領域
位置との略中央位置へ移動させる。次にステップ216に
移行して、その移動したCCDカメラ12の光軸位置にて、
上記除外された領域について、CCDカメラ12にて新たに
対象物体11を撮像し、その2値化画面を取り込み、ステ
ップ210における説明と同様の処理が行われる。つま
り、再度ステップ210の抽出条件を適用して予め設定さ
れた条件に適合しない領域を除外し、適合した領域を計
測対象形状として更に抽出し、それらの重心位置を算出
する。次にステップ218に移行して、上記除外された領
域の全てについて、CCDカメラ12の光軸を移動した再抽
出が行われたか否かが判定される。ステップ218で上記
除外された領域が複数箇所ある場合には判定がNOとな
り、ステップ214に移行し、同様に、ステップ218までを
繰り返す。 ステップ218で上記除外された領域の全てについて再
抽出のためのCCDカメラ12の光軸の移動が終了すると判
定はYESとなり、ステップ220に移行する。尚、上述のス
テップ212にて上記除外された領域が無い場合で判定がN
Oとなった場合にもステップ220に移行する。そして、ス
テップ220では、抽出された計測対象形状の数が2〜20
ヶであるか否かが判定される。 ここで、ステップ220の判定基準として、抽出された
計測対象形状の数が2ヶ以上であれば良いすると、極端
に多くの計測対象形状が抽出された場合には、その後の
処理時間が問題となり、2〜6ヶ程度とすると抽出され
た計測対象形状から予め設定された真の計測対象形状が
除外されてしまう場合が考えられ、抽出される計測対象
形状の数の上限をあまり小さく設定するのも良くない。 そして、ステップ220で抽出された計測対象形状の数
が設定範囲2〜20ヶ以外であるとNOとなりステップ222
に移行し、予め設定された時間に対してタイムオーバー
となっているか否かが判定される。ステップ222でタイ
ムオーバーでなければNOでありステップ224に移行し、
2値化レベルが適切でないので、2値化レベルの変更を
行った後ステップ202に移行し、以降は上述と同様に説
明される。ここで、ステップ222でタイムオーバーとな
りYESと判定されると、計測不可として視覚処理がNGで
あることを知らせる。 上述の処理が行われ、ステップ220で抽出された計測
対象形状の数が2〜20ヶとなりYESと判定されるとステ
ップ226に移行し、ステップ220で判定に用いられた計測
対象形状、つまり、抽出された複数の計測対象形状のう
ち、一つ目の計測対象形状を取り出し計測対象形状1と
し、その計測対象形状1と基準穴21との重心間距離を算
出する。次にステップ228に移行し、抽出された複数の
計測対象形状の全てについて重心間距離の算出が完了し
たか否かが判定される。そして、ステップ228で算出が
計測対象形状全てについて完了していなければ判定はNO
でありステップ230に移行し、抽出された複数の計測対
象形状のうち、二つ目の計測対象形状を取り出し、計測
対象形状1とし、ステップ226に移行し、上述と同様
に、計測対象形状1と基準穴21との重心間距離が算出さ
れる。 ステップ228おいて、抽出された計測対象形状の全て
について重心間距離の算出が完了すると判定はYESとな
りステップ232に移行する。ステップ232において、計測
対象形状1と基準穴21との重心間距離が予め設定されて
いる距離公差内にあるものは1ヶか否かが判定される。
そして、ステップ232で計測対象形状1と基準穴21との
重心間距離が予め設定されている距離公差内にあるもの
が無い或いは2ヶ以上在る場合にはステップ222に移行
し、以降は上述と同様に説明される。 ステップ232で計測対象形状1と基準穴21との重心間
距離が予め設定されている距離公差内にあるものが1ヶ
であると判定はYESでありその計測対象形状1を記憶し
た後ステップ234に移行し、ステップ220で判定に用いら
れた計測対象形状、つまり、抽出された複数の計測対象
形状のうち、一つ目の計測対象形状を取り出し計測対象
形状2とし、その計測対象形状2の重心と基準穴21の重
心との間の距離を算出する。次にステップ236に移行
し、抽出された複数の計測対象形状の全てについて重心
間距離の算出が完了したか否かが判定される。そして、
ステップ236で重心間距離の算出が計測対象形状全てに
ついて完了していなければ判定はNOでありステップ238
に移行し、抽出された複数の計測対象形状のうち、二つ
目の計測対象形状を取り出し、計測対象形状2とし、ス
テップ234に移行し、上述と同様に、計測対象形状2と
基準穴21との重心間距離が算出される。 ステップ236において、抽出された計測対象形状の全
てについて重心間距離の算出が完了すると判定はYESと
なりステップ240に移行する。ステップ240において、計
測対象形状2と基準穴21との重心間距離が予め設定され
ている距離公差内にあるものは1ヶか否かが判定され
る。そして、ステップ240で計測対象形状2と基準穴21
との重心間距離が予め設定されている距離公差内にある
ものが無い或いは2ヶ以上在る場合にはステップ222に
移行し、以降は上述と同様に説明される。 ステップ240で計測対象形状2と基準穴21との重心間
距離が予め設定されている距離公差内にあるものが1ヶ
であると判定はYESでありその計測対象形状2を記憶し
た後ステップ242に移行し、ステップ232で記憶された計
測対象形状1とステップ240で記憶された計測対象形状
2とのそれぞれの重心間を結んだ直線の傾きが算出され
ることにより、CCDカメラと対象物体との相対的な回転
方向の角度ズレが求められる本プログラムを終了する。 上述のように、最初CCDカメラ12の光軸を対象物体11
の基準穴21に移動させ、その位置における視覚画面のウ
ィンドウ20にて認識可能な領域を計測対象形状として抽
出する。そして、次に、その位置で認識不可の領域があ
る場合には、CCDカメラ12の光軸を対象物体11の基準穴2
1からその領域の方に移動させ、新たに認識可能となっ
た領域を計測対象形状として抽出する。このような視覚
処理方法を行うことにより、CCDカメラ12の光軸と対象
物体11の領域(計測対象形状)との角度差及び照明光源
の反射状態の違いがなくなり、CCDカメラ12における対
象物体11の領域(計測対象形状)との抽出条件が改善さ
れる。更に、抽出された計測対象形状と基準穴との重心
間距離に対して予め設定された値にて比較判定され、特
定された一組の計測対象形状が認識される。このよう
に、CCDカメラ12による認識(視覚処理)エラーが吸収
され、安定して対象物体の計測対象形状の認識が行われ
ることによりCCDカメラ12と対象物体11との回転方向を
含む相対位置関係が求められる。
Hereinafter, a description will be given based on specific examples of the present invention. FIG. 1A and FIG. 1B are explanatory diagrams for explaining the visual processing method of the present embodiment. FIG. 1A shows a target object which is an engine cylinder head for visual processing.
11 shows a positional relationship between the CCD camera 12 and a total of 61440 pixels of 240 pixels in length and 256 pixels in width for measuring the position and inclination thereof. The engine cylinder head is made of a coarse material (cast), and generally has many burrs in the middle of the process and has color unevenness due to heat treatment or the like. FIG. 1 (b) shows a window 20 of the visual screen of the CCD camera 12, in which a reference hole 21 as a reference shape of the target object 11 and the optical axis of the CCD camera 12 are the center of gravity of the reference hole 21 of the target object 11. The position is shown. A group A composed of the reference hole 21 and the measurement target shape 22 of the target object 11 is shown on the left, and a B group composed of the reference hole 21 and the measurement target shape 23 of the target object 11 is shown on the right. . The measurement target shape 22 of the A group cannot be recognized at this camera position (broken line), and the measurement target shape 23 of the B group can be recognized at this camera position (solid line). The position where the optical axis of the CCD camera 12 is moved when the A group or the B group cannot be recognized is represented by A- or B-. Note that a control device (not shown) in the visual processing has an automatic filter function for improving recognition accuracy, a binarization level adjustment, a learning function associated with the level adjustment, and the like. Next, the visual processing method of the present embodiment will be described based on the flowcharts of FIGS. 2 (a) and 2 (b). FIG. 2A is a program for moving the optical axis of the CCD camera 12 to the reference hole 21. First, in step 100, the target object 11 is imaged in the window 20 of the visual screen of the CCD camera 12, and the binarized screen is captured. Next, the process proceeds to step 102, where a reference hole 21 corresponding to a preset value is extracted on the binarized screen of the captured target object 11. The reference hole 21 has a shape close to a perfect circle so that it can be extracted without fail even if the target object 11 is a coarse material (casting) such as an engine cylinder head, and is located substantially at the center of the target object 11. Holes have been selected. Next, the process proceeds to step 104, where the center of gravity of the reference hole 21 is calculated. Then, the process shifts to step 106 to shift the optical axis of the CCD camera 12 to the calculated position of the center of gravity, and ends the program. After the above-described program is executed, a program for calculating the inclination of the target object 11 shown in FIG. 2B is executed. In step 200, the window of the visual screen of the CCD camera 12
At 20, the target object 11 is imaged and its binarized screen is captured. Next, proceeding to step 202, of the area in the binarized screen of the target object 11 captured by the CCD camera 12 as the primary feature amount extraction, the area of the area of 12 pixels or less is deleted as noise, and is deleted. All the areas whose area is 13 pixels or more are extracted. Next, the process proceeds to step 204, where it is determined whether or not any of the extracted regions has an area exceeding 8000 pixels. That is, it is assumed that the area of the true region (measurement target shape) is preset to be 13 to 8000 pixels in terms of the number of pixels, and the area of the extracted region is also in the same pixel number range. Then, in step 204, if the area of the region extracted in step 202 overflows beyond 8000 pixels, it is determined as YES, and the process proceeds to step 206, where it is determined whether or not the number of measurements is less than three. You. If the number of times of measurement is less than three in step 206 and it is determined as YES, the process proceeds to step 208. Since the binarization level is not appropriate, the binarization level is changed, and the process returns to step 202 again. Step 2
When the number of times of measurement becomes three and the determination is NO in 06, it is determined that the measurement is impossible, and that the visual processing is NG is notified. If the area of the region extracted in step 204 does not exceed 8000 pixels, no overflow has occurred, so the determination is NO.
Then, the process proceeds to step 210, and as a secondary feature value extraction, for the region extracted by the temporary feature value extraction in step 202, the area of the region exists in a predetermined allowable area of the measurement target shape, A circumscribed rectangle composed of a main axis length and a sub axis length circumscribing the area of the target object 11 exists in an allowable range of a circumscribed rectangle composed of a main axis length and a sub axis length (vertical and horizontal lengths) of a predetermined measurement target shape The extracted area is extracted as a measurement target shape, and the position of the center of gravity of the extracted measurement target shape is calculated. Here, as described above, generally, if the area (measurement target shape) is a hole, it can be recognized by measuring the circularity. However, when the target object 11 is a coarse material (casting) and there are many burrs around the hole and it is far from a perfect circle, it is not possible to use the method of recognizing the circle to derive its center of gravity because of a large error. . Therefore, such a target object
In the case of 11, as shown in FIG. 1 (b), a circumscribed rectangle CR composed of a main axis length ML and a sub axis length SL circumscribing the region (measurement target shape) is determined in advance. A method of using the circumscribed rectangle CR based on the main axis length ML and the sub-axis length SL of the area (measurement target shape) to determine whether or not they can be recognized from upper and lower tolerances is effective because the error is reduced. Next, proceeding to step 212, it is determined whether or not there is an area that has been extracted at the time of step 204 and has been excluded in the secondary feature quantity extraction processing in step 210. If there is an excluded region, the determination in step 212 is Y
ES is reached, and the process proceeds to step 214 to move the optical axis of the CCD camera 12 to a substantially central position between the position of the center of gravity of the reference hole 21 and the position of the excluded region to be extracted. Next, proceeding to step 216, at the moved optical axis position of the CCD camera 12,
For the excluded area, the CCD camera 12 newly captures an image of the target object 11, captures the binarized screen, and performs the same processing as described in step 210. In other words, the extraction conditions of step 210 are applied again to exclude regions that do not meet the preset conditions, and further extract the conforming regions as measurement target shapes, and calculate their center of gravity positions. Next, proceeding to step 218, it is determined whether or not re-extraction has been performed with the optical axis of the CCD camera 12 moved for all the excluded regions. If there are a plurality of excluded regions in step 218, the determination is no, and the process proceeds to step 214, and steps up to step 218 are similarly repeated. In step 218, when the movement of the optical axis of the CCD camera 12 for re-extraction is completed for all the excluded regions, the determination is YES, and the process proceeds to step 220. Note that the determination is N when there is no area excluded in step 212 described above.
The process also proceeds to step 220 when the result becomes O. Then, in step 220, the number of extracted measurement target shapes is 2 to 20.
Is determined. Here, as a determination criterion in step 220, if it is sufficient that the number of extracted measurement target shapes is two or more, if an extremely large number of measurement target shapes are extracted, the subsequent processing time becomes a problem. If the number is set to about 2 to 6, the preset true measurement target shape may be excluded from the extracted measurement target shapes. Therefore, the upper limit of the number of extracted measurement target shapes is set to be too small. Is not good either. If the number of measurement target shapes extracted in step 220 is out of the setting range of 2 to 20, the result is NO, and step 222
Then, it is determined whether or not the time is over the preset time. If the time is not over in step 222, it is NO and the process proceeds to step 224,
Since the binarization level is not appropriate, the process proceeds to step 202 after the binarization level is changed, and the subsequent steps are the same as described above. Here, if the time is over in step 222 and YES is determined, it is determined that measurement is not possible and that visual processing is NG is notified. The above processing is performed, the number of measurement target shapes extracted in step 220 becomes 2 to 20, and if YES is determined, the process proceeds to step 226, and the measurement target shape used for determination in step 220, that is, From the plurality of extracted measurement target shapes, the first measurement target shape is taken out as the measurement target shape 1, and the distance between the centers of gravity between the measurement target shape 1 and the reference hole 21 is calculated. Next, the process proceeds to step 228, where it is determined whether the calculation of the distance between the centers of gravity has been completed for all of the plurality of extracted measurement target shapes. If the calculation has not been completed for all the measurement target shapes in step 228, the determination is NO.
Then, the process proceeds to step 230, in which the second measurement target shape is extracted from the plurality of extracted measurement target shapes, is set as the measurement target shape 1, and the process proceeds to step 226. The distance between the center of gravity and the reference hole 21 is calculated. In step 228, when the calculation of the distance between the centers of gravity is completed for all the extracted measurement target shapes, the determination is YES and the process proceeds to step 232. In step 232, it is determined whether or not one of the distances between the centers of gravity between the shape 1 to be measured and the reference hole 21 is within a preset distance tolerance.
In step 232, if there is no or more than two distances between the centers of gravity of the measurement target shape 1 and the reference hole 21 within the preset distance tolerance, the process proceeds to step 222, and thereafter, It is described in the same way. In step 232, it is determined that the distance between the centers of gravity of the measurement target shape 1 and the reference hole 21 is within a preset distance tolerance is one, and the determination is YES. Then, the measurement target shape used for the determination in step 220, that is, the first measurement target shape out of the plurality of extracted measurement target shapes is taken out as the measurement target shape 2, and the measurement target shape 2 The distance between the center of gravity and the center of gravity of the reference hole 21 is calculated. Next, the process proceeds to step 236, where it is determined whether the calculation of the distance between the centers of gravity has been completed for all of the plurality of extracted measurement target shapes. And
If the calculation of the distance between the centers of gravity is not completed for all the shapes to be measured in Step 236, the determination is NO, and Step 238 is performed.
Then, the second measurement target shape is taken out of the plurality of extracted measurement target shapes, is set as the measurement target shape 2, and the process proceeds to step 234. Similarly to the above, the measurement target shape 2 and the reference hole 21 are extracted. Is calculated. In step 236, when the calculation of the distance between the centers of gravity is completed for all the extracted shapes to be measured, the determination is YES and the process proceeds to step 240. In step 240, it is determined whether or not one of the distances between the centers of gravity between the measurement target shape 2 and the reference hole 21 is within a preset distance tolerance. Then, in step 240, the measurement target shape 2 and the reference hole 21
If there is no or more than two distances between the centers of gravity within the preset distance tolerance, the process proceeds to step 222, and the subsequent description will be made in the same manner as described above. If it is determined in step 240 that the distance between the centers of gravity between the measurement target shape 2 and the reference hole 21 is within a preset distance tolerance is one, the determination is YES, and after storing the measurement target shape 2, step 242 is performed. Then, the inclination of a straight line connecting the respective centers of gravity of the measurement target shape 1 stored in step 232 and the measurement target shape 2 stored in step 240 is calculated, so that the CCD camera and the target object This program in which the relative angular deviation in the rotational direction is determined is ended. As described above, first, the optical axis of the CCD camera 12 is
Is moved to the reference hole 21, and an area recognizable in the window 20 of the visual screen at that position is extracted as the shape to be measured. Then, if there is an unrecognizable area at that position, the optical axis of the CCD camera 12 is aligned with the reference hole 2 of the target object 11.
Move from 1 to the area, and extract the newly recognizable area as the measurement target shape. By performing such a visual processing method, the angle difference between the optical axis of the CCD camera 12 and the area (measurement target shape) of the target object 11 and the difference in the reflection state of the illumination light source are eliminated, and the target object 11 in the CCD camera 12 is eliminated. The extraction condition with the region (measurement target shape) is improved. Furthermore, the distance between the centers of gravity of the extracted measurement target shape and the reference hole is compared and determined by a preset value, and a specified set of measurement target shapes is recognized. In this way, the recognition (visual processing) error of the CCD camera 12 is absorbed, and the measurement target shape of the target object is stably recognized, so that the relative positional relationship between the CCD camera 12 and the target object 11 including the rotation direction is obtained. Is required.

【発明の効果】【The invention's effect】

本発明は、カメラで撮像した対応物体の基準形状から
算出された重心位置にカメラの光軸を移動して、その位
置にて撮像された2値化画面における所定面積範囲にあ
る領域の中から所定特徴量を有する計測対象形状を抽出
し、領域のうちで計測対象形状として除外されるものに
対して、カメラの光軸を重心位置とその領域との略中央
まで移動し、同様の抽出条件にて新たに計測対象形状を
抽出するので、対象物体の計測対象形状が漏れなく抽出
され、更に、抽出された計測対象形状と基準形状との重
心間距離を予め設定された値と比較判定することにより
真の一組の計測対象形状を特定できるので対象物体の傾
きが確実に求められる。
The present invention moves the optical axis of the camera to the position of the center of gravity calculated from the reference shape of the corresponding object imaged by the camera, and selects an area within a predetermined area range in the binarized screen imaged at that position. A measurement target shape having a predetermined characteristic amount is extracted, and the optical axis of the camera is moved to a position of the center of gravity and substantially the center of the region with respect to a region excluded from the measurement target shape, and the same extraction conditions are used. Since the shape to be measured is newly extracted in, the shape to be measured of the target object is extracted without omission, and further, the distance between the centers of gravity of the extracted shape to be measured and the reference shape is compared with a predetermined value and determined. As a result, a true set of measurement target shapes can be specified, so that the inclination of the target object can be reliably obtained.

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

第1図(a)は本発明の具体的な一実施例に係る視覚処
理方法におけるカメラと対象物体との位置関係を示した
斜視図。第1図(b)は第1図(a)のカメラの視覚画
面における対象物体の計測対象形状の見えを示した説明
図。第2図(a)及び第2図(bは同実施例に係る視覚
処理方法を達成するためのフローチャートである。 11……対象物体、12……CCDカメラ 20……視覚画面のウィンドウ、21……基準穴 22,23……計測対象形状 ML……主軸長、SL……副軸長、CR……外接長方形
FIG. 1A is a perspective view showing a positional relationship between a camera and a target object in a visual processing method according to a specific embodiment of the present invention. FIG. 1B is an explanatory diagram showing the appearance of the shape of the object to be measured on the visual screen of the camera in FIG. 1A. FIGS. 2 (a) and 2 (b) are flowcharts for achieving the visual processing method according to the embodiment. 11: target object, 12: CCD camera 20: window of visual screen, 21 …… Reference holes 22,23 …… Measurement target shape ML …… Spindle length, SL …… Counter shaft length, CR …… A circumscribed rectangle

フロントページの続き (72)発明者 山口 久雄 愛知県豊田市トヨタ町1番地 トヨタ自 動車株式会社内 (72)発明者 山本 吉二 愛知県刈谷市朝日町1丁目1番地 豊田 工機株式会社内 (56)参考文献 特開 昭61−213705(JP,A)Continued on the front page (72) Inventor Hisao Yamaguchi 1 Toyota Town, Toyota City, Aichi Prefecture Inside Toyota Motor Co., Ltd. (72) Inventor Yoshiji Yamamoto 1-1-1, Asahimachi, Kariya City, Aichi Prefecture Toyota Koki Co., Ltd. ( 56) References JP-A-61-213705 (JP, A)

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】カメラで撮像された2値化画面より対象物
体に設けられた基準形状の重心を算出し、 前記カメラの光軸をその重心位置に移動し、 その重心位置にて前記カメラで撮像された2値化画面に
おける、所定面積範囲にある領域の中から所定特徴量を
有する計測対象形状を抽出し、 前記領域のうちで計測対象形状として確認されないもの
がある場合には、前記カメラの光軸を前記重心位置と前
記認識されなかった領域との略中央まで移動させ、新た
に前記カメラで撮像された2値化画面におけるその領域
が前記所定特徴量を有する計測対象形状として認識され
るものを抽出し、 抽出された前記計測対象形状と前記基準形状との重心間
距離を予め設定された値にて比較判定し、 比較判定にて特性された一組の計測対象形状から前記対
象物体の傾きを算出する ことを特徴とする視覚処理方法。
1. A center of gravity of a reference shape provided on a target object is calculated from a binarized screen imaged by a camera, the optical axis of the camera is moved to the position of the center of gravity, and the camera is moved at the position of the center of gravity by the camera. In the imaged binarized screen, a measurement target shape having a predetermined feature amount is extracted from a region within a predetermined area range, and if there is any of the regions that is not confirmed as the measurement target shape, the camera Is moved to the approximate center of the position of the center of gravity and the unrecognized region, and the region on the binarized screen newly captured by the camera is recognized as the measurement target shape having the predetermined feature amount. The distance between the centers of gravity of the extracted measurement target shape and the reference shape is compared and determined by a preset value, and the object is determined from a set of measurement target shapes characterized by the comparison determination. The visual processing method characterized by calculating the slope of the body.
JP63314736A 1988-12-13 1988-12-13 Visual processing method Expired - Lifetime JP2613645B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63314736A JP2613645B2 (en) 1988-12-13 1988-12-13 Visual processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63314736A JP2613645B2 (en) 1988-12-13 1988-12-13 Visual processing method

Publications (2)

Publication Number Publication Date
JPH02159506A JPH02159506A (en) 1990-06-19
JP2613645B2 true JP2613645B2 (en) 1997-05-28

Family

ID=18056961

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63314736A Expired - Lifetime JP2613645B2 (en) 1988-12-13 1988-12-13 Visual processing method

Country Status (1)

Country Link
JP (1) JP2613645B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004272378A (en) * 2003-03-05 2004-09-30 Ricoh Co Ltd Image input device
JP2008139258A (en) * 2006-12-05 2008-06-19 Meidensha Corp Graphic group image recognition technique

Also Published As

Publication number Publication date
JPH02159506A (en) 1990-06-19

Similar Documents

Publication Publication Date Title
EP0827127B1 (en) Local positioning apparatus, and method therefor
CN102342088B (en) Calibration device and method of onboard camera calibration
US20230252677A1 (en) Method and system for detecting position relation between vehicle and lane line, and storage medium
DE69218812T2 (en) Method and device for inspecting the end of an object for defects
JP3209828B2 (en) Inter-vehicle distance measuring device and stereo image capturing device
US4993836A (en) Method and apparatus for measuring form of three-dimensional objects
Coulombeau et al. Vehicle yaw, pitch, roll and 3D lane shape recovery by vision
CN117123931A (en) A pipe centering method and laser cutting method based on machine vision
JP2613645B2 (en) Visual processing method
JP3327068B2 (en) Road surface measurement device
CN108492306A (en) A kind of X-type Angular Point Extracting Method based on image outline
US20030113020A1 (en) Method for the extraction of image features caused by structure light using template information
JPH1049662A (en) Vehicle identification device
US20220076428A1 (en) Product positioning method
JPH11506847A (en) Visual identification method
RU2166748C1 (en) Technique forming images and defining relief of objects of complicated form
JP4062581B2 (en) Region extraction method for fringe analysis
CN109118511B (en) Image processing method of tilt sensor
JP4348859B2 (en) Precise 3D position and orientation detection device for circular features of parts
DE4407285C2 (en) Procedure for measuring the position of a hole
JPH0754253B2 (en) Tracking type inter-vehicle distance measuring device
JP2527231B2 (en) Distance measuring device
JPH0843056A (en) Moving object characteristic acquisition method and apparatus
EP4584568B1 (en) Method for calibration of vehicle headlights
JP2533436B2 (en) Object recognition method

Legal Events

Date Code Title Description
S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313115

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080227

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090227

Year of fee payment: 12

EXPY Cancellation because of completion of term