AUTOMATIC CALIBRATION METHOD

Abstract: A method of automatically effecting calibration between an image processor and an automatic machine. Data of a calibration jig and a position of a robot to which is fitted a jig capable of imaging by a a camera at the time of calibration are instructed beforehand. The robot having the jig fitted thereto moves to the instruction point (T3) by a calibration instruction and after this movement, the image processor takes the image of the jig and inputs the image (T4, S3, S4). Calibration processing is carried out by the image data taken, the jig data set and the robot position (T6, S7-S9, S10-S13). Once the jig data and the instruction point are set and instructed at the beginning, subsequent calibration can be carried out automatically by merely fitting the jig to the robot and inputting the calibration instruction.

Description: The present invention relates to a calibration method essential to a system for the control of an automatic machine, such as a robot, in which an object of operation is detected by means of an external visual sensor, such as an image processing apparatus, and the operating position of the automatic machine is corrected. Conventionally known is a system in which an image processing apparatus is utilized as a visual sensor for an automatic machine such as a robot so that the deviations of the position and attitude of the object of operation detected by means of the image processing apparatus are detected; the data indicative of these deviations of the position and attitude are delivered as correction data to a control device of the automatic machine; and the control device of the automatic machine performs a specified operation while correcting the operating position in accordance with the correction data. In this case, the operation for the position correction cannot be performed normally unless a coordinate system for an image of the object of operation to be detected by means of the image processing apparatus and a coordinate system for the operation of the automatic machine are integrated. Accordingly, a process is needed to combine the respective coordinate systems of the image processing apparatus and the control device of the automatic machine. In order to correct the operation of the automatic machine, such as a robot, in accordance with the correction data indicative of the deviations of the position and attitude of the object of operation detected by means of the image processing apparatus, it is necessary to transform pixel value data (data in a camera coordinate system) on the image, picked up by means of a camera of the image processing apparatus, into data in a sensor coordinate system, which is common to the image processing apparatus and the control device of the automatic machine, and also into data in a work coordinate system for the actual drive control of the automatic machine. These coordinate transformations for the data require previous definitions of the respective coordinate axes of the individual coordinate systems. In general, this series of operations is referred to as calibration. This calibration work comprises operations including: (1) setting on the visual sensor side and data setting essential to the coordinate definitions; (2) coordinate definition for the visual sensor; (3) coordinate definition for the control device of the robot (automatic machine); and (4) combining the coordinates for the visual sensor and the robot control device. In executing two-dimensional calibration associated with the image processing apparatus and the robot, for example, the image processing apparatus combines the camera coordinates and sensor coordinates (operations (1) and (2) of the calibration work) by setting the positional relationships between the camera coordinate axis and the sensor coordinates, axis names of the sensor coordinates, pixel size, etc., and then defines the work coordinates for the robot operation (coordinate definition on the robot side described in (3)). In the aforesaid operation (4), a body which can be recognized by means of the image processing apparatus, e.g., a jig with a circular object thereon, is first prepared for use and mounted on the robot. Then, the jig on the robot is moved to the origin of the sensor coordinates recognized by the image processing apparatus, and its position (position with respect to the work coordinates for the robot) is stored in the control device of the robot. Then, the robot is moved to specified points on the X and Y axes of the sensor coordinates, and the respective positions of these points are stored individually. Subsequently, these stored data are displayed on a display unit on the robot side, and their respective values are entered in the image processing apparatus. Thereupon, the relationships between the work coordinates for the robot and the sensor coordinates are obtained, and the sensor coordinates recognized by the robot are squared with the sensor coordinates recognized by the image processing apparatus to complete the calibration work. This calibration work is a highly expert task, which requires very high accuracy and complicated operation processes. Known examples of this calibration work, besides the aforementioned two-dimensional calibration, include three-dimensional calibration such that a three-dimensional position is detected by picking up the object of operation by means of three cameras. Also known is a method in which the two- and three-dimensional calibrations are effected by using dot patterns. Normally, the calibration work described above need not be repeated if it has been executed once during the construction of the work system including the image processing apparatus, robot, etc. If errors increase for any reasons, such as deviation of the camera, change of the optical environment, etc., the calibration should be executed again. In this case, the operations (1) to (4) of the calibration work must be repeated, thus requiring time, labor, and service of an expert. The object of the present invention is to provide a method for automatically effecting the aforesaid calibration. According to the present invention there is provided a method of automatically calibrating a camera of an image processing apparatus for processing an image of an object of operation by combining a work coordinate system set in a control device of an automatic machine with a camera coordinate system set in the image processing apparatus, wherein said method comprises the steps of: (a) giving the automatic machine an instruction point for a position of the automatic machine wherein a whole body of a jig mounted on the automatic machine comes within the range of the camera of the image processing apparatus, and storing first data of the instruction point in first storage means in the automatic machine; (b) setting, in the image processing apparatus, second data relating to an object of recognition attached to said jig, and storing said second data relating to the object of recognition in second storage means in the image processing apparatus; (c) mounting said jig on the automatic machine; (d) issuing a calibration start command to actuate the image processing apparatus and the automatic machine; (e) moving said automatic machine to said instruction point based on said first data stored in said first storing means; (f) photographing said jig with the camera, to produce image data; and (g) combining the camera coordinate system and the work coordinate system in accordance with the image data obtained by said photographing in said step (f), said second data relating to the object of recognition stored in said second storing means, and said position data of the automatic machine at said instruction point, while maintaining communication between the image processing apparatus and the automatic machine, said steps (e), (f) and (g) being automatically repeated in response to said calibration start command issued in said step (d). Data of transformation from the camera coordinates to the sensor coordinates is obtained in accordance with the image data obtained by the photographing and the data on the jig. Further, data of transformation from the sensor coordinates to the position of the work coordinates of the automatic machine is obtained in accordance with the position of the automatic machine in which the jig is photographed. Thus, the camera coordinates, sensor coordinates, and work coordinates are combined, and the calibration is effected automatically. Brief Description of the Drawings Fig. 1 is a flow chart showing an automatic calibration process to be executed by means of an image processing apparatus and a control device of a robot according to a method of the present invention; Fig. 2 is a block diagram showing the principal part of the image processing apparatus for carrying out the method of the present invention; Fig. 3 is a diagram for illustrating an example of a two-dimensional calibration jig; and Fig. 4 is a diagram for illustrating an example of a three-dimensional calibration jig. In Fig. 2, numeral 10 denotes a central image processing apparatus. The central image processing apparatus 10 comprises a main central processing unit (main CPU) 11. The main CPU 11 is connected, by means of a bus 21, to a camera interface 12, an image processor 13, a console interface 14, a communication interface 15, a monitor interface 16, a frame memory 17, a memory 18 for control software formed of a ROM, a program memory 19 formed of a RAM or the like, and a data memory 20 formed of a nonvolatile RAM. The camera interface 12 is connected to cameras 22 (up to 8 in total, only one of which is shown in Fig. 2) for photographing parts or other objects. An image of an object picked up in the range of one of the cameras 22 is transformed into a gradation image by means of a gray scale, and loaded into the frame memory 17. The image processor 13 processes the image stored in the frame memory 17, discriminates the object, and determines its position and attitude. The console interface 14 is connected to a console 23. The console 23 has various command keys, numeric keys for the entry, editing, registration, and execution of application programs, etc., as well as a liquid crystal display unit. The liquid crystal display unit can display menus for setting various data, program list, etc. The memory 18 for control software is loaded with control programs for controlling a visual sensor system by means of the main CPU 11, while the program memory 19 is loaded with programs created by a user. The communication interface 15 is connected to an automatic machine, such as a robot, which uses the visual sensor system. Also, the TV monitor interface 16 is connected to a monitor TV 24 for displaying the image picked up by camera 22. The above arrangement resembles the arrangement of a conventional visual sensor system. The system according to the present invention, however, differs from the conventional visual sensor system in that the memory 18 for control is loaded with programs for automatic calibration, which will be described later. Fig. 3 shows a jig 30 for two-dimensional regular calibration and dot-pattern calibration to be used in the present embodiment. The jig 30 is provided with a large circle 31 and a small circle 32. In Fig. 3, the origin O corresponds to the center of the large circle 31; the X axis is given by a straight line which connects the respective centers O and O' of the large and small circles 31 and 32 (direction from center O to center O' is positive), and the Y axis is an axis obtained by rotating the X axis for 90° in the counterclockwise direction. Further, pixel scale data is given by the distance L between the respective centers O and O' of the two circles. Fig. 4 shows an example of a jig 40 for three-dimensional regular calibration and dot-pattern calibration. In this jig 40, a large circle 41 is disposed around a position corresponding to the origin O of sensor coordinates, and n number of small circles 42 and m number of small circles 42 are arranged at regular intervals L in the X- and Y-axis directions, respectively, thus forming a lattice. Pins 43 are arranged individually at three corner portions to extend at right angles to the XY plane. Referring now to the flow chart of Fig. 1, a method for calibration using the jigs 30 and 40 will be described. First, programs for processes of Steps S1 to S17 to be executed by the image processing apparatus 10 are previously registered in a program memory 19 of the image processing apparatus shown in Fig. 2, and programs for processes (Steps T1 to T10) of Fig. 1 to be executed by a robot are previously registered in a memory in a control device of the robot. Then, the following setting processes (I) to (III) are executed only for the first calibration after the construction of the system. (I) The camera to be used is set in the image processing apparatus 10. This setting, like the conventional calibration, is made according to the connector number of the camera interface 12 which is connected to the camera to be used. (II) Data on the calibration jig are set in the image processing apparatus. If the calibration is two-dimensional, the distance L between the respective centers of the circles 31 and 32 of the jig 30 is set. If the calibration is three-dimensional, the distance L between the circles 42 of the three-dimensional jig 40, which are arranged in the form of a lattice, the number n of the circles with respect to the X-axis direction, and the number m of the circles with respect to the Y-axis direction are set. (III) The calibration jig is attached to the robot, and a position (position in a work coordinate system of the robot) such that the whole jig is in the range of the camera 22 is given as an instruction to the robot. In the case of the three-dimensional calibration, the positions are given as instructions to the individual cameras (three cameras) to be used. Further, the mounting position and attitude of the three-dimensional calibration jig 40, relative to the robot, are given as instructions to the robot by locating the respective top portions of the three pins 43 of the jig 40 in specific points, individually. These individual data are set and stored in the data memory 20 of the image processing apparatus and the memory of the robot control device. When the type of calibration and a calibration command are delivered as inputs to the image processing apparatus or the control device of the robot after attaching the calibration jig to be used to the robot, the CPU 11 of the image processing apparatus 10 and a processor of the robot control device start the processings shown in the flow chart of Fig. 1, individually. In the present embodiment, set types of calibration include Type 1 or two-dimensional regular calibration, Type 2 or three-dimensional regular calibration, Type 3 or two-dimensional dot-pattern calibration, and Type 4 or three-dimensional dot-pattern calibration. Also given next is a case where a calibration start command is inputted from the control device of the robot. First, in Step T1, the processor of the robot control device loads its register with an inputted calibration type number, and transmits the calibration type number and the calibration start signal to the image processing apparatus. On receiving the calibration start signal from the robot control device, the CPU 11 of the image processing apparatus 10 loads a register R with the received calibration type number in Step S1, and starts the subsequent processes of Steps S2 to S17. The CPU 11 sets "0" for an index i in Step S2, and watches for a movement completion signal coming from the robot control device in Step S2. On the other hand, after transmitting the calibration start signal, the robot control device sets "0" for the index i in Step T2, and advances to Step T3, whereupon it moves the robot to an i'th instruction point (position given and stored as the instruction in the aforementioned processing (III) ), which is indicated by the index i. In the case of the two-dimensional calibration, there is only one instruction point, and the robot moves to this point. When the movement is completed, the control device of the robot transmits the movement completion signal to the image processing apparatus in Step T4, and watches for a position data request signal coming from the image processing apparatus in Step T5. On receiving the movement completion signal from the robot control device, the CPU of the image processing apparatus 10 issues a snap command to the camera 22. Then, in Step S4, the CPU fetches an image of the jig into the frame memory 17, and causes the image processor 13 to detect the position and attitude of the jig from the jig image. In Step S5, the CPU delivers the position data request command to the robot control device, and watches for the reception of this data. On receiving the position data request signal in Step T5, the robot control device transmits the current position (position of the instruction point) of the robot. In the case of the three-dimensional calibration, data on the mounting position and attitude of the jig 40, assigned by the pins 43 of the jig 40, are also transmitted in Step T6. On receiving the position data, the image processing apparatus discriminates the calibration types stored in the register R in Steps S7 to S9, and executes calibration processings (Steps S10 to S14), which correspond to Steps S7 to S9, individually. More specifically, camera coordinates and the sensor coordinates are combined on the basis of the jig image fetched in Step S4 and previously set jig data, and the sensor coordinates and work coordinates of the robot are combined on the basis of the position data received in Step S6. In the case of the two-dimensional regular calibration, the value in the register R is "1," and the program proceeds from Step S7 to Step S10. In Step S10, the position of the center of the large circle 31 of the jig 30 is defined as the origin of the sensor coordinates; the straight line which connects the respective centers O and O' of the large and small circles 31 and 32 as the X axis of the sensor coordinates; the direction from the center O to the center O' as the positive direction of the X axis; and the direction at the counterclockwise rotational angle of 90° from the X axis as the Y-axis direction. Further, a pixel scale is obtained in accordance with the number of pixels between the respective centers O and O' of the circles 31 and 32 and the distance L between these circles, and data on transformation from the camera coordinates to the sensor coordinates is obtained. As a result, the two coordinate systems, the camera coordinates and the sensor coordinates, are combined. Furthermore, data on transformation from the sensor coordinates to the work coordinates of the robot is obtained in accordance with the position data received in Step S6, and a processing for the two-dimensional regular calibration is executed to combine the two coordinate systems. Likewise, if the value in the register R is "2," a processing for the three-dimensional calibration is executed (Steps S8 and S11) to combine the camera coordinates, sensor coordinates, and robot work coordinates on the basis of the image of the jig 40, the set jig data (L, m and n), the position and the jig mounting position/attitude data received in Step S6. Likewise, if the value in the register R is "3," the two-dimensional dot-pattern calibration is executed (Steps S9 and S12). If the value in the register R is "4," the three-dimensional dot-pattern calibration is executed (Step S13). When the calibration is finished, the calibration completion signal is transmitted to the robot control device (Steps S14 and S15). In the case of the two-dimensional calibration, this calibration processing ends. In the case of the three-dimensional calibration, "1" is added to the value of the index i in Step S16, and whether or not "3" is attained by the index i is determined in Step S17. If "3" is not attained, the program returns to Step S3. On receiving the calibration completion signal from the image processing apparatus 10 in Step T7, the robot control device determines whether the stored calibration type is "2" or "3," that is, whether the calibration is three-dimensional or not (Step T8). If the value stored in the register is "1" or "3," that is, if the calibration is two-dimensional, this automatic calibration process is finished. In the case of the three-dimensional calibration, however, "1" added to the value of the index i in Step T9, and if "3" is not attained by the index i (Step T10), the program returns to Step T3. Then, the robot is moved to the next instruction point given by the index i, and the robot control device executes the aforesaid processings of Steps S3 to T10, while the image processing apparatus 10 executes the processings of Steps S3 to S17 for each instruction point (each camera). Thus, the calibration processing is executed for the three cameras, and this three-dimensional calibration processing ends when the index i becomes "3." After the calibration is finished in this manner, deviations of the position and attitude of the object of operation are detected by means of the image processing apparatus, and are delivered as correction data to the robot. Based on these correction data, the robot control device makes operating position correction, and activates the system. If the camera is deviated, or if the optical environment is changed during operation, thus increasing errors to necessitate another calibration, the calibration jig is attached to the robot; the calibration type is set in the control device of the robot or the image processing apparatus 10; and the calibration start signal is inputted. Thereupon, the robot control device and the image processing apparatus 10 start the processing shown in Fig. 1, thereby automatically effecting the calibration. According to the present invention, as described above, individual operations which constitute the calibration control are treated as units, and the individual units can be invoked according to the programs of the image processing apparatus. Further, the system is arranged so that the calibration can also be started by means of the robot control device, and transmission, reception and operations of data associated with the calibration can be effected through communication between the image processing apparatus and the robot or some other automatic machine which utilizes the image processing apparatus. Thus, calibrating operations of different types can be performed automatically. Once the data of the jig and the position of the automatic machine, which is fitted with a jig, which is to be photographed by the camera of the image processing apparatus, are given and stored as instructions, the automatic machine and the image processing apparatus can be caused to operate automatically and execute the calibration in accordance with the predetermined programs by issuing the calibration command. Thus, the calibration can be executed with ease.

