JP3538506B2 - Automatic image processing program generation method for robot, device thereof and robot program automatic correction method - Google Patents

Automatic image processing program generation method for robot, device thereof and robot program automatic correction method

Info

Publication number
JP3538506B2
JP3538506B2 JP24281096A JP24281096A JP3538506B2 JP 3538506 B2 JP3538506 B2 JP 3538506B2 JP 24281096 A JP24281096 A JP 24281096A JP 24281096 A JP24281096 A JP 24281096A JP 3538506 B2 JP3538506 B2 JP 3538506B2
Authority
JP
Japan
Prior art keywords
robot
program
teaching
work
image processing
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 - Fee Related
Application number
JP24281096A
Other languages
Japanese (ja)
Other versions
JPH1091225A (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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP24281096A priority Critical patent/JP3538506B2/en
Publication of JPH1091225A publication Critical patent/JPH1091225A/en
Application granted granted Critical
Publication of JP3538506B2 publication Critical patent/JP3538506B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は溶接作業や、面取り
作業等のワークとの接触を伴う作業を行うロボットに係
り、とりわけこのようなロボットのための画像処理プロ
グラム自動生成方法、その装置およびロボットプログラ
ム自動修正方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a robot for performing an operation involving contact with a work such as a welding operation or a chamfering operation, and more particularly to an automatic image processing program generating method for such a robot, an apparatus therefor, and a robot. It relates to a program automatic correction method.

【0002】[0002]

【従来の技術】従来より工場の製造ライン等において
は、各種の作業を行うために様々な形でロボットが利用
されている。ロボットの主な用途としては、自動車ライ
ンにおける溶接や、電子部品の組立等が挙げられるが、
その他にもマテハンや塗装、面取り等の各種の作業で利
用されている。なお、従来におけるロボットの基本的な
使用方法は、治具等によりロボットに対してワークが正
確に位置決めされるようにしておき、あらかじめマスタ
ワークについてティーチングされたロボットプログラム
による動作を数多くの同じワークに対して繰り返し行う
というものであった。
2. Description of the Related Art Conventionally, robots have been used in various forms on factory production lines and the like to perform various operations. The main applications of robots include welding in automobile lines and assembling electronic components.
In addition, it is used in various operations such as material handling, painting, and chamfering. The basic usage of the conventional robot is to ensure that the work is accurately positioned with respect to the robot using a jig, etc. It was to repeat it.

【0003】しかしながら、近年のコンピュータの価格
低下と計算能力の急激な増大、およびCCD(Charge c
oupled device ,電荷結合素子)カメラの価格低下と性
能向上により、画像処理が従来とは比べものにならない
ほどの低価格で利用できるようになってきている。これ
に伴い、ロボットの分野においても、画像処理を積極的
に利用する例が増えている。代表的な利用方法として
は、物体をパレットの決められた位置に搬送するパレタ
イジングにおいてワークの種別や正確な位置を検出する
もの、チップマウンタにおいてICの位置を検出するも
の等がある。また、ロボットにおけるこれまでの画像処
理では、処理時間の制約が厳しいために、画像処理専用
のハードウェアによる2値化処理を行うことが普通であ
ったが、コンピュータの価格低下と計算能力の向上によ
り、濃淡画像のパターンマッチング等を行う画像処理装
置も増えつつある。一般に濃淡画像のパターンマッチン
グの方が2値化処理に比べて照明条件の変化に対して安
定であるといわれている。
[0003] However, in recent years, the price of computers has dropped, the computing power has increased sharply, and CCDs (Charge c
Due to the price reduction and performance improvement of cameras (oupled devices), image processing has become available at a price that is incomparable to conventional ones. Along with this, in the field of robots, an example of actively using image processing is increasing. Typical methods of use include a method of detecting the type and accurate position of a work in palletizing for transporting an object to a predetermined position on a pallet, and a method of detecting the position of an IC in a chip mounter. In conventional image processing for robots, binarization processing is usually performed by hardware dedicated to image processing due to severe restrictions on processing time. Accordingly, image processing apparatuses that perform pattern matching of grayscale images and the like are increasing. It is generally said that pattern matching of a grayscale image is more stable with respect to changes in illumination conditions than binarization processing.

【0004】ロボット用の画像処理装置は、ロボットの
動作を制御するロボットコントローラに組み込まれる
か、あるいはロボットコントローラとのデータのやりと
りが可能となっており、これにより画像処理結果をロボ
ットプログラムに反映できるようになっている。また画
像処理装置には、専用の画像処理用言語が用意されてい
るのが普通であり、この専用の画像処理用言語により、
あらかじめユーザはその処理内容についてのプログラム
を記述しておく必要がある。これまでの画像処理用言語
の中には、ユーザによるプログラム作業ができるだけ容
易になるように工夫されているものも多いが、画像処理
技術の発展とともに画像処理装置により提供される機能
は急激に増えつつあり、ユーザに必要とされる画像処理
に関する知識はむしろ増えつつあるといえる。
An image processing apparatus for a robot is incorporated in a robot controller for controlling the operation of the robot, or can exchange data with the robot controller, so that the result of the image processing can be reflected in the robot program. It has become. Further, the image processing apparatus is usually provided with a dedicated image processing language.
The user needs to write a program for the processing content in advance. Many of the conventional image processing languages have been devised to make the program work by the user as easy as possible. However, the functions provided by the image processing apparatus have rapidly increased with the development of image processing technology. It can be said that the knowledge of image processing required by users is rather increasing.

【0005】なお、画像処理が利用できるロボットの具
体的な作業として、例えば面取り作業や溶接作業等のよ
うにワーク稜線に沿ってロボットの先端に取り付けられ
たツールが移動する作業においては、ワークの個体差に
よって変化するワーク稜線の位置および形状を正確に把
握しておく必要があり、このためにワークの位置および
形状を特徴づける教示点の実際の位置を画像処理により
求めておくことが有効となる。
[0005] As a specific work of a robot that can use image processing, for example, in a work in which a tool attached to the end of the robot moves along a work ridgeline such as a chamfering work or a welding work, the work of the work is not performed. It is necessary to accurately grasp the position and shape of the work ridgeline that changes due to individual differences, and it is effective to obtain the actual position of the teaching point that characterizes the position and shape of the work by image processing. Become.

【0006】[0006]

【発明が解決しようとする課題】上述したように、ロボ
ットにより行われる各種の作業に画像処理を利用するこ
とは有効ではあるが、画像処理を利用するためには個々
の画像処理装置に固有の言語を習得した後に、各作業ご
とに画像処理プログラムを記述する必要があった。ま
た、個々のワークに対して画像処理プログラムを記述す
るとともに、その画像処理結果を利用してロボットが動
作するようにロボットプログラムを作成ないし修正する
必要があった。
As described above, it is effective to use image processing for various operations performed by a robot. However, in order to use image processing, it is necessary to use image processing unique to each image processing apparatus. After learning the language, it was necessary to write an image processing program for each task. Further, it is necessary to describe an image processing program for each work and to create or modify a robot program so that the robot operates using the image processing result.

【0007】このため従来のロボットでは、画像処理プ
ログラムの記述に多大な時間を要していた。また画像処
理装置に固有の言語や画像処理に関する基礎知識を習得
するためにも多大な時間が必要であり、画像処理に詳し
い人間でないと画像処理装置を使いこなすことは困難で
あった。
[0007] For this reason, in the conventional robot, it takes a lot of time to describe the image processing program. In addition, a great deal of time is required to acquire a language specific to the image processing apparatus and basic knowledge about image processing, and it is difficult to use the image processing apparatus unless a person who is familiar with image processing is used.

【0008】しかしながら、ロボットにより行われる溶
接作業や、面取り作業等のワークとの接触を伴う作業の
ために必要となる画像処理に限れば、ワークの個体差に
よって変化するワーク稜線の位置および形状等は、1つ
のマスタワークについてティーチングされたロボットプ
ログラムの中に動作命令の種別や動作命令の引数である
教示点としてすでに含まれている。ここで、画像処理に
より正確な位置が要求される教示点はワーク稜線等との
位置決めが要求される作業である。
However, if the image processing required for the work involving contact with the work such as the welding work and the chamfering work performed by the robot is limited, the position and shape of the work ridge line that changes depending on the individual difference of the work. Are already included in the robot program that has been taught for one master work, as a type of operation command and a teaching point that is an argument of the operation command. Here, a teaching point for which an accurate position is required by image processing is an operation for which positioning with a work ridge line or the like is required.

【0009】一方、ロボットプログラムの中には、溶接
作業時の動作や面取り作業時の動作等に直接関係する正
確な位置が要求される教示点以外にも、ロボットの姿勢
を単に変化させるだけの動作のようにワークの個体差を
考慮する必要のない動作に関係する教示点も含まれてい
る。しかしこれについては、例えば溶接作業に関して
は、溶接開始命令および溶接停止命令に挟まれたロボッ
トの動作命令のみを選択することにより高精度の位置決
めが要求される溶接作業時の動作に関係する教示点のみ
を抽出することが可能である。
On the other hand, in the robot program, in addition to the teaching points that require an accurate position directly related to the operation at the time of welding operation and the operation at the time of chamfering operation, the robot program merely changes the posture of the robot. It also includes teaching points related to motions that do not need to consider individual differences between workpieces, such as motions. However, as for the welding operation, for example, the teaching points related to the operation at the time of the welding operation that requires high-precision positioning by selecting only the operation command of the robot sandwiched between the welding start command and the welding stop command. It is possible to extract only

【0010】また力制御機能を有するロボットによる面
取り作業に関しては、ワークとの接触を伴う直線移動命
令や円弧移動命令等のようにワークとの接触を伴う作業
命令のみを選択することにより溶接作業の場合と同様に
高精度の位置決めが要求されるワークとの接触作業時の
動作に関係する教示点のみを抽出することが可能であ
る。このように、マスタワークについてティーチングさ
れたロボットプログラムの中には、画像処理プログラム
を作成するために必要な情報は全て含まれている。
[0010] Further, as for the chamfering operation by the robot having the force control function, the welding operation can be performed by selecting only the operation command that comes into contact with the work, such as a linear movement instruction or an arc movement instruction that comes into contact with the work. As in the case described above, it is possible to extract only the teaching points related to the operation at the time of the contact work with the work requiring high-precision positioning. As described above, the robot program taught for the master work includes all information necessary for creating an image processing program.

【0011】本発明はこのような点を考慮してなされた
ものであり、マスタワークについてティーチングされた
ロボットプログラムからワークごとの個体差に対応する
ための画像処理プログラムを自動的に生成することがで
きるロボットのための画像処理プログラム自動生成方法
およびその装置を提供することを目的とする。また、こ
のような方法により生成された画像処理プログラムを用
いてロボットプログラムにあらかじめ内蔵された各教示
点の座標値を自動的に修正することができるロボットプ
ログラム自動修正方法を提供することも目的とする。
The present invention has been made in view of the above points, and it is possible to automatically generate an image processing program for coping with individual differences between works from a robot program taught for a master work. It is an object of the present invention to provide a method and an apparatus for automatically generating an image processing program for a robot that can be used. It is another object of the present invention to provide a robot program automatic correction method capable of automatically correcting the coordinate values of each teaching point previously stored in a robot program using an image processing program generated by such a method. I do.

【0012】[0012]

【課題を解決するための手段】本発明は、ワークとの接
触を伴う作業(溶接作業や面取り作業等)を行うロボッ
トのための画像処理プログラム自動生成方法において、
あらかじめマスタワークについてティーチングされたロ
ボットプログラムの中からワークとの接触作業を行う際
のロボット座標系に基づく教示点を含む動作命令を抽出
し、この抽出された動作命令からあらかじめ内蔵された
教示点を抽出する第1の工程と、この第1の工程により
抽出された各教示点について、それぞれの教示点を含む
動作命令の種別から各教示点がどのような曲線(直線や
円弧等)に属するかを判別するとともに、この判別され
た曲線の範囲を特定する教示点(端点や途中の点等)の
座標値を前記ロボットプログラムの中から読み出す第2
の工程と、この第2の工程により読み出された各教示点
のロボット座標系での座標値を、あらかじめ定義された
前記ワークを撮影するためのビデオカメラの座標系とロ
ボット座標系との変位量を用いて前記ビデオカメラの画
面内での座標値に変換する第3の工程と、この第3の工
程により変換された各教示点の座標値および各教示点の
属する曲線の種別に基づいて、前記ビデオカメラにより
撮影された画像から前記各教示点に対応する曲線(直線
や円弧等)の位置を検出してこれらの交点としての各教
示点の実際の位置を求める画像処理プログラムを生成す
る第4の工程と、を備えたことを特徴とするロボットの
ための画像処理プログラム自動生成方法を提供する。
SUMMARY OF THE INVENTION The present invention relates to a method for automatically generating an image processing program for a robot which performs an operation (such as a welding operation or a chamfering operation) involving contact with a workpiece.
Extract a motion command including a teaching point based on the robot coordinate system when performing a contact work with a work from a robot program that has been taught in advance for a master work, and derive a pre-installed teaching point from the extracted motion command. The first step to be extracted and, for each teaching point extracted in the first step, what curve (straight line, arc, etc.) each teaching point belongs to based on the type of the operation command including each teaching point. And reading out, from the robot program, coordinate values of teaching points (end points, intermediate points, etc.) for specifying the range of the determined curve.
And the coordinate values in the robot coordinate system of each teaching point read out in the second step are defined by a displacement between the coordinate system of the video camera for photographing the workpiece and the robot coordinate system defined in advance. A third step of converting the coordinates into coordinates within the screen of the video camera using the quantity, and a coordinate value of each teaching point converted by the third step and a type of a curve to which each teaching point belongs. Generating an image processing program for detecting a position of a curve (a straight line, a circular arc, or the like) corresponding to each of the teaching points from an image taken by the video camera, and obtaining an actual position of each of the teaching points as an intersection thereof. And a fourth step of automatically generating an image processing program for a robot.

【0013】また本発明は、ワークとの接触を伴う作業
(溶接作業や面取り作業等)を行うロボットのための画
像処理プログラム自動生成装置において、作業対象とな
るワークを撮影するビデオカメラと、あらかじめマスタ
ワークについてティーチングされたロボットプログラム
の中からワークとの接触作業を行う際のロボット座標系
に基づく教示点を含む動作命令を抽出し、この抽出され
た動作命令からあらかじめ内蔵された教示点を抽出する
手段と、この手段により抽出された各教示点について、
それぞれの教示点を含む動作命令の種別から各教示点が
どのような曲線(直線や円弧等)に属するかを判別する
とともに、この判別された曲線の範囲を特定する教示点
(端点や途中の点等)の座標値を前記ロボットプログラ
ムの中から読み出す手段と、この手段により読み出され
た各教示点のロボット座標系での座標値を、あらかじめ
定義された前記ビデオカメラの座標系とロボット座標系
との変位量を用いて前記ビデオカメラの画面内での座標
値に変換する手段と、この手段により変換された各教示
点の座標値および各教示点の属する曲線の種別に基づい
て、前記ビデオカメラにより撮影された画像から前記各
教示点に対応する曲線(直線や円弧等)の位置を検出し
てこれらの交点としての各教示点の実際の位置を求める
画像処理プログラムを生成する手段と、を備えたことを
特徴とするロボットのための画像処理プログラム自動生
成装置を提供する。
According to the present invention, there is provided an image processing program automatic generation device for a robot which performs a work involving contact with a work (welding work, chamfering work, etc.), comprising: a video camera for photographing a work to be worked; Extract a motion command including a teaching point based on the robot coordinate system when performing contact work with the work from the robot program taught for the master work, and extract pre-built teaching points from the extracted motion command Means, and for each teaching point extracted by this means,
From the type of the operation command including each teaching point, it is determined which curve (straight line, circular arc, etc.) each teaching point belongs to, and a teaching point (end point or halfway point) specifying the range of the determined curve is determined. Means for reading the coordinate values of the teaching point from the robot program, and the coordinate values in the robot coordinate system of each teaching point read by the means are converted into the coordinate system of the video camera and the robot coordinates defined in advance. Means for converting into coordinate values within the screen of the video camera using the amount of displacement with the system, and based on the coordinate values of each teaching point converted by this means and the type of curve to which each teaching point belongs, An image processing program that detects the position of a curve (a straight line, an arc, or the like) corresponding to each of the teaching points from an image captured by a video camera and obtains the actual position of each of the teaching points as an intersection of these points. Further comprising a means for generating a to provide an image processing program automatic generation device for a robot according to claim.

【0014】さらに本発明は、上述したロボットのため
の画像処理プログラム自動生成方法により生成された画
像処理プログラムを用いて、前記ビデオカメラにより撮
影された画像から実際のワークの教示点の座標値を求め
る工程と、この工程により求められた実際のワークの教
示点の座標値に基づいて、ロボットプログラムにあらか
じめ内蔵された各教示点の座標値を修正する工程と、を
備えたことを特徴とするロボットプログラム自動修正方
法を提供する。
Further, the present invention uses the image processing program generated by the above-described method for automatically generating an image processing program for a robot to calculate the coordinate values of the teaching points of the actual work from the image taken by the video camera. Determining a coordinate value of each teaching point previously stored in the robot program based on the coordinate value of the teaching point of the actual work determined by this step. A method for automatically correcting a robot program is provided.

【0015】本発明のロボットのための画像処理プログ
ラム自動生成方法およびその装置によれば、あらかじめ
マスタワークについてティーチングされたロボットプロ
グラムの中から画像処理により正確な位置を求めるべき
教示点を抽出し、この抽出された各教示点を含む動作命
令の種別および他の動作命令に含まれる教示点に基づい
て、これらの各教示点のロボット座標系での座標値およ
び各教示点の属する曲線の種別を求め、これらの各教示
点のロボット座標系での座標値をビデオカメラの画面内
での座標値に変換する。そして、この変換された各教示
点の座標値および各教示点の属する曲線の種別に基づい
て、ビデオカメラにより撮影された画像から前記各教示
点に対応する曲線(直線や円弧等)の位置を検出してこ
れらの交点としての各教示点の実際の位置を求める画像
処理プログラムを生成する。これにより、マスタワーク
についてティーチングされたロボットプログラムからワ
ークごとの個体差に対応するための画像処理プログラム
を自動的に生成することができる。
According to the method and apparatus for automatically generating an image processing program for a robot according to the present invention, a teaching point for which an accurate position is to be obtained by image processing is extracted from a robot program that has been previously taught for a master work. Based on the type of the operation command including the extracted teaching points and the teaching points included in other operation commands, the coordinate values of these teaching points in the robot coordinate system and the type of the curve to which each teaching point belongs are determined. Then, the coordinate values of these teaching points in the robot coordinate system are converted into coordinate values in the video camera screen. Then, based on the converted coordinate values of the taught points and the type of the curve to which the taught points belong, the positions of the curves (straight lines, arcs, etc.) corresponding to the taught points are determined from the image taken by the video camera. An image processing program for detecting and finding the actual position of each teaching point as these intersections is generated. This makes it possible to automatically generate an image processing program for coping with individual differences between works from the robot program taught for the master work.

【0016】また本発明のロボットプログラム自動修正
方法によれば、本発明のロボットのための画像処理プロ
グラム自動生成方法により生成された画像処理プログラ
ムを用いて、ビデオカメラにより撮影された画像から実
際のワークの教示点の座標値を各ワークごとに求め、さ
らにこの求められた実際のワークの教示点の座標値に基
づいて、ロボットプログラムにあらかじめ内蔵された各
教示点の座標値を自動的に修正するので、1つのマスタ
ワークについてティーチングを行ってロボットプログラ
ムを作成するだけでワークごとの個体差を吸収するよう
にロボットプログラムを自動的に修正することができ、
このため仮に画像処理に関しての十分な知識を有しない
人であっても容易に画像処理を利用してワークの個体差
を吸収した形でロボットを動作させることができる。
Further, according to the robot program automatic correction method of the present invention, an actual image processing program generated by the image processing program automatic generation method for a robot of the present invention is used to convert an image taken by a video camera into an actual image. The coordinate values of the teaching points of the work are calculated for each work, and the coordinate values of the teaching points pre-installed in the robot program are automatically corrected based on the obtained coordinate values of the teaching points of the actual work. Therefore, it is possible to automatically modify the robot program so as to absorb individual differences for each work only by performing teaching for one master work and creating a robot program.
For this reason, even if a person who does not have sufficient knowledge about the image processing can easily operate the robot using the image processing in a form absorbing the individual difference of the work.

【0017】[0017]

【発明の実施の形態】以下、図面を参照して本発明の実
施の形態について説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0018】図1および図2は本発明によるロボットの
ための画像処理プログラム自動生成方法およびその装置
の一実施の形態を説明するための図である。
FIG. 1 and FIG. 2 are diagrams for explaining an embodiment of an automatic image processing program generation method and apparatus for a robot according to the present invention.

【0019】まず図2によりロボットのための画像処理
プログラム自動生成方法を実現する装置の全体構成につ
いて説明する。図2に示すように、この装置は、作業対
象となるワーク6を撮影するビデオカメラ1と、ビデオ
カメラ1により撮影された画像を取り込む画像入力ボー
ド2が挿入されたパーソナルコンピュータ3とから構成
されている。ここで、パーソナルコンピュータ3におい
て生成された画像処理プログラムはパーソナルコンピュ
ータ3上で実行され、この実行結果に基づいてマスタワ
ークについてティーチングされたロボットプログラムが
修正される。修正後のロボットプログラムはロボット5
の動作を制御するロボットコントローラ4上で実行さ
れ、ロボット5によりワーク6の個体差を考慮した動作
がなされる。なお、ロボットプログラムの修正はパーソ
ナルコンピュータ3上またはロボットコントローラ4上
のいずれでも行うことができ、パーソナルコンピュータ
3上で修正が行われる場合には修正後のロボットプログ
ラムがロボットコントローラ4に転送される。
First, an overall configuration of an apparatus for realizing an image processing program automatic generation method for a robot will be described with reference to FIG. As shown in FIG. 2, the apparatus includes a video camera 1 for photographing a work 6 to be worked, and a personal computer 3 into which an image input board 2 for capturing an image photographed by the video camera 1 is inserted. ing. Here, the image processing program generated in the personal computer 3 is executed on the personal computer 3, and the robot program taught for the master work is corrected based on the execution result. The modified robot program is Robot 5
The operation is performed on the robot controller 4 that controls the operation of the work 6, and the robot 5 performs the operation in consideration of the individual difference of the work 6. Note that the robot program can be corrected on the personal computer 3 or the robot controller 4. When the correction is performed on the personal computer 3, the corrected robot program is transferred to the robot controller 4.

【0020】次に図1によりロボットのための画像処理
プログラム自動生成方法の手順について説明する。図1
に示すように、まず、あらかじめマスタワークについて
ティーチングされたロボットプログラムの中から溶接作
業や、面取り作業等の作業対象であるワークとの接触を
伴う作業を行う際のロボット座標系に基づく動作命令を
抽出し、この抽出された動作命令から正確な位置計測が
必要な教示点を抽出する(ステップS101)。
Next, the procedure of an image processing program automatic generation method for a robot will be described with reference to FIG. FIG.
As shown in the figure, first, from the robot program that was previously taught for the master work, an operation command based on the robot coordinate system when performing work involving contact with the work to be worked, such as welding work or chamfering work, is given. A teaching point requiring accurate position measurement is extracted from the extracted operation command (step S101).

【0021】続いて、ステップS101において抽出さ
れた各教示点について、それぞれの教示点を含む動作命
令の種別から各教示点が直線や円弧等の曲線のうちどの
ような曲線に属するかを判別するとともに、この判別さ
れた曲線における端点や途中の点等の曲線の範囲を特定
する教示点の座標値をロボットプログラムの中から読み
出す(ステップS102)。
Subsequently, for each of the taught points extracted in step S101, it is determined from the type of the operation command including each of the taught points what kind of curve the straight line or the arc belongs to. At the same time, the coordinate value of the teaching point for specifying the range of the curve such as the end point or the halfway point in the determined curve is read from the robot program (step S102).

【0022】その後、ステップS101において抽出さ
れた教示点のロボット座標系での座標値、およびステッ
プS102において抽出されたその他の教示点のロボッ
ト座標系での座標値をビデオカメラの画面内での座標値
に変換する(ステップS103)。すなわち、ロボット
プログラムで記述されている座標値はロボット座標系で
の座標値であるので、これらの座標値をロボット座標系
とビデオカメラの投影中心に原点を有するカメラ座標系
との変位量を用いてビデオカメラの画面内での座標系で
ある画面座標系での座標値に変換する。なお、ロボット
座標系とカメラ座標系との変位量はあらかじめユーザが
設定しておく。
Thereafter, the coordinates of the teaching point extracted in step S101 in the robot coordinate system and the coordinates of the other teaching points extracted in step S102 in the robot coordinate system are displayed on the screen of the video camera. The value is converted to a value (step S103). That is, since the coordinate values described in the robot program are coordinate values in the robot coordinate system, these coordinate values are calculated using the displacement between the robot coordinate system and the camera coordinate system having the origin at the projection center of the video camera. To a coordinate value in a screen coordinate system which is a coordinate system in the screen of the video camera. The displacement between the robot coordinate system and the camera coordinate system is set in advance by the user.

【0023】そして、ステップS103において変換さ
れた各教示点の座標値および各教示点の属する曲線の種
別に基づいて、ビデオカメラの画面内での直線や円弧等
の曲線の位置を検出する位置検出プログラムを生成する
とともに(ステップS104)、ステップS104にお
いて生成された位置検出プログラムにより検出される直
線や円弧等の曲線の位置からステップS101およびス
テップS102において抽出された各教示点のビデオカ
メラの画面内での実際の位置を算出する位置算出プログ
ラムと、この位置算出プログラムにより算出される各教
示点の画面座標系での座標値をロボット座標系での座標
値に変換する座標変換プログラムとを生成する(ステッ
プS105)。
Then, based on the coordinate values of each teaching point converted in step S103 and the type of curve to which each teaching point belongs, position detection for detecting the position of a curve such as a straight line or an arc on the screen of the video camera. A program is generated (step S104), and the teaching point extracted in step S101 and step S102 from the position of a curve such as a straight line or an arc detected by the position detection program generated in step S104 is displayed on the video camera screen. And a coordinate conversion program for converting the coordinate values in the screen coordinate system of each teaching point calculated by the position calculation program into the coordinate values in the robot coordinate system. (Step S105).

【0024】以下、図3に示すワークを例にとり、この
ワークについての画像処理プログラムが生成される手順
を図1により具体的に説明する。図4は図3に示すワー
クのエッジの面取り作業を行うためのロボットプログラ
ムを示す図である。
Hereinafter, taking the work shown in FIG. 3 as an example, a procedure for generating an image processing program for the work will be described in detail with reference to FIG. FIG. 4 is a diagram showing a robot program for performing the edge chamfering work of the work shown in FIG.

【0025】図4に示すロボットプログラムにおいて、
15行目の「speed 10」はロボットの動作速度
を“10”に設定することを意味する。また、16行目
の「force 1」は動作命令のうちgmovel等
による押し付け作業時の押し付け力を“1kg”に設定
することを意味する。さらに、17行目の「dset
1」はデジタル出力のチャンネル1の出力を“1(O
N)”に設定することを意味し、28行目の「dres
et 1」はデジタル出力のチャンネル1の出力を“0
(OFF)”に設定することを意味する。なお、「ds
et 1」および「dreset 1」はそれぞれ、円
錐工具等の回転開始および回転停止に対応している。
In the robot program shown in FIG.
“Speed 10” on the fifteenth line means that the operation speed of the robot is set to “10”. Further, “force 1” on the 16th line means that the pressing force at the time of pressing work by gmove or the like among the operation commands is set to “1 kg”. Further, “dset on line 17
“1” indicates the digital output of channel 1 as “1 (O
N) ”means that“ dres
“et 1” sets the output of the digital output channel 1 to “0”.
(OFF) ”. Note that“ ds
"et 1" and "dreset 1" correspond to the start and stop of rotation of a conical tool or the like, respectively.

【0026】一方、18行目および27行目の「mov
el」はワークへの押し付けを伴わない直線移動命令で
あり、命令実行開始時の位置から引数で指定された教示
点までワークへの押し付けを行わずに円錐工具等を直線
移動させるためのものである。これに対し、19行目等
の「gmovel」はワークへの押し付けを伴う直線移
動命令であり、命令実行開始時の位置から引数で指定さ
れた教示点までワークへの押し付けを行いながら円錐工
具等を直線移動させるためのものである。また、20行
目等の「gmovec」はワークへの押し付けを伴う円
弧移動命令であり、命令実行開始時の位置と引数で指定
された2つの教示点とを通る円弧上を、命令実行開始時
の位置から第1の引数で指定された教示点を通って第2
の引数で指定された教示点までワークへの押し付けを行
いながら円錐工具等を移動させるためのものである。
On the other hand, "mov
`` el '' is a linear movement command that does not involve pressing on the work, and is used to linearly move a conical tool etc. without pressing on the work from the position at the start of command execution to the teaching point specified by the argument. is there. On the other hand, “gmove” in the 19th line and the like is a linear movement command accompanied by pressing on the work, and a cone tool or the like is pressed from the position at the start of command execution to the teaching point specified by the argument while pressing the work on the work. For linearly moving. “Gmovec” in the 20th line or the like is an arc movement command accompanied by pressing on the work, and is performed on an arc passing through the position at the start of command execution and the two teaching points specified by the arguments at the start of command execution. Through the teaching point specified by the first argument from the position
This is for moving the conical tool or the like while pressing the work to the teaching point designated by the argument of.

【0027】図4に示すようなロボットプログラムが与
えられると、図1のステップS101において、面取り
作業を行う際の動作命令である「gmovel」,「g
movec」のみがロボットプログラムの中から選び出
され、これらの動作命令の引数として指定されている教
示点および、これらの動作命令の実行開始時の位置を決
定する1つ前の動作命令の教示点を調べることにより、
面取り作業時の動作と関係する教示点を抽出する。例え
ば、図4に示すロボットプログラムの19行目の動作命
令「gmovel p3」の引数は「p3」であり、ま
たこの動作命令の実行開始時の位置を決定するのは1つ
前の18行目の動作命令である「movel p2」の
引数である「p2」である。同様にして、図4に示すロ
ボットプログラムから面取り作業時の動作と関係する教
示点を全て抽出すると、p2,p3,p4,p5,p
6,p7,p8,p9,p10,p11,p12,p1
3となる。
When a robot program as shown in FIG. 4 is given, in step S101 in FIG. 1, "gmove", "g
movec "is selected from the robot program, and the teaching points specified as the arguments of these operation instructions and the teaching point of the immediately preceding operation instruction that determines the position at the start of execution of these operation instructions By examining the
The teaching points related to the operation during the chamfering operation are extracted. For example, the argument of the operation instruction “gmove p3” on the 19th line of the robot program shown in FIG. 4 is “p3”, and the position at the start of execution of this operation instruction is determined on the 18th line immediately before "P2" which is an argument of "move p2" which is the operation instruction of "1". Similarly, if all the teaching points related to the operation during the chamfering operation are extracted from the robot program shown in FIG. 4, p2, p3, p4, p5, p
6, p7, p8, p9, p10, p11, p12, p1
It becomes 3.

【0028】図1のステップS102においては、これ
らp2〜p13の各教示点について、それぞれの教示点
を含む動作命令の種別から各教示点が直線や円弧等の曲
線のうちどのような曲線に属するかを判別するととも
に、この判別された曲線における端点や途中の点等の曲
線の範囲を特定する教示点の座標値をロボットプログラ
ムの中から読み出す。図3に示すワークの場合には、ワ
ーク稜線が直線および円弧に限定されるので、各教示点
の種別は(1)直線と直線との交点、(2)直線と円弧
との境界、および(3)円弧の途中の点の3通りに限定
される。また、曲線の範囲を特定する教示点は、直線の
場合にはその両端点となり、円弧の場合にはその両端点
および途中の点となる。このため、図4に示すロボット
プログラムの場合であれば、教示点の種別および曲線の
範囲を特定する教示点は以下のようになる。
In step S102 of FIG. 1, for each of the teaching points p2 to p13, the teaching point belongs to any of curves such as a straight line or an arc based on the type of the operation command including the teaching point. Is determined, and a coordinate value of a teaching point for specifying a range of the curve such as an end point or an intermediate point in the determined curve is read from the robot program. In the case of the work shown in FIG. 3, since the work ridgeline is limited to a straight line and an arc, the types of the teaching points are (1) the intersection of the straight line and the straight line, (2) the boundary between the straight line and the arc, and ( 3) It is limited to three types of points in the middle of the arc. In addition, the teaching points for specifying the range of the curve are both end points in the case of a straight line, and both end points and a halfway point in the case of a circular arc. Therefore, in the case of the robot program shown in FIG. 4, the teaching points for specifying the type of the teaching point and the range of the curve are as follows.

【0029】 図1のステップS103においては、ステップS102
までに求められた、面取り作業時の動作と関係する教示
点、および曲線の範囲を特定する教示点のロボット座標
系での座標値を、カメラ座標系さらには画面座標系での
座標値に変換する。なお、図4に示すロボットプログラ
ムの場合であれば、座標変換計算が必要な教示点はp
2,p3,p4,p5,p6,p7,p8,p9,p1
0,p11,p12,p13となる。ここで、カメラ座
標系とロボット座標系との変位量は2つの座標系原点の
位置変位量および座標系の姿勢変化量により特定するこ
とができる。これらの値については、あらかじめビデオ
カメラとロボットとの位置関係を正確にキャリブレーシ
ョンして、本実施の形態によるロボットのための画像処
理プログラム自動生成方法を実装したプログラムの設定
ファイルにユーザが設定しておく。
[0029] In step S103 of FIG. 1, step S102
The coordinate values in the robot coordinate system of the teaching points related to the operation during the chamfering operation and the teaching point that specifies the range of the curve determined up to this point are converted into the coordinate values in the camera coordinate system and further in the screen coordinate system I do. In the case of the robot program shown in FIG. 4, the teaching point requiring coordinate conversion calculation is p
2, p3, p4, p5, p6, p7, p8, p9, p1
0, p11, p12, and p13. Here, the amount of displacement between the camera coordinate system and the robot coordinate system can be specified by the amount of positional displacement between the origins of the two coordinate systems and the amount of change in posture of the coordinate systems. For these values, the user calibrates the positional relationship between the video camera and the robot accurately in advance, and sets the values in the setting file of the program that implements the automatic image processing program generation method for the robot according to the present embodiment. Keep it.

【0030】カメラ座標系とロボット座標系との変位量
から計算されるロボット座標系からカメラ座標系への座
標変換行列をT、ロボット座標系での各教示点の座標値
をXri、カメラ座標系での各教示点の座標値をXciとす
ると、カメラ座標系への変換は次式(1)により行われ
る。
The coordinate transformation matrix from the robot coordinate system to the camera coordinate system calculated from the displacement between the camera coordinate system and the robot coordinate system is T, the coordinate value of each teaching point in the robot coordinate system is X ri , and the camera coordinates Assuming that the coordinate value of each teaching point in the system is Xci , conversion to the camera coordinate system is performed by the following equation (1).

【0031】[0031]

【数1】 上式(1)において、行列Tは同次座標で表現されてい
るものとする。ここで、カメラ座標系はビデオカメラの
投影中心に原点を有しており、本実施の形態ではレンズ
光軸をZ軸、原点を通り画面の水平方向に対応する軸を
X軸、原点を通り画面の垂直方向に対応する軸をY軸と
している。また、画面右方向に対応する向きをX軸の正
方向、画面上方向に対応する向きをY軸の正方向、ビデ
オカメラの前方からビデオカメラに向かう方向をZ軸の
正方向としている。このようにして教示点のロボット座
標系での座標値をビデオカメラの投影中心に原点を有す
る三次元空間の座標系であるカメラ座標系での座標値に
変換した後、ビデオカメラの画面内の二次元空間の座標
系である画面座標系への変換を次式(2)により行う。
(Equation 1) In the above equation (1), it is assumed that the matrix T is represented by homogeneous coordinates. Here, the camera coordinate system has an origin at the projection center of the video camera, and in this embodiment, the lens optical axis passes through the origin, the axis corresponding to the horizontal direction of the screen passes through the origin, and the X axis passes through the origin. The axis corresponding to the vertical direction of the screen is the Y axis. The direction corresponding to the right side of the screen is defined as the positive direction of the X axis, the direction corresponding to the upward direction of the screen is defined as the positive direction of the Y axis, and the direction from the front of the video camera to the video camera is defined as the positive direction of the Z axis. After converting the coordinate values of the teaching point in the robot coordinate system into coordinate values in the camera coordinate system, which is a coordinate system in a three-dimensional space having the origin at the projection center of the video camera, Conversion to a screen coordinate system, which is a coordinate system in a two-dimensional space, is performed by the following equation (2).

【0032】[0032]

【数2】 上式(2)において、Xc =[xc ,yc ,zc t
教示点のカメラ座標系での座標値であり、[xf
f t は教示点の画面座標系での座標値である。画面
座標系は画面中央に原点を有しており、本実施の形態で
は原点を通り画面の水平方向に対応する軸をX軸、原点
を通り画面の垂直方向に対応する軸をY軸としている。
また、画面右方向に対応する向きをX軸の正方向、画面
上方向に対応する向きをY軸の正方向としている。
(Equation 2) In the above equation (2), X c = [x c , y c , z c ] t is the coordinate value of the teaching point in the camera coordinate system, and [x f ,
y f ] t is the coordinate value of the teaching point in the screen coordinate system. The screen coordinate system has an origin at the center of the screen. In this embodiment, an axis passing through the origin and corresponding to the horizontal direction of the screen is defined as an X axis, and an axis passing through the origin and corresponding to the vertical direction of the screen is defined as a Y axis. .
The direction corresponding to the right side of the screen is defined as the positive direction of the X axis, and the direction corresponding to the upward direction of the screen is defined as the positive direction of the Y axis.

【0033】なお、教示点の座標値をロボット座標系か
らカメラ座標系へ変換する関数またはコマンド、および
教示点の座標値をカメラ座標系から画面座標系へ変換す
る関数またはコマンドとして、 xc=TrnRobCam(xr,T), xp=Persp(xc) のような形式の2つの関数またはコマンドをあらかじめ
用意しておけば、図4に示すロボットプログラムの場合
には、図1のステップS104およびステップS105
において生成される画像処理プログラムの前段のプログ
ラムとして、図5に示すプログラムが実行される。な
お、図5の(A)の部分は教示点の座標値をロボット座
標系からカメラ座標系へ変換するプログラムであり、図
5の(B)の部分は教示点の座標値をカメラ座標系から
画面座標系へ変換するプログラムである。
A function or command for converting the coordinate value of the teaching point from the robot coordinate system to the camera coordinate system and a function or command for converting the coordinate value of the teaching point from the camera coordinate system to the screen coordinate system are as follows: xc = TrnRobCam If two functions or commands of the form (xr, T), xp = Persp (xc) are prepared in advance, in the case of the robot program shown in FIG. 4, steps S104 and S105 in FIG.
The program shown in FIG. 5 is executed as a program preceding the image processing program generated in the step (1). 5A is a program for converting the coordinate value of the teaching point from the robot coordinate system to the camera coordinate system, and FIG. 5B is a program for converting the coordinate value of the teaching point from the camera coordinate system. This is a program for converting to the screen coordinate system.

【0034】図1のステップS104においては、ステ
ップS103において変換された各教示点の座標値およ
び各教示点の属する曲線の種別に基づいて、ビデオカメ
ラの画面内での直線や円弧等の曲線の位置を検出する位
置検出プログラムを生成する。図3に示すワークの場合
には、ワーク稜線が直線と円弧とに限定されるので、画
面内の限定された領域内に存在する直線を検出するルー
チン、および画面内の限定された領域内に存在する円弧
を検出するルーチンをあらかじめ用意しておき、図1の
ステップS102で求められた直線および円弧を画面内
から順次検出していくプログラムを生成する。すなわ
ち、図4に示すロボットプログラムの場合であれば、あ
らかじめ用意された上述したような専用の画像処理ルー
チンを呼び出し、直線L1から直線L4、および円弧C
1から円弧C4を順次検出するプログラムを生成する。
なお、本実施の形態における画像処理ルーチンでは、ワ
ーク稜線では明るさが急激に変化していることを利用し
て、あらかじめ指定されたワークの個体差の範囲を考慮
した領域内から直線や円弧等の曲線の正確な位置を検出
する。
In step S104 of FIG. 1, based on the coordinate values of each teaching point converted in step S103 and the type of curve to which each teaching point belongs, a curve such as a straight line or an arc in the video camera screen is displayed. Generate a position detection program for detecting a position. In the case of the work shown in FIG. 3, since the work ridgeline is limited to a straight line and a circular arc, a routine for detecting a straight line existing in a limited area on the screen, and a routine for detecting a straight line existing in a limited area on the screen. A routine for detecting an existing arc is prepared in advance, and a program for sequentially detecting the straight line and the arc determined in step S102 in FIG. 1 from the screen is generated. That is, in the case of the robot program shown in FIG. 4, the dedicated image processing routine prepared as described above prepared in advance is called, and the straight line L1 to the straight line L4 and the arc C
A program for sequentially detecting the arc C4 from 1 is generated.
In the image processing routine according to the present embodiment, the fact that the brightness sharply changes at the work ridge line is used, and a straight line, a circular arc, or the like is selected from an area in which the range of the individual difference of the work specified in advance is considered. The exact position of the curve is detected.

【0035】以下、画面内の限定された領域内に存在す
る直線または円弧を検出するルーチンの詳細について説
明する。
The details of the routine for detecting a straight line or an arc present in a limited area on the screen will be described below.

【0036】まず、画面内の限定された領域内に存在す
る直線を検出するルーチンについて図6により説明す
る。ここで、画面内の限定された領域とは、両端点が指
定された直線(線分)のまわりのある指定された距離だ
けの幅を持つ領域であり、その形状は例えば長方形であ
る。なお、距離の指定に関してはワークの個体差を考慮
してその範囲をユーザがあらかじめ指定しておく。
First, a routine for detecting a straight line existing in a limited area on the screen will be described with reference to FIG. Here, the limited area in the screen is an area in which both end points have a width of a specified distance around a specified straight line (line segment), and its shape is, for example, a rectangle. Note that the user specifies the range in advance in consideration of the individual difference of the work.

【0037】画面内の限定された領域が設定された場合
には、図6に示すように、まずその領域内についてエッ
ジ強調処理を行う(ステップS201)。図7にエッジ
強調処理の具体例を示す。図7(a)はビデオカメラに
より撮影された画像の全体を示す図であり、図7(b)
は図7(a)に示した画像の全体に対してエッジ強調処
理を行った結果を示している。なお、図6のステップS
201においては、例えば図7(a)中の点線で囲まれ
た領域についてエッジ強調処理を行う。ここで、エッジ
強調処理とは領域内の各画素について次式(3)のよう
なフィルタリング計算を行うことを意味する。
When a limited area in the screen is set, first, as shown in FIG. 6, edge enhancement processing is performed on the area (step S201). FIG. 7 shows a specific example of the edge enhancement processing. FIG. 7A is a diagram showing an entire image captured by a video camera, and FIG.
7A shows the result of performing the edge enhancement processing on the entire image shown in FIG. Note that step S in FIG.
In 201, for example, edge enhancement processing is performed on a region surrounded by a dotted line in FIG. Here, the edge enhancement processing means performing a filtering calculation as in the following equation (3) for each pixel in the area.

【0038】[0038]

【数3】 上式(3)において、filter[i][j]はフィ
ルタのパターンであり、本実施の形態ではエッジの傾き
に垂直な方向に傾けたガウシアン関数を微分したもの
(DoG:Derivative of Gaussian)とする。なお、エ
ッジの傾きは図1のステップS103までに算出された
線分の両端点の座標値から算出する。このようなエッジ
強調処理を行うことにより、図7(b)に示すようにエ
ッジ上の画素の値は大きくなり、それ以外の画素の値は
小さくなる。
[Equation 3] In the above equation (3), filter [i] [j] is a filter pattern. In the present embodiment, a filter obtained by differentiating a Gaussian function inclined in a direction perpendicular to the edge inclination (DoG: Derivative of Gaussian) I do. The inclination of the edge is calculated from the coordinate values of both end points of the line segment calculated up to step S103 in FIG. By performing such edge enhancement processing, the value of the pixel on the edge increases as shown in FIG. 7B, and the values of the other pixels decrease.

【0039】エッジ強調処理が施された画像が得られた
ら、直線の方程式をハフ(Hough )変換により求める。
ハフ変換は、直線や楕円等の方程式を求める代表的な手
法の1つであり、ノイズのある画面からも安定して直線
や楕円等を検出できるという特徴を有している。
When an image on which edge enhancement processing has been performed is obtained, the equation of a straight line is obtained by Hough transformation.
The Hough transform is one of the typical methods for obtaining equations such as a straight line and an ellipse, and has a feature that a straight line, an ellipse, and the like can be detected stably even on a screen having noise.

【0040】ハフにより提案された直線検出用のハフ変
換は、直線を傾きaおよび切片bの2つのパラメータ
(a,b)により、 y=ax+b … (4) と表現し、特徴点(Xi ,Yi )が与えられたときに、
直線のパラメータ(a,b)によって張られるパラメー
タ空間に、 b=Yi −aXi … (5) により表される軌跡を描くようにする。そして、全ての
特徴点について軌跡を描いた後、パラメータ空間中で多
くの軌跡が交わる点を抽出することにより、その点に対
応する直線が画像空間中に存在するものとみなす。
The Hough transform proposed by Hough for straight line detection expresses a straight line as y = ax + b (4) using two parameters (a, b) of a slope a and an intercept b, and expresses a feature point (X i , Y i ),
A locus represented by b = Y i −aX i (5) is drawn in a parameter space spanned by the straight line parameters (a, b). Then, after trajectories are drawn for all the feature points, a point where many trajectories intersect is extracted in the parameter space, and a straight line corresponding to the point is regarded as existing in the image space.

【0041】なお、実際にプログラムによりハフ変換を
行う場合には、パラメータ空間を「セル」と呼ばれる多
数の要素に分解し、各特徴点についての軌跡を描く際
に、パラメータ空間で軌跡が通過する各セルの投票度数
をエッジ強調処理が施された結果の値だけ増やすことに
より、よりエッジらしい点にはより大きな重みが与えら
れるようにする。このような処理が図6のステップS2
02の処理である。
When the Hough transform is actually performed by a program, the parameter space is decomposed into a large number of elements called "cells", and when a trajectory is drawn for each feature point, the trajectory passes in the parameter space. By increasing the voting frequency of each cell by the value of the result of the edge emphasizing process, points that are more edge-like are given greater weight. Such processing is performed in step S2 of FIG.
02.

【0042】画面内の限定された領域内の全ての特徴点
についての投票が終了した後、投票度数が最も大きい値
を有するセルを抽出することにより、直線のパラメータ
(a,b)が求められる(ステップS203)。なお、
ステップS203においては、領域内の全ての特徴点に
ついて投票を行うのではなく、ステップS201におい
てエッジ強調処理が施されてよりエッジらしい点である
とみなされた特徴点のみに限定して投票を行うようにし
てもよい。
After the voting for all the feature points in the limited area on the screen is completed, the cell having the largest voting frequency is extracted to obtain the straight line parameters (a, b). (Step S203). In addition,
In step S203, voting is not performed for all the feature points in the region, but is limited to only the feature points that have been subjected to the edge enhancement process in step S201 and are considered to be more likely to be edges. You may do so.

【0043】上式(4)のようにパラメータ(a,b)
により画像空間中の直線を表現すると、画面内で直線が
垂直に近づくにつれてこれらのパラメータの値が無限大
になるので、パラメータ空間が有界にならない。この問
題を解決するための一般的な方法は、画像空間中の直線
を垂角θと原点からの符号付き距離ρを用いて、 ρ=xcosθ+ysinθ … (6) と表現し、パラメータ空間としては(ρ,θ)空間を用
いることである。図8(a)は直線に対する(ρ,θ)
パラメータ空間の設定の仕方を示し、図8(b)はハフ
変換による直線のパラメータ(ρ,θ)の決定の仕方を
示す。本実施の形態においては、両端点が指定された直
線(線分)のまわりの長方形の領域内の各点について、
その点でのエッジ強調処理が施された結果の値を、上式
(6)により計算される(ρ,θ)パラメータ空間での
直線上の各セルについて加算する。これにより、エッジ
強調処理が施された結果の値が大きい点をより多く通る
直線が選び出されることになる。
As shown in the above equation (4), the parameters (a, b)
When the straight line in the image space is represented by, the values of these parameters become infinite as the straight line approaches the vertical in the screen, so that the parameter space is not bounded. A general method for solving this problem is to express a straight line in the image space as ρ = xcos θ + ysin θ (6) using a perpendicular angle θ and a signed distance ρ from the origin. (ρ, θ) space. FIG. 8A shows (ρ, θ) for a straight line.
FIG. 8B shows how to set a parameter space (ρ, θ) by Hough transform. In the present embodiment, for each point in a rectangular area around a straight line (line segment) whose end points are specified,
The value resulting from the edge enhancement processing at that point is added for each cell on a straight line in the (ρ, θ) parameter space calculated by the above equation (6). As a result, a straight line that passes through more points having a large value as a result of the edge enhancement processing is selected.

【0044】次に、画面内の限定された領域内に存在す
る円弧を検出するルーチンについて直線の場合と同様に
図6により説明する。円弧の場合には、未知の値は円弧
中心の座標値(x0,y0)および円弧の半径rの3つ
であるので、円弧中心の座標値(x0,y0)および半
径rの値をパラメータとする3次元の(x0,y0,
r)パラメータ空間において上述した直線の場合と同様
の投票を行うことにより、円弧の方程式すなわち円弧の
位置を決定する。
Next, a routine for detecting an arc present in a limited area on the screen will be described with reference to FIG. 6, as in the case of a straight line. In the case of an arc, three unknown values are the coordinate value (x0, y0) of the center of the arc and the radius r of the arc. Therefore, the coordinates (x0, y0) and the value of the radius r of the arc center are used as parameters. (X0, y0,
r) By voting in the parameter space in the same manner as in the case of the straight line, the arc equation, that is, the position of the arc is determined.

【0045】エッジ強調処理は上述した直線の場合と同
様に、DoGフィルタを図1のステップS103までに
算出された円弧の両端点の座標値から算出したエッジの
傾きと直角な方向に設定したフィルタをかける(ステッ
プS201)。ただし、円弧の場合には、直線の場合と
は異なりエッジの傾きが連続的に変化していくので、各
点のエッジ強調処理を行う際に、ステップS103まで
に算出された教示点の座標値から算出できる円弧の方程
式を用いて、その円弧上の特定の点近傍での円弧の傾き
を計算し、DoGフィルタの傾きを設定している。
In the edge enhancement processing, as in the case of the straight line described above, a filter in which the DoG filter is set in a direction perpendicular to the inclination of the edge calculated from the coordinate values of both ends of the arc calculated up to step S103 in FIG. (Step S201). However, in the case of a circular arc, unlike the case of a straight line, the slope of the edge changes continuously. Therefore, when performing the edge enhancement processing of each point, the coordinate values of the teaching point calculated up to step S103 are used. The gradient of the circular arc near a specific point on the circular arc is calculated using the circular arc equation that can be calculated from the above equation, and the gradient of the DoG filter is set.

【0046】エッジ強調処理が行われた後は、限定され
た領域内の各点Pについて次のような処理を行う。すな
わち、(x0,y0,r)パラメータ空間の(x0,y
0)平面の各セルについて、点Pが円弧上の点であると
すると半径がいくらになるかを次式(7)により計算
し、該当するパラメータ空間のセル(x0,y0,
o2)の投票度数を点Pでのエッジ強調処理が施された
結果の値だけ増やす(ステップS202)。なお、ro2
は(x0,y0,r)パラメータ空間で次式(7)によ
り計算されたro を含むセルの代表値である。
After the edge enhancement processing is performed, the following processing is performed on each point P in the limited area. That is, (x0, y0) in the (x0, y0, r) parameter space
0) For each cell on the plane, if the point P is a point on an arc, the radius is calculated by the following equation (7), and the cell (x0, y0,
The voting frequency of r o2 ) is increased by the value of the result of the edge emphasis processing at the point P (step S202). Note that r o2
Is the representative value of the cell containing ro calculated by the following equation (7) in the (x0, y0, r) parameter space.

【数4】 (Equation 4)

【0047】画面内の限定された領域内の全ての特徴点
についての投票が終了した後、投票度数が最も大きい値
を有するセルを抽出することにより、円弧のパラメータ
(x0,y0,r)が求められる(ステップS20
3)。図9(a)は円弧に対する(x0,y0,r)パ
ラメータ空間の設定の仕方を示し、図9(b)はハフ変
換による円弧のパラメータ(x0,y0,r)の決定の
仕方を示す。
After the voting for all the feature points in the limited area on the screen is completed, the cell having the largest voting frequency is extracted, so that the parameter (x0, y0, r) of the arc is changed. Is obtained (Step S20)
3). FIG. 9A shows how to set the (x0, y0, r) parameter space for the arc, and FIG. 9B shows how to determine the arc parameter (x0, y0, r) by Hough transform.

【0048】なお、上述した円弧のパラメータの算出方
法は、ビデオカメラがワークの真上に設置されている場
合の方法であり、ビデオカメラがワークの真上に設置さ
れていない場合には円弧が楕円として見えるので、次の
ようにして円弧のパラメータを求める。
The above-described method of calculating the parameters of the arc is a method in the case where the video camera is installed directly above the work, and the method in the case where the video camera is not installed directly above the work. Since it looks like an ellipse, the parameters of the arc are obtained as follows.

【0049】まずはじめに、図1のステップS102に
おいて算出されたロボット座標系での円弧上の3点の座
標値から3点の存在する平面の方程式、すなわち次式
(8)のパラメータa,b,c,dの値を算出する。
First, from the coordinate values of the three points on the arc in the robot coordinate system calculated in step S102 of FIG. 1, an equation of a plane on which three points exist, that is, parameters a, b, and Calculate the values of c and d.

【0050】ax+by+cz+d=0 … (8) 上式(8)において、パラメータa,b,c,dの値は
ロボット座標系での値であるので、以後の計算のために
これらの値をカメラ座標系での値に変換しておく。ま
た、上述した3点を通る円弧の中心位置は上述したワー
ク平面上に存在するはずであるので、円弧の中心位置か
ら3点までの距離は等しいという関係を表す2つの方程
式、および円弧の中心は既知のワーク平面上にあるとい
う関係を表す方程式により円弧中心の座標値を算出する
ことができ、これにより円弧の半径も容易に算出するこ
とができる。なお、円弧中心の座標値を(xcp,ycp
cp)とすると、次式(9)により円弧中心の座標値を
算出することができる。
Ax + by + cz + d = 0 (8) In the above equation (8), the values of the parameters a, b, c, and d are values in the robot coordinate system. Convert to the value in the system. Also, since the center position of the arc passing through the three points described above must exist on the work plane described above, two equations expressing the relationship that the distance from the center position of the arc to the three points are equal, and the center of the arc Can calculate the coordinate value of the center of the arc by an equation representing the relationship that the arc is located on the known work plane, whereby the radius of the arc can be easily calculated. The coordinates of the center of the arc are represented by (x cp , y cp ,
z cp ), the coordinate value of the center of the arc can be calculated by the following equation (9).

【数5】 (Equation 5)

【0051】このようにして算出された円弧の方程式か
ら、その円弧上の点の座標値を1度ごとに360点につ
いて計算し、各点について画面座標系での座標値に変換
して配列xfcirleに保存する。
From the arc equation thus calculated, the coordinate values of the points on the arc are calculated for 360 points each degree, and each point is converted into a coordinate value in the screen coordinate system, and an array xfcirle is obtained. To save.

【0052】次に、未知の値としてのカメラ座標系での
円弧中心の座標値(x0,y0)および円弧の半径rを
パラメータとする3次元の(x0,y0,r)パラメー
タ空間において上述した直線および円弧の場合と同様の
投票を行うことにより、円弧の方程式すなわち円弧の位
置が決定される。
Next, the three-dimensional (x0, y0, r) parameter space using the coordinates (x0, y0) of the center of the arc in the camera coordinate system as unknown values and the radius r of the arc as parameters is described above. By performing the same voting as in the case of the straight line and the arc, the equation of the arc, that is, the position of the arc is determined.

【0053】エッジ強調処理は上述した直線および円弧
の場合と同様に、DoGフィルタをステップS103ま
でに算出された円弧の両端点の座標値から算出したエッ
ジの傾きと直角な方向に設定したフィルタをかける(ス
テップS201)。なお、エッジの傾きが連続的に変化
していくのに対応したDoGフィルタの傾きの設定は、
各点でのフィルタの傾きの設定の際に上述した配列xf
cirleの中でその点に最も近傍に位置する座標値を
探し、その前後の配列要素の値から円弧の傾きを算出し
て、それと直角に設定する。
In the edge enhancement processing, as in the case of the straight line and the arc described above, a filter in which the DoG filter is set in a direction perpendicular to the inclination of the edge calculated from the coordinate values of both ends of the arc calculated up to step S103 is used. Apply (step S201). The setting of the slope of the DoG filter corresponding to the continuously changing slope of the edge is as follows.
The array xf described above when setting the filter inclination at each point
The coordinate value closest to the point is searched for in the circle, the slope of the arc is calculated from the values of the array elements before and after the coordinate value, and the inclination is set at a right angle to that.

【0054】エッジ強調処理が行われた後は、限定され
た領域内の各点Pについて次のような処理を行う。すな
わち、各点Pについてその画面座標系での座標値と平面
の方程式とからカメラ座標系での三次元座標値を算出す
る。(x0,y0,r)パラメータ空間の(x0,y
0)平面の各セルについて、点Pが円弧上の点であると
すると半径がいくらになるかを次式(10)により計算
し、該当するパラメータ空間のセル(x0,y0,
o2)の投票度数を点Pでのエッジ強調処理が行われた
結果の値だけ増やす(ステップS202)。なお、ro2
は(x0,y0,r)パラメータ空間で次式(10)に
より計算されたro を含むセルの代表値である。また、
次式(10)におけるz0の値は(x0,y0)の値と
平面の方程式とから算出される。
After the edge enhancement processing is performed, the following processing is performed for each point P in the limited area. That is, for each point P, a three-dimensional coordinate value in the camera coordinate system is calculated from the coordinate value in the screen coordinate system and the equation of the plane. (X0, y0, r) (x0, y) in parameter space
0) For each cell on the plane, if the point P is a point on an arc, the radius is calculated by the following equation (10), and the cell (x0, y0,
The vote frequency of r o2 ) is increased by the value of the result of the edge emphasizing process at the point P (step S202). Note that r o2
Is a representative value of a cell including ro calculated in the (x0, y0, r) parameter space by the following equation (10). Also,
The value of z0 in the following equation (10) is calculated from the value of (x0, y0) and a plane equation.

【数6】 (Equation 6)

【0055】画面内の限定された領域内の全ての特徴点
についての投票が終了した後、投票度数が最も大きい値
を有するセルを抽出することにより、円弧のパラメータ
(x0,y0,r)が求められる(ステップS20
3)。
After the voting for all the feature points in the limited area on the screen is completed, the cell having the largest voting frequency is extracted to obtain the parameter (x0, y0, r) of the arc. Is obtained (Step S20)
3).

