Calibration method and system and storage medium
Through an automated robot and camera system, high-precision camera calibration is achieved using image matching scores and pixel coordinates of multiple calibration points, solving the problems of high accuracy and manual intervention in the selection of natural feature points in the prior art, and improving calibration Efficiency and stability.
Patent Information
- Application Number
- CN202411178461.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-31
AI Technical Summary
The existing camera calibration methods rely on natural feature points, with high selection and detection accuracy, and manual intervention leads to unstable calibration results and low efficiency.
By controlling the robot carrying the calibration block to perform longitudinal motion, obtain image matching scores, determine the robot coordinates, and calculate pixel coordinates based on multiple calibration points. The least squares method is used to solve the internal and external parameter matrix to achieve automated calibration.
It improves the accuracy and consistency of calibration results, reduces human errors, improves calibration efficiency and stability, and adapts to different hardware configurations and calibration needs.
Smart Images

Figure CN119228906A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of camera calibration, and in particular to a calibration method, system and storage medium. Background Art
[0002] The purpose of camera calibration is to determine the intrinsic and extrinsic parameters of the camera, so as to establish an accurate mapping relationship between the camera image coordinate system and the actual world coordinate system.
[0003] Existing calibration methods, such as self-calibration methods, use natural feature points in any scene for calibration, and calculate camera parameters by matching the images and actual coordinates of these natural feature points; however, this self-calibration method has high requirements for the selection of feature points, and the selection and detection accuracy of feature points have a great influence on the calibration results, and usually requires complex algorithms and calculation processes to process the natural feature points. Summary of the invention
[0004] In order to solve the above technical problems, the present application provides a calibration method, system and storage medium with a simple calibration process and relatively accurate calibration results.
[0005] Specifically, the present application provides a calibration method, comprising the following steps:
[0006] S100: Control the robot carrying the calibration block to move longitudinally, and control the camera to acquire the calibration block image to obtain an image matching score.
[0007] S200: Determine a first coordinate of the robot according to the image matching score, and acquire a second coordinate of the robot at N calibration points based on the first coordinate.
[0008] And S300: Control the robot to move to each second coordinate, obtain the pixel coordinates corresponding to the calibration block, and determine the calibration result according to the pixel coordinates and the second coordinates.
[0009] In the above technical solution, high-precision coordinate measurement can be achieved through image matching to ensure the consistency and accuracy of calibration; the calibration process is automatically performed by robots and cameras to avoid human intervention. This automation method not only reduces the possibility of human errors, but also improves the efficiency and stability of the calibration process; by designing multiple calibration points, the calibration area can be fully covered to avoid errors caused by single-point calibration, improve the comprehensiveness and reliability of the calibration results, and facilitate more detailed optimization and calibration.
[0010] In addition, the entire calibration process is simple and convenient, and can be adapted to different types of calibration blocks and robots, and can be flexibly adjusted and adapted to different hardware configurations and calibration requirements.
[0011] Furthermore, before executing step S100, it includes: predetermining a template image.
[0012] In the above technical solution, predetermining the template image can ensure that the reference image used in the image matching process is accurate and standardized, which helps to improve the accuracy of image matching and further improve the accuracy of robot coordinate measurement; by preparing the template image in advance, the calculation time can be reduced in the calibration process, and the camera can directly compare with the predetermined template when acquiring the image, thereby speeding up the matching speed and improving the overall calibration efficiency; by predetermining the template image, quality control and verification can be performed to ensure that the template image in the image matching process meets the standard requirements, which helps to improve the reliability and consistency of the final calibration results; the pre-prepared template image can be reused in different calibration tasks, improving the adaptability and flexibility of the system, and multiple calibration tasks can be completed by simply applying the same template image during the calibration process, reducing the need to re-make the template.
[0013] In addition, for complex scenes that require high-precision calibration, pre-determined template images can provide more detailed and accurate references, helping to deal with the challenges brought by different perspectives and image deformations.
[0014] Furthermore, before executing step S100, the method further includes:
[0015] Control the robot carrying the calibration block to enter the camera's field of view and obtain the initial coordinates of the current robot.
[0016] In the above technical solution, by bringing the robot with the calibration block into the field of view of the camera, it can be ensured that the calibration block is in the effective field of view of the camera, which helps to ensure the accuracy of subsequent image acquisition and image matching, and avoid calibration errors caused by image data outside the field of view; obtaining the initial coordinates of the current robot can be used as a benchmark for the subsequent calibration process, which provides a clear starting point for the calculation and calibration of coordinates during the calibration process, and helps to accurately execute subsequent steps; obtaining the initial coordinates after entering the camera's field of view allows the camera to capture images at the correct viewing angle and distance, ensuring the quality and matching effect of the image, thereby improving the accuracy of the calibration results.
[0017] Furthermore, in the step S100, after obtaining the calibration block image, the following steps are performed:
[0018] The longitudinal coordinate corresponding to the robot is obtained to obtain the preliminary coordinate based on the initial coordinate and the longitudinal coordinate; and the template matching score is calculated according to the template image and the calibration block image.
[0019] In the above technical solution, by obtaining the corresponding longitudinal coordinates of the robot, the actual coordinates of the calibration block at different longitudinal positions can be accurately calculated. This precise coordinate calculation helps to improve the accuracy of the calibration results; after obtaining the calibration block image, the template matching score is calculated based on the template image and the calibration block image, which can effectively evaluate the matching degree of the calibration block under the current viewing angle. This evaluation helps to determine the quality of image matching, thereby improving the accuracy of subsequent steps; based on the initial coordinates and the longitudinal coordinates, the pre-coordinates are obtained to provide accurate reference points for subsequent calibration steps, which helps to ensure that the robot can accurately locate the target position during the calibration process, thereby improving the accuracy of the overall calibration.
[0020] Furthermore, in step S200, obtaining the first coordinate includes:
[0021] The pre-coordinates corresponding to the calibration block image with the highest template matching score are obtained as the first coordinates, and the calibration block image with the highest template matching score is used as the target image.
[0022] In the above technical solution, the pre-coordinates corresponding to the calibration block image with the highest matching score are selected, which can ensure that the first coordinates obtained have higher accuracy. The matching score reflects the matching quality of the image, ensuring the selection of the most reliable data. By focusing on the image with the highest matching score, the coordinate error caused by selecting an inappropriate calibration block image can be effectively reduced, thereby improving the stability and credibility of the calibration result.
[0023] Furthermore, in step S200, obtaining the second coordinate includes:
[0024] Based on the target image, the corresponding total pixel value, high pixel value and wide pixel value are obtained; the pixel unit quantity is calculated according to the total pixel value and the block diameter of the calibration block, and the camera field of view length and camera field of view width are calculated according to the total pixel value, high pixel value and wide pixel value.
[0025] In the above technical solution, selecting the image with the highest template matching score as the target image can ensure that the acquired coordinates are the most accurate. This is because the image with the highest matching score usually indicates that the template has the best match with the actual calibration block, thereby providing the most reliable coordinate data. By acquiring the first coordinate based on the image with the highest matching score, the coordinate error caused by low matching can be significantly reduced, which helps to improve the overall accuracy and consistency of the calibration and avoid error transmission caused by poor image matching.
[0026] Furthermore, in step S200, obtaining the second coordinates further includes:
[0027] Based on the first coordinate, the camera field of view length and the camera field of view width, N calibration points are determined; wherein the N calibration points include a central calibration point and N-1 surrounding calibration points.
[0028] The second coordinates of the central calibration point are calculated based on the initial coordinates, the pixel unit quantity, the high pixel value and the wide pixel value as the central coordinates.
[0029] And based on the center coordinates, the camera field of view length, the camera field of view width and the block diameter, the second coordinates corresponding to the N-1 surrounding calibration points are calculated respectively.
[0030] In the above technical solution, determining N calibration points (including central calibration points and surrounding calibration points) can fully cover the field of view of the camera. This coverage helps to uniformly calibrate the entire field of view, thereby improving the comprehensiveness and accuracy of the calibration; calculating the center coordinates based on the first coordinates, pixel unit, high pixel value and wide pixel value can provide accurate reference points. This accurate reference point is crucial for the calculation of subsequent calibration points, ensuring the high accuracy of the overall coordinate calculation; the layout of the central calibration points and the surrounding calibration points can optimize the distribution of the calibration points, covering the center and edge areas of the field of view. This layout helps to reduce errors caused by edge distortion or center deviation of the field of view, and improves the reliability of calibration; by calculating the second coordinates of N-1 surrounding calibration points, different areas of the camera's field of view can be analyzed in detail, which helps to perform high-precision calibration at different positions and angles, thereby improving the overall performance of the system.
[0031] In addition, calculation and correction at multiple calibration points can effectively detect and correct possible system errors. Data from different calibration points can be used to correct distortion and inconsistency in the field of view, thereby improving the stability of the system. In practical applications, calibration data based on center coordinates and surrounding coordinates can support dynamic adjustment. For example, the position of the calibration point can be adjusted according to real-time feedback to adapt to different working environments and needs.
[0032] Furthermore, in step S300, determining the calibration result includes:
[0033] A calibration equation group is established based on the pixel coordinates and the second coordinates, and the calibration equation group is solved using a least square method to obtain an intrinsic parameter matrix and an extrinsic parameter matrix as a calibration result.
[0034] In the above technical solution, the least squares method is used to solve the calibration equation group, which can accurately fit the calibration data and minimize the error, thereby improving the accuracy of the intrinsic parameter matrix and the extrinsic parameter matrix, which helps to ensure the high precision and reliability of the calibration results; the least squares method will comprehensively consider the noise and errors in the data during the solution process, and minimize these errors through the optimization algorithm, so that the final intrinsic parameter matrix and the extrinsic parameter matrix fit the actual situation more accurately; and the least squares method is a mature optimization algorithm with good computational stability. It can effectively process large-scale data sets and ensure that the calibration process can run stably under different data volumes and conditions.
[0035] Based on the same concept, the present application also provides a calibration system, including:
[0036] The first acquisition module is used to control the longitudinal movement of the robot carrying the calibration block, and at the same time control the camera to acquire the calibration block image to obtain the image matching score.
[0037] The second acquisition module is used to determine the first coordinates of the robot according to the image matching score, and acquire the second coordinates of the robot at N calibration points based on the first coordinates.
[0038] and a determination module, which is used to control the robot to move to each second coordinate, obtain the pixel coordinates corresponding to the calibration block, and determine the calibration result according to the pixel coordinates and the second coordinates.
[0039] In the above technical solution, the system controls the robot to automatically move longitudinally through the first acquisition module, and automatically acquires the calibration block image and image matching score, which simplifies the calibration process. This automation reduces manual intervention and improves the efficiency of calibration; the second acquisition module determines the first coordinate of the robot according to the image matching score, and acquires the second coordinate of the robot at multiple calibration points based on the coordinate. This method ensures the accuracy of coordinate acquisition and makes the calibration data more reliable; by acquiring the second coordinates of N calibration points, including the center and surrounding calibration points, the system can fully cover the camera's field of view. This comprehensive coverage ensures the consistency and accuracy of the calibration results within the entire field of view; the determination module controls the robot to move to each second coordinate and acquires the pixel coordinates of the calibration block, and calculates the calibration result through the pixel coordinates and the second coordinates. This method can effectively compare the actual calibration data with the theoretical model, thereby providing accurate calibration results.
[0040] In addition, the system can correct errors through data from multiple calibration points. Comprehensive consideration of calibration points in different positions helps to detect and correct errors caused by viewing angle, position changes, etc., and improve the overall accuracy of calibration. Since the system automatically controls the robot for calibration, it can adapt to different calibration tasks and environments. Whether it is different calibration blocks or different camera configurations, the system can be flexibly adjusted.
[0041] Through standardized steps and automated control, the system can maintain stability and consistency under different experimental conditions, reducing changes caused by human operation and improving the reliability of the calibration process.
[0042] Based on the same concept, the present application also provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the calibration method when running.
[0043] Compared with the prior art, the beneficial effects of this application are:
[0044] This application first controls the longitudinal movement of the robot carrying the calibration block, and at the same time controls the camera to obtain the calibration block image to obtain the image matching score; then determines the first coordinate of the robot according to the image matching score, and obtains the second coordinate of the robot at N calibration points based on the first coordinate; and further controls the robot to move to each second coordinate, obtains the pixel coordinates corresponding to the calibration block, and determines the calibration result according to the pixel coordinates and the second coordinates. This application can achieve high-precision coordinate measurement through image matching to ensure the consistency and accuracy of calibration; uses robots and cameras to automatically perform the calibration process, avoids manual intervention, and improves the efficiency and stability of the calibration process; by designing multiple calibration points, the calibration area can be fully covered, the comprehensiveness and reliability of the calibration results can be improved, and it is conducive to more detailed optimization and calibration; in addition, the entire calibration process is simple and convenient, and can be adapted to different types of calibration blocks and robots. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 This is a flow chart of the calibration method described in Example 1.
[0046] Figure 2 Schematic diagram of the calibration position distribution design.
[0047] Figure 3 A schematic diagram of the coordinate axis direction.
[0048] Figure 4 The framework diagram of the calibration system using the calibration method described in Example 1. DETAILED DESCRIPTION
[0049] A calibration method, system and storage medium of the present application are further described in detail below in conjunction with specific embodiments and drawings.
[0050] Embodiment 1:
[0051] See also Figure 1 , the present application provides a calibration method, comprising the following steps:
[0052] S100: Control the robot carrying the calibration block to move longitudinally, and control the camera to acquire the calibration block image to obtain an image matching score.
[0053] Furthermore, before executing step S100, it includes: predetermining a template image.
[0054] In this embodiment, first, it is necessary to prepare a template image, which is a typical representation of the target to be matched (in this case, an image related to the calibration block). The template image can be a grayscale image or a color image. Technical personnel in this field can choose it according to the actual application requirements and the algorithm used, and it is not limited here.
[0055] In the above technical solution, predetermining the template image can ensure that the reference image used in the image matching process is accurate and standardized, which helps to improve the accuracy of image matching and further improve the accuracy of robot coordinate measurement; by preparing the template image in advance, the calculation time can be reduced in the calibration process, and the camera can directly compare with the predetermined template when acquiring the image, thereby speeding up the matching speed and improving the overall calibration efficiency; by predetermining the template image, quality control and verification can be performed to ensure that the template image in the image matching process meets the standard requirements, which helps to improve the reliability and consistency of the final calibration results; the pre-prepared template image can be reused in different calibration tasks, improving the adaptability and flexibility of the system, and multiple calibration tasks can be completed by simply applying the same template image during the calibration process, reducing the need to re-make the template.
[0056] In addition, for complex scenes that require high-precision calibration, pre-determined template images can provide more detailed and accurate references, helping to deal with the challenges brought by different perspectives and image deformations.
[0057] Furthermore, before executing step S100, the method further includes:
[0058] Control the robot carrying the calibration block to enter the camera's field of view and obtain the initial coordinates of the current robot.
[0059] In this embodiment, after the template image is determined, a calibration block with a known diameter (i.e., the block diameter mentioned below, for example, 10 mm, and the calibration block is a circular calibration block) is installed at the end of the robot, and the robot is controlled to fall into the camera field of view with the calibration block. At this time, the initial coordinates (X0, Y0) of the robot are sent to the automatic calibration system, and the robot is controlled to move slowly up and down (i.e., longitudinal movement, or movement of the Z axis).
[0060] While the robot is moving with the calibration block, the camera continuously captures images containing the calibration block, namely, the calibration block image, which is used as the input of the template matching algorithm to find areas similar to the template image.
[0061] In the above technical solution, by bringing the robot with the calibration block into the field of view of the camera, it can be ensured that the calibration block is in the effective field of view of the camera, which helps to ensure the accuracy of subsequent image acquisition and image matching, and avoid calibration errors caused by image data outside the field of view; obtaining the initial coordinates of the current robot can be used as a benchmark for the subsequent calibration process, which provides a clear starting point for the calculation and calibration of coordinates during the calibration process, and helps to accurately execute subsequent steps; obtaining the initial coordinates after entering the camera's field of view allows the camera to capture images at the correct viewing angle and distance, ensuring the quality and matching effect of the image, thereby improving the accuracy of the calibration results.
[0062] Furthermore, in the step S100, after obtaining the calibration block image, the following steps are performed:
[0063] The longitudinal coordinate corresponding to the robot is obtained to obtain the preliminary coordinate based on the initial coordinate and the longitudinal coordinate; and the template matching score is calculated according to the template image and the calibration block image.
[0064] In this embodiment, the automatic calibration system automatically records the robot coordinates (X0, Y0, Z) and calculates the template matching score.
[0065] Among them, (X0, Y0, Z) is the pre-coordinate, and Z is the longitudinal coordinate.
[0066] Furthermore, the template matching score can be calculated using methods such as the square difference matching method (TM_SQDIFF), the normalized square difference matching method (TM_SQDIFF_NORMED), the correlation coefficient matching method (TM_CCORR), the normalized correlation coefficient matching method (TM_CCORR_NORMED), etc.; technical personnel in this field can select a suitable algorithm for calculation according to actual application requirements.
[0067] In the above technical solution, by obtaining the corresponding longitudinal coordinates of the robot, the actual coordinates of the calibration block at different longitudinal positions can be accurately calculated. This precise coordinate calculation helps to improve the accuracy of the calibration results; after obtaining the calibration block image, the template matching score is calculated based on the template image and the calibration block image, which can effectively evaluate the matching degree of the calibration block under the current viewing angle. This evaluation helps to determine the quality of image matching, thereby improving the accuracy of subsequent steps; based on the initial coordinates and the longitudinal coordinates, the pre-coordinates are obtained to provide accurate reference points for subsequent calibration steps, which helps to ensure that the robot can accurately locate the target position during the calibration process, thereby improving the accuracy of the overall calibration.
[0068] Further, S200: determining a first coordinate of the robot according to the image matching score, and acquiring a second coordinate of the robot at N calibration points based on the first coordinate.
[0069] Furthermore, in step S200, obtaining the first coordinate includes:
[0070] The pre-coordinates corresponding to the calibration block image with the highest template matching score are obtained as the first coordinates, and the calibration block image with the highest template matching score is used as the target image.
[0071] In this embodiment, the longitudinal coordinate Z corresponding to the highest template matching score is screened out. The pre-coordinate (X0, Y0, Z) at this time is the focal length corresponding to the camera at this position, which is also the initial position. The pre-coordinate at this time is used as the first coordinate for subsequent calculations, and the calibration block image corresponding to the initial position at this time is also used as the target image as a reference for subsequent calculations.
[0072] In the above technical solution, the pre-coordinates corresponding to the calibration block image with the highest matching score are selected, which can ensure that the first coordinates obtained have higher accuracy. The matching score reflects the matching quality of the image, ensuring the selection of the most reliable data. By focusing on the image with the highest matching score, the coordinate error caused by selecting an inappropriate calibration block image can be effectively reduced, thereby improving the stability and credibility of the calibration result.
[0073] Furthermore, in step S200, obtaining the second coordinate includes:
[0074] Based on the target image, the corresponding total pixel value, high pixel value and wide pixel value are obtained; the pixel unit quantity is calculated according to the total pixel value and the block diameter of the calibration block, and the camera field of view length and camera field of view width are calculated according to the total pixel value, high pixel value and wide pixel value.
[0075] In this embodiment, after the target image is acquired, it is preprocessed, such as denoising, graying, etc., and then an edge detection algorithm, such as Canny edge detection, is used to identify the edge of the calibration block. This step helps to determine the boundary of the circular calibration block; further, the corresponding total pixel value D is calculated based on the processed target image. 像素值 , high pixel value h 高像素值 and width pixel value w 宽像素值 .
[0076] The pixel unit quantity D is calculated according to the total pixel value and the block diameter of the calibration block. 像素单量 =D 标定块直径 / D 像素值 .
[0077] Get the length and width of the image in pixels (h高像素值 , w 宽像素值 ), based on the pixel count, the camera field of view can be calculated as:
[0078] H 宽 =D 像素值 *h 高像素值
[0079] W 长 =D 像素值 *w 宽像素值
[0080] In the above technical solution, selecting the image with the highest template matching score as the target image can ensure that the acquired coordinates are the most accurate. This is because the image with the highest matching score usually indicates that the template has the best match with the actual calibration block, thereby providing the most reliable coordinate data. By acquiring the first coordinate based on the image with the highest matching score, the coordinate error caused by low matching can be significantly reduced, which helps to improve the overall accuracy and consistency of the calibration and avoid error transmission caused by poor image matching.
[0081] Furthermore, in step S200, obtaining the second coordinates further includes:
[0082] Based on the first coordinate, the camera field of view length and the camera field of view width, N calibration points are determined; wherein the N calibration points include a central calibration point and N-1 surrounding calibration points.
[0083] In this embodiment, for example, 9-point calibration is adopted, so 9 calibration points (such as Figure 2 As shown), among which, calibration point 5 is the central calibration point, and the others are surrounding calibration points.
[0084] It should be noted that N is at least 3, that is, at least 3 calibration points need to be determined, but the current method usually performs calibration using three-point calibration, nine-point calibration, or more than nine-point calibration points.
[0085] Further, the second coordinates of the central calibration point are calculated based on the initial coordinates, the pixel unit quantity, the high pixel value and the wide pixel value as the central coordinates.
[0086] In this embodiment, the direction of the robot is determined, and a small step is added to the X and Y directions of the robot to move to the next point, thereby determining the direction of the X and Y coordinate axes (such as Figure 3 shown).
[0087] The pixel coordinates (X0, Y0) of the robot end calibration block at the initial position (i.e., the initial coordinates) and the pixel coordinates of the center point of the camera field of view (w 宽像素值 / 2,h 高像素值 / 2), combined with the actual coordinates of the robot at the end of the robot calibration block at the initial position, the direction of the robot coordinate axis and the pixel unit, the actual coordinate value of the camera center point, that is, the actual coordinate value of the calibration point 5 (that is, the center coordinate) can be calculated:
[0088]
[0089] Further, second coordinates corresponding to the N-1 surrounding calibration points are calculated respectively based on the center coordinates, the camera field of view length, the camera field of view width and the block diameter.
[0090] According to the coordinate distribution of the 9 points and the diameter of the calibration block, the robot coordinate values of the other 8 calibration points (i.e. the surrounding calibration points) are calculated in sequence. For example, the calibration point 1 is calculated as follows:
[0091]
[0092] Calibration point 2:
[0093] X2=X5
[0094]
[0095] Calibration point 3:
[0096]
[0097] Calibration point 4:
[0098]
[0099] Y4=Y5
[0100] Calibration point 6:
[0101]
[0102] Y6=Y5
[0103] Calibration point 7:
[0104]
[0105] Calibration point 8:
[0106] X8=X5
[0107]
[0108] Calibration point 9:
[0109]
[0110] In the above technical solution, determining N calibration points (including central calibration points and surrounding calibration points) can fully cover the field of view of the camera. This coverage helps to uniformly calibrate the entire field of view, thereby improving the comprehensiveness and accuracy of the calibration; calculating the center coordinates based on the first coordinates, pixel unit, high pixel value and wide pixel value can provide accurate reference points. This accurate reference point is crucial for the calculation of subsequent calibration points, ensuring the high accuracy of the overall coordinate calculation; the layout of the central calibration points and the surrounding calibration points can optimize the distribution of the calibration points, covering the center and edge areas of the field of view. This layout helps to reduce errors caused by edge distortion or center deviation of the field of view, and improves the reliability of calibration; by calculating the second coordinates of N-1 surrounding calibration points, different areas of the camera's field of view can be analyzed in detail, which helps to perform high-precision calibration at different positions and angles, thereby improving the overall performance of the system.
[0111] In addition, calculation and correction at multiple calibration points can effectively detect and correct possible system errors. Data from different calibration points can be used to correct distortion and inconsistency in the field of view, thereby improving the stability of the system. In practical applications, calibration data based on center coordinates and surrounding coordinates can support dynamic adjustment. For example, the position of the calibration point can be adjusted according to real-time feedback to adapt to different working environments and needs.
[0112] Further, S300: controlling the robot to move to each second coordinate, obtaining the pixel coordinates corresponding to the calibration block, and determining the calibration result according to the pixel coordinates and the second coordinates.
[0113] In this embodiment, after calculating the coordinate value corresponding to each calibration point (i.e., the second coordinate), each second coordinate is sent to the robot in turn, the robot moves to the corresponding second coordinate to obtain a new calibration block image, and calculates the center pixel coordinate value (i.e., the pixel coordinate) corresponding to the circular calibration block in each new calibration block image.
[0114] It should be noted that the calibration block image in step S300 is different from that in step S100, and the new calibration block image is obtained based on the second coordinate.
[0115] Furthermore, in step S300, determining the calibration result includes:
[0116] A calibration equation group is established based on the pixel coordinates and the second coordinates, and the calibration equation group is solved using a least square method to obtain an intrinsic parameter matrix and an extrinsic parameter matrix as a calibration result.
[0117] In this embodiment, each second coordinate and the corresponding pixel coordinate are represented as two sets, such as:
[0118] Second coordinate set: [(x1,y1),(x2,y2),...,(x9,y9)]
[0119] Pixel coordinate set: [(X1,Y1,Z1),(X2,Y2,Z2),...,(X9,Y9,Z9)]
[0120] Then, based on the second coordinate set and the pixel coordinate set, a calibration equation group is established, which also involves an intrinsic parameter matrix (K) and an extrinsic parameter matrix (R|t).
[0121] The calibration equations are as follows:
[0122]
[0123] Among them, s i is the scale factor, R is the rotation matrix, and t is the translation matrix.
[0124] Furthermore, the calibration equations are converted into a linear form and solved using the least squares method, for example, by using the calibration function provided by OpenCV. During the calibration process, the existing distortion needs to be corrected to obtain a more accurate calibration result.
[0125] In the above technical solution, the least squares method is used to solve the calibration equation group, which can accurately fit the calibration data and minimize the error, thereby improving the accuracy of the intrinsic parameter matrix and the extrinsic parameter matrix, which helps to ensure the high precision and reliability of the calibration results; the least squares method will comprehensively consider the noise and errors in the data during the solution process, and minimize these errors through the optimization algorithm, so that the final intrinsic parameter matrix and the extrinsic parameter matrix fit the actual situation more accurately; and the least squares method is a mature optimization algorithm with good computational stability. It can effectively process large-scale data sets and ensure that the calibration process can run stably under different data volumes and conditions.
[0126] Embodiment 2:
[0127] See also Figure 4 The present application also provides a calibration system using the calibration method described in Example 1, comprising:
[0128] The first acquisition module is used to control the longitudinal movement of the robot carrying the calibration block, and at the same time control the camera to acquire the calibration block image to obtain the image matching score.
[0129] The second acquisition module is used to determine the first coordinates of the robot according to the image matching score, and acquire the second coordinates of the robot at N calibration points based on the first coordinates.
[0130] and a determination module, which is used to control the robot to move to each second coordinate, obtain the pixel coordinates corresponding to the calibration block, and determine the calibration result according to the pixel coordinates and the second coordinates.
[0131] In the above technical solution, the system controls the robot to automatically move longitudinally through the first acquisition module, and automatically acquires the calibration block image and image matching score, which simplifies the calibration process. This automation reduces manual intervention and improves the efficiency of calibration; the second acquisition module determines the first coordinate of the robot according to the image matching score, and acquires the second coordinate of the robot at multiple calibration points based on the coordinate. This method ensures the accuracy of coordinate acquisition and makes the calibration data more reliable; by acquiring the second coordinates of N calibration points, including the center and surrounding calibration points, the system can fully cover the camera's field of view. This comprehensive coverage ensures the consistency and accuracy of the calibration results within the entire field of view; the determination module controls the robot to move to each second coordinate and acquires the pixel coordinates of the calibration block, and calculates the calibration result through the pixel coordinates and the second coordinates. This method can effectively compare the actual calibration data with the theoretical model, thereby providing accurate calibration results.
[0132] In addition, the system can correct errors through data from multiple calibration points. Comprehensive consideration of calibration points in different positions helps to detect and correct errors caused by viewing angle, position changes, etc., and improve the overall accuracy of calibration. Since the system automatically controls the robot for calibration, it can adapt to different calibration tasks and environments. Whether it is different calibration blocks or different camera configurations, the system can be flexibly adjusted.
[0133] Through standardized steps and automated control, the system can maintain stability and consistency under different experimental conditions, reducing changes caused by human operation and improving the reliability of the calibration process.
[0134] Embodiment three:
[0135] The present application also provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the calibration method when running.
[0136] In this embodiment, the storage medium stores several computer programs for enabling a device to execute all or part of the steps of the method described in each embodiment of the present application.
[0137] The medium may include a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk, and other media that can store program codes.
[0138] In summary, the present application provides a calibration method, system and storage medium; first, the robot carrying the calibration block is controlled to move longitudinally, and the camera is controlled to obtain the calibration block image at the same time to obtain the image matching score; then the first coordinate of the robot is determined according to the image matching score, and the second coordinate of the robot at N calibration points is obtained based on the first coordinate; the robot is further controlled to move to each second coordinate, and the pixel coordinates corresponding to the calibration block are obtained to determine the calibration result according to the pixel coordinates and the second coordinates. The present application can achieve high-precision coordinate measurement through image matching to ensure the consistency and accuracy of calibration; the robot and camera are used to automatically perform the calibration process, avoiding manual intervention and improving the efficiency and stability of the calibration process; by designing multiple calibration points, the calibration area can be fully covered, the comprehensiveness and reliability of the calibration results can be improved, and it is conducive to more detailed optimization and calibration; in addition, the entire calibration process is simple and convenient, and can be adapted to different types of calibration blocks and robots.
[0139] Although example embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above example embodiments are merely exemplary and are not intended to limit the scope of the present application to this. Those of ordinary skill in the art may make various changes and modifications therein without departing from the scope and spirit of the present application. All these changes and modifications are intended to be included within the scope of the present application as required by the appended claims.
[0140] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0141] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.
[0142] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some modules according to the embodiments of the present application. The application can also be implemented as a device program (e.g., computer program and computer program product) for executing a part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0143] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0144] Although the description of the present application is carried out in conjunction with the above specific embodiments, it is obvious that those skilled in the art can make many substitutions, modifications and changes based on the above content. Therefore, all such substitutions, improvements and changes are included in the spirit and scope of the appended claims.
Claims
1. A calibration method, characterized in that: The following steps are involved: S100: Control the robot carrying the calibration block to move longitudinally, and control the camera to obtain the calibration block image to obtain the image matching score; S200: determining a first coordinate of the robot according to the image matching score, and acquiring a second coordinate of the robot at N calibration points based on the first coordinate; and S300: Control the robot to move to each second coordinate, obtain the pixel coordinates corresponding to the calibration block, and determine the calibration result according to the pixel coordinates and the second coordinates.
2. The calibration method according to claim 1, characterized in that: Before executing step S100 , it includes: predetermining a template image.
3. The calibration method according to claim 2, characterized in that: Before executing step S100, the method further includes: Control the robot carrying the calibration block to enter the camera's field of view and obtain the initial coordinates of the current robot.
4. The calibration method according to claim 3, characterized in that: In the step S100, after obtaining the calibration block image, the following steps are performed: Acquire the longitudinal coordinate corresponding to the robot to obtain the pre-coordinate based on the initial coordinate and the longitudinal coordinate; At the same time, a template matching score is calculated according to the template image and the calibration block image.
5. The calibration method according to claim 4, characterized in that: In the step S200, obtaining the first coordinate includes: obtaining the pre-coordinate corresponding to the calibration block image with the highest template matching score as the first coordinate, and using the calibration block image with the highest template matching score as the target image.
6. The calibration method according to claim 5, characterized in that: In the step S200, obtaining the second coordinate includes: obtaining the corresponding total pixel value, high pixel value and wide pixel value based on the target image; The pixel unit quantity is calculated according to the total pixel value and the block diameter of the calibration block, and the camera field of view length and camera field of view width are calculated according to the total pixel value, the high pixel value and the wide pixel value.
7. The calibration method according to claim 6, characterized in that: In the step S200, obtaining the second coordinate further includes: determining N calibration points based on the first coordinate, the camera field of view length and the camera field of view width; wherein the N calibration points include a central calibration point and N-1 surrounding calibration points; Calculating the second coordinate of the central calibration point based on the initial coordinate, the pixel unit quantity, the high pixel value and the wide pixel value as the central coordinate; and The second coordinates corresponding to the N-1 surrounding calibration points are calculated respectively based on the center coordinates, the camera field of view length, the camera field of view width and the block diameter.
8. The calibration method according to claim 7, characterized in that: In the step S300, determining the calibration result includes: establishing a calibration equation group based on the pixel coordinates and the second coordinates, and solving the calibration equation group using the least square method to obtain an intrinsic parameter matrix and an extrinsic parameter matrix as the calibration result.
9. A system using the calibration method according to any one of claims 1 to 8, characterized in that: include: The first acquisition module is used to control the longitudinal movement of the robot carrying the calibration block and control the camera to acquire the calibration block image to obtain the image matching score; A second acquisition module, used to determine the first coordinates of the robot according to the image matching score, and acquire the second coordinates of the robot at N calibration points based on the first coordinates; as well as The determination module is used to control the robot to move to each second coordinate, obtain the pixel coordinates corresponding to the calibration block, and determine the calibration result according to the pixel coordinates and the second coordinates.
10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the calibration method according to any one of claims 1 to 8 when running.
Citation Information
Patent Citations
Robotc based on concentric annulus template
CN108908399A
Robot calibration method and device
CN114074321A
Layered hand-eye calibration robot motion pose automatic generation method, system, equipment and medium
CN115781698A
Visual positioning method, terminal and storage medium
CN116051634A
Automatic calibration and feedback method and system
CN118135026A