Calibration device and method for three-dimensional camera and machine tool positioner system
By obtaining the point cloud data set under the machine tool movement and building the pose and virtual pose matrix, the existing calibration process is complicated and unsuitable for the dynamic environment, and high accuracy and stability of machine tool and camera calibration is achieved.
Patent Information
- Application Number
- CN202510119268.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-05-16
AI Technical Summary
The calibration process of existing three-dimensional stereo cameras and machine tool shifting systems is cumbersome, time-consuming and unsuitable for dynamic environments, resulting in deviations in calibration results, and the wear or inaccurate manufacturing of calibration objects will affect the stability and accuracy of calibration results.
By arranging the positions of calibration blocks, cameras, positioning machines and machine tools, the camera is used to obtain the point cloud data set of calibration block profiles of the machine tool in different motion directions, and constructing the attitude matrix and virtual positioning matrix by fitting the straight line and translation matrix, completing the attitude and positioning calibration of the machine tool and the camera.
It improves the accuracy and stability of attitude calibration of machine tools and cameras, is suitable for dynamic environments, reduces manual intervention and time consumption, and improves the accuracy and reliability of calibration results.
Smart Images

Figure CN120014068A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of camera calibration, and in particular to a calibration device and method for a three-dimensional camera and a machine tool positioner system. Background Art
[0002] In the fields of precision machining, robot control, vision guidance systems, etc., 3D stereo cameras and machine tool positioners often need to work together. 3D cameras are used to obtain 3D spatial information of objects or workpieces, while machine tool positioners adjust the pose (position and posture) of the workpiece to put it in the ideal position for machining, inspection, or measurement. In order to ensure that the two work together, they must be accurately calibrated.
[0003] The traditional calibration process usually requires multiple manual operations or multiple shots of data from different angles. The entire calibration process may require a lot of time and manual intervention, especially when the position of the device, object or calibration object needs to be adjusted multiple times. For application scenarios that require rapid deployment or efficient operation, this cumbersome and complicated process is a significant drawback. In addition, existing calibration technologies are usually performed when the device is stationary. Once the device starts to move, the calibration results may deviate; and in actual applications, the calibration object itself may be worn, damaged or inaccurately manufactured, which will affect the stability and accuracy of the calibration results. Summary of the invention
[0004] The invention provides a calibration device and method for a three-dimensional camera and a machine tool positioner system, which are used to solve the existing problems.
[0005] The purpose of the present invention can be achieved through the following technical solutions: The first aspect of the present invention is to provide a calibration method for a three-dimensional camera and a machine tool positioner system, comprising: Arrange the position of the calibration block, camera, positioner, machine tool and machine tool coordinate system; Obtain the machine tool coordinate system through the camera , and The point cloud data set of the calibration block contour under the movement in three directions is obtained, and the point cloud data set of the calibration block contour obtained by the positioner under rotation is obtained; According to the machine tool , and The point cloud data set of the block contour is calibrated in three directions to obtain the corresponding three fitting lines and the corresponding straightness of the fitting lines; the attitude matrix is constructed through the three fitting lines and the corresponding straightness of the fitting lines, and the attitude calibration of the machine tool and the camera is completed; According to the point cloud data set of the calibration block contour obtained by the positioner under rotation, the displacement relationship between points, the posture matrix, and the point cloud data set of the calibration block contour obtained by the positioner under rotation, the arc contour point cloud data set is obtained; the virtual pose matrix of the positioner in the camera coordinate system is constructed through the arc contour point cloud data set and the posture matrix; Use a laser to carve out a number of points, which are recorded as laser points; obtain the coordinates of the laser points in the machine tool coordinate system and the camera coordinate system, and transform the coordinates of the laser points in the camera coordinate system through the virtual pose matrix to obtain the corresponding coordinates of the laser points in the virtual coordinate system of the positioner; construct a second translation matrix according to the translation amount between the coordinates of the laser points in the virtual coordinate system of the positioner and the coordinates of the laser points in the machine tool coordinate system; The coordinates of the laser in the camera coordinate system are transformed through the changes in the point cloud data set of the calibration block contour obtained by the positioner under rotation, the second translation matrix and the virtual pose matrix to obtain the coordinates of the laser point in the machine tool coordinate system after the transformation. The final pose calibration of the camera and the positioner is performed through the difference between the coordinates of several laser points in the machine tool coordinate system and the coordinates in the machine tool coordinate system after the transformation.
[0006] Furthermore, the camera is used to obtain the coordinates of the machine tool in the machine tool coordinate system. , and The point cloud dataset of the calibration block contour under three-direction movement, and the point cloud dataset of the calibration block contour obtained by the positioner under rotation, include: In the machine tool coordinate system, it moves along the X, Y, and Z directions to the set distance, at preset intervals during the process. is the sampling time interval, and the point cloud data sets in three directions of the machine tool coordinate system are collected, that is, the point cloud data sets of the calibration block contour can be collected at each moment; The rotary positioner collects the point cloud data set of the calibration block contour at each rotation sampling angle; wherein, for the high-precision positioner, the sampling angle is the first preset angle ; For low-precision positioners, the sampling angle is the second preset angle ; Among them, the judgment of the positioner accuracy can be determined by geometric accuracy detection; the positioner accuracy is less than or equal to the preset accuracy threshold The positioner with a precision greater than the preset precision threshold is recorded as a high-precision positioner. The positioner is recorded as a low-precision positioner.
[0007] Further, the machine tool is , and The point cloud data set of the calibrated block contour is moved in three directions to obtain the corresponding three fitting lines and the corresponding straightness of the fitting lines, including: According to the point cloud data set of the block contours in three directions, a linear fit is performed in each direction using the least squares method to obtain three fitting straight lines; The straightness corresponding to each fitting line is obtained by the distance between all points in each direction and the corresponding fitting line.
[0008] Furthermore, the posture matrix is constructed by using three fitting lines and the straightness corresponding to the fitting lines, and the posture calibration of the machine tool and the camera is completed, including: Determine the initial direction of each fitting line according to the order of point cloud data acquisition; obtain the first point cloud data and the last point cloud data in the point cloud data set, connect the two points, obtain the connecting line corresponding to each fitting line, and record the initial direction of each fitting line as the direction close to the two ends of the corresponding connecting line and less than 90 degrees, which is the new direction of each fitting line after redirection; According to the point cloud data set of the block contour calibrated in each direction of the machine tool coordinate system and the new direction of the point cloud data set after the fitting straight line is redirected, a unit vector in each direction of the machine tool coordinate system is obtained; wherein the direction of the unit vector is the new direction of the corresponding fitting straight line; The posture matrix is constructed by three ordered unit vectors. The specific process of constructing the posture matrix is: Select the best straight line among the three fitted lines and record it as , and the fitted line with the second best straightness is recorded as ;Will The redirected unit vector is recorded as ; The best straight-line fit corresponds to The basic cross product is calculated and , specifically, the first cross product , normalized , the second cross product Among them, Expressed as , Expressed as , Expressed as ; pass , and To construct the posture matrix, the posture matrix It is expressed as:
[0009] Substitute the three ordered unit vectors into the posture matrix In the process, the attitude calibration of the machine tool and the camera is completed.
[0010] Further, the point cloud data set of the calibration block contour obtained by the positioner under rotation, the displacement relationship between points, the posture matrix, and the point cloud data set of the calibration block contour obtained by the positioner under rotation are used to obtain the arc contour point cloud data set; and the virtual pose matrix of the positioner in the camera coordinate system is constructed by the arc contour point cloud data set and the posture matrix, including: Any data point collected by the camera when the positioner rotates is recorded as the reference point; when the camera follows the positioner to rotate and collect data, the translation vector T formed by other points and the reference point is obtained; when the camera does not follow the positioner to rotate, the collection point is the reference point, and the translation vector T generated at this time is 0; Substitute all the point cloud data of the point cloud data set of the calibration block contour collected by the positioner under rotation into After transforming with the translation vector T, the arc contour point cloud data set is obtained; According to the arc contour point cloud data set, the arc is fitted by the least square method to obtain the fitted arc curve and the center coordinates of the fitted arc curve. ; Through the attitude matrix and the center coordinates , obtain the virtual pose of the positioner in the camera coordinate system when the machine tool moves to the reference point; Virtual pose matrix of the positioner in the camera coordinate system It is expressed as:
[0011] in, Expressed as .
[0012] Further, the coordinates of the laser point in the virtual coordinate system of the positioner are obtained by transforming the coordinates of the laser point in the camera coordinate system through the virtual pose matrix; and a second translation matrix is constructed according to the translation amount between the coordinates of the laser point in the virtual coordinate system of the positioner and the coordinates of the laser point in the machine tool coordinate system, including: The coordinates of the laser point in the camera coordinate system are transformed into the corresponding coordinates in the positioner virtual coordinate system through the camera coordinate system to positioner virtual coordinate system transformation formula; the translation between the coordinates of the laser point in the positioner virtual coordinate system and the coordinates of the laser point in the machine tool coordinate system is calculated, and the average translation is calculated through multiple operations of several laser points. , to construct the second translation matrix ; Among them, the second translation matrix Specifically expressed as:
[0013] Among them, the transformation formula from the camera coordinate system to the positioner virtual coordinate system is specifically expressed as:
[0014] In the formula, Represents the coordinates of any point in the camera coordinate system. Represents the homogeneous coordinates of the corresponding points in the virtual coordinate system of the positioner; and are the known positioner rotation matrix and the first translation matrix; Among them, the homogeneous coordinates of the corresponding points in the virtual coordinate system of the positioner are obtained by a homogeneous transformation method to obtain the coordinates in the virtual coordinate system of the positioner after transformation.
[0015] Furthermore, the coordinates of the laser in the camera coordinate system are transformed by the change of the point cloud data set of the calibration block contour obtained by the positioner under rotation, the second translation matrix and the virtual pose matrix to obtain the coordinates of the laser point in the machine tool coordinate system after the transformation, and the final camera and positioner pose calibration is performed by the difference between the coordinates of several laser points in the machine tool coordinate system and the coordinates in the machine tool coordinate system after the transformation, including: The coordinates of the laser in the camera coordinate system are transformed by the camera coordinate system to machine tool coordinate system transformation formula to obtain the coordinates of the laser point in the machine tool coordinate system after transformation; Among them, the transformation formula from the camera coordinate system to the machine tool coordinate system is specifically expressed as:
[0016] In the formula, Represents the homogeneous coordinates of the corresponding points in the machine tool coordinate system; Represents the coordinates of any laser point in the camera coordinate system; Among them, the homogeneous coordinates of the corresponding points in the machine tool coordinate system are obtained by the homogeneous transformation method to obtain the coordinates in the transformed machine tool coordinate system, and the coordinate points in the transformed machine tool coordinate system are recorded as ; Through the coordinate points of several laser points in the machine tool coordinate system The coordinate point in the machine tool coordinate system after transformation The difference between them is used to calibrate the final pose of the camera and the positioner; Specifically: Calculate the coordinates of all laser points in the machine tool coordinate system The coordinate point in the machine tool coordinate system after transformation When the average distance difference calculated by calibration is less than the preset distance difference threshold, it is determined that the accuracy of posture calibration meets the standard, that is, the posture calibration of the positioner and the camera is completed.
[0017] The second aspect of the present invention is to provide a calibration device for a three-dimensional camera and a machine tool positioner system, comprising: Equipment layout module, used to arrange the position of calibration blocks, cameras, positioners, machine tools and machine tool coordinate systems; Point cloud data acquisition module, used to obtain the machine tool in the machine tool coordinate system through the camera , and The point cloud data set of the calibration block contour under the movement in three directions is obtained, and the point cloud data set of the calibration block contour obtained by the positioner under rotation is obtained; The machine tool and camera calibration module is used to , and The point cloud data set of the block contour is calibrated in three directions to obtain the corresponding three fitting lines and the corresponding straightness of the fitting lines; the attitude matrix is constructed through the three fitting lines and the corresponding straightness of the fitting lines, and the attitude calibration of the machine tool and the camera is completed; The positioner and camera calibration module is used to obtain the arc contour point cloud dataset based on the displacement relationship between points, the posture matrix, and the point cloud dataset of the calibration block contour obtained by the positioner under rotation; construct the virtual posture matrix of the positioner in the camera coordinate system through the arc contour point cloud dataset and the posture matrix; use laser to carve out a number of points, which are recorded as laser points; obtain the coordinates of the laser point in the machine tool coordinate system and the camera coordinate system, and transform the virtual posture matrix coordinates of the laser point in the camera coordinate system to obtain the position of the laser point in the positioner. The corresponding coordinates in the virtual coordinate system of the positioner; construct a second translation matrix according to the translation between the coordinates of the laser point in the virtual coordinate system of the positioner and the coordinates of the laser point in the machine tool coordinate system; transform the coordinates of the laser in the camera coordinate system through the changes in the point cloud data set of the calibration block contour obtained under the rotation of the positioner, the second translation matrix and the virtual pose matrix to obtain the coordinates of the laser point in the machine tool coordinate system after the transformation, and perform the final pose calibration of the camera and the positioner through the difference between the coordinates of several laser points in the machine tool coordinate system and the coordinates in the machine tool coordinate system after the transformation.
[0018] The third aspect of the present invention is to provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the calibration method of a three-dimensional stereo camera and a machine tool positioner system when executing the computer program.
[0019] A fourth aspect of the present invention is to provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the calibration method of the three-dimensional stereo camera and the machine tool positioner system is implemented.
[0020] Compared with the prior art, the invention has the following beneficial effects: , and The point cloud data set of the calibration block contour under three-way movement obtains the corresponding three fitting lines and the corresponding straightness of the fitting lines; the posture matrix is constructed through the three fitting lines and the corresponding straightness of the fitting lines, and the posture calibration of the machine tool and the camera is completed; the accuracy of the posture calibration of the machine tool and the camera is improved; according to the point cloud data set of the calibration block contour obtained by the positioner under rotation, the displacement relationship between points, the posture matrix, and the point cloud data set of the calibration block contour obtained by the positioner under rotation, the arc contour point cloud data set is obtained; the virtual pose matrix of the positioner in the camera coordinate system is constructed through the arc contour point cloud data set and the posture matrix; the transformation relationship between the camera coordinate system and the virtual coordinate system of the positioner is analyzed through the virtual pose matrix, which improves the accuracy of the analysis between the two coordinate systems; Use laser to carve out several points, which are recorded as laser points; obtain the coordinates of the laser points in the machine tool coordinate system and the camera coordinate system, and transform the coordinates of the laser points in the camera coordinate system through the virtual pose matrix to obtain the corresponding coordinates of the laser points in the virtual coordinate system of the positioner; construct a second translation matrix according to the translation amount between the coordinates of the laser points in the virtual coordinate system of the positioner and the coordinates of the laser points in the machine tool coordinate system; transform the coordinates of the laser in the camera coordinate system through the second translation matrix and the virtual pose matrix to obtain the coordinates of the laser points in the machine tool coordinate system after the transformation, and perform the final pose calibration of the camera and the positioner through the difference between the coordinates of several laser points in the machine tool coordinate system and the coordinates in the machine tool coordinate system after the transformation, so as to improve the stability and accuracy of the calibration result. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 A schematic flow chart of the steps of a calibration method for a three-dimensional camera and a machine tool positioner system is provided for the present invention; Figure 2A schematic diagram of a module flow of a calibration device for a three-dimensional camera and a machine tool positioner system is provided for the present invention; Figure 3 It is the schematic diagram of the device of the machine tool positioner system. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] In view of the problems existing in the background technology, a calibration device and method for a three-dimensional stereo camera and a machine tool positioner system are studied and designed, which has important practical significance.
[0026] like Figure 1 As shown, the first aspect of the present invention is to provide a calibration method for a three-dimensional camera and a machine tool positioner system, comprising: Step S001: Arrange the positions of the calibration block, camera, positioner and machine tool.
[0027] The camera is installed on the machine tool and moved to its working posture; the calibration block is fixed at the edge of the positioner so that three sides of the calibration block face the camera, and the camera is controlled to collect the point cloud data of the calibration block as much as possible so that the point cloud data with the fastest point is in the center of the camera field of view. Figure 3 As shown. Among them, for Figure 3 A specific description is given; among them, 1 is a positioner; 2 is the X-axis of the machine tool; 3 is a calibration block; 4 is a surface structured light stereo camera; 5 is a laser; 6 is the Z-axis of the machine tool; and 7 is the Y-axis of the machine tool.
[0028] Step S002: Collecting a point cloud data set of the calibration block contour through a camera.
[0029] It should be noted that, since the existing calibration technology is usually performed when the device is stationary, once the device starts to move, the calibration result may deviate, especially in a complex motion environment. Therefore, the deviation is reduced by setting a dynamic point cloud data.
[0030] Specifically, in the machine tool coordinate system, it moves along the X, Y, and Z directions to the set distance, at preset intervals during the process. is the sampling time interval, and the point cloud data sets in three directions under the machine tool coordinate system are collected, that is, the point cloud data sets of the calibration block contour can be collected at each moment. seconds, wherein in this embodiment, the preset interval There is no specific limitation, and the implementer may determine it according to the specific situation. Among them, the X, Y, and Z directions in the machine tool coordinate system are described in the device diagram.
[0031] At this point, the point cloud data set of the calibration block contour under machine tool movement is obtained.
[0032] It should be noted that due to the service life of the positioner and personal maintenance of the positioner, there are differences in the accuracy of different positioners. That is, in practice, the positioner may have high and low accuracy. Therefore, for the positioner, two methods are designed for dynamically collecting point cloud data sets of the calibration block contour according to the high and low accuracy.
[0033] It should be further explained that when the positioner accuracy is high, the accuracy of the point cloud data set of the calibration block contour collected by the rotary positioner at different angles is high. Therefore, in order to have more data to analyze the calibration, a smaller sampling angle is set for sampling when the positioner accuracy is high. When the positioner accuracy is low, the error of the collected data is large, so only a larger sampling angle is needed for sampling and then fitting. Therefore, it is more appropriate to set a larger sampling angle when the positioner accuracy is low.
[0034] Specifically, the rotary positioner collects a point cloud data set of the calibration block contour at each rotation of a sampling angle; wherein, for a high-precision positioner, the sampling angle is a first preset angle ; For low-precision positioners, the sampling angle is the second preset angle The positioner accuracy can be determined by geometric accuracy detection; the positioner accuracy is less than or equal to the preset accuracy threshold. The positioner is recorded as a high-precision positioner, and the positioner accuracy is greater than the preset accuracy threshold. The positioner is recorded as a low-precision positioner. The geometric accuracy detection is a well-known technology and will not be described in detail here. mm, in this embodiment, the preset accuracy threshold There is no specific limitation and implementers can decide based on specific circumstances.
[0035] In this embodiment, the first preset angle , wherein in this embodiment, the first preset angle There is no specific limitation, and the implementer may determine it according to the specific situation. , wherein in this embodiment, the second preset angle No specific restrictions are made, only guarantees Angle greater than or equal to The specific setting value can be determined by the implementer according to the specific situation.
[0036] It should be noted that when the machine tool moves and the positioner rotates, Figure 3 The base of the device is stationary.
[0037] At this point, a point cloud data set of the calibration block contour obtained by the positioner under rotation is obtained.
[0038] Step S003: calibrate the posture of the machine tool and the camera by using the point cloud data set of the calibration block contour under the machine tool movement.
[0039] It should be noted that in order to analyze the impact of machine tool changes on calibration, a machine tool change method is designed to solve the impact of machine tool changes on calibration.
[0040] Specifically, step S002 is used to obtain a point cloud data set of the contour of the calibration block in each direction when the machine tool moves. ;in, express Point cloud dataset of block contours in the direction, express Point cloud dataset of block contours in the direction, express Point cloud dataset of calibrated block contours in the direction.
[0041] Point cloud dataset based on block contour calibration in three directions , use the least squares method to fit a straight line in each direction, and get three fitting straight lines, which are The least square method is a well-known technique and will not be described in detail here. The straightness corresponding to each fitting line is obtained by calculating the distance between all points in each direction and the corresponding fitting line.
[0042] The initial direction corresponding to each fitting straight line is determined according to the previous movement direction of the machine tool, that is, the initial direction of each fitting straight line is determined according to the order in which the point cloud data is acquired; the first point cloud data and the last point cloud data in the point cloud data set are acquired, and the two points are connected to obtain the connecting line corresponding to each fitting straight line, and the directions at both ends of the connecting line corresponding to each fitting straight line are close to the initial direction and less than 90 degrees, which are recorded as the new direction of each fitting straight line after redirection; The unit vector in each direction of the machine tool coordinate system is obtained according to the point cloud data set of the block contour in each direction of the machine tool coordinate system and the new direction of the point cloud data set after the fitting straight line is redirected; wherein the direction of the unit vector is the new direction of the corresponding fitting straight line.
[0043] At this point, we get three ordered unit vectors of the machine tool coordinate system: ; Through three ordered unit vectors To construct the posture matrix, the specific process of constructing the posture matrix is: Select The best straight line is the fitted line, which is recorded as , and the fitted line with the second best straightness is recorded as ;Will The redirected unit vector is recorded as ; The best straight-line fit corresponds to The basic cross product is calculated and , specifically, the first cross product , normalized , the second cross product , so far, we get and Among them, Expressed as , Expressed as , Expressed as .
[0044] pass , and To construct the posture matrix, the posture matrix It is expressed as:
[0045] The three ordered unit vectors Substitute the posture matrix In the process, the attitude calibration of the machine tool and the camera is completed; among them, the attitude matrix is the rotation matrix from the camera coordinate system to the machine tool coordinate system. The process of substituting the unit vector into the attitude matrix to calibrate the attitude of the machine tool and the camera is a well-known technology and will not be described in detail here.
[0046] At this point, the attitude calibration of the machine tool and the camera is completed.
[0047] Step S004: The positioner and the camera are calibrated based on the point cloud data set of the calibration block contour obtained by the positioner under rotation and the distance difference between the transformed data points and the points actually engraved by the laser.
[0048] It should be noted that by collecting point cloud data during the synchronous motion of the camera and the positioner, and performing coordinate transformation and arc fitting, the precise position and posture of the positioner in the camera coordinate system are calculated to achieve precise calibration and control.
[0049] Specifically, any data point collected by the camera when the positioner rotates is recorded as the reference point. When the camera follows the rotation of the positioner to collect data, the translation vector T formed by other points and the reference point is obtained; when the camera does not follow the rotation of the positioner, the collection point is the reference point, and the translation vector T generated at this time is 0. Among them, in the process of the camera following the positioner, the camera and the positioner move synchronously, that is, they are all circular motions. The specific implementation method for the synchronous movement between the camera and the positioner is to install a controller in the device to control the synchronous movement between the camera and the positioner.
[0050] Substitute all the point cloud data of the point cloud data set of the calibration block contour collected by the positioner under rotation into After transforming the translation vector T, the arc contour point cloud dataset is obtained.
[0051] According to the arc contour point cloud data set, the arc is fitted by the least square method to obtain the fitted arc curve and the center coordinates of the fitted arc curve. ; Among them, the least square method is a well-known technology and will not be described in detail here.
[0052] Through the attitude matrix and the center coordinates , obtain the virtual pose of the positioner in the camera coordinate system when the machine tool moves to the reference point; where, Expressed as , the virtual pose matrix of the positioner in the camera coordinate system It is expressed as:
[0053] It should be noted that in order to analyze the accuracy of the points, the coordinates in the camera coordinate system are transformed, and the calibration accuracy analysis is performed through the distance difference between the transformed data points and the corresponding actual points.
[0054] Specifically, the coordinates of any point in the camera coordinate system , through the positioner rotation matrix , the first translation matrix And the virtual pose matrix of the positioner in the camera coordinate system , transform to obtain the coordinates of the corresponding point in the virtual coordinate system of the positioner; wherein, during the transformation process, the point Through the homogeneous coordinates, the transformation is adjusted, that is, after adjustment, it is , and subsequent matrix operations are performed through homogeneous coordinates. Among them, the transformation formula from the camera coordinate system to the positioner virtual coordinate system is specifically expressed as:
[0055] In the formula, Represents the homogeneous coordinates of the corresponding points in the virtual coordinate system of the positioner.
[0056] Among them, the rotation matrix is a 4×4 matrix introduced by the positioner due to the angle change. is the translation matrix determined by the translation relationship between the data points collected each time and the reference point. Among them, the rotation matrix and the first translation matrix The process of obtaining is a well-known technology and will not be described in detail here.
[0057] Among them, the homogeneous coordinates of the corresponding points in the virtual coordinate system of the positioner are obtained by the homogeneous transformation method to obtain the coordinates in the virtual coordinate system of the positioner after transformation, which is recorded as , wherein the homogeneous transformation method is a well-known technology and will not be described in detail here.
[0058] Use laser to carve out several points, recorded as laser points; obtain the coordinates of the laser point in the machine tool coordinate system and the camera coordinate system, obtain the coordinates of the laser point in the camera coordinate system and the corresponding coordinates in the positioner virtual coordinate system through the camera coordinate system to positioner virtual coordinate system transformation formula, calculate the translation between the coordinates of the laser point in the positioner virtual coordinate system and the coordinates of the laser point in the machine tool coordinate system, and calculate the average translation through multiple operations of several laser points , to construct the second translation matrix . Among them, the second translation matrix Specifically expressed as:
[0059] The coordinates of any laser point in the camera coordinate system , through the second translation matrix , Positioner rotation matrix , the first translation matrix and the virtual pose matrix , transform to obtain the coordinates of the corresponding point in the machine tool coordinate system; wherein the transformation formula from the camera coordinate system to the machine tool coordinate system is specifically expressed as:
[0060] In the formula, Represents the homogeneous coordinates of the corresponding point in the machine tool coordinate system; wherein, the homogeneous coordinates of the corresponding point in the machine tool coordinate system are obtained by a homogeneous transformation method to obtain the coordinates in the transformed machine tool coordinate system, and the coordinate point in the transformed machine tool coordinate system is recorded as ; Among them, the homogeneous transformation method is a well-known technology and will not be described in detail in this embodiment.
[0061] Through the coordinate points of several laser points in the machine tool coordinate system The coordinate point in the machine tool coordinate system after transformation The difference between them is used to calibrate the final pose of the camera and the positioner; Specifically: Calculate the coordinates of all laser points in the machine tool coordinate system The coordinate point in the machine tool coordinate system after transformation When the average distance difference calculated by calibration is less than the preset distance difference threshold, it is determined that the accuracy of posture calibration meets the standard, that is, the posture calibration of the positioner and the camera is completed.
[0062] Among them, in this embodiment, the preset distance difference threshold is 0.2 mm. In this embodiment, the preset distance difference threshold is not specifically limited, and the implementer can determine it according to the specific situation.
[0063] It should be noted that the positioner virtual coordinate system is a virtual coordinate system that does not exist in reality and is also used for transformation and indirect use. The camera coordinate system is a coordinate system designed and determined internally.
[0064] like Figure 2 As shown, the second aspect of the present invention is to provide a calibration device for a three-dimensional camera and a machine tool positioner system, comprising: The equipment arrangement module 101 is used to arrange the positions of the calibration block, the camera, the positioner and the machine tool and the machine tool coordinate system; Point cloud data acquisition module 102 is used to obtain the point cloud data of the machine tool in the machine tool coordinate system through the camera. , and The point cloud data set of the calibration block contour under the movement in three directions is obtained, and the point cloud data set of the calibration block contour obtained by the positioner under rotation is obtained; The machine tool and camera calibration module 103 is used to calibrate the machine tool according to the , and The point cloud data set of the block contour is calibrated in three directions to obtain the corresponding three fitting lines and the corresponding straightness of the fitting lines; the attitude matrix is constructed through the three fitting lines and the corresponding straightness of the fitting lines, and the attitude calibration of the machine tool and the camera is completed; The positioner and camera calibration module 104 is used to obtain an arc contour point cloud dataset based on the point cloud dataset of the calibration block contour obtained by the positioner under rotation, the displacement relationship between points, the posture matrix, and the point cloud dataset of the calibration block contour obtained by the positioner under rotation; construct a virtual posture matrix of the positioner in the camera coordinate system through the arc contour point cloud dataset and the posture matrix; use a laser to carve out a number of points, which are recorded as laser points; obtain the coordinates of the laser point in the machine tool coordinate system and the camera coordinate system, and obtain the laser point according to the coordinates of the laser point in the camera coordinate system through the virtual posture matrix transformation. The corresponding coordinates in the virtual coordinate system of the positioner; construct a second translation matrix according to the translation between the coordinates of the laser point in the virtual coordinate system of the positioner and the coordinates of the laser point in the machine tool coordinate system; transform the coordinates of the laser in the camera coordinate system through the changes in the point cloud data set of the calibration block contour obtained under the rotation of the positioner, the second translation matrix and the virtual pose matrix to obtain the coordinates of the laser point in the machine tool coordinate system after the transformation, and perform the final pose calibration of the camera and the positioner through the difference between the coordinates of several laser points in the machine tool coordinate system and the coordinates in the machine tool coordinate system after the transformation.
[0065] The third aspect of the present invention is to provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a calibration method for a three-dimensional stereo camera and a machine tool positioner system is implemented.
[0066] A fourth aspect of the present invention is to provide a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, a calibration method for a three-dimensional stereo camera and a machine tool positioner system is implemented.
[0067] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program code.
[0068] The present invention is described with reference to flowcharts and / or block diagrams of methods, systems, and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0069] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0070] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A calibration method for a three-dimensional camera and a machine tool positioner system, characterized in that: include: Arrange the position of the calibration block, camera, positioner, machine tool and machine tool coordinate system; Obtain the machine tool coordinate system through the camera , and The point cloud data set of the calibration block contour under the movement in three directions is obtained, and the point cloud data set of the calibration block contour obtained by the positioner under rotation is obtained; According to the machine tool , and The point cloud data set of the block contour is calibrated in three directions to obtain the corresponding three fitting lines and the corresponding straightness of the fitting lines; the attitude matrix is constructed through the three fitting lines and the corresponding straightness of the fitting lines, and the attitude calibration of the machine tool and the camera is completed; According to the point cloud data set of the calibration block contour obtained by the positioner under rotation, the displacement relationship between points, the posture matrix, and the point cloud data set of the calibration block contour obtained by the positioner under rotation, the arc contour point cloud data set is obtained; the virtual pose matrix of the positioner in the camera coordinate system is constructed through the arc contour point cloud data set and the posture matrix; Use a laser to carve out a number of points, which are recorded as laser points; obtain the coordinates of the laser points in the machine tool coordinate system and the camera coordinate system, and transform the coordinates of the laser points in the camera coordinate system through the virtual pose matrix to obtain the corresponding coordinates of the laser points in the virtual coordinate system of the positioner; construct a second translation matrix according to the translation amount between the coordinates of the laser points in the virtual coordinate system of the positioner and the coordinates of the laser points in the machine tool coordinate system; The coordinates of the laser in the camera coordinate system are transformed through the changes in the point cloud data set of the calibration block contour obtained by the positioner under rotation, the second translation matrix and the virtual pose matrix to obtain the coordinates of the laser point in the machine tool coordinate system after the transformation. The final pose calibration of the camera and the positioner is performed through the difference between the coordinates of several laser points in the machine tool coordinate system and the coordinates in the machine tool coordinate system after the transformation.
2. The calibration method of a three-dimensional camera and a machine tool positioner system according to claim 1, characterized in that: The camera is used to obtain the coordinate system of the machine tool. , and The point cloud dataset of the calibration block contour under three-direction movement, and the point cloud dataset of the calibration block contour obtained by the positioner under rotation, include: In the machine tool coordinate system, it moves along the X, Y, and Z directions to the set distance, at preset intervals during the process. is the sampling time interval, and the point cloud data sets in three directions of the machine tool coordinate system are collected, that is, the point cloud data sets of the calibration block contour can be collected at each moment; The rotary positioner collects the point cloud data set of the calibration block contour at each rotation sampling angle; wherein, for the high-precision positioner, the sampling angle is the first preset angle ; For low-precision positioners, the sampling angle is the second preset angle ; Among them, the judgment of the positioner accuracy can be determined by geometric accuracy detection; the positioner accuracy is less than or equal to the preset accuracy threshold The positioner with a precision greater than the preset precision threshold is recorded as a high-precision positioner. The positioner is recorded as a low-precision positioner.
3. The calibration method of a three-dimensional camera and a machine tool positioner system according to claim 1, characterized in that: The machine tool is , and The point cloud data set of the calibrated block contour is moved in three directions to obtain the corresponding three fitting lines and the corresponding straightness of the fitting lines, including: According to the point cloud data set of the block contours in three directions, a linear fit is performed in each direction using the least squares method to obtain three fitting straight lines; The straightness corresponding to each fitting line is obtained by the distance between all points in each direction and the corresponding fitting line.
4. The calibration method of a three-dimensional camera and a machine tool positioner system according to claim 1, characterized in that: The posture matrix is constructed by using three fitting lines and the straightness corresponding to the fitting lines, and the posture calibration of the machine tool and the camera is completed, including: Determine the initial direction of each fitting line according to the order of point cloud data acquisition; obtain the first point cloud data and the last point cloud data in the point cloud data set, connect the two points, obtain the connecting line corresponding to each fitting line, and record the initial direction of each fitting line as the direction close to the two ends of the corresponding connecting line and less than 90 degrees, which is the new direction of each fitting line after redirection; According to the point cloud data set of the block contour calibrated in each direction of the machine tool coordinate system and the new direction of the point cloud data set after the fitting straight line is redirected, a unit vector in each direction of the machine tool coordinate system is obtained; wherein the direction of the unit vector is the new direction of the corresponding fitting straight line; The posture matrix is constructed by three ordered unit vectors. The specific process of constructing the posture matrix is: Select the best straight line among the three fitted lines and record it as , and the fitted line with the second best straightness is recorded as ;Will The redirected unit vector is recorded as ; The best straight-line fit corresponds to The basic cross product is calculated and , specifically, the first cross product , normalized , the second cross product Among them, Expressed as , Expressed as , Expressed as ; pass , and To construct the posture matrix, the posture matrix It is expressed as: Substitute the three ordered unit vectors into the posture matrix In the process, the attitude calibration of the machine tool and the camera is completed.
5. The calibration method of a three-dimensional camera and a machine tool positioner system according to claim 4, characterized in that: The point cloud data set of the calibration block contour obtained by the positioner under rotation, the displacement relationship between points, the posture matrix, and the point cloud data set of the calibration block contour obtained by the positioner under rotation, obtain the arc contour point cloud data set; The virtual pose matrix of the positioner in the camera coordinate system is constructed through the arc contour point cloud data set and the pose matrix, including: Any data point collected by the camera when the positioner rotates is recorded as the reference point; when the camera follows the positioner to rotate and collect data, the translation vector T formed by other points and the reference point is obtained; when the camera does not follow the positioner to rotate, the collection point is the reference point, and the translation vector T generated at this time is 0; Substitute all the point cloud data of the point cloud data set of the calibration block contour collected by the positioner under rotation into After transforming with the translation vector T, the arc contour point cloud data set is obtained; According to the arc contour point cloud data set, the arc is fitted by the least square method to obtain the fitted arc curve and the center coordinates of the fitted arc curve. ; Through the attitude matrix and the center coordinates , obtain the virtual pose of the positioner in the camera coordinate system when the machine tool moves to the reference point; Virtual pose matrix of the positioner in the camera coordinate system It is expressed as: in, Expressed as .
6. The calibration method of a three-dimensional camera and a machine tool positioner system according to claim 5, characterized in that: The method comprises: transforming the coordinates of the laser point in the camera coordinate system through the virtual pose matrix coordinates to obtain the coordinates of the laser point in the virtual coordinate system of the positioner; and constructing a second translation matrix according to the translation amount between the coordinates of the laser point in the virtual coordinate system of the positioner and the coordinates of the laser point in the machine tool coordinate system, including: The coordinates of the laser point in the camera coordinate system are transformed into the corresponding coordinates in the positioner virtual coordinate system through the camera coordinate system to positioner virtual coordinate system transformation formula; the translation between the coordinates of the laser point in the positioner virtual coordinate system and the coordinates of the laser point in the machine tool coordinate system is calculated, and the average translation is calculated through multiple operations of several laser points. , to construct the second translation matrix ; Among them, the second translation matrix Specifically expressed as: Among them, the transformation formula from the camera coordinate system to the positioner virtual coordinate system is specifically expressed as: In the formula, Represents the coordinates of any point in the camera coordinate system. Represents the homogeneous coordinates of the corresponding points in the virtual coordinate system of the positioner; and are the known positioner rotation matrix and the first translation matrix; Among them, the homogeneous coordinates of the corresponding points in the virtual coordinate system of the positioner are obtained by a homogeneous transformation method to obtain the coordinates in the virtual coordinate system of the positioner after transformation.
7. The calibration method of a three-dimensional camera and a machine tool positioner system according to claim 6, characterized in that: The coordinates of the laser in the camera coordinate system are transformed by the change of the point cloud data set of the calibration block contour obtained by the positioner under rotation, the second translation matrix and the virtual pose matrix to obtain the coordinates of the laser point in the machine tool coordinate system after the transformation, and the final camera and positioner pose calibration is performed by the difference between the coordinates of several laser points in the machine tool coordinate system and the coordinates in the machine tool coordinate system after the transformation, including: The coordinates of the laser in the camera coordinate system are transformed by the camera coordinate system to machine tool coordinate system transformation formula to obtain the coordinates of the laser point in the machine tool coordinate system after transformation; Among them, the transformation formula from the camera coordinate system to the machine tool coordinate system is specifically expressed as: In the formula, Represents the homogeneous coordinates of the corresponding points in the machine tool coordinate system; Represents the coordinates of any laser point in the camera coordinate system; Among them, the homogeneous coordinates of the corresponding points in the machine tool coordinate system are obtained by the homogeneous transformation method to obtain the coordinates in the transformed machine tool coordinate system, and the coordinate points in the transformed machine tool coordinate system are recorded as ; Through the coordinate points of several laser points in the machine tool coordinate system The coordinate point in the machine tool coordinate system after transformation The difference between them is used to calibrate the final pose of the camera and the positioner; Specifically: Calculate the coordinates of all laser points in the machine tool coordinate system The coordinate point in the machine tool coordinate system after transformation When the average distance difference calculated by calibration is less than the preset distance difference threshold, it is determined that the accuracy of posture calibration meets the standard, that is, the posture calibration of the positioner and the camera is completed.
8. A calibration device for a three-dimensional camera and a machine tool positioner system, characterized in that: include: Equipment layout module, used to arrange the position of calibration blocks, cameras, positioners, machine tools and machine tool coordinate systems; Point cloud data acquisition module, used to obtain the machine tool in the machine tool coordinate system through the camera , and The point cloud data set of the calibration block contour under the movement in three directions is obtained, and the point cloud data set of the calibration block contour obtained by the positioner under rotation is obtained; The machine tool and camera calibration module is used to , and The point cloud data set of the block contour is calibrated in three directions to obtain the corresponding three fitting lines and the corresponding straightness of the fitting lines; the attitude matrix is constructed through the three fitting lines and the corresponding straightness of the fitting lines, and the attitude calibration of the machine tool and the camera is completed; The positioner and camera calibration module is used to obtain the arc contour point cloud data set according to the point cloud data set of the calibration block contour obtained by the positioner under rotation, the displacement relationship between points, the posture matrix, and the point cloud data set of the calibration block contour obtained by the positioner under rotation; the virtual posture matrix of the positioner in the camera coordinate system is constructed through the arc contour point cloud data set and the posture matrix; Use laser to carve out several points, which are recorded as laser points; obtain the coordinates of the laser points in the machine tool coordinate system and the camera coordinate system, and transform the coordinates of the laser points in the camera coordinate system through the virtual pose matrix to obtain the corresponding coordinates of the laser points in the virtual coordinate system of the positioner; construct a second translation matrix according to the translation amount between the coordinates of the laser points in the virtual coordinate system of the positioner and the coordinates of the laser points in the machine tool coordinate system; transform the coordinates of the laser in the camera coordinate system through the changes in the point cloud data set of the calibration block contour obtained under the rotation of the positioner, the second translation matrix and the virtual pose matrix to obtain the coordinates of the laser points in the machine tool coordinate system after the transformation, and perform the final pose calibration of the camera and the positioner through the difference between the coordinates of several laser points in the machine tool coordinate system and the coordinates in the machine tool coordinate system after the transformation.
9. An electronic device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a calibration method for a three-dimensional stereo camera and a machine tool positioner system as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the calibration method of a three-dimensional stereo camera and a machine tool positioner system as described in any one of claims 1 to 7 is implemented.