【0056】なお、以上に説明した直線を検出するルー
チンおよび円弧を検出するルーチンについてはそれぞ
れ、 l=line(x1,x2,area), c=circle(x1,x2,x3,area) のような形式の関数またはコマンドを用意しておき、図
1のステップS104において位置検出プログラムを生
成する際に、対応する引数を指定して関数またはコマン
ドを順次呼び出すプログラムを生成する。これらの関数
またはコマンドにおいて、l,cはそれぞれ、算出され
た直線のパラメータ、円弧のパラメータを格納するため
の配列である。また、line()の引数であるx1,
x2はステップS103までに算出された線分の両端点
の画面座標系での(x,y)座標値であり、circl
e()の引数であるx1,x2,x3は同様にステップ
S103までに算出された円弧の両端点および途中の点
の画面座標系での(x,y)座標値である。なお、ar
eaは線分または円弧のまわりの画像処理が行われる領
域の幅であり、ワークの個体差等を考慮してマスタワー
クについてティーチングされたロボットプログラムの中
での教示点の座標値からワークごとに教示点の位置がど
の程度変動する可能性があるかを検討してユーザが設定
する。
The routine for detecting a straight line and the routine for detecting an arc described above are as follows: l = line (x1, x2, area) and c = circle (x1, x2, x3, area), respectively. A function or command of the format is prepared, and when a position detection program is generated in step S104 in FIG. 1, a program for sequentially calling the function or command by specifying a corresponding argument is generated. In these functions or commands, l and c are arrays for storing the calculated parameters of the straight line and the parameters of the arc, respectively. Also, x1, which is an argument of line (),
x2 is the (x, y) coordinate value in the screen coordinate system of both end points of the line segment calculated up to step S103, and circcl
x1, x2, and x3, which are the arguments of e (), are the (x, y) coordinate values in the screen coordinate system of the both end points and the intermediate points of the arc calculated up to step S103. Ar
ea is the width of an area where image processing around a line segment or an arc is performed, and for each work from the coordinate value of a teaching point in a robot program taught for a master work in consideration of individual differences of the work, etc. The user sets by considering how much the position of the teaching point may vary.

