[go: up one dir, main page]

TW202511037A - Parameter correction device - Google Patents

Parameter correction device Download PDF

Info

Publication number
TW202511037A
TW202511037A TW113130156A TW113130156A TW202511037A TW 202511037 A TW202511037 A TW 202511037A TW 113130156 A TW113130156 A TW 113130156A TW 113130156 A TW113130156 A TW 113130156A TW 202511037 A TW202511037 A TW 202511037A
Authority
TW
Taiwan
Prior art keywords
image
workpiece
camera
unit
estimated
Prior art date
Application number
TW113130156A
Other languages
Chinese (zh)
Inventor
高橋祐輝
Original Assignee
日商發那科股份有限公司
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 日商發那科股份有限公司 filed Critical 日商發那科股份有限公司
Publication of TW202511037A publication Critical patent/TW202511037A/en

Links

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J13/00Controls for manipulators
    • B25J13/08Controls for manipulators by means of sensing devices, e.g. viewing or touching devices
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J19/00Accessories fitted to manipulators, e.g. for monitoring, for viewing; Safety devices combined with or specially adapted for use in connection with manipulators
    • B25J19/02Sensing devices
    • B25J19/04Viewing devices
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/10Programme-controlled manipulators characterised by positioning means for manipulator elements
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration

Landscapes

  • Engineering & Computer Science (AREA)
  • Robotics (AREA)
  • Mechanical Engineering (AREA)
  • Human Computer Interaction (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Manipulator (AREA)
  • Numerical Control (AREA)
  • Automatic Control Of Machine Tools (AREA)

Abstract

The present invention provides a parameter correction device that calculates a three-dimensional estimated position of a workpiece on the basis of a sensor parameter and the position of a characteristic portion in an image of the workpiece. The parameter correction device calculates a measured position of one member out of the sensor and the workpiece on the basis of the drive state of a movement device. The parameter correction device uses the movement device to move one member to first and second positions to capture images of the workpiece. The parameter correction device corrects the sensor parameter on the basis of the amount of movement, which is based on first and second measured positions, and the distance from a first estimated position to a second estimated position.

Description

參數修正裝置Parameter correction device

發明領域Invention Field

本揭示是有關於一種參數修正裝置。The present disclosure relates to a parameter correction device.

發明背景Invention Background

至今已知一種使用以照相機所拍攝的圖像來測定工件的位置,並根據工件的已測定位置來進行作業之機器人裝置。機器人裝置的控制裝置可取得以照相機所拍攝的工件的特徵部分的圖像。控制裝置根據預先製作的工件的特徵部分的基準圖像及照相機參數,從工件的特徵部分的圖像算出工件的三維的位置。然後,控制裝置根據工件的三維的位置,補正記載於機器人的動作程式之動作位置,來驅動機器人。機器人裝置可進行對應於實際的工件的位置之正確的作業。 先前技術文獻 專利文獻 A robot device is known that uses an image taken by a camera to measure the position of a workpiece and performs operations based on the measured position of the workpiece. The control device of the robot device can obtain an image of a characteristic portion of the workpiece taken by a camera. The control device calculates the three-dimensional position of the workpiece from the image of the characteristic portion of the workpiece based on a pre-made reference image of the characteristic portion of the workpiece and camera parameters. Then, the control device drives the robot by correcting the action position recorded in the action program of the robot based on the three-dimensional position of the workpiece. The robot device can perform correct operations corresponding to the actual position of the workpiece. Prior Art Literature Patent Literature

專利文獻1:國際公開WO2018/163450A1號公報 專利文獻2:日本專利特開2023-69274號公報 專利文獻3:國際公開WO2021/145280A1號公報 Patent document 1: International publication WO2018/163450A1 Patent document 2: Japanese patent publication No. 2023-69274 Patent document 3: International publication WO2021/145280A1

發明概要 發明欲解決之課題 Invention Summary Problem to be solved by the invention

在藉由以照相機所拍攝的圖像來補正機器人的動作位置之機器人裝置中,必須預先決定照相機參數。若照相機參數的精度良好,控制裝置算出的工件的三維的位置亦會正確。照相機參數所包含的複數個參數可藉由稱為校正的作業來決定。在校正中,例如,控制裝置是以照相機來拍攝點的位置已預先決定的校正板。然後,控制裝置可根據圖像中之點的位置及點的實際的三維的位置,來生成照相機參數。In a robot device that corrects the robot's motion position by using an image taken by a camera, the camera parameters must be determined in advance. If the accuracy of the camera parameters is good, the three-dimensional position of the workpiece calculated by the control device will also be correct. The multiple parameters included in the camera parameters can be determined by a process called calibration. In calibration, for example, the control device uses a camera to photograph a calibration plate whose position of a point has been predetermined. Then, the control device can generate the camera parameters based on the position of the point in the image and the actual three-dimensional position of the point.

然而,在機器人裝置的使用後,有時會修正照相機參數來正確地補正機器人的動作。此情況下,必須再次準備校正板,而有為了修正照相機參數的誤差而耗費時間的問題。又,有時校正板的高度與實際地進行檢測之工件的特徵部分的高度不同,在拍攝二維的圖像之照相機的情況下,有時從照相機的圖像推定的工件的三維的位置會產生誤差。或,若在基準圖像中錯誤設定工件的輪廓或紋樣,有時工件的三維的位置會產生誤差。此類誤差難以找出,且進一步有參數的修正難以進行的問題。 用以解決課題之手段 However, after the use of the robot device, the camera parameters are sometimes corrected to correctly compensate for the robot's movements. In this case, the calibration plate must be prepared again, and there is a problem of taking time to correct the camera parameter errors. In addition, sometimes the height of the calibration plate is different from the height of the feature part of the workpiece actually inspected, and in the case of a camera that takes a two-dimensional image, the three-dimensional position of the workpiece estimated from the camera image sometimes produces errors. Or, if the outline or pattern of the workpiece is incorrectly set in the reference image, the three-dimensional position of the workpiece sometimes produces errors. Such errors are difficult to find, and there is a problem that the parameter correction is difficult to perform. Means used to solve the problem

本揭示的一態樣是一種參數修正裝置,是修正用以算出三維的位置之感測器參數的參數修正裝置,前述三維的位置對應於以感測器所拍攝的工件的圖像中之特定的位置。參數修正裝置具備特徵檢測部,前述特徵檢測部在工件的圖像中檢測特徵部分。參數修正裝置具備推定位置算出部,前述推定位置算出部根據工件的圖像中之特徵部分的位置及感測器參數,來算出工件的三維的位置即推定位置。參數修正裝置具備實測位置算出部,前述實測位置算出部根據移動感測器及工件當中之至少其中一個構件之移動裝置的驅動狀態,來算出其中一個構件的三維的位置即實測位置。參數修正裝置具備修正部,前述修正部修正感測器參數。特徵檢測部檢測其中一個構件配置於第1位置時所拍攝的圖像中之特徵部分、及其中一個構件配置於第2位置時所拍攝的圖像中之特徵部分。推定位置算出部算出其中一個構件配置於第1位置時之第1推定位置、及其中一個構件配置於第2位置時之第2推定位置。實測位置算出部算出其中一個構件配置於第1位置時之第1實測位置、及其中一個構件配置於第2位置時之第2實測位置。修正部根據以第1實測位置及第2實測位置為依據的移動量、與從第1推定位置到第2推定位置的距離,來修正感測器參數。One aspect of the present disclosure is a parameter correction device that corrects sensor parameters used to calculate a three-dimensional position, wherein the three-dimensional position corresponds to a specific position in an image of a workpiece captured by the sensor. The parameter correction device includes a feature detection unit that detects a feature portion in the image of the workpiece. The parameter correction device includes an estimated position calculation unit that calculates the three-dimensional position of the workpiece, i.e., the estimated position, based on the position of the feature portion in the image of the workpiece and the sensor parameters. The parameter correction device includes a measured position calculation unit that calculates the three-dimensional position of one of the components, i.e., the measured position, based on the driving state of a moving device of at least one of the components of the moving sensor and the workpiece. The parameter correction device includes a correction unit that corrects the sensor parameters. The feature detection unit detects a feature portion in an image captured when one of the components is arranged at a first position, and a feature portion in an image captured when one of the components is arranged at a second position. The estimated position calculation unit calculates a first estimated position when one of the components is arranged at the first position, and a second estimated position when one of the components is arranged at the second position. The measured position calculation unit calculates a first measured position when one of the components is arranged at the first position, and a second measured position when one of the components is arranged at the second position. The correction unit corrects the sensor parameter based on a movement amount based on the first measured position and the second measured position, and a distance from the first estimated position to the second estimated position.

用以實施發明之形態The form used to implement the invention

參照圖1至圖18,就實施形態的參數修正裝置加以說明。本實施形態的參數修正裝置修正用以算出三維的位置之感測器參數,前述三維的位置對應於以感測器所拍攝的圖像中之特定的位置。在本實施形態,機器人裝置的控制裝置是作為參數修正裝置而發揮功能。又,在本實施形態,作為感測器,是例示拍攝二維的圖像之照相機。又,作為感測器參數,例示包含內部參數及外部參數之照相機參數。The parameter correction device of the embodiment is described with reference to FIGS. 1 to 18. The parameter correction device of the embodiment corrects the sensor parameters used to calculate the three-dimensional position corresponding to a specific position in the image taken by the sensor. In the embodiment, the control device of the robot device functions as the parameter correction device. In the embodiment, the sensor is exemplified by a camera that takes a two-dimensional image. In addition, as the sensor parameter, the camera parameter including the internal parameter and the external parameter is exemplified.

(第1機器人裝置的構成) 圖1是具備本實施形態的參數修正裝置之第1機器人裝置的概略圖。圖2是本實施形態的機器人裝置的方塊圖。本實施形態的機器人裝置3檢測作為對象物的工件31的位置而搬送工件。 (Configuration of the first robot device) Fig. 1 is a schematic diagram of the first robot device having a parameter correction device of the present embodiment. Fig. 2 is a block diagram of the robot device of the present embodiment. The robot device 3 of the present embodiment detects the position of a workpiece 31 as an object and transports the workpiece.

參照圖1及圖2,第1機器人裝置3具備作為把持工件31的作業工具之手部5、及移動手部5的機器人1。機器人裝置3具備作為控制機器人裝置3的機器人控制裝置之控制裝置2。又,機器人裝置3具備載置工件31的架台35。1 and 2 , the first robot device 3 includes a hand 5 as a working tool for holding a workpiece 31 and a robot 1 for moving the hand 5. The robot device 3 includes a control device 2 as a robot control device for controlling the robot device 3. The robot device 3 also includes a stage 35 for placing the workpiece 31.

本實施形態的手部5是把持或釋放工件31的作業工具。作為安裝於機器人1的作業工具不限於此形態,可採用與機器人裝置3進行的作業相應之任意的作業工具。例如,作為作業工具,可採用實施熔接的熔接槍等。The hand 5 of this embodiment is a working tool for holding or releasing the workpiece 31. The working tool mounted on the robot 1 is not limited to this form, and any working tool corresponding to the work performed by the robot device 3 can be adopted. For example, a welding gun for welding can be adopted as the working tool.

本實施形態的機器人1是作為移動裝置而發揮功能,前述移動裝置移動作為感測器之照相機6及工件31當中之其中一個構件。在第1機器人裝置3,相當於照相機6藉由移動裝置來移動之其中一個構件。又,工件31相當於位置固定的另一個構件。The robot 1 of this embodiment functions as a moving device, and the moving device moves one of the components of the camera 6 as a sensor and the workpiece 31. In the first robot device 3, it corresponds to one of the components moved by the camera 6 through the moving device. In addition, the workpiece 31 corresponds to another component whose position is fixed.

本實施形態的機器人1是包含複數個關節部18的多關節機器人。機器人1包含上部臂11及下部臂12。下部臂12支撐於旋繞基座13。旋繞基座13支撐於基座14。機器人1包含連結於上部臂11的端部的腕15。腕15包含將手部5固定的凸緣16。本實施形態的機器人1的構成構件形成為繞著預先決定的6個驅動軸旋轉。作為機器人1,不限於此形態,可採用能移動作業工具之任意的機器人。The robot 1 of this embodiment is a multi-joint robot including a plurality of joints 18. The robot 1 includes an upper arm 11 and a lower arm 12. The lower arm 12 is supported on a rotating base 13. The rotating base 13 is supported on a base 14. The robot 1 includes a wrist 15 connected to the end of the upper arm 11. The wrist 15 includes a flange 16 for fixing the hand 5. The components of the robot 1 of this embodiment are formed to rotate around six predetermined drive axes. The robot 1 is not limited to this form, and any robot that can move a working tool can be used.

本實施形態的機器人1包含機器人驅動裝置21,前述機器人驅動裝置21具有驅動上部臂11等構成構件的驅動馬達。手部5包含驅動手部5的手部驅動裝置22。本實施形態的手部驅動裝置22是藉由氣壓來驅動手部5。手部驅動裝置22包含用以將壓縮空氣供給至汽缸的空氣泵等。The robot 1 of this embodiment includes a robot drive device 21, and the robot drive device 21 has a drive motor for driving the upper arm 11 and other components. The hand 5 includes a hand drive device 22 for driving the hand 5. The hand drive device 22 of this embodiment drives the hand 5 by air pressure. The hand drive device 22 includes an air pump for supplying compressed air to the cylinder, etc.

控制裝置2包含控制裝置本體40、及用以供作業人員操作控制裝置本體40的教示操作盤26。控制裝置本體40包含具有作為處理器的CPU(Central Processing Unit(中央處理單元))之運算處理裝置(電腦)。運算處理裝置具有透過匯流排連接於CPU的RAM(Random Access Memory(隨機存取記憶體))及ROM(Read Only Memory(唯讀記憶體))等。本實施形態的機器人裝置3根據動作程式67自動地搬送工件31。機器人驅動裝置21及手部驅動裝置22是藉由控制裝置2來控制。The control device 2 includes a control device body 40 and a teaching operation panel 26 for an operator to operate the control device body 40. The control device body 40 includes an arithmetic processing device (computer) having a CPU (Central Processing Unit) as a processor. The arithmetic processing device has a RAM (Random Access Memory) and a ROM (Read Only Memory) etc. connected to the CPU via a bus. The robot device 3 of this embodiment automatically transports a workpiece 31 according to an action program 67. The robot drive device 21 and the hand drive device 22 are controlled by the control device 2.

控制裝置本體40包含記憶部42,前述記憶部42記憶關於機器人裝置3的任意的資訊。記憶部42能以可記憶資訊的非暫時性記憶媒體來構成。例如,記憶部42能以揮發性記憶體、非揮發性記憶體、磁性記憶媒體或光記憶媒體等記憶媒體來構成。The control device body 40 includes a memory unit 42, and the memory unit 42 stores arbitrary information about the robot device 3. The memory unit 42 can be configured with a non-transitory storage medium that can store information. For example, the memory unit 42 can be configured with a storage medium such as a volatile memory, a non-volatile memory, a magnetic storage medium, or an optical storage medium.

於控制裝置2輸入有動作程式67,前述動作程式67是為了進行機器人1的動作而預先製作。或,作業人員可操作教示操作盤26來驅動機器人1,藉此設定機器人1的教示點。控制裝置2可根據教示點來生成動作程式67。The control device 2 has an action program 67 input thereto, which is prepared in advance for performing the actions of the robot 1. Alternatively, the operator can operate the teaching operation panel 26 to drive the robot 1, thereby setting the teaching point of the robot 1. The control device 2 can generate the action program 67 based on the teaching point.

動作程式67是記憶於記憶部42。動作控制部43根據動作程式67來將用以驅動機器人1的動作指令送出至機器人驅動部44。機器人驅動部44包含將驅動馬達驅動的電路,根據動作指令來向機器人驅動裝置21供給電力。又,動作控制部43將驅動手部驅動裝置22之動作指令送出至手部驅動部45。手部驅動部45包含驅動空氣泵等之電路,根據動作指令來將電力供給至空氣泵等。The action program 67 is stored in the memory unit 42. The action control unit 43 sends an action command for driving the robot 1 to the robot drive unit 44 according to the action program 67. The robot drive unit 44 includes a circuit for driving a drive motor, and supplies power to the robot drive device 21 according to the action command. In addition, the action control unit 43 sends an action command for driving the hand drive device 22 to the hand drive unit 45. The hand drive unit 45 includes a circuit for driving an air pump, etc., and supplies power to the air pump, etc. according to the action command.

動作控制部43相當於按照動作程式67來驅動的處理器。處理器形成為可讀取記憶於記憶部42的資訊。處理器讀入動作程式67,實施決定於動作程式67的控制,藉此作為動作控制部43而發揮功能。The motion control unit 43 corresponds to a processor driven according to the motion program 67. The processor is configured to read information stored in the memory unit 42. The processor reads the motion program 67 and executes control determined by the motion program 67, thereby functioning as the motion control unit 43.

機器人1包含檢測機器人1的驅動狀態的狀態檢測器。本實施形態的狀態檢測器是檢測機器人的位置及姿勢,來作為機器人1的驅動狀態。本實施形態的狀態檢測器包含位置檢測器23,前述位置檢測器23安裝於機器人驅動裝置21的各驅動軸的驅動馬達。位置檢測器23能以例如編碼器來構成,前述編碼器檢測驅動馬達的輸出軸的旋轉位置。藉由位置檢測器23的輸出,來檢測機器人1的位置及姿勢。The robot 1 includes a state detector for detecting the driving state of the robot 1. The state detector of this embodiment detects the position and posture of the robot as the driving state of the robot 1. The state detector of this embodiment includes a position detector 23, and the position detector 23 is installed on the drive motor of each drive shaft of the robot drive device 21. The position detector 23 can be configured as an encoder, for example, and the encoder detects the rotational position of the output shaft of the drive motor. The position and posture of the robot 1 are detected by the output of the position detector 23.

教示操作盤26透過通訊裝置而連接於控制裝置本體40。教示操作盤26包含輸入部27,前述輸入部27輸入關於機器人1及手部5之資訊。輸入部27是藉由鍵盤、按鈕及刻度盤等輸入構件來構成。教示操作盤26包含顯示部28,前述顯示部28顯示關於機器人1及手部5之資訊。顯示部28能以液晶顯示面板或有機EL(Electro Luminescence(電致發光))顯示面板等任意的顯示面板來構成。再者,在教示操作盤具備觸控面板方式的顯示面板的情況下,顯示面板是作為輸入部及顯示部而發揮功能。The teaching operation panel 26 is connected to the control device body 40 through a communication device. The teaching operation panel 26 includes an input unit 27, and the input unit 27 inputs information about the robot 1 and the hand 5. The input unit 27 is composed of input components such as a keyboard, buttons, and a dial. The teaching operation panel 26 includes a display unit 28, and the display unit 28 displays information about the robot 1 and the hand 5. The display unit 28 can be composed of any display panel such as a liquid crystal display panel or an organic EL (Electro Luminescence) display panel. Furthermore, in the case where the teaching operation panel has a display panel of a touch panel type, the display panel functions as an input unit and a display unit.

在機器人裝置3,設定有基準座標系統71,前述基準座標系統71在機器人1的位置及姿勢變化時為不動。在圖1所示之例中,於機器人1的旋繞基座13配置有基準座標系統71的原點。基準座標系統71亦稱為世界座標系統。於基準座標系統71,原點的位置固定,且座標軸的方向固定。基準座標系統71具有相互呈正交的X軸、Y軸及Z軸來作為座標軸。The robot device 3 is provided with a reference coordinate system 71, which remains unchanged when the position and posture of the robot 1 change. In the example shown in FIG. 1 , the origin of the reference coordinate system 71 is arranged on the rotating base 13 of the robot 1. The reference coordinate system 71 is also called a world coordinate system. In the reference coordinate system 71, the position of the origin is fixed, and the direction of the coordinate axis is fixed. The reference coordinate system 71 has mutually orthogonal X-axis, Y-axis and Z-axis as coordinate axes.

在機器人裝置3,設定有工具座標系統74,前述工具座標系統74具有設定於作業工具的任意的位置的原點。工具座標系統74與作業工具一同變化位置及姿勢。在本實施形態,工具座標系統74的原點設定於手部5的工具前端點。機器人1的位置對應於基準座標系統71中之工具前端點的位置(工具座標系統的原點的位置)。又,機器人1的姿勢對應於工具座標系統74相對於基準座標系統71的姿勢。In the robot device 3, a tool coordinate system 74 is provided, and the tool coordinate system 74 has an origin set at an arbitrary position of the working tool. The tool coordinate system 74 changes position and posture together with the working tool. In the present embodiment, the origin of the tool coordinate system 74 is set at the tool tip of the hand 5. The position of the robot 1 corresponds to the position of the tool tip in the reference coordinate system 71 (the position of the origin of the tool coordinate system). In addition, the posture of the robot 1 corresponds to the posture of the tool coordinate system 74 relative to the reference coordinate system 71.

本實施形態的機器人裝置3具備用以拍攝工件31的作為感測器之照相機6。本實施形態的照相機6是拍攝二維的圖像之二維照相機。照相機6可於視野6a來拍攝圖像。The robot device 3 of this embodiment is equipped with a camera 6 as a sensor for photographing the workpiece 31. The camera 6 of this embodiment is a two-dimensional camera for photographing two-dimensional images. The camera 6 can photograph images in a field of view 6a.

在第1機器人裝置3,照相機6及工件31當中之以機器人1來移動的其中一個構件是照相機6。照相機6及工件31當中之另一個構件是工件31。如此,構成為機器人1變更位置及姿勢,藉此使照相機6的位置及姿勢變化。照相機6的三維的位置是藉由機器人1來變更。本實施形態的照相機6固定在安裝於機器人1的手部5,但不限於此形態。照相機6可固定在機器人1會動作並且位置及姿勢會變化的任意的構件。或,照相機6亦可安裝於機器人1。例如,照相機6亦可固定在機器人1的凸緣16。In the first robot device 3, one of the components among the camera 6 and the workpiece 31 that is moved by the robot 1 is the camera 6. The other component among the camera 6 and the workpiece 31 is the workpiece 31. In this way, the robot 1 changes its position and posture, thereby changing the position and posture of the camera 6. The three-dimensional position of the camera 6 is changed by the robot 1. The camera 6 of this embodiment is fixed to the hand 5 installed on the robot 1, but is not limited to this form. The camera 6 can be fixed to any component of the robot 1 that moves and changes its position and posture. Or, the camera 6 can also be installed on the robot 1. For example, the camera 6 can also be fixed to the flange 16 of the robot 1.

在機器人裝置3中,對照相機6設定有作為感測器座標系統之照相機座標系統72。照相機座標系統72與照相機6一同變化位置及姿勢。照相機座標系統72的原點設定於照相機6之預先決定的位置,如照相機6的透鏡中心或光學中心等。照相機座標系統72具有相互呈正交的X軸、Y軸及Z軸。本實施形態的照相機座標系統72設定為Z軸與照相機6的透鏡的光軸呈平行。In the robot device 3, a camera coordinate system 72 as a sensor coordinate system is set for the camera 6. The camera coordinate system 72 changes position and posture together with the camera 6. The origin of the camera coordinate system 72 is set at a predetermined position of the camera 6, such as the lens center or optical center of the camera 6. The camera coordinate system 72 has an X-axis, a Y-axis, and a Z-axis that are orthogonal to each other. The camera coordinate system 72 of this embodiment is set so that the Z-axis is parallel to the optical axis of the lens of the camera 6.

若機器人1的位置及姿勢變化,照相機座標系統72的位置及姿勢會變化。照相機6的位置對應於基準座標系統71中之照相機座標系統72的原點的位置。又,照相機6的姿勢對應於照相機座標系統72相對於基準座標系統71的方向。又,在本實施形態,照相機座標系統72相對於工具座標系統74的位置及姿勢是預先決定的。If the position and posture of the robot 1 change, the position and posture of the camera coordinate system 72 will change. The position of the camera 6 corresponds to the position of the origin of the camera coordinate system 72 in the reference coordinate system 71. Moreover, the posture of the camera 6 corresponds to the direction of the camera coordinate system 72 relative to the reference coordinate system 71. Moreover, in the present embodiment, the position and posture of the camera coordinate system 72 relative to the tool coordinate system 74 are predetermined.

控制裝置2在進行作業時根據拍攝了工件31之圖像來檢測作業空間中之工件31的三維的位置。控制裝置2根據工件31的位置,來補正機器人1的位置及姿勢。The control device 2 detects the three-dimensional position of the workpiece 31 in the work space based on the image of the workpiece 31 during the operation. The control device 2 corrects the position and posture of the robot 1 based on the position of the workpiece 31.

控制裝置2是作為修正感測器參數之參數修正裝置而發揮功能。控制裝置2包含圖像處理部51,前述圖像處理部51處理以照相機6所拍攝的圖像。圖像處理部51包含攝像控制部53,前述攝像控制部53對照相機6送出拍攝圖像的指令。The control device 2 functions as a parameter correction device for correcting sensor parameters. The control device 2 includes an image processing unit 51 that processes an image captured by the camera 6. The image processing unit 51 includes an image capture control unit 53 that sends an instruction to the camera 6 to capture an image.

圖像處理部51包含特徵檢測部56,前述特徵檢測部56是在工件31的圖像中檢測預先決定的特徵部分。圖像處理部51包含推定位置算出部57,前述推定位置算出部57根據圖像中之特徵部分的位置及作為感測器參數之照相機參數,以照相機座標系統72來算出工件的三維的位置即推定位置。圖像處理部51包含動作指令生成部64,前述動作指令生成部64根據圖像處理的結果,來生成機器人1及手部5的動作指令。The image processing unit 51 includes a feature detection unit 56, which detects a predetermined feature portion in the image of the workpiece 31. The image processing unit 51 includes an estimated position calculation unit 57, which calculates the three-dimensional position of the workpiece, i.e., the estimated position, using a camera coordinate system 72 based on the position of the feature portion in the image and the camera parameters as sensor parameters. The image processing unit 51 includes an action command generation unit 64, which generates action commands for the robot 1 and the hand 5 based on the result of image processing.

圖像處理部51包含實測位置算出部52,前述實測位置算出部52根據作為機器人的驅動狀態之機器人1的位置及姿勢,以基準座標系統71來算出照相機6及工件31當中之其中一個構件的三維的位置即實測位置。圖像處理部51包含評估照相機參數的評估部58。圖像處理部51具備選定部59,前述選定部59從照相機參數所包含的複數個參數,選定要修正的參數。圖像處理部51包含修正照相機參數的修正部60。The image processing unit 51 includes a measured position calculation unit 52, which calculates the three-dimensional position of one of the components of the camera 6 and the workpiece 31, i.e., the measured position, based on the position and posture of the robot 1 as the driving state of the robot, using the reference coordinate system 71. The image processing unit 51 includes an evaluation unit 58 for evaluating camera parameters. The image processing unit 51 has a selection unit 59, which selects a parameter to be corrected from a plurality of parameters included in the camera parameters. The image processing unit 51 includes a correction unit 60 for correcting the camera parameters.

圖像處理部51包含圖像推定部61,前述圖像推定部61推定照相機6配置於預先決定的位置時之特徵部分的圖像。本實施形態的圖像推定部61根據其中一個構件配置於第1位置時所拍攝的特徵部分的圖像、照相機參數68、及其中一個構件的實測位置的移動量,來推定其中一個構件配置於第2位置時之特徵部分的圖像。圖像處理部51包含分數算出部62,前述分數算出部62是對其中一個構件配置於第2位置時所拍攝的特徵部分的圖像,算出表示以圖像推定部61所推定的特徵部分的圖像重疊程度之點數。圖像處理部51包含顯示控制部63,前述顯示控制部63控制顯示於顯示部28的圖像。The image processing unit 51 includes an image estimation unit 61, which estimates an image of a characteristic portion when the camera 6 is arranged at a predetermined position. The image estimation unit 61 of the present embodiment estimates an image of a characteristic portion when one of the components is arranged at a second position based on an image of a characteristic portion photographed when one of the components is arranged at a first position, the camera parameter 68, and the amount of movement of the measured position of one of the components. The image processing unit 51 includes a score calculation unit 62, which calculates a point indicating the degree of overlap of the image of the characteristic portion estimated by the image estimation unit 61 for the image of the characteristic portion photographed when one of the components is arranged at the second position. The image processing unit 51 includes a display control unit 63 that controls the image displayed on the display unit 28 .

圖像處理部51及圖像處理部51所包含的單元相當於按照動作程式67來驅動的處理器。實測位置算出部52、攝像控制部53、特徵檢測部56、推定位置算出部57、及動作指令生成部64相當於按照動作程式67來驅動的處理器。又,評估部58、選定部59、修正部60、圖像推定部61、分數算出部62、及顯示控制部63相當於按照動作程式67來驅動的處理器。處理器讀入動作程式67,實施決定於動作程式67中的控制,藉此作為各個單元而發揮功能。The image processing unit 51 and the units included in the image processing unit 51 are equivalent to a processor driven according to the action program 67. The measured position calculation unit 52, the imaging control unit 53, the feature detection unit 56, the estimated position calculation unit 57, and the action command generation unit 64 are equivalent to a processor driven according to the action program 67. Furthermore, the evaluation unit 58, the selection unit 59, the correction unit 60, the image estimation unit 61, the score calculation unit 62, and the display control unit 63 are equivalent to a processor driven according to the action program 67. The processor reads the action program 67 and implements the control determined in the action program 67, thereby functioning as each unit.

在圖3,顯示本實施形態的工件的立體圖。參照圖1及圖3,本實施形態的工件31具有板狀部31a、及形成於板狀部31a的上側的板狀部31b。各個板狀部31a、31b具有圓板形狀。工件31是以上側的板狀部31b的上表面與水平方向呈平行的方式配置於架台35的表面。板狀部31b具有上表面的緣部31c。在本實施形態,板狀部31b的上表面是工件31的特徵部分。在本實施形態的工件31的圖像中,根據平面形狀為圓形的緣部31c的圖像來檢測特徵部分。再者,工件的形狀可採用任意的形狀。又,特徵部分可決定能以圖像處理來檢測的任意的部分。FIG3 shows a three-dimensional view of the workpiece of the present embodiment. Referring to FIG1 and FIG3, the workpiece 31 of the present embodiment has a plate-like portion 31a and a plate-like portion 31b formed on the upper side of the plate-like portion 31a. Each of the plate-like portions 31a and 31b has a circular plate shape. The workpiece 31 is arranged on the surface of the stand 35 in such a manner that the upper surface of the plate-like portion 31b on the upper side is parallel to the horizontal direction. The plate-like portion 31b has an edge 31c on the upper surface. In the present embodiment, the upper surface of the plate-like portion 31b is a characteristic portion of the workpiece 31. In the image of the workpiece 31 of the present embodiment, the characteristic portion is detected based on the image of the edge 31c whose plane shape is a circle. Furthermore, the shape of the workpiece can adopt any shape. In addition, the characteristic portion can determine any portion that can be detected by image processing.

(藉由第1機器人裝置所進行之搬送作業) 參照圖1至圖3,在第1機器人裝置3,藉由預先決定的方法將工件31配置於架台35的表面。機器人1的位置及姿勢變化,以手部5來把持配置於架台35的上表面的工件31。機器人裝置3藉由變化機器人1的位置及姿勢,來將工件31搬送到預先決定的位置。 (Transportation operation performed by the first robot device) Referring to Figures 1 to 3, the first robot device 3 places the workpiece 31 on the surface of the platform 35 by a predetermined method. The position and posture of the robot 1 change, and the hand 5 grasps the workpiece 31 placed on the upper surface of the platform 35. The robot device 3 transports the workpiece 31 to the predetermined position by changing the position and posture of the robot 1.

在將工件31配置於架台35的表面時,工件31在架台35的位置有時會偏離。控制裝置2在進行工件31的把持之前,將照相機6配置於工件31的鉛直方向的上側。此時,從工件31的特徵部分的表面到照相機6的距離hz是預先決定的。When the workpiece 31 is placed on the surface of the stand 35, the position of the workpiece 31 on the stand 35 may be deviated. Before the control device 2 holds the workpiece 31, the camera 6 is placed on the upper side of the workpiece 31 in the vertical direction. At this time, the distance hz from the surface of the characteristic part of the workpiece 31 to the camera 6 is predetermined.

在此之例中,調整照相機6的姿勢,以使照相機6的光軸(照相機座標系統72的Z軸)相對於工件31的特徵部分即板狀部31b的上表面呈幾乎垂直。又,控制機器人1的位置及姿勢,以使板狀部31b的上表面的位置成為照相機座標系統72的Z軸的預定之值。此類機器人的位置及姿勢是預先決定於動作程式67。In this example, the posture of the camera 6 is adjusted so that the optical axis of the camera 6 (the Z axis of the camera coordinate system 72) is almost perpendicular to the upper surface of the plate-shaped portion 31b, which is the characteristic portion of the workpiece 31. Furthermore, the position and posture of the robot 1 are controlled so that the position of the upper surface of the plate-shaped portion 31b becomes a predetermined value of the Z axis of the camera coordinate system 72. The position and posture of such a robot are predetermined in the motion program 67.

攝像控制部53以照相機6來拍攝工件31。特徵檢測部56根據工件31的特徵部分的基準圖像、與以照相機6所拍攝的工件31的圖像,來檢測工件31的特徵部分。用以檢測特徵部分之工件31的基準圖像是預先製作並記憶於記憶部42。特徵檢測部56藉由進行型樣匹配,來在以照相機6所拍攝的圖像中檢測工件31的板狀部31b的上表面的緣部31c。The imaging control unit 53 photographs the workpiece 31 with the camera 6. The feature detection unit 56 detects the feature portion of the workpiece 31 based on the reference image of the feature portion of the workpiece 31 and the image of the workpiece 31 photographed with the camera 6. The reference image of the workpiece 31 used to detect the feature portion is prepared in advance and stored in the storage unit 42. The feature detection unit 56 detects the edge 31c of the upper surface of the plate-shaped portion 31b of the workpiece 31 in the image photographed with the camera 6 by performing pattern matching.

推定位置算出部57根據圖像中之工件31的特徵部分的位置、記憶於記憶部42的照相機參數68、及從工件31的特徵部分到照相機6的距離hz,來算出工件31的三維的位置。在本實施形態,將從工件31的圖像所算出的工件的三維的位置,稱為推定位置。作為推定位置,可算出設定於工件31的特定點31p的位置。在本實施形態,將板狀部31b的上表面的形狀的圓的中心設定為特定點31p。推定位置算出部57能以照相機座標系統72來算出工件31的推定位置。進而,推定位置算出部57可根據機器人1的位置及姿勢,將照相機座標系統72中之座標值轉換成基準座標系統71中之座標值。The estimated position calculation unit 57 calculates the three-dimensional position of the workpiece 31 based on the position of the characteristic portion of the workpiece 31 in the image, the camera parameter 68 stored in the memory unit 42, and the distance hz from the characteristic portion of the workpiece 31 to the camera 6. In this embodiment, the three-dimensional position of the workpiece calculated from the image of the workpiece 31 is called the estimated position. As the estimated position, the position of a specific point 31p set on the workpiece 31 can be calculated. In this embodiment, the center of the circle of the shape of the upper surface of the plate-shaped portion 31b is set as the specific point 31p. The estimated position calculation unit 57 can calculate the estimated position of the workpiece 31 using the camera coordinate system 72. Furthermore, the estimated position calculation unit 57 can convert the coordinate values in the camera coordinate system 72 into coordinate values in the reference coordinate system 71 according to the position and posture of the robot 1.

動作指令生成部64是以對應於工件31的推定位置的方式,來生成補正動作程式67所包含的機器人1的位置及姿勢之動作指令。動作指令生成部64將補正的動作指令送出至動作控制部43。動作控制部43根據補正的動作指令來驅動機器人1。或,動作指令生成部64亦可將對應於工件31的推定位置之機器人1的位置及姿勢,發送至動作控制部43。藉由此控制,機器人1的位置及姿勢是與工件31的推定位置配合的位置及姿勢。機器人裝置3可精度良好地把持工件31。The motion instruction generation unit 64 generates motion instructions for correcting the position and posture of the robot 1 included in the motion program 67 in a manner corresponding to the estimated position of the workpiece 31. The motion instruction generation unit 64 sends the corrected motion instructions to the motion control unit 43. The motion control unit 43 drives the robot 1 according to the corrected motion instructions. Alternatively, the motion instruction generation unit 64 may also send the position and posture of the robot 1 corresponding to the estimated position of the workpiece 31 to the motion control unit 43. Through this control, the position and posture of the robot 1 are the positions and postures that match the estimated position of the workpiece 31. The robot device 3 can hold the workpiece 31 with good precision.

如此,本實施形態的機器人裝置3可根據以照相機6所拍攝的圖像,來補正機器人的位置及姿勢。由於對應於從工件31的圖像所推定出的工件的推定位置來驅動機器人1,因此可將手部5配置於正確的位置。本實施形態的機器人裝置3可精度良好地進行預先決定的作業。In this way, the robot device 3 of this embodiment can correct the position and posture of the robot based on the image taken by the camera 6. Since the robot 1 is driven according to the estimated position of the workpiece estimated from the image of the workpiece 31, the hand 5 can be arranged at the correct position. The robot device 3 of this embodiment can perform a predetermined operation with good accuracy.

(計算模型) 在此,就算出與以照相機所拍攝的圖像中之特定的位置對應之空間中之三維的位置之計算模型加以說明。在計算模型中,使用作為包含複數個參數的感測器參數之照相機參數來進行計算。照相機參數包含內部參數與外部參數。又,照相機參數包含從照相機到工件的特徵部分的距離hz。與空間上任意的位置對應之照相機的圖像中之位置,是藉由針孔照相機的模型而一般以下式(1)來表示。 (Calculation model) Here, a calculation model for calculating a three-dimensional position in space corresponding to a specific position in an image taken by a camera is described. In the calculation model, camera parameters, which are sensor parameters including a plurality of parameters, are used for calculation. The camera parameters include internal parameters and external parameters. In addition, the camera parameters include the distance hz from the camera to the characteristic part of the workpiece. The position in the image of the camera corresponding to an arbitrary position in space is generally expressed by the following formula (1) using the pinhole camera model.

[數1] [Number 1]

三維的位置的座標值(X,Y,Z)是以例如基準座標系統71來表現。圖像上的位置的座標值(u,v)是以例如設定於圖像上的圖像座標系統73來表現。外部參數的矩陣是用以將空間中之基準座標系統71的座標值(X,Y,Z)轉換成照相機座標系統72的座標值(x,y,z)之轉換矩陣。又,內部參數的矩陣是用以將照相機座標系統72的座標值(x,y,z)轉換成圖像中之圖像座標系統73的座標值(u,v)之矩陣。在此,照相機座標系統72中之Z軸的座標值是對應於從照相機6到工件31的特徵部分的距離hz而預先決定。The coordinate values (X, Y, Z) of the three-dimensional position are expressed by, for example, a reference coordinate system 71. The coordinate values (u, v) of the position on the image are expressed by, for example, an image coordinate system 73 set on the image. The matrix of external parameters is a conversion matrix used to convert the coordinate values (X, Y, Z) of the reference coordinate system 71 in space into the coordinate values (x, y, z) of the camera coordinate system 72. In addition, the matrix of internal parameters is a matrix used to convert the coordinate values (x, y, z) of the camera coordinate system 72 into the coordinate values (u, v) of the image coordinate system 73 in the image. Here, the coordinate value of the Z axis in the camera coordinate system 72 is predetermined corresponding to the distance hz from the camera 6 to the characteristic part of the workpiece 31.

上述式(1)是不存在藉由透鏡的畸變等所造成的圖像的變形之理想例。相對於此,可考慮藉由透鏡的畸變等所造成的參數的變化等。首先,式(1)中之三維的位置與外部參數的矩陣之部分的運算能以下式(2)來表示。The above equation (1) is an ideal example in which there is no deformation of the image due to lens distortion, etc. In contrast, changes in parameters due to lens distortion, etc. can be considered. First, the calculation of the three-dimensional position and the matrix of the external parameters in equation (1) can be expressed as the following equation (2).

[數2] [Number 2]

依據式(2),可將以基準座標系統71所表現的座標值(X,Y,Z),轉換成以照相機座標系統72所表現的座標值(x,y,z)。接著,為了考慮圖像的變形,如下式(3)及式(4)所示地定義變數x'及變數y'。進而,將考慮到變形的變數x''及變數y'',如式(5)及式(6)所示地算出。在此,變數x'、變數y'及變數r的關係是如式(7)所示。According to formula (2), the coordinate values (X, Y, Z) expressed by the reference coordinate system 71 can be converted into coordinate values (x, y, z) expressed by the camera coordinate system 72. Next, in order to consider the deformation of the image, the variables x' and y' are defined as shown in the following formulas (3) and (4). Furthermore, the variables x'' and y'' taking the deformation into consideration are calculated as shown in formulas (5) and (6). Here, the relationship between the variables x', y' and r is as shown in formula (7).

[數3] [Number 3]

在式(5)及式(6)中,係數k 1~k 6是關於半徑方向的透鏡的畸變之係數,係數p 1、p 2是關於圓周方向的透鏡的畸變之係數。使用考慮到透鏡的畸變的變數x''及變數y'',圖像座標系統73的圖像上的座標值(u,v)可如下式(8)及下式(9)所示地算出。式(8)及式(9)是與藉由上述式(1)中之內部參數的矩陣所進行之運算對應的部分。 In equations (5) and (6), coefficients k1 to k6 are coefficients for lens distortion in the radial direction, and coefficients p1 and p2 are coefficients for lens distortion in the circumferential direction. Using variables x'' and y'' that take lens distortion into account, the coordinate values (u, v) on the image of the image coordinate system 73 can be calculated as shown in equations (8) and (9). Equations (8) and (9) are parts corresponding to the operations performed by the matrix of the internal parameters in equation (1) above.

[數4] [Number 4]

在上述說明中,說明了從空間上的三維的位置算出圖像中之位置的方法,不過可根據上述關係式,並根據圖像上的位置的座標值(u,v)及照相機座標系統72中之從照相機6到工件31的特徵部分的距離hz,來算出空間上的三維的位置(X,Y,Z)。對應於從照相機6到工件31的特徵部分的距離hz之照相機座標值的Z軸的座標值,可預先決定並使記憶部42記憶。推定位置算出部57根據計算模型,從圖像上的特定的位置的座標值(u,v)算出空間上的三維的位置(X,Y,Z)。In the above description, a method of calculating the position in the image from the three-dimensional position in space is described, but the three-dimensional position in space (X, Y, Z) can be calculated based on the above relationship and the coordinate value (u, v) of the position in the image and the distance hz from the camera 6 to the characteristic part of the workpiece 31 in the camera coordinate system 72. The coordinate value of the Z axis corresponding to the camera coordinate value of the distance hz from the camera 6 to the characteristic part of the workpiece 31 can be predetermined and stored in the memory unit 42. The estimated position calculation unit 57 calculates the three-dimensional position in space (X, Y, Z) from the coordinate value (u, v) of the specific position in the image based on the calculation model.

在此,參照式(1)至式(9),用以將照相機座標系統72的座標值變更為圖像座標系統73的座標值之參數相當於內部參數。在從圖像中之特定的位置算出三維的位置之計算模型中,例如焦距與圖像的有效尺寸之積f x、f y、圖像中心c x、c y、及關於變形之係數k 1~k 6、p 1、p 2相當於內部參數。又,用以將基準座標系統71的座標值轉換成照相機座標系統72的座標值之參數相當於外部參數。例如,式(1)的外部參數的矩陣所包含的參數相當於外部參數。 Here, referring to equations (1) to (9), the parameters used to convert the coordinate values of the camera coordinate system 72 into the coordinate values of the image coordinate system 73 are equivalent to the internal parameters. In the calculation model for calculating the three-dimensional position from a specific position in the image, for example, the product of the focal length and the effective size of the image f x , f y , the image center c x , cy , and the coefficients k 1 to k 6 , p 1 , p 2 related to the deformation are equivalent to the internal parameters. In addition, the parameters used to convert the coordinate values of the reference coordinate system 71 into the coordinate values of the camera coordinate system 72 are equivalent to the external parameters. For example, the parameters included in the matrix of the external parameters of equation (1) are equivalent to the external parameters.

(參數的評估及修正的控制) 就本實施形態的照相機參數的評估、及照相機參數的修正加以說明。在新設定照相機參數68的情況下,可藉由任意的方法來設定。例如,可以使用平板狀的校正板來製作照相機參數。例如大小互異之點的型樣呈格子狀描繪在校正板的表面上。校正板配置於架台35的預先決定的位置。 (Parameter evaluation and correction control) The evaluation of the camera parameters and the correction of the camera parameters in this embodiment are described. When the camera parameters 68 are newly set, they can be set by any method. For example, a flat correction plate can be used to make the camera parameters. For example, a pattern of points of different sizes is drawn in a grid shape on the surface of the correction plate. The correction plate is arranged at a predetermined position on the stand 35.

作業人員預先測定基準座標系統71中之校正板的位置。描繪於校正板上的點彼此的間隔是預先測定的。驅動機器人1,以在與校正板呈垂直的高度方向上,隔著預先決定的距離來配置照相機6。以照相機6來拍攝校正板的點型樣。The operator pre-measures the position of the calibration plate in the reference coordinate system 71. The intervals between the points drawn on the calibration plate are pre-measured. The robot 1 is driven to arrange the camera 6 at a predetermined distance in the height direction perpendicular to the calibration plate. The camera 6 is used to photograph the dot pattern of the calibration plate.

接著,將照相機6相對於校正板移動到任意的位置。例如,將照相機6往照相機6的光軸方向移動。取得在照相機6的複數個位置所拍攝的圖像中之圖像座標系統73的校正板之點的位置、機器人的位置及姿勢、及預先測定的校正板之點在基準座標系統71中之位置。然後,根據式(1)或式(8)及式(9),來生成照相機參數。Next, the camera 6 is moved to an arbitrary position relative to the calibration plate. For example, the camera 6 is moved in the direction of the optical axis of the camera 6. The positions of the points of the calibration plate in the image coordinate system 73, the position and posture of the robot, and the positions of the points of the calibration plate in the reference coordinate system 71 measured in advance are obtained in the images taken at multiple positions of the camera 6. Then, the camera parameters are generated according to equation (1) or equation (8) and equation (9).

在圖4,顯示本實施形態的照相機及工件的概略側視圖。在圖4中,重疊記載有校正板32與工件31。校正板32的上表面描繪有點型樣。校正板32的上表面與照相機6是隔著距離hc來配置。Fig. 4 shows a schematic side view of the camera and the workpiece of this embodiment. In Fig. 4, a correction plate 32 and a workpiece 31 are superimposed. A dot pattern is drawn on the upper surface of the correction plate 32. The upper surface of the correction plate 32 and the camera 6 are arranged at a distance hc.

本實施形態的工件31比校正板32更厚。工件31的特徵部分即板狀部31b的上表面與照相機6的距離hz比距離hc還要短距離差Δh。如此,使用於三維的位置的算出之距離hz有時會與預先設定的距離hc不同。因此,有時難以正確取得反映距離差Δh之距離hz。The workpiece 31 of this embodiment is thicker than the correction plate 32. The distance hz between the upper surface of the plate-shaped portion 31b, which is the characteristic portion of the workpiece 31, and the camera 6 is shorter than the distance hc by the distance difference Δh. As a result, the distance hz used for calculating the three-dimensional position may be different from the preset distance hc. Therefore, it is sometimes difficult to correctly obtain the distance hz that reflects the distance difference Δh.

或,作業人員可拍攝包含特徵部分之工件31,來生成用以進行型樣匹配的基準圖像。在此基準圖像中,有時包含圖像的變形或特徵部分的形狀的誤差等。進而,若以機器人裝置繼續作業,隨著時間推移,用以檢測正確的工件的三維的位置之照相機參數之值會偏離,有時會無法算出工件的正確的推定位置。Alternatively, the operator may take a picture of the workpiece 31 including the feature portion to generate a reference image for pattern matching. This reference image may contain image deformation or errors in the shape of the feature portion. Furthermore, if the robot continues to operate, the values of the camera parameters used to detect the correct three-dimensional position of the workpiece may deviate over time, and the correct estimated position of the workpiece may sometimes be unable to be calculated.

在新生成照相機參數時、及藉由機器人裝置來繼續作業時,照相機參數所包含的各個參數有時會從最佳的值偏離。因此,本實施形態的控制裝置2評估照相機參數。亦即,在使用現在的照相機參數的情況下,判定是否能以容許範圍內的誤差,來從圖像檢測工件的三維的位置。然後,在照相機參數的評估低的情況下,修正照相機參數。When the camera parameters are newly generated and the robot device continues the operation, the parameters included in the camera parameters may deviate from the optimal value. Therefore, the control device 2 of this embodiment evaluates the camera parameters. That is, when using the current camera parameters, it is determined whether the three-dimensional position of the workpiece can be detected from the image with an error within the allowable range. Then, when the evaluation of the camera parameters is low, the camera parameters are corrected.

在圖5,顯示實施本實施形態的照相機參數的評估及照相機參數的修正之控制的流程圖。在此,用以進行型樣匹配的基準圖像是預先生成的。又,為了進行照相機參數的評估及修正,拍攝圖像時從照相機6到工件31的特徵部分即上表面的距離hz是預先決定的。又,照相機6的姿勢是預先決定的。在本實施形態,機器人1的姿勢是預先決定的,以使照相機座標系統72的Z方向與工件31的上表面呈垂直。又,機器人1的姿勢是預先決定的,以使照相機座標系統72的X軸與基準座標系統71的X軸呈平行。再者,如後述,距離hz亦可修正為照相機參數的1種。FIG5 shows a flow chart of the control of the evaluation of the camera parameters and the correction of the camera parameters for implementing the present embodiment. Here, the reference image for pattern matching is generated in advance. Furthermore, in order to evaluate and correct the camera parameters, the distance hz from the camera 6 to the characteristic part, i.e., the upper surface, of the workpiece 31 when taking the image is predetermined. Furthermore, the posture of the camera 6 is predetermined. In the present embodiment, the posture of the robot 1 is predetermined so that the Z direction of the camera coordinate system 72 is perpendicular to the upper surface of the workpiece 31. Furthermore, the posture of the robot 1 is predetermined so that the X axis of the camera coordinate system 72 is parallel to the X axis of the reference coordinate system 71. Furthermore, as described later, distance hz can also be corrected as one of the camera parameters.

參照圖1、圖2、及圖5,在步驟101,將照相機6移動到第1位置P6a。作為第1位置P6a,可選定能以照相機6來拍攝工件31的特徵部分之任意的位置。在本實施形態中,如圖1所示,調整機器人1的位置及姿勢,以使照相機6配置於工件31的正上方。作業人員以教示操作盤26來修正機器人1的位置及姿勢。或,動作指令生成部64亦可控制機器人1的位置及姿勢,以使照相機6移動到預先決定的第1位置P6a。Referring to Fig. 1, Fig. 2, and Fig. 5, in step 101, the camera 6 is moved to the first position P6a. As the first position P6a, any position at which the characteristic portion of the workpiece 31 can be photographed by the camera 6 can be selected. In the present embodiment, as shown in Fig. 1, the position and posture of the robot 1 are adjusted so that the camera 6 is arranged directly above the workpiece 31. The operator corrects the position and posture of the robot 1 using the teaching operation panel 26. Alternatively, the action command generation unit 64 can also control the position and posture of the robot 1 so that the camera 6 moves to the predetermined first position P6a.

實測位置算出部52根據機器人1的位置及姿勢,算出照相機6配置於第1位置P6a時之第1實測位置。在本實施形態,將根據移動裝置的驅動狀態所算出的其中一個構件的位置,稱為實測位置。照相機座標系統72相對於工具座標系統74之相對的位置及姿勢是預先決定的。實測位置算出部52例如能以基準座標系統71中之座標值,來算出照相機6的第1實測位置。The measured position calculation unit 52 calculates the first measured position when the camera 6 is arranged at the first position P6a based on the position and posture of the robot 1. In this embodiment, the position of one of the components calculated based on the driving state of the moving device is called the measured position. The relative position and posture of the camera coordinate system 72 with respect to the tool coordinate system 74 are predetermined. The measured position calculation unit 52 can calculate the first measured position of the camera 6, for example, using the coordinate value in the reference coordinate system 71.

在步驟102,攝像控制部53以照相機6來拍攝工件31。特言之,照相機6拍攝工件31的特徵部分即板狀部31b的上表面。In step 102, the imaging control unit 53 uses the camera 6 to photograph the workpiece 31. Specifically, the camera 6 photographs the upper surface of the plate-shaped portion 31b, which is a characteristic portion of the workpiece 31.

在步驟103,特徵檢測部56根據基準圖像,檢測照相機6配置於第1位置P6a時所拍攝的圖像中之特徵部分。特徵檢測部56藉由型樣匹配來檢測特徵部分。在本實施形態中,檢測工件31的板狀部31b的上表面的緣部31c。特徵檢測部56以圖像座標系統73來算出板狀部31b的上表面的特定點31p的位置,來作為圖像中之工件31的位置。In step 103, the feature detection unit 56 detects the feature portion in the image taken when the camera 6 is configured at the first position P6a based on the reference image. The feature detection unit 56 detects the feature portion by pattern matching. In this embodiment, the edge 31c of the upper surface of the plate-shaped portion 31b of the workpiece 31 is detected. The feature detection unit 56 calculates the position of the specific point 31p on the upper surface of the plate-shaped portion 31b using the image coordinate system 73 as the position of the workpiece 31 in the image.

在圖6,顯示將照相機配置於第1位置時以照相機所拍攝的圖像。在以照相機6所拍攝的圖像81中設定有圖像座標系統73。圖像座標系統73是以U軸及V軸來構成。在圖像81中拍到工件的圖像31g。又,在圖像81中,顯示有表示特徵檢測部56以型樣匹配檢測到的特徵部分的位置之標記31m。在此之例中,標記31m由2條交叉之線來構成。2條線的交點為表示特徵部分的位置(工件31的位置)之特定點31p。FIG6 shows an image taken by the camera when the camera is arranged at the first position. An image coordinate system 73 is set in the image 81 taken by the camera 6. The image coordinate system 73 is composed of the U axis and the V axis. An image 31g of the workpiece is captured in the image 81. In addition, in the image 81, a mark 31m is displayed indicating the position of the feature portion detected by the feature detection unit 56 by pattern matching. In this example, the mark 31m is composed of two intersecting lines. The intersection of the two lines is a specific point 31p indicating the position of the feature portion (the position of the workpiece 31).

參照圖5,在步驟103,推定位置算出部57檢測照相機6配置於第1位置時之工件31的第1推定位置。在本實施形態,將根據以照相機所拍攝的圖像所算出的工件的位置,稱為推定位置。作為推定位置,能以照相機座標系統72的座標值,來算出特徵部分的特定點31p的位置。推定位置算出部57根據圖像中之工件31的特徵部分的位置、機器人1的位置及姿勢、照相機參數、及距離hz,根據前述式(1)或式(2)至式(9)來算出工件31的第1推定位置。Referring to FIG. 5 , in step 103, the estimated position calculation unit 57 detects the first estimated position of the workpiece 31 when the camera 6 is arranged at the first position. In the present embodiment, the position of the workpiece calculated based on the image captured by the camera is referred to as the estimated position. As the estimated position, the position of the specific point 31p of the characteristic portion can be calculated using the coordinate value of the camera coordinate system 72. The estimated position calculation unit 57 calculates the first estimated position of the workpiece 31 based on the position of the characteristic portion of the workpiece 31 in the image, the position and posture of the robot 1, the camera parameters, and the distance hz according to the aforementioned equation (1) or equations (2) to (9).

接著,在步驟104,控制機器人1的位置及姿勢,以使照相機6配置於第2位置P6b。第2位置P6b是與第1位置P6a不同的位置。作為第2位置P6b,可選定能以照相機6來拍攝工件31的特徵部分之任意的位置。在本實施形態中,在各個照相機的第1位置及第2位置P6b,照相機6的姿勢幾乎固定。例如,照相機座標系統72的Z軸的方向維持與鉛直方向呈平行。又,維持照相機6的姿勢,以使照相機座標系統72的X軸的方向及Y軸的方向為一定。Next, in step 104, the position and posture of the robot 1 are controlled so that the camera 6 is arranged at the second position P6b. The second position P6b is a position different from the first position P6a. As the second position P6b, any position at which the characteristic portion of the workpiece 31 can be photographed by the camera 6 can be selected. In the present embodiment, the posture of the camera 6 is almost fixed at the first position and the second position P6b of each camera. For example, the direction of the Z axis of the camera coordinate system 72 is maintained parallel to the vertical direction. In addition, the posture of the camera 6 is maintained so that the directions of the X axis and the Y axis of the camera coordinate system 72 are constant.

在圖7,顯示將照相機配置於第2位置時之第1機器人裝置的概略圖。作業人員操作教示操作盤26來變更機器人的位置及姿勢,藉此如箭頭98所示,將照相機6往與工件31的特徵部分的表面呈平行的方向移動,並配置於第2位置P6b。從工件31的特徵部分到照相機6的距離hz維持一定。又,移動照相機6,以使照相機6的視野6a的內部包含工件31的特徵部分。或,動作指令生成部64亦可控制機器人1的位置及姿勢,以使照相機6移動到預先決定的第2位置P6b。FIG7 shows a schematic diagram of the first robot device when the camera is arranged at the second position. The operator operates the teaching operation panel 26 to change the position and posture of the robot, thereby moving the camera 6 in a direction parallel to the surface of the characteristic portion of the workpiece 31 as shown by the arrow 98, and arrange it at the second position P6b. The distance hz from the characteristic portion of the workpiece 31 to the camera 6 is maintained constant. In addition, the camera 6 is moved so that the interior of the field of view 6a of the camera 6 includes the characteristic portion of the workpiece 31. Alternatively, the action command generation unit 64 can also control the position and posture of the robot 1 so that the camera 6 moves to the predetermined second position P6b.

參照圖5,在步驟104,實測位置算出部52根據機器人1的位置及姿勢,算出照相機6配置於第2位置P6b時之第2實測位置。實測位置算出部52例如能以基準座標系統71之座標值,來算出照相機6的第2實測位置。5 , in step 104, the measured position calculation unit 52 calculates the second measured position when the camera 6 is arranged at the second position P6b based on the position and posture of the robot 1. The measured position calculation unit 52 can calculate the second measured position of the camera 6 using the coordinate values of the reference coordinate system 71, for example.

在步驟105,照相機6拍攝工件31。在步驟106,實施與步驟103同樣的控制。特徵檢測部56檢測照相機6配置於第2位置P6b時所拍攝的圖像中之特徵部分。進而,特徵檢測部56檢測圖像中之特徵部分的位置。In step 105, the camera 6 photographs the workpiece 31. In step 106, the same control as in step 103 is performed. The feature detection unit 56 detects the feature portion in the image photographed when the camera 6 is arranged at the second position P6b. Furthermore, the feature detection unit 56 detects the position of the feature portion in the image.

在圖8,顯示將照相機配置於第2位置P6b時以照相機所拍攝的圖像。在圖像82中,工件的圖像31g的位置會移動。又,由於從工件31的傾斜方向拍攝圖像82,因此稍微拍攝有工件31的板狀部31a、31b的側面。在圖像82中,顯示以特徵檢測部56檢測到的特徵部分的位置之標記31m及特定點31p。FIG8 shows an image taken by the camera when the camera is placed at the second position P6b. In the image 82, the position of the image 31g of the workpiece moves. In addition, since the image 82 is taken from the tilted direction of the workpiece 31, the side surfaces of the plate-like parts 31a and 31b of the workpiece 31 are slightly photographed. In the image 82, the mark 31m and the specific point 31p of the position of the feature part detected by the feature detection unit 56 are shown.

參照圖5,在步驟106,推定位置算出部57以照相機座標系統72來算出照相機6配置於第2位置時之第2推定位置。推定位置算出部57使用圖像中之特徵部分的位置、機器人1的位置及姿勢、照相機參數、及距離hz,來算出工件31的第2推定位置。5, in step 106, the estimated position calculation unit 57 calculates the second estimated position when the camera 6 is arranged at the second position using the camera coordinate system 72. The estimated position calculation unit 57 calculates the second estimated position of the workpiece 31 using the position of the feature part in the image, the position and posture of the robot 1, the camera parameters, and the distance hz.

接著,在步驟107,評估部58算出第1實測位置與第2實測位置之間的移動量。評估部58算出從第1推定位置到第2推定位置的距離。在此,在照相機參數正確的情況下,第1實測位置與第2實測位置之間的移動量、及從第1推定位置到第2推定位置的距離幾乎相同。在本實施形態,將第1實測位置與第2實測位置之間的移動量,稱為實測位置的移動量。又,將從第1推定位置到第2推定位置的距離,稱為推定位置彼此的距離。Next, in step 107, the evaluation unit 58 calculates the amount of movement between the first measured position and the second measured position. The evaluation unit 58 calculates the distance from the first estimated position to the second estimated position. Here, when the camera parameters are correct, the amount of movement between the first measured position and the second measured position and the distance from the first estimated position to the second estimated position are almost the same. In this embodiment, the amount of movement between the first measured position and the second measured position is referred to as the amount of movement of the measured position. In addition, the distance from the first estimated position to the second estimated position is referred to as the distance between the estimated positions.

在步驟108,評估部58評估照相機參數。在本實施形態,評估部58根據實測位置的移動量與推定位置彼此的距離,來評估照相機參數。在本實施形態,算出從推定位置彼此的距離減去實測位置的移動量所得之誤差。評估部判定誤差的大小(誤差的絕對值)是否小於預先決定的判定值。判定值是例如可因應實測值位置的移動量的大小來設定。或,可對所有實測位置的移動量,設置一定的判定值。In step 108, the evaluation unit 58 evaluates the camera parameters. In the present embodiment, the evaluation unit 58 evaluates the camera parameters based on the movement amount of the measured position and the distance between the estimated positions. In the present embodiment, the error obtained by subtracting the movement amount of the measured position from the distance between the estimated positions is calculated. The evaluation unit determines whether the size of the error (the absolute value of the error) is less than a predetermined judgment value. The judgment value can be set, for example, in accordance with the size of the movement amount of the measured value position. Alternatively, a certain judgment value can be set for the movement amount of all measured positions.

在步驟108,在誤差的大小小於預先決定的判定值的情況下,可判定為能以現在所設定的照相機參數,來精度良好地算出工件的推定位置。可判定為無須修正現在的照相機參數。此情況下,即結束控制。In step 108, when the magnitude of the error is smaller than a predetermined judgment value, it can be determined that the estimated position of the workpiece can be calculated with good accuracy using the currently set camera parameters. It can be determined that there is no need to correct the current camera parameters. In this case, the control is terminated.

另一方面,在推定位置彼此的距離相對於實測位置的移動量之誤差為預先決定的判定值以上的情況下,可判定為藉由現在的照相機參數來算出的工件的推定位置包含有容許值以上的誤差。此情況下,為了修正照相機參數,控制轉移到步驟109。On the other hand, when the error of the distance between the estimated positions relative to the movement amount of the measured position is greater than a predetermined judgment value, it can be determined that the estimated position of the workpiece calculated by the current camera parameters contains an error greater than the allowable value. In this case, control is transferred to step 109 in order to correct the camera parameters.

再者,評估部58能以任意的方法來評估照相機參數。例如,評估部58亦可根據推定位置彼此的距離對實測位置的移動量之比率,來進行照相機參數的評估。評估部58可判定為此比率越接近1,照相機參數的精度越良好。評估部亦可決定比率的判定值,並評估照相機參數。Furthermore, the evaluation unit 58 can evaluate the camera parameters in any method. For example, the evaluation unit 58 can also evaluate the camera parameters based on the ratio of the distance between the estimated positions to the movement amount of the measured positions. The evaluation unit 58 can determine that the closer this ratio is to 1, the better the accuracy of the camera parameters. The evaluation unit can also determine the judgment value of the ratio and evaluate the camera parameters.

在步驟109,選定部59選定照相機參數所包含的複數個參數當中之要修正的參數。作業人員可選定要修正的參數,並以教示操作盤26的輸入部27來輸入。或,作業人員亦可選定照相機參數所包含的所有參數。選定部59可因應作業人員的操作,來設定要修正的參數。或,選定部59可藉由預先決定的控制,來自動地選定要修正的參數。或,亦可不以選定部59來選定參數,而預先決定照相機參數所包含的複數個參數當中之要修正的參數。In step 109, the selection unit 59 selects the parameter to be corrected from among the plurality of parameters included in the camera parameters. The operator can select the parameter to be corrected and input it using the input unit 27 of the teaching operation panel 26. Alternatively, the operator can also select all the parameters included in the camera parameters. The selection unit 59 can set the parameter to be corrected in response to the operator's operation. Alternatively, the selection unit 59 can automatically select the parameter to be corrected by a predetermined control. Alternatively, the parameter to be corrected from among the plurality of parameters included in the camera parameters can be predetermined instead of selecting the parameter using the selection unit 59.

接著,在步驟110,修正部60修正以選定部59所選定的參數。修正部60根據第1實測位置與第2實測位置之間的移動量、與第1推定位置及第2推定位置,來修正照相機參數。若照相機參數的精度好,則實測位置的移動量與推定位置彼此的距離幾乎相同。在本實施形態,修正部60算出實測位置的移動量與推定位置彼此的距離之誤差。例如,修正部60算出從推定位置彼此的距離減去實測位置的移動量所得之誤差。Next, in step 110, the correction unit 60 corrects the parameters selected by the selection unit 59. The correction unit 60 corrects the camera parameters based on the amount of movement between the first measured position and the second measured position, and the first estimated position and the second estimated position. If the accuracy of the camera parameters is good, the amount of movement of the measured position and the distance between the estimated positions are almost the same. In this embodiment, the correction unit 60 calculates the error between the amount of movement of the measured position and the distance between the estimated positions. For example, the correction unit 60 calculates the error obtained by subtracting the amount of movement of the measured position from the distance between the estimated positions.

(參數的修正方法) 在此,就藉由本實施形態的修正部60所進行之照相機參數的修正方法加以說明。控制裝置2以機器人1來變更第1位置及第2位置當中之至少其中一個位置,並重複攝像。以與以選定部59所選定的參數的個數對應之次數來重複攝像。修正部60可根據已重複攝像的圖像,以誤差成為最小的方式來修正照相機參數。 (Parameter correction method) Here, the method for correcting camera parameters by the correction unit 60 of the present embodiment is described. The control device 2 changes at least one of the first position and the second position by the robot 1 and repeats the shooting. The shooting is repeated a number of times corresponding to the number of parameters selected by the selection unit 59. The correction unit 60 can correct the camera parameters in a manner that minimizes the error based on the repeatedly shot images.

在本實施形態的第1機器人裝置3,從照相機座標系統72的座標值往基準座標系統71的座標值之轉換,可藉由包含矩陣R及變數t之式(2)來表示。接著,若以(Dx c,Dy c,Dz c)來表示照相機座標系統72中之實測位置的移動量,照相機座標系統72中之實測位置的移動量能以下式(10)來從基準座標系統71中之實測位置的移動量(Dx w,Dy w,Dz w)算出。 In the first robot device 3 of the present embodiment, the conversion from the coordinate value of the camera coordinate system 72 to the coordinate value of the reference coordinate system 71 can be expressed by the equation (2) including the matrix R and the variable t. Next, if the movement amount of the measured position in the camera coordinate system 72 is expressed by ( Dxc , Dyc , Dzc ), the movement amount of the measured position in the camera coordinate system 72 can be calculated from the movement amount of the measured position in the reference coordinate system 71 ( Dxw , Dyw , Dzw ) by the following equation (10).

[數5] [Number 5]

接著,在圖像座標系統73中,工件的位置從對應於第1位置之座標值(u1,v1)移動到對應於第2位置之座標值(u2,v2)。各個圖像座標系統73的座標值可根據從照相機到特徵部分的距離hz及參數c、f、k、p,並藉由式(1)或式(2)至式(9)來轉換成照相機座標系統72的座標值(x 1,y 1,hz)與座標值(x 2,y 2,hz)。藉由將式(10)變形,可以導出式(11)。 Next, in the image coordinate system 73, the position of the workpiece moves from the coordinate value (u1, v1) corresponding to the first position to the coordinate value (u2, v2) corresponding to the second position. The coordinate values of each image coordinate system 73 can be converted into the coordinate value (x1, y1, hz) and the coordinate value (x2, y2, hz) of the camera coordinate system 72 by using equation (1) or equation (2) to equation (9) according to the distance hz from the camera to the feature part and the parameters c, f , k , p. By transforming equation (10), equation (11) can be derived.

[數6] [Number 6]

在此,式(11)的左邊的[(x 1,y 1,hz)-(x 2,y 2,hz)]是對應於照相機座標系統72中之推定位置彼此的距離。左邊的R(Dx w,Dy w,Dz w)為照相機座標系統中之實測位置的移動量。在從圖像所算出的推定位置彼此的距離與實測位置的移動量相等的情況下,可判定為照相機參數正確。亦即,在照相機參數的精度高時,式(11)會成立。或,將式(11)變形後的式(12)會成立。 Here, [( x1 , y1 , hz)-( x2 , y2 , hz)] on the left side of equation (11) corresponds to the distance between the estimated positions in the camera coordinate system 72. R ( Dxw , Dyw , Dzw ) on the left side is the amount of movement of the measured position in the camera coordinate system. When the distance between the estimated positions calculated from the image is equal to the amount of movement of the measured position, it can be determined that the camera parameters are correct. That is, when the accuracy of the camera parameters is high, equation (11) is established. Alternatively, equation (12) which is a modification of equation (11) is established.

式(12)的左邊是對應於實測位置的移動量之測定值。亦即,對應於從機器人的位置及姿勢所算出的照相機的實測位置的移動量。式(12)的右邊是對應於從圖像的特徵部分的位置、參數c、f、k、p、及矩陣R求出之工件的推定位置彼此的距離。在式(12)中,以基準座標系統71來表現。實際上,由於照相機參數的誤差,式(12)不會成立。藉由導入誤差ΔD,可以根據式(12)來導出式(13)。式(13)的左邊的(ΔDx,ΔDy,ΔDz)是對應於從推定位置彼此的距離減去實測位置的移動量所得之誤差ΔD。The left side of equation (12) is the measured value corresponding to the movement amount of the measured position. That is, it corresponds to the movement amount of the measured position of the camera calculated from the position and posture of the robot. The right side of equation (12) corresponds to the distance between the estimated positions of the workpiece obtained from the position of the feature part of the image, parameters c, f, k, p, and matrix R. In equation (12), it is expressed as a reference coordinate system 71. In practice, due to the error of the camera parameters, equation (12) does not hold. By introducing the error ΔD, equation (13) can be derived from equation (12). The (ΔDx, ΔDy, ΔDz) on the left side of equation (13) corresponds to the error ΔD obtained by subtracting the movement amount of the measured position from the distance between the estimated positions.

修正部60是以牛頓法來算出已選定的參數,以使式(13)的左邊的(ΔDx,ΔDy,ΔDz)接近(0,0,0)。修正部60可算出牛頓法的函數並以疊代法來重複計算,藉此算出已選定的參數。在使用該2點間的誤差之方法中,可1個1個地算出參數。The correction unit 60 calculates the selected parameters by Newton's method so that (ΔDx, ΔDy, ΔDz) on the left side of equation (13) approaches (0, 0, 0). The correction unit 60 can calculate the selected parameters by calculating the function of Newton's method and repeatedly calculating by the iterative method. In the method using the error between the two points, the parameters can be calculated one by one.

接著,說明算出照相機參數的其他例。式(12)的右邊是參數c、f、k、p、矩陣R、及距離hz的函數。因此,基準座標系統中之實測位置的移動量(Dx w,Dy w,Dz w)能以下式(14)至(16)來表示。 Next, another example of calculating the camera parameters is described. The right side of equation (12) is a function of the parameters c, f, k, p, matrix R, and distance hz. Therefore, the displacement (Dxw, Dyw , Dzw ) of the measured position in the reference coordinate system can be expressed by the following equations (14) to (16).

[數7] [Number 7]

例如,式(14)的右邊的Dx w(c,f,k,p,R,hz,u,v)是表示參數c、f、k、p、矩陣R、距離hz、及圖像的座標值(u,v)之函數。接著,可根據圖像中之座標值(u,v)及移動量(Dx w,Dy w,Dz w)的實測值,使用最小平方法來算出參數。例如,在使用Gauss-Newton(高斯-牛頓)法來算出參數f x、f y及距離hz的情況下,可藉由使用下式(17)求出Δf x、Δf y及Δhz,對實測值來修正參數f x、f y及距離hz。可藉由以奇異值分解法算出左邊的矩陣的反矩陣,來計算Δf x、Δf y及Δhz。可藉由重複該操作,來使參數f x、f y及距離hz接近真值。 For example, Dxw (c, f, k, p, R, hz, u, v) on the right side of equation (14) is a function representing parameters c, f, k, p, matrix R, distance hz, and image coordinate values (u, v). Then, the least square method can be used to calculate the parameters based on the measured values of the image coordinate values (u, v) and the displacement ( Dxw , Dyw , Dzw ). For example, when the Gauss-Newton method is used to calculate the parameters fx , fy , and distance hz, Δfx , Δfy , and Δhz can be obtained by using the following equation (17), and the parameters fx , fy , and distance hz can be corrected for the measured values. Δf x , Δf y , and Δhz can be calculated by calculating the inverse matrix of the matrix on the left using the singular value decomposition method. By repeating this operation, the parameters f x , f y , and distance hz can be made close to the true value.

[數8] [Number 8]

在於複數個移動點取得了資料的情況下,在各個位置之點附上號碼,並在數式中附上註標來標記,即成為下式(18)。When data is obtained from multiple moving points, a number is attached to each point at each position and an annotation is attached to the formula to mark it, which becomes the following formula (18).

[數9] [Number 9]

在針對更多的變數同時算出的情況下,可藉由將式(17)擴充來算出。例如,若包含參數c x、c y,即成為下式(19)。 When more variables are calculated at the same time, the equation (17) can be expanded. For example, if the parameters c x and cy are included, the equation (19) becomes as follows.

[數10] [Number 10]

(誤差的圖表的顯示) 在本實施形態的控制裝置2中,顯示控制部63可將實測位置的移動量、與推定位置彼此的距離相對於實測位置的移動量之誤差的關係,顯示於顯示部28。在本實施形態的實施形態,可將圖9至圖14所示之圖表顯示於顯示部28。 (Display of graph of error) In the control device 2 of this embodiment, the display control unit 63 can display the relationship between the movement amount of the measured position and the error of the distance between the estimated positions relative to the movement amount of the measured position on the display unit 28. In the embodiment of this embodiment, the graphs shown in Figures 9 to 14 can be displayed on the display unit 28.

圖9是顯示基準座標系統中之實測位置的X方向的移動量、與推定位置彼此的距離相對於實測位置的移動量之誤差的關係的圖表。圖10是顯示基準座標系統中之實測位置的Y方向的移動量、與推定位置彼此的距離相對於實測位置的移動量之誤差的關係的圖表。Fig. 9 is a graph showing the relationship between the X-direction shift amount of the measured position in the reference coordinate system and the error of the distance between the estimated positions relative to the shift amount of the measured position. Fig. 10 is a graph showing the relationship between the Y-direction shift amount of the measured position in the reference coordinate system and the error of the distance between the estimated positions relative to the shift amount of the measured position.

例如,如圖7的箭頭98所示,將照相機6往基準座標系統71的X軸的方向移動。可在照相機6的1個第1位置及照相機6的複數個第2位置,拍攝工件31的圖像。修正部60在各個實測位置,算出推定位置彼此的距離相對於實測位置的移動量之誤差。再者,顯示控制部63或評估部58亦可取代修正部60來算出誤差。顯示控制部63將實測位置的移動量與誤差的關係顯示於顯示部28。此處的誤差與X方向及Y方向無關,為任意的方向的誤差。For example, as shown by arrow 98 in FIG. 7 , the camera 6 is moved in the direction of the X axis of the reference coordinate system 71. The image of the workpiece 31 can be captured at one first position of the camera 6 and at a plurality of second positions of the camera 6. The correction unit 60 calculates the error of the distance between the estimated positions relative to the movement amount of the measured position at each measured position. Furthermore, the display control unit 63 or the evaluation unit 58 can also calculate the error instead of the correction unit 60. The display control unit 63 displays the relationship between the movement amount of the measured position and the error on the display unit 28. The error here is independent of the X direction and the Y direction and is an error in an arbitrary direction.

藉由圖9及圖10的圖表,可得知相對於實測位置之誤差的傾向。例如,可從相對於實測位置之誤差的傾向來推定包含誤差之參數,並決定應修正的參數。或,可推測誤差成為最大的位置,來確認誤差的最大值。The tendency of the error relative to the measured position can be known from the graphs of FIG9 and FIG10. For example, the parameter containing the error can be estimated from the tendency of the error relative to the measured position, and the parameter to be corrected can be determined. Alternatively, the position where the error is the largest can be estimated to confirm the maximum value of the error.

圖11是顯示將照相機往基準座標系統的X方向移動時之X方向的誤差及Y方向的誤差的圖表。圖12是顯示將照相機往基準座標系統的Y方向移動時之Y方向的誤差及X方向的誤差的圖表。參照圖11及圖12,在此例中,與移動了照相機之方向相同方向的誤差隨著移動量的增加而變大。又,與移動了照相機之方向呈垂直的方向上的誤差幾乎沒有變化。此情況下,可判定為從照相機到工件的特徵部分的距離hz的設定錯誤。FIG. 11 is a graph showing the error in the X direction and the error in the Y direction when the camera is moved in the X direction of the reference coordinate system. FIG. 12 is a graph showing the error in the Y direction and the error in the X direction when the camera is moved in the Y direction of the reference coordinate system. Referring to FIG. 11 and FIG. 12, in this example, the error in the same direction as the direction in which the camera is moved increases as the amount of movement increases. In addition, the error in the direction perpendicular to the direction in which the camera is moved hardly changes. In this case, it can be determined that the distance hz from the camera to the feature portion of the workpiece is set incorrectly.

圖13及圖14是在與圖11及圖12不同的狀態下測定誤差的圖表。圖13是顯示將照相機往基準座標系統的X方向移動時之X方向的誤差及Y方向的誤差的圖表。圖14是將照相機往基準座標系統的Y方向移動時之Y方向的誤差及X方向的誤差的圖表。參照圖13及圖14,在此例中,移動了照相機之方向上的誤差、及與移動了照相機之方向呈垂直的方向上的誤差變大。此情況下,可判定為照相機座標系統的設定錯誤。例如,可判定為照相機座標系統繞著R軸具有誤差。因此,可判定為要修正關於照相機座標系統的設定之外部參數。FIG. 13 and FIG. 14 are graphs showing errors measured under conditions different from those of FIG. 11 and FIG. 12. FIG. 13 is a graph showing the error in the X direction and the error in the Y direction when the camera is moved in the X direction of the reference coordinate system. FIG. 14 is a graph showing the error in the Y direction and the error in the X direction when the camera is moved in the Y direction of the reference coordinate system. Referring to FIG. 13 and FIG. 14, in this example, the error in the direction in which the camera is moved and the error in the direction perpendicular to the direction in which the camera is moved become larger. In this case, it can be determined that the camera coordinate system is set incorrectly. For example, it can be determined that the camera coordinate system has an error around the R axis. Therefore, it can be determined that the external parameters related to the setting of the camera coordinate system need to be corrected.

如此,藉由顯示部28顯示實測位置的移動量、與推定位置彼此的距離相對於實測位置的移動量之誤差的關係,作業人員可視覺地理解誤差的大小。亦即,可視覺地判斷照相機參數的精度。In this way, by displaying the relationship between the movement amount of the measured position and the error of the distance between the estimated positions with respect to the movement amount of the measured position on the display unit 28, the operator can visually understand the magnitude of the error. In other words, the operator can visually judge the accuracy of the camera parameters.

作業人員或評估部58可以根據顯示於顯示部28的圖表,來判定是否要修正照相機參數。又,作業人員或選定部59可根據移動了照相機之方向上的誤差、及與移動了照相機之方向呈垂直的方向上的誤差,來選定要修正的參數。亦即,可選定推定位置是無法精度良好地算出的原因之參數。The operator or the evaluation unit 58 can determine whether to correct the camera parameters based on the graph displayed on the display unit 28. In addition, the operator or the selection unit 59 can select the parameters to be corrected based on the error in the direction in which the camera is moved and the error in the direction perpendicular to the direction in which the camera is moved. In other words, the parameters that are the reason why the estimated position cannot be calculated with good accuracy can be selected.

再者,作為表示實測位置的移動量、與推定位置彼此的距離相對於實測位置的移動量之誤差的關係的圖像,不限於圖表,可顯示任意的圖像。例如,顯示部亦可顯示表示實測位置的移動量與誤差的表。Furthermore, the image showing the relationship between the measured position shift amount and the distance between the estimated position and the error of the measured position shift amount is not limited to a graph, and any image may be displayed. For example, the display unit may display a table showing the measured position shift amount and the error.

(工件的推定圖像的顯示) 參照圖2,圖像處理部51的圖像推定部61根據照相機6配置於第1位置時所拍攝的特徵部分的圖像、照相機參數、及實測位置的移動量,來推定照相機配置於第2位置時之特徵部分的圖像。顯示控制部63可將以圖像推定部61所推定的特徵部分的圖像,重疊於照相機6配置於第2位置時所拍攝的特徵部分的圖像來顯示。 (Display of estimated image of workpiece) Referring to FIG. 2, the image estimation unit 61 of the image processing unit 51 estimates the image of the characteristic portion when the camera 6 is arranged at the second position based on the image of the characteristic portion photographed when the camera 6 is arranged at the first position, the camera parameters, and the movement amount of the measured position. The display control unit 63 can display the image of the characteristic portion estimated by the image estimation unit 61 by superimposing it on the image of the characteristic portion photographed when the camera 6 is arranged at the second position.

在圖15,顯示包含在第2位置拍攝了工件時推定的工件的推定圖像之圖像。在圖像89中,顯示有在第2位置實際地拍攝了工件31時之工件的圖像31g、及以圖像推定部61所推定的工件的推定圖像31r。特定點31p顯示工件的實際的圖像31g中之工件31的特徵部分的位置。In Fig. 15, an image including an estimated image of the workpiece estimated when the workpiece is photographed at the second position is displayed. In the image 89, an image 31g of the workpiece when the workpiece 31 is actually photographed at the second position and an estimated image 31r of the workpiece estimated by the image estimation unit 61 are displayed. The specific point 31p indicates the position of the characteristic portion of the workpiece 31 in the actual image 31g of the workpiece.

參照圖6及圖15,在照相機在第1位置所拍攝的圖像81中,工件的圖像31g配置於圖像81的中央。推定位置算出部57以照相機座標系統72來算出工件31的第1推定位置。實測位置算出部52算出照相機的第1實測位置及第2實測位置。圖像推定部61根據從第1實測位置到第2實測位置之實測位置的移動方向及移動量與第1推定位置,來推定第2推定位置。亦即,圖像推定部61以照相機座標系統72的座標值,來推定在第2位置配置有照相機時之特定點的位置。圖像推定部61可使用照相機座標系統72的座標值及照相機參數,藉由式(1)來推定圖像座標系統中之特定點31p的座標值。然後,圖像推定部61可根據圖像89中之工件31的特定點31p的位置,來製作工件的推定圖像31r。顯示控制部63可顯示以圖像推定部61所推定的工件的推定圖像31r。Referring to FIG. 6 and FIG. 15 , in the image 81 captured by the camera at the first position, the image 31g of the workpiece is arranged at the center of the image 81. The estimated position calculation unit 57 calculates the first estimated position of the workpiece 31 using the camera coordinate system 72. The measured position calculation unit 52 calculates the first measured position and the second measured position of the camera. The image estimation unit 61 estimates the second estimated position based on the moving direction and the moving amount of the measured position from the first measured position to the second measured position and the first estimated position. That is, the image estimation unit 61 estimates the position of the specific point when the camera is arranged at the second position using the coordinate value of the camera coordinate system 72. The image estimation unit 61 can estimate the coordinate value of the specific point 31p in the image coordinate system by using the coordinate value of the camera coordinate system 72 and the camera parameter according to the formula (1). Then, the image estimation unit 61 can create an estimated image 31r of the workpiece based on the position of the specific point 31p of the workpiece 31 in the image 89. The display control unit 63 can display the estimated image 31r of the workpiece estimated by the image estimation unit 61.

又,圖像推定部61可根據從照相機6的第1實測位置往第2實測位置的移動量及移動方向,藉由式(1)來推定圖像座標系統73中之特定點31p的移動量及移動方向。然後,在圖像中,可從對應於第1位置之特定點31p的位置,來算出對應於第2位置之特定點31p的位置。圖像推定部61可根據對應於第2實測位置之圖像的特定點31p的位置,來生成工件的推定圖像31r。Furthermore, the image estimation unit 61 can estimate the amount of movement and the direction of movement of the specific point 31p in the image coordinate system 73 by using equation (1) based on the amount of movement and the direction of movement from the first measured position to the second measured position of the camera 6. Then, in the image, the position of the specific point 31p corresponding to the second position can be calculated from the position of the specific point 31p corresponding to the first position. The image estimation unit 61 can generate an estimated image 31r of the workpiece based on the position of the specific point 31p of the image corresponding to the second measured position.

顯示控制部63將以圖像推定部61所推定的特徵部分的圖像,重疊於照相機6配置於第2位置時所拍攝的特徵部分的圖像來顯示。在照相機參數68的精度優異的情況下,在照相機移動到第2位置之後的圖像89中,工件的圖像31g的位置會與藉由圖像推定部61所推定的工件的推定圖像31r幾乎一致。另一方面,在照相機參數68的精度不佳的情況下,工件的推定圖像31r會從實際的工件的圖像31g偏離而顯示。The display control unit 63 displays the image of the characteristic portion estimated by the image estimation unit 61 superimposed on the image of the characteristic portion captured when the camera 6 is arranged at the second position. When the accuracy of the camera parameter 68 is excellent, the position of the image 31g of the workpiece in the image 89 after the camera moves to the second position is almost consistent with the estimated image 31r of the workpiece estimated by the image estimation unit 61. On the other hand, when the accuracy of the camera parameter 68 is poor, the estimated image 31r of the workpiece is displayed deviated from the actual image 31g of the workpiece.

作業人員可藉由觀看圖像89,以工件的圖像來推定誤差的大小。作業人員亦可根據此圖像89,來判定是否要修正照相機參數68。The operator can estimate the size of the error by viewing the image 89 of the workpiece. The operator can also determine whether to correct the camera parameters 68 based on the image 89.

在此,以圖像推定部61所推定的推定圖像31r的位置、及以照相機6所拍攝的工件的圖像31g的位置,會相對於在第1位置所拍攝的工件的位置往同一方向移動,但有時移動的大小會不同。此情況下,可判定為照相機6與工件31的特徵部分的距離hz的設定不正確。或,工件的推定圖像31r的一部分雖與工件的圖像31g精度良好地一致,但有時工件的推定圖像31r的其他部分與實際地拍攝到的工件的圖像31g不一致。此情況下,可判定為工件的基準圖像不正確。例如,若在基準圖像中,將高度不同的複數個面設定為特徵部分,以圖像推定部所推定的工件的推定圖像的一部分,會與以照相機6所拍攝的工件的圖像不一致。此情況下,作業人員可重新製作基準圖像。Here, the position of the estimated image 31r estimated by the image estimation unit 61 and the position of the image 31g of the workpiece photographed by the camera 6 move in the same direction relative to the position of the workpiece photographed at the first position, but the magnitude of the movement may be different. In this case, it can be determined that the setting of the distance hz between the camera 6 and the characteristic part of the workpiece 31 is incorrect. Or, although a part of the estimated image 31r of the workpiece is highly consistent with the image 31g of the workpiece, sometimes the other part of the estimated image 31r of the workpiece is inconsistent with the image 31g of the workpiece actually photographed. In this case, it can be determined that the reference image of the workpiece is incorrect. For example, if a plurality of surfaces of different heights are set as characteristic portions in the reference image, a portion of the estimated image of the workpiece estimated by the image estimation unit may not match the image of the workpiece taken by the camera 6. In this case, the operator may re-create the reference image.

如此,可藉由以圖像推定部61所製作的推定圖像,特定出照相機參數68所包含的複數個參數當中之不正確的參數。或,可特定出基準圖像不正確。In this way, an incorrect parameter among a plurality of parameters included in the camera parameter 68 can be identified by using the estimated image produced by the image estimation unit 61. Alternatively, it can be identified that the reference image is incorrect.

順帶一提,在圖15所示之圖像89中,工件的圖像31g配置於圖像89的端部。在二維的照相機中,具有越遠離照相機的光軸,圖像的變形就變得越大的特性。在此之例中,工件的圖像31g產生了變形。另一方面,工件的推定圖像31r是不考慮圖像的變形而推定的圖像。亦即,圖像推定部61根據式(1)來生成工件的推定圖像31r。因此,工件的板狀部31a、31b的圖像的形狀為正圓。Incidentally, in the image 89 shown in FIG15 , the image 31g of the workpiece is arranged at the end of the image 89. In a two-dimensional camera, the farther away from the optical axis of the camera, the greater the deformation of the image. In this example, the image 31g of the workpiece is deformed. On the other hand, the estimated image 31r of the workpiece is an image estimated without considering the deformation of the image. That is, the image estimation unit 61 generates the estimated image 31r of the workpiece according to formula (1). Therefore, the shape of the image of the plate-like parts 31a and 31b of the workpiece is a perfect circle.

在圖16,顯示包含考慮到圖像的變形之工件的推定圖像的圖像。本實施形態的圖像推定部61可製作包含圖像的變形之工件的推定圖像31s。特言之,圖像推定部61可推定包含圖像的變形之工件的特徵部分的推定圖像。在圖像90中,在照相機6配置於第2位置時實際地拍攝到的工件的圖像31g中,重疊顯示有工件的推定圖像31s。FIG. 16 shows an image including an estimated image of a workpiece in consideration of the deformation of the image. The image estimation unit 61 of the present embodiment can produce an estimated image 31s of a workpiece including the deformation of the image. Specifically, the image estimation unit 61 can estimate an estimated image of a characteristic portion of the workpiece including the deformation of the image. In the image 90, the estimated image 31s of the workpiece is superimposed on the image 31g of the workpiece actually captured when the camera 6 is arranged at the second position.

圖像推定部61可藉由已將特定點的圖像中之位置的算出方法擴充的方法,來算出圖像90中之工件31的輪廓。例如,圖像推定部61取得照相機配置於第1位置時之工件31的第1推定位置。然後,圖像推定部61在工件31的輪廓上設定許多點。圖像推定部61算出輪廓上的點在照相機座標系統72中之座標值。The image estimation unit 61 can calculate the outline of the workpiece 31 in the image 90 by a method that expands the method of calculating the position of a specific point in the image. For example, the image estimation unit 61 obtains the first estimated position of the workpiece 31 when the camera is arranged at the first position. Then, the image estimation unit 61 sets a plurality of points on the outline of the workpiece 31. The image estimation unit 61 calculates the coordinate values of the points on the outline in the camera coordinate system 72.

圖像推定部61根據從第1實測位置往第2實測位置的移動方向及移動量,來推定將照相機6配置於第2位置時之照相機座標系統72中之工件的輪廓上的點的位置。然後,圖像推定部61根據式(2)至(9),從照相機座標系統72中之工件的輪廓上的點的位置,來推定圖像座標系統73中之工件的輪廓上的點的位置。圖像推定部61可連接圖像中之工件的輪廓上的點的位置,來生成工件的推定圖像31s。The image estimation unit 61 estimates the position of the point on the outline of the workpiece in the camera coordinate system 72 when the camera 6 is arranged at the second position based on the movement direction and the movement amount from the first measured position to the second measured position. Then, the image estimation unit 61 estimates the position of the point on the outline of the workpiece in the image coordinate system 73 from the position of the point on the outline of the workpiece in the camera coordinate system 72 based on equations (2) to (9). The image estimation unit 61 can connect the positions of the points on the outline of the workpiece in the image to generate the estimated image 31s of the workpiece.

藉由此控制,在圖像90中顯示有包含圖像的變形之圖像。可顯示與實際地拍攝到的工件的圖像接近的推定圖像。藉由顯示包含圖像的變形之推定圖像之控制,會變得容易判定照相機參數、從照相機到工件的距離hz、及基準圖像當中之任一者有無問題。By this control, an image including a deformation of the image is displayed in the image 90. An estimated image close to the image of the workpiece actually photographed can be displayed. By controlling to display the estimated image including the deformation of the image, it becomes easy to determine whether there is a problem in any of the camera parameters, the distance hz from the camera to the workpiece, and the reference image.

亦即,在顯示了包含圖像的變形之推定圖像的情況下,在推定圖像與以照相機所拍攝的圖像一致的情況下,可判定為照相機參數的精度優異。即使生成包含圖像的變形之推定圖像,若圖像的位置完全不同,仍然可以判定為從照相機到工件的距離hz的設定不正確。又,即使生成包含圖像的變形之圖像,在圖像的一部分不重疊的情況下,仍然可以判定為基準圖像不適當。進而,在作業人員確認了基準圖像的結果是基準圖像為適當的情況下,可判定為照相機參數當中之關於變形之參數並非正確。That is, when an estimated image including a deformation of an image is displayed, if the estimated image is consistent with the image taken by the camera, it can be determined that the accuracy of the camera parameters is excellent. Even if an estimated image including a deformation of an image is generated, if the position of the image is completely different, it can still be determined that the setting of the distance hz from the camera to the workpiece is incorrect. Furthermore, even if an image including a deformation of an image is generated, if a part of the image does not overlap, it can still be determined that the reference image is inappropriate. Furthermore, when the operator confirms that the reference image is appropriate, it can be determined that the parameters related to the deformation among the camera parameters are incorrect.

在圖17,顯示說明以本實施形態的分數算出部所算出的點數的圖像。在本實施形態,工件31的板狀部31b的上表面的緣部31c被指定為特徵部分。參照圖2及圖17,分數算出部62檢測藉由圖像推定部61所推定的工件的推定圖像31s的特徵部分、與以照相機所拍攝的工件的圖像31g的特徵部分之重複部分。本實施形態的重複部分是工件的推定圖像31s的特徵部分的輪廓、與以照相機所拍攝的工件的圖像31g的特徵部分的輪廓實質地重疊之線段31n。在本實施形態,在工件的推定圖像31s的特徵部分的輪廓與工件的圖像31g的特徵部分的輪廓小於預先決定之判定值的距離的情況下,會判定為輪廓彼此相互重疊。FIG17 shows an image of the points calculated by the score calculation unit of the present embodiment. In the present embodiment, the edge 31c of the upper surface of the plate-shaped portion 31b of the workpiece 31 is designated as a characteristic portion. Referring to FIG2 and FIG17, the score calculation unit 62 detects the overlapping portion of the characteristic portion of the estimated image 31s of the workpiece estimated by the image estimation unit 61 and the characteristic portion of the image 31g of the workpiece photographed by the camera. The overlapping portion of the present embodiment is a line segment 31n where the outline of the characteristic portion of the estimated image 31s of the workpiece and the outline of the characteristic portion of the image 31g of the workpiece photographed by the camera substantially overlap. In the present embodiment, when the distance between the contour of the characteristic portion of the estimated image 31s of the workpiece and the contour of the characteristic portion of the image 31g of the workpiece is smaller than a predetermined determination value, it is determined that the contours overlap each other.

顯示控制部63可顯示圖像,以可得知以照相機6所拍攝的工件的圖像31g的特徵部分、與以圖像推定部61所推定的工件的推定圖像31r的特徵部分之重複部分。在此,作為特徵部分彼此互相重疊的部分之線段31n是以粗實線來表示。The display control unit 63 can display an image so that the overlapping portion of the characteristic portion of the workpiece image 31g taken by the camera 6 and the characteristic portion of the estimated workpiece image 31r estimated by the image estimation unit 61 can be known. Here, the line segment 31n which is the portion where the characteristic portions overlap each other is indicated by a thick solid line.

分數算出部62是對照相機6配置於第2位置時所拍攝的特徵部分的圖像,算出表示以圖像推定部61所推定的特徵部分的圖像重疊程度之點數。本實施形態的分數算出部62可算出重疊部分的線段31n的長度對以照相機6所拍攝的工件的圖像31g的特徵部分的周圍的長度之比率,來作為點數。此點數越接近1,則可判定為推定圖像與以照相機所拍攝的工件的圖像良好地一致。The score calculation unit 62 calculates the points indicating the degree of overlap of the images of the characteristic parts estimated by the image estimation unit 61 for the image of the characteristic parts photographed when the camera 6 is arranged at the second position. The score calculation unit 62 of the present embodiment can calculate the points as the ratio of the length of the line segment 31n of the overlapping part to the length of the periphery of the characteristic part of the image 31g of the workpiece photographed by the camera 6. The closer this point is to 1, the better the estimated image and the image of the workpiece photographed by the camera are determined to be consistent.

或,分數算出部62可算出從以照相機6所拍攝的工件的圖像31g的特徵部分的周圍的長度減去重疊部分的線段的長度所得之值,來作為點數。此點數越接近零,則可判定為推定圖像與以照相機所拍攝的工件的圖像良好地一致。顯示控制部63可將點數顯示於顯示部28。Alternatively, the score calculation unit 62 may calculate a value obtained by subtracting the length of the line segment of the overlapping portion from the length of the periphery of the characteristic portion of the image 31g of the workpiece photographed by the camera 6 as a point. The closer the point is to zero, the better the estimated image and the image of the workpiece photographed by the camera are determined to be consistent. The display control unit 63 may display the point on the display unit 28.

藉由此控制,作業人員可判定為點數越優異,則越能夠精度良好地設定照相機參數。或,評估部58亦可根據以分數算出部62所算出的點數,來判定是否要修正照相機參數。By this control, the operator can determine that the better the score is, the more accurately the camera parameters can be set. Alternatively, the evaluation unit 58 can also determine whether to correct the camera parameters based on the score calculated by the score calculation unit 62.

(第2機器人裝置) 在圖18,顯示本實施形態的第2機器人裝置的概略圖。在第2機器人裝置4中,照相機6的位置固定,工件31的位置藉由機器人1來變更。亦即,在第2機器人裝置,照相機6及工件31當中之其中一個構件是工件31。工件31是由安裝於機器人1的手部5把持。作為另一個構件之照相機6是藉由架台36來固定位置。構成為機器人1變更位置及姿勢,藉此使工件31的三維的位置及姿勢變化。 (Second robot device) FIG. 18 shows a schematic diagram of the second robot device of the present embodiment. In the second robot device 4, the position of the camera 6 is fixed, and the position of the workpiece 31 is changed by the robot 1. That is, in the second robot device, one of the components between the camera 6 and the workpiece 31 is the workpiece 31. The workpiece 31 is held by the hand 5 mounted on the robot 1. The camera 6 as the other component is fixed in position by the stand 36. The robot 1 is configured to change its position and posture, thereby changing the three-dimensional position and posture of the workpiece 31.

工件31的特徵部分是能以照相機6來拍攝的部分。在第2機器人裝置4,工件31的底面設定為工件31的特徵部分。例如,板狀部31b的底面的圓的緣部設定為工件31的特徵部分。然後,板狀部31b的底面的中心的位置設定為特定點的位置。板狀部31b的底面的基準圖像是預先製作的。特徵檢測部56在工件31的圖像中檢測板狀部31b的底面的輪廓。The characteristic portion of the workpiece 31 is a portion that can be photographed with the camera 6. In the second robot device 4, the bottom surface of the workpiece 31 is set as the characteristic portion of the workpiece 31. For example, the edge of the circle of the bottom surface of the plate-shaped portion 31b is set as the characteristic portion of the workpiece 31. Then, the position of the center of the bottom surface of the plate-shaped portion 31b is set as the position of the specific point. The reference image of the bottom surface of the plate-shaped portion 31b is prepared in advance. The feature detection unit 56 detects the contour of the bottom surface of the plate-shaped portion 31b in the image of the workpiece 31.

推定位置算出部57根據工件31的圖像中之特徵部分的位置及照相機參數,以照相機座標系統72來算出工件31的推定位置。實測位置算出部52根據作為移動裝置的驅動狀態之機器人1的位置及姿勢,以基準座標系統71來算出工件31的三維的位置即實測位置。The estimated position calculation unit 57 calculates the estimated position of the workpiece 31 using the camera coordinate system 72 based on the position of the characteristic portion in the image of the workpiece 31 and the camera parameters. The measured position calculation unit 52 calculates the three-dimensional position of the workpiece 31, i.e., the measured position, using the reference coordinate system 71 based on the position and posture of the robot 1 in the driving state as a mobile device.

控制裝置2藉由變更機器人的位置及姿勢,來將工件31配置於第1位置P31a。照相機6拍攝工件31的特徵部分即工件31的底面。控制裝置2變更機器人的位置及姿勢,藉此如箭頭99所示,將工件31移動到第2位置P31b。從照相機6到工件31的特徵部分的距離hz是預先決定的。機器人1將工件31平行移動,以使從照相機6到工件31的特徵部分的距離hz及工件31的姿勢不會變化。The control device 2 places the workpiece 31 at the first position P31a by changing the position and posture of the robot. The camera 6 photographs the characteristic portion of the workpiece 31, i.e., the bottom surface of the workpiece 31. The control device 2 changes the position and posture of the robot, thereby moving the workpiece 31 to the second position P31b as shown by the arrow 99. The distance hz from the camera 6 to the characteristic portion of the workpiece 31 is predetermined. The robot 1 moves the workpiece 31 in parallel so that the distance hz from the camera 6 to the characteristic portion of the workpiece 31 and the posture of the workpiece 31 do not change.

特徵檢測部56檢測工件31配置於第1位置P31a時所拍攝的圖像中之特徵部分、及工件31配置於第2位置P31b時所拍攝的圖像中之特徵部分。推定位置算出部57算出工件31配置於第1位置時之第1推定位置、及工件31配置於第2位置時之第2推定位置。實測位置算出部52算出工件31配置於第1位置時之第1實測位置、及工件31配置於第2位置時之第2實測位置。The feature detection unit 56 detects a feature portion in an image captured when the workpiece 31 is arranged at the first position P31a, and a feature portion in an image captured when the workpiece 31 is arranged at the second position P31b. The estimated position calculation unit 57 calculates a first estimated position when the workpiece 31 is arranged at the first position, and a second estimated position when the workpiece 31 is arranged at the second position. The measured position calculation unit 52 calculates a first measured position when the workpiece 31 is arranged at the first position, and a second measured position when the workpiece 31 is arranged at the second position.

評估部58根據第1實測位置與第2實測位置之間的移動量、與從第1推定位置到第2推定位置的距離之誤差,來評估照相機參數。評估部58判定是否需要修正照相機參數。The evaluation unit 58 evaluates the camera parameter based on the amount of movement between the first measured position and the second measured position and the error in the distance from the first estimated position to the second estimated position. The evaluation unit 58 determines whether the camera parameter needs to be corrected.

在需要修正照相機參數的情況下,修正部60根據第1實測位置與第2實測位置之間的移動量、與從第1推定位置到第2推定位置的距離,來修正照相機參數。特言之,修正部60可算出第1實測位置與第2實測位置之間的移動量、與從第1推定位置到第2推定位置的距離之誤差,並以誤差成為最小的方式修正照相機參數。When the camera parameters need to be corrected, the correction unit 60 corrects the camera parameters based on the amount of movement between the first measured position and the second measured position and the distance from the first estimated position to the second estimated position. Specifically, the correction unit 60 calculates the error between the amount of movement between the first measured position and the second measured position and the distance from the first estimated position to the second estimated position, and corrects the camera parameters in a manner that minimizes the error.

如此,在第2機器人裝置4中,亦可實施照相機參數的評估及修正。關於其他構成、作用及效果,由於與第1機器人裝置3同樣,因此在此不重複說明。Thus, the evaluation and correction of the camera parameters can also be implemented in the second robot device 4. As the other structures, functions and effects are the same as those of the first robot device 3, they will not be repeated here.

在本實施形態中,例示有機器人來作為移動工件或感測器的移動裝置,但不限於此形態。移動裝置可採用能變更感測器相對於工件的相對位置之任意的移動裝置。例如,作為移動裝置,可採用搬送工件之輸送機及無人搬送車(AGV)等。In this embodiment, a robot is used as a moving device for moving a workpiece or a sensor, but the present invention is not limited to this embodiment. The moving device can be any moving device that can change the relative position of the sensor with respect to the workpiece. For example, a conveyor for transporting workpieces and an automated guided vehicle (AGV) can be used as the moving device.

在本實施形態中,感測器及工件當中之其中一個構件雖以移動裝置來移動,且另一個構件的位置固定,但不限於此形態。亦可構成為感測器及工件雙方的構件以移動裝置來移動。例如,移動裝置亦可構成為包含機器人及輸送機,機器人移動作為其中一個構件的感測器,輸送機移動作為另一個構件的工件。在此情況下,修正部亦可根據以其中一個構件的第1實測位置及第2實測位置為依據的移動量、與從第1推定位置到第2推定位置的距離,來修正感測器參數。In the present embodiment, one of the components of the sensor and the workpiece is moved by a moving device, and the position of the other component is fixed, but the present invention is not limited to this embodiment. It is also possible to configure the components of both the sensor and the workpiece to be moved by a moving device. For example, the moving device may also be configured to include a robot and a conveyor, the robot moves the sensor as one of the components, and the conveyor moves the workpiece as the other component. In this case, the correction unit may also correct the sensor parameters based on the movement amount based on the first measured position and the second measured position of one of the components and the distance from the first estimated position to the second estimated position.

更具體而言,實測位置算出部算出其中一個構件配置於第1位置時之第1實測位置、及其中一個構件配置於第2位置時之第2實測位置。實測位置算出部算出其中一個構件配置於第1位置時之另一個構件的第3實測位置、及其中一個構件配置於第2位置時之另一個構件的第4實測位置。修正部可根據其中一個構件的第1實測位置及第2實測位置、與另一個構件的第3實測位置及第4實測位置,來算出其中一個構件相對於另一個構件的相對的移動量。修正部可算出假設另一個構件已靜止時之其中一個構件的移動量。換言之,修正部可算出從另一個構件觀看時之其中一個構件的移動量。然後,修正部可根據其中一個構件相對於另一個構件的相對的移動量,來修正感測器參數。More specifically, the measured position calculation unit calculates a first measured position when one of the components is arranged at the first position, and a second measured position when one of the components is arranged at the second position. The measured position calculation unit calculates a third measured position of the other component when one of the components is arranged at the first position, and a fourth measured position of the other component when one of the components is arranged at the second position. The correction unit can calculate a relative movement amount of one of the components with respect to the other component based on the first measured position and the second measured position of one of the components and the third measured position and the fourth measured position of the other component. The correction unit can calculate the movement amount of one of the components assuming that the other component is stationary. In other words, the correction unit can calculate the movement amount of one of the components when viewed from the other component. Then, the correction unit can correct the sensor parameters according to the relative movement of one component with respect to the other component.

在本實施形態中,作為感測器例示了拍攝二維的圖像之照相機,但不限於此形態。可採用使用感測器參數來算出與以感測器所拍攝的工件的圖像中之特定的位置對應之空間的三維的位置之任意的感測器。例如,作為感測器,可採用檢測空間的位置之三維感測器。在三維感測器固定於作業工具的情況下,可評估或修正將感測器座標系統的座標值轉換成工具座標系統的座標值之外部參數。In this embodiment, a camera that captures a two-dimensional image is exemplified as a sensor, but the present invention is not limited to this form. Any sensor that uses sensor parameters to calculate a three-dimensional position in space corresponding to a specific position in an image of a workpiece captured by the sensor can be used. For example, a three-dimensional sensor that detects a spatial position can be used as a sensor. When the three-dimensional sensor is fixed to a work tool, external parameters that convert the coordinate values of the sensor coordinate system into the coordinate values of the tool coordinate system can be evaluated or corrected.

在本實施形態中,作業人員主要以手動來驅動機器人,或評估照相機參數及圖像,但不限於此形態。控制裝置亦可根據預先決定的程式,自動地驅動移動裝置、或以感測器來拍攝圖像、或評估感測器參數及圖像。進而,控制裝置亦可自動地選定應修正的參數、或修正參數。In this embodiment, the operator mainly drives the robot manually or evaluates the camera parameters and images, but the present invention is not limited to this embodiment. The control device can also automatically drive the mobile device, or use the sensor to take images, or evaluate the sensor parameters and images according to a predetermined program. Furthermore, the control device can also automatically select the parameters to be corrected or correct the parameters.

在如上述所說明的至少一個實施形態中,可以提供一種能以優異的精度來修正感測器參數之參數修正裝置。In at least one embodiment as described above, a parameter correction device can be provided that can correct sensor parameters with excellent accuracy.

雖詳述了本揭示,但本揭示不限定於上述的各個實施形態。這些實施形態可在不脫離本揭示的要旨的範圍內,或可在不脫離由申請專利範圍所記載的內容及其均等物所導出的本揭示的旨趣的範圍內,進行各種追加、替換、變更、部分刪除等。又,這些實施形態亦可加以組合而實施。例如,在上述的實施形態中,各動作的順序或各處理的順序是作為一例來顯示,並不限定於該等順序。又,在上述的實施形態的說明中使用數值或數式的情況亦同。Although the present disclosure is described in detail, the present disclosure is not limited to the above-mentioned embodiments. These embodiments may be subject to various additions, replacements, changes, partial deletions, etc., without departing from the gist of the present disclosure, or without departing from the intent of the present disclosure derived from the contents described in the patent application and its equivalents. Furthermore, these embodiments may also be combined and implemented. For example, in the above-mentioned embodiments, the sequence of each action or the sequence of each processing is shown as an example and is not limited to such sequence. Furthermore, the same applies to the use of numerical values or formulas in the description of the above-mentioned embodiments.

關於上述實施形態及變形例揭示以下附記。The following notes are disclosed regarding the above-mentioned embodiments and modifications.

(附記1) 一種參數修正裝置2,是修正用以算出三維的位置之感測器參數的參數修正裝置2,前述三維的位置對應於以感測器6所拍攝的工件的圖像31g中之特定的位置,前述參數修正裝置2具備: 特徵檢測部56,在工件的圖像31g中檢測特徵部分31c; 推定位置算出部57,根據工件的圖像31g中之特徵部分的位置及感測器參數,來算出工件31的三維的位置即推定位置; 實測位置算出部52,根據移動感測器6及工件31當中之至少其中一個構件之移動裝置1的驅動狀態,來算出其中一個構件的三維的位置即實測位置;及 修正部60,修正感測器參數, 特徵檢測部56檢測其中一個構件配置於第1位置P6a、P31a時所拍攝的圖像81中之特徵部分、及其中一個構件配置於第2位置P6b、P31b時所拍攝的圖像82中之特徵部分, 推定位置算出部57算出其中一個構件配置於第1位置P6a、P31a時之第1推定位置、及其中一個構件配置於第2位置時之第2推定位置, 實測位置算出部52算出其中一個構件配置於第1位置時之第1實測位置、及其中一個構件配置於第2位置時之第2實測位置, 修正部60根據以第1實測位置及第2實測位置為依據的移動量、與從第1推定位置到第2推定位置的距離,來修正感測器參數。 (Note 1) A parameter correction device 2 is a parameter correction device 2 for correcting sensor parameters used to calculate a three-dimensional position, wherein the three-dimensional position corresponds to a specific position in an image 31g of a workpiece taken by a sensor 6, and the parameter correction device 2 comprises: a feature detection unit 56 for detecting a feature portion 31c in the image 31g of the workpiece; an estimated position calculation unit 57 for calculating the three-dimensional position of the workpiece 31, i.e., the estimated position, based on the position of the feature portion in the image 31g of the workpiece and the sensor parameters; a measured position calculation unit 52 for calculating the three-dimensional position of one of the components, i.e., the measured position, based on the driving state of the moving device 1 of the moving sensor 6 and at least one of the components of the workpiece 31; and a correction unit 60 for correcting the sensor parameters, The feature detection unit 56 detects the feature part in the image 81 taken when one of the components is arranged at the first position P6a, P31a, and the feature part in the image 82 taken when one of the components is arranged at the second position P6b, P31b. The estimated position calculation unit 57 calculates the first estimated position when one of the components is arranged at the first position P6a, P31a, and the second estimated position when one of the components is arranged at the second position. The measured position calculation unit 52 calculates the first measured position when one of the components is arranged at the first position, and the second measured position when one of the components is arranged at the second position. The correction unit 60 corrects the sensor parameters according to the movement amount based on the first measured position and the second measured position, and the distance from the first estimated position to the second estimated position.

(附記2) 如附記1之參數修正裝置,其中修正部60算出以第1實測位置及第2實測位置為依據的移動量、與從第1推定位置到第2推定位置的距離之誤差,並修正感測器參數以令誤差為最小。 (Note 2) As in the parameter correction device of Note 1, the correction unit 60 calculates the error between the movement amount based on the first measured position and the second measured position and the distance from the first estimated position to the second estimated position, and corrects the sensor parameter to minimize the error.

(附記3) 如附記1之參數修正裝置,其具備選定部59,前述選定部59從感測器參數所包含的複數個參數,選定要修正的參數, 修正部60以與選定部59所選定的參數的個數對應之次數,根據變更第1位置及第2位置當中之至少其中一個位置並重複攝像之圖像,來修正以選定部所選定的參數。 (Supplementary Note 3) The parameter correction device of Supplementary Note 1 includes a selection unit 59, which selects a parameter to be corrected from a plurality of parameters included in the sensor parameters. The correction unit 60 corrects the parameter selected by the selection unit by changing at least one of the first position and the second position and repeatedly photographing the image a number of times corresponding to the number of parameters selected by the selection unit 59.

(附記4) 如附記1之參數修正裝置,其中感測器及工件當中之另一個構件位置固定, 修正部根據第1實測位置與第2實測位置之間的移動量,來修正感測器參數。 (Note 4) As in the parameter correction device of Note 1, the positions of the sensor and another component in the workpiece are fixed, and the correction unit corrects the sensor parameters according to the movement between the first measured position and the second measured position.

(附記5) 如附記1至4中任一項之參數修正裝置,其具備評估部58,前述評估部58評估感測器參數, 評估部58根據以第1實測位置及第2實測位置為依據的移動量、與從第1推定位置到第2推定位置的距離之誤差,來評估感測器參數。 (Note 5) The parameter correction device as in any one of Notes 1 to 4 has an evaluation unit 58, which evaluates the sensor parameter. The evaluation unit 58 evaluates the sensor parameter based on the movement amount based on the first measured position and the second measured position and the error of the distance from the first estimated position to the second estimated position.

(附記6) 如附記1至4中任一項之參數修正裝置,其具備顯示控制部63,前述顯示控制部63控制顯示於顯示部28的圖像, 修正部60算出以第1實測位置及第2實測位置為依據的移動量、與從第1推定位置到第2推定位置的距離之誤差, 顯示控制部63將以第1實測位置及第2實測位置為依據的移動量與誤差的關係顯示於顯示部28。 (Note 6) The parameter correction device as in any one of Notes 1 to 4 has a display control unit 63, which controls the image displayed on the display unit 28, The correction unit 60 calculates the movement amount based on the first measured position and the second measured position and the error of the distance from the first estimated position to the second estimated position, The display control unit 63 displays the relationship between the movement amount based on the first measured position and the second measured position and the error on the display unit 28.

(附記7) 如附記1至4中任一項之參數修正裝置,其具備: 顯示控制部,控制顯示於顯示部的圖像;及 圖像推定部61,根據其中一個構件配置於第1位置時所拍攝的特徵部分的圖像、感測器參數、及以實測位置為依據的移動量,來推定其中一個構件配置於第2位置時之特徵部分的圖像, 顯示控制部63將以圖像推定部所推定的特徵部分的圖像,重疊於其中一個構件配置於第2位置時所拍攝的特徵部分的圖像來顯示。 (Supplementary Note 7) A parameter correction device as in any one of Supplementary Notes 1 to 4, comprising: a display control unit for controlling an image displayed on the display unit; and an image estimation unit 61 for estimating an image of a characteristic portion when one of the components is arranged at a second position based on an image of a characteristic portion taken when one of the components is arranged at a first position, sensor parameters, and a movement amount based on an actual position, and a display control unit 63 for displaying the image of the characteristic portion estimated by the image estimation unit superimposed on the image of the characteristic portion taken when one of the components is arranged at the second position.

(附記8) 如附記7之參數修正裝置,其中感測器參數包含與圖像的變形相關聯的參數, 圖像推定部61推定包含圖像的變形之特徵部分的圖像。 (Supplementary Note 8) The parameter correction device of Supplementary Note 7, wherein the sensor parameter includes a parameter associated with the deformation of the image, and the image estimation unit 61 estimates the image including the characteristic portion of the deformation of the image.

(附記9) 如附記1至4中任一項之參數修正裝置,其具備: 圖像推定部61,根據其中一個構件配置於第1位置時所拍攝的特徵部分的圖像、感測器參數、及以實測位置為依據的移動量,來推定其中一個構件配置於第2位置時之特徵部分的圖像;及 分數算出部62,對其中一個構件配置於第2位置時所拍攝的特徵部分的圖像,算出表示以圖像推定部61所推定的特徵部分的圖像重疊之程度之點數。 (Supplementary Note 9) A parameter correction device as in any one of Supplementary Notes 1 to 4, comprising: an image estimation unit 61 for estimating an image of a characteristic portion when one of the components is arranged at a second position based on an image of a characteristic portion photographed when one of the components is arranged at a first position, sensor parameters, and a movement amount based on a measured position; and a score calculation unit 62 for calculating a point indicating a degree of overlap of the image of the characteristic portion estimated by the image estimation unit 61 with respect to the image of the characteristic portion photographed when one of the components is arranged at the second position.

(附記10) 如附記4之參數修正裝置,其中移動裝置為機器人1, 其中一個構件為感測器6, 另一個構件為工件31, 感測器6固定在機器人1或安裝於機器人1的作業工具5, 構成為藉由機器人1變更位置及姿勢,使感測器6的位置及姿勢變化, 實測位置算出部52根據機器人1的位置及姿勢來算出感測器6的實測位置。 (Note 10) As in the parameter correction device of Note 4, the moving device is a robot 1, one of the components is a sensor 6, the other component is a workpiece 31, the sensor 6 is fixed to the robot 1 or a work tool 5 mounted on the robot 1, the position and posture of the sensor 6 are changed by changing the position and posture of the robot 1, the measured position calculation unit 52 calculates the measured position of the sensor 6 based on the position and posture of the robot 1.

(附記11) 如附記4之參數修正裝置,其中移動裝置為機器人1, 其中一個構件為工件31, 另一個構件為感測器6, 工件31是由安裝於機器人1的作業工具5把持, 構成為藉由機器人1變更位置及姿勢,使工件31的位置及姿勢變化, 實測位置算出部52根據機器人1的位置及姿勢來算出工件31的實測位置。 (Note 11) As in the parameter correction device of Note 4, the moving device is a robot 1, one of the components is a workpiece 31, the other component is a sensor 6, the workpiece 31 is held by a work tool 5 mounted on the robot 1, the position and posture of the workpiece 31 are changed by changing the position and posture of the robot 1, the measured position calculation unit 52 calculates the measured position of the workpiece 31 based on the position and posture of the robot 1.

(附記12) 如附記1至4中任一項之參數修正裝置,其中感測器為拍攝二維的圖像之照相機6, 感測器參數為包含外部參數及內部參數之照相機參數。 (Note 12) A parameter correction device as in any one of Notes 1 to 4, wherein the sensor is a camera 6 for taking two-dimensional images, and the sensor parameters are camera parameters including external parameters and internal parameters.

1:機器人、移動裝置 2:控制裝置、修正裝置 3:機器人裝置、第1機器人裝置 4:第2機器人裝置 5:手部、作業工具 6:照相機、感測器 6a:視野 11:上部臂 12:下部臂 13:旋繞基座 14:基座 15:腕 16:凸緣 18:關節部 21:機器人驅動裝置 22:手部驅動裝置 23:位置檢測器 26:教示操作盤 27:輸入部 28:顯示部 31:工件 31a,31b:板狀部 31c:緣部、特徵部分 31g,81,82,83,84,85a,85b,86a,86b,87a,87b,88a,88b,89,90,91:圖像 31m:標記 31n:線段 31p:特定點 31r,31s:推定圖像 32:校正板 35,36:架台 40:控制裝置本體 42:記憶部 43:動作控制部 44:機器人驅動部 45:手部驅動部 51:圖像處理部 52:實測位置算出部 53:攝像控制部 56:特徵檢測部 57:推定位置算出部 58:評估部 59:選定部 60:修正部 61:圖像推定部 62:分數算出部 63:顯示控制部 64:動作指令生成部 67:動作程式 68:照相機參數 71:基準座標系統 72:照相機座標系統 73:圖像座標系統 74:工具座標系統 98,99:箭頭 101,102,103,104,105,106,107,108,109,110:步驟 hc,hz:距離 P6a,P6b,P31a,P31b:位置 U,V,X,Y,Z:軸 Δh:距離差 1: Robot, moving device 2: Control device, correction device 3: Robot device, first robot device 4: Second robot device 5: Hand, work tool 6: Camera, sensor 6a: Field of view 11: Upper arm 12: Lower arm 13: Rotating base 14: Base 15: Wrist 16: Flange 18: Joint 21: Robot drive device 22: Hand drive device 23: Position detector 26: Teaching operation panel 27: Input unit 28: Display unit 31: Workpiece 31a, 31b: Plate-shaped part 31c: Edge, feature part 31g,81,82,83,84,85a,85b,86a,86b,87a,87b,88a,88b,89,90,91: Image 31m: Marker 31n: Line segment 31p: Specific point 31r,31s: Estimated image 32: Calibration plate 35,36: Stand 40: Control device body 42: Memory unit 43: Motion control unit 44: Robot drive unit 45: Hand drive unit 51: Image processing unit 52: Measured position calculation unit 53: Image control unit 56: Feature detection unit 57: Estimated position calculation unit 58: Evaluation unit 59: Selection unit 60: Correction unit 61: Image estimation unit 62: Score calculation unit 63: Display control unit 64: Action command generation unit 67: Action program 68: Camera parameters 71: Reference coordinate system 72: Camera coordinate system 73: Image coordinate system 74: Tool coordinate system 98,99: Arrow 101,102,103,104,105,106,107,108,109,110: Step hc,hz: Distance P6a,P6b,P31a,P31b: Position U,V,X,Y,Z: Axis Δh: Distance difference

圖1是實施形態的第1機器人裝置的概略圖。 圖2是實施形態的機器人裝置的方塊圖。 圖3是實施形態的工件的立體圖。 圖4是說明從照相機到工件的特徵部分的距離的概略圖。 圖5是評估及修正照相機參數之控制的流程圖。 圖6是將照相機配置於第1位置所拍攝的圖像。 圖7是將照相機配置於第2位置時之第1機器人裝置的概略圖。 圖8是將照相機配置於第2位置並拍攝的圖像。 圖9是顯示X方向的實測位置的移動量與誤差的關係的圖表。 圖10是顯示Y方向的實測位置的移動量與誤差的關係的圖表。 圖11是顯示從照相機到工件的距離有誤差時之相對於X方向的實測位置的移動量之X方向的誤差及Y方向的誤差的圖表。 圖12是顯示從照相機到工件的距離有誤差時之相對於Y方向的實測位置的移動量之Y方向的誤差及X方向的誤差的圖表。 圖13是照相機座標系統的設定不正確時之相對於X方向的實測位置的移動量之X方向的誤差及Y方向的誤差。 圖14是照相機座標系統的設定不正確時之相對於Y方向的實測位置的移動量之Y方向的誤差及X方向的誤差。 圖15是將未計算圖像的變形而推定出的推定圖像,重疊於實際的工件的圖像並顯示的圖像。 圖16是將計算圖像的變形而推定出的推定圖像,重疊於實際的工件的圖像並顯示的圖像。 圖17是顯示實際地拍攝到的圖像與圖像推定部所推定出的推定圖像之重複部分的圖像。 圖18是實施形態的第2機器人裝置的概略圖。 FIG. 1 is a schematic diagram of the first robot device of the embodiment. FIG. 2 is a block diagram of the robot device of the embodiment. FIG. 3 is a three-dimensional diagram of the workpiece of the embodiment. FIG. 4 is a schematic diagram illustrating the distance from the camera to the characteristic portion of the workpiece. FIG. 5 is a flow chart of the control for evaluating and correcting camera parameters. FIG. 6 is an image taken when the camera is arranged at the first position. FIG. 7 is a schematic diagram of the first robot device when the camera is arranged at the second position. FIG. 8 is an image taken when the camera is arranged at the second position. FIG. 9 is a graph showing the relationship between the movement amount of the measured position in the X direction and the error. FIG. 10 is a graph showing the relationship between the amount of movement of the measured position in the Y direction and the error. FIG. 11 is a graph showing the error in the X direction and the error in the Y direction of the amount of movement of the measured position in the X direction when there is an error in the distance from the camera to the workpiece. FIG. 12 is a graph showing the error in the Y direction and the error in the X direction of the amount of movement of the measured position in the Y direction when there is an error in the distance from the camera to the workpiece. FIG. 13 is the error in the X direction and the error in the Y direction of the amount of movement of the measured position in the X direction when the camera coordinate system is incorrectly set. FIG. 14 shows the error in the Y direction and the error in the X direction of the movement amount relative to the measured position in the Y direction when the camera coordinate system is incorrectly set. FIG. 15 shows an image in which an estimated image estimated without calculating the deformation of the image is superimposed on the image of the actual workpiece and displayed. FIG. 16 shows an image in which an estimated image estimated by calculating the deformation of the image is superimposed on the image of the actual workpiece and displayed. FIG. 17 shows an image showing the overlapping portion of the image actually captured and the estimated image estimated by the image estimation unit. FIG. 18 is a schematic diagram of the second robot device of the embodiment.

1:機器人、移動裝置 1:Robots and mobile devices

2:控制裝置、修正裝置 2: Control device, correction device

3:機器人裝置、第1機器人裝置 3: Robot device, first robot device

5:手部、作業工具 5: Hands, work tools

6:照相機、感測器 6: Camera, sensor

21:機器人驅動裝置 21:Robot drive device

22:手部驅動裝置 22: Hand drive device

23:位置檢測器 23: Position detector

26:教示操作盤 26: Teaching operation panel

27:輸入部 27: Input Department

28:顯示部 28: Display unit

40:控制裝置本體 40: Control device body

42:記憶部 42: Memory Department

43:動作控制部 43: Motion control unit

44:機器人驅動部 44:Robot drive unit

45:手部驅動部 45: Hand drive unit

51:圖像處理部 51: Image processing department

52:實測位置算出部 52: Measured position calculation unit

53:攝像控制部 53: Camera control unit

56:特徵檢測部 56: Feature Detection Department

57:推定位置算出部 57: Estimated position calculation unit

58:評估部 58: Evaluation Department

59:選定部 59:Selection Department

60:修正部 60: Correction Department

61:圖像推定部 61: Image estimation unit

62:分數算出部 62: Score calculation part

63:顯示控制部 63: Display control unit

64:動作指令生成部 64: Action command generation unit

67:動作程式 67:Action Program

68:照相機參數 68: Camera parameters

Claims (12)

一種參數修正裝置,是修正用以算出三維的位置之感測器參數的參數修正裝置,前述三維的位置對應於以感測器所拍攝的工件的圖像中之特定的位置,前述參數修正裝置具備: 特徵檢測部,在工件的圖像中檢測特徵部分; 推定位置算出部,根據工件的圖像中之特徵部分的位置及感測器參數,來算出工件的三維的位置即推定位置; 實測位置算出部,根據移動感測器及工件當中之至少其中一個構件之移動裝置的驅動狀態,來算出前述其中一個構件的三維的位置即實測位置;及 修正部,修正感測器參數, 前述特徵檢測部檢測前述其中一個構件配置於第1位置時所拍攝的圖像中之特徵部分、及前述其中一個構件配置於第2位置時所拍攝的圖像中之特徵部分, 前述推定位置算出部算出前述其中一個構件配置於第1位置時之第1推定位置、及前述其中一個構件配置於第2位置時之第2推定位置, 前述實測位置算出部算出前述其中一個構件配置於第1位置時之第1實測位置、及前述其中一個構件配置於第2位置時之第2實測位置, 前述修正部根據以第1實測位置及第2實測位置為依據的移動量、與從第1推定位置到第2推定位置的距離,來修正感測器參數。 A parameter correction device is a parameter correction device for correcting sensor parameters used to calculate a three-dimensional position, wherein the three-dimensional position corresponds to a specific position in an image of a workpiece taken by a sensor, and the parameter correction device comprises: a feature detection unit for detecting a feature portion in the image of the workpiece; an estimated position calculation unit for calculating the three-dimensional position of the workpiece, i.e., the estimated position, based on the position of the feature portion in the image of the workpiece and the sensor parameters; a measured position calculation unit for calculating the three-dimensional position of one of the components, i.e., the measured position, based on the driving state of a moving device of a moving sensor and at least one of the components in the workpiece; and a correction unit for correcting the sensor parameters, The feature detection unit detects a feature portion in an image taken when one of the components is arranged at the first position, and a feature portion in an image taken when one of the components is arranged at the second position. The estimated position calculation unit calculates a first estimated position when one of the components is arranged at the first position, and a second estimated position when one of the components is arranged at the second position. The measured position calculation unit calculates a first measured position when one of the components is arranged at the first position, and a second measured position when one of the components is arranged at the second position. The correction unit corrects the sensor parameter based on the movement amount based on the first measured position and the second measured position, and the distance from the first estimated position to the second estimated position. 如請求項1之參數修正裝置,其中前述修正部算出以第1實測位置及第2實測位置為依據的移動量、與從第1推定位置到第2推定位置的距離之誤差,並修正感測器參數以令前述誤差為最小。A parameter correction device as claimed in claim 1, wherein the correction unit calculates the error between the movement amount based on the first measured position and the second measured position and the distance from the first estimated position to the second estimated position, and corrects the sensor parameters to minimize the error. 如請求項1之參數修正裝置,其具備選定部,前述選定部從感測器參數所包含的複數個參數,選定要修正的參數, 前述修正部以與前述選定部所選定的參數的個數對應之次數,根據變更第1位置及第2位置當中之至少其中一個位置並重複攝像之圖像,來修正以前述選定部所選定的參數。 The parameter correction device of claim 1 comprises a selection unit, wherein the selection unit selects a parameter to be corrected from a plurality of parameters included in the sensor parameter, and the correction unit corrects the parameter selected by the selection unit by changing at least one of the first position and the second position and repeatedly photographing the image a number of times corresponding to the number of parameters selected by the selection unit. 如請求項1之參數修正裝置,其中感測器及工件當中之另一個構件位置固定, 前述修正部根據第1實測位置與第2實測位置之間的移動量,來修正感測器參數。 In the parameter correction device of claim 1, the positions of the sensor and another component in the workpiece are fixed, and the correction unit corrects the sensor parameters according to the displacement between the first measured position and the second measured position. 如請求項1至4中任一項之參數修正裝置,其具備評估部,前述評估部評估感測器參數, 前述評估部根據以第1實測位置及第2實測位置為依據的移動量、與從第1推定位置到第2推定位置的距離之誤差,來評估感測器參數。 A parameter correction device as claimed in any one of claims 1 to 4, comprising an evaluation unit, wherein the evaluation unit evaluates sensor parameters. The evaluation unit evaluates the sensor parameters based on the movement amount based on the first measured position and the second measured position and the error of the distance from the first estimated position to the second estimated position. 如請求項1至4中任一項之參數修正裝置,其具備顯示控制部,前述顯示控制部控制顯示於顯示部的圖像, 前述修正部算出以第1實測位置及第2實測位置為依據的移動量、與從第1推定位置到第2推定位置的距離之誤差, 前述顯示控制部將以第1實測位置及第2實測位置為依據的移動量與前述誤差的關係顯示於顯示部。 A parameter correction device as claimed in any one of claims 1 to 4, comprising a display control unit, the display control unit controlling an image displayed on the display unit, the correction unit calculating an error between a movement amount based on a first measured position and a second measured position and a distance from a first estimated position to a second estimated position, and the display control unit displaying the relationship between the movement amount based on a first measured position and a second measured position and the error on the display unit. 如請求項1至4中任一項之參數修正裝置,其具備: 顯示控制部,控制顯示於顯示部的圖像;及 圖像推定部,根據前述其中一個構件配置於第1位置時所拍攝的特徵部分的圖像、感測器參數、及以實測位置為依據的移動量,來推定前述其中一個構件配置於第2位置時之特徵部分的圖像, 前述顯示控制部將以前述圖像推定部所推定的特徵部分的圖像,重疊於前述其中一個構件配置於第2位置時所拍攝的特徵部分的圖像來顯示。 A parameter correction device as claimed in any one of claims 1 to 4, comprising: a display control unit for controlling an image displayed on the display unit; and an image estimation unit for estimating an image of a characteristic portion when one of the components is arranged at a second position based on an image of a characteristic portion taken when one of the components is arranged at a first position, sensor parameters, and a movement amount based on an actual position, and the display control unit superimposes the image of the characteristic portion estimated by the image estimation unit on the image of the characteristic portion taken when one of the components is arranged at the second position for display. 如請求項7之參數修正裝置,其中感測器參數包含與圖像的變形相關聯的參數, 前述圖像推定部推定包含圖像的變形之特徵部分的圖像。 As in claim 7, the parameter correction device, wherein the sensor parameters include parameters associated with the deformation of the image, and the image estimation unit estimates the image including the characteristic portion of the deformation of the image. 如請求項1至4中任一項之參數修正裝置,其具備: 圖像推定部,根據前述其中一個構件配置於第1位置時所拍攝的特徵部分的圖像、感測器參數、及以實測位置為依據的移動量,來推定前述其中一個構件配置於第2位置時之特徵部分的圖像;及 分數算出部,對前述其中一個構件配置於第2位置時所拍攝的特徵部分的圖像,算出表示以前述圖像推定部所推定的特徵部分的圖像重疊之程度之點數。 A parameter correction device as claimed in any one of claims 1 to 4, comprising: an image estimation unit for estimating an image of a characteristic portion when one of the components is arranged at a second position based on an image of a characteristic portion photographed when one of the components is arranged at a first position, sensor parameters, and a movement amount based on a measured position; and a score calculation unit for calculating a score indicating a degree of overlap of the image of the characteristic portion estimated by the image estimation unit with the image of the characteristic portion photographed when one of the components is arranged at the second position. 如請求項4之參數修正裝置,其中前述移動裝置為機器人, 前述其中一個構件為感測器, 前述另一個構件為工件, 感測器固定在機器人或安裝於機器人的作業工具, 構成為藉由機器人變更位置及姿勢,使感測器的位置及姿勢變化, 前述實測位置算出部根據機器人的位置及姿勢來算出感測器的實測位置。 The parameter correction device of claim 4, wherein the moving device is a robot, one of the components is a sensor, the other component is a workpiece, the sensor is fixed to the robot or a work tool mounted on the robot, the position and posture of the sensor are changed by the robot changing its position and posture, the measured position calculation unit calculates the measured position of the sensor based on the position and posture of the robot. 如請求項4之參數修正裝置,其中前述移動裝置為機器人, 前述其中一個構件為工件, 前述另一個構件為感測器, 工件是由安裝於機器人的作業工具把持, 構成為藉由機器人變更位置及姿勢,使工件的位置及姿勢變化, 前述實測位置算出部根據機器人的位置及姿勢來算出工件的實測位置。 The parameter correction device of claim 4, wherein the moving device is a robot, one of the components is a workpiece, the other component is a sensor, the workpiece is held by a work tool mounted on the robot, the position and posture of the workpiece are changed by changing the position and posture of the robot, the measured position calculation unit calculates the measured position of the workpiece based on the position and posture of the robot. 如請求項1至4中任一項之參數修正裝置,其中感測器為拍攝二維的圖像之照相機, 感測器參數為包含外部參數及內部參數之照相機參數。 A parameter correction device as claimed in any one of claim items 1 to 4, wherein the sensor is a camera for taking two-dimensional images, and the sensor parameters are camera parameters including external parameters and internal parameters.
TW113130156A 2023-09-12 2024-08-12 Parameter correction device TW202511037A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
WOPCT/JP2023/033168 2023-09-12
PCT/JP2023/033168 WO2025057290A1 (en) 2023-09-12 2023-09-12 Parameter correction device

Publications (1)

Publication Number Publication Date
TW202511037A true TW202511037A (en) 2025-03-16

Family

ID=95021839

Family Applications (1)

Application Number Title Priority Date Filing Date
TW113130156A TW202511037A (en) 2023-09-12 2024-08-12 Parameter correction device

Country Status (2)

Country Link
TW (1) TW202511037A (en)
WO (1) WO2025057290A1 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007061979A (en) * 2005-09-01 2007-03-15 Sharp Corp Robot arm visual sensor correction method and computer program
US9279661B2 (en) * 2011-07-08 2016-03-08 Canon Kabushiki Kaisha Information processing apparatus and information processing method
US12186920B2 (en) * 2020-01-14 2025-01-07 Fanuc Corporation Robot system

Also Published As

Publication number Publication date
WO2025057290A1 (en) 2025-03-20

Similar Documents

Publication Publication Date Title
KR102280663B1 (en) Calibration method for robot using vision technology
JP5815761B2 (en) Visual sensor data creation system and detection simulation system
JP3946711B2 (en) Robot system
US6816755B2 (en) Method and apparatus for single camera 3D vision guided robotics
JP3733364B2 (en) Teaching position correction method
JP5670416B2 (en) Robot system display device
KR20200093464A (en) System and method for automatic hand-eye calibration of vision system for robot motion
CN112297004B (en) Control device for a robot device for controlling the position of a robot
JP6912529B2 (en) How to correct the visual guidance robot arm
JP6693981B2 (en) Simulation device for simulating robot movement
JP4171488B2 (en) Offline programming device
CN106217372A (en) Robot, robot controller and robot system
JP7674464B2 (en) Simulation device using 3D position information obtained from the output of a visual sensor
JP2023108062A (en) Control device, robot device, control method, and program
CN112238453B (en) Vision-guided robot arm calibration method
TWI699264B (en) Correction method of vision guided robotic arm
TW202246872A (en) Imaging device for calculating three-dimensional position on the basis of image captured by visual sensor
JP2021024075A (en) Control device of robot device for controlling position of robot
TW202511037A (en) Parameter correction device
TWI898134B (en) A camera that calculates three-dimensional position based on images captured by a visual sensor
JP7660686B2 (en) ROBOT CONTROL DEVICE, ROBOT CONTROL SYSTEM, AND ROBOT CONTROL METHOD
JPH09323280A (en) Manipulator control method and system
TW202327835A (en) Robot device equipped with three-dimensional sensor and control method of robot device
TW202319851A (en) Work assistance device and work assistance method
JP2024102425A (en) Correction method, correction system and program