A calibration device and method for machine vision rapid calibration
By designing a calibration device and method containing a white cylinder, the problem of insufficient accuracy in existing machine vision calibration is solved, and high-precision relative position calibration between the camera and the robot flange is achieved, thereby improving the accuracy of image recognition and robot operation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING HANGTIAN XINFENG MECHANICAL EQUIP
- Filing Date
- 2023-03-29
- Publication Date
- 2026-06-02
Smart Images

Figure CN116363227B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a calibration device and method for rapid calibration of machine vision, and relates to the fields of machine vision, industrial robots, and mechanical design and manufacturing. Background Technology
[0002] The primary purpose of machine vision technology in the robotics field is to guide robots in their tasks. Machine vision acquires information such as target features and location, then provides this information to the robot. Before this, the camera must be calibrated to establish the transformation relationship between the robot's coordinate system and the visual coordinate system, thereby achieving accurate target position acquisition. Currently, the mainstream calibration method for machine vision involves obtaining the projection relationship between robot coordinates and visual coordinates through a series of data acquisitions. Nine-point calibration is the most commonly used method. The most common approach is to print nine dots on a piece of white paper, attach them to the workpiece platform surface, and then attach probes to the robot's end effector to move to the center of each of the nine dots and record their coordinates. However, this method has the following problems: 1. The outline accuracy of the nine dots obtained through printing is poor, thus affecting image recognition accuracy; 2. The positioning accuracy of attaching probes to the robot's end effector to move to the center of each of the nine dots is poor, thus affecting the overall calibration accuracy. Summary of the Invention
[0003] To address the problems existing in camera and robot calibration, this invention provides a calibration device and method for rapid calibration of machine vision.
[0004] A calibration device for rapid calibration of machine vision is characterized by comprising an upper plate 1 and a lower plate 2, both of which are rectangular plates; wherein the upper plate 1 is fixed to the upper surface of the lower plate 2, the upper plate 1 is smaller than the lower plate 2, and the upper plate 1 and the lower plate 2 form a calibration device 50. The calibration device 50 is provided with nine circular through holes 10 and two circular blind holes for positioning holes 20. The nine through holes 10 are evenly distributed in three rows on the upper plate 1, and in the middle row, a positioning hole 20 is provided between every two through holes 10; a white cylinder 3 is fixedly installed in the middle of each through hole 10, and the upper surface of the white cylinder 3 is flush with the upper surface of the upper plate 1.
[0005] The upper plate 1 and lower plate 2 of the calibration device 50 are black.
[0006] The upper plate 1, the lower plate 2, and the white cylinder 3 are made of polymethyl methacrylate material.
[0007] A calibration method for rapid calibration of machine vision, using the calibration device for rapid calibration of machine vision as described in claim 1, is characterized by comprising three parts: positioning, visual recognition, and calibration, with the specific steps as follows:
[0008] position
[0009] Step 1: Fix the calibration device 50 on the workpiece platform. The lower surface of the lower plate 2 of the calibration device 50 is in contact with the workpiece platform. The robot 30 is fixedly installed on the ground. The relative position of the robot 30 and the calibration device 50 remains fixed.
[0010] Step 2: Install the trigger probe 70 on the flange 60 of the robot 30, so that the trigger probe 70 contacts the upper surface of the calibration device 50, arbitrarily select 3 contact points, and read the position of the contact points in the robot 30 base coordinate system from the teach pendant of the robot 30.
[0011] Step 3: Establish a spatial plane A using the three known contact points, and then obtain the normal vector of the spatial plane A; adjust the end effector posture of robot 30 so that the end effector of robot 30 is perpendicular to the spatial plane A;
[0012] Step 4: Control the end effector of robot 30 to reach the positions of left positioning hole 201 and right positioning hole 202 respectively, and use trigger probe 70 to perform multi-point measurements on the inner walls of left positioning hole 201 and right positioning hole 202, thereby obtaining the central axis a and axis b of left positioning hole 201 and right positioning hole 202 respectively, and take the intersection points O of axis a and axis b with space plane A respectively. A and O B Thus, the center coordinates O of the left positioning hole 201 and the right positioning hole 202 in the robot base coordinate system are obtained. A (A x A y A z ) and O B (B x B y B z );
[0013] Step 5: Establish a spatial plane coordinate system A. This coordinate system is a two-dimensional plane coordinate system, with the center O of the left positioning hole 201 as the reference point. a (0, 0) is the origin of the coordinate system, and O is the origin of the coordinate system. a With O b The direction of the line connecting the two points is the x-axis; given the machining dimensions of the calibration device 50 and the machining positions of the left positioning hole 201 and the right positioning hole 202, the center point O of the right positioning hole 202 can be obtained. b(d, 0), where d is the center distance between the left positioning hole 201 and the right positioning hole 202, and the direction perpendicular to the x-axis is the y-axis. This coordinate system is used as the spatial plane A coordinate system of the calibration device 50.
[0014] Step 6: Given the machining dimensions of calibration device 50 and the machining positions of the 9 cylinders, the coordinates r1 to r9 of the centers of the 9 white feature circles in the coordinate system A of the space plane can be calculated.
[0015] Visual recognition
[0016] Step 7: Remove the trigger probe 70 and install the camera 40 on the flange 60 of the robot 30; use the robot teach pendant to control the robot 30 to move to the set image capture position to obtain an image of the calibration device, and read the coordinates P(P) of the flange 60 of the robot 30 in the robot base coordinate system from the robot teach pendant. x P y P z );
[0017] Step 8: Preprocess the image:
[0018] (1) First, perform bilateral filtering to reduce noise;
[0019] (2) Next, adaptive threshold binarization segmentation is performed on the preprocessed image to obtain a binarized image;
[0020] (3) Edge detection was performed on the binarized image, and white feature circle edge contour points were detected;
[0021] Step 9: Perform least squares fitting on the obtained edge contour points to form a circle, and extract the center coordinates of the circle in the pixel coordinate system, that is, the center coordinates p of the white feature circle in the visual coordinate system. i (x, y), i = 1, 2, ... 9;
[0022] Calibration
[0023] Step 10: Given the coordinates P(P) of the robot flange in the robot base coordinate system at the known photographing position. x P y P z Given that the center coordinates O of the left positioning hole 201 and the right positioning hole 202 in the robot base coordinate system are also known. A (A x A y A z ) and O B (B x B y B z Then, the coordinates P of the left positioning hole 201 and the right positioning hole 202 in the robot flange coordinate system can be obtained.A (A x -P x A y -P y (The Z direction is not considered); given the coordinates r1 to r9 of the centers of the nine white feature circles in the coordinate system A of the space plane, the coordinates R of the centers of the nine white feature circles relative to the robot flange at the photographing position can be calculated. i (X, Y), i = 1, 2, ... 9, using the mathematical principles of affine transformation, the coordinates p of the centers of the 9 white feature circles in the visual coordinate system are calculated. i (x, y) and coordinates R in the robot flange coordinate system i The transformation matrix M between (X, Y);
[0024] R i (X, Y) = M·p i (x, y) (1)
[0025] Equation 1 represents the center coordinates p of the white feature circle in the visual coordinate system. i (x, y) and coordinates R in the robot flange coordinate system i The conversion formula between (X, Y) is as follows; where... in For rotation matrix, It is a translation matrix.
[0026] This invention is used to calibrate the relative positional relationship between a camera and a robot flange, thereby transforming the visually recognized target position from the visual coordinate system to the robot flange coordinate system, enabling the vision system to guide the robot to perform operations on the target. This invention solves the problems of insufficient calibration accuracy caused by poor manufacturing precision of the calibration device and poor positioning accuracy of the calibration method in current calibration processes. Attached Figure Description
[0027] Figure 1 1 is a schematic diagram of the calibration device of the present invention;
[0028] Figure 2 The image shows a scenario of the robot flange mounting camera 40 being used in this invention.
[0029] Figure 3 The image shows a usage scenario of the robot flange installation trigger probe 70 of the present invention.
[0030] Among them, 1 is the upper plate, 2 is the lower plate, 3 is a white cylinder, 10 is a circular through hole, 20 is a positioning hole, 30 is a robot, 50 is a calibration device, 60 is a flange, 70 is a trigger probe, 201 is a left positioning hole, and 202 is a right positioning hole. Detailed Implementation
[0031] A calibration device for rapid calibration of machine vision is characterized by comprising an upper plate 1 and a lower plate 2, both of which are rectangular plates; wherein the upper plate 1 is fixed to the upper surface of the lower plate 2, the upper plate 1 is smaller than the lower plate 2, and the upper plate 1 and the lower plate 2 form a calibration device 50. The calibration device 50 is provided with nine circular through holes 10 and two circular blind holes for positioning holes 20. The nine through holes 10 are evenly distributed in three rows on the upper plate 1, and in the middle row, a positioning hole 20 is provided between every two through holes 10; a white cylinder 3 is fixedly installed in the middle of each through hole 10, and the upper surface of the white cylinder 3 is flush with the upper surface of the upper plate 1.
[0032] The upper plate 1 and lower plate 2 of the calibration device 50 are black.
[0033] The upper plate 1, the lower plate 2, and the white cylinder 3 are made of polymethyl methacrylate material.
[0034] A calibration method for rapid calibration of machine vision, using the calibration device for rapid calibration of machine vision as described in claim 1, is characterized by comprising three parts: positioning, visual recognition, and calibration, with the specific steps as follows:
[0035] position
[0036] Step 1: Fix the calibration device 50 on the workpiece platform. The lower surface of the lower plate 2 of the calibration device 50 is in contact with the workpiece platform. The robot 30 is fixedly installed on the ground. The relative position of the robot 30 and the calibration device 50 remains fixed.
[0037] Step 2: Install the trigger probe 70 on the flange 60 of the robot 30, so that the trigger probe 70 contacts the upper surface of the calibration device 50, arbitrarily select 3 contact points, and read the position of the contact points in the robot 30 base coordinate system from the teach pendant of the robot 30.
[0038] Step 3: Establish a spatial plane A using the three known contact points, and then obtain the normal vector of the spatial plane A; adjust the end effector posture of robot 30 so that the end effector of robot 30 is perpendicular to the spatial plane A;
[0039] Step 4: Control the end effector of robot 30 to reach the positions of the two positioning holes 201 and 202 respectively, and use the trigger probe 70 to perform multi-point measurements on the inner walls of positioning holes 201 and 202 to obtain the central axis a and axis b of the two positioning holes 201 and 202 respectively. Take the intersection point O of axis a and axis b with the spatial plane A respectively. A and O BThus, the center coordinates O of the two positioning holes 201 and 202 in the robot base coordinate system are obtained. A (A x A y A z ) and O B (B x B y B z );
[0040] Step 5: Establish a spatial plane coordinate system A. This coordinate system is a two-dimensional plane coordinate system, with the center O of the positioning hole 201 as the reference. a (0, 0) is the origin of the coordinate system, and O is the origin of the coordinate system. a With O b The direction of the line connecting the points is the x-axis; given the machining dimensions of the calibration device 50 and the machining positions of the positioning holes 201 and 202, the center point O of the positioning hole 202 can be obtained. b (d, 0), where d is the center distance between positioning holes 201 and 202, and the y-axis is the direction perpendicular to the x-axis. This coordinate system is used as the spatial plane A coordinate system of the calibration device 50.
[0041] Step 6: Given the machining dimensions of calibration device 50 and the machining positions of the 9 cylinders, the coordinates t1 to r9 of the centers of the 9 white feature circles in the spatial plane A coordinate system can be calculated.
[0042] Visual recognition
[0043] Step 7: Remove the trigger probe 70 and install the camera 40 on the flange 60 of the robot 30; use the robot teach pendant to control the robot 30 to move to the set image capture position to obtain an image of the calibration device, and read the coordinates P(P) of the flange 60 of the robot 30 in the robot base coordinate system from the robot teach pendant. x P y P z );
[0044] Step 8: Preprocess the image:
[0045] (1) First, perform bilateral filtering to reduce noise;
[0046] (2) Next, adaptive threshold binarization segmentation is performed on the preprocessed image to obtain a binarized image;
[0047] (3) Edge detection was performed on the binarized image, and white feature circle edge contour points were detected;
[0048] Step 9: Perform least squares fitting on the obtained edge contour points to form a circle, and extract the center coordinates of the circle in the pixel coordinate system, that is, the center coordinates p of the white feature circle in the visual coordinate system. i(x, y), i = 1, 2, ... 9;
[0049] Calibration
[0050] Step 10: Given the coordinates P(P) of the robot flange in the robot base coordinate system at the known photographing position. x P y P z Given that the center coordinates O of the two positioning holes 201 and 202 in the robot's base coordinate system are also known. A (A x A y A z ) and O B (B x B y B z Then, the coordinates P of the two positioning holes 201 and 202 in the robot flange coordinate system can be obtained. A (A x -P x A y -P y (The Z direction is not considered); given the coordinates r1 to r9 of the centers of the nine white feature circles in the coordinate system A of the space plane, the coordinates R of the centers of the nine white feature circles relative to the robot flange at the photographing position can be calculated. i (X, Y), i = 1, 2, ... 9, using the mathematical principles of affine transformation, the coordinates p of the centers of the 9 white feature circles in the visual coordinate system are calculated. i (x, y) and coordinates R in the robot flange coordinate system i The transformation matrix M between (X, Y);
[0051] R i (X, Y) = M·p i (x, y) (1)
[0052] in, in For rotation matrix, It is a translation matrix.
[0053] Example:
[0054] To better explain the technology of this invention, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining the invention and are not intended to limit the invention.
[0055] Figure 1 The figure shown is a three-dimensional model of the calibration device for rapid calibration of machine vision according to the present invention. Figure 2 The diagram shows a specific application scenario of the calibration device for rapid calibration of machine vision described in this invention.
[0056] like Figure 1 The figure shows a three-dimensional model of the calibration device for rapid calibration of machine vision according to the present invention. 10 represents white feature circles, of which there are 9 in total. These circles are mainly used to provide circular contour features to the vision system. The center coordinates of the 9 circles in the visual coordinate system are obtained through a visual recognition method. 20 represents positioning holes, of which there are 2 in total, namely 201 and 202. These holes are mainly used to assist in positioning. The spatial plane coordinate system of the calibration device is established through a positioning method, thereby obtaining the center coordinates of the 9 circles in the robot base coordinate system.
[0057] like Figure 2 The diagram illustrates a specific application scenario of the calibration device for rapid machine vision calibration described in this invention. 30 represents the robot, 40 represents the camera mounted at the robot's end effector, and 50 represents the calibration device. In practical use, the calibration device first uses two positioning holes for auxiliary positioning. A spatial plane coordinate system for the device is established using a positioning method, thereby obtaining the center coordinates of nine circles in the robot's base coordinate system. Then, a visual recognition method is used to obtain the center coordinates of the nine circles in the visual coordinate system. Finally, a calibration algorithm is used to obtain the relative positional relationship between the camera and the robot flange. In summary, the calibration device can be divided into three steps in practical use: a positioning step, a visual recognition step, and a calibration step.
[0058] The specific positioning steps are as follows:
[0059] a) The calibration device of the present invention is fixedly installed on the workpiece platform, with the lower surface of the device in contact with the workpiece platform, and the robot is fixedly installed on the ground, with the relative position of the robot and the calibration device remaining fixed.
[0060] b) Install a trigger-type probe on the robot flange. This probe can read the robot's current position by sending a feedback signal through contact with the surface of an object.
[0061] c) Use the robot teach pendant to control the robot's movement and reach the upper surface of the calibration device, so that the probe contacts the upper surface of the calibration device. Take any 3 contact points and read the position of the contact points in the robot's base coordinate system from the robot teach pendant. If a plane is established by the three points, then a spatial plane A can be established. Then the normal vector of the spatial plane A can be obtained, and the robot end attitude can be adjusted to be perpendicular to the spatial plane A.
[0062] d) Control the robot to reach the positions of the two positioning holes respectively, and use the probe to perform multi-point measurements on the inner wall of the positioning holes to obtain the center axis a and axis b of the two positioning holes respectively. Take the intersection points of axis a and axis b with the spatial plane A respectively, and thus obtain the center coordinates O of the two positioning holes on the spatial plane A respectively. A and O B ;
[0063] e) Using the center coordinates O a and O b Establish a spatial plane coordinate system, where O a O is the origin of the coordinate system. a With O b The direction of the line connecting the x and y axes is the x-axis, and the direction perpendicular to the x-axis is the y-axis. This coordinate system is used as the spatial plane coordinate system of the calibration device.
[0064] f) Given the machining dimensions of the calibration device and the machining positions of the nine cylinders, the coordinates r1 to r9 of the centers of the nine white feature circles in the spatial plane coordinate system can be calculated.
[0065] The visual recognition steps are as follows:
[0066] 1) Remove the trigger probe and install the camera on the robot flange;
[0067] 2) Use the robot teach pendant to control the robot to move to the shooting position (this shooting position is defined by the user, as long as it can capture an image of the calibration device), acquire the image of the calibration device, and read the coordinates P of the robot flange in the robot base coordinate system from the robot teach pendant at this time;
[0068] 3) Preprocess the image, first performing bilateral filtering for noise reduction;
[0069] 4) Perform adaptive threshold binarization segmentation on the preprocessed image to obtain a binary image;
[0070] 5) Edge detection was performed on the binarized image, and white feature circle edge contour points were detected;
[0071] 6) Perform least-squares fitting on the obtained edge contour points to form a circle, and extract the center coordinates of the circle in the pixel coordinate system, that is, the center coordinates p of the white feature circle in the visual coordinate system. i (x, y), i = 1, 2, ... 9;
[0072] The calibration steps are as follows:
[0073] 1) According to claim 1, the coordinates r1 to r9 of the centers of the nine white feature circles in the spatial plane coordinate system are obtained; according to claim 2, the coordinates p of the centers of the nine white feature circles in the visual coordinate system are obtained. i (x, y), i = 1, 2, ... 9;
[0074] 2) Given the coordinates P of the robot flange in the robot base coordinate system at the photographing position as obtained in claim 2, and the coordinates r1 to r9 of the centers of the nine white feature circles in the spatial plane coordinate system, the coordinates R of the centers of the nine white feature circles relative to the robot flange at the photographing position can be calculated. i (X, Y), i = 1, 2, ... 9;
[0075] 7) Using the mathematical principles of affine transformation, the coordinates p of the centers of the nine white feature circles in the visual coordinate system were calculated. i (x, y) and coordinates R in the robot flange coordinate system i The transformation matrix M between (X, Y) represents the relative positional relationship between the camera and the robot flange.
[0076] This invention designs a calibration device and method for rapid calibration of machine vision (hereinafter referred to as "calibration device"). This invention is mainly used to calibrate the relative positional relationship between a camera and a robot, thereby transforming the visually recognized target position from the visual coordinate system to the robot coordinate system, enabling the vision system to guide the robot to perform operations on the target. The device is rectangular in shape, with a black main body, and consists of two layers, the lower layer being larger than or equal in size to the upper layer. The device has nine through holes and two blind holes. Nine white cylinders are embedded in the through holes, with the cylinder diameter matching the diameter of the through holes and the cylinder height matching the device height. When the nine cylinders are embedded in the through holes, the upper surface of the device displays nine white characteristic circles. The two blind holes mentioned above serve as positioning holes for the device, used to assist in positioning. A spatial plane coordinate system for the device is established using the positioning method of this invention, thereby obtaining the center coordinates of the nine circles in the robot coordinate system. The white feature circle provides circular outline features to the vision system. The center coordinates of the nine circles in the visual coordinate system are obtained using the visual recognition method of this invention. Then, the relative positional relationship between the camera and the robot flange is obtained using the calibration algorithm of this invention. The device material of this invention is polymethyl methacrylate, which is lightweight, has high processing precision, uniform color, and is opaque under any lighting conditions, thus significantly improving recognition accuracy.
Claims
1. A calibration method for rapid calibration of machine vision, wherein calibration is performed using a calibration device for rapid calibration of machine vision. The calibration device for rapid calibration of machine vision has the following structure: it includes an upper plate (1) and a lower plate (2), both of which are rectangular plates; wherein the upper plate (1) is fixed to the upper surface of the lower plate (2), and the size of the upper plate (1) is smaller than that of the lower plate (2). The upper plate (1) and the lower plate (2) together form a calibration device (50), and the calibration device (50) is provided with nine circular through holes (10) and two circular through holes (10). The blind hole positioning hole (20) and nine through holes (10) are evenly distributed in three rows on the upper plate (1). In the middle row, a positioning hole (20) is provided between every two through holes (10); a white cylinder (3) is fixedly installed in the middle of each through hole (10), and the upper surface of the white cylinder (3) is flush with the upper surface of the upper plate (1); the upper plate (1) and lower plate (2) of the calibration device (50) are black; the upper plate (1), lower plate (2) and white cylinder (3) are made of polymethyl methacrylate material; characterized in that, The method includes three parts, namely positioning, visual recognition and calibration, and the specific steps are as follows: Positioning Step one, fix the calibration device (50) on the workpiece platform, the lower surface of the lower layer plate (2) of the calibration device (50) is attached to the workpiece platform, the robot (30) is fixedly installed on the ground, and the relative position between the robot (30) and the calibration device (50) remains fixed; Step two, install the trigger probe (70) on the flange (60) of the robot (30), make the trigger probe (70) contact with the upper surface of the calibration device (50), arbitrarily take 3 contact points, and read the positions of the contact points in the robot (30) base coordinate system from the teach pendant of the robot (30); Step three, establish a space plane A through the known 3 contact points, and further obtain the normal vector of the space plane A; adjust the end posture of the robot (30), so that the end of the robot (30) is perpendicular to the space plane A; Step four, control the end of the robot (30) to reach the position of the left positioning hole (201) and the right positioning hole (202) respectively, and use the trigger probe (70) to measure the inner wall of the left positioning hole (201) and the right positioning hole (202) at multiple points, so as to obtain the hole center axes a and b of the left positioning hole (201) and the right positioning hole (202) respectively, and take the intersection of the axes a and b with the space plane A and , so as to obtain the hole center coordinates of the left positioning hole (201) and the right positioning hole (202) in the robot base coordinate system and ; Step 5: Establish a spatial plane coordinate system A. This coordinate system is a two-dimensional plane coordinate system, with the center of the left positioning hole (201) as the reference point. Let be the origin of the coordinate system, with and The direction of the connecting line is Shaft; given the machining dimensions of the calibration device (50), and the machining positions of the left positioning hole (201) and the right positioning hole (202), the center of the right positioning hole (202) can be obtained. Where d is the center distance between the left positioning hole (201) and the right positioning hole (202), perpendicular to... The direction of the axis is The coordinate system is used as the spatial plane A coordinate system of the calibration device (50); Step six, knowing the machining size of the calibration device (50) and the machining position of the nine cylinders, the coordinates of the centers of the nine white feature circles in the spatial plane A coordinate system can be calculated ; Visual recognition Step seven, remove the trigger probe (70), install the camera (40) on the flange (60) of the robot (30); use the robot teach pendant to control the robot (30) to move to the set shooting position to obtain the calibration device image, and read the coordinates of the flange (60) of the robot (30) in the robot base coordinate system at this time from the robot teach pendant ; Step eight, pre-process the image: (1) first, bilateral filtering denoising; (2) secondly, adaptive threshold binaryzation segmentation is performed on the pre-processed image to obtain a binaryzation image; (3) edge detection is performed on the binaryzation image to detect the white feature circle edge contour points; Step nine, the edge contour points obtained are fitted with a circle by using the least square method, and the center coordinates in the pixel coordinate system are extracted, that is, the center coordinates of the white feature circle in the visual coordinate system ; Calibration Step ten, the coordinates of the robot flange in the robot base coordinate system at the known photographing position , and the center coordinates of the left positioning hole (201) and the right positioning hole (202) in the robot base coordinate system are known , and , the coordinates of the left positioning hole (201) and the right positioning hole (202) in the robot flange coordinate system are obtained , wherein the Z direction is not considered; the coordinates of the centers of the nine white feature circles in the space plane A coordinate system are known The coordinates of the centers of the nine white feature circles relative to the robot flange at the photographing position are obtained by calculation The center coordinates of the nine white feature circles in the vision coordinate system are calculated by the mathematical principle of affine transformation , and the transformation matrix between the coordinates in the robot flange coordinate system and the coordinates in the vision coordinate system ; Formula 1 Formula 1 is the center coordinate of the white feature circle in the visual coordinate system The conversion formula between the coordinates in the robot flange coordinate system and the coordinates in the visual coordinate system; wherein, wherein, is a rotation matrix, is a translation matrix.