【0057】なお、図4に示すロボットプログラムの場
合には、直線L1から直線L4、円弧C1から円弧C4
までを検出する位置検出プログラムは図10に示すもの
となる。
In the case of the robot program shown in FIG. 4, the straight line L1 to the straight line L4, and the circular arc C1 to the circular arc C4
FIG. 10 shows a position detection program for detecting the position.

【0058】図10において、xp2,xp3等は図1
のステップS103までに算出された教示点P2,P3
の画面座標系での座標値である。なお、2本の直線の交
点を求める際に設定される直線を検出する領域(エッジ
検出領域1およびエッジ検出領域2)の具体例を図12
に示す。
In FIG. 10, xp2, xp3, etc.
Teaching points P2 and P3 calculated up to step S103
Are coordinate values in the screen coordinate system. FIG. 12 shows a specific example of an area (edge detection area 1 and edge detection area 2) for detecting a straight line set when obtaining the intersection of two straight lines.
Shown in

【0059】図1のステップS105においては、ステ
ップS104において生成された位置検出プログラムに
より検出される直線や円弧等の曲線の位置からステップ
S101およびステップS102において抽出された各
教示点のビデオカメラの画面内での実際の位置を算出す
る位置算出プログラムと、この位置算出プログラムによ
り算出される各教示点の画面座標系での座標値をロボッ
ト座標系での座標値に変換する座標変換プログラムとを
生成する。ここで、教示点の種別は上述したように、
(1)直線と直線との交点、(2)直線と円弧との境
界、および(3)円弧の途中の点の3通りに限定され
る。このため、これらの各場合について、 xo=clines(l1,l2,xp1,xp2,x
p3), xo=clinecircle(l1,c1,xp1,
xp2,xp3,xp4), xo=pcirle(c1,xp1,xp2) のような形式の関数またはコマンドを用意しておく。こ
れらの関数またはコマンドにおいて、xoは算出された
教示点の画面座標系での(x,y)座標値である。l
1,l2はステップS104において生成された位置検
出プログラムにより検出される直線のパラメータ(a,
b)または(ρ,θ)を含む配列であり、c1は同様に
位置検出プログラムにより検出される円弧の中心位置
(x0,y0)および半径の値rを含む配列である。ま
た、clines()におけるxp1,xp2,xp3
は引数で指定された2つの線分の端点の画面座標系での
座標値であり、clinecircle()におけるx
p1,xp2,xp3,xp4は引数で指定された線分
の両端点と円弧の両端点および途中の点の画面座標系で
の座標値であり、pcirle()におけるxp1,x
p2は引数で指定された円弧の両端点の画面座標系での
座標値であり、全ての引数で指定した座標値はステップ
S103において変換して求められた値を用いる。これ
らの引数は、ステップS102において各教示点が含ま
れる動作命令の種別から各教示点が直線や円弧等の曲線
のうちどのような曲線に属するかを判別するとともに、
この判別された曲線における端点や途中の点等の曲線の
範囲を特定する教示点の座標値を求めているので、容易
に設定することが可能である。なお、図4に示すロボッ
トプログラムの場合には、直線や円弧等の曲線の位置か
らロボットプログラムの中から読み出された各教示点の
ビデオカメラの画面内での実際の位置を算出する位置算
出プログラムは図11に示すものとなる。
In step S105 of FIG. 1, the video camera screen of each teaching point extracted in steps S101 and S102 from the position of a curve such as a straight line or an arc detected by the position detection program generated in step S104. Generates a position calculation program that calculates the actual position in the robot, and a coordinate conversion program that converts the coordinate values in the screen coordinate system of each teaching point calculated by the position calculation program into the coordinate values in the robot coordinate system. I do. Here, the type of the teaching point is, as described above,
It is limited to three types: (1) the intersection of a straight line and a straight line, (2) the boundary between a straight line and an arc, and (3) a point in the middle of the arc. Therefore, for each of these cases, xo = clines (l1, l2, xp1, xp2, x
p3), xo = clinecircle (l1, c1, xp1,
A function or a command of a format such as xp2, xp3, xp4), xo = pcirle (c1, xp1, xp2) is prepared. In these functions or commands, xo is the (x, y) coordinate value of the calculated teaching point in the screen coordinate system. l
1, 12 are the parameters (a, a) of the straight line detected by the position detection program generated in step S104.
b) or an array containing (ρ, θ), and c1 is an array containing the center position (x0, y0) and radius value r of the arc also detected by the position detection program. Also, xp1, xp2, xp3 in the clines ()
Is the coordinate value in the screen coordinate system of the end point of the two line segments specified by the argument, and x in clincircle ()
p1, xp2, xp3, xp4 are coordinate values in the screen coordinate system of both end points of the line segment specified by the argument, both end points of the arc, and intermediate points, and xp1, x in pcirle ()
p2 is the coordinate value in the screen coordinate system of both ends of the arc specified by the argument, and the coordinate value specified by all the arguments uses the value obtained by conversion in step S103. These arguments determine in step S102 from the type of the operation command that includes each teaching point, to what kind of curve each of the teaching points belongs to a curve such as a straight line or an arc.
Since the coordinate value of the teaching point for specifying the range of the curve such as the end point or the halfway point in the determined curve is obtained, the coordinate value can be easily set. In the case of the robot program shown in FIG. 4, position calculation for calculating the actual position on the video camera screen of each teaching point read from the robot program from the position of a curve such as a straight line or an arc. The program is as shown in FIG.