Claims: A method of automatically calibrating a camera (22) of an image processing apparatus (10) for processing an image of an object of operation by combining a work coordinate system set in a control device of an automatic machine with a camera coordinate system set in the image processing apparatus (10), wherein said method comprises the steps of: (a) giving the automatic machine an instruction point for a position of the automatic machine wherein a whole body of a jig (30,40) mounted on the automatic machine comes within the range of the camera (22) of the image processing apparatus (10), and storing first data of the instruction point in first storage means in the automatic machine; (b) setting, in the image processing apparatus (10), second data relating to an object of recognition attached to said jig (30,40), and storing said second data relating to the object of recognition in second storage means in the image processing apparatus; (c) mounting said jig (30,40) on the automatic machine; (d) issuing a calibration start command to actuate the image processing apparatus (10) and the automatic machine; (e) moving said automatic machine to said instruction point based on said first data stored in said first storing means; (f) photographing said jig with the camera (22), to produce image data; and (g) combining the camera coordinate system and the work coordinate system in accordance with the image data obtained by said photographing in said step (f), said second data relating to the object of recognition stored in said second storing means, and said position data of the automatic machine at said instruction point, while maintaining communication between the image processing apparatus (10) and the automatic machine, said steps (e), (f) and (g) being automatically repeated in response to said calibration start command issued in said step (d). An automatic calibration method according to claim 1, wherein said step (b) further includes setting, in the image processing apparatus (10), data relating to the position and attitude of the jig (30,40) mounted on the automatic machine. An automatic calibration method according to claim 1 or 2, wherein said second data, relating to said object of recognition, corresponds to an inputted type of calibration.

Inventors: TERAWAKI FUMIKAZU, WARASHINA FUMIKAZU, WATANABE ATSUSHI, TERAWAKI, FUMIKAZU, WARASHINA, FUMIKAZU, WATANABE, ATSUSHI, TERAWAKI, FUMIKAZU, ROOM 8-106, FANUC MANSHION, WARASHINA, FUMIKAZU, FANUC DAI-3 VIRA-KARAMATSU, WATANABE, ATSUSHI, ROOM 7-207, FANUC MANSHION
Applicants: FANUC LTD, FANUC LTD.
Application year: 1992
Main classification: B25J9
IPC codes: B25J13, G05D3, B25J9, G05B19