JPH05314258A - Image processing device and robot control device - Google Patents
Image processing device and robot control deviceInfo
- Publication number
- JPH05314258A JPH05314258A JP11378692A JP11378692A JPH05314258A JP H05314258 A JPH05314258 A JP H05314258A JP 11378692 A JP11378692 A JP 11378692A JP 11378692 A JP11378692 A JP 11378692A JP H05314258 A JPH05314258 A JP H05314258A
- Authority
- JP
- Japan
- Prior art keywords
- image
- pixels
- target frame
- black
- white
- 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.)
- Withdrawn
Links
Landscapes
- Numerical Control (AREA)
- Image Processing (AREA)
- Closed-Circuit Television Systems (AREA)
- Devices For Indicating Variable Information By Combining Individual Elements (AREA)
- Image Analysis (AREA)
Abstract
(57)【要約】
【目的】 本発明は画像処理装置及びロボット制御装置
の改善に関し、対象物の色につき、事前に黒又は白が明
確になっていない場合であっても、それを自動判別し
て、対象物の計測情報を正確に演算すること、及び、高
速に対象物の認識をすることを目的とする。
【構成】 画像処理装置は、画像取得対象16に計算対
象枠Fを設定する範囲設定手段11と、画像取得対象1
6に設定された該対象枠F上の白の画素数Wi又は黒の
画素数Bjを計数する計数手段12と、該対象枠F上の
白の画素数Wiや黒の画素数Bjを比較する比較手段1
3と、該対象枠F内の対象画像の重心座標値を演算する
演算手段14とを具備し、該対象枠F上の白の画素数W
i及び黒の画素数Bjに基づいて該対象枠F内の画像取
得対象16の色調を識別することを含み構成し、ロボッ
ト制御装置は、ロボット作業部17及び画像取得手段1
8と本発明の画像処理装置から成る画像計測手段19と
を具備することを含み構成する。
(57) [Abstract] [Object] The present invention relates to an improvement in an image processing device and a robot control device, and automatically distinguishes a color of an object even if black or white is not clear in advance. Then, the object is to accurately calculate the measurement information of the target object and to recognize the target object at high speed. The image processing apparatus includes a range setting unit 11 that sets a calculation target frame F in an image acquisition target 16, and an image acquisition target 1.
The counting means 12 for counting the number of white pixels Wi or the number of black pixels Bj on the target frame F set to 6 is compared with the number of white pixels Wi or the number of black pixels Bj on the target frame F. Comparison means 1
3 and a calculation means 14 for calculating the barycentric coordinate value of the target image in the target frame F, and the number of white pixels W on the target frame F
It is configured to include identifying the color tone of the image acquisition target 16 in the target frame F based on i and the number of black pixels Bj, and the robot control device includes the robot working unit 17 and the image acquisition unit 1.
8 and an image measuring unit 19 including the image processing apparatus of the present invention.
Description
【0001】〔目 次〕 産業上の利用分野 従来の技術(図9) 発明が解決しようとする課題(図10) 課題を解決するための手段(図1,2) 作用 実施例 (1)第1の実施例(図3〜5) (2)第2の実施例(図6,7) (3)第3の実施例(図8) 発明の効果[Table of Contents] Industrial Application Field of the Prior Art (FIG. 9) Problem to be Solved by the Invention (FIG. 10) Means for Solving the Problem (FIGS. 1 and 2) Action Embodiment (1) First Example 1 (FIGS. 3 to 5) (2) Second example (FIGS. 6 and 7) (3) Third example (FIG. 8)
【0002】[0002]
【産業上の利用分野】本発明は、画像処理装置及びロボ
ット制御装置に関するものであり、更に詳しく言えば、
画像取得情報から各種計測量を計算する装置及びその応
用装置の改善に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing device and a robot control device, and more specifically,
The present invention relates to improvements in an apparatus that calculates various measurement amounts from image acquisition information and an application apparatus thereof.
【0003】近年、各種電子機器や精密機械の製造工程
の自動化に伴い、目的とする対象物にロボットハンドを
位置決めして各種教示作業をするロボット制御装置が使
用されている。また、ロボットの目としてテレビカメラ
が搭載され、対象物の画像取得データから計測した位置
情報に基づいてその対象物の教示作業する制御方法が開
発されている。In recent years, along with automation of manufacturing processes of various electronic devices and precision machines, a robot control device for positioning a robot hand on a target object and performing various teaching work is used. In addition, a control method has been developed in which a television camera is mounted as the eyes of the robot and the teaching work of the target object is performed based on the position information measured from the image acquisition data of the target object.
【0004】ところで、従来例のロボット制御装置によ
れば、画像計測部において、対象画像の重心座標値の演
算処理の高速化を図るため、予め、対象物の色を黒、そ
の周辺の背景色を白又は対象物の色を白、その周辺の背
景色を黒とする識別条件が仮定され、その対象画像の重
み付けとして黒には、「1」,白には「0」が設定さ
れ、これに基づいて、その重心座標値が演算されてい
る。By the way, according to the robot controller of the conventional example, in order to speed up the calculation process of the barycentric coordinate value of the target image in the image measuring unit, the color of the target object is black and the background color around the target object is preset. Is assumed to be white or the color of the object is white and the background color around it is black, and "1" is set to black and "0" is set to white as the weighting of the target image. The barycentric coordinate value is calculated based on
【0005】このため、対象物の色が黒又は白、その周
辺の背景色が白又は黒とする識別条件を仮定しない場
合,すなわち、未知の色の対象物の場合について、それ
を認識する要求があった場合に、その画像処理が困難と
なる。Therefore, in the case where the discrimination condition that the color of the object is black or white and the background color around the object is white is not assumed, that is, in the case of the object of an unknown color, it is required to recognize it. If so, the image processing becomes difficult.
【0006】また、計算対象枠の内部に対象物の画像と
対象物以外の物体とが含まれた場合に、その内部画面を
計算対象する重心座標値の計算であっても、演算処理に
限界を生じてその正確さに欠けることから、計算された
重心座標が対象物の重心位置と整合しない場合がある。Further, when an image of a target object and an object other than the target object are included in the calculation target frame, the calculation processing is limited even in the calculation of the barycentric coordinate value for which the internal screen is calculated. And the calculated barycentric coordinates may not match the barycentric position of the object.
【0007】そこで、対象物の色につき、事前に黒又は
白が明確になっていない場合であっても、それを自動判
別して、対象物の計測情報を正確に演算すること、及
び、高速に対象物の認識をすることができる装置及びそ
の応用装置が望まれている。Therefore, even if black or white is not clearly defined in advance with respect to the color of the object, it is automatically discriminated and the measurement information of the object is accurately calculated. There is a demand for a device capable of recognizing an object and its applied device.
【0008】[0008]
【従来の技術】図9,10は、従来例に係る説明図であ
る。また、図9は、従来例に係るロボット制御装置の物
体認識方法の説明図であり、図9(a)はその構成図で
あり、また、図9(b)はその画像処理フローチャート
をそれぞれ示している。9 and 10 are explanatory views of a conventional example. Further, FIG. 9 is an explanatory diagram of an object recognition method of a robot controller according to a conventional example, FIG. 9 (a) is its configuration diagram, and FIG. 9 (b) is its image processing flowchart. ing.
【0009】例えば、目的とする対象物10にロボット
ハンド1を位置決めして各種教示作業をするロボット制
御装置は、図9(a)において、ロボットハンド1,テ
レビカメラ2,画像計測部3及びロボット制御部4から
成る。For example, a robot control device for positioning the robot hand 1 on a target object 10 for various teaching work is shown in FIG. 9A, which is a robot hand 1, a television camera 2, an image measuring section 3 and a robot. It consists of the control unit 4.
【0010】当該装置の機能は、テレビカメラ2を搭載
したロボットハンド1が対象物10の領域上付近に移動
されると、その領域の画像がテレビカメラ2により撮像
される。また、画像計測部3でその画像信号が白黒階調
係る二値化データに変換され、そのデータが画像計測部
3により演算処理され、対象物10が認識される。これ
により、対象物10にロボットハンド1が位置決めさ
れ、把持作業等の教示作業が行われる。The function of the apparatus is that when the robot hand 1 equipped with the television camera 2 is moved to the vicinity of the area of the object 10, the image of the area is captured by the television camera 2. Further, the image measuring unit 3 converts the image signal into binarized data relating to black and white gradation, and the data is arithmetically processed by the image measuring unit 3 to recognize the object 10. As a result, the robot hand 1 is positioned on the object 10 and teaching work such as gripping work is performed.
【0011】なお、図10(a),(b)は、従来例に係
る問題点を説明する対象物10の取得画像図であり、対
象物10の領域の画像データをあるスライスレベルによ
り二値化した明るい部分を白,暗い部分を黒をモニタテ
レビに表示した図を示している。10 (a) and 10 (b) are acquired image diagrams of the object 10 for explaining the problems in the conventional example, and the image data of the area of the object 10 is binarized by a certain slice level. The figure shows the changed bright parts in white and the dark parts in black on the monitor TV.
【0012】例えば、対象物10にロボットハンド1を
位置決めする場合に、画像計測部3において、対象物1
0の色を黒と仮定して、画像取得対象16に計算対象枠
Fが設定され、その内部の対象画像について、その重心
座標が計測される。For example, when the robot hand 1 is positioned on the object 10, the object 1 is measured by the image measuring unit 3.
Assuming that the color of 0 is black, the calculation target frame F is set in the image acquisition target 16, and the barycentric coordinates of the target image inside thereof are measured.
【0013】これは、対象物10の色とその周辺の背景
色との識別条件を画像計測部3に予め設定することによ
り、対象画像の重心座標値の演算処理の高速化を図るた
めである。This is because the discrimination condition between the color of the object 10 and the background color around the object 10 is set in advance in the image measuring section 3 so as to speed up the calculation process of the barycentric coordinate value of the object image. ..
【0014】すなわち、図9(b)において、まず、ス
テップP1で対象物10の色を予め黒と仮定し、次に、
ステップP2でカメラ入力画像を適当なレベルにより二
値化する。次いで、ステップP3で対象物10がもっと
も有りそうなところに計算対象枠Fを設定する。That is, in FIG. 9B, first, in step P1, it is assumed that the color of the object 10 is black in advance, and then,
In step P2, the camera input image is binarized by an appropriate level. Next, in step P3, the calculation target frame F is set at a position where the object 10 is most likely to exist.
【0015】例えば、図10(a)に示すように対象物1
0と対象物以外の物体9との離隔距離や対象物10の大
きさを考慮して、予め、画像計測部3に対して、重心座
標を演算する対象画像領域に係わり計算対象枠Fの大き
さが固定される。これは、計算対象枠Fをある範囲に設
定することによって、対象物10と対象物外の物体9を
切り分けることができるためである。For example, as shown in FIG.
In consideration of the separation distance between 0 and the object 9 other than the target object and the size of the target object 10, the size of the calculation target frame F related to the target image area in which the barycentric coordinates are calculated with respect to the image measurement unit 3 in advance. Is fixed. This is because the target object 10 and the object 9 outside the target object can be separated by setting the calculation target frame F in a certain range.
【0016】これにより、計算対象枠F外の領域につい
ては、重心座標計算に含めず、その枠内に限って演算を
実行することにより計算時間の短縮化が図れる。次に、
ステップP4で計算対象枠Fの内部を対象に、黒を
「1」,白を「0」の重み付けしてその重心座標値を求
め、その後、ステップP5で先に求めた重心座標を対象
物10の重心位置として位置決め等の作業を行う。Thus, the region outside the calculation target frame F is not included in the barycentric coordinate calculation, and the calculation is executed only within that frame, whereby the calculation time can be shortened. next,
In step P4, for the inside of the calculation target frame F, black is weighted with "1" and white is weighted with "0" to obtain the barycentric coordinate values, and thereafter, in step P5, the barycentric coordinates previously obtained are determined. Positioning is performed as the center of gravity position of.
【0017】[0017]
【発明が解決しようとする課題】ところで、従来例によ
れば画像計測部3において、対象画像の重心座標値の演
算処理の高速化を図るため、予め、対象物10の色を
黒、その周辺の背景色を白とする識別条件が仮定されて
いる。また、対象画像の黒=「1」,白=「0」の重み
付けに基づいて、その重心座標値が演算されている。By the way, according to the conventional example, in order to speed up the calculation process of the barycentric coordinate value of the target image in the image measuring unit 3, the color of the target object 10 is set to black in advance and its periphery is set in advance. It is assumed that the discrimination condition that the background color of is white. Further, the barycentric coordinate value is calculated based on the weighting of the target image such that black = “1” and white = “0”.
【0018】このため、対象物10の色が黒又は白、そ
の周辺の背景色が白又は黒とする識別条件を仮定しない
場合,すなわち、未知の色の対象物10の場合につい
て、それを認識する要求があった場合に、その画像処理
が困難となる。Therefore, when the discrimination condition that the color of the object 10 is black or white and the surrounding background color is white or black is not assumed, that is, the object 10 of an unknown color is recognized, it is recognized. If there is a request to do so, the image processing becomes difficult.
【0019】例えば、対象物10の色が黒であって、そ
の周辺の背景色が白とする画像取得状態(被写体)にお
いて、画像処理部3に識別条件が仮定されなっかた場合
には、図9(b)のステップP4で、誤って、対象物1
0の色が白=「0」、その周辺の背景色が黒=「1」と
して画像処理が行われることにより、対象画像の正しい
重心座標の演算処理を行うことができない。このため、
ステップP5で誤った対象画像の重心座標値によって対
象物10の重心位置を決定してしまう恐れがある。For example, in the image acquisition state (subject) in which the color of the object 10 is black and the surrounding background color is white, if the identification condition is not assumed in the image processing unit 3, In step P4 of FIG. 9B, the target 1
Since the image processing is performed with the color of 0 being white = “0” and the background color of the periphery being black = “1”, the correct barycentric coordinate calculation processing of the target image cannot be performed. For this reason,
In step P5, the barycentric position of the target object 10 may be determined by the incorrect barycentric coordinate value of the target image.
【0020】また、図10(b)に示すように計算対象枠
Fの内部に対象物10の画像と対象物以外の物体9とが
含まれた場合に、その内部画面を計算対象する重心座標
値の計算であっても、演算処理に限界を生じてその正確
さに欠けることから、計算された重心座標が対象物10
の重心位置と整合しない場合がある。Further, when the image of the object 10 and the object 9 other than the object are included in the calculation target frame F as shown in FIG. Even in the calculation of the value, since the calculation process has a limit and its accuracy is lacking, the calculated barycentric coordinate is the object 10.
May not match the center of gravity position of.
【0021】これは、重心座標値の誤差に比べて面積の
違いがわずかとなるためであり、これにより、その面積
差から対象物10を確実に検出するのが困難となる。す
なわち、計算対象枠Fを固定した方法では、テレビカメ
ラ2の位置ずれ等により、図10(b)において、計算対
象枠Fが対象外の物体9のほんの一部のみを含む場合で
あっても、対象物10の重心座標から該物体9までの距
離が遠い成分となるため、重心座標計算値の誤差が大き
くなり、それが真の対象物10の重心座標位置から大き
く掛け離れてしまうこととなる。This is because the difference in area is smaller than the error in the coordinate value of the center of gravity, which makes it difficult to reliably detect the object 10 from the difference in area. That is, in the method in which the calculation target frame F is fixed, even when the calculation target frame F includes only a part of the non-target object 9 in FIG. Since the distance from the barycentric coordinates of the object 10 to the object 9 is a long component, the error of the calculated value of the barycentric coordinates becomes large, which greatly deviates from the true barycentric coordinate position of the object 10. ..
【0022】この結果、計算対象枠内の対象物10の面
積計算値が予定していた対象物11の実際面積値と異な
ることにより、計測不能あるいはテレビカメラ2の取得
領域の誤り,すなわち、それが取り付けられたロボット
ハンド1の位置ずれが大きすぎたとして処理される。As a result, the calculated area value of the object 10 in the calculation object frame differs from the actual area value of the object 11 that is scheduled, so that measurement is impossible or the acquisition area of the television camera 2 is erroneous, that is, It is processed as if the displacement of the robot hand 1 to which is attached is too large.
【0023】かかる場合、計算対象枠Fの中心とその内
部画面に係る重心座標計算値とがたまたま一致すること
もある。しかし、対象物以外の物体9の画素(ノイズ画
像)が含まれた重心座標計算値では、真に計算対象枠F
の中心が対象物10の画像重心座標に一致するとは限ら
ない。In such a case, the center of the calculation target frame F may happen to coincide with the calculated barycentric coordinate value of the internal screen. However, in the calculated barycentric coordinates including the pixels (noise image) of the object 9 other than the target object, the true calculation target frame F
The center of does not always match the image centroid coordinates of the object 10.
【0024】このような状態で、制御系が誤って対象物
10の重心位置を認識し、以後の教示作業に移行する
と、ロボットハンド1を対象物10に衝突させたり、そ
れを転倒させる等の制御ミスが起こる。In this state, when the control system mistakenly recognizes the position of the center of gravity of the object 10 and shifts to the teaching work thereafter, the robot hand 1 collides with the object 10 or falls. Control error occurs.
【0025】これにより、対象物10の色,すなわち、
黒又は白が事前に明確になっていなければ、画像計測部
3において、誤った重心座標値を演算する恐れがあり、
画像処理の信頼性の低下を招く。また、該重心座標値の
計測不能に陥った場合に、再度、テレビカメラ2の移
動,すなわち、ロボットハンド1の移動が必要となり位
置決め処理の高速化の妨げとなるという問題がある。As a result, the color of the object 10, that is,
If black or white is not clear in advance, the image measuring unit 3 may calculate an incorrect barycentric coordinate value.
This leads to a decrease in reliability of image processing. Further, when the gravity center coordinate value cannot be measured, the television camera 2 needs to be moved again, that is, the robot hand 1 needs to be moved again, which hinders the speeding up of the positioning process.
【0026】本発明は、かかる従来例の問題点に鑑み創
作されたものであり、対象物の色につき、事前に黒又は
白が明確になっていない場合であっても、それを自動判
別して、対象物の計測情報を正確に演算すること、及
び、高速に対象物の認識をすることが可能となる画像処
理装置及びロボット制御装置の提供を目的とする。The present invention was created in view of the problems of the conventional example, and automatically distinguishes the color of the object even if black or white is not clear in advance. Thus, it is an object of the present invention to provide an image processing device and a robot control device that can accurately calculate measurement information of an object and recognize the object at high speed.
【0027】[0027]
【課題を解決するための手段】図1,2は、本発明に係
る画像処理装置及びロボット制御装置の原理図(その
1,2)をそれぞれ示している。1 and 2 show principle diagrams (Nos. 1 and 2) of an image processing apparatus and a robot control apparatus according to the present invention, respectively.
【0028】本発明の第1の画像処理装置は図1(a)
や図2(a)に示すように、画像取得対象16に計算対
象枠Fを設定する範囲設定手段11と、前記画像取得対
象16に設定された計算対象枠上の白の画素数Wi〔i
=1,2,3…〕又は黒の画素数Bj〔j=1,2,3
…〕を計数する計数手段12と、前記計算対象枠F上の
白の画素数Wiや黒の画素数Bjを比較する比較手段1
3と、前記計算対象枠F内の対象画像の重心座標値を演
算する演算手段14とを具備し、前記計算対象枠F上の
白の画素数Wi及び黒の画素数Bjに基づいて該計算対
象枠F内の画像取得対象16の色調を識別することを特
徴とする。The first image processing apparatus of the present invention is shown in FIG.
As shown in FIG. 2A, the range setting means 11 for setting the calculation target frame F in the image acquisition target 16 and the number of white pixels Wi [i on the calculation target frame set in the image acquisition target 16 Wi [i
= 1, 2, 3 ...] or the number of black pixels Bj [j = 1, 2, 3
, And a comparing means 1 for comparing the number of white pixels Wi and the number of black pixels Bj on the calculation target frame F.
3 and a calculation unit 14 for calculating the barycentric coordinate value of the target image in the calculation target frame F, and the calculation is performed based on the number of white pixels Wi and the number of black pixels Bj on the calculation target frame F. The color tone of the image acquisition target 16 in the target frame F is identified.
【0029】なお、本発明の第1の画像処理装置におい
て、前記比較手段13が図2(b)に示すように、計算
対象枠F上の白の画素数Wiと黒の画素数Bjとを比較
することを特徴とする。In the first image processing apparatus of the present invention, the comparison means 13 determines the number of white pixels Wi and the number of black pixels Bj on the calculation target frame F as shown in FIG. 2B. It is characterized by comparing.
【0030】さらに、本発明の第2の画像処理装置は、
前記第1の画像処理装置において、図1(a)に示すよ
うに、前記比較手段13が,予め設定された白の画素数
Wi又は黒の画素数Bjの判定基準値DRと前記計算対
象枠F上の白の画素数Wiや黒の画素数Bjとを比較す
ることを特徴とする。Further, the second image processing apparatus of the present invention is
In the first image processing apparatus, as shown in FIG. 1A, the comparing unit 13 sets the determination reference value DR of the preset white pixel number Wi or the black pixel number Bj and the calculation target frame. It is characterized in that the number of white pixels Wi on F and the number of black pixels Bj are compared.
【0031】また、本発明の第3の画像処理装置は前記
第1,第2の画像処理装置において、予め設定された白
の画素数Wi又は黒の画素数Bjの判定基準値DRと前
記計算対象枠F上の白の画素数Wiや黒の画素数Bjと
の比較処理に基づいて計測異常を発生する警報手段15
が設けられることを特徴とする。The third image processing apparatus of the present invention is the same as the first and second image processing apparatus, wherein the preset reference value DR of the number of white pixels Wi or the number of black pixels Bj and the calculation are set. Warning means 15 for generating a measurement abnormality based on a comparison process with the number of white pixels Wi and the number of black pixels Bj on the target frame F
Is provided.
【0032】なお、本発明の第3の画像処理装置におい
て、前記警報手段15が,予め設定された白の画素数W
iの判定基準値DRと前記計算対象枠F上の白の画素数
Wiとの第1の比較処理及び前記黒の画素数Bjの判定
基準値DRと前記計算対象枠F上の黒の画素数Bjとの
第2の比較処理に基づいて計測異常を発生することを特
徴とする。In the third image processing apparatus according to the present invention, the warning means 15 sets the preset number of white pixels W.
First comparison processing between the judgment reference value DR of i and the number of white pixels Wi on the calculation target frame F, and the judgment reference value DR of the number of black pixels Bj and the number of black pixels on the calculation target frame F It is characterized in that a measurement abnormality is generated based on the second comparison process with Bj.
【0033】さらに、本発明のロボット制御装置は、図
1(b)に示すように、対象物10に係わり各種教示作
業をするロボット作業部17と、前記対象物10の画像
を取得する画像取得手段18と、前記対象物10の位置
情報を計測する画像計測手段19と、前記ロボット作業
部17,画像取得手段18及び画像計測手段19の入出
力を制御する制御手段20とを具備し、前記画像計測手
段19が本発明の第1〜第3の画像処理装置から成るこ
とを特徴とし、上記目的を達成する。Further, the robot controller of the present invention, as shown in FIG. 1 (b), has a robot working unit 17 for performing various teaching operations related to the object 10 and an image acquisition for acquiring an image of the object 10. And a control means 20 for controlling the input and output of the robot working unit 17, the image acquisition means 18, and the image measurement means 19, and the image measurement means 19 for measuring the position information of the object 10. The image measuring means 19 comprises the first to third image processing devices of the present invention, and achieves the above object.
【0034】[0034]
【作 用】本発明の第1の画像処理装置によれば、図1
(a)に示すように、範囲設定手段11,計数手段1
2,比較手段13及び演算手段14が具備され、該比較
手段13が図2(b)に示すように、計算対象枠F上の
白の画素数Wiと黒の画素数Bjとを比較する。[Operation] According to the first image processing apparatus of the present invention, as shown in FIG.
As shown in (a), range setting means 11 and counting means 1
2. The comparison means 13 and the calculation means 14 are provided, and the comparison means 13 compares the number Wi of white pixels and the number Bj of black pixels on the calculation target frame F as shown in FIG. 2B.
【0035】例えば、メモリ領域上に展開された画像取
得対象16に範囲設定手段11により計算対象枠Fが設
定されると、該画像取得対象16に設定された計算対象
枠上の白の画素数Wi〔i=1,2,3…〕又は黒の画
素数Bj〔j=1,2,3…〕が計数手段12により計
数される。また、計算対象枠上の白の画素数Wiや黒の
画素数Bjが比較手段13により比較される。For example, when the calculation target frame F is set to the image acquisition target 16 expanded in the memory area by the range setting means 11, the number of white pixels on the calculation target frame set in the image acquisition target 16 is set. Wi [i = 1, 2, 3 ...] Or the number of black pixels Bj [j = 1, 2, 3 ...] is counted by the counting means 12. Further, the comparison unit 13 compares the number of white pixels Wi and the number of black pixels Bj on the calculation target frame.
【0036】この際に、比較手段13により、図2
(b)に示すように、計算対象枠F上の白の画素数Wi
と黒の画素数Bjとが比較される。例えば、白の画素数
Wiが黒の画素数Bjよりも多い場合には、対象物10
の色は黒として、該計算対象枠F内の画像取得対象16
の色調を自動識別することが可能となる。At this time, the comparison means 13 is used to
As shown in (b), the number of white pixels Wi on the calculation target frame F
And the number of black pixels Bj are compared. For example, when the number of white pixels Wi is greater than the number of black pixels Bj, the target object 10
Is black, and the image acquisition target 16 in the calculation target frame F is
It is possible to automatically identify the color tone of.
【0037】また、逆に、黒の画素数Biが白の画素数
Wiよりも多い場合には、対象物10の色は白として、
該計算対象枠F内の画像取得対象16の色調を自動識別
することが可能となる。これにより、当該自動識別処理
に基づいて計算対象枠F内の対象画像の重心座標値が演
算手段14により演算される。On the contrary, when the number of black pixels Bi is larger than the number of white pixels Wi, the color of the object 10 is white,
It is possible to automatically identify the color tone of the image acquisition target 16 in the calculation target frame F. Accordingly, the barycentric coordinate value of the target image in the calculation target frame F is calculated by the calculation means 14 based on the automatic identification processing.
【0038】このため、対象物10の色が黒又は白、そ
の周辺の背景色が白又は黒とする識別条件を設定(仮
定)しない場合,すなわち、対象物10が未知の色の場
合について、それを認識する要求があった場合にも、画
像取得対象16の色調識別処理を容易に実行することが
可能となる。Therefore, in the case where the discrimination condition that the color of the object 10 is black or white and the surrounding background color is white or black is not set (assumed), that is, the object 10 is an unknown color, Even if there is a request to recognize it, it is possible to easily execute the color tone identification processing of the image acquisition target 16.
【0039】これにより、対象画像の正しい重心座標値
の演算処理を行うことが可能となり、正確な対象画像の
重心座標値によって対象物10の重心位置を決定するこ
とが可能となる。As a result, it becomes possible to perform the correct arithmetic processing of the barycentric coordinate value of the target image, and it becomes possible to determine the barycentric position of the object 10 by the accurate barycentric coordinate value of the target image.
【0040】さらに、本発明の第2の画像処理装置によ
れば、第1の画像処理装置において、図1(a)に示す
比較手段13が,予め設定された白の画素数Wi又は黒
の画素数Bjの判定基準値DRと計算対象枠F上の白の
画素数Wiや黒の画素数Bjとを比較する。Further, according to the second image processing apparatus of the present invention, in the first image processing apparatus, the comparing means 13 shown in FIG. 1A has the preset number of white pixels Wi or black. The determination reference value DR of the number of pixels Bj is compared with the number of white pixels Wi or the number of black pixels Bj on the calculation target frame F.
【0041】このため、計算対象枠F上の未知の画素に
ついて、該計算対象枠F内の対象画像の色の画素と反対
の色の画素の画素数を計数し、その画素数が判定基準値
DR,例えば、零又は一定の許容できる数以下の場合に
は、「良」とし、それ以外の場合には「不良」,すなわ
ち、対象物以外の物体9の一部が当該計算対象枠F内の
対象画像に重なっているか,又は、対象物10自身が計
算対象枠Fからはみ出している状態として異常判定をす
ることが可能となる。Therefore, with respect to the unknown pixel on the calculation target frame F, the number of pixels of the color opposite to the pixel of the color of the target image in the calculation target frame F is counted, and the number of pixels is the judgment reference value. DR, for example, zero or less than a certain allowable number, is “good”, otherwise “bad”, that is, a part of the object 9 other than the target is within the calculation target frame F. It is possible to make an abnormality determination as if the object 10 overlaps the target image or the object 10 itself is out of the calculation target frame F.
【0042】このことで、対象物10の色が既知の場合
であっても、当該異常判定された場合には、演算処理を
行わずに終了し、それ以外の場合には、計算対象枠F内
の対象画像の重心座標値が演算手段14により演算され
る。As a result, even if the color of the object 10 is known, if the abnormality is determined, the process ends without performing arithmetic processing, and in other cases, the calculation target frame F The barycentric coordinate value of the target image within is calculated by the calculating means 14.
【0043】これにより、第1の画像処理装置と同様に
対象画像の正しい重心座標値の演算処理を行うことが可
能となり、正確な対象画像の重心座標値によって対象物
10の重心位置を決定することが可能となる。As a result, like the first image processing apparatus, it is possible to carry out the arithmetic processing of the correct barycentric coordinate value of the target image, and the barycentric position of the object 10 is determined by the accurate barycentric coordinate value of the target image. It becomes possible.
【0044】また、本発明の第3の画像処理装置によれ
ば、第1,第2の画像処理装置において、予め設定され
た白の画素数Wi又は黒の画素数Bjの判定基準値DR
と計算対象枠F上の白の画素数Wiや黒の画素数Bjと
の比較処理に基づいて計測異常を発生する警報手段15
が設けられる。Further, according to the third image processing apparatus of the present invention, in the first and second image processing apparatuses, the judgment reference value DR of the preset white pixel number Wi or the black pixel number Bj is set.
And an alarm means 15 for generating a measurement abnormality based on a comparison process between the number of white pixels Wi and the number of black pixels Bj on the calculation target frame F.
Is provided.
【0045】このため、計算対象枠F上の未知の画素に
ついて、計算対象枠F上の白の画素数Wiや黒の画素数
Bjの計数結果が予め設定された白の画素数Wi又は黒
の画素数Bjの判定基準値DRを満足しない場合には、
当該重心座標値の計測不能に陥った旨の警報等が警報手
段15により発生される。Therefore, with respect to the unknown pixel on the calculation target frame F, the counting result of the number of white pixels Wi and the number of black pixels Bj on the calculation target frame F is set to the preset number of white pixels Wi or black. When the determination reference value DR of the number of pixels Bj is not satisfied,
The alarm means 15 issues an alarm or the like indicating that the measurement of the barycentric coordinate value has failed.
【0046】この際に、例えば、予め設定された白の画
素数Wiの判定基準値DRと計算対象枠F上の白の画素
数Wiとの第1の比較処理及び黒の画素数Bjの判定基
準値DRと計算対象枠F上の黒の画素数Bjとの第2の
比較処理に基づいて計測異常が警報手段15により発生
される。At this time, for example, the first comparison processing between the preset reference value DR of the number of white pixels Wi and the number of white pixels Wi on the calculation target frame F and the determination of the number of black pixels Bj are performed. A measurement abnormality is generated by the alarm means 15 based on the second comparison process of the reference value DR and the number of black pixels Bj on the calculation target frame F.
【0047】これにより、当該画像処理装置の上位の制
御系に知らしめ、事前に制御ミス等を阻止することが可
能となる。なお、本発明のロボット制御装置によれば、
図1(b)に示すように、ロボット作業部17,画像取
得手段18,画像計測手段19及び制御手段20が具備
され、該画像計測手段19が第1〜第3の画像処理装置
から成っている。As a result, it becomes possible to notify the upper control system of the image processing apparatus and prevent a control error or the like in advance. According to the robot controller of the present invention,
As shown in FIG. 1B, a robot working unit 17, an image acquisition unit 18, an image measuring unit 19, and a control unit 20 are provided, and the image measuring unit 19 is composed of first to third image processing devices. There is.
【0048】例えば、対象物10に係わり各種教示作業
をする場合に、制御手段20を介してロボット作業部1
7が対象物10の領域上に移動され、その対象物10の
画像が画像取得手段18により取得される。また、対象
物10の位置情報が画像計測手段19により計測され
る。この際に、本発明の第1〜第3の画像処理装置から
成る画像計測手段19により該計算対象枠F内の画像取
得対象16の色調が自動識別される。For example, when performing various teaching operations related to the object 10, the robot working unit 1 is controlled via the control means 20.
7 is moved onto the area of the object 10, and the image of the object 10 is acquired by the image acquisition means 18. Further, the position information of the object 10 is measured by the image measuring means 19. At this time, the color tone of the image acquisition target 16 in the calculation target frame F is automatically identified by the image measuring unit 19 including the first to third image processing devices of the present invention.
【0049】このため、対象物10の色につき、事前に
黒又は白が明確になっていない場合であっても、計算対
象枠F上の未知の画素について、計算対象枠F内の画像
取得対象16の色調を自動識別する機能を有する画像処
理装置を採用することで、対象物10の正確な重心座標
値の演算をすることができる。Therefore, even if black or white is not clearly defined in advance for the color of the object 10, unknown pixels on the frame F to be calculated are subject to image acquisition in the frame F to be calculated. By adopting an image processing apparatus having a function of automatically identifying 16 color tones, it is possible to accurately calculate the barycentric coordinate value of the object 10.
【0050】これにより、従来例のように、予め、対象
物10の色に係わり事前に黒又は白を仮定することな
く、それを自動判別して、対象物の計測情報を正確に演
算すること、及び、高速に対象物10の認識をすること
が可能となる。As a result, unlike the conventional example, it is possible to accurately determine the measurement information of the object by automatically discriminating the color of the object 10 without assuming black or white in advance. It is possible to recognize the object 10 at high speed.
【0051】[0051]
【実施例】次に、図を参照しながら本発明の各実施例に
ついて説明をする。図3〜8は、本発明の実施例に係る
画像処理装置及びロボット制御装置を説明する図であ
る。Embodiments Next, embodiments of the present invention will be described with reference to the drawings. 3 to 8 are diagrams illustrating an image processing device and a robot control device according to an embodiment of the present invention.
【0052】(1)第1の実施例の説明 図3は、本発明の各実施例に係る画像処理装置を応用し
たロボット制御装置の構成図であり、図4はその対象物
を認識する画像処理フローチャートをそれぞれ示してい
る。(1) Description of First Embodiment FIG. 3 is a block diagram of a robot controller to which an image processing apparatus according to each embodiment of the present invention is applied, and FIG. 4 is an image for recognizing an object thereof. Each of the processing flowcharts is shown.
【0053】例えば、本発明の第1〜第3の画像処理装
置の各機能を組み合わせ、それを応用したロボット制御
装置は、図3において、ロボットハンド27,テレビカ
メラ28,画像計測システム29及びCPU(中央演算
処理装置)30及び駆動制御部31等から成る。For example, in FIG. 3, a robot control device in which the respective functions of the first to third image processing devices of the present invention are combined and applied are shown in FIG. 3 as a robot hand 27, a television camera 28, an image measuring system 29 and a CPU. (Central processing unit) 30 and drive control unit 31 and the like.
【0054】すなわち、ロボットハンド27はロボット
作業部17の一実施例であり、対象物10に係わり各種
教示作業をするものである。例えば、対象物10を把持
するものである。That is, the robot hand 27 is one embodiment of the robot working unit 17, and is for carrying out various teaching work in relation to the object 10. For example, the object 10 is gripped.
【0055】テレビカメラ28は画像取得手段18の一
実施例であり、対象物10の画像を取得し、そのアナロ
グ映像信号Sを画像処理システム29に出力するもので
ある。例えば、テレビカメラ28はロボットハンド27
の側面に固定されたり、その作業領域の天井面に設けら
れる。The television camera 28 is an embodiment of the image acquisition means 18, and acquires an image of the object 10 and outputs its analog video signal S to the image processing system 29. For example, the TV camera 28 is the robot hand 27.
It is fixed to the side of the work area or installed on the ceiling surface of the work area.
【0056】画像計測システム29は画像計測手段19
の一実施例であり、対象物10の位置情報を計測するも
のである。なお、画像計測システム29が本発明の第1
〜第3の画像処理装置から成る。The image measuring system 29 is an image measuring means 19
This is an example of measuring the position information of the object 10. The image measuring system 29 is the first aspect of the present invention.
~ It comprises a third image processing device.
【0057】例えば、画像計測システム29は図3の一
点鎖線に囲んだ部分に示すように、データバス34に接
続された計算枠設定エディタ21,画素計数エディタ2
2,データ比較部23,演算部24,アラーム部25,
信号処理部32及びメモリ部33等から成る。For example, the image measuring system 29 has the calculation frame setting editor 21 and the pixel counting editor 2 connected to the data bus 34 as shown in the portion surrounded by the one-dot chain line in FIG.
2, a data comparison unit 23, a calculation unit 24, an alarm unit 25,
The signal processing unit 32 and the memory unit 33 are included.
【0058】すなわち、計算枠設定エディタ21は範囲
設定手段11の一実施例であり、画像取得対象16に計
算対象枠Fを設定するものである。画素計数エディタ2
2は計数手段12の一実施例であり、画像取得対象16
に設定された計算対象枠F上の白の画素数Wi〔i=
1,2,3…〕又は黒の画素数Bj〔j=1,2,3
…〕を計数するものである。That is, the calculation frame setting editor 21 is an embodiment of the range setting means 11 and sets the calculation target frame F to the image acquisition target 16. Pixel counting editor 2
Reference numeral 2 is an embodiment of the counting means 12, and an image acquisition target 16
Number of white pixels on the calculation target frame F set to
1, 2, 3 ...] or the number of black pixels Bj [j = 1, 2, 3
…] Are counted.
【0059】データ比較部23は比較手段13の一実施
例であり、計算対象枠F上の白の画素数Wiや黒の画素
数Bjを比較するものである。例えば、データ比較部2
3が図2(b)に示すように、計算対象枠F上の白の画
素数Wiと黒の画素数Bjとを直接比較する。当該機能
により、本発明の第1の画像処理装置が構成される。ま
た、データ比較部23が,予め設定された白の画素数W
i又は黒の画素数Bjの判定基準値DRと計算対象枠F
上の白の画素数Wiや黒の画素数Bjとを比較する。当
該機能により、本発明の第2の画像処理装置が構成され
る。The data comparison unit 23 is an embodiment of the comparison means 13 and compares the number of white pixels Wi and the number of black pixels Bj on the calculation target frame F. For example, the data comparison unit 2
As shown in FIG. 2B, 3 directly compares the number Wi of white pixels and the number Bj of black pixels on the calculation target frame F. The function constitutes the first image processing apparatus of the present invention. In addition, the data comparison unit 23 determines that the preset number of white pixels W
i or the judgment reference value DR of the number of black pixels Bj and the calculation target frame F
The number of white pixels Wi and the number of black pixels Bj are compared. The second image processing device of the present invention is configured by the function.
【0060】演算部24は演算手段14の一実施例であ
り、計算対象枠F内の対象画像の重心座標値を演算する
ものである。アラーム部25は警報手段15の一実施例
であり、予め設定された白の画素数Wi又は黒の画素数
Bjの判定基準値DRと、計算対象枠F上の白の画素数
Wiや黒の画素数Bjとの比較処理に基づいて計測異常
を発生するものである。例えば、アラーム部25は,予
め設定された白の画素数Wiの判定基準値DRと計算対
象枠F上の白の画素数Wiとの第1の比較処理及び黒の
画素数Bjの判定基準値DRと計算対象枠F上の黒の画
素数Bjとの第2の比較処理に基づいて計測異常を発生
する。これにより、対象物10の認識をすることができ
ない場合やその認識処理不能の場合に、警報データDa
に基づいて画像計測システム29から直接,外部に警報
をすることができ、本発明の第3の画像処理装置が構成
される。The calculation section 24 is an embodiment of the calculation means 14 and calculates the barycentric coordinate value of the target image in the calculation target frame F. The alarm unit 25 is one embodiment of the alarm means 15, and includes a preset reference value DR of the number of white pixels Wi or the number of black pixels Bj set in advance and the number of white pixels Wi or black of the calculation target frame F. The measurement abnormality is generated based on the comparison process with the number of pixels Bj. For example, the alarm unit 25 performs the first comparison process between the preset reference value DR of the number of white pixels Wi and the number of white pixels Wi on the calculation target frame F and the determination reference value of the number of black pixels Bj. A measurement abnormality is generated based on the second comparison processing between DR and the number of black pixels Bj on the calculation target frame F. As a result, when the object 10 cannot be recognized or the recognition process cannot be performed, the alarm data Da is generated.
Based on the above, the image measurement system 29 can directly issue an alarm to the outside, and the third image processing apparatus of the present invention is configured.
【0061】また、信号処理部32はテレビカメラ28
から出力されるアナログ映像信号Sを二値化する,例え
ば、A/D変換回路やその閾値回路から成り、その結果
として、白黒階調に係る画像データDinが得られる。Further, the signal processing unit 32 is the television camera 28.
The analog video signal S output from the binarization circuit is binarized, for example, it is composed of an A / D conversion circuit and its threshold circuit, and as a result, image data Din relating to black and white gradation is obtained.
【0062】メモリ部33は、画像データDinを一時記
憶したり、計算対象枠Fの設定,画素の計数,計測不能
に係る警報等に係る各種制御データや判定基準値DRを
記憶するものである。The memory unit 33 temporarily stores the image data Din, sets the calculation target frame F, counts pixels, and various control data relating to an alarm regarding unmeasurable and a determination reference value DR. ..
【0063】これにより、画像計測システム29におい
て、計算対象枠F上の白の画素数Wi及び黒の画素数B
jに基づいて該計算対象枠内の画像取得対象16の色調
を自動識別することができる。As a result, in the image measuring system 29, the number of white pixels Wi and the number of black pixels B on the calculation target frame F are calculated.
The color tone of the image acquisition target 16 in the calculation target frame can be automatically identified based on j.
【0064】また、CPU30は制御手段20の一実施
例であり、ロボットハンド27,テレビカメラ28及び
画像計測システム29の入出力を制御するものである。
例えば、駆動制御部31に駆動制御データDmを出力し
たり、アラーム部35に警報データDaを出力する。な
お、駆動制御部31は駆動制御データDmに基づいてロ
ボットハンド27をX,Y,Z方向に駆動制御をするも
のである。The CPU 30 is an embodiment of the control means 20 and controls the input / output of the robot hand 27, the television camera 28 and the image measuring system 29.
For example, the drive control data Dm is output to the drive control unit 31, and the alarm data Da is output to the alarm unit 35. The drive control section 31 controls the drive of the robot hand 27 in the X, Y, and Z directions based on the drive control data Dm.
【0065】このようにして、本発明の各実施例に係る
画像処理装置を応用したロボット制制御装置によれば、
図3に示すように、ロボットハンド27,テレビカメラ
28,画像処理システム29,CPU30及び駆動制御
部31が具備され、該画像処理システム29がデータバ
ス34に接続された計算枠設定エディタ21,画素計数
エディタ22,データ比較部23,演算部24,信号処
理部32及びメモリ部33等から成っている。In this way, according to the robot control device to which the image processing device according to each embodiment of the present invention is applied,
As shown in FIG. 3, a robot frame 27, a television camera 28, an image processing system 29, a CPU 30, and a drive control unit 31 are provided, and the image processing system 29 is connected to a data bus 34. It comprises a counting editor 22, a data comparing section 23, a computing section 24, a signal processing section 32, a memory section 33 and the like.
【0066】例えば、対象物10に係わり各種教示作業
をする場合に、CPU30を介してロボットハンド27
が対象物10の領域上に移動され、その対象物10の画
像がテレビカメラ28により取得される。また、対象物
10の位置情報が画像処理システム29により計測され
る。For example, when performing various teaching operations related to the object 10, the robot hand 27 is executed via the CPU 30.
Is moved onto the area of the object 10, and an image of the object 10 is acquired by the television camera 28. Further, the position information of the object 10 is measured by the image processing system 29.
【0067】この際に、本発明の第1〜第3の画像処理
装置から成る画像処理システム29により計算対象枠F
上の白の画素数Wi及び黒の画素数Bjに基づいて該計
算対象枠内の画像取得対象16の色調が自動識別処理さ
れる。例えば、メモリ部32の領域上に展開された画像
取得対象16に計算枠設定エディタ21により計算対象
枠Fが設定される。At this time, the calculation target frame F is calculated by the image processing system 29 including the first to third image processing devices of the present invention.
The color tone of the image acquisition target 16 in the calculation target frame is automatically identified based on the number of white pixels Wi and the number of black pixels Bj. For example, the calculation target frame F is set by the calculation frame setting editor 21 in the image acquisition target 16 expanded on the area of the memory unit 32.
【0068】また、該画像取得対象16に設定された計
算対象枠上の白の画素数Wi〔i=1,2,3…〕又は
黒の画素数Bj〔j=1,2,3…〕が画素計数エディ
タ22により計数され、計算対象枠F上の白の画素数W
iや黒の画素数Bjがデータ比較部23により比較され
る。Further, the number of white pixels Wi [i = 1, 2, 3 ...] or the number of black pixels Bj [j = 1, 2, 3, ...] On the calculation target frame set as the image acquisition target 16. Are counted by the pixel counting editor 22, and the number of white pixels W on the calculation target frame F is calculated.
The data comparison unit 23 compares i and the number of black pixels Bj.
【0069】このため、対象物10の色につき、事前に
黒又は白が明確になっていない場合であっても、計算対
象枠F上の未知の画素について、計算対象枠F内の画像
取得対象16の色調を自動識別する画像処理装置を採用
することにより、対象物10の正確な重心座標値を高速
に演算することができる。Therefore, even if black or white is not clear in advance for the color of the object 10, unknown pixels on the frame F to be calculated are subject to image acquisition in the frame F to be calculated. By adopting the image processing device for automatically identifying the 16 color tones, the accurate barycentric coordinate value of the object 10 can be calculated at high speed.
【0070】これにより、ロボット作業部17の位置決
め処理の高速化を図ることが可能となる。また、制御系
における対象物10の重心位置の誤認識が皆無に等しく
なり、以後の教示作業に際に、ロボット作業部11を対
象物10に衝突させたり、それを転倒させる等の制御ミ
スを極力阻止することが可能となる。This makes it possible to speed up the positioning process of the robot working unit 17. In addition, erroneous recognition of the position of the center of gravity of the object 10 in the control system becomes almost zero, and a control error such as colliding the robot working unit 11 with the object 10 or causing it to tip over is avoided during subsequent teaching work. It becomes possible to prevent it as much as possible.
【0071】次に、本発明の各実施例に係る対象物を認
識し、それを把持するロボット制御装置について、当該
装置の画像計測システム29の動作を補足しながら説明
をする。Next, a robot control apparatus for recognizing an object and gripping the object according to each embodiment of the present invention will be described while supplementing the operation of the image measuring system 29 of the apparatus.
【0072】図4は、本発明の第1の実施例に係る対象
物を認識する画像処理のフローチャートであり、図5は
そのフローチャートの補足説明図をそれぞれ示してい
る。例えば、図3に示すように対象物10を認識して、
それを把持する場合、図4において、まず、ステップP
1でロボットハンド27を対象物10の領域上に移動す
る。この際に、CPU30から駆動制御部31に、駆動
制御データDmが出力されると、該制御データDmに基
づいて駆動制御部31によりロボットハンド27がX,
Y,Z方向に駆動制御される。これにより、ロボットハ
ンド27の側面に固定されたテレビカメラ28が移動さ
れ、対象物10の領域上に移動される。FIG. 4 is a flow chart of image processing for recognizing an object according to the first embodiment of the present invention, and FIG. 5 is a supplementary explanatory view of the flow chart. For example, recognizing the object 10 as shown in FIG.
When gripping it, first in step P in FIG.
At 1, the robot hand 27 is moved onto the area of the object 10. At this time, when the drive control data Dm is output from the CPU 30 to the drive control unit 31, the drive control unit 31 causes the drive unit 31 to move the X, X, and X based on the control data Dm.
Drive control is performed in the Y and Z directions. As a result, the television camera 28 fixed to the side surface of the robot hand 27 is moved and moved onto the area of the object 10.
【0073】次に、ステップP2でテレビカメラ28の
取付け領域下の対象物10の画像取得処理をする。この
際に、テレビカメラ28により対象物10の画像が取得
され、そのアナログ映像信号Sが画像処理システム29
に出力される。Next, in step P2, an image acquisition process of the object 10 under the attachment area of the television camera 28 is performed. At this time, the image of the object 10 is acquired by the television camera 28, and the analog video signal S is acquired by the image processing system 29.
Is output to.
【0074】次いで、ステップP3でカメラ入力画像を
適当なレベルにより二値化する。この際に、信号処理部
32により、テレビカメラ28から出力されたアナログ
映像信号Sが二値化され、その白黒階調に係る画像デー
タDinが出力される。この画像データDinがメモリ部3
3に一時格納される。Then, in step P3, the camera input image is binarized by an appropriate level. At this time, the signal processing unit 32 binarizes the analog video signal S output from the television camera 28, and outputs image data Din related to the black and white gradation. This image data Din is stored in the memory unit 3
Temporarily stored in 3.
【0075】例えば、図5(a)において、その二値化
された画像データDinに基づいてモニタ表示をすると、
対象物10の画像と対象物以外の物体9の画像から成る
画像取得対象16が得られる。For example, in FIG. 5A, when a monitor display is performed based on the binarized image data Din,
An image acquisition target 16 including an image of the object 10 and an image of the object 9 other than the object is obtained.
【0076】さらに、ステップP4で対象物10が最も
存在しそうな位置に計算対象枠Fを設定する。この際
に、CPU30を介して画像処理システム29の計算枠
設定エディタ21により、図5(b)に示すような画像
取得対象16に計算対象枠Fが設定される。Further, in step P4, the calculation target frame F is set at the position where the object 10 is most likely to exist. At this time, the calculation frame setting editor 21 of the image processing system 29 sets the calculation target frame F in the image acquisition target 16 as shown in FIG. 5B via the CPU 30.
【0077】次に、ステップP5で計算対象枠F上の画
素について、白の画素数Wiと黒の画素数Bjを計数す
る。この際に、画素計数エディタ22により画像取得対
象16に設定された計算対象枠F上の白の画素数Wi
〔i=1,2,3…〕又は黒の画素数Bj〔j=1,
2,3…〕が計数される。Next, in step P5, the number of white pixels Wi and the number of black pixels Bj of the pixels in the calculation target frame F are counted. At this time, the number of white pixels Wi on the calculation target frame F set as the image acquisition target 16 by the pixel counting editor 22
[I = 1, 2, 3 ...] or the number of black pixels Bj [j = 1,
2, 3, ...] are counted.
【0078】その後、ステップP6で計算対象枠F上の
画素について、白の画素数Wiと黒の画素数Wjとの比
較処理をする。この際に、白の画素数Wiが黒の画素数
Bjよりも多い場合又は白の画素数Wiと黒の画素数W
jとが等しい場合(YES)には、ステップP7に移行す
る。After that, in step P6, the number of white pixels Wi and the number of black pixels Wj of the pixels in the calculation target frame F are compared. At this time, if the number of white pixels Wi is larger than the number of black pixels Bj, or if the number of white pixels Wi and the number of black pixels W
If j is equal (YES), the process proceeds to step P7.
【0079】また、白の画素数Wiが黒の画素数Bjよ
りも少ない場合,すなわち、黒の画素数Bjが白の画素
数Wiよりの多い場合(NO)には、ステップP8に移
行する。なお、計算対象枠F上の画素については、例え
ば、メモリ部33に展開された画像データDinに基づい
て、データ比較部23により白の画素数Wiと黒の画素
数Wjとが直接比較される(図2(b)参照)。If the number of white pixels Wi is less than the number of black pixels Bj, that is, if the number of black pixels Bj is more than the number of white pixels Wi (NO), the process proceeds to step P8. Regarding the pixels on the calculation target frame F, for example, the number of white pixels Wi and the number of black pixels Wj are directly compared by the data comparison unit 23 based on the image data Din developed in the memory unit 33. (See FIG. 2B).
【0080】ここで、計算対象枠F上の画素について、
白の画素数Wiが黒の画素数Bjよりも多い場合(YE
S)には、ステップP7で該計算対象枠Fの内部を対象
に、黒の画素を「1」,白の画素に「0」をそれぞれ重
み付けして対象画像の重心座標Xg,Ygを求める。こ
の際に、画像データDinに基づいて対象物10の色と見
られる黒を「1」,白を「0」の重み付けをしてX軸方
向,Y軸方向,についてそれぞれ(1),(2)式によ
り平均計算をする。Here, for the pixels on the calculation target frame F,
When the number of white pixels Wi is greater than the number of black pixels Bj (YE
In step S7, black pixels are weighted by "1" and white pixels are weighted by "0" for the inside of the calculation target frame F in step P7 to obtain the barycentric coordinates Xg, Yg of the target image. At this time, black, which is seen as the color of the object 10, is weighted with “1” and white is weighted with “0” based on the image data Din, and (1) and (2) are assigned to the X-axis direction and the Y-axis direction, respectively. ) Formula is used to calculate the average.
【0081】[0081]
【数1】 [Equation 1]
【0082】これにより、演算部24を介して対象物1
0の重心座標Xg,Ygを求めることができる。ここ
で、fiはそのi番目の画素が黒の時「1」、白の時
「0」,xi,yiはその画素のX,Y軸の座標値であ
り、nは画面内の全画素数を表している。また、分母の
値はその物体の画素数,すなわち、面積を表している。As a result, the object 1
The barycentric coordinates Xg and Yg of 0 can be obtained. Here, fi is “1” when the i-th pixel is black, “0” when it is white, xi, yi are the coordinate values of the X and Y axes of the pixel, and n is the total number of pixels in the screen. Is represented. The value of the denominator represents the number of pixels of the object, that is, the area.
【0083】なお、ステップP6で計算対象枠F上の画
素について、白の画素数Wiが黒の画素数Bjよりも少
ない場合(NO)には、ステップP8に移行して該計算
対象枠Fの内部を対象に、黒の画素を「0」,白の画素
に「1」をそれぞれ重み付けして対象画像の重心座標X
g,Ygを求める。この際に、ステップP7と同様に演
算部24を介して対象物10の重心座標Xg,Ygを求
める。When the number of white pixels Wi of the pixels in the calculation target frame F is smaller than the number of black pixels Bj in step P6 (NO), the process proceeds to step P8, and the calculation target frame F is calculated. With respect to the inside, the black pixel is weighted with "0", the white pixel is weighted with "1", and the barycentric coordinate X of the target image is weighted.
Find g and Yg. At this time, the barycentric coordinates Xg, Yg of the object 10 are obtained via the calculation unit 24 as in step P7.
【0084】その後、ステップP9で先に求めた重心座
標Xg,Ygを対象物の重心位置XG,YGとして認識
し、以後の各種作業を行う。この際に、ロボットハンド
27により対象物10に係わり各種教示作業が行われ
る。例えば、駆動制御データDmに基づいて駆動制御部
31を介して、ロボットハンド27がテレビカメラ28
の取付けオフセット分だけX,Y方向に移動され、その
後、それがZ方向に駆動制御され、対象物10が把持さ
れる。Then, in step P9, the barycentric coordinates Xg, Yg previously obtained are recognized as the barycentric positions XG, YG of the object, and the various operations thereafter are performed. At this time, various teaching operations are performed by the robot hand 27 in relation to the object 10. For example, the robot hand 27 is operated by the television camera 28 via the drive control unit 31 based on the drive control data Dm.
Is moved in the X and Y directions by the mounting offset of, and thereafter, it is driven and controlled in the Z direction, and the object 10 is gripped.
【0085】このようにして、本発明の第1の実施例に
係る対象物を認識するロボット制御装置の画像計測方法
によれば、図4の処理フローチャートに示すように、ス
テップP6で計算対象枠F上の白の画素数Wiと黒の画
素数Bjとが比較処理される。As described above, according to the image measuring method of the robot controller for recognizing an object according to the first embodiment of the present invention, as shown in the processing flowchart of FIG. The number of white pixels Wi on F and the number of black pixels Bj are compared.
【0086】このため、図2(b)に示すように、計算
対象枠F上の白の画素数Wiと黒の画素数Bjとが直接
比較されることにより、白の画素数Wiが黒の画素数B
jよりも多い場合には、対象物10の色は黒として、該
計算対象枠F内の画像取得対象16の色調を自動識別す
ることが可能となる。Therefore, as shown in FIG. 2B, the number of white pixels Wi on the calculation target frame F is directly compared with the number of black pixels Bj, so that the number of white pixels Wi is black. Number of pixels B
When the number is larger than j, the color of the object 10 is black, and the color tone of the image acquisition object 16 in the calculation object frame F can be automatically identified.
【0087】また、逆に、黒の画素数Biが白の画素数
Wiよりも多い場合には、対象物10の色は白として、
該計算対象枠F内の画像取得対象16の色調を自動識別
することが可能となる。これにより、ステップP7やP
8で当該自動識別処理に基づいて計算対象枠F内の対象
画像の重心座標値が演算部24により演算される。On the contrary, when the number of black pixels Bi is greater than the number of white pixels Wi, the color of the object 10 is white.
It is possible to automatically identify the color tone of the image acquisition target 16 in the calculation target frame F. As a result, steps P7 and P
At 8, the calculation unit 24 calculates the barycentric coordinate value of the target image in the calculation target frame F based on the automatic identification processing.
【0088】このことで、対象物10の色が黒又は白、
その周辺の背景色が白又は黒とする識別条件を設定(仮
定)しない場合,すなわち、対象物10が未知の色の場
合について、それを認識する要求があった場合にも、画
像取得対象16の色調識別処理を容易に実行することが
可能となる。As a result, the color of the object 10 is black or white,
Even when the discrimination condition that the background color around the object is white or black is not set (assumed), that is, when the object 10 has an unknown color, the image acquisition target 16 It is possible to easily execute the color tone identification processing of.
【0089】例えば、対象物10の実際の色が黒であっ
て、その周辺の背景色が白とする画像取得状態(被写
体)において、当該画像処理装置に識別条件が仮定され
なっかた場合であっても、計算対象枠F上の白の画素数
Wiと黒の画素数Bjとがデータ比較部23により比較
されることから、ステップP7やP8で従来例のような
対象物10の色が白=「0」、その周辺の背景色が黒=
「1」とする誤った画像処理を無くすことができる。For example, in an image acquisition state (subject) in which the actual color of the object 10 is black and the background color around the object 10 is white, the identification condition is not assumed in the image processing apparatus. Even if there is, since the number of white pixels Wi on the calculation target frame F and the number of black pixels Bj are compared by the data comparison unit 23, the color of the target object 10 as in the conventional example is determined in steps P7 and P8. White = "0", surrounding background color is black =
Erroneous image processing of "1" can be eliminated.
【0090】これにより、ステップP9で対象画像の正
しい重心座標値の演算処理を行うことが可能となり、正
確な対象画像の重心座標Xg,Ygによって対象物10
の重心位置XG,YGを決定することが可能となる。こ
のことで、各種計測情報の演算に係り画像計測処理の信
頼性の向上を図ることが可能となる。As a result, in step P9, the correct center-of-gravity coordinate values of the target image can be calculated, and the target object 10 can be accurately calculated by the center-of-gravity coordinates Xg and Yg.
It is possible to determine the barycentric positions XG, YG of. As a result, it is possible to improve the reliability of the image measurement processing related to the calculation of various measurement information.
【0091】(2)第2の実施例の説明 図6は、本発明の第2の実施例に係る対象物を認識する
画像処理のフローチャートであり、図7はその他実施例
に係るフローチャートの補足説明図をそれぞれ示してい
る。(2) Description of Second Embodiment FIG. 6 is a flowchart of image processing for recognizing an object according to the second embodiment of the present invention, and FIG. 7 is a supplement of the flowchart of other embodiments. Explanatory drawing is shown respectively.
【0092】図6において、第1の実施例と異なるのは
第2の実施例では、計算対象枠F上の白の画素数Wiに
ついて、その判定基準値DRと比較結果によりアラーム
処理をするものである。In FIG. 6, the difference from the first embodiment is that in the second embodiment, for the number of white pixels Wi on the calculation target frame F, alarm processing is performed according to the judgment reference value DR and the comparison result. Is.
【0093】すなわち、ステップP1で第1の実施例と
同様に、ロボットハンド27を対象物10の領域上に移
動し、次に、ステップP2で対象物10の画像取得処理
をする。また、ステップP2でカメラ入力画像を適当な
レベルにより二値化をし、ステップP3で対象物がもっ
とも有りそうなところに第1の計算対象枠Fを設定する
(図7(a)参照)。これまでは、第1の実施例と同様
である。That is, as in the first embodiment, the robot hand 27 is moved onto the area of the object 10 in step P1, and the image acquisition processing of the object 10 is performed in step P2. In step P2, the camera input image is binarized by an appropriate level, and in step P3, the first calculation target frame F is set at a position where the object is most likely to exist (see FIG. 7A). So far, this is the same as the first embodiment.
【0094】次に、ステップP6で計算対象枠F上の白
の画素数Wiを計数する。この際に、該画像取得対象1
6に設定された計算対象枠上の白の画素数Wi〔i=
1,2,3…〕が画素計数エディタ22により計数され
る。Next, in step P6, the number of white pixels Wi on the calculation target frame F is counted. At this time, the image acquisition target 1
The number of white pixels on the calculation target frame set to 6 Wi [i =
1, 2, 3 ...] are counted by the pixel counting editor 22.
【0095】さらに、ステップP7で計算対象枠F上の
白の画素数Wiとその判定基準値DRとの比較処理をす
る。この際に、該対象枠F上の白の画素数Wiがその判
定基準値DRよりも少ないか,又はそれが判定基準値D
Rと等しい場合(YES)には、ステップP8に移行す
る。ここで、データ比較部23により、予め設定された
白の画素数Wiの判定基準値DRと計算対象枠F上の白
の画素数Wiとが比較される。Further, in step P7, the number Wi of white pixels on the calculation target frame F is compared with the determination reference value DR. At this time, the number of white pixels Wi on the target frame F is smaller than the determination reference value DR, or the number of white pixels Wi is less than the determination reference value D.
If it is equal to R (YES), the process proceeds to step P8. Here, the data comparison unit 23 compares the preset determination reference value DR of the number of white pixels Wi with the number of white pixels Wi in the calculation target frame F.
【0096】また、該対象枠F上の白の画素数Wiがそ
の判定基準値DRよりも多い場合(NO)には、異常終
了をする。なお、アラーム部25により、比較結果に基
づいて計測異常が発生される。If the number of white pixels Wi on the target frame F is larger than the determination reference value DR (NO), the process ends abnormally. Note that the alarm unit 25 causes a measurement abnormality based on the comparison result.
【0097】従って、図7(a)に示す画像取得対象1
6ような場合には、ステップP7で該対象枠F上の白の
画素数Wiがその判定基準値DRよりも少ない場合(Y
ES)に該当することから、ステップP8で計算対象枠F
の内部を対象に、黒を「1」,白を「0」として重み付
けをし、対象画像の重心座標値Xg,Ygを求める。こ
の際に、第1の実施例と同様に、演算部24を介して対
象物10の重心座標Xg,Ygが求められる。Therefore, the image acquisition target 1 shown in FIG.
In the case of 6, if the number of white pixels Wi on the target frame F is smaller than the determination reference value DR in step P7 (Y
Since it corresponds to ES), the calculation target frame F is calculated in step P8.
The inside of the image is weighted with “1” for black and “0” for white, and the barycentric coordinate values Xg and Yg of the target image are obtained. At this time, as in the first embodiment, the barycentric coordinates Xg, Yg of the object 10 are obtained via the calculation unit 24.
【0098】これにより、ステップP9で先に求めた重
心座標Xg,Ygを対象物10の重心位置XG,YGと
して認識し、以後の各種教示作業を行う。なお、その他
の処理は第1の実施例と同様であるため、その説明を省
略する。As a result, the barycentric coordinates Xg, Yg previously obtained in step P9 are recognized as the barycentric positions XG, YG of the object 10, and various teaching operations thereafter are performed. Since the other processing is the same as that of the first embodiment, the description thereof will be omitted.
【0099】このようにして、本発明の第2の実施例に
係る対象物を認識するロボット制御装置の画像計測方法
によれば、図6の処理フローチャートに示すように、ス
テップP7で予め設定された白の画素数Wiの判定基準
値DRと計算対象枠F上の白の画素数Wiとがデータ比
較部23により比較処理されている。As described above, according to the image measuring method of the robot control device for recognizing the object according to the second embodiment of the present invention, as shown in the processing flowchart of FIG. 6, it is preset in step P7. The data comparison unit 23 compares the determination reference value DR of the number of white pixels Wi and the number of white pixels Wi on the calculation target frame F.
【0100】このため、計算対象枠F上の未知の画素に
ついて、該計算対象枠F内の対象画像の色の画素と反対
の色の画素の画素数,すなわち、本発明の実施例では白
の画素数Wiを計数し、その画素数Wiが判定基準値D
R,例えば、零又は一定の許容できる数以下の場合に
は、「良」とし、それ以外の場合には「不良」,すなわ
ち、対象物以外の物体9の一部が当該計算対象枠F内の
対象画像に重なっているか,又は、対象物10自身が計
算対象枠Fからはみ出している状態として異常判定終了
をすることが可能となる。Therefore, with respect to the unknown pixel on the calculation target frame F, the number of pixels of the color opposite to the color pixel of the target image in the calculation target frame F, that is, the white pixel in the embodiment of the present invention. The number of pixels Wi is counted, and the number of pixels Wi is the judgment reference value D.
R, for example, zero or less than a certain allowable number, is “good”, otherwise “bad”, that is, a part of the object 9 other than the object is in the calculation target frame F. It is possible to end the abnormality determination as a state in which the object 10 overlaps the target image or the target 10 itself is out of the calculation target frame F.
【0101】このことで、対象物10の色が既知の場合
であっても、当該異常判定は演算処理を行わずに終了
し、それ以外の場合には、ステップP8で計算対象枠F
内の対象画像の重心座標値が演算部24により第1の実
施例と同様に演算を継続することが可能となる。As a result, even if the color of the object 10 is known, the abnormality determination ends without performing the calculation process. In other cases, the calculation target frame F is calculated in step P8.
The calculation of the barycentric coordinate value of the target image within the calculation unit 24 enables the calculation to be continued in the same manner as in the first embodiment.
【0102】これにより、第1の実施例と同様に対象画
像の正しい重心座標値の演算処理を行うことが可能とな
り、ステップP9で正確な対象画像の重心座標値Xg,
Ygによって対象物10の重心位置XG,YGを決定す
ることが可能となる。As a result, as in the first embodiment, it is possible to carry out the arithmetic processing of the correct barycentric coordinate value of the target image, and in step P9, the accurate barycentric coordinate value Xg of the target image,
The center of gravity position XG, YG of the object 10 can be determined by Yg.
【0103】なお、該重心座標値の計測不能に陥った場
合にはアラーム部25により警報等を発することで、当
該画像計測系において異常が発生した旨を上位の制御系
に知らしめ、従来例のような制御ミス等を事前に阻止す
ることが可能となる。When the barycentric coordinate value cannot be measured, an alarm or the like is issued by the alarm unit 25 to inform the upper control system that an abnormality has occurred in the image measuring system, and the conventional example is used. It is possible to prevent such control mistakes in advance.
【0104】(3)第3の実施例の説明 図8は、本発明の第3の実施例に係る対象物を認識する
画像処理のフローチャートをそれぞれ示している。(3) Description of Third Embodiment FIG. 8 shows a flowchart of image processing for recognizing an object according to the third embodiment of the present invention.
【0105】図8において、第1,第2の実施例と異な
るのは第3の実施例では、予め設定された白の画素数W
i及び黒の画素数Bjの判定基準値DRと計算対象枠F
上の白の画素数Wi及び黒の画素数Bjとの比較処理に
基づいて、アラーム部25により計測異常終了を行うも
のである。In FIG. 8, the difference from the first and second embodiments is that in the third embodiment, the preset number of white pixels W
i and the judgment reference value DR of the number of black pixels Bj and the calculation target frame F
Based on the comparison processing between the number of white pixels Wi and the number of black pixels Bj above, the alarm unit 25 terminates the measurement abnormally.
【0106】すなわち、図8において、ステップP1で
第1,第2の実施例と同様に、ロボットハンド27を対
象物10の領域上に移動し、ステップP2でその対象物
10に係る画像取得処理をする。また、ステップP3で
カメラ入力画像を適当なレベルにより二値化し、さら
に、ステップP4で対象物がもっとも有りそうなところ
に計算対象枠Fを設定する。ここで、図7(b)に示す
ように計算対象枠Fが画像取得対象16に設定される。That is, in FIG. 8, in step P1, the robot hand 27 is moved to the area of the object 10 in the same manner as in the first and second embodiments, and in step P2, the image acquisition process for the object 10 is performed. do. Further, in step P3, the camera input image is binarized by an appropriate level, and in step P4, a calculation target frame F is set at a position where an object is most likely. Here, the calculation target frame F is set as the image acquisition target 16 as shown in FIG.
【0107】次に、ステップP5で第1の実施例と同様
に、計算対象枠F上の画素について、白の画素数Wiと
黒の画素数Bjを計数する。この際に、画素計数エディ
タ22により画像取得対象16に設定された計算対象枠
F上の白の画素数Wi〔i=1,2,3…〕又は黒の画
素数Bj〔j=1,2,3…〕が計数される。Then, in step P5, as in the first embodiment, the number of white pixels Wi and the number of black pixels Bj of the pixels on the calculation target frame F are counted. At this time, the number of white pixels Wi [i = 1, 2, 3 ...] or the number of black pixels Bj [j = 1, 2] on the calculation target frame F set as the image acquisition target 16 by the pixel counting editor 22. , 3 ...] are counted.
【0108】その後、ステップP6で計算対象枠F上の
画素について、白の画素数Wiと黒の画素数Wjとの比
較処理をする。この際に、白の画素数Wiが黒の画素数
Bjよりも多い場合又は白の画素数Wiと黒の画素数W
jとが等しい場合(YES)には、ステップP7に移行す
る。Thereafter, in step P6, the number of white pixels Wi and the number of black pixels Wj of the pixels in the calculation target frame F are compared. At this time, if the number of white pixels Wi is larger than the number of black pixels Bj, or if the number of white pixels Wi and the number of black pixels W
If j is equal (YES), the process proceeds to step P7.
【0109】また、白の画素数Wiが黒の画素数Bjよ
りも少ない場合,すなわち、黒の画素数Bjが白の画素
数Wiよりの多い場合(NO)には、ステップP8に移
行する。なお、計算対象枠F上の画素については、例え
ば、メモリ部33に展開された画像データDinに基づい
て、データ比較部23により白の画素数Wiと黒の画素
数Wjとが直接比較される(図2(b)参照)。If the number of white pixels Wi is smaller than the number of black pixels Bj, that is, if the number of black pixels Bj is larger than the number of white pixels Wi (NO), the process proceeds to step P8. Regarding the pixels on the calculation target frame F, for example, the number of white pixels Wi and the number of black pixels Wj are directly compared by the data comparison unit 23 based on the image data Din developed in the memory unit 33. (See FIG. 2B).
【0110】ここで、計算対象枠F上の画素について、
白の画素数Wiが黒の画素数Bjよりも多い場合(YE
S)には、ステップP7で計算対象枠F上の白の画素数
Wiとその判定基準値DRとの比較処理をする。この際
に、該対象枠F上の白の画素数Wiがその判定基準値D
Rよりも少ないか,又はそれが判定基準値DRと等しい
場合(YES)には、ステップP8に移行する。ここで、
データ比較部23により、予め設定された白の画素数W
iの判定基準値DRと計算対象枠F上の白の画素数Wi
とが比較される(第1の比較処理)。Here, for the pixels on the calculation target frame F,
When the number of white pixels Wi is greater than the number of black pixels Bj (YE
In step S7, the number of white pixels Wi on the calculation target frame F is compared with the determination reference value DR in step P7. At this time, the number of white pixels Wi on the target frame F is equal to the determination reference value D.
If it is smaller than R or is equal to the judgment reference value DR (YES), the process proceeds to step P8. here,
The number of white pixels W preset by the data comparison unit 23
The determination reference value DR of i and the number of white pixels Wi on the calculation target frame F
And are compared (first comparison processing).
【0111】また、該対象枠F上の白の画素数Wiがそ
の判定基準値DRよりも多い場合(NO)には、異常終
了をする。なお、アラーム部25により、比較結果に基
づいて計測異常が発生される。If the number of white pixels Wi on the target frame F is larger than the determination reference value DR (NO), the process ends abnormally. Note that the alarm unit 25 causes a measurement abnormality based on the comparison result.
【0112】従って、図7(a)に示す画像取得対象1
6のような場合には、ステップP7で該対象枠F上の黒
の画素数Bjがその判定基準値DRよりも少ない場合
(YES)に該当することから、ステップP8で計算対象
枠Fの内部を対象に、黒を「1」,白を「0」として重
み付けをし、対象画像の重心座標値Xg,Ygを求め
る。この際に、第1の実施例と同様に、演算部24を介
して対象物10の重心座標Xg,Ygが求められる。Therefore, the image acquisition target 1 shown in FIG.
In the case of 6, the case corresponds to the case where the number of black pixels Bj on the target frame F is smaller than the determination reference value DR (YES) at step P7, and therefore the inside of the calculation target frame F at step P8. Are weighted with "1" for black and "0" for white, and the barycentric coordinate values Xg, Yg of the target image are obtained. At this time, as in the first embodiment, the barycentric coordinates Xg, Yg of the object 10 are obtained via the calculation unit 24.
【0113】なお、ステップP6で、計算対象枠F上の
画素について、黒の画素数Bjが白の画素数Wiよりも
多い場合(NO)には、ステップP9で計算対象枠F上
の黒の画素数Bjとその判定基準値DRとの比較処理を
する。この際に、該対象枠F上の黒の画素数Bjがその
判定基準値DRよりも少ないか,又はそれが判定基準値
DRと等しい場合(YES)には、ステップP10に移行す
る。ここで、データ比較部23により、予め設定された
黒の画素数Bjの判定基準値DRと計算対象枠F上の黒
の画素数Bjとが比較される(第2の比較処理)。If the number of black pixels Bj of the pixels in the calculation target frame F is larger than the number of white pixels Wi in step P6 (NO), the black pixels in the calculation target frame F are calculated in step P9. The number of pixels Bj is compared with the determination reference value DR. At this time, if the number of black pixels Bj on the target frame F is smaller than the determination reference value DR or if it is equal to the determination reference value DR (YES), the process proceeds to step P10. Here, the data comparison unit 23 compares the preset reference value DR of the number of black pixels Bj with the number of black pixels Bj on the calculation target frame F (second comparison processing).
【0114】また、該対象枠F上の黒の画素数Bjがそ
の判定基準値DRよりも多い場合(NO)には、異常終
了をする(図7(b)参照)。なお、アラーム部25に
より、比較結果に基づいて計測異常が発生される。If the number of black pixels Bj on the target frame F is larger than the determination reference value DR (NO), the abnormal termination is performed (see FIG. 7B). Note that the alarm unit 25 causes a measurement abnormality based on the comparison result.
【0115】従って、図7(b)に示す画像取得対象1
6のような場合には、ステップP10で該対象枠F上の白
の画素数Wiがその判定基準値DRよりも少ない場合
(YES)に該当することから、ステップP10で計算対象
枠Fの内部を対象に、白を「1」,黒を「0」として重
み付けをし、対象画像の重心座標値Xg,Ygを求め
る。この際に、第1の実施例と同様に、演算部24を介
して対象物10の重心座標Xg,Ygが求められる。Therefore, the image acquisition target 1 shown in FIG.
In the case of 6, the case corresponds to the case where the number of white pixels Wi on the target frame F is smaller than the determination reference value DR (YES) in step P10. Therefore, in step P10, the inside of the calculation target frame F is determined. Are weighted with "1" for white and "0" for black to obtain the barycentric coordinate values Xg, Yg of the target image. At this time, as in the first embodiment, the barycentric coordinates Xg, Yg of the object 10 are obtained via the calculation unit 24.
【0116】これにより、ステップP11で先に求めた重
心座標値Xg,Ygを対象物10の重心位置XG,YG
として認識し、各種作業を行う。なお、その他の構成は
第1,第2の実施例と同様であるため、その説明を省略
する。As a result, the barycentric coordinate values Xg, Yg previously obtained in step P11 are set to the barycentric position XG, YG of the object 10.
Recognize as, and perform various work. Since the other structures are similar to those of the first and second embodiments, the description thereof will be omitted.
【0117】このようにして、本発明の第3の実施例に
係る対象物を認識するロボット制御装置の画像計測方法
によれば、図8の処理フローチャートに示すように、ス
テップP6の計算対象枠F上の白の画素数Wiと黒の画
素数Bjとの比較処理に基づいて、ステップP7やP9
で予め設定された白の画素数Wi又は黒の画素数Bjの
判定基準値DRと計算対象枠F上の白の画素数Wiや黒
の画素数Bjとの比較処理(第1,第2の比較処理)に
基づいて計測異常終了をしている。As described above, according to the image measuring method of the robot controller for recognizing an object according to the third embodiment of the present invention, as shown in the processing flowchart of FIG. Based on the comparison processing of the number of white pixels Wi on F and the number of black pixels Bj, steps P7 and P9 are performed.
In the comparison processing of the judgment reference value DR of the number of white pixels Wi or the number of black pixels Bj set in advance and the number of white pixels Wi or the number of black pixels Bj on the calculation target frame F (first, second The measurement is abnormally terminated based on the comparison process).
【0118】このため、計算対象枠F上の未知の画素に
ついて、計算対象枠F上の白の画素数Wiや黒の画素数
Bjの計数結果が予め設定された白の画素数Wi又は黒
の画素数Bjの判定基準値DRを満足しない場合には、
計測異常終了時に当該重心座標値の計測不能に陥った旨
の警報等がアラーム部25により発生される。Therefore, with respect to the unknown pixel on the calculation target frame F, the count result of the number of white pixels Wi and the number of black pixels Bj on the calculation target frame F is set to the preset number of white pixels Wi or black. When the determination reference value DR of the number of pixels Bj is not satisfied,
When the measurement ends abnormally, the alarm unit 25 issues a warning or the like indicating that the gravity center coordinate value cannot be measured.
【0119】この際に、予め設定された白の画素数Wi
の判定基準値DRと計算対象枠F上の白の画素数Wiと
の第1の比較処理及び黒の画素数Bjの判定基準値DR
と計算対象枠F上の黒の画素数Bjとの第2の比較処理
に基づいて計測異常がアラーム部25により発生され
る。At this time, the preset number of white pixels Wi
Of the white reference pixel number Wi on the calculation target frame F and the reference value DR of the black pixel number Bj
The measurement error is generated by the alarm unit 25 on the basis of the second comparison processing between the number of black pixels Bj on the calculation target frame F and Bj.
【0120】これにより、当該画像処理装置の上位の制
御系に知らしめ、事前に制御ミス等を阻止することが可
能となる。このことで、第1,第2の実施例と同様に、
対象物10の計測情報を正確に演算することが可能とな
る。As a result, it is possible to notify the upper control system of the image processing apparatus and prevent a control error or the like in advance. As a result, like the first and second embodiments,
It is possible to accurately calculate the measurement information of the object 10.
【0121】なお、本発明の画像処理装置をロボット制
御装置の目に適用した実施例について述べたが、パター
ン認識処理やその他の画像処理に適用した場合にも、同
様な効果が得られる。また、計算対象枠Fは四角形状の
場合について説明したが、円形や楕円形等の任意形状で
も同様に適用可能である。Although the embodiment in which the image processing apparatus of the present invention is applied to the eyes of the robot control apparatus has been described, the same effect can be obtained when applied to pattern recognition processing and other image processing. Further, although the calculation target frame F has been described as having a quadrangular shape, it can be similarly applied to an arbitrary shape such as a circle or an ellipse.
【0122】さらに、各実施例では計測値として重心座
標と面積について説明をしたが、その他の計測値,例え
ば、慣性主軸角度や等価楕円長径/短径などを用いて計
算対象枠Fの内部に係わり演算処理をしても良い。Further, in each of the embodiments, the barycentric coordinates and the area are described as the measured values. Involved calculation processing may be performed.
【0123】なお、各実施例ではX軸,Y軸の二次元画
像に係る計測処理の場合について説明をしたが、CTス
キャナなどの立体画像に係る計測処理の場合についても
適用可能である。In each of the embodiments, the case of the measurement processing relating to the X-axis and Y-axis two-dimensional images has been described, but it is also applicable to the case of the measurement processing relating to a stereoscopic image such as a CT scanner.
【0124】[0124]
【発明の効果】以上説明したように、本発明の画像処理
装置によれば、範囲設定手段,計数手段,比較手段及び
演算手段が具備され、該比較手段が計算対象枠上の白の
画素数と黒の画素数とを比較している。As described above, according to the image processing apparatus of the present invention, the range setting means, the counting means, the comparing means and the calculating means are provided, and the comparing means includes the number of white pixels on the calculation target frame. And the number of black pixels are compared.
【0125】このため、比較手段により計算対象枠上の
白の画素数と黒の画素数とが比較され、白の画素数が黒
の画素数よりも多い場合には、対象物の色は黒として、
また、逆に、黒の画素数が白の画素数よりも多い場合に
は、対象物の色は白として、該対象枠内の画像取得対象
の色調を自動識別することが可能となる。このことで、
対象物の色が黒又は白、その周辺の背景色が白又は黒と
する識別条件を設定しない未知の色の場合について、そ
れを容易に認識することが可能となる。Therefore, the comparison means compares the number of white pixels and the number of black pixels on the calculation target frame, and when the number of white pixels is larger than the number of black pixels, the color of the object is black. As
On the contrary, when the number of black pixels is larger than the number of white pixels, the color of the object is white, and it is possible to automatically identify the color tone of the image acquisition target in the target frame. With this,
It is possible to easily recognize the case where the color of the object is black or white and the background color around the object is an unknown color for which the identification condition is not set and which is not set.
【0126】また、本発明の画像処理装置によれば、予
め設定された白の画素数又は黒の画素数の判定基準値と
計算対象枠上の白の画素数や黒の画素数とが比較手段に
より比較される。Further, according to the image processing apparatus of the present invention, the preset reference value of the number of white pixels or the number of black pixels is compared with the number of white pixels or the number of black pixels on the calculation target frame. Compared by means.
【0127】このため、計算対象枠上の未知の画素につ
いて、対象物以外の物体の一部が当該計算対象枠内の対
象画像に重なっているか,又は、対象物自身が計算対象
枠からはみ出している状態として異常判定をすることが
可能となる。Therefore, for an unknown pixel on the calculation target frame, a part of the object other than the target object overlaps the target image in the calculation target frame, or the target object itself protrudes from the calculation target frame. It is possible to make an abnormality determination as the state of being present.
【0128】さらに、本発明の画像処理装置によれば予
め設定された白の画素数又は黒の画素数の判定基準値と
計算対象枠上の白の画素数や黒の画素数との比較処理に
基づいて計測異常を発生する警報手段が設けられる。Further, according to the image processing apparatus of the present invention, the comparison processing of the preset reference value of the number of white pixels or the number of black pixels and the number of white pixels or the number of black pixels on the calculation target frame is performed. An alarm means is provided for generating a measurement abnormality based on the above.
【0129】このため、計算対象枠上の未知の画素につ
いて、計算対象枠上の白の画素数や黒の画素数の計数結
果が予め設定された白の画素数又は黒の画素数の判定基
準値を満足しない場合には、当該重心座標値の計測不能
に陥った旨の警報等が警報手段により発生される。この
ことで、当該画像処理装置の上位の制御系に知らしめ、
事前に制御ミス等を阻止することが可能となる。Therefore, with respect to the unknown pixel on the calculation target frame, the counting result of the number of white pixels and the number of black pixels on the calculation target frame is a preset judgment criterion of the number of white pixels or the number of black pixels. If the value is not satisfied, the alarm means issues an alarm indicating that the barycentric coordinate value cannot be measured. This informs the upper control system of the image processing device,
It is possible to prevent control mistakes in advance.
【0130】これにより、対象画像の正しい重心座標値
の演算処理を行うことが可能となり、正確な対象画像の
重心座標値によって対象物の重心位置を決定することが
可能となる。As a result, it becomes possible to perform the arithmetic processing of the correct barycentric coordinate value of the target image, and it becomes possible to determine the barycentric position of the target object by the accurate barycentric coordinate value of the target image.
【0131】また、本発明のロボット制御装置によれ
ば、ロボット作業部,画像取得手段,画像計測手段及び
制御手段が具備され、該画像計測手段が本発明の画像処
理装置から成っている。Further, according to the robot control device of the present invention, the robot working unit, the image acquisition means, the image measurement means and the control means are provided, and the image measurement means comprises the image processing device of the present invention.
【0132】このため、対象物の色につき、事前に黒又
は白が明確になっていない場合であっても、計算対象枠
上の未知の画素について、計算対象枠内の画像取得対象
の色調を自動識別することができるので、該対象物の正
確な重心座標値の演算をすることができる。このことか
ら、従来例のように、予め、対象物の色に係わり事前に
黒又は白を仮定することなく、その計測情報を正確に演
算すること、及び、高速に認識をすることが可能とな
る。Therefore, even if black or white is not clearly defined in advance for the color of the object, the color tone of the image acquisition object in the object frame is calculated for the unknown pixel on the object frame. Since it can be automatically identified, the accurate barycentric coordinate value of the object can be calculated. From this, unlike the conventional example, it is possible to accurately calculate the measurement information and to recognize at high speed without previously assuming black or white depending on the color of the object. Become.
【0133】これにより、高信頼度の画像計測装置及び
それを応用した高性能の物体認識機能を具備するロボッ
ト制御装置の提供に寄与するところが大きい。This greatly contributes to the provision of a highly reliable image measuring device and a robot controller having a high-performance object recognition function to which the image measuring device is applied.
【図1】本発明に係る画像処理装置及びロボット制御装
置の原理図(その1)である。FIG. 1 is a principle diagram (1) of an image processing apparatus and a robot control apparatus according to the present invention.
【図2】本発明に係る画像処理装置及びロボット制御装
置の原理図(その2)である。FIG. 2 is a principle diagram (No. 2) of the image processing apparatus and the robot control apparatus according to the present invention.
【図3】本発明の実施例に係る画像処理装置を応用した
ロボット制御装置の構成図である。FIG. 3 is a configuration diagram of a robot control device to which an image processing device according to an embodiment of the present invention is applied.
【図4】本発明の第1の実施例に係る対象物を認識する
画像処理のフローチャートである。FIG. 4 is a flowchart of image processing for recognizing an object according to the first embodiment of the present invention.
【図5】本発明の第1の実施例に係るフローチャートの
補足説明図である。FIG. 5 is a supplementary explanatory diagram of the flowchart according to the first embodiment of the present invention.
【図6】本発明の第2の実施例に係る対象物を認識する
画像処理のフローチャートである。FIG. 6 is a flowchart of image processing for recognizing an object according to the second embodiment of the present invention.
【図7】本発明のその他の実施例に係るフローチャート
の補足説明図である。FIG. 7 is a supplementary explanatory diagram of a flowchart according to another embodiment of the present invention.
【図8】本発明の第3の実施例に係る対象物を認識する
画像処理のフローチャートである。FIG. 8 is a flowchart of image processing for recognizing an object according to the third embodiment of the present invention.
【図9】従来例に係るロボット制御装置の物体認識方法
の説明図である。FIG. 9 is an explanatory diagram of an object recognition method of a robot controller according to a conventional example.
【図10】従来例に係る問題点を説明する対象物の取得画
像図である。FIG. 10 is an acquired image view of a target object for explaining a problem in the conventional example.
11…範囲設定手段、 12…計数手段、 13…比較手段、 14…演算手段、 15…警報手段、 17…ロボット作業部、 18…画像取得手段、 19…画像計測手段、 20…制御手段、 F…計算対象枠、 DR…判定基準値、 Wi〔i=1,2,3…〕…白の画素、 Bj〔j=1,2,3…〕…黒の画素。 11 ... Range setting means, 12 ... Counting means, 13 ... Comparison means, 14 ... Calculation means, 15 ... Alarm means, 17 ... Robot working unit, 18 ... Image acquisition means, 19 ... Image measurement means, 20 ... Control means, F ... Calculation target frame, DR ... Judgment reference value, Wi [i = 1, 2, 3 ...] ... White pixel, Bj [j = 1, 2, 3 ...] ... Black pixel.
Claims (6)
(F)を設定する範囲設定手段(11)と、前記画像取
得対象(16)に設定された計算対象枠上の白の画素数
(Wi〔i=1,2,3…〕)又は黒の画素数(Bj
〔j=1,2,3…〕)を計数する計数手段(12)
と、前記計算対象枠(F)上の白の画素数(Wi)や黒
の画素数(Bj)を比較する比較手段(13)と、前記
計算対象枠(F)内の対象画像の重心座標値を演算する
演算手段(14)とを具備し、前記計算対象枠(F)上
の白の画素数(Wi)及び黒の画素数(Bj)に基づい
て該計算対象枠(F)内の画像取得対象(16)の色調
を識別することを特徴とする画像処理装置。1. A range setting means (11) for setting a calculation target frame (F) to an image acquisition target (16), and a number of white pixels on the calculation target frame set to the image acquisition target (16) ( Wi [i = 1, 2, 3 ...]) or the number of black pixels (Bj
[J = 1, 2, 3 ...]) counting means (12)
And a comparison means (13) for comparing the number of white pixels (Wi) and the number of black pixels (Bj) on the calculation target frame (F), and the barycentric coordinates of the target image in the calculation target frame (F). A calculation means (14) for calculating a value, and based on the number of white pixels (Wi) and the number of black pixels (Bj) on the calculation target frame (F), An image processing device characterized by identifying a color tone of an image acquisition target (16).
前記比較手段(13)が計算対象枠(F)上の白の画素
数(Wi)と黒の画素数(Bj)とを比較することを特
徴とする画像処理装置。2. The image processing apparatus according to claim 1,
The image processing apparatus, wherein the comparing means (13) compares the number of white pixels (Wi) and the number of black pixels (Bj) on the calculation target frame (F).
前記比較手段(13)が,予め設定された白の画素数
(Wi)又は黒の画素数(Bj)の判定基準値(DR)
と前記計算対象枠(F)上の白の画素数(Wi)や黒の
画素数(Bj)とを比較することを特徴とする画像処理
装置。3. The image processing apparatus according to claim 1,
The comparison means (13) determines a preset reference value (DR) of the number of white pixels (Wi) or the number of black pixels (Bj).
And an image processing apparatus for comparing the number of white pixels (Wi) and the number of black pixels (Bj) on the calculation target frame (F).
予め設定された白の画素数(Wi)又は黒の画素数(B
j)の判定基準値(DR)と前記計算対象枠(F)上の
白の画素数(Wi)や黒の画素数(Bj)との比較処理
に基づいて計測異常を発生する警報手段(15)が設け
られることを特徴とする画像処理装置。4. The image processing apparatus according to claim 3,
The number of white pixels (Wi) or the number of black pixels (B
An alarm means (15) for generating a measurement abnormality based on a comparison process between the judgment reference value (DR) of j) and the number of white pixels (Wi) or the number of black pixels (Bj) on the calculation target frame (F). ) Is provided.
前記警報手段(15)が,予め設定された白の画素数
(Wi)の判定基準値(DR)と前記計算対象枠(F)
上の白の画素数(Wi)との第1の比較処理及び前記黒
の画素数(Bj)の判定基準値(DR)と前記計算対象
枠(F)上の黒の画素数(Bj)との第2の比較処理に
基づいて計測異常を発生することを特徴とする画像処理
装置。5. The image processing apparatus according to claim 4,
The alarm means (15) sets a judgment reference value (DR) of a preset number of white pixels (Wi) and the calculation target frame (F).
First comparison processing with the number of white pixels (Wi) above, and a determination reference value (DR) of the number of black pixels (Bj) and the number of black pixels (Bj) on the calculation target frame (F). An image processing apparatus, wherein a measurement abnormality is generated based on the second comparison processing of 1.
するロボット作業部(17)と、前記対象物(10)の
画像を取得する画像取得手段(18)と、前記対象物
(10)の位置情報を計測する画像計測手段(19)
と、前記ロボット作業部(17),画像取得手段(1
8)及び画像計測手段(19)の入出力を制御する制御
手段(20)とを具備し、前記画像計測手段(19)が
請求項1〜5記載の画像処理装置から成ることを特徴と
するロボット制御装置。6. A robot working unit (17) for performing various teaching operations relating to an object (10), an image acquisition means (18) for acquiring an image of the object (10), and the object (10). Image measuring means (19) for measuring position information of
And the robot working unit (17), image acquisition means (1
8) and a control means (20) for controlling the input / output of the image measuring means (19), wherein the image measuring means (19) comprises the image processing device according to any one of claims 1 to 5. Robot controller.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP11378692A JPH05314258A (en) | 1992-05-06 | 1992-05-06 | Image processing device and robot control device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP11378692A JPH05314258A (en) | 1992-05-06 | 1992-05-06 | Image processing device and robot control device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH05314258A true JPH05314258A (en) | 1993-11-26 |
Family
ID=14621064
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP11378692A Withdrawn JPH05314258A (en) | 1992-05-06 | 1992-05-06 | Image processing device and robot control device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH05314258A (en) |
-
1992
- 1992-05-06 JP JP11378692A patent/JPH05314258A/en not_active Withdrawn
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112276936B (en) | Three-dimensional data generating device and robot control system | |
| EP1555507B1 (en) | Three-dimensional visual sensor | |
| JP3951984B2 (en) | Image projection method and image projection apparatus | |
| JP2710850B2 (en) | Work holding device, work and its storage case | |
| JP3394278B2 (en) | Visual sensor coordinate system setting jig and setting method | |
| US6728417B1 (en) | Measurement apparatus | |
| EP1524492B1 (en) | Three-dimensional measurement apparatus | |
| JPH0798208A (en) | Method and system for recognizing three-dimensional position and attitude on the basis of sense of sight | |
| WO2019093299A1 (en) | Position information acquisition device and robot control device provided with same | |
| CN120235959A (en) | Multi-angle rotation 3D guided dispensing detection method based on two-dimensional vision | |
| US7355725B2 (en) | Measuring system | |
| JPH06243236A (en) | Coordinate system calibration parameter setting device for visual recognition device | |
| US6633663B1 (en) | Method and system for determining component dimensional information | |
| JPH05314258A (en) | Image processing device and robot control device | |
| KR0130950B1 (en) | Circular Hole Recognition Method | |
| JPH05314257A (en) | Image processor and robot controller | |
| JPH0575243B2 (en) | ||
| CN117644510A (en) | Robot working method, device, equipment and storage medium | |
| US11691237B2 (en) | Machine control device | |
| JPH09126759A (en) | Distance measuring method using in-vehicle camera and distance measuring apparatus using the same | |
| JP2562047B2 (en) | Position and orientation recognition method of target object | |
| JPH0339611A (en) | Calibration method between coordinate systems in a robot equipped with a visual recognition device | |
| CN111862198A (en) | Image processing apparatus, image processing method, and robot system | |
| JPH05204459A (en) | Position measuring device and connector fitting method | |
| JP2974794B2 (en) | Multi-view recognition method for polygonal parts |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 19990706 |