【0060】図1のステップS105においてはさら
に、図11に示す位置算出プログラムにより算出される
画面座標系でのxf2〜xf13の値をカメラ座標系で
の値に変換し、これらの変換された値をロボット座標系
に変換する座標変換プログラムを生成する。ここで、教
示点の座標値を画面座標系からカメラ座標系へ変換する
関数またはコマンド、および教示点の座標値をカメラ座
標系からロボット座標系へ変換する関数またはコマンド
として、 xc=TrnCam(xf,plane), xr=TrnCamRob(xc,T) のような形式の2つの関数またはコマンドをあらかじめ
用意しておく。これらの関数またはコマンドにおいて、
planeはその点がのっている平面の方程式の係数ベ
クトルであり、点が円弧の一部であれば、平面の方程式
は上述したように算出されているので、その値を用い
る。一方、点が線分の一部であれば、線分の両端点およ
びステップS101で求められた教示点の中での隣接点
も含めて3点とし、平面の方程式を算出して用いる。ま
た、Tはカメラ座標系からロボット座標系への同次表現
の変換行列である。図4に示すロボットプログラムの場
合には、教示点の画面座標系での座標値をロボット座標
系での座標値に変換する座標変換プログラムは図13に
示すものとなる。なお、図13の(E)の部分は教示点
の座標値を画面座標系からカメラ座標系へ変換するプロ
グラムであり、図13の(F)の部分は教示点の座標値
をカメラ座標系からロボット座標系へ変換するプログラ
ムである。
In step S105 of FIG. 1, the values of xf2 to xf13 in the screen coordinate system calculated by the position calculation program shown in FIG. 11 are further converted to values in the camera coordinate system, and these converted values are converted. Generates a coordinate conversion program for converting into a robot coordinate system. Here, a function or command for converting the coordinate value of the teaching point from the screen coordinate system to the camera coordinate system and a function or command for converting the coordinate value of the teaching point from the camera coordinate system to the robot coordinate system are as follows: xc = TrnCam (xf , Plane), xr = TrnCamRob (xc, T) Two functions or commands of the following format are prepared in advance. In these functions or commands,
plane is a coefficient vector of the equation of the plane on which the point is placed. If the point is a part of an arc, the value of the plane equation is calculated as described above, and the value is used. On the other hand, if the point is a part of the line segment, three points including both end points of the line segment and adjacent points among the teaching points obtained in step S101 are used, and a plane equation is calculated and used. T is a transformation matrix of a homogeneous representation from the camera coordinate system to the robot coordinate system. In the case of the robot program shown in FIG. 4, the coordinate conversion program for converting the coordinate values of the teaching point in the screen coordinate system into the coordinate values in the robot coordinate system is as shown in FIG. The part (E) of FIG. 13 is a program for converting the coordinate value of the teaching point from the screen coordinate system to the camera coordinate system, and the part (F) of FIG. 13 converts the coordinate value of the teaching point from the camera coordinate system. This is a program for converting to the robot coordinate system.

