A method and system for locating structured light in three coordinates
By acquiring calibration plate images and composite coded patterns from multiple angles, combined with the parameter optimization methods of cameras and projectors, the problems of lens distortion and ambient light interference in traditional structural cursor calibration methods are solved, and high-precision three-dimensional shape detection is achieved.
Patent Information
- Application Number
- CN202510733495.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-06-04
AI Technical Summary
Traditional structural cursor calibration methods are difficult to fully consider the impact of lens distortion under three coordinates, and are susceptible to interference from ambient light, resulting in parameter decoding errors and affecting the accuracy of three-dimensional shape detection.
By acquiring calibration plate images from multiple angles, extracting sub-pixel corner point data, constructing camera parameters including radial and tangential distortions, and solving camera parameters based on linear equations; 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.
Effectively reduce imaging errors to subpixel level, improve measurement accuracy, enhance anti-ambient light interference capability, shorten calibration time, and improve the accuracy and efficiency of projector parameters.
Smart Images

Figure CN120259444B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of structured light imaging technology, and in particular to a structured light positioning method and system under three-coordinate conditions. Background Art
[0002] Traditional structured light calibration methods have several limitations. Most of them determine camera and projector parameters based on single-view or limited-view calibration plate images, making it difficult to fully account for the impact of lens distortion on imaging. For example, when performing 3D dimensional inspection of an automobile engine cylinder, using traditional calibration methods, the radial and tangential distortion of the camera lens exacerbates the distortion when capturing images of the cylinder's edge due to changes in viewing angle. The calibrated parameters are unable to accurately restore the cylinder's true 3D shape, resulting in deviations in the inspection results.
[0003] In addition, traditional methods rely more on simple coding patterns when establishing the correspondence between projectors and three-dimensional spatial points. They are easily interfered by ambient light and have limited decoding accuracy. The complex ambient light in the production workshop can cause the simple stripe patterns of traditional structured light projection to deform and attenuate the brightness, resulting in errors in the decoding phase and coding data, which in turn affects 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 optical calibration method and system under three-coordinate conditions, which realizes the coordinated calibration of camera and projector parameters by multi-angle acquisition of calibration plate images and composite coding projection.
[0005] In order to solve the above technical problems, the technical solutions of the present invention are as follows:
[0006] In a first aspect, a method for locating a structured light in three coordinates is provided, the method comprising:
[0007] Step 1: By collecting calibration plate images at multiple angles, extracting sub-pixel corner data, constructing a camera parameter description method including radial and tangential distortion, and based on the pinhole imaging principle, solving the camera's internal parameter matrix and distortion coefficients by establishing a linear equation system to obtain the calibrated camera parameters;
[0008] Step 2: Based on the calibrated camera parameters, a composite coding pattern is projected onto the calibration plate, and the relevant images are synchronously acquired and the phase and coding data are decoded. The calibrated camera parameters are used to establish the correspondence between the projector pixels and the three-dimensional space points of the calibration plate, and the intrinsic and extrinsic parameter matrix of the projector is solved to obtain the initial projector parameters.
[0009] Step 3: Based on the initial projector parameters, the three-dimensional target including the feature points is used to synchronously acquire the camera image and the projection pattern in multiple positions. The correspondence between "projector code-camera corner point-world coordinates" is established through feature matching. The three detection points are determined and the geometric correction value is calculated based on the spatial polygon formed by the three detection points.
[0010] Step 4: Correct the initial projector parameters using the geometric correction values to obtain corrected projector parameters.
[0011] Furthermore, by collecting calibration plate images at multiple angles and extracting sub-pixel corner data, we construct a camera parameter description method that includes radial and tangential distortion. Based on the pinhole imaging principle, we establish a linear equation system to solve the camera's internal parameter matrix and distortion coefficients to obtain the calibrated camera parameters, including:
[0012] The checkerboard calibration plate is rotated around the horizontal and vertical axes within the plane by different angles within the range of ±30 degrees, and translated to five different spatial positions in the depth direction perpendicular to the calibration plate plane. A clear image including the complete checkerboard corner points is captured by the camera at each position.
[0013] Extract the sub-pixel coordinates of the checkerboard corner points from a clear image of the complete checkerboard corner points, and remove abnormal corner points of pixels by checking the consistency of the distance between adjacent corner points to form an image coordinate set;
[0014] Based on the image coordinate set and the world coordinates of the corner points of the calibration plate, the projective mapping relationship between the camera coordinate system and the world coordinate system is established through the pinhole imaging principle. The world coordinates of the corner points of the calibration plate are converted into three-dimensional coordinates in the camera coordinate system by combining the rotation and translation matrix. The first radial, second radial, first tangential and second tangential distortion coefficients are introduced to quantify the distortion characteristics of the camera lens.
[0015] 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 coordinates are corrected by superimposing the distortion coefficient to obtain the actual image plane coordinates. The linear equation system is constructed using the correspondence between the world coordinates of all corner points and the corrected image coordinates.
[0016] Based on the constructed linear equations, the camera's internal parameters, external parameters and distortion coefficients are jointly corrected to obtain the calibrated camera parameters.
[0017] Furthermore, based on 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 coordinates are corrected by superimposing the distortion coefficient to obtain the actual image plane coordinates. The correspondence between the world coordinates of all corner points and the corrected image coordinates is used to construct a linear equation system, including:
[0018] Place a three-dimensional target in multiple preset positions, including checkerboard corner points and preset circular coded marks, and project a composite coded pattern onto the target through a projector, synchronously triggering the camera to capture the target image with the projected pattern;
[0019] Decode the target image, extract the sub-pixel corner coordinates in the camera coordinate system and the corresponding projector code value, and combine the calibrated camera parameters to back-project the sub-pixel corner coordinates into 3D space to obtain the world coordinates of the target corner points;
[0020] Based on the projector code value and the decoded phase information, a preliminary mapping relationship between the projector pixel coordinates and the target world coordinates is established. Through the preliminary mapping relationship under multiple perspectives, three non-collinear feature points at different depth planes of the target are determined as detection points.
[0021] Using the world coordinates of the detection points and the corresponding projector coded coordinates, the deviations between the measured geometric relationships and the theoretical geometric relationships of the three detection points in the projector coordinate system are calculated, including the differences between the measured distances and angles between the detection points and the theoretical distances and angles.
[0022] The deviation is decomposed into the focal length error and principal point offset error of the projector internal parameters and the rotation component error and translation component error of the external parameters. The linear correspondence between each deviation component and the geometric correction parameter is established through mathematical relationship analysis to construct a linear equation group.
[0023] Furthermore, based on the calibrated camera parameters, a composite coding pattern is projected onto the calibration plate, and relevant images are simultaneously acquired and the phase and coding data are decoded. The calibrated camera parameters are used to establish the correspondence between the projector pixels and the three-dimensional space points of the calibration plate, and the internal and external parameter matrix of the projector is solved to obtain the initial projector parameters, including:
[0024] Based on the calibrated camera parameters, a composite code consisting of multiple sets of sinusoidal fringes and binary coding patterns is projected onto the calibration plate to form a spatiotemporal hybrid coding sequence.
[0025] When the projector projects each set of coded patterns, the camera is synchronously triggered to capture the corresponding deformed fringe images and decode the captured image sequence;
[0026] Using the calibrated camera parameters, the image coordinates of the corner points of the calibration plate are reversely projected into the three-dimensional space coordinate system of the calibration plate to obtain the precise three-dimensional coordinates of the corner points. At the same time, based on the absolute phase value of each pixel in the coded pattern projected by the projector, a mapping relationship between the projector image plane coordinates and the three-dimensional space coordinates of the calibration plate is established;
[0027] Based on the mapping relationship between the projector image plane coordinates and the calibration plate three-dimensional space coordinates, the coordinates of each pixel of the projector are associated with the corresponding three-dimensional coordinates of the calibration plate, and the projection equation of the projector is constructed to obtain the initial projector parameters.
[0028] Furthermore, based on the initial projector parameters, the three-dimensional target including the feature points is used to synchronously acquire the camera image and the projection pattern in multiple positions. The correspondence between "projector code - camera corner point - world coordinates" is established through feature matching, and the three detection points are determined. The geometric correction value is calculated based on the spatial polygon formed by the three detection points, including:
[0029] The checkerboard corner points and circular markers are distributed on the three orthogonal planes of the target. The three-dimensional coordinates of each feature point are pre-calibrated by the measuring equipment, and the target can move freely along the translation guide rail to change its spatial position.
[0030] During the target movement, the projector is controlled to project a composite coded pattern onto the target surface, and the camera is synchronously triggered to capture the target image and the projected pattern;
[0031] Based on the known world coordinates of the target feature points, they are matched 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, the encoding coordinates of the corresponding pixels in the projector image plane are associated to form a three-dimensional correspondence data set of "projector pixel-camera pixel-world coordinate", and three non-collinear feature points on the target are determined as the detection point set to calculate the geometric correction value.
[0032] Furthermore, based on the known world coordinates of the target feature points, the sub-pixel corner coordinates extracted from the camera image are matched. At the same time, by decoding the phase encoding value of the projected pattern, the encoding coordinates of the corresponding pixels in the projector image plane are associated to form a three-dimensional correspondence relationship data set of "projector pixel-camera pixel-world coordinate". Three non-collinear feature points on the target are determined as the detection point set to calculate the geometric correction value, including:
[0033] Based on the target's multiple poses, the sub-pixel corner coordinates of all feature points on the target surface are extracted from the camera image of each pose. Combined with the pre-calibrated 3D world coordinates on the target, a local mapping relationship between "camera pixel-world coordinates" is established.
[0034] Decode the composite coding pattern projected by the projector at each pose to obtain the absolute phase coding of the target surface feature points. Combined with the local mapping relationship, the projector coding coordinates are bound to the camera pixel coordinates and world coordinates to generate a three-dimensional global data set of "projector pixel-camera pixel-world coordinate";
[0035] Determine three non-collinear feature points from the 3D global data set as the detection point set. Based on the world coordinates and initial projector parameters, calculate the projector's theoretical encoding coordinates and compare them with the actual decoding coordinates to obtain the horizontal and vertical coordinate deviation vectors of each detection point.
[0036] Based on the coordinate deviation vector, the actual projection position of the spatial triangle formed by the three detection points in the projector coordinate system is calculated, and a geometric comparison is performed with the theoretical spatial triangle in the world coordinate system to extract the side length ratio error and plane rotation angle deviation;
[0037] The side length proportional error is converted into the scaling correction coefficient of the projector image plane, and the plane rotation angle deviation is decomposed into the rotation correction matrix between the projector coordinate system and the space coordinate system. The geometric correction value is generated by combining the spatial distribution direction of the deviation vectors of the three detection points.
[0038] Furthermore, the initial projector parameters are corrected using the geometric correction values to obtain corrected projector parameters, including:
[0039] Resolving the geometric correction value into the rotational component adjustment amount and the translational component adjustment amount corresponding to the projector external parameters;
[0040] The rotation component adjustment amount is combined and superimposed with the rotation component in the initial extrinsic parameters, and the translation component adjustment amount is superimposed with the translation component in the initial extrinsic parameters to generate an adjusted projector extrinsic parameter matrix;
[0041] Based on the adjusted extrinsic parameter matrix and the initial intrinsic parameters, and combined with the projection position deviation of the structured light pattern on the projector imaging plane under multiple sets of target poses, the correction relationship between the projector's internal and external parameters is established;
[0042] The internal and external parameters of the projector are corrected according to the correction relationship so that the projection position deviation corresponding to different target postures is reduced to within the preset range to obtain the corrected projector parameters.
[0043] In a second aspect, a three-coordinate structured optical positioning system includes:
[0044] The parameter calibration module is used to collect calibration plate images at multiple angles, extract sub-pixel corner data, construct a camera parameter description method including radial and tangential distortion, and based on the pinhole imaging principle, establish a linear equation system to solve the camera's internal parameter matrix and distortion coefficients to obtain a preliminary calibration of the camera parameters;
[0045] The projector calibration module is used to perform preliminary calibration of camera parameters, project a composite coded pattern onto a calibration plate, synchronously capture relevant images and decode phase and coded data. Using the calibrated camera parameters, the module establishes a correspondence between projector pixels and points in the three-dimensional space of the calibration plate to solve the projector's intrinsic and extrinsic parameter matrix and obtain the initial projector parameters.
[0046] The 3D matching module is used to synchronously acquire camera images and projection patterns of a 3D target including feature points in multiple different positions based on the initial projector parameters. The module then establishes the correspondence between "projector code-camera corner point-world coordinates" through feature matching, determines the three detection points, and calculates the geometric correction value based on the spatial polygon formed by the three points.
[0047] The projector correction module is used to correct the initial projector parameters using the geometric correction values to obtain corrected projector parameters.
[0048] According to a third aspect, a computing device includes:
[0049] one or more processors;
[0050] The storage device is used to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method.
[0051] In a fourth aspect, a computer-readable storage medium stores a program, which implements the method when executed by a processor.
[0052] The above solution of the present invention includes at least the following beneficial effects:
[0053] By capturing calibration plate images from multiple angles and extracting sub-pixel corner points, camera parameters are constructed, including radial and tangential distortion. Combining linear equations to integrate camera intrinsic and extrinsic parameters and distortion coefficients, this approach reduces camera imaging errors from the pixel level to the sub-pixel level compared to traditional single-view calibration methods, effectively addressing 3D reconstruction errors caused by edge field distortion. By matching feature points of a 3D target in multiple poses, a global correspondence between projector code, camera corners, and world coordinates is established. Initial projector parameters are then corrected using spatial polygon geometry corrections, improving the accuracy of the projector matrix. A composite coding pattern combining multiple sinusoidal stripes with binary coding is employed, and spatiotemporal hybrid decoding technology enhances the interference resistance of phase and coding data. This avoids phase ambiguity and parameter calculation errors caused by ambient light interference with traditional simple fringe coding, even in the presence of fluctuating ambient light or projector brightness attenuation. Through standardized 3D target design and an automated multi-pose acquisition process, manual intervention during calibration is reduced, shortening overall calibration time. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 The figure is a flow chart of a method for locating a structured cursor in three coordinates provided by an embodiment of the present invention.
[0055] Figure 2 Schematic diagram of a three-coordinate structured cursor positioning system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying 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. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0057] like Figure 1 As shown, an embodiment of the present invention provides a method for locating a structured light in three coordinates, the method comprising the following steps:
[0058] Step 1: By collecting calibration plate images at multiple angles, extracting sub-pixel corner data, constructing a camera parameter description method including radial and tangential distortion, and based on the pinhole imaging principle, solving the camera's internal parameter matrix and distortion coefficients by establishing a linear equation system to obtain the calibrated camera parameters;
[0059] Step 2: Based on the calibrated camera parameters, a composite coding pattern is projected onto the calibration plate, and the relevant images are synchronously acquired and the phase and coding data are decoded. The calibrated camera parameters are used to establish the correspondence between the projector pixels and the three-dimensional space points of the calibration plate, and the intrinsic and extrinsic parameter matrix of the projector is solved to obtain the initial projector parameters.
[0060] Step 3: Based on the initial projector parameters, the three-dimensional target including the feature points is used to synchronously acquire the camera image and the projection pattern in multiple positions. The correspondence between "projector code-camera corner point-world coordinates" is established through feature matching. The three detection points are determined and the geometric correction value is calculated based on the spatial polygon formed by the three detection points.
[0061] Step 4: Correct the initial projector parameters using the geometric correction values to obtain corrected projector parameters.
[0062] In an embodiment of the present invention, by acquiring calibration plate images from multiple angles and extracting sub-pixel corner data, the camera's imaging field of view is fully covered, fully accounting for imaging conditions at different viewing angles. A camera parameter description method that includes radial and tangential distortion is constructed, and the parameters are solved using the pinhole imaging principle, effectively eliminating the impact of lens distortion on imaging. Compared with traditional methods, this method can more accurately determine the camera's internal parameter matrix and distortion coefficients, making the geometric information of objects in the image closer to reality and improving measurement accuracy. A composite coding pattern is projected based on the calibrated camera parameters. The use of the composite coding pattern enhances the ability to resist interference from ambient light and ensures accurate decoding of phase and coding data even under complex lighting conditions. Using the calibrated camera parameters to establish a correspondence between projector pixels and calibration plate three-dimensional spatial points effectively avoids correspondence errors caused by inaccurate camera parameters. The internal and external parameter matrices of the projector can be quickly and accurately solved, resulting in more reliable initial projector parameters and improving the efficiency and accuracy of projector parameter calibration.
[0063] Using a 3D target, images and projected patterns are simultaneously acquired at multiple positions. Feature matching is used to establish the correspondence between projector code, camera corners, and world coordinates. Compared to calibration using a single fixed position, this multi-perspective, multi-dimensional data acquisition and matching method provides a more comprehensive representation of the projector's projection characteristics in different spatial states. Three detection points are identified and geometric correction values are calculated based on spatial polygons. This provides an in-depth analysis of deviations in projector parameters at the geometric level, enabling more targeted optimization and effectively addressing potential errors in projector parameter spatial mapping. Using these geometric correction values to correct the initial projector parameters directly addresses any deviations discovered in the previous step. Compared to the uncorrected initial parameters, the corrected projector parameters improve the accuracy of the mapping between the projector and the real 3D space. Whether used for object dimensional measurement or 3D reconstruction, this approach ensures more realistic projection results and effectively reduces measurement errors caused by inaccurate projector parameters.
[0064] In a preferred embodiment of the present invention, step 1, by acquiring calibration plate images at multiple angles, extracting sub-pixel corner data, constructing a camera parameter description method including radial and tangential distortion, and solving the camera's internal parameter matrix and distortion coefficients by establishing a linear equation system based on the pinhole imaging principle to obtain the calibrated camera parameters, may include:
[0065] Step 110: Rotate the checkerboard calibration plate around its horizontal and vertical axes within a ±30-degree range, and translate it to five different spatial positions in the depth direction perpendicular to the plane of the calibration plate. Capture a clear image of the complete checkerboard corners at each position using a camera.
[0066] Step 111: extracting sub-pixel coordinates of the checkerboard corner points from a clear image of the complete checkerboard corner points, and removing abnormal corner points of pixels by performing consistency check of the distances between adjacent corner points to form an image coordinate set;
[0067] Step 112: Based on the image coordinate set and the world coordinates of the corner points of the calibration plate, a projective mapping relationship between the camera coordinate system and the world coordinate system is established using the pinhole imaging principle. The world coordinates of the corner points of the calibration plate are converted into three-dimensional coordinates in the camera coordinate system using a rotation and translation matrix. The first radial, second radial, first tangential, and second tangential distortion coefficients are introduced to quantify the distortion characteristics of the camera lens.
[0068] Step 113, according to the projection mapping relationship, maps the three-dimensional coordinates in the camera coordinate system to the undistorted image plane coordinates through the ideal projection formula, and superimposes the distortion coefficient to correct the coordinates to obtain the actual image plane coordinates, and uses the correspondence between the world coordinates of all corner points and the corrected image coordinates to construct a linear equation system, specifically including: placing a three-dimensional target in multiple preset positions, 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 capture the target image with the projected pattern; decoding the target image, extracting the sub-pixel corner point coordinates in the camera coordinate system and the corresponding projector code value, and combining the calibrated camera parameters to back-project the sub-pixel corner point coordinates into three-dimensional space to obtain the target corner points. World coordinates; based on the projector coding value and the decoded phase information, a preliminary mapping relationship between the projector pixel coordinates and the target world coordinates is established, and through the preliminary mapping relationship under multiple perspectives, three non-collinear feature points at different depth planes of the target are determined as detection points; using the world coordinates of the detection points and the corresponding projector coding coordinates, the deviations between the measured geometric relationship and the theoretical geometric relationship of the three detection points in the projector coordinate system are calculated, including the difference between the measured distance and measured angle between the detection points and the theoretical distance and theoretical angle; the deviation is decomposed 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 a linear correspondence between each deviation component and the geometric correction parameter is established through mathematical relationship analysis to construct a linear equation system;
[0069] Step 114 : Based on the constructed linear equations, the camera's internal parameters, external parameters, and distortion coefficients are jointly corrected to obtain calibrated camera parameters.
[0070] In this embodiment of the present invention, a checkerboard calibration plate is placed in the center of the camera's field of view, initially held horizontally, and the first image is captured as a reference. Subsequently, the plate is rotated incrementally along its transverse axis (e.g., from left to right) at regular angular intervals (e.g., 5 degrees), capturing an image after each rotation until it reaches +30 degrees. The plate is then rotated in the opposite direction to -30 degrees, again capturing images at intervals. After completing the transverse rotation, the plate is repeated along its longitudinal axis (e.g., from top to bottom) to ensure coverage of all oblique viewing angles. Finally, the plate is moved perpendicular to the plane of the plate toward or away from the camera by five different distances, maintaining a horizontal position and capturing an image after each movement. This multi-directional, multi-angle, and multi-depth acquisition method allows for the acquisition of an image dataset covering various imaging conditions within the camera's field of view. After obtaining a clear image that includes all checkerboard corners, a classic corner detection algorithm (e.g., the Harris corner detection algorithm) is first applied to evaluate each pixel in the image. The algorithm calculates the horizontal and vertical grayscale gradients of pixels to construct an autocorrelation matrix, which then determines the corner response value for each pixel. An appropriate response threshold is set, and pixels with response values greater than the threshold are initially identified as checkerboard corners, thereby locating the approximate pixel locations of the checkerboard corners in the image. A small local area (such as a 3×3 or 5×5 pixel neighborhood) is defined, centered around the pixel-level corner location. Within this local area, sub-pixel coordinates are calculated using grayscale interpolation. For example, within a 3×3 neighborhood, the grayscale value of each pixel is used as a weight to perform a weighted average of the coordinates within the neighborhood. Fine-tuning is then performed using an interpolation formula to improve the corner coordinate accuracy to sub-pixel levels. After sub-pixel coordinate extraction, the pixel distances between adjacent corners are calculated for each row and column of the checkerboard. Because the checkerboard manufacturing process dictates that the spacing between corner points is fixed and uniform in practice (for example, the side length of each checkerboard square corresponds to a fixed pixel distance), a theoretical standard pixel distance between adjacent corner points can be pre-calculated based on the actual checkerboard size and image resolution. A reasonable error threshold is set (for example, the difference in adjacent spacing should not exceed 0.5 pixels), and the calculated spacing between adjacent corner points is compared with the standard distance. If the difference between the spacing between adjacent corner points and the standard distance exceeds the set threshold, the corner point is considered an outlier and is removed. After this outlier removal operation, the sub-pixel coordinates of all remaining corner points are aggregated to form an image coordinate set. Each corner point coordinate in this set has high precision and effectively eliminates erroneous corner points caused by image noise, local illumination changes, partial occlusion of the checkerboard, or minor deformation of the calibration plate itself.
[0071] The three-dimensional coordinates of each corner point of the checkerboard calibration plate in the world coordinate system are known (usually the plane where the calibration plate is located is set as the world coordinate system). flat, The axis is perpendicular to the plane, and the corner points The coordinates are 0). According to the pinhole imaging principle, the camera imaging process can be viewed as projecting a point in the world coordinate system onto the image plane through a virtual pinhole. By introducing an extrinsic parameter matrix consisting of a rotation matrix and a translation vector, the coordinates of the corner points in the world coordinate system are transformed into the camera coordinate system, describing the spatial pose of the calibration plate within the camera's field of view. Furthermore, to account for the distortion of actual camera lenses, four distortion coefficients (first radial, second radial, first tangential, and second tangential) are introduced, corresponding to different types of distortion effects. For example, radial distortion primarily affects the ratio between the center and edge of the image, while tangential distortion causes the image to appear tilted. These coefficients enable a quantitative description of the lens distortion characteristics, providing a basis for subsequent distortion correction. Based on the projection mapping relationship, the 3D coordinates in the camera coordinate system are mapped to the undistorted image plane coordinates using the ideal projection formula. The coordinates are then corrected by superimposing the distortion coefficients to obtain the actual image plane coordinates. A system of linear equations is constructed using the correspondence between the world coordinates of all corner points and the corrected image coordinates. First, based on the ideal projection formula for pinhole imaging, the three-dimensional corner coordinates in the camera coordinate system are projected onto an ideal, undistorted image plane to obtain preliminary image coordinates. However, due to actual lens distortion, the ideal coordinates must be corrected using the distortion coefficients introduced in step 112. Specifically, the radial position of the coordinates is adjusted based on the radial distortion coefficients (e.g., to adjust the stretching or compression effect caused by radial distortion at points away from the image center), and the tangential position of the coordinates is adjusted based on the tangential distortion coefficients (e.g., to correct image tilt caused by lens assembly errors). After distortion correction, the exact coordinates of each corner point on the actual image plane are obtained. Finally, the world coordinates of all corner points are mapped to the corrected image coordinates. Based on the projection transformation and distortion, these mappings are converted into linear equations. The equations for multiple corner points are combined to form a system of linear equations, which contains unknowns such as camera intrinsic parameters, extrinsic parameters, and distortion coefficients. The system of linear equations constructed in step 113 is solved using a linear equation solving method (e.g., the least squares method). The core idea of the least squares method is to minimize the sum of squared errors between the actual image coordinates and the theoretically calculated coordinates by adjusting the unknowns in the equations (i.e., the camera's intrinsic parameter matrix elements, rotation and translation matrix elements, and distortion coefficients). During the solution process, the corner point data from all captured images is simultaneously incorporated into the calculation, and the error is gradually reduced by continuously adjusting the parameter values. Ultimately, when the error reaches the set convergence condition (e.g., the sum of squared errors no longer decreases), the resulting parameter values are the jointly corrected camera intrinsic parameter matrix, extrinsic parameter matrix, and distortion coefficients. These parameters accurately describe the current camera's imaging characteristics, completing the camera parameter calibration.
[0072] By acquiring calibration plate images from multiple angles and depths, the system comprehensively covers camera imaging conditions at different poses and distances, effectively avoiding parameter estimation bias caused by a single viewpoint or limited sample size. This acquisition method fully accounts for the diverse imaging conditions encountered by cameras in real-world applications, ensuring the broad applicability of calibration parameters and providing accurate camera parameters even in scenes with complex viewpoints or large distance variations. Sub-pixel corner coordinate extraction improves corner location accuracy. Compared to using pixel-level coordinates alone, it more accurately reflects the true position of the calibration plate corners in the image. Furthermore, a consistency check of the distance between adjacent corners is used to eliminate outliers, effectively eliminating interference caused by image noise, uneven lighting, or local defects in the calibration plate. This ensures the reliability and accuracy of the image coordinate set and avoids parameter calculation errors caused by erroneous corner points. A projective mapping relationship is established between the camera coordinate system and the world coordinate system, and distortion coefficients are introduced to quantify lens distortion characteristics, allowing the calibration process to fully account for the actual physical process of camera imaging. This method not only accurately describes the spatial pose of the calibration plate under the camera's viewpoint but also finely characterizes the effects of lens distortion on imaging. By combining the ideal projection formula 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 camera imaging process. A system of linear equations is constructed using the world coordinates of the corner points and the corrected image coordinates, transforming the camera parameter solution problem into a mathematical equation solution problem, ensuring the logic and rigor of the parameter calculation. A joint correction approach is used to simultaneously optimize the camera's internal and external parameters and distortion coefficients, avoiding the mutual influence and cumulative error between parameters in traditional step-by-step calibration methods. Global optimization is performed using the least squares method, allowing the corner point data of all captured images to participate in the parameter adjustment process, fully utilizing the information of multi-view images, improving the accuracy and stability of parameter calibration, and ultimately obtaining camera parameters that accurately describe the camera's imaging.
[0073] In a preferred embodiment of the present invention, step 2, based on the calibrated camera parameters, projects a composite coding pattern onto a calibration plate, synchronously acquires relevant images and decodes phase and coding data, and uses the calibrated camera parameters to establish a correspondence between projector pixels and three-dimensional spatial points of the calibration plate, and solves the internal and external parameter matrix of the projector to obtain initial projector parameters, which may include:
[0074] Step 220 , based on the calibrated camera parameters, projecting a composite code composed of multiple sets of sinusoidal fringes and binary code patterns onto the calibration plate to form a spatiotemporal hybrid code sequence;
[0075] Step 221 , when the projector projects each set of coded patterns, synchronously triggering the camera to capture the corresponding deformed fringe image and decoding the captured image sequence;
[0076] Step 222: Using the calibrated camera parameters, the image coordinates of the corner points of the calibration plate are reversely projected into the three-dimensional space coordinate system of the calibration plate to obtain the precise three-dimensional coordinates of the corner points. At the same time, based on the absolute phase value of each pixel in the coded pattern projected by the projector, a mapping relationship between the projector image plane coordinates and the three-dimensional space coordinates of the calibration plate is established.
[0077] Step 223 , based on the mapping relationship between the projector image plane coordinates and the calibration plate three-dimensional space coordinates, the coordinates of each pixel of the projector are associated with the corresponding calibration plate three-dimensional coordinates, and the projection equation of the projector is constructed to obtain the initial projector parameters.
[0078] In this embodiment of the present invention, the camera's field of view, imaging angle, and distortion characteristics are determined based on calibrated camera parameters (including an intrinsic parameter matrix, distortion coefficients, and an extrinsic parameter matrix), providing a reference for the projector's projection area. Next, multiple sets of sinusoidal fringe patterns are generated. Each set of sinusoidal fringe patterns encodes spatial information by adjusting frequency (e.g., setting 3-5 different frequencies) and phase (e.g., using a four-step phase shift method, with phases shifted by 90°). Simultaneously, a binary encoding pattern (e.g., Gray code) is generated, using different combinations of black and white stripes to form a unique coded identifier. The sinusoidal fringe pattern and the binary encoding pattern are alternately projected onto a calibration plate in a time-sequential manner. Multiple sets of sinusoidal fringe patterns are first projected sequentially, and the image at each fringe change is recorded. The binary encoding pattern is then projected to determine the global position information of each area. This method creates a spatiotemporal hybrid encoding sequence that includes both spatial phase information and global encoding information, ensuring that the projected pattern meets the requirements for high-precision phase calculation while also providing globally unique identification. At the moment the projector projects each set of sinusoidal fringe patterns or binary-coded patterns, a hardware synchronization trigger (e.g., a synchronization signal cable connecting the projector to the camera's trigger interface) causes the camera to immediately capture an image of the deformed fringe patterns after the current pattern is projected onto the calibration plate. Due to the 3D shape of the calibration plate surface and the camera's viewing angle, the projected fringe patterns will change shape. These deformations contain the 3D information of the calibration plate. After acquisition, the image sequence is decoded. For sinusoidal fringe image sequences, a phase shifting algorithm (e.g., the four-step phase shifting method) is used to calculate the phase value of each pixel. By comparing the grayscale changes of the same pixel in fringe images with different phases, the relative phase of that pixel is determined. For binary-coded images, the binary code value corresponding to each region is directly decoded based on the combination rules of black and white fringe patterns (e.g., Gray code). The relative phase and binary code values are combined and, using a phase unwrapping algorithm (e.g., path-tracing-based phase unwrapping), the absolute phase value of each pixel is obtained. This value corresponds to the precise position of the projected pattern on the calibration plate.
[0079] According to the camera parameters calibrated in step 1, the camera intrinsic parameter matrix is known to describe the geometric transformation relationship of the camera imaging, the extrinsic parameter matrix can describe the relative position between the camera coordinate system and the world coordinate system (the coordinate system where the calibration plate is located), and the distortion coefficient can correct the influence of lens distortion. For the pixel coordinates of each corner point of the calibration plate in the image, the distortion coefficient is first used to perform inverse distortion correction to restore the image coordinates under the ideal state; then, combined with the camera intrinsic parameter matrix and the extrinsic parameter matrix, the image coordinates of the corner point are converted to the three-dimensional space coordinate system of the calibration plate through reverse projection calculation (that is, the inverse process of solving the three-dimensional space coordinates when the image coordinates are known), and the precise three-dimensional coordinates of the corner point are obtained ( , , 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 of the projector projection (such as the direction and angle of the projection light), the pixel coordinates on the projector image plane ( , ) and the three-dimensional space coordinates of the calibration plate ( , , ) establish a corresponding relationship. For example, by recording the projector pixel position corresponding to each absolute phase value and the actual spatial position corresponding to the phase value on the calibration plate, a mapping table of "projector pixel-absolute phase-three-dimensional space point" is formed. According to the mapping relationship established in step 222, all pixel points on the projector image plane are traversed, and the coordinates of each pixel point ( , ) and the corresponding three-dimensional space coordinates on the calibration plate ( , , ). Assuming that the projector imaging satisfies the pinhole imaging principle (similar to the camera imaging principle), there exists a projection equation that describes 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). Substituting the mapping relationship of all pixel points into the projection equation forms 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), the internal parameter matrix of the projector (describing the geometric characteristics of the projector imaging) and the external parameter matrix (describing the relative position of the projector coordinate system and the three-dimensional space coordinate system of the calibration plate) are calculated, thereby obtaining the initial projector parameters.
[0080] A hybrid encoding scheme combining multiple sets of sinusoidal fringes with binary coding leverages the advantages of both encoding methods. Sinusoidal fringes encode spatial information through phase variations, enabling precise measurement of minute three-dimensional shape changes; binary coding provides a globally unique identifier, avoiding ambiguity in phase resolution. The design of a hybrid spatiotemporal encoding sequence enables both high-resolution spatial measurement of the projected pattern and rapid and accurate temporal decoding, effectively enhancing the encoding pattern's anti-interference capabilities and information expression capabilities. This ensures the reliability and accuracy of the encoded pattern even in complex lighting environments or with uneven projector brightness. Hardware-synchronized triggering of the camera to capture the deformed fringes ensures strict synchronization between image acquisition and projector projection, avoiding image information misalignment caused by time asynchrony and ensuring that the captured image accurately reflects the real-time state of the projected pattern. A phase-shifting algorithm and decoding techniques are used to process the image sequence, accurately extracting both phase and encoding information from the deformed fringes. Combined with a phase unwrapping algorithm, the absolute phase value is derived, improving the accuracy and stability of phase calculation compared to traditional single encoding and decoding methods. Using calibrated camera parameters for back-projection calculations accurately converts image coordinates into 3D space coordinates, fully leveraging the results of camera calibration and ensuring the accuracy of 3D coordinate calculations. Simultaneously, a mapping relationship is established between the projector image plane coordinates and the calibration plate's 3D space coordinates, closely linking the projector's 2D projection information with the actual 3D space. This provides an intuitive and accurate basis for solving projector parameters, resolving the difficulty of accurately establishing the relationship between the projector and 3D space in traditional methods.
[0081] In a preferred embodiment of the present invention, the above step 3, based on the initial projector parameters, enables the three-dimensional target including the feature points to synchronously acquire the camera image and the projection pattern at multiple positions, establishes the correspondence between "projector code-camera corner point-world coordinates" through feature matching, determines three detection points, and calculates the geometric correction value based on the spatial polygon formed by the three detection points, which may include:
[0082] Step 330: Distribute checkerboard corner points and circular markers 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 position.
[0083] Step 331 , while the target is moving, controlling the projector to project the composite coded pattern onto the target surface, and synchronously triggering the camera to capture the image of the target and the projected pattern;
[0084] Step 332, based on the known world coordinates of the target feature points, matches the sub-pixel corner coordinates extracted from the camera image, and at the same time, by decoding the phase encoding value of the projection pattern, associates the encoding 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 determines three non-collinear feature points on the target as the detection point set to calculate the geometric correction value, specifically including: based on multiple poses of target movement, extracting the sub-pixel corner coordinates of all feature points on the target surface from the camera image of each pose, and combining the pre-calibrated three-dimensional world coordinates on the target to establish a local mapping relationship of "camera pixel-world coordinate"; decoding the composite encoding pattern projected by the projector at each pose, obtaining the absolute phase encoding of the target surface feature points, and combining the projector encoding coordinates with the camera pixel in combination with the local mapping relationship. The coordinates and world coordinates are bound to generate a three-dimensional global data set of "projector pixels-camera pixels-world coordinates"; three non-collinear feature points are determined from the three-dimensional global data set as the detection point set, and the theoretical encoding coordinates of the projector are calculated and compared with the actual decoding coordinates according to the world coordinates and the initial projector parameters to obtain the horizontal and vertical coordinate deviation vectors of each detection point; based on the coordinate deviation vector, the actual projection position of the spatial triangle formed by the three detection points in the projector coordinate system is calculated, and a geometric comparison is performed with the theoretical spatial triangle in the world coordinate system to extract the side length ratio error and the plane rotation angle deviation; the side length ratio error is converted into the scaling correction coefficient of the projector image plane, and the plane rotation angle deviation is decomposed into the rotation correction matrix between the projector coordinate system and the space coordinate system, and the geometric correction value is generated by combining the spatial distribution direction of the deviation vectors of the three detection points.
[0085] In an embodiment of the present invention, a three-dimensional target is designed, which includes three mutually perpendicular planes (such as 、 、 Plane), each plane is evenly distributed with checkerboard corner points and circular markers. The checkerboard corner points are used for camera corner detection and matching, while the circular markers are used to achieve high-precision feature point extraction by locating the center of the circle. Use high-precision measuring equipment (such as a three-dimensional 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 feature points (for example, each corner point coordinate is marked as ( , , ). The target is mounted on a translation rail that can move along three coordinate axes. The rail has a high-precision positioning function (such as a resolution of 0.01mm). The rail is controlled by a computer to drive the target to move to different positions in three-dimensional space, ensuring that the spatial position and posture of the target (such as translation distance, rotation angle) in each position can be accurately recorded. The projector is controlled by a computer program to sequentially project a spatiotemporal mixed coding sequence (such as multiple sets of sinusoidal stripes and binary coding patterns). Each time a set 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 the image at the moment the pattern is stably projected. For example, when the target moves to the first position, the projector projects the first set of sinusoidal stripe patterns, and the camera synchronously captures the target image with deformed stripes; then the projector switches to the second set of stripe patterns, and the camera captures again until all sinusoidal stripe sequences are captured; finally, the binary coding pattern is projected and captured. Repeat the above process to move the target to multiple preset positions (such as 5-10 different positions) in sequence. Complete coding pattern projection and image acquisition are completed in each position to form multiple sets of "position-image-coding" data pairs.
[0086] For each camera image at each pose, the same sub-pixel corner point extraction method as step 111 is used to obtain the sub-pixel coordinates of the checkerboard corner points ( , ), and at the same time, the sub-pixel coordinates of the circular marker points are extracted through the circle center detection algorithm (such as least squares circle fitting). These coordinates are matched 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 chessboard, the arrangement order of the circular marker points), a one-to-one correspondence between the image coordinates and the world coordinates is established through a pattern recognition algorithm (such as template matching or matching based on geometric constraints). For example, the first ( , ) chessboard corner points correspond to the world coordinates For each projection pattern image of each posture, the projector pixel coding coordinates corresponding to each feature point are obtained by the decoding method of step 221 ( , ), the coordinate is determined by the absolute phase value and the binary code value. For example, the absolute phase value corresponding to a circular mark point in the projection pattern is , the binary encoding value is , its coordinates in the projector image plane can be determined by querying the coding mapping table ( , ). The projector pixel coordinates of each feature point ( , ), camera pixel coordinates( , ) and its world coordinates ( , , ) into a dataset, forming multiple sets of triplet correspondences. From the 3D correspondence dataset, three non-collinear feature points (i.e., three points that are not on the same straight line) are determined. For example, one point is selected from each of the three orthogonal planes of the target, ensuring that the three points form a triangle in 3D space. These three points serve as the detection point set for geometric relationship calculation.
[0087] The orthogonal planar design and high-precision pre-calibration of the 3D target ensure extremely high accuracy and spatial diversity of the world coordinates of feature points, providing a reliable benchmark for establishing 3D correspondences from multiple perspectives. The freely movable translation guide enables the target to cover different relative poses between the projector and camera, acquiring rich spatial projection data and avoiding the biased parameter estimation caused by a single fixed pose. Synchronizing the projection of the coding pattern and the image acquisition ensures temporal consistency between the projection information and the imaging data, preventing spatial misalignment errors caused by time delay. Projecting multiple sets of coding patterns and acquiring images from multiple perspectives increases the data sample size and reduces the impact of random noise on parameter calculation through statistical averaging. Combining camera image features with projected coding features establishes cross-modal 3D correspondences, leveraging the camera's high-precision imaging capabilities and the projector's global encoding properties to ensure accurate and unique correspondences. By selecting widely distributed non-collinear detection points, the target can sensitively capture geometric distortions (such as scaling, rotational deviation, and translational error) of the projector in 3D space, ensuring that the geometric correction value fully reflects the actual deviations in the projector parameters. The large-scale "projector-camera-world coordinate" correspondence dataset provides sufficient constraints for geometric correction. Through statistical analysis and least squares optimization, it can effectively suppress outlier interference and improve the accuracy and stability of geometric correction values.
[0088] In a preferred embodiment of the present invention, the above step 4, correcting the initial projector parameters using the geometric correction values to obtain corrected projector parameters, may include:
[0089] Step 440 , parsing the geometric correction value into a rotational component adjustment amount and a translational component adjustment amount corresponding to the projector extrinsic parameters;
[0090] Step 441 , combining and superimposing the rotation component adjustment amount with the rotation component in the initial extrinsic parameters, and superimposing the translation component adjustment amount with the translation component in the initial extrinsic parameters, to generate an adjusted projector extrinsic parameter matrix;
[0091] Step 442 , establishing a correction relationship between the projector's internal and external parameters based on the adjusted external parameter matrix and the initial internal parameters, combined with the projection position deviations of the structured light patterns on the projector imaging plane under multiple sets of target poses;
[0092] Step 443 , performing parameter correction on the internal and external parameters of the projector according to the correction relationship, so that the projection position deviation corresponding to different target postures is reduced to within a preset range, so as to obtain the corrected projector parameters.
[0093] In this embodiment of the present invention, the geometric correction value calculated in step 332 is analyzed. The geometric correction value is calculated based on the spatial polygon formed by the three non-collinear detection points. Its essence reflects the position deviation of the projector in three-dimensional space. Based on the theory of spatial geometric transformation, the geometric correction value is decomposed into rotational and translational components:
[0094] Rotation adjustment: Calculates 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 two triangles at 、 、 The normal vector difference in the axis direction determines the rotation angle that needs to be adjusted (such as around Axis rotation , around Axis rotation , around Axis rotation ).
[0095] Translation adjustment: Calculate the displacement difference between the actual 3D coordinates of the detection point and the coordinates predicted based on the initial projector parameters. For example, calculate the displacement difference between the three detection points in 、 、 The average displacement difference in the direction ( 、 、 ), as the translation adjustment amount.
[0096] The rotation component adjustment amount is combined and superimposed with the rotation component in the initial extrinsic parameters, and the translation component adjustment amount is superimposed with the translation component in the initial extrinsic parameters to generate the adjusted projector extrinsic parameter matrix. The rotation component adjustment amount obtained in step 440 ( 、 、 ) is combined with the rotation matrix in the initial projector extrinsic parameters. For example, by multiplying the rotation matrix, the adjustment amount is expressed as three basic rotation matrices (around axis, axis, The product of the rotation matrix of the axis) and multiply it with the initial rotation matrix to get the new rotation matrix. 、 、 ) is directly added to the translation vector of the initial extrinsic parameters. For example, if the initial translation vector is ( , , ), then the adjusted translation vector is ( + , + , + The adjusted rotation matrix and translation vector are combined to form a new projector extrinsic parameter matrix, which more accurately describes the projector's pose in three-dimensional space. Based on the adjusted extrinsic parameter matrix and the initial intrinsic parameters, combined with the projection position deviations of the structured light pattern on the projector imaging plane for multiple target poses, a correction relationship between the projector's intrinsic and extrinsic parameters is established. For each target pose, the adjusted extrinsic parameter matrix and the initial intrinsic parameters are used to calculate the theoretical projection positions of the target's feature points on the projector imaging plane through projector projection. Simultaneously, the actual encoded coordinates of the feature points on the projector image plane are obtained using the "projector pixel-camera pixel-world coordinate" correspondence established in step 332. The theoretical projection positions are compared with the actual encoded coordinates to obtain the projection position deviation of each feature point. Analysis of the projection position deviations for multiple target poses reveals that these deviations are not only related to the extrinsic parameters but may also be affected by intrinsic parameters (such as focal length and principal point offset). For example, if the deviations for all poses exhibit a systematic scaling or translation trend, the focal length or principal point position in the intrinsic parameters may need to be adjusted. The internal and external parameters of the projector are corrected according to the correction relationship so that the projection position deviation corresponding to different target postures is reduced to within the preset range to obtain the corrected projector parameters.
[0097] By decomposing the geometric correction value into rotational and translational components, the spatial geometric deviation is intuitively converted into adjustments to the projector's extrinsic parameters, giving the correction process clear physical meaning and making it easier to understand and implement. This decomposition method can accurately locate the source of the projector's posture deviation. By superimposing the rotational and translational components through matrix operations, the projector's extrinsic parameter matrix is updated, ensuring the mathematical rigor of the parameter adjustment. This method effectively utilizes the prior information provided by the initial parameters, avoiding parameter estimation from scratch and improving the efficiency and stability of parameter correction. The internal and external parameter correction relationship is established by combining the projection position deviations under multiple poses, fully considering the coupled effects of internal and external parameters during the projector imaging process. By analyzing the deviation patterns, it is possible to identify which deviations are caused by external parameters and which are caused by internal parameters, achieving coordinated optimization of internal and external parameters and improving the accuracy of parameter correction.
[0098] like Figure 2 As shown, an embodiment of the present invention further provides a three-coordinate structured cursor positioning system, comprising:
[0099] The parameter calibration module is used to collect calibration plate images at multiple angles, extract sub-pixel corner data, construct a camera parameter description method including radial and tangential distortion, and based on the pinhole imaging principle, establish a linear equation system to solve the camera's internal parameter matrix and distortion coefficients to obtain a preliminary calibration of the camera parameters;
[0100] The projector calibration module is used to perform preliminary calibration of camera parameters, project a composite coded pattern onto a calibration plate, synchronously capture relevant images and decode phase and coded data. Using the calibrated camera parameters, the module establishes a correspondence between projector pixels and points in the three-dimensional space of the calibration plate to solve the projector's intrinsic and extrinsic parameter matrix and obtain the initial projector parameters.
[0101] The 3D matching module is used to synchronously acquire camera images and projection patterns of a 3D target including feature points in multiple different positions based on the initial projector parameters. The module then establishes the correspondence between "projector code-camera corner point-world coordinates" through feature matching, determines the three detection points, and calculates the geometric correction value based on the spatial polygon formed by the three points.
[0102] The projector correction module is used to correct the initial projector parameters using the geometric correction values to obtain corrected projector parameters.
[0103] It should be noted that this system is a system corresponding to the above method, and all implementation methods in the above method embodiment are applicable to this embodiment and can achieve the same technical effects.
[0104] An embodiment of the present invention further provides a computing device comprising: a processor and a memory storing a computer program, wherein the computer program, when executed by the processor, performs the above-described method. All implementations in the above-described method embodiments are applicable to this embodiment and can achieve the same technical effects.
[0105] The embodiment of the present invention further provides a computer-readable storage medium storing instructions, which, when executed on a computer, causes the computer to execute the above-described method. All implementations in the above-described method embodiment are applicable to this embodiment and can achieve the same technical effects.
[0106] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for locating structural light in three coordinates, characterized in that: The method comprises: Step 1: By collecting calibration plate images at multiple angles, extracting sub-pixel corner data, constructing a camera parameter description method including radial and tangential distortion, and based on the pinhole imaging principle, solving the camera's internal parameter matrix and distortion coefficients by establishing a linear equation system to obtain the calibrated camera parameters; Step 2: Based on the calibrated camera parameters, a composite coding pattern is projected onto the calibration plate, and the relevant images are synchronously acquired and the phase and coding data are decoded. The calibrated camera parameters are used to establish the correspondence between the projector pixels and the three-dimensional space points of the calibration plate, and the intrinsic and extrinsic parameter matrix of the projector is solved to obtain the initial projector parameters. Step 3: Based on the initial projector parameters, a three-dimensional target including feature points is caused to synchronously acquire camera images and projection patterns in multiple positions, and a correspondence between "projector code-camera corner point-world coordinates" is established through feature matching, three detection points are determined, and a geometric correction value is calculated based on the spatial polygon formed by the three detection points, including: distributing 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 move freely along a translation guide rail to change its spatial position; during the movement of the target, the projector is controlled to project a composite coded pattern onto the target surface, and the camera is synchronously triggered to capture the target image and projection pattern; based on the known world coordinates of the target feature points, the sub-pixel corner point coordinates extracted from the camera image are matched, and at the same time, by decoding the phase encoding value of the projection pattern, the coded coordinates of the corresponding pixels in the projector image plane are associated to form a three-dimensional correspondence relationship data set of "projector pixel-camera pixel-world coordinates", and three non-collinear feature points on the target are determined as the detection point set to calculate the geometric correction value; Step 4: Correct the initial projector parameters using the geometric correction values to obtain corrected projector parameters.
2. The three-coordinate structured light locating method according to claim 1, characterized in that: By acquiring calibration plate images at multiple angles and extracting sub-pixel corner data, we construct a camera parameter description method that includes radial and tangential distortion. Based on the pinhole imaging principle, we establish a linear equation system to solve the camera's internal parameter matrix and distortion coefficients to obtain the calibrated camera parameters, including: The checkerboard calibration plate is rotated around the horizontal and vertical axes within the plane by different angles within the range of ±30 degrees, and translated to five different spatial positions in the depth direction perpendicular to the calibration plate plane. A clear image including the complete checkerboard corner points is captured by the camera at each position. Extract the sub-pixel coordinates of the checkerboard corner points from a clear image of the complete checkerboard corner points, and remove abnormal corner points of pixels by checking the consistency of the distance between adjacent corner points to form an image coordinate set; Based on the image coordinate set and the world coordinates of the corner points of the calibration plate, the projective mapping relationship between the camera coordinate system and the world coordinate system is established through the pinhole imaging principle. The world coordinates of the corner points of the calibration plate are converted into three-dimensional coordinates in the camera coordinate system by combining the rotation and translation matrix. The first radial, second radial, first tangential and second tangential distortion coefficients are introduced to quantify the distortion characteristics of the camera lens. 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 coordinates are corrected by superimposing the distortion coefficient to obtain the actual image plane coordinates. The linear equation system is constructed using the correspondence between the world coordinates of all corner points and the corrected image coordinates. Based on the constructed linear equations, the camera's internal parameters, external parameters and distortion coefficients are jointly corrected to obtain the calibrated camera parameters.
3. The three-coordinate structured light locating method according to claim 2, characterized in that: 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 coordinates are corrected by superimposing the distortion coefficient to obtain the actual image plane coordinates. The corresponding relationship between the world coordinates of all corner points and the corrected image coordinates is used to construct a linear equation system, including: Place a three-dimensional target in multiple preset positions, including checkerboard corner points and preset circular coded marks, and project a composite coded pattern onto the target through a projector, synchronously triggering the camera to capture the target image with the projected pattern; Decode the target image, extract the sub-pixel corner coordinates in the camera coordinate system and the corresponding projector code value, and combine the calibrated camera parameters to back-project the sub-pixel corner coordinates into 3D space to obtain the world coordinates of the target corner points; Based on the projector code value and the decoded phase information, a preliminary mapping relationship between the projector pixel coordinates and the target world coordinates is established. Through the preliminary mapping relationship under multiple perspectives, three non-collinear feature points at different depth planes of the target are determined as detection points. Using the world coordinates of the detection points and the corresponding projector coded coordinates, the deviations between the measured geometric relationships and the theoretical geometric relationships of the three detection points in the projector coordinate system are calculated, including the differences between the measured distances and angles between the detection points and the theoretical distances and angles. The deviation is decomposed into the focal length error and principal point offset error of the projector internal parameters and the rotation component error and translation component error of the external parameters. The linear correspondence between each deviation component and the geometric correction parameter is established through mathematical relationship analysis to construct a linear equation group.
4. The three-coordinate structured light locating method according to claim 3, characterized in that: Based on the calibrated camera parameters, a composite coding pattern is projected onto the calibration plate. The relevant images are collected synchronously and the phase and coding data are decoded. The calibrated camera parameters are used to establish the correspondence between the projector pixels and the three-dimensional space points of the calibration plate. The internal and external parameter matrix of the projector is solved to obtain the initial projector parameters, including: Based on the calibrated camera parameters, a composite code consisting of multiple sets of sinusoidal fringes and binary coding patterns is projected onto the calibration plate to form a spatiotemporal hybrid coding sequence. When the projector projects each set of coded patterns, the camera is synchronously triggered to capture the corresponding deformed fringe images and decode the captured image sequence; Using the calibrated camera parameters, the image coordinates of the corner points of the calibration plate are reversely projected into the three-dimensional space coordinate system of the calibration plate to obtain the precise three-dimensional coordinates of the corner points. At the same time, based on the absolute phase value of each pixel in the coded pattern projected by the projector, a mapping relationship between the projector image plane coordinates and the three-dimensional space coordinates of the calibration plate is established; Based on the mapping relationship between the projector image plane coordinates and the calibration plate three-dimensional space coordinates, the coordinates of each pixel of the projector are associated with the corresponding three-dimensional coordinates of the calibration plate, and the projection equation of the projector is constructed to obtain the initial projector parameters.
5. The three-coordinate structured light locating method according to claim 4, characterized in that: Based on the known world coordinates of the target feature points, they are matched with the sub-pixel corner coordinates extracted from the camera image. At the same time, by decoding the phase encoding value of the projected pattern, the encoded coordinates of the corresponding pixels in the projector image plane are associated to form a three-dimensional correspondence data set of "projector pixel-camera pixel-world coordinate". Three non-collinear feature points on the target are determined as the detection point set to calculate the geometric correction value, including: Based on the target's multiple poses, the sub-pixel corner coordinates of all feature points on the target surface are extracted from the camera image of each pose. Combined with the pre-calibrated 3D world coordinates on the target, a local mapping relationship between "camera pixel and world coordinate" is established. Decode the composite coded pattern projected by the projector at each pose to obtain the absolute phase coding of the target surface feature points. Combined with the local mapping relationship, the projector coding coordinates are bound to the camera pixel coordinates and world coordinates to generate a 3D global data set of "projector pixel-camera pixel-world coordinate"; Determine three non-collinear feature points from the 3D global data set as the detection point set. Based on the world coordinates and initial projector parameters, calculate the projector's theoretical encoding coordinates and compare them with the actual decoding coordinates to obtain the horizontal and vertical coordinate deviation vectors of each detection point. Based on the coordinate deviation vector, the actual projection position of the spatial triangle formed by the three detection points in the projector coordinate system is calculated, and a geometric comparison is performed with the theoretical spatial triangle in the world coordinate system to extract the side length ratio error and plane rotation angle deviation; The side length proportional error is converted into the scaling correction coefficient of the projector image plane, and the plane rotation angle deviation is decomposed into the rotation correction matrix between the projector coordinate system and the space coordinate system. The geometric correction value is generated by combining the spatial distribution direction of the deviation vectors of the three detection points.
6. The three-coordinate structured light locating method according to claim 5, characterized in that: The initial projector parameters are corrected using the geometric correction values to obtain corrected projector parameters, including: Resolving the geometric correction value into the rotational component adjustment amount and the translational component adjustment amount corresponding to the projector external parameters; The rotation component adjustment amount is combined and superimposed with the rotation component in the initial extrinsic parameters, and the translation component adjustment amount is superimposed with the translation component in the initial extrinsic parameters to generate an adjusted projector extrinsic parameter matrix; Based on the adjusted extrinsic parameter matrix and the initial intrinsic parameters, and combined with the projection position deviation of the structured light pattern on the projector imaging plane under multiple sets of target poses, the correction relationship between the projector's internal and external parameters is established; The internal and external parameters of the projector are corrected according to the correction relationship so that the projection position deviation corresponding to different target postures is reduced to within the preset range to obtain the corrected projector parameters.
7. A three-coordinate structural cursor positioning system, which implements the method according to any one of claims 1 to 6, characterized in that: include: The parameter calibration module is used to collect calibration plate images at multiple angles, extract sub-pixel corner data, construct a camera parameter description method including radial and tangential distortion, and based on the pinhole imaging principle, establish a linear equation system to solve the camera's internal parameter matrix and distortion coefficients to obtain a preliminary calibration of the camera parameters; The projector calibration module is used to perform preliminary calibration of camera parameters, project a composite coded pattern onto a calibration plate, synchronously capture relevant images and decode phase and coded data. Using the calibrated camera parameters, the module establishes a correspondence between projector pixels and points in the three-dimensional space of the calibration plate to solve the projector's intrinsic and extrinsic parameter matrix and obtain the initial projector parameters. A three-dimensional matching module is used to simultaneously acquire camera images and projection patterns of a three-dimensional target including feature points at multiple different positions based on initial projector parameters, establish a correspondence between "projector code-camera corner point-world coordinates" through feature matching, determine three detection points, and calculate geometric correction values based on the spatial polygon formed by the three points. The module includes: distributing checkerboard corner points and circular marker points on three orthogonal planes of the target, with the three-dimensional coordinates of each feature point pre-calibrated by a measuring device, and allowing the target to move freely along a translation guide rail to change its spatial position; during the target movement, controlling the projector to project a composite coded pattern onto the target surface and synchronously triggering the camera to capture the target image and projection pattern; matching the known world coordinates of the target feature points with the sub-pixel corner point coordinates extracted from the camera image, and simultaneously correlating the coded coordinates of the corresponding pixels in the projector image plane by decoding the phase encoding value of the projection pattern to form a three-dimensional correspondence data set of "projector pixel-camera pixel-world coordinates"; and determining three non-collinear feature points on the target as the detection point set to calculate the geometric correction value; The projector correction module is used to correct the initial projector parameters using the geometric correction values to obtain corrected projector parameters.
8. A computing device, characterized in that include: one or more processors; A storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Automatic calibration method for structured light three-dimensional scanner system
CN101763643A
Calibration method based on monocular structured light system
CN114792345A