Structural cursor calibration method and system under three coordinates
By acquiring calibration plate images and composite coded patterns from multiple angles, combined with three-dimensional three-dimensional targets, the problems of lens distortion and ambient light interference in the traditional structural cursor calibration method are solved, and high-precision camera and projector parameter calibration is achieved, improving the accuracy and efficiency of three-dimensional detection.
Patent Information
- Application Number
- CN202510733495.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-06-04
AI Technical Summary
Traditional structural cursor calibration methods are difficult to fully consider the impact of lens distortion in three-dimensional dimension detection, resulting in inaccurate parameters, and ambient light interference can easily lead to decoding errors, affecting the accurate solution of projector parameters.
By acquiring calibration plate images from multiple angles, extracting sub-pixel corner point data, building a camera parameter description method including radial and tangential distortion, solving camera parameters based on pinhole imaging principles; using composite coded patterns and three-dimensional three-dimensional targets, establishing the corresponding relationship between the projector and the camera, and optimizing projector parameters through geometric correction values.
It effectively reduces the camera imaging error to the subpixel level, improves the accuracy of projector parameters, enhances the anti-interference ability of the encoded pattern, reduces manual intervention in the calibration process, and shortens the calibration time.
Smart Images

Figure CN120259444A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of structured light imaging, and particularly to a structured light calibration method and system in three coordinates. Background Art
[0002] Traditional structured light calibration methods have some limitations. Most of them determine camera and projector parameters based on calibration plate images from a single perspective or a limited number of perspectives, and it is difficult to comprehensively consider the influence of lens distortion on imaging. For example, when performing three-dimensional dimension detection on an automotive engine cylinder block, if the traditional method is used for calibration, due to the radial and tangential distortion of the camera lens, when images of the edge part of the cylinder block are collected, the influence of distortion increases due to the change in perspective, and the parameters obtained by calibration are difficult to accurately restore the true three-dimensional shape of the cylinder block, resulting in deviation in the detection results.
[0003] In addition, when traditional methods establish the correspondence between the projector and three-dimensional space points, they rely relatively heavily on simple coded patterns, are easily interfered by ambient light, and have limited decoding accuracy. The complex ambient light in the production workshop will cause deformation and brightness attenuation of the simple stripe patterns projected by traditional structured light, resulting in errors in the decoded phase and coded data, and further affecting the accurate solution of the internal and external parameters of the projector. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a structured light calibration method and system in three coordinates, which realize the collaborative calibration of camera and projector parameters by collecting calibration plate images from multiple angles and projecting composite codes.
[0005] To solve the above technical problem, the technical solution of the present invention is as follows: In a first aspect, a structured light calibration method in three coordinates, the method includes: Step 1, by collecting calibration plate images at multiple angles, extracting sub-pixel corner point data, constructing a description method of camera parameters including radial and tangential distortion, and based on the pinhole imaging principle, solving the internal parameter matrix and distortion coefficients of the camera by establishing a linear equation system to obtain the calibrated camera parameters; Step 2, based on the calibrated camera parameters, projecting a composite coded pattern onto the calibration plate, synchronously collecting relevant images and decoding the phase and coded data, and using the calibrated camera parameters to establish the correspondence between projector pixels and three-dimensional space points on the calibration plate, and solving the internal and external parameter matrices of the projector to obtain the initial projector parameters; Step 3, according to the initial projector parameters, enabling a three-dimensional stereo target including feature points to synchronously obtain camera images and projection patterns in multiple poses, and establishing the correspondence between "projector code - camera corner point - world coordinate" through feature matching, determining three detection points and calculating a geometric correction value based on the spatial polygon formed by the three detection points; Step 4: Use the geometric correction value to correct the initial projector parameters to obtain the corrected projector parameters.
[0006] Further, by collecting calibration board images at multiple angles, extracting sub-pixel corner data, constructing a camera parameter description method including radial and tangential distortions, and based on the pinhole imaging principle, establishing a linear equation system to solve the internal parameter matrix and distortion coefficients of the camera to obtain the calibrated camera parameters, including: Rotate the checkerboard calibration board by different angles within ±30 degrees around the horizontal and vertical axes in the plane, and translate it by 5 different spatial positions in the depth direction perpendicular to the calibration board plane. Collect clear images including complete checkerboard corner points at each position through the camera. Extract the sub-pixel coordinates of the checkerboard corner points from the clear images of the complete checkerboard corner points, and eliminate abnormal corner points of the pixels through the consistency check of the adjacent corner point spacing to form an image coordinate set. Based on the image coordinate set and the world coordinates of the calibration board corner points, establish the projection mapping relationship between the camera coordinate system and the world coordinate system through the pinhole imaging principle. Combine the rotation and translation matrix to convert the world coordinates of the calibration board corner points into three-dimensional coordinates in the camera coordinate system, and introduce the first radial, second radial, first tangential, and second tangential distortion coefficients to quantify the distortion characteristics of the camera lens. According to the projection mapping relationship, map the three-dimensional coordinates in the camera coordinate system to the undistorted image plane coordinates through the ideal projection formula, and correct the coordinates by superimposing the distortion coefficients to obtain the actual image plane coordinates. And use the corresponding relationship between the world coordinates of all corner points and the corrected image coordinates to construct a linear equation system. Based on the constructed linear equation system, jointly correct the internal parameters, external parameters, and distortion coefficients of the camera to obtain the calibrated camera parameters.
[0007] Further, according to the projection mapping relationship, map the three-dimensional coordinates in the camera coordinate system to the undistorted image plane coordinates through the ideal projection formula, and correct the coordinates by superimposing the distortion coefficients to obtain the actual image plane coordinates. And use the corresponding relationship between the world coordinates of all corner points and the corrected image coordinates to construct a linear equation system, including: Place the three-dimensional stereo target at multiple preset poses, including checkerboard corner points and preset circular coding marks, and project a composite coding pattern onto the target through the projector, and synchronously trigger the camera to collect the target images with the projection pattern. Decode the target images, extract the sub-pixel corner point coordinates in the camera coordinate system and the corresponding projector coding values, and combine the calibrated camera parameters to back-project the sub-pixel corner point coordinates into three-dimensional space to obtain the world coordinates of the target corner points. Based on the encoded values of the projector and the decoded phase information, establish a preliminary mapping relationship between the projector pixel coordinates and the target world coordinates, and determine three non-collinear feature points on different depth planes of the target as detection points through the preliminary mapping relationships under multiple perspectives; Using the world coordinates of the detection points and the corresponding projector encoded coordinates, calculate the deviation amounts between the measured geometric relationships and the theoretical geometric relationships of the three detection points in the projector coordinate system respectively, including the differences between the measured distances and angles among the detection points and the theoretical distances and angles; Decompose the deviation amounts into the focal length error of the projector internal parameters, the principal point offset error, and the rotation component error and translation component error of the external parameters, and establish a linear correspondence relationship between each deviation component and the geometric correction parameters through mathematical relationship analysis to construct a system of linear equations.
[0008] Furthermore, based on the calibrated camera parameters, project a composite encoded pattern onto the calibration board, synchronously collect relevant images and decode the phase and encoded data, and establish a correspondence relationship between the projector pixels and the three-dimensional space points of the calibration board using the calibrated camera parameters to solve the internal and external parameter matrices of the projector to obtain the initial projector parameters, including: Based on the calibrated camera parameters, project a composite code composed of multiple groups of sine fringes and binary encoded patterns onto the calibration board to form a spatio-temporal hybrid encoding sequence; When the projector projects each group of encoded patterns, synchronously trigger the camera to collect the corresponding deformed fringe images and decode the collected image sequence; Using the calibrated camera parameters, back-project the image coordinates of the calibration board corner points to the three-dimensional space coordinate system of the calibration board to obtain the accurate three-dimensional coordinates of the corner points, and at the same time, establish a mapping relationship between the projector image plane coordinates and the calibration board three-dimensional space coordinates according to the absolute phase value of each pixel in the encoded pattern projected by the projector; Based on the mapping relationship between the projector image plane coordinates and the calibration board three-dimensional space coordinates, associate the coordinates of each pixel of the projector with the corresponding calibration board three-dimensional coordinates, and construct the projection equation of the projector to obtain the initial projector parameters.
[0009] Furthermore, according to the initial projector parameters, enable a three-dimensional solid target including feature points to synchronously obtain camera images and projection patterns in multiple poses, and establish a correspondence relationship among "projector encoding - camera corner points - world coordinates" through feature matching, determine three detection points, and calculate geometric correction values based on the spatial polygon formed by the three detection points, including: Distribute checkerboard corner points and circular fiducial points on three orthogonal planes of the target, the three-dimensional coordinates of each feature point are pre-calibrated by a measuring device, and the target can freely move along the translation guide rail to change the spatial pose; During the movement of the target, control the projector to project a composite coded pattern onto the surface of the target, and simultaneously trigger the camera to collect the image of the target and the projection pattern; Based on the known world coordinates of the target feature points, match them with the sub-pixel corner coordinates extracted from the camera image. At the same time, by decoding the phase encoding value of the projection pattern, associate the encoding coordinates of the corresponding pixels in the projector image plane to form a three-dimensional correspondence dataset of "projector pixel - camera pixel - world coordinate", and determine three non-collinear feature points on the target as the detection point set to calculate the geometric correction value.
[0010] Further, based on the known world coordinates of the target feature points, match them with the sub-pixel corner coordinates extracted from the camera image. At the same time, by decoding the phase encoding value of the projection pattern, associate the encoding coordinates of the corresponding pixels in the projector image plane to form a three-dimensional correspondence dataset of "projector pixel - camera pixel - world coordinate", and determine three non-collinear feature points on the target as the detection point set to calculate the geometric correction value, including: Based on multiple poses of the target movement, extract the sub-pixel corner coordinates of all feature points on the target surface from the camera image of each pose, and combine with the pre-calibrated three-dimensional world coordinates on the target to establish a local mapping relationship of "camera pixel - world coordinate"; Decode the composite coded pattern projected by the projector for each pose, obtain the absolute phase encoding of the feature points on the target surface, and combine with the local mapping relationship to bind the projector encoding coordinates with the camera pixel coordinates and world coordinates to generate a three-dimensional global dataset of "projector pixel - camera pixel - world coordinate"; Determine three non-collinear feature points from the three-dimensional global dataset as the detection point set. According to the world coordinates and the initial projector parameters, calculate the comparison between the theoretical encoding coordinates and the actual decoded coordinates of the projector to obtain the coordinate deviation vectors in the horizontal and vertical directions of each detection point; Based on the coordinate deviation vectors, calculate the actual projection position of the spatial triangle formed by the three detection points in the projector coordinate system, and perform geometric comparison with the theoretical spatial triangle in the world coordinate system to extract the side length ratio error and the plane rotation angle deviation; Convert the side length ratio error into a scaling correction coefficient of the projector image plane, decompose the plane rotation angle deviation into a rotation correction matrix between the projector coordinate system and the spatial coordinate system, and combine with the spatial distribution direction of the deviation vectors of the three detection points to generate the geometric correction value.
[0011] Further, use the geometric correction value to correct the initial projector parameters to obtain the corrected projector parameters, including: Analyze the geometric correction value into the rotation component adjustment amount and the translation component adjustment amount corresponding to the external parameters of the projector; Combine and superimpose the rotation component adjustment amount with the rotation component in the initial external parameters, and superimpose the translation component adjustment amount with the translation component in the initial external parameters to generate an adjusted external parameter matrix of the projector; Based on the adjusted external parameter matrix and the initial internal parameters, and in combination with the projection position deviation of the structured light pattern on the imaging plane of the projector under multiple sets of target poses, establish a correction relationship for the internal and external parameters of the projector; According to the correction relationship, correct the internal and external parameters of the projector to reduce the projection position deviation corresponding to different target poses to within a preset range, so as to obtain the corrected projector parameters.
[0012] In a second aspect, a structured light calibration system in three coordinates includes: A parameter calibration module, which is used to collect calibration plate images at multiple angles, extract sub-pixel corner data, construct a description method of camera parameters including radial and tangential distortions, and based on the pinhole imaging principle, solve the internal parameter matrix and distortion coefficients of the camera by establishing a system of linear equations to obtain a preliminary calibration of the camera parameters; A projector calibration module, which is used to project a composite coded pattern onto the calibration plate based on the preliminary calibration of the camera parameters, synchronously collect relevant images and decode the phase and coded data, and use the calibrated camera parameters to establish a correspondence between the projector pixels and the three-dimensional space points of the calibration plate, so as to solve the internal and external parameter matrices of the projector and obtain the initial projector parameters; A three-dimensional matching module, which is used to, according to the initial projector parameters, synchronously obtain camera images and projection patterns of a three-dimensional stereo target including feature points in multiple different poses, establish a correspondence between "projector coding - camera corner - world coordinate" through feature matching, determine three detection points, and calculate a geometric correction value based on the spatial polygon formed by the three points; A projector correction module, which is used to correct the initial projector parameters by using the geometric correction value to obtain the corrected projector parameters.
[0013] In a third aspect, a computing device includes: One or more processors; A storage device for storing one or more programs, which when executed by the one or more processors cause the one or more processors to implement the method described above.
[0014] In a fourth aspect, a computer-readable storage medium stores a program that implements the method when executed by a processor.
[0015] The above solution of the present invention has at least the following beneficial effects: By collecting calibration board images from multiple angles and extracting sub-pixel corner points, a camera parameter description including radial and tangential distortions is constructed. Combining a linear equation system to jointly calibrate the internal and external parameters of the camera and the distortion coefficients, compared with the traditional single-view calibration method, the camera imaging error can be reduced from the pixel level to the sub-pixel level, effectively solving the problem of three-dimensional reconstruction deviation caused by edge field distortion. Using feature point matching of a three-dimensional stereo target in multiple poses, a global correspondence relationship of "projector coding - camera corner points - world coordinates" is established, and the initial parameters of the projector are corrected through the geometric correction value of the spatial polygon to improve the accuracy of the projector projection matrix. A composite coding pattern combining multiple groups of sine stripes and binary coding is adopted, and the anti-interference ability of the phase and coding data is enhanced through spatio-temporal hybrid decoding technology. Even under environmental light fluctuations or projector projection brightness attenuation, the phase ambiguity and parameter calculation errors caused by environmental light interference in traditional simple stripe coding are avoided. Through the standardized three-dimensional stereo target design and multi-pose automatic acquisition process, the manual intervention in the calibration process is reduced, and the overall calibration time is shortened. Brief Description of the Drawings
[0016] Figure 1 FIG. is a schematic flowchart of a structured light calibration method in three coordinates provided by an embodiment of the present invention.
[0017] Figure 2 FIG. is a schematic diagram of a structured light calibration system in three coordinates provided by an embodiment of the present invention. Detailed Description of the Embodiments
[0018] Hereinafter, exemplary embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.
[0019] As Figure 1 shown, an embodiment of the present invention provides a structured light calibration method in three coordinates, and the method includes the following steps: Step 1: By collecting calibration board images at multiple angles, extracting sub-pixel corner point data, constructing a camera parameter description method including radial and tangential distortions, and based on the pinhole imaging principle, establishing a linear equation system to solve the internal parameter matrix and distortion coefficients of the camera to obtain the calibrated camera parameters; Step 2: Based on the calibrated camera parameters, project a composite coding pattern onto the calibration board, synchronously collect relevant images and decode the phase and coding data, and establish a correspondence relationship between the projector pixels and the three-dimensional space points of the calibration board using the calibrated camera parameters, and solve the internal and external parameter matrices of the projector to obtain the initial projector parameters; Step 3: According to the initial projector parameters, make the three-dimensional stereo target including feature points synchronously acquire camera images and projection patterns in multiple poses, and establish the corresponding relationship among "projector encoding - camera corner points - world coordinates" through feature matching, determine three detection points, and calculate the geometric correction value based on the spatial polygon formed by the three detection points; Step 4: Use the geometric correction value to correct the initial projector parameters to obtain the corrected projector parameters.
[0020] In the embodiment of the present invention, by collecting calibration board images from multiple angles and extracting sub-pixel corner point data, the imaging field of view of the camera can be comprehensively covered, and the imaging conditions under different perspectives are fully considered. Construct a camera parameter description method including radial and tangential distortions, and solve the parameters in combination with the pinhole imaging principle, effectively eliminating the influence of lens distortion on imaging. Compared with traditional methods, this method can more accurately determine the internal parameter matrix and distortion coefficient of the camera, making the geometric information of the object in the image closer to the real situation and improving the measurement accuracy. Project the composite coding pattern based on the calibrated camera parameters. The use of the composite coding pattern enhances the anti-interference ability against ambient light, ensuring accurate decoding of the phase and coding data under complex lighting conditions. Establish the corresponding relationship between the projector pixels and the three-dimensional space points of the calibration board using the calibrated camera parameters, effectively avoiding the corresponding errors caused by inaccurate camera parameters, being able to quickly and accurately solve the internal and external parameter matrices of the projector, obtaining relatively reliable initial projector parameters, and improving the efficiency and accuracy of projector parameter calibration.
[0021] Using the three-dimensional stereo target to synchronously acquire images and projection patterns in multiple poses and establishing the corresponding relationship among "projector encoding - camera corner points - world coordinates" through feature matching, compared with the calibration in a single fixed pose, this multi-perspective and multi-dimensional data acquisition and matching method can more comprehensively reflect the projection characteristics of the projector in different spatial states. Determine three detection points and calculate the geometric correction value based on the spatial polygon, deeply analyze the deviation of the projector parameters from the geometric relationship level, make the optimization of the projector parameters more targeted, and effectively solve the potential error problem of the projector parameters in spatial mapping. Use the geometric correction value to correct the initial projector parameters, which can directly adjust the deviation of the projector parameters found in the previous steps. Compared with the uncorrected initial parameters, the corrected projector parameters improve the mapping accuracy between the projector and the real three-dimensional space. Whether in the measurement of the size of an object or in the application of three-dimensional reconstruction, the projection result can be made more in line with the actual situation, effectively reducing the measurement error caused by inaccurate projector parameters.
[0022] In a preferred embodiment of the present invention, in step 1 above, by collecting calibration board images from multiple angles, extracting sub-pixel corner data, constructing a description method of camera parameters including radial and tangential distortions, and based on the pinhole imaging principle, by establishing a system of linear equations to solve the internal parameter matrix and distortion coefficients of the camera, the calibrated camera parameters can be obtained, which may include: Step 110, rotate the checkerboard calibration board by different angles within the range of ±30 degrees around the horizontal axis and the vertical axis in the plane, and translate it by 5 different spatial positions in the depth direction perpendicular to the plane of the calibration board, and collect clear images including complete checkerboard corner points through the camera at each position; Step 111, extract the sub-pixel coordinates of the checkerboard corner points from the clear images of the complete checkerboard corner points, and eliminate abnormal corner points of the pixels through the consistency check of the distances between adjacent corner points to form an image coordinate set; Step 112, based on the image coordinate set and the world coordinates of the calibration board corner points, establish the projection mapping relationship between the camera coordinate system and the world coordinate system through the pinhole imaging principle, convert the world coordinates of the calibration board corner points into three-dimensional coordinates in the camera coordinate system in combination with the rotation and translation matrix, and introduce the first radial, second radial, first tangential and second tangential distortion coefficients to quantify the distortion characteristics of the camera lens; Step 113, according to the projection mapping relationship, map the three-dimensional coordinates in the camera coordinate system to the undistorted image plane coordinates through the ideal projection formula, and correct the coordinates by superimposing the distortion coefficients to obtain the actual image plane coordinates, and construct a system of linear equations using the corresponding relationship between the world coordinates of all corner points and the corrected image coordinates, specifically including: placing a three-dimensional stereo target at multiple preset poses, including checkerboard corner points and preset circular coding marks, and projecting a composite coding pattern onto the target through a projector, synchronously triggering the camera to collect target images with the projection pattern; decoding the target images, extracting the sub-pixel corner point coordinates in the camera coordinate system and the corresponding projector coding values, and in combination with the calibrated camera parameters, back-projecting the sub-pixel corner point coordinates into three-dimensional space to obtain the world coordinates of the target corner points; based on the projector coding values and the decoded phase information, establish a preliminary mapping relationship between the projector pixel coordinates and the target world coordinates, and determine three non-collinear feature points on different depth planes of the target as detection points through the preliminary mapping relationship under multiple perspectives; using the world coordinates of the detection points and the corresponding projector coding coordinates, calculate the deviation amounts between the measured geometric relationships and the theoretical geometric relationships of the three detection points in the projector coordinate system respectively, including the differences between the measured distances and angles between the detection points and the theoretical distances and angles; decompose the deviation amounts into the focal length error of the projector internal parameters, the principal point offset error, and the rotation component error and translation component error of the external parameters, and establish a linear correspondence relationship between each deviation component and the geometric correction parameters through mathematical relationship analysis to construct a system of linear equations; Step 114, based on the constructed linear equations, jointly correct the internal parameters, external parameters, and distortion coefficients of the camera to obtain the calibrated camera parameters.
[0023] In the embodiment of the present invention, the checkerboard calibration board is placed in the center of the camera's field of view, maintaining the initial horizontal posture, and the first image is taken as a reference. Subsequently, the calibration board is gradually rotated along the horizontal axis (for example, from left to right) at a certain angular interval (such as 5 degrees), and an image is taken after each rotation until +30 degrees is reached; then it is rotated in the reverse direction to -30 degrees, and images are also taken at intervals. After the rotation along the horizontal axis is completed, the above operations are repeated for the calibration board along the vertical axis (for example, from top to bottom) to ensure that all tilted perspectives are covered. Finally, in the direction perpendicular to the plane of the calibration board, the calibration board is moved 5 different distances towards or away from the camera, and an image is taken after each movement while maintaining the horizontal posture. Through this multi-directional, multi-angle, and multi-depth acquisition method, an image dataset covering different imaging conditions within the camera's field of view is obtained. After obtaining clear images including all the corner points of the checkerboard, first, a classic corner detection algorithm (such as the Harris corner detection algorithm) is used to evaluate each pixel point in the image. This algorithm calculates the gradient of the gray-scale change of the pixel point in the horizontal and vertical directions, constructs an autocorrelation matrix, and then obtains the corner response value of each pixel point. A suitable response threshold is set, and the pixel points with a response value > threshold are initially identified as the corner points of the checkerboard, thereby locating the approximate pixel positions of the corner points of the checkerboard in the image. Taking the position obtained by pixel-level corner localization as the center, a small local area (such as a 3×3 or 5×5 pixel neighborhood) is determined. In this local area, sub-pixel coordinate calculation is performed based on the method of gray-scale interpolation. For example, assuming a 3×3 neighborhood, the gray-scale value of each pixel point is used as a weight to perform weighted averaging on the coordinates within the neighborhood, and fine-tuning is performed through an interpolation formula, thereby improving the accuracy of the corner coordinates to the sub-pixel level. After the sub-pixel coordinates are extracted, for each row and each column of the checkerboard, the pixel distances between adjacent corner points are calculated in sequence. Since the manufacturing process of the checkerboard determines that the corner point spacing is fixed and uniform in reality (for example, the side length of each square of the checkerboard corresponds to a fixed pixel distance), the theoretical standard pixel distance between adjacent corner points can be calculated in advance according to the actual size of the checkerboard and the image resolution. A reasonable error threshold is set (such as the difference in adjacent spacings does not exceed 0.5 pixels), and the actually calculated adjacent corner point spacings are compared with the standard distance. If the difference between a certain adjacent corner point spacing and the standard distance > the set threshold, then this corner point is determined as an abnormal corner point and is excluded. After the above abnormal corner point exclusion operation, the sub-pixel coordinates of all the remaining corner points are summarized to form an image coordinate set. Each corner point coordinate in this set has a high accuracy and effectively excludes the wrong corner points caused by image noise, local illumination changes, partial occlusion of the checkerboard, or minor deformation factors existing in the calibration board itself.
[0024] The three-dimensional coordinates of each corner point of the known checkerboard calibration board in the world coordinate system (usually set the plane where the calibration board is located as the plane, axis is perpendicular to this plane, and the (with coordinates of 0), according to the principle of pinhole imaging, the camera imaging process can be regarded as points in the world coordinate system being projected onto the image plane through a virtual pinhole. By introducing the external parameter matrix composed of a rotation matrix and a translation vector, the corner coordinates in the world coordinate system are transformed into the camera coordinate system to describe the spatial pose of the calibration board from the camera's perspective. At the same time, considering the distortion existing in the actual camera lens, four distortion coefficients (the first radial, the second radial, the first tangential, and the second tangential distortion coefficients) are introduced, corresponding to different types of distortion effects respectively. For example, radial distortion mainly affects the proportional relationship from the center to the edge region of the image, while tangential distortion causes the image to appear skewed. Through these coefficients, the lens distortion characteristics can be quantitatively described, providing a basis for subsequent distortion correction. According to the projection mapping relationship, the three-dimensional coordinates in the camera coordinate system are mapped to the undistorted image plane coordinates through the ideal projection formula, and the distortion coefficients are superimposed to correct the coordinates, obtaining the actual image plane coordinates, and a linear equation system is constructed using the corresponding relationship between the world coordinates of all corners and the corrected image coordinates. First, according to the ideal projection formula of pinhole imaging, the three-dimensional corner coordinates in the camera coordinate system are projected onto an ideal undistorted image plane to obtain the preliminary image coordinates. However, due to the distortion of the actual lens, the distortion coefficients introduced in step 112 are needed to correct the ideal coordinates. The specific operation is to adjust the radial position of the coordinates according to the radial distortion coefficient (such as the stretching or compression effect caused by radial distortion for points far from the image center), and adjust the tangential position of the coordinates according to the tangential distortion coefficient (such as correcting the image skew caused by lens assembly error). After distortion correction, the accurate coordinates of each corner on the actual image plane are obtained. Finally, the world coordinates of all corners are corresponded to the corrected image coordinates, and according to the projection transformation relationship and distortion, these corresponding relationships are transformed into the form of linear equations. The equations of multiple corners are combined together to form a linear equation system, which contains unknowns such as the camera's internal parameters, external parameters, and distortion coefficients. Using the linear equation system solving method (such as the least squares method), the linear equation system constructed in step 113 is solved. The core idea of the least squares method is to adjust the unknowns in the equation system (i.e., the elements of the camera's internal parameter matrix, the rotation and translation matrix elements, and the distortion coefficients) so that the sum of the squares of the errors between the actual image coordinates and the theoretically calculated coordinates in the equation system is minimized. During the solving process, the corner data in all the collected images are included in the calculation at the same time, and by continuously adjusting the parameter values, the error is gradually reduced. Finally, when the error reaches the set convergence condition (such as the sum of the squares of the errors no longer decreases), the obtained parameter values are the camera's internal parameter matrix, external parameter matrix, and distortion coefficients after combined correction, and these parameters accurately describe the imaging characteristics of the current camera, completing the calibration of the camera parameters.
[0025] By collecting calibration board images from multiple angles and depths, the imaging conditions of the camera at different poses and distances are comprehensively covered, effectively avoiding parameter estimation biases caused by a single perspective or limited samples. This collection method can fully consider various imaging conditions that the camera may encounter in practical applications, ensuring that the calibration parameters have wide applicability. Even in scenarios with complex perspectives or large distance changes, accurate camera parameters can still be provided. The extraction of sub-pixel corner coordinates improves the accuracy of corner positioning. Compared with only using pixel-level coordinates, it can more accurately reflect the true position of the calibration board corners in the image. At the same time, by checking the consistency of the distances between adjacent corners, abnormal corners are removed, effectively eliminating the interference caused by image noise, uneven illumination, or local defects of the calibration board, ensuring the reliability and accuracy of the image coordinate set, and avoiding parameter calculation errors caused by incorrect corners. The projection mapping relationship between the camera coordinate system and the world coordinate system is established, and the distortion coefficient is introduced to quantify the lens distortion characteristics, enabling the calibration process to fully consider the actual physical process of camera imaging. This method can not only accurately describe the spatial pose of the calibration board from the camera's perspective but also finely depict the impact of lens distortion on imaging. Through the ideal projection formula combined with distortion correction, the three-dimensional coordinates in the camera coordinate system are accurately mapped to the actual image plane coordinates, truly restoring the entire process of camera imaging. Using the corner world coordinates and the corrected image coordinates to construct a linear equation system, the problem of solving camera parameters is transformed into a mathematical equation-solving problem, ensuring the logic and rigor of parameter calculation. The internal parameters, external parameters, and distortion coefficients of the camera are simultaneously optimized using a joint correction method, avoiding the mutual influence and cumulative errors between parameters in traditional step-by-step calibration methods. Through global optimization using the least squares method, the corner data of all collected images are involved in the parameter adjustment process, fully utilizing the information of multi-perspective images, improving the accuracy and stability of parameter calibration, and finally obtaining camera parameters that can accurately describe the camera's imaging.
[0026] In a preferred embodiment of the present invention, for step 2 above, based on the calibrated camera parameters, a composite coding pattern is projected onto the calibration board, relevant images are synchronously collected and the phase and coding data are decoded, and the correspondence between the projector pixels and the three-dimensional space points of the calibration board is established using the calibrated camera parameters to solve the internal and external parameter matrices of the projector to obtain the initial projector parameters, which may include: Step 220, based on the calibrated camera parameters, project a composite code composed of multiple groups of sine stripes and binary coding patterns onto the calibration board to form a spatio-temporal hybrid coding sequence; Step 221, when the projector projects each group of coding patterns, synchronously trigger the camera to collect the corresponding deformed stripe images and decode the collected image sequence; Step 222: Using the calibrated camera parameters, reverse-project the image coordinates of the calibration board corner points into the three-dimensional space coordinate system of the calibration board to obtain the accurate three-dimensional coordinates of the corner points. At the same time, according to the absolute phase value of each pixel in the encoded pattern projected by the projector, establish the mapping relationship between the projector image plane coordinates and the calibration board three-dimensional space coordinates; Step 223: Based on the mapping relationship between the projector image plane coordinates and the calibration board three-dimensional space coordinates, associate the coordinates of each pixel of the projector with the corresponding calibration board three-dimensional coordinates, and construct the projection equation of the projector to obtain the initial projector parameters.
[0027] In the embodiment of the present invention, the field of view range, imaging angle, and distortion characteristics of the camera are determined according to the calibrated camera parameters (including the internal parameter matrix, distortion coefficient, and external parameter matrix), providing a reference for the projection area of the projector. Then, multiple sets of sine stripe patterns are generated. Each set of sine stripes encodes spatial information by adjusting the frequency (such as setting 3 - 5 different frequencies) and phase (such as using the four-step phase-shifting method, that is, the phases differ by 90° in sequence); at the same time, a binary encoded pattern (such as a Gray code) is generated, and a unique encoded identifier is formed through different combinations of black and white stripes. The sine stripe pattern and the binary encoded pattern are alternately projected onto the calibration board in chronological order. First, multiple sets of sine stripes are projected in sequence, and the images at each stripe change are recorded; then the binary encoded pattern is projected to determine the global position information of each area. In this way, a spatio-temporal hybrid encoding sequence including spatial phase information and global encoding information is formed, ensuring that the pattern projected by the projector can meet the requirements of high-precision phase calculation and has the characteristics of a globally unique identifier. At the moment when the projector projects each set of sine stripes or binary encoded patterns, through a hardware synchronization trigger device (such as a synchronization signal line connecting the trigger interfaces of the projector and the camera), the camera immediately captures the deformed stripe image after the current pattern is projected onto the calibration board. Due to the influence of the three-dimensional shape of the calibration board surface and the camera viewing angle, the shape of the stripes projected by the projector will change, and these deformations contain the three-dimensional information of the calibration board. After the acquisition is completed, the image sequence is decoded. For the sine stripe image sequence, a phase-shifting algorithm (such as the four-step phase-shifting method) is used to calculate the phase value of each pixel point. By comparing the gray-scale changes of the same pixel in different phase stripe images, the relative phase of the pixel point is solved; for the binary encoded image, according to the combination rule of black and white stripes (such as the Gray code encoding rule), the binary encoded value corresponding to each area is directly decoded. Combining the relative phase and the binary encoded value, through a phase unwrapping algorithm (such as a phase unwrapping method based on path tracking), the absolute phase value of each pixel point is obtained, and this value corresponds to the accurate position information of the pattern projected by the projector on the calibration board.
[0028] According to the calibrated camera parameters in Step 1, the camera internal parameter matrix can describe the geometric transformation relationship of camera imaging, the external parameter matrix can describe the relative pose between the camera coordinate system and the world coordinate system (the coordinate system where the calibration board is located), and the distortion coefficient can correct the influence of lens distortion. For the pixel coordinates of each calibration board corner point in the image, first use the distortion coefficient for inverse distortion correction to restore the image coordinates in the ideal state; then combine the camera internal parameter matrix and the external parameter matrix, and through back-projection calculation (i.e., the inverse process of solving the three-dimensional space coordinates from the known image coordinates), convert the image coordinates of the corner points to the three-dimensional space coordinate system of the calibration board to obtain the accurate three-dimensional coordinates of the corner points ( , , ). At the same time, according to the absolute phase value of each pixel of the projector coding pattern decoded in Step 221, combined with the geometric relationship projected by the projector (such as the direction and angle of the projection light), the pixel coordinates on the projector image plane ( , ) are established corresponding to the three-dimensional space coordinates of the calibration board ( , , ). For example, by recording the projector pixel position corresponding to each absolute phase value and the actual spatial position corresponding to this phase value on the calibration board, a mapping table of "projector pixel - absolute phase - three-dimensional space point" is formed. According to the mapping relationship established in Step 222, traverse all pixel points on the projector image plane, and correspond the coordinates of each pixel point ( , ) to the corresponding three-dimensional space coordinates on the calibration board ( , , ). Assuming that the projector imaging satisfies the pinhole imaging (similar to the camera imaging principle), there is a projection equation to describe the conversion relationship between the projector pixel coordinates and the three-dimensional space coordinates. This equation contains the internal parameters of the projector (such as focal length, principal point coordinates) and external parameters (rotation matrix, translation vector). Substitute the mapping relationships of all pixel points into the projection equation to form a system of equations containing multiple equations. The unknowns in the system of equations are the internal and external parameters of the projector. By solving this system of equations (such as using the least squares method to adjust the parameters to minimize the error on both sides of the equation), calculate the internal parameter matrix of the projector (describing the geometric characteristics of the projector imaging) and the external parameter matrix (describing the relative pose between the projector coordinate system and the three-dimensional space coordinate system of the calibration board), so as to obtain the initial projector parameters.
[0029] Adopt a composite coding method that combines multiple groups of sine stripes and binary coding, giving full play to the advantages of both codings. The sine stripes achieve spatial information coding through phase changes and can accurately measure tiny three-dimensional shape changes; the binary coding provides a globally unique identifier to avoid ambiguity problems in phase resolution. The design of the spatio-temporal hybrid coding sequence enables the patterns projected by the projector to achieve high-resolution measurement in space and be decoded quickly and accurately in the time dimension, effectively improving the anti-interference ability and information expression ability of the coding patterns. Even in complex lighting environments or when the projector brightness is uneven, the reliability and accuracy of the coding patterns can still be ensured. By hardware-synchronously triggering the camera to collect deformed stripe images, the strict synchronization between image acquisition and projector projection is ensured, avoiding the problem of image information misalignment caused by time asynchrony and ensuring that the collected images can accurately reflect the real-time state of the patterns projected by the projector. Using the phase-shift algorithm and decoding technology to process the image sequence, the phase information and coding information can be accurately extracted from the deformed stripes. Combining with the phase unwrapping algorithm to obtain the absolute phase value, compared with the traditional single coding and decoding method, the accuracy and stability of phase calculation are improved. Using the calibrated camera parameters for back-projection calculation can accurately convert the image coordinates into three-dimensional space coordinates, making full use of the results of camera calibration and ensuring the accuracy of three-dimensional coordinate calculation. At the same time, establishing the mapping relationship between the projector image plane coordinates and the calibration board three-dimensional space coordinates closely links the two-dimensional projection information of the projector with the actual three-dimensional space, providing an intuitive and accurate corresponding basis for solving the projector parameters and solving the problem that it is difficult to accurately establish the relationship between the projector and the three-dimensional space in the traditional method.
[0030] In a preferred embodiment of the present invention, in step 3 above, according to the initial projector parameters, a three-dimensional stereo target including feature points synchronously acquires camera images and projection patterns in multiple poses, and establishes the corresponding relationship among "projector coding - camera corner points - world coordinates" through feature matching. Determining three detection points and calculating the geometric correction value based on the spatial polygon formed by the three detection points may include: Step 330, distribute checkerboard corner points and circular marker points on three orthogonal planes of the target. The three-dimensional coordinates of each feature point are pre-calibrated by a measuring device, and the target can freely move along the translation guide rail to change its spatial pose; Step 331, during the movement of the target, control the projector to project a composite coding pattern onto the surface of the target, and synchronously trigger the camera to collect the images and projection patterns of the target; Step 332: Based on the known world coordinates of the target feature points, match them with the sub-pixel corner coordinates extracted from the camera image. At the same time, by decoding the phase encoding value of the projection pattern, associate the encoded coordinates of the corresponding pixels in the projector image plane to form a three-dimensional correspondence dataset of "projector pixel - camera pixel - world coordinate", and determine three non-collinear feature points on the target as the detection point set to calculate the geometric correction value. Specifically, it includes: Based on multiple poses of the target movement, extract the sub-pixel corner coordinates of all feature points on the target surface from the camera image of each pose, and combine with the pre-calibrated three-dimensional world coordinates on the target to establish a local mapping relationship of "camera pixel - world coordinate"; Decode the composite encoded pattern projected by the projector for each pose to obtain the absolute phase encoding of the feature points on the target surface, and combine with the local mapping relationship to bind the projector encoded coordinates with the camera pixel coordinates and world coordinates to generate a three-dimensional global dataset of "projector pixel - camera pixel - world coordinate"; Determine three non-collinear feature points from the three-dimensional global dataset as the detection point set, calculate the comparison between the theoretical encoded coordinates and the actual decoded coordinates of the projector according to the world coordinates and the initial projector parameters to obtain the coordinate deviation vectors of each detection point in the horizontal and vertical directions; Based on the coordinate deviation vectors, calculate the actual projection position of the spatial triangle formed by the three detection points in the projector coordinate system, and perform geometric comparison with the theoretical spatial triangle in the world coordinate system to extract the side length ratio error and the plane rotation angle deviation; Convert the side length ratio error into a scaling correction coefficient of the projector image plane, decompose the plane rotation angle deviation into a rotation correction matrix between the projector coordinate system and the spatial coordinate system, and combine with the spatial distribution direction of the deviation vectors of the three detection points to generate the geometric correction value.
[0031] In the embodiment of the present invention, a three-dimensional stereoscopic target is designed, which includes three mutually perpendicular planes (such as , , planes), and checkerboard corner points and circular fiducial points are evenly distributed on each plane. The checkerboard corner points are used for corner detection and matching of the camera, and the circular fiducial points are used to extract high-precision feature points through center positioning. Use a high-precision measuring device (such as a coordinate measuring machine or a laser tracker) to accurately measure the three-dimensional coordinates of each feature point and establish a world coordinate database of the feature points (for example, each corner point coordinate is recorded as ( , , )。Mount the target on a translation guide rail that can move along three coordinate axes. The guide rail has a high-precision positioning function (such as a resolution of 0.01 mm). The computer controls the guide rail to drive the target to move to different poses in three-dimensional space, ensuring that the spatial position and attitude of the target (such as translation distance, rotation angle) can be accurately recorded at each pose. The computer program controls the projector to project a spatio-temporal hybrid coding sequence (such as multiple groups of sine fringes and binary coding patterns) in sequence. Each time a group of patterns is projected, a trigger signal is sent to the camera through a hardware synchronization module (such as a synchronization pulse generator) to ensure that the camera captures an image at the moment when the pattern is stably projected. For example, when the target moves to the first pose, the projector projects the first group of sine fringe patterns, and the camera synchronously takes a picture of the target image with deformed fringes; then the projector switches to the second group of fringe patterns, and the camera takes pictures again until all the sine fringe sequences are captured; finally, the binary coding pattern is projected and photographed. Repeat the above process to move the target to a preset number of poses (such as 5 - 10 different positions) in sequence. At each pose, a complete coding pattern projection and image acquisition are completed to form multiple groups of "pose-image-coding" data pairs.
[0032] For the camera image of each pose, use the same sub-pixel corner extraction method as in step 111 to obtain the sub-pixel coordinates of the checkerboard corners ( , ), and at the same time extract the sub-pixel coordinates of the circular fiducial points through a circular fiducial point center detection algorithm (such as least squares circle fitting). Match these coordinates with the known world coordinates of the target feature points. Since the spatial distribution of the target feature points is known (such as the number of rows and columns of the checkerboard, the arrangement order of the circular fiducial points), establish a one-to-one correspondence between the image coordinates and the world coordinates through a pattern recognition algorithm (such as template matching or geometric constraint-based matching). For example, the ([[]] , )th checkerboard corner in the image corresponds to in the world coordinates. For the projection pattern image of each pose, obtain the projector pixel coding coordinates ( , ) corresponding to each feature point through the decoding method in step 221. This coordinate is jointly determined by the absolute phase value and the binary coding value. For example, the absolute phase value corresponding to a certain circular fiducial point in the projection pattern is , and the binary coding value is . By querying the coding mapping table, its coordinates ([[]] , ) in the projector image plane can be determined. The projector pixel coordinates ( , ) of each feature point, the camera pixel coordinates ([[]] , ) and their world coordinates ([[]] , , ) Store them in the data set to form multiple groups of triple correspondence relationships. From the three-dimensional correspondence relationship data set, determine three non-collinear feature points (i.e., the three points are not on the same straight line). For example, select one point from each of the three orthogonal planes of the target, ensuring that the three points form a triangle in three-dimensional space. These three points are used as the detection point set for geometric relationship calculation.
[0033] The orthogonal plane design and high-precision pre-calibration of the three-dimensional solid target ensure that the world coordinates of the feature points have extremely high accuracy and spatial distribution diversity, providing a reliable benchmark for establishing three-dimensional correspondence relationships under multiple perspectives. The free movement ability of the translation guide rail enables the target to cover different relative poses of the projector and the camera, collecting rich spatial projection data and avoiding the one-sidedness of parameter estimation caused by a single fixed pose. Synchronously projecting the coded pattern and collecting the image ensure the time consistency of the projection information and the imaging data, avoiding the spatial misalignment error caused by time delay. The projection of multiple groups of coded patterns and the collection of multi-perspective images increase the data sample size, and reduce the influence of random noise on parameter calculation through the statistical averaging effect. Combining the camera image features and the projection coding features to establish a cross-modal three-dimensional correspondence relationship makes full use of the high-precision imaging ability of the camera and the global coding characteristics of the projector, ensuring the accuracy and uniqueness of the correspondence relationship. By selecting non-collinear detection points with a wide spatial distribution, the geometric distortion (such as scale scaling, rotation deviation, translation error) of the projector in three-dimensional space can be sensitively captured, enabling the geometric correction value to comprehensively reflect the actual deviation of the projector parameters. The large-scale data set of "projector-camera-world coordinate" correspondence relationships provides sufficient constraint conditions for geometric correction. Through statistical analysis and least squares optimization, the interference of outliers can be effectively suppressed, and the accuracy and stability of the geometric correction value can be improved.
[0034] In a preferred embodiment of the present invention, step 4 above, using the geometric correction value to correct the initial projector parameters to obtain the corrected projector parameters, may include: Step 440, resolve the geometric correction value into the rotation component adjustment amount and the translation component adjustment amount corresponding to the external parameters of the projector; Step 441, combine and superimpose the rotation component adjustment amount with the rotation component in the initial external parameters, and superimpose the translation component adjustment amount with the translation component in the initial external parameters to generate an adjusted external parameter matrix of the projector; Step 442, based on the adjusted external parameter matrix and the initial internal parameters, combined with the projection position deviation of the structured light pattern on the imaging plane of the projector under multiple target poses, establish a correction relationship between the internal and external parameters of the projector; Step 443: Correct the internal and external parameters of the projector according to the correction relationship to reduce the projection position deviation corresponding to different target poses to within a preset range, so as to obtain the corrected projector parameters.
[0035] In the embodiment of the present invention, the geometric correction value calculated in step 332 is analyzed. The geometric correction value is calculated based on a spatial polygon formed by three non-collinear detection points, and its essence reflects the pose deviation of the projector in three-dimensional space. Through the theory of spatial geometric transformation, the geometric correction value is decomposed into a rotation component and a translation component: Rotation component adjustment amount: Calculate the rotation angle difference between the actual triangle formed by the detection points and the ideal triangle (the triangle predicted based on the initial projector parameters). For example, by comparing the normal vector differences of the two triangles in , , axis directions, determine the rotation angle to be adjusted (such as rotating by axis by , rotating by axis by , rotating by axis by ).
[0036] Translation component adjustment amount: Calculate the displacement difference between the actual three-dimensional coordinates of the detection points and the coordinates predicted based on the initial projector parameters. For example, calculate the average displacement differences of the three detection points in , , directions ( , , ) as the translation adjustment amount.
[0037] Combine and superimpose the rotation component adjustment amount with the rotation component in the initial external parameters, and superimpose the translation component adjustment amount with the translation component in the initial external parameters to generate an adjusted projector external parameter matrix. Combine the rotation component adjustment amount obtained in step 440 ( , , ) with the rotation matrix in the initial projector external parameters. For example, through the multiplication operation of the rotation matrix, represent the adjustment amount as the product of three basic rotation matrices (rotation matrices around the axis, axis, axis) and multiply it by the initial rotation matrix to obtain a new rotation matrix. Directly add the translation adjustment amount ( , , ) to the translation vector of the initial external parameters. For example, if the initial translation vector is ( , , )), the adjusted translation vector is ( + , + , + ). Combine the adjusted rotation matrix and translation vector into a new extrinsic parameter matrix of the projector, which describes the more accurate pose of the projector in three-dimensional space. Based on the adjusted extrinsic parameter matrix and the initial intrinsic parameters, combined with the projection position deviation of the structured light pattern on the imaging plane of the projector under multiple sets of target poses, establish the correction relationship between the intrinsic and extrinsic parameters of the projector. For each target pose, use the adjusted extrinsic parameter matrix and the initial intrinsic parameters to calculate the theoretical projection position of the feature points on the target on the imaging plane of the projector through the projection of the projector. At the same time, through the "projector pixel - camera pixel - world coordinate" correspondence established in step 332, obtain the actual encoded coordinates of the feature points on the image plane of the projector. Compare the theoretical projection position with the actual encoded coordinates to obtain the projection position deviation of each feature point. Analyze the projection position deviations under multiple sets of target poses and find that these deviations are not only related to the extrinsic parameters but may also be affected by the intrinsic parameters (such as focal length, principal point offset). For example, if the deviations under all poses show a systematic scaling or translation trend, it may be necessary to adjust the focal length or principal point position in the intrinsic parameters. According to the correction relationship, correct the intrinsic and extrinsic parameters of the projector to reduce the projection position deviations corresponding to different target poses to a preset range to obtain the corrected projector parameters.
[0038] Decompose the geometric correction value into rotation and translation components, intuitively convert the spatial geometric deviation into the adjustment amount of the projector's extrinsic parameters, make the correction process have a clear physical meaning, and facilitate understanding and implementation. This decomposition method can accurately locate the source of the projector pose deviation. Update the projector extrinsic parameter matrix by superimposing the rotation and translation components through matrix operations to ensure the mathematical rigor of parameter adjustment. This method can effectively utilize the prior information provided by the initial parameters, avoid estimating parameters from scratch, and improve the efficiency and stability of parameter correction. Establish the correction relationship between the intrinsic and extrinsic parameters by combining the projection position deviations under multiple sets of poses, comprehensively consider the coupled influence of the intrinsic and extrinsic parameters in the projector imaging process. By analyzing the deviation pattern, it is possible to identify which deviations are caused by the extrinsic parameters and which are caused by the intrinsic parameters, realize the collaborative optimization of the intrinsic and extrinsic parameters, and improve the accuracy of parameter correction.
[0039] As Figure 2 shown, an embodiment of the present invention also provides a structured light calibration system in three coordinates, including: The parameter calibration module is used to collect calibration board images at multiple angles, extract sub-pixel corner data, construct a camera parameter description method including radial and tangential distortions, and based on the pinhole imaging principle, solve the internal parameter matrix and distortion coefficients of the camera by establishing a system of linear equations to obtain the preliminary calibration of the camera parameters; The projector calibration module is used to project a composite coded pattern onto the calibration board based on the preliminary calibration of the camera parameters, synchronously collect relevant images and decode the phase and coded data, and establish the correspondence between the projector pixels and the three-dimensional space points of the calibration board by using the calibrated camera parameters to solve the internal and external parameter matrices of the projector and obtain the initial projector parameters; The 3D matching module is used to, according to the initial projector parameters, synchronously obtain camera images and projection patterns of a three-dimensional stereo target including feature points in multiple different poses, establish the correspondence between "projector coding - camera corner - world coordinates" through feature matching, determine three detection points, and calculate the geometric correction value based on the spatial polygon formed by the three points; The projector correction module is used to correct the initial projector parameters by using the geometric correction value to obtain the corrected projector parameters.
[0040] It should be noted that this system corresponds to the above method. All implementation manners in the above method embodiments are applicable to this embodiment and can also achieve the same technical effects.
[0041] An embodiment of the present invention also provides a computing device, including: a processor and a memory storing a computer program. When the computer program is run by the processor, it executes the method as described above. All implementation manners in the above method embodiments are applicable to this embodiment and can also achieve the same technical effects.
[0042] An embodiment of the present invention also provides a computer-readable storage medium storing instructions. When the instructions are run on a computer, the computer is made to execute the method as described above. All implementation manners in the above method embodiments are applicable to this embodiment and can also achieve the same technical effects.
[0043] The above is the preferred implementation manner of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A structured light calibration method under three coordinates, characterized in that The method includes: Step 1: By collecting calibration board images at multiple angles, extracting sub-pixel corner data, constructing a description method of camera parameters including radial and tangential distortions, and based on the pinhole imaging principle, solving the internal parameter matrix and distortion coefficients of the camera by establishing a system of linear equations to obtain the calibrated camera parameters. Step 2: Based on the calibrated camera parameters, project a composite coded pattern onto the calibration board, synchronously collect relevant images and decode the phase and coded data, and establish the correspondence between the projector pixels and the three-dimensional spatial points on the calibration board using the calibrated camera parameters, and solve the internal and external parameter matrices of the projector to obtain the initial projector parameters. Step 3: According to the initial projector parameters, a three-dimensional stereo target including feature points synchronously acquires camera images and projection patterns in multiple poses, and establishes the correspondence between "projector coding - camera corner - world coordinate" through feature matching, determines three detection points, and calculates the geometric correction value based on the spatial polygon formed by the three detection points. Step 4: Use the geometric correction value to correct the initial projector parameters to obtain the corrected projector parameters.
2. The structured light calibration method under three coordinates according to claim 1, wherein By collecting calibration board images at multiple angles, extracting sub-pixel corner data, constructing a description method of camera parameters including radial and tangential distortions, and based on the pinhole imaging principle, solving the internal parameter matrix and distortion coefficients of the camera by establishing a system of linear equations to obtain the calibrated camera parameters, including: Rotate the checkerboard calibration board by different angles within the range of ±30 degrees around the horizontal axis and vertical axis in the plane, and translate it by 5 different spatial positions in the depth direction perpendicular to the calibration board plane, and collect clear images including complete checkerboard corner points by the camera at each position. Extract the sub-pixel coordinates of the checkerboard corner points from the clear images of the complete checkerboard corner points, and eliminate abnormal corner points of pixels through the consistency check of the adjacent corner point spacings to form an image coordinate set. Based on the image coordinate set and the world coordinates of the calibration board corner points, establish the projection mapping relationship between the camera coordinate system and the world coordinate system through the pinhole imaging principle, convert the world coordinates of the calibration board corner points into three-dimensional coordinates in the camera coordinate system by combining the rotation and translation matrices, and introduce the first radial, second radial, first tangential, and second tangential distortion coefficients to quantify the distortion characteristics of the camera lens. According to the projection mapping relationship, map the three-dimensional coordinates in the camera coordinate system to the undistorted image plane coordinates through the ideal projection formula, and correct the coordinates by superimposing the distortion coefficients to obtain the actual image plane coordinates, and construct a system of linear equations using the correspondence between the world coordinates of all corner points and the corrected image coordinates. Based on the constructed system of linear equations, jointly correct the internal parameters, external parameters, and distortion coefficients of the camera to obtain the calibrated camera parameters.
3. The structured light calibration method under three coordinates according to claim 2, wherein According to the projection mapping relationship, map the three-dimensional coordinates in the camera coordinate system to the undistorted image plane coordinates through the ideal projection formula, and correct the coordinates by superimposing the distortion coefficients to obtain the actual image plane coordinates, and construct a system of linear equations using the correspondence between the world coordinates of all corner points and the corrected image coordinates, including: Place the 3D target at multiple preset poses, including checkerboard corner points and preset circular coding marks, and project a composite coding pattern onto the target through a projector, while synchronously triggering the camera to collect target images with the projection pattern; Decode the target images, extract the sub-pixel corner point coordinates in the camera coordinate system and the corresponding projector coding values, and combine the calibrated camera parameters to back-project the sub-pixel corner point coordinates into 3D space to obtain the world coordinates of the target corner points; Based on the projector coding values and the decoded phase information, establish a preliminary mapping relationship between the projector pixel coordinates and the target world coordinates, and through the preliminary mapping relationships from multiple perspectives, determine three non-collinear feature points on different depth planes of the target as detection points; Use the world coordinates of the detection points and the corresponding projector coding coordinates to calculate the deviation amounts between the measured geometric relationships and the theoretical geometric relationships of the three detection points in the projector coordinate system, including the differences between the measured distances and angles between the detection points and the theoretical distances and angles; Decompose the deviation amounts into the focal length error of the projector internal parameters, the principal point offset error, and the rotation component error and translation component error of the external parameters, and establish a linear correspondence relationship between each deviation component and the geometric correction parameters through mathematical relationship analysis to construct a system of linear equations.
4. The structured light calibration method under three coordinates according to claim 3, wherein Based on the calibrated camera parameters, project a composite coding pattern onto the calibration board, synchronously collect relevant images and decode the phase and coding data, and use the calibrated camera parameters to establish the correspondence relationship between the projector pixels and the 3D space points of the calibration board, and solve the internal and external parameter matrices of the projector to obtain the initial projector parameters, including: Based on the calibrated camera parameters, project a composite coding composed of multiple groups of sine fringes and binary coding patterns onto the calibration board to form a spatio-temporal hybrid coding sequence; When the projector projects each group of coding patterns, synchronously trigger the camera to collect the corresponding deformed fringe images and decode the collected image sequence; Use the calibrated camera parameters to back-project the image coordinates of the calibration board corner points into the 3D space coordinate system of the calibration board to obtain the accurate 3D coordinates of the corner points, and at the same time, based on the absolute phase value of each pixel in the coding pattern projected by the projector, establish the mapping relationship between the projector image plane coordinates and the 3D space coordinates of the calibration board; Based on the mapping relationship between the projector image plane coordinates and the 3D space coordinates of the calibration board, associate the coordinates of each pixel of the projector with the corresponding 3D coordinates of the calibration board, construct the projection equation of the projector to obtain the initial projector parameters.
5. The structured light calibration method under three coordinates according to claim 4, wherein According to the initial projector parameters, enable the 3D target including feature points to synchronously obtain camera images and projection patterns at multiple poses, and establish the correspondence relationship among "projector coding - camera corner point - world coordinate" through feature matching, determine three detection points and calculate the geometric correction values based on the spatial polygon formed by the three detection points, including: Distribute checkerboard corner points and circular marker points on three orthogonal planes of the target, the 3D coordinates of each feature point are pre-calibrated by a measuring device, and the target can freely move along the translation guide rail to change the spatial pose; During the movement of the target, control the projector to project a composite coded pattern onto the surface of the target, and simultaneously trigger the camera to collect the image of the target and the projection pattern; Based on the known world coordinates of the target feature points, match them with the sub-pixel corner coordinates extracted from the camera image. At the same time, by decoding the phase coding value of the projection pattern, associate the coding coordinates of the corresponding pixels in the projector image plane to form a three-dimensional correspondence data set of "projector pixel - camera pixel - world coordinate", and determine three non-collinear feature points on the target as the detection point set to calculate the geometric correction value.
6. The structured light calibration method under three coordinates according to claim 5, characterized in that, Based on the known world coordinates of the target feature points, match them with the sub-pixel corner coordinates extracted from the camera image. At the same time, by decoding the phase coding value of the projection pattern, associate the coding coordinates of the corresponding pixels in the projector image plane to form a three-dimensional correspondence data set of "projector pixel - camera pixel - world coordinate", and determine three non-collinear feature points on the target as the detection point set to calculate the geometric correction value, including: Based on multiple poses of the target movement, extract the sub-pixel corner coordinates of all feature points on the target surface from the camera image of each pose, and combine with the pre-calibrated three-dimensional world coordinates on the target to establish a local mapping relationship of "camera pixel - world coordinate"; Decode the composite coded pattern projected by the projector for each pose, obtain the absolute phase coding of the feature points on the target surface, and combine with the local mapping relationship to bind the projector coding coordinates with the camera pixel coordinates and world coordinates to generate a three-dimensional global data set of "projector pixel - camera pixel - world coordinate"; Determine three non-collinear feature points from the three-dimensional global data set as the detection point set, calculate the comparison between the theoretical coding coordinates and the actual decoded coordinates of the projector according to the world coordinates and the initial projector parameters, so as to obtain the coordinate deviation vectors in the horizontal and vertical directions of each detection point; Based on the coordinate deviation vectors, calculate the actual projection position of the spatial triangle formed by the three detection points in the projector coordinate system, and perform geometric comparison with the theoretical spatial triangle in the world coordinate system to extract the side length ratio error and the plane rotation angle deviation; Convert the side length ratio error into a scaling correction coefficient of the projector image plane, decompose the plane rotation angle deviation into a rotation correction matrix between the projector coordinate system and the spatial coordinate system, and combine with the spatial distribution direction of the deviation vectors of the three detection points to generate the geometric correction value.
7. The structured light calibration method under three coordinates according to claim 6, characterized in that Use the geometric correction value to correct the initial projector parameters to obtain the corrected projector parameters, including: Analyze the geometric correction value into the rotation component adjustment amount and the translation component adjustment amount corresponding to the external parameters of the projector; Combine and superimpose the rotation component adjustment amount with the rotation component in the initial external parameters, and superimpose the translation component adjustment amount with the translation component in the initial external parameters to generate an adjusted external parameter matrix of the projector; Based on the adjusted external parameter matrix and the initial internal parameters, and combined with the projection position deviation of the structured light pattern on the projector imaging plane under multiple target poses, establish the correction relationship between the internal and external parameters of the projector; According to the correction relationship, the internal and external parameters of the projector are corrected to reduce the projection position deviation corresponding to different target poses to within a preset range, so as to obtain the corrected projector parameters.
8. A structured light calibration system under three coordinates, which implements the method described in any one of claims 1 to 7, characterized in that, It includes: A parameter calibration module, which is used to collect calibration board images at multiple angles, extract sub-pixel corner data, construct a camera parameter description method including radial and tangential distortions, and based on the pinhole imaging principle, solve the internal parameter matrix and distortion coefficients of the camera by establishing a system of linear equations to obtain the preliminary calibration of the camera parameters; A projector calibration module, which is used to project a composite coded pattern onto the calibration board based on the preliminary calibration of the camera parameters, synchronously collect relevant images and decode the phase and coded data, and establish the correspondence between the projector pixels and the three-dimensional space points of the calibration board by using the calibrated camera parameters to solve the internal and external parameter matrices of the projector and obtain the initial projector parameters; A three-dimensional matching module, which is used to, according to the initial projector parameters, synchronously obtain camera images and projection patterns of a three-dimensional stereo target including feature points in multiple different poses, establish the correspondence between "projector coding - camera corner - world coordinates" through feature matching, determine three detection points, and calculate the geometric correction value based on the spatial polygon formed by the three points; A projector correction module, which is used to correct the initial projector parameters by using the geometric correction value to obtain the corrected projector parameters.
9. A computing device, characterized in that, It includes: One or more processors; A storage device for storing one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A program is stored in the computer-readable storage medium, and when the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Automatic calibration method for structured light three-dimensional scanner system
CN101763643A
Calibration method based on monocular structured light system
CN114792345A
Structured light system calibration method based on color composite calibration board
CN115713561A
Sammer imaging telecentric projection three-dimensional measurement system and calibration method thereof
CN118189856A
Calibration method for 3D structured light system, and electronic device and storage medium
WO2022052313A1
Cited By
Method for judging six-surface completion state of handheld product based on cross view angle image fusion
CN120823200A
Iris lesion geometric parameter measurement system based on laser triangulation
CN121264951A
Image acquisition equipment pose calibration system and method, controller and storage medium
CN121304770A
Building structure deformation measurement method, system and device
CN121346686A