【0061】図14は本発明によるロボットプログラム
自動修正方法の一実施の形態を説明するための図であ
る。図14に示すように、本発明によるロボットプログ
ラム自動修正方法は、上述したロボットのための画像処
理プログラム自動生成方法により生成された画像処理プ
ログラムを用いて、ビデオカメラにより撮影された画像
から実際のワークの教示点の座標値を求め、さらにこの
求められた実際のワークの教示点の座標値に基づいて、
ロボットプログラムにあらかじめ内蔵された各教示点の
座標値を修正するものである。なお、ステップS301
〜ステップS305のそれぞれの処理は図1のステップ
S101〜ステップS105の対応するそれぞれの処理
と同一であるので、その詳細な説明は省略する。
FIG. 14 is a diagram for explaining an embodiment of the robot program automatic correction method according to the present invention. As shown in FIG. 14, the robot program automatic correction method according to the present invention uses an image processing program generated by the above-described image processing program automatic generation method for a robot to convert an image captured by a video camera into an actual image. The coordinate value of the teaching point of the work is obtained, and further, based on the obtained coordinate value of the teaching point of the actual work,
This is for correcting the coordinate value of each teaching point previously stored in the robot program. Step S301
Steps S305 to S305 are the same as the corresponding steps S101 to S105 in FIG. 1, and a detailed description thereof will be omitted.

