Three-dimensional measurement system calibration method and system based on light model
By collecting images in multiple target poses for circle center correction and triangulation processing, the object point set and light parameters in the camera coordinate system are calculated, and a lookup table of phase and three-dimensional mapping coefficients is constructed to solve the light model's requirements for target flatness. solves the problem, simplifies the calibration process and improves accuracy.
Patent Information
- Application Number
- CN202410985369.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-07-23
AI Technical Summary
Existing light models have high requirements on target flatness during camera calibration, and the low flatness of large-sized flat targets will reduce the calibration accuracy and make the process cumbersome.
By collecting images of the target in multiple target postures, performing circle center correction and triangulation processing, calculating the object point set and light parameters in the camera coordinate system, constructing a lookup table of phase and three-dimensional mapping coefficients, and reducing the flatness of the target. requirements and simplify the calibration process.
This reduces the requirements for target flatness, avoids errors caused by treating the target plane as an ideal plane, simplifies the calibration process, and improves data processing efficiency.
Smart Images

Figure CN118521652B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image detection technology, and in particular to a three-dimensional measurement system calibration method, system, electronic device, storage medium and computer program product based on a light model. Background Art
[0002] The calibration of the imaging system is one of the important links in the field of machine vision. In related technologies, light models can be used to calibrate cameras and projectors. However, the light model has high requirements for the target. For example, when solving spatial points, the target plane needs to be fitted as an ideal plane. If the field of view of the 3D sensor is large, it is difficult and expensive to make a target with high flatness; if the flatness of a large-sized plane target is not high, the calibration accuracy will be reduced in the light calibration. Summary of the invention
[0003] Based on this, it is necessary to provide a three-dimensional measurement system calibration method, system, electronic device, storage medium and computer program product based on a light model to address the above technical problems, which can reduce the requirements for target flatness and simplify the calibration process.
[0004] In a first aspect, the present application provides a three-dimensional measurement system calibration method based on a light model, the method comprising:
[0005] Collect target images corresponding to the target in multiple target postures, as well as corresponding phase-shifted fringe images and Gray code images;
[0006] Performing circle center correction on each of the target images to obtain the circle center coordinates of the marking points of each of the target images;
[0007] Triangulating the coordinates of the center of the target image under each target posture to obtain triangular mesh data;
[0008] Calculating the object points corresponding to the target postures in the camera coordinate system for each pixel point of the target image using the triangular mesh data to obtain a set of object points corresponding to each pixel point; and determining the light parameters corresponding to the set of object points;
[0009] Performing phase extraction on the phase-shifted fringe image and the Gray code image to obtain absolute phase data corresponding to each pixel;
[0010] The mapping coefficients are determined by coefficient fitting according to the object point set corresponding to each pixel point and the absolute phase data, and a lookup table of phase and three-dimensional mapping coefficients is constructed based on the mapping coefficients and the light parameters to achieve camera calibration.
[0011] In one embodiment, performing circle center correction on each target image to obtain the circle center coordinates of the marker points of each target image includes:
[0012] Construct a circle center arrangement network in the target image;
[0013] Define the image plane corresponding to the camera coordinate system of the target image in the parallel view;
[0014] Determine a geometric transformation matrix based on the circle center arrangement network; wherein the geometric transformation matrix is used to transform the circle center arrangement network to a target position on an image plane corresponding to a camera coordinate system under a parallel view;
[0015] Determine a homography matrix according to the geometric transformation matrix and the internal and external parameters of the target image; wherein the homography matrix is used for coordinate system conversion of the target image between the camera coordinate system and the parallel view coordinate system;
[0016] Based on the homography matrix, the corrected center coordinates of the marker points corresponding to the target image under each target posture are obtained.
[0017] In one embodiment, triangulating the coordinates of the center of the target image under each target posture to obtain triangular mesh data includes:
[0018] The center coordinates of the marker points in the target image corresponding to each target posture are triangulated based on the triangulation method, and the target image is divided into several planes to obtain triangular mesh data.
[0019] In one embodiment, the method of calculating the object point corresponding to each target posture in the camera coordinate system for each pixel on the target image using the triangular mesh data to obtain a set of object points corresponding to each pixel point includes:
[0020] For each pixel in the target image, the centroid coordinates of each triangle in the triangular mesh data are traversed to determine the target triangle corresponding to the pixel;
[0021] Construct the barycentric coordinate coefficients based on the geometric relationship between the pixel and each vertex of the target triangle;
[0022] According to the imaging assumption of the light model, the target point in the target image corresponding to the pixel under each target posture is determined to obtain the object point set corresponding to each pixel point.
[0023] In one embodiment, the method further includes: sorting all circle center coordinates on the image plane by a four-circle sequencing algorithm, and establishing a lookup table of circle center points on the image plane and corresponding circle center points on the target plane in the camera coordinate system.
[0024] In one embodiment, the method further comprises:
[0025] Based on the lookup table of the phase and the three-dimensional mapping coefficients, three-dimensional reconstruction is performed.
[0026] In one embodiment,
[0027] The three-dimensional reconstruction is performed based on the lookup table of the phase and the three-dimensional mapping coefficient, comprising:
[0028] Project a unidirectional fringe image onto the object to be measured and determine the absolute phase data of the pixel points of the object to be measured;
[0029] Querying the phase and three-dimensional mapping coefficient lookup table according to the absolute phase data to determine the corresponding phase-three-dimensional mapping coefficient;
[0030] The three-dimensional coordinates of the pixel points of the object under test are determined based on the phase-three-dimensional mapping coefficients.
[0031] In a second aspect, the present application provides a three-dimensional measurement system calibration system based on a light model, the system comprising:
[0032] An image acquisition module, used to acquire target images corresponding to the target in multiple target postures, as well as corresponding phase-shifted fringe images and Gray code images;
[0033] A circle center correction module, used to perform circle center correction on each of the target images to obtain the circle center coordinates of the marker points of each of the target images;
[0034] A triangulation processing module is used to triangulate the coordinates of the center of the target image under each target posture to obtain triangulated mesh data;
[0035] An object point calculation module is used to calculate the object points corresponding to each target posture in the camera coordinate system for each pixel point of the target image using the triangular mesh data to obtain a set of object points corresponding to each pixel point; and determine the light parameters corresponding to the set of object points;
[0036] A phase calculation module, used for performing phase extraction on the phase-shifted fringe image and the Gray code image to obtain absolute phase data corresponding to each pixel;
[0037] A lookup table construction module is used to determine the mapping coefficient by coefficient fitting according to the object point set corresponding to each pixel point and the absolute phase data, and to construct a lookup table of phase and three-dimensional mapping coefficients based on the mapping coefficient and the light parameters to achieve camera calibration.
[0038] In a third aspect, the present application further provides an electronic device, wherein the electronic device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method in any one of the embodiments of the first aspect are implemented.
[0039] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method in any one of the embodiments of the first aspect are implemented.
[0040] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the method in any one of the embodiments of the first aspect are implemented.
[0041] The above-mentioned business is based on the three-dimensional measurement system calibration method of the light model. By performing circle center correction on the target image under multiple target postures, the circle center coordinates of the corresponding corrected marker points are obtained to realize parallel projection correction of the target image; the circle center coordinates under each target posture are triangulated to obtain triangular mesh data, so that the object point set corresponding to each pixel point and the fitting light parameters can be calculated based on the triangular mesh data, so that the three-dimensional coordinates of the pixel point can be solved based on the barycentric coordinate mapping; thereby reducing the requirements for the flatness of the target and avoiding the error caused by treating the target plane as an ideal plane. The entire calibration process only needs to use target images of a plane target in multiple postures, which effectively simplifies the calibration process and improves data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a schematic diagram of a three-dimensional measurement system calibration method based on a light model in an embodiment;
[0043] Figure 2 is a schematic diagram of a camera coordinate system and a camera coordinate system in a parallel view in one embodiment;
[0044] Figure 3 is a schematic diagram of coordinate components corresponding to a triangle in one embodiment;
[0045] Figure 4 It is a schematic diagram of transformation of a marker point in a target image, a marker point in a camera coordinate system of a parallel view, and a marker point after center correction in one embodiment;
[0046] Figure 5 is a schematic diagram of a coordinate point projection in one embodiment;
[0047] Figure 6 A schematic diagram of a light beam in one embodiment;
[0048] Figure 7 is a schematic diagram of the intersection of two spatial straight lines in a camera coordinate system and a projector coordinate system in one embodiment;
[0049] Figure 8 A schematic diagram of a flow chart of a three-dimensional measurement system calibration method based on a light model in an embodiment;
[0050] Fig. 9 is a schematic diagram of a three-dimensional measurement system calibration system based on a light model in one embodiment;
[0051] Fig.10 FIG. 4 is a structural diagram of an electronic device in an embodiment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] In related technologies, when calibrating a camera, the light model fits the target plane as an ideal plane when solving spatial points. If the 3D sensor has a large field of view, it is difficult and expensive to make a target with high flatness. If the flatness of a large-sized plane target is not high, the calibration accuracy will be reduced in the light calibration. In addition, when calibrating the camera light, it is necessary to use an LCD target first, and then replace the plane target to solve the three-dimensional point. The process is relatively cumbersome.
[0054] In order to solve the technical defects existing in the prior art, an embodiment of the present application provides a three-dimensional measurement system calibration method based on a light model.
[0055] In an exemplary embodiment, Figure 1 As shown, a three-dimensional measurement system calibration method based on a light model is provided, which can be applied to intelligent electronic devices with camera and video recording functions, such as digital cameras and camera components installed in intelligent terminal devices. Exemplarily, the three-dimensional measurement system calibration method based on a light model may include steps S11 to S16. Among them:
[0056] Step S11 , collecting target images corresponding to the target in multiple target postures, as well as corresponding phase-shifted fringe images and Gray code images.
[0057] In an exemplary embodiment, a sensor system can be composed of 1 industrial camera and 1 digital projector. During calibration, the target is placed in the measurement space of the sensor system, and the target posture of the target can be pre-configured. For example, the target can be pre-configured to be placed in K postures in the measurement space; where K ≥ 10. In each target posture, the angle and distance between the target and the camera plane are different. In each posture, the industrial camera captures a grayscale image of the target, and then the projector and the camera capture a set of unidirectional phase-shifted fringe patterns and Gray code patterns. Among them, the number of phase shift steps n ≥ 4 for controlling the phase-shifted fringe pattern acquisition.
[0058] Step S12, performing circle center correction on each of the target images to obtain the circle center coordinates of the marking points of each of the target images.
[0059] For example, due to the perspective transformation in the camera imaging process, when the camera shooting direction is not parallel to the target plane, the circular mark point of the target captured by the camera will become an ellipse. At this time, the center of the ellipse extracted in the picture using the center extraction algorithm is not the image point corresponding to the center of the circular mark point, that is, there is a perspective deviation. The center deviation will reduce the accuracy of the light model in solving the object point, so center correction is required.
[0060] refer to Figure 2 As shown, O1 is the coordinate system where the camera is located, O p is the camera coordinate system under the parallel view. The transformation relationship between the target image under the camera coordinate system and the camera coordinate system of the parallel view can be expressed as:
[0061]
[0062]
[0063] in, , is the camera internal reference; , It is the external parameter of the camera in the world coordinate system; , is the external parameter of the target in the parallel view coordinate system, , is used to represent the coordinates of the pixel points in the original target image in the camera coordinate system, for example, the coordinates of the point m1; , is the coordinate of the pixel point in the camera coordinate system used to represent the parallel view image, for example, m p The coordinates of the point.
[0064] Considering that the world coordinate system where the target is located is fixed, no matter what the position relationship of the O1 coordinate system relative to the world coordinate system is, the optimal parallel view pose O pThe relative positions of the target in the world coordinate system should be determined, so the transformation relationship Hp can be represented by calculating the homography matrix of the two planes. The parallel view requires that the camera is directly above the target, the field of view can cover the entire target and the circle on the imaging plane is of moderate size.
[0065] In an exemplary embodiment, in step S12, performing circle center correction on each target image to obtain the circle center coordinates of the marker points of each target image includes:
[0066] Step S121, constructing a circle center arrangement network in the target image;
[0067] Step S122, defining an image plane corresponding to the camera coordinate system of the target image in the parallel view;
[0068] Step S123, determining a geometric transformation matrix based on the circle center arrangement network; wherein the geometric transformation matrix is used to transform the circle center arrangement network to a target position of an image plane corresponding to a camera coordinate system under a parallel view;
[0069] Step S124, determining a homography matrix according to the geometric transformation matrix and the internal and external parameters of the target image; wherein the homography matrix is used for coordinate system conversion of the target image between the camera coordinate system and the parallel view coordinate system;
[0070] Step S125, obtaining the corrected center coordinates of the marker points corresponding to the target image under each target posture based on the homography matrix.
[0071] For example, a standard circle center arrangement network can be generated based on the number of rows and columns of the target circle center and the distance between the circle centers in the x and y directions. Then an image plane with a custom input resolution is generated. , ,For example Figure 2 The image plane corresponding to the camera coordinate system under the parallel view shown in , .
[0072] When calculating the geometric transformation matrix, we can determine the four edge corner points of the circle center arrangement network, take the average value to get the midpoint, then calculate the midpoint of the image plane, and subtract the two to determine the displacement offset. , ; Then determine the scaling factor scale. Since it is proportional magnification, the magnification factor is the image plane width / corner point coordinate Difference, image plane height / corner point coordinates The minimum value of the difference is calculated by taking 8 / 10 of the image height and width to keep the corner point away from the edge of the image and retain a certain width. The geometric transformation matrix can be used to center the image plane of the camera coordinate system in the parallel view of the standard circle center.
[0073] Then, the homography matrix Hp of the two plane transformations is calculated through the center point of the image plane and the center point of the target image in the camera coordinate system.
[0074] After calculating the homography matrix Hp, for the image plane , According to the transformation relationship of formula (2), it can be inversely mapped to the original image plane , , and then the image of the parallel view is obtained by bilinear interpolation. At this time, the point extraction algorithm is used to obtain the center point set of the parallel view, and then the point set is inversely mapped from the parallel view back to the original image. In this way, the image plane can be obtained, such as Figure 4 As shown in the figure, the corrected center coordinates of the circular marker points of the target under various target postures.
[0075] In addition, the external parameter matrix corresponding to the target under different target postures can be determined by Zhang Zhengyou calibration method.
[0076] Step S13, triangulating the coordinates of the center of the target image under each target posture to obtain triangular mesh data.
[0077] In an exemplary embodiment, triangulating the center coordinates of the target image under each target posture to obtain triangular mesh data includes: triangulating the center coordinates of the marker points in the target image corresponding to each target posture based on triangulation, dividing the target image into several planes to obtain triangular mesh data.
[0078] For example, in a calibration scenario with a large field of view, the target often cannot be directly regarded as an ideal plane. In this case, the idea of finite element method can be adopted to divide the target into multiple small planes by triangulation, and then solve the three-dimensional coordinates of the points on the plane based on the centroid coordinates.
[0079] Specifically, all the center coordinates of the target images collected in each posture can be triangulated by using the triangulation method to obtain a triangular mesh. .
[0080] Among them, for any triangle in space At any point P on the plane ABC defined by the triangle, the following triangle area ratio Defined as point M about the triangle The centroid coordinates (or area coordinates) of are expressed as: Among them, the area , , are all directed areas. It is usually agreed that when the vertices of a triangle are arranged in a counterclockwise direction, the area of the triangle is positive, and when the vertices are arranged in a clockwise direction, the area of the triangle is negative. Correspondingly, the coordinate components of each area are , , are all directed, such as Figure 3 shown.
[0081] In step S14, the triangular mesh data is used to calculate the object points corresponding to the target postures in the camera coordinate system for each pixel point of the target image to obtain the object point set corresponding to each pixel point; and the light parameters corresponding to the object point set are determined.
[0082] In an exemplary embodiment, the method of calculating the object points corresponding to each target posture in the camera coordinate system for each pixel on the target image using the triangular mesh data to obtain a set of object points corresponding to each pixel point includes:
[0083] Step S141, for a pixel in the target image, traverse the centroid coordinates of each triangle in the triangular mesh data to determine the target triangle corresponding to the pixel;
[0084] Step S142, constructing barycentric coordinate coefficients based on the geometric relationship between the pixel and each vertex of the target triangle;
[0085] Step S143, according to the imaging assumption of the light model, determine the target point in the target image corresponding to the pixel under each target posture, so as to obtain the object point set corresponding to each pixel point.
[0086] For example, for a pixel m of the target image in the image plane in the camera coordinate system, traverse and calculate its intersection with all triangles The barycentric coordinates of a triangle are , then at a point on the triangular plane The coordinates can be expressed as:
[0087]
[0088] in, , and is the barycentric coordinate coefficient, satisfying .
[0089] Correspondingly,
[0090]
[0091] The centroid coefficient is used to represent the geometric relationship between the point and the vertex coordinates. , and The positive and negative signs of can determine the relationship between the point and the triangle. , and When both are greater than 0, it means that the point P is located inside the triangle. When the triangle where the point P is located is determined, the corresponding barycentric coordinate coefficients can be determined.
[0092] According to the imaging assumptions of the light model, the target points on the target image under each target posture It can be imaged onto the same pixel point m, and the points on the target image are converted to the camera coordinate system through the following relationship:
[0093]
[0094] in, Respectively represent the rotation matrix of the target corresponding to the camera in the first posture, the second posture and the third posture, They represent the translation matrices of the camera corresponding to the target in the first posture, the second posture and the third posture respectively. The external parameters of different postures can be obtained by Zhang Zhengyou calibration method with circle center correction.
[0095] In an exemplary embodiment, the method further includes: sorting all circle center coordinates on the image plane by a four-circle sequencing algorithm, and establishing a lookup table of circle center points on the image plane and corresponding circle center points on the target plane in the camera coordinate system.
[0096] For example, in the camera coordinate system of the parallel view, the image plane can sort all the circle center coordinates by the four-circle sequencing algorithm, and then establish the circle center point P on the image plane. n The center point of the circle corresponding to the target plane in the camera coordinate system Lookup table .
[0097] For any pixel point m, the triangle vertex of the found target in the kth posture , the corresponding spatial point can be found on the target lookup table through the circle center point lookup table The three-dimensional coordinates of .
[0098] At this point, the geometric relationship determined by the centroid coordinates can be transferred from the pixel plane to the camera coordinate system to solve the three-dimensional coordinates of point Q corresponding to any point P in the pixel plane, as follows: Figure 5 shown.
[0099] Due to the nonlinear effect of perspective transformation, the barycentric coordinate coefficient of point P obtained from the pixel plane is not equivalent to the barycentric coefficient of the corresponding point Q in the camera coordinate system. Therefore, perspective correction is required first, and the space after projection transformation can be regarded as a nonlinear space related to 1 / z. Then, only a nonlinear transformation is required for the three vertex attributes, and then a linear interpolation based on the 1 / z space attribute can be obtained using the barycentric coordinate coefficient based on 1 / z. The formula may include:
[0100]
[0101] Then, you can Multiply by the inverse r of the linear interpolation based on the 1 / z space unit vector to obtain the coordinates of point Q. The formula may include:
[0102]
[0103]
[0104] Correspondingly, the real coordinate expression of point Q based on the barycentric coordinates can include:
[0105]
[0106] At the same time, the space line equation can be expressed as a parametric equation:
[0107]
[0108] For a pixel point m, the above formula can be used to solve the set of its real object point coordinates Q in the camera coordinate system. Then the spatial straight line passing through these points can be fitted by the least squares method to calculate the covariance matrix. The formula may include:
[0109]
[0110]
[0111] Based on the PCA (Principal Component Analysis) theory, the eigenvector corresponding to the maximum eigenvalue of the covariance matrix is the direction vector of the spatial line, and the line must pass through the centroid, so all spatial lines can be characterized to obtain the light parameters. , the light parameter drawing results are as follows Figure 6 shown. Figure 6 The multiple straight lines in the figure represent spatial lines, and the circle where the lines converge represents the camera.
[0112] For any pixel m, corresponding to K object points, by calculating the covariance matrix of the object points, and then calculating the eigenvector corresponding to the maximum eigenvalue of the covariance matrix, it can be expressed as the direction vector of the space line, and the line must pass through the centroid. According to a point and direction, the parameters of this light can be determined.
[0113] In step S15, phase extraction is performed on the phase-shifted fringe image and the Gray code image to obtain absolute phase data corresponding to each pixel.
[0114] In an exemplary embodiment, the absolute phase of the image point in the camera image plane can be extracted by N-step phase shifting method + Gray code unwrapping phase. By combining N phase-shifted fringe patterns in a certain posture, the relative phase corresponding to all pixels can be obtained, and then the absolute phase can be obtained by expanding the phase through Gray code. .
[0115] In step S16, coefficient fitting is performed according to the object point set corresponding to each pixel point and the absolute phase data to determine the mapping coefficient, and a lookup table of phase and three-dimensional mapping coefficient is constructed based on the mapping coefficient and the light parameters to achieve camera calibration.
[0116] For example, after obtaining the coordinates of the object point in space, the mapping relationship between the phase of the image point and the three-dimensional point can be solved, so that the corresponding three-dimensional point in space can be directly obtained by knowing the phase of the image point.
[0117] Specifically, refer to Figure 7 As shown, the coordinate points passing through the two coordinate systems , The two spatial straight lines intersect at the spatial point , and satisfy the following relationship:
[0118]
[0119] in, is the homogeneous coordinate; R s is the rotation matrix from the camera coordinate system to the projector coordinate system; t s It is the translation matrix from the camera coordinate system to the projector coordinate system.
[0120] Based on formula (9) and formula (12), It can be expressed as:
[0121]
[0122] in, , Used to represent the light parameters of the camera light in the projection coordinate system; is a scale constant.
[0123] Based on the above formula, we can get the straight line constraint .in, express The antisymmetric matrix of , then the above system of equations has only three degrees of freedom, the system of equations is solvable, and and Satisfying the polynomial mapping relationship, the object point can be obtained The Z coordinate is:
[0124]
[0125] Therefore, the relationship between the three-dimensional point on the camera light and the phase is a polynomial relationship, where is the mapping coefficient, and the three-dimensional point coordinates obtained by solving Coordinate system conversion and unwrapped phase The coefficients are fitted.
[0126] In determining After that, it can be calculated by formula (9) , Coordinates, combined with coordinate system conversion, can be calculated Therefore, a phase-three-dimensional mapping coefficient lookup table is established From the above derivation, we can know that as long as the light parameters are determined and the mapping coefficients , the image point can be Directly map to the corresponding 3D space point.
[0127] In an exemplary embodiment, reference Figure 8 As shown, the method further includes: step S17, performing three-dimensional reconstruction based on a lookup table of the phase and three-dimensional mapping coefficients.
[0128] Exemplarily, the performing three-dimensional reconstruction based on the lookup table of the phase and the three-dimensional mapping coefficients includes:
[0129] Step S171, projecting a unidirectional fringe image onto the object to be measured, and determining the absolute phase data of the pixel points of the object to be measured;
[0130] Step S172, querying the phase and three-dimensional mapping coefficient lookup table according to the absolute phase data to determine the corresponding phase-three-dimensional mapping coefficient;
[0131] Step S173, determining the three-dimensional coordinates of the pixel points of the object under test based on the phase-three-dimensional mapping coefficients.
[0132] Specifically, the absolute phase is calculated by projecting a unidirectional fringe pattern onto the surface of the object being measured. , find the image point corresponding to the image point from the lookup table LUT Substitute the phase and mapping coefficients into formula (13) to calculate the corresponding X, Y and Z coordinates.
[0133] In the calibration method of the three-dimensional measurement system based on the light model provided in the embodiment of the present application, the target is placed in multiple different postures, and the corresponding target image is collected in different postures, and the stripes and Gray code patterns are projected and sampled, and the center coordinates of the target corresponding to each posture are calculated by parallel projection correction, and the external parameter matrix in each posture is calculated by Zhang Zhengyou calibration to achieve parallel projection correction of the target image. The center coordinates are triangulated to obtain triangular mesh data, and the triangular mesh is used to calculate the K object points corresponding to each pixel based on the barycentric coordinates, and the light parameters are fitted to achieve the three-dimensional coordinates of each pixel based on the barycentric coordinates. The absolute phase is calculated by projecting the stripe map, and the mapping coefficients are fitted using the object points and the phase to establish a phase-three-dimensional mapping coefficient lookup table, and the phase-three-dimensional mapping coefficient lookup table can be used to achieve three-dimensional reconstruction. This scheme establishes triangular mesh data by triangulating the center coordinates, and then uses the barycentric coordinate mapping to solve the spatial coordinates of the three-dimensional point, which is equivalent to dividing the target plane into multiple small planes through the idea of finite elements, reducing the requirements for the flatness of the target, and avoiding the error caused by treating the target plane as an ideal plane. The entire calibration process only requires the use of one flat target, which simplifies the calibration process.
[0134] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0135] Based on the same inventive concept, the embodiment of the present application also provides a system for implementing the above-mentioned three-dimensional measurement system calibration method based on a light model. The implementation solution provided by the system to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in one or more embodiments of the three-dimensional measurement system calibration system based on a light model provided below can refer to the limitations of the three-dimensional measurement system calibration method based on a light model above, and will not be repeated here.
[0136] In one embodiment, Fig. 9 As shown, a three-dimensional measurement system calibration system based on a light model is provided. The calibration system 90 includes:
[0137] An image acquisition module 901 is used to acquire target images corresponding to the target in multiple target postures, as well as corresponding phase-shifted fringe images and Gray code images;
[0138] A circle center correction module 902 is used to perform circle center correction on each of the target images to obtain the circle center coordinates of the marker points of each of the target images;
[0139] A triangulation processing module 903 is used to perform triangulation processing on the center coordinates of the target image under each target posture to obtain triangulated mesh data;
[0140] The object point calculation module 904 is used to calculate the object points corresponding to each target posture in the camera coordinate system for each pixel point of the target image using the triangular mesh data to obtain the object point set corresponding to each pixel point; and determine the light parameters corresponding to the object point set;
[0141] A phase calculation module 905 is used to perform phase extraction on the phase-shifted fringe image and the Gray code image to obtain absolute phase data corresponding to each pixel;
[0142] The lookup table construction module 906 is used to determine the mapping coefficients by performing coefficient fitting according to the object point set corresponding to each pixel point and the absolute phase data, and to construct a lookup table of phase and three-dimensional mapping coefficients based on the mapping coefficients and the light parameters to achieve camera calibration.
[0143] In one embodiment, the system may further include: a reconstruction module, which may be used to perform three-dimensional reconstruction based on a lookup table of the phase and three-dimensional mapping coefficients.
[0144] Each module in the above-mentioned three-dimensional measurement system calibration system based on the light model can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0145] In one embodiment, an electronic device is provided, whose structure diagram can be as follows: Fig.10As shown. The device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a three-dimensional measurement system calibration method based on a light model is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0146] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0147] In one embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0148] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0149] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above-mentioned method embodiments when executed by a processor. The computer program can be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in the above-mentioned method embodiments.
[0150] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0151] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magneto resistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0152] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0153] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems, and computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0154] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A three-dimensional measurement system calibration method based on a light model, characterized in that: The method comprises: Collect target images corresponding to the target in multiple target postures, as well as corresponding phase-shifted fringe images and Gray code images; Performing circle center correction on each of the target images to obtain the circle center coordinates of the marking points of each of the target images; Triangulating the coordinates of the center of the target image under each target posture to obtain triangular mesh data; Calculating the object points corresponding to the target postures in the camera coordinate system for each pixel point of the target image using the triangular mesh data to obtain a set of object points corresponding to each pixel point; and determining the light parameters corresponding to the set of object points; Performing phase extraction on the phase-shifted fringe image and the Gray code image to obtain absolute phase data corresponding to each pixel; The mapping coefficients are determined by coefficient fitting according to the object point set corresponding to each pixel point and the absolute phase data, and a lookup table of phase and three-dimensional mapping coefficients is constructed based on the mapping coefficients and the light parameters to achieve camera calibration.
2. The method according to claim 1, characterized in that The performing circle center correction on each target image to obtain the circle center coordinates of the marker points of each target image includes: Construct a circle center arrangement network in the target image; Define the image plane corresponding to the camera coordinate system of the target image in the parallel view; Determine a geometric transformation matrix based on the circle center arrangement network; wherein the geometric transformation matrix is used to transform the circle center arrangement network to a target position on an image plane corresponding to a camera coordinate system under a parallel view; Determine a homography matrix according to the geometric transformation matrix and the internal and external parameters of the target image; wherein the homography matrix is used for coordinate system conversion of the target image between the camera coordinate system and the parallel view coordinate system; Based on the homography matrix, the corrected center coordinates of the marker points corresponding to the target image under each target posture are obtained.
3. The method according to claim 1, characterized in that: The triangulating the center coordinates of the target image under each target posture to obtain triangulated mesh data includes: The center coordinates of the marker points in the target image corresponding to each target posture are triangulated based on the triangulation method, and the target image is divided into several planes to obtain triangular mesh data.
4. The method according to claim 1, characterized in that: The method of calculating the object points corresponding to the target postures in the camera coordinate system for each pixel on the target image using the triangular mesh data to obtain the object point set corresponding to each pixel point includes: For each pixel in the target image, the centroid coordinates of each triangle in the triangular mesh data are traversed to determine the target triangle corresponding to the pixel; Construct the barycentric coordinate coefficients based on the geometric relationship between the pixel and each vertex of the target triangle; According to the imaging assumption of the light model, the target point in the target image corresponding to the pixel under each target posture is determined to obtain the object point set corresponding to each pixel point.
5. The method according to claim 4, characterized in that The method further comprises: All circle center coordinates are sorted on the image plane using a four-circle sequencing algorithm, and a lookup table of circle center points on the image plane and corresponding circle center points on the target plane in the camera coordinate system is established.
6. The method according to claim 1, characterized in that The method further comprises: Based on the lookup table of the phase and the three-dimensional mapping coefficients, three-dimensional reconstruction is performed.
7. The method according to claim 6, characterized in that The three-dimensional reconstruction is performed based on the lookup table of the phase and the three-dimensional mapping coefficient, comprising: Project a unidirectional fringe image onto the object to be measured and determine the absolute phase data of the pixel points of the object to be measured; Querying the phase and three-dimensional mapping coefficient lookup table according to the absolute phase data to determine the corresponding phase-three-dimensional mapping coefficient; The three-dimensional coordinates of the pixel points of the object under test are determined based on the phase-three-dimensional mapping coefficients.
8. A three-dimensional measurement system calibration system based on a light model, characterized in that: The system comprises: An image acquisition module, used to acquire target images corresponding to the target in multiple target postures, as well as corresponding phase-shifted fringe images and Gray code images; A circle center correction module, used to perform circle center correction on each of the target images to obtain the circle center coordinates of the marker points of each of the target images; A triangulation processing module is used to triangulate the coordinates of the center of the target image under each target posture to obtain triangulated mesh data; An object point calculation module is used to calculate the object points corresponding to each target posture in the camera coordinate system for each pixel point of the target image using the triangular mesh data to obtain a set of object points corresponding to each pixel point; and determine the light parameters corresponding to the set of object points; A phase calculation module, used for performing phase extraction on the phase-shifted fringe image and the Gray code image to obtain absolute phase data corresponding to each pixel; A lookup table construction module is used to determine the mapping coefficient by coefficient fitting according to the object point set corresponding to each pixel point and the absolute phase data, and to construct a lookup table of phase and three-dimensional mapping coefficients based on the mapping coefficient and the light parameters to achieve camera calibration.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, which implements the steps of the method according to any one of claims 1 to 7 when executed by a processor.