【0062】図14に示すように、まず、あらかじめマ
スタワークについてティーチングされたロボットプログ
ラムの中から溶接作業や、面取り作業等の作業対象であ
るワークとの接触作業を行う際のロボット座標系に基づ
く動作命令を抽出し、この抽出された動作命令から正確
な位置計測が必要な教示点を抽出する(ステップS30
1)。
As shown in FIG. 14, first, based on a robot coordinate system for performing a contact work with a work to be worked, such as a welding work or a chamfering work, from a robot program which has been previously taught for a master work. An operation command is extracted, and a teaching point requiring accurate position measurement is extracted from the extracted operation command (step S30).
1).

【0063】続いて、ステップS301において抽出さ
れた各教示点について、それぞれの教示点を含む動作命
令の種別から各教示点が直線や円弧等の曲線のうちどの
ような曲線に属するかを判別するとともに、この判別さ
れた曲線における端点や途中の点等の曲線の範囲を特定
する教示点の座標値をロボットプログラムの中から読み
出す(ステップS302)。
Subsequently, for each of the teaching points extracted in step S301, it is determined from the type of the operation command including each of the teaching points to which curve among the curves, such as a straight line and a circular arc, each teaching point belongs. At the same time, the coordinate value of the teaching point for specifying the range of the curve such as the end point or the halfway point in the determined curve is read from the robot program (step S302).

【0064】その後、ステップS301において抽出さ
れた教示点のロボット座標系での座標値、およびステッ
プS302において抽出されたその他の教示点のロボッ
ト座標系での座標値を画面座標系での座標値に変換する
(ステップS303)。すなわち、ロボットプログラム
で記述されている座標値はロボット座標系での座標値で
あるので、これらの座標値をロボット座標系とカメラ座
標系との変位量を用いて画面座標系での座標値に変換す
る。なお、ロボット座標系とカメラ座標系との変位量は
あらかじめユーザが設定しておく。
Thereafter, the coordinate values in the robot coordinate system of the teaching point extracted in step S301 and the coordinate values in the robot coordinate system of the other teaching points extracted in step S302 are converted into coordinate values in the screen coordinate system. Conversion is performed (step S303). That is, since the coordinate values described in the robot program are coordinate values in the robot coordinate system, these coordinate values are converted into coordinate values in the screen coordinate system using the displacement amount between the robot coordinate system and the camera coordinate system. Convert. The displacement between the robot coordinate system and the camera coordinate system is set in advance by the user.

【0065】そして、ステップS303において変換さ
れた各教示点の座標値および各教示点の属する曲線の種
別に基づいてビデオカメラの画面内での直線や円弧等の
曲線の位置を検出する位置検出プログラムを生成すると
ともに(ステップS304)、ステップS304におい
て生成された位置検出プログラムにより検出される直線
や円弧等の曲線の位置からステップS101およびステ
ップS102において抽出された各教示点のビデオカメ
ラの画面内での実際の位置を算出する位置算出プログラ
ムと、この位置算出プログラムにより算出される各教示
点の画面座標系での座標値をロボット座標系での座標値
へ変換する座標変換プログラムとを生成する(ステップ
S305)。
Then, a position detecting program for detecting the position of a curve such as a straight line or an arc on the video camera screen based on the coordinate value of each teaching point converted in step S303 and the type of the curve to which each teaching point belongs. Is generated (step S304), and the teaching point extracted in steps S101 and S102 from the position of a curve such as a straight line or an arc detected by the position detection program generated in step S304 is displayed on the video camera screen. And a coordinate conversion program for converting the coordinate values in the screen coordinate system of each teaching point calculated by the position calculation program into the coordinate values in the robot coordinate system. Step S305).

【0066】最後に、ステップS304およびステップ
S305において生成された画像処理プログラムを実行
することにより、ビデオカメラにより撮影された画像か
ら実際のワークの教示点の座標値を求める。そして、こ
のようにして求められた実際のワークの教示点の座標値
に基づいて、あらかじめロボットプログラムに内蔵され
た各教示点の座標値を修正する(ステップS306)。
Finally, by executing the image processing program generated in steps S304 and S305, the coordinate values of the actual work teaching point are obtained from the image taken by the video camera. Then, based on the coordinate values of the teaching points of the actual work thus obtained, the coordinate values of each teaching point built in the robot program are corrected in advance (step S306).

【0067】図4に示すロボットプログラムの場合に
は、図15に示すように、ロボットプログラムの13行
目と14行目との間に、生成された画像処理プログラム
(A)〜(F)(図5、図10、図11および図13参
照)と、この画像処理プログラムを実行して求められた
実際のワークの教示点xr2〜xr13の座標値をあら
かじめ内蔵された対応する教示点p2〜p13の座標値
として代入するプログラム(図15の(G)の部分参
照)とを組み込むようにする。なお、図15に示すよう
に生成された画像処理プログラムを直接ロボットプログ
ラムの中に組み込む他、画像処理プログラムをロボット
プログラムとは独立して実行し、その実行結果として得
られた座標値によってロボットプログラムの中のあらか
じめ内蔵された教示点の座標値を修正するようにしても
よい。
In the case of the robot program shown in FIG. 4, as shown in FIG. 15, the generated image processing programs (A) to (F) ( The coordinate values of the teaching points xr2 to xr13 of the actual work obtained by executing the image processing program are stored in the corresponding teaching points p2 to p13. (See (G) in FIG. 15). The image processing program generated as shown in FIG. 15 is directly incorporated into the robot program, and the image processing program is executed independently of the robot program, and the coordinate values obtained as a result of execution execute the robot program. The coordinate values of the teaching points stored in advance may be corrected.

【0068】このように、本発明のロボットプログラム
自動修正方法の一実施の形態によれば、ステップS30
1〜ステップS305により生成された画像処理プログ
ラムを用いて、ビデオカメラにより撮影された画像から
実際のワークの教示点の座標値を各ワークごとに求め、
さらにこの求められたワークの実際の教示点の座標値に
基づいて、あらかじめ図4に示すようなロボットプログ
ラムに内蔵された各教示点の座標値を自動的に修正する
(ステップS306)ので、1つのマスタワークについ
てティーチングを行ってロボットプログラムを作成する
だけでワークごとの個体差を吸収するようにロボットプ
ログラムを自動的に修正することができる。
As described above, according to the embodiment of the robot program automatic correction method of the present invention, step S30 is performed.
1 to use the image processing program generated in step S305 to determine the coordinate values of the teaching points of the actual work for each work from the image taken by the video camera;
Further, based on the obtained coordinate values of the actual teaching points of the work, the coordinate values of the teaching points incorporated in the robot program as shown in FIG. 4 are automatically corrected in advance (step S306). The robot program can be automatically modified so as to absorb the individual differences between the works only by performing teaching on one master work and creating a robot program.

【0069】[0069]

【発明の効果】以上説明したように、本発明によれば、
マスタワークについてティーチングされたロボットプロ
グラムからワークごとの個体差に対応するための画像処
理プログラムを自動的に生成することができる。また、
このようにして生成された画像処理プログラムを用い
て、ロボットプログラムにあらかじめ内蔵された各教示
点の座標値を自動的に修正するので、1つのマスタワー
クについてティーチングを行ってロボットプログラムを
作成するだけでワークごとの個体差を吸収するようにロ
ボットプログラムを自動的に修正することができ、この
ため仮に画像処理に関しての十分な知識を有しない人で
あっても容易に画像処理を利用してワークの個体差を吸
収した形でロボットを動作させることができる。
As described above, according to the present invention,
An image processing program for coping with individual differences for each work can be automatically generated from the robot program taught for the master work. Also,
Using the image processing program generated in this way, the coordinate values of each teaching point previously stored in the robot program are automatically corrected, so that teaching is performed for one master work and a robot program is created. Can automatically modify the robot program to absorb individual differences for each work, so even if a person who does not have enough knowledge about image processing can easily use the The robot can be operated in a form absorbing the individual difference of the robot.

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

【図1】本発明によるロボットのための画像処理プログ
ラム自動生成方法の一実施の形態を説明するための図で
ある。
FIG. 1 is a diagram for explaining an embodiment of an image processing program automatic generation method for a robot according to the present invention.

【図2】本発明によるロボットのための画像処理プログ
ラム自動生成方法を実現する装置の一実施の形態を示す
図である。
FIG. 2 is a diagram showing an embodiment of an apparatus for realizing an automatic image processing program generation method for a robot according to the present invention.

【図3】ワークの一例およびそのワークの教示点を示す
図である。
FIG. 3 is a diagram illustrating an example of a work and teaching points of the work.

【図4】図3に示すワークのエッジの面取り作業を行う
ためのロボットプログラムを示す図である。
4 is a diagram showing a robot program for performing a chamfering operation of an edge of the work shown in FIG. 3;

【図5】教示点の座標値をロボット座標系からカメラ座
標系へ変換するプログラム、および教示点の座標値をカ
メラ座標系から画面座標系へ変換するプログラムを示す
図である。
FIG. 5 is a diagram showing a program for converting a coordinate value of a teaching point from a robot coordinate system to a camera coordinate system and a program for converting the coordinate value of a teaching point from a camera coordinate system to a screen coordinate system.

【図6】画面内の限定された領域内に存在する直線や円
弧等の曲線を検出するルーチンを説明するための図であ
る。
FIG. 6 is a diagram for explaining a routine for detecting a curve such as a straight line or an arc present in a limited area on the screen.

【図7】ビデオカメラにより撮影された画像に対するエ
ッジ強調処理の具体例を示す図である。
FIG. 7 is a diagram illustrating a specific example of edge enhancement processing on an image captured by a video camera.

【図8】直線に対する(ρ,θ)パラメータ空間の設定
の仕方(図8(a))、およびハフ変換による直線のパ
ラメータ(ρ,θ)の決定の仕方(図8(b))を示す
図である。
FIG. 8 shows how to set a (ρ, θ) parameter space for a straight line (FIG. 8A) and how to determine a straight line parameter (ρ, θ) by Hough transform (FIG. 8B). FIG.

【図9】円弧に対する(x0,y0,r)パラメータ空
間の設定の仕方(図9(a))、およびハフ変換による
円弧のパラメータの決定の仕方(図9(b))を示す図
である。
9 is a diagram showing how to set an (x0, y0, r) parameter space for an arc (FIG. 9A) and how to determine an arc parameter by Hough transform (FIG. 9B). .

【図10】図4に示すロボットプログラムに対して作成
される位置検出プログラムを示す図である。
FIG. 10 is a diagram showing a position detection program created for the robot program shown in FIG.

【図11】図4に示すロボットプログラムに対して作成
される位置算出プログラムを示す図である。
FIG. 11 is a diagram showing a position calculation program created for the robot program shown in FIG.

【図12】2本の直線の交点を求める際に設定される直
線を検出する領域の具体例を示す図である。
FIG. 12 is a diagram showing a specific example of a region for detecting a straight line set when obtaining an intersection of two straight lines.

【図13】図4に示すロボットプログラムに対して作成
される座標変換プログラムを示す図である。
FIG. 13 is a diagram showing a coordinate conversion program created for the robot program shown in FIG. 4;

【図14】本発明によるロボットプログラム自動修正方
法の一実施の形態を説明するための図である。
FIG. 14 is a diagram for explaining an embodiment of a robot program automatic correction method according to the present invention.

【図15】本発明によるロボットのための画像処理プロ
グラム自動生成方法により生成された画像処理プログラ
ムを組み込んだロボットプログラムを示す図である。
FIG. 15 is a diagram showing a robot program incorporating an image processing program generated by an automatic image processing program generation method for a robot according to the present invention.

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

1 ビデオカメラ 2 画像入力ボード 3 パーソナルコンピュータ 4 ロボットコントローラ 5 ロボット 6 ワーク 1 Video camera 2 Image input board 3 Personal computer 4 Robot controller 5 Robot 6 Work

Claims (5)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】ワークとの接触を伴う作業を行うロボット
のための画像処理プログラム自動生成方法において、 あらかじめマスタワークについてティーチングされたロ
ボットプログラムの中からワークとの接触作業を行う際
のロボット座標系に基づく動作命令を抽出し、この抽出
された動作命令からあらかじめ内蔵された教示点を抽出
する第1の工程と、 この第1の工程により抽出された各教示点について、そ
れぞれの教示点を含む動作命令の種別から各教示点がど
のような曲線に属するかを判別するとともに、この判別
された曲線の範囲を特定する教示点の座標値を前記ロボ
ットプログラムの中から読み出す第2の工程と、 この第2の工程により読み出された各教示点のロボット
座標系での座標値を、あらかじめ定義された前記ワーク
を撮影するためのビデオカメラの座標系とロボット座標
系との変位量を用いて前記ビデオカメラの画面内での座
標値に変換する第3の工程と、 この第3の工程により変換された各教示点の座標値およ
び各教示点の属する曲線の種別に基づいて、前記ビデオ
カメラにより撮影された画像から前記各教示点に対応す
る曲線の位置を検出してこれらの交点としての各教示点
の実際の位置を求める画像処理プログラムを生成する第
4の工程と、 を備えたことを特徴とするロボットのための画像処理プ
ログラム自動生成方法。
1. A method of automatically generating an image processing program for a robot performing a work involving contact with a work, wherein a robot coordinate system for performing a work of contacting the work from a robot program which has been previously taught for a master work. A first step of extracting an operation instruction based on the first instruction and extracting pre-stored teaching points from the extracted operation instruction, and including each teaching point for each of the teaching points extracted in the first step. A second step of determining, from the type of the operation command, what curve each teaching point belongs to, and reading out the coordinate value of the teaching point specifying the range of the determined curve from the robot program; The coordinate values in the robot coordinate system of each teaching point read in the second step are taken by taking the previously defined workpiece. A third step of converting into a coordinate value in the screen of the video camera using a displacement amount between the coordinate system of the video camera and the robot coordinate system for performing the teaching, and each teaching point converted by the third step Based on the coordinate value of and the type of the curve to which each teaching point belongs, the position of the curve corresponding to each of the teaching points is detected from the image taken by the video camera, and the actual position of each of the teaching points as an intersection thereof is detected. A fourth step of generating an image processing program for obtaining a position; and a method of automatically generating an image processing program for a robot, comprising:
【請求項2】前記第4の工程において生成される画像処
理プログラムは、前記ビデオカメラにより撮影された画
像から前記ビデオカメラの画面内での曲線の位置を検出
する位置検出プログラムと、この位置検出プログラムに
より検出される曲線の位置から前記ロボットプログラム
の中から読み出された前記各教示点の前記ビデオカメラ
の画面内での実際の位置を算出する位置算出プログラム
と、この位置算出プログラムにより算出される前記各教
示点の前記ビデオカメラの画面内での座標値をロボット
座標系での座標値に変換する座標変換プログラムとから
なることを特徴とするロボットのための画像処理プログ
ラム自動生成方法。
2. An image processing program generated in the fourth step includes: a position detection program for detecting a position of a curve on a screen of the video camera from an image taken by the video camera; A position calculation program for calculating an actual position on the video camera screen of each of the teaching points read from the robot program from the position of the curve detected by the program; A coordinate conversion program for converting a coordinate value of each of the teaching points on the screen of the video camera into a coordinate value in a robot coordinate system.
【請求項3】前記位置検出プログラムは、前記ビデオカ
メラにより撮影された画像から、前記第2の工程により
読み出された各教示点の座標値および各教示点の属する
曲線の種別に基づいて前記ビデオカメラの画面内におけ
る限定された所定領域内で曲線の位置を検出するもので
あることを特徴とする請求項2記載のロボットのための
画像処理プログラム自動生成方法。
3. The program according to claim 1, wherein the position detection program is configured to execute the program based on a coordinate value of each teaching point read in the second step and a type of a curve to which the teaching point belongs from an image captured by the video camera. 3. The automatic image processing program generation method for a robot according to claim 2, wherein a position of a curve is detected within a limited predetermined area in a screen of a video camera.
【請求項4】ワークとの接触を伴う作業を行うロボット
のための画像処理プログラム自動生成装置において、 作業対象となるワークを撮影するビデオカメラと、 あらかじめマスタワークについてティーチングされたロ
ボットプログラムの中からワークとの接触作業を行う際
のロボット座標系に基づく動作命令を抽出し、この抽出
された動作命令からあらかじめ内蔵された教示点を抽出
する手段と、 この手段により抽出された各教示点について、それぞれ
の教示点を含む動作命令の種別から各教示点がどのよう
な曲線に属するかを判別するとともに、この判別された
曲線の範囲を特定する教示点の座標値を前記ロボットプ
ログラムの中から読み出す手段と、 この手段により読み出された各教示点のロボット座標系
での座標値を、あらかじめ定義された前記ビデオカメラ
の座標系とロボット座標系との変位量を用いて前記ビデ
オカメラの画面内での座標値に変換する手段と、 この手段により変換された各教示点の座標値および各教
示点の属する曲線の種別に基づいて、前記ビデオカメラ
により撮影された画像から前記各教示点に対応する曲線
の位置を検出してこれらの交点としての各教示点の実際
の位置を求める画像処理プログラムを生成する手段と、 を備えたことを特徴とするロボットのための画像処理プ
ログラム自動生成装置。
4. An image processing program automatic generation device for a robot performing a work involving contact with a work, wherein a video camera for photographing a work to be worked, and a robot program previously taught for a master work. A means for extracting an operation command based on a robot coordinate system when performing a contact operation with a workpiece, extracting a pre-built teaching point from the extracted operation command, and for each teaching point extracted by this means, From the type of the operation command including each teaching point, it is determined which curve each teaching point belongs to, and the coordinate value of the teaching point specifying the range of the determined curve is read out from the robot program. Means and a coordinate value in the robot coordinate system of each teaching point read out by this means. Means for converting the coordinate system of the video camera into a coordinate value in the screen of the video camera using the displacement amount between the coordinate system of the video camera and the robot coordinate system, and the coordinate value of each teaching point converted by the means and Image processing for detecting the position of a curve corresponding to each of the teaching points from an image taken by the video camera based on the type of the curve to which the teaching point belongs, and obtaining the actual position of each of the teaching points as an intersection of these An image processing program automatic generation device for a robot, comprising: means for generating a program.
【請求項5】請求項1ないし3のいずれかに記載のロボ
ットのための画像処理プログラム自動生成方法により生
成された画像処理プログラムを用いて、前記ビデオカメ
ラにより撮影された画像から実際のワークの教示点の座
標値を求める工程と、 この工程により求められた実際のワークの教示点の座標
値に基づいて、ロボットプログラムにあらかじめ内蔵さ
れた各教示点の座標値を修正する工程と、 を備えたことを特徴とするロボットプログラム自動修正
方法。
5. An image processing program for a robot according to claim 1, wherein the image processing program automatically generates an actual workpiece from an image captured by the video camera. A step of obtaining coordinate values of the teaching points; and a step of correcting the coordinate values of the teaching points preliminarily incorporated in the robot program based on the coordinate values of the teaching points of the actual work obtained in this step. An automatic correction method for a robot program.
JP24281096A 1996-09-13 1996-09-13 Automatic image processing program generation method for robot, device thereof and robot program automatic correction method Expired - Fee Related JP3538506B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP24281096A JP3538506B2 (en) 1996-09-13 1996-09-13 Automatic image processing program generation method for robot, device thereof and robot program automatic correction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP24281096A JP3538506B2 (en) 1996-09-13 1996-09-13 Automatic image processing program generation method for robot, device thereof and robot program automatic correction method

Publications (2)

Publication Number Publication Date
JPH1091225A JPH1091225A (en) 1998-04-10
JP3538506B2 true JP3538506B2 (en) 2004-06-14

Family

ID=17094632

Family Applications (1)

Application Number Title Priority Date Filing Date
JP24281096A Expired - Fee Related JP3538506B2 (en) 1996-09-13 1996-09-13 Automatic image processing program generation method for robot, device thereof and robot program automatic correction method

Country Status (1)

Country Link
JP (1) JP3538506B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4257570B2 (en) 2002-07-17 2009-04-22 株式会社安川電機 Transfer robot teaching device and transfer robot teaching method
KR101330049B1 (en) 2012-03-06 2013-11-18 한국기계연구원 Postprocessing method of direct teaching trajectory in industrial robot
CN103226456A (en) * 2013-04-24 2013-07-31 广东威创视讯科技股份有限公司 Image display method and device for tiled wall
JP5845212B2 (en) * 2013-06-28 2016-01-20 ファナック株式会社 Deburring device with visual sensor and force sensor
JP2015134407A (en) * 2015-04-30 2015-07-27 ファナック株式会社 Visual sensor and deburring device provided with force sensor
CN109514533B (en) * 2019-01-08 2023-03-28 崧智智能科技(深圳)有限公司 Industrial robot rapid teaching system and teaching method

Also Published As

Publication number Publication date
JPH1091225A (en) 1998-04-10

Similar Documents

Publication Publication Date Title
Chen et al. Applying a 6-axis mechanical arm combine with computer vision to the research of object recognition in plane inspection
Dame et al. Mutual information-based visual servoing
CN110443154B (en) Three-dimensional coordinate positioning method and device of key point, electronic equipment and storage medium
JPH04344503A (en) Numerical controller for robot
JP7128933B2 (en) Image processing device
CN113146073B (en) Vision-based laser cutting method and device, electronic equipment and storage medium
CN113379849B (en) Robot autonomous recognition intelligent grabbing method and system based on depth camera
KR101670270B1 (en) System and method for locating fiducials with known shape
US10664939B2 (en) Position control system, position detection device, and non-transitory recording medium
CN105260740A (en) Element recognition method and apparatus
JP3538506B2 (en) Automatic image processing program generation method for robot, device thereof and robot program automatic correction method
CN105912101B (en) Projection control method and electronic equipment
CN112614183A (en) Tray pose detection method, device, equipment and storage medium
CN113284178A (en) Object stacking method and device, computing equipment and computer storage medium
Gradmann et al. Augmented reality robot operation interface with google tango
JP3450609B2 (en) Offline teaching device for robots
JP2778430B2 (en) Three-dimensional position and posture recognition method based on vision and three-dimensional position and posture recognition device based on vision
Huang et al. Intelligent humanoid mobile robot with embedded control and stereo visual feedback
Motai et al. SmartView: hand-eye robotic calibration for active viewpoint generation and object grasping
CN114677264A (en) Image alignment method, system, electronic device and storage medium
CN113776517A (en) Map generation method, device, system, storage medium and electronic equipment
Maarif et al. A trajectory generation method based on edge detection for auto-sealant cartesian robot
CN114902281A (en) Image processing system
CN116423525B (en) Automatic hand-eye calibration method and system and storage medium
KR20200059465A (en) Method and apparatus for controlling a drawing robot based on image

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040312

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040322

LAPS Cancellation because of no payment of annual fees