A binocular structured light imaging method and system based on a lifting platform calibration
The binocular structured light imaging method calibrated by the lifting platform solves the problems of low calibration accuracy and long matching point search time in the existing technology, and realizes high-precision and efficient 3D coordinate calculation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG AOPUTE TECH CO LTD
- Filing Date
- 2023-04-28
- Publication Date
- 2026-05-05
AI Technical Summary
Existing binocular structured light imaging technology suffers from low calibration accuracy, unstable accuracy, and excessively long search time for left and right matching points.
A binocular structured light imaging method based on lifting platform calibration is adopted. By calibrating the binocular camera and projector, the same world coordinates are constructed to find the matching point of the left and right cameras. The Gauss-Dessell iteration method is used to solve the model parameters and calculate the binocular 3D coordinates. The homography matrix and the projector homography matrix are solved by using a standard pinhole camera model. The matching point is calculated in reverse to improve accuracy and efficiency.
It improves calibration accuracy and imaging efficiency, has good stability, reduces the time spent searching for matching points, and achieves high-precision 3D coordinate calculation.
Smart Images

Figure CN116630434B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision technology, and in particular to a binocular structured light imaging method and system based on a lifting platform calibration. Background Technology
[0002] Machine vision is a rapidly developing branch of artificial intelligence. Simply put, machine vision uses computers to simulate human visual functions, extracting information from images of objective things, processing and understanding it, and ultimately using it for practical detection, measurement, and control.
[0003] Binocular imaging technology is one type of machine vision technology. In most binocular imaging systems, it is necessary to go through steps such as stereo calibration, stereo correction, stereo matching, and 3D coordinate calculation to generate a 3D image of an object. Since stereo matching uses a matching algorithm to search for matching points between the left and right cameras, the whole process is very time-consuming, and the calculated 3D coordinate model is relatively fixed, which makes the image accuracy more dependent on the matching effect.
[0004] Compared to binocular imaging technology, binocular structured light imaging technology is more efficient, requires less data processing, and has a wider range of applications. However, even so, binocular structured light imaging technology still has problems such as low calibration accuracy, unstable accuracy, and excessively long search time for left and right matching points.
[0005] Therefore, improvements to existing technologies are necessary.
[0006] The above information is provided as background information only to aid in understanding this disclosure and does not constitute an assertion or admission that any of the above content can be used as prior art relative to this disclosure. Summary of the Invention
[0007] This invention provides a binocular structured light imaging method and system based on a lifting platform calibration, so as to improve the calibration accuracy, accuracy stability and imaging efficiency of binocular structured light technology.
[0008] To achieve the above objectives, the present invention provides the following technical solution:
[0009] In a first aspect, the present invention provides a binocular structured light imaging method based on a lifting platform calibration, the method comprising:
[0010] S1. Calibrate the binocular camera and projector separately;
[0011] S2. By constructing the same world coordinates, matching points between the left and right cameras are found, and a 17-parameter model is constructed for all matching points to calculate the stereo 3D coordinates.
[0012] S3. The Gauss-Dessell iterative method is used to solve for the model parameters to obtain the bi-objective transformation matrix H in the X, Y, and Z directions.x H y H z ;
[0013] S4. Solve for the absolute phase diagram from the fringe pattern of the calibration plate and find the corresponding projector pixel coordinates;
[0014] S5. The homography matrix H of the left and right cameras can be obtained by solving the problem based on the standard pinhole camera model. cl H cr and the homography matrix H of the projector pl H pr ;
[0015] S6. Calculate the absolute phase maps of the left and right cameras for the imaged object. l I r ;
[0016] S7, Lianli H cl and H pl Find the 3D coordinates of the left camera, and similarly find the 3D coordinates of the right camera;
[0017] S8. Based on the 3D coordinates of the left camera and H cr Solve for the pixel coordinates on the right camera, and based on the right camera's 3D coordinates and H... cl Solve for the pixel coordinates on the corresponding left camera;
[0018] S9. Based on the pixel coordinates corresponding to the 3D coordinates obtained in step S8 and the absolute phase map I l I r Search for matching points between the left and right cameras within a fixed interval;
[0019] S10. Based on the matching points and the bi-target transformation matrix H x H y H z Obtain the binocular 3D coordinates.
[0020] In one possible implementation, the binocular structured light imaging method based on platform calibration includes step S1:
[0021] Select a calibration plate and place it on the lifting platform;
[0022] Control the lifting platform to rise to different heights and collect images of the calibration plate at different heights;
[0023] At different altitudes, more than 6 sets of calibration board images were collected to calibrate the binocular camera;
[0024] At different heights, more than 6*24 calibration plate stripe images were collected in the X and Y directions to calibrate the projector.
[0025] In one possible implementation, the binocular structured light imaging method based on the lifting platform calibration includes step S2:
[0026] By constructing the same world coordinate system, matching points (L) for the left and right cameras are found. u ,L v ) and (R u ,R v );
[0027] A model with the following 17 parameters is constructed for all matching points to calculate the stereo 3D coordinates:
[0028]
[0029]
[0030]
[0031] In one possible implementation, the binocular structured light imaging method based on the lifting platform calibration includes step S3:
[0032] The Gauss-Seidel iterative method is used to solve for the model parameters, obtaining the bi-objective directional transformation matrix H in the X, Y, and Z directions. x H y H z The iterative formula is as follows:
[0033]
[0034] In one possible implementation, the binocular structured light imaging method based on the lifting platform calibration includes step S4:
[0035] Define the absolute phase diagram in the X and Y directions as P ix P iy Given image point I(ux,uy), and projector width and height pw and ph, the formula for calculating the projector's pixel coordinates P(x,y) is as follows:
[0036] x0 = P ix (floor(uy),floor(ux))*(pw / 2π);
[0037] x1=P ix (ceil(uy),ceil(ux))*(pw / 2π);
[0038] x=x0+(x1-x0)*(ux-floor(ux));
[0039] Similarly, we can obtain: y = y0 + (y1 - y0) * (uy - floor(uy)).
[0040] In one possible implementation, the binocular structured light imaging method based on the lifting platform calibration includes step S5:
[0041] The homography matrix H of the left and right cameras can be obtained by solving the problem based on the standard pinhole camera model. cl H cr and the homography matrix H of the projector pl H pr The formula is as follows:
[0042]
[0043] Rewritten in the form AX = B, it is as follows:
[0044]
[0045] The coefficient X = (A) is obtained by direct solution. T A) -1 A T B.
[0046] In one possible implementation, the binocular structured light imaging method based on the lifting platform calibration includes step S7:
[0047] Joint H cl and H pl Find the 3D coordinates of the left camera, and similarly find the 3D coordinates of the right camera. The formula is as follows:
[0048] up = I(u,v)*(pw / 2π);
[0049] a1 = h c00 -h c20 *v、b1=h c01 -h c21 *v、c1=h c02 -h c22 *v;
[0050] a2=h c10 -h c20 *u、b2=h c21 -h c21 *u、c2=h c12 -h c22 *u;
[0051] a3 = h p00 -h p20 *up、b3=h p01 -h p21 *up、c3=h p02 -h p22 *up;
[0052] d1 = hc23 *vh c03 d2=h c23 *uh c13 d3 = h p23 *up-h p03 ;
[0053] A1 = (c2*c3*a1 - c1*c2*a3);
[0054] B1 = (c2*c3*b1 - c1*c2*b3);
[0055] C1 = (c2*c3*d1 - c1*c2*d3);
[0056] A2 = (c1*c3*a2 - c1*c2*a3);
[0057] B2 = (c1*c3*b2 - c1*c2*b3);
[0058] C2 = (c1*c3*d2 - c1*c2*d3);
[0059] X=(C1*B2-C2*B1) / (A1*B2-A2*B1);
[0060] Y = (C1 - A1 * X) / B1;
[0061] Z = (d3 - a3 * X - b3 * Y) / c3.
[0062] In one possible implementation, the binocular structured light imaging method based on the lifting platform calibration includes step S9:
[0063] The pixel coordinates corresponding to the 3D coordinates are (u, v), and V is defined as follows: min =I l (u,v), V max =I l (u, v+1), traversing I r For a point (u, vr) in the interval [v-30, v+30], when V... min = < I r (u,mid) <= V max Linear interpolation is then performed, using the following formula:
[0064] lr0=I l (u,v)-I r (u, mid-1);
[0065] lr1=I r (u,mid+1)-I r (u, mid-1);
[0066] ry=(mid-1)+((mid+1)*lr0-(mid-1)*lr0) / lr1.
[0067] In one possible implementation, the binocular structured light imaging method based on platform calibration includes step S10:
[0068] The matching points (L) obtained in the previous steps u =u,L v =v) and (R) u =u,R v Substitute (=ry) into the formula in step S2, and according to the bi-target transformation matrix H x H y H z Obtain the binocular 3D coordinates.
[0069] Secondly, the present invention provides a binocular structured light imaging system based on a lifting platform calibration, the system comprising:
[0070] The calibration module is used to calibrate the binocular camera and the projector separately.
[0071] The model building module is used to find matching points between the left and right cameras by constructing the same world coordinates, and to build a 17-parameter model for all matching points to calculate the stereo 3D coordinates;
[0072] The model iteration module is used to solve for the model parameters using the Gauss-Dessell iteration method to obtain the bi-objective definite transformation matrix H in the X, Y, and Z directions. x H y H z ;
[0073] The first pixel coordinate solving module is used to solve the absolute phase map of the calibration plate fringe pattern and find the corresponding projector pixel coordinates.
[0074] The matrix solving module is used to solve for the homography matrix H of the left and right cameras based on the standard pinhole camera model. cl H cr and the homography matrix H of the projector pl H pr ;
[0075] The phase map solving module is used to calculate the absolute phase map I of the left and right cameras for the imaged object. l I r ;
[0076] The camera 3D coordinate solving module is used to solve the simultaneous H... cl and H pl Find the 3D coordinates of the left camera, and similarly find the 3D coordinates of the right camera;
[0077] The second pixel coordinate solving module is used to solve for the left camera's 3D coordinates and H... cr Solve for the pixel coordinates on the right camera, and based on the right camera's 3D coordinates and H... cl Solve for the pixel coordinates on the corresponding left camera;
[0078] The matching point search module is used to search for the pixel coordinates corresponding to the 3D coordinates obtained in step S8 and the absolute phase map I. l I r Search for matching points between the left and right cameras within a fixed interval;
[0079] The binocular 3D coordinate solving module is used for S10, based on the matching points and the binocular positioning transformation matrix H. x H y H z Obtain the binocular 3D coordinates.
[0080] In one possible implementation, in the binocular structured light imaging system based on the lifting platform calibration, the calibration module is specifically used for:
[0081] Select a calibration plate and place it on the lifting platform;
[0082] Control the lifting platform to rise to different heights and collect images of the calibration plate at different heights;
[0083] At different altitudes, more than 6 sets of calibration board images were collected to calibrate the binocular camera;
[0084] At different heights, more than 6*24 calibration plate stripe images were collected in the X and Y directions to calibrate the projector.
[0085] In one possible implementation, in the binocular structured light imaging system based on the lifting platform calibration, the model building module is specifically used for:
[0086] By constructing the same world coordinate system, matching points (L) for the left and right cameras are found. u ,L v ) and (R u ,R v );
[0087] A model with the following 17 parameters is constructed for all matching points to calculate the stereo 3D coordinates:
[0088]
[0089]
[0090]
[0091] In one possible implementation, in the binocular structured light imaging system based on the lifting platform calibration, the model iteration module is specifically used for:
[0092] The Gauss-Seidel iterative method is used to solve for the model parameters, obtaining the bi-objective directional transformation matrix H in the X, Y, and Z directions. x H y H z The iterative formula is as follows:
[0093]
[0094] In one possible implementation, in the binocular structured light imaging system based on the lifting platform calibration, the first pixel coordinate solving module is specifically used for:
[0095] Define the absolute phase diagram in the X and Y directions as P ix P iy Given image point I(ux,uy), and projector width and height pw and ph, the formula for calculating the projector's pixel coordinates P(x,y) is as follows:
[0096] x0 = P ix (floor(uy),floor(ux))*(pw / 2π);
[0097] x1=P ix (ceil(uy),ceil(ux))*(pw / 2π);
[0098] x=x0+(x1-x0)*(ux-floor(ux));
[0099] Similarly, we can obtain: y = y0 + (y1 - y0) * (uy - floor(uy)).
[0100] In one possible implementation, in the binocular structured light imaging system based on the lifting platform calibration, the matrix solving module is specifically used for:
[0101] The homography matrix H of the left and right cameras can be obtained by solving the problem based on the standard pinhole camera model. cl H cr and the homography matrix H of the projector pl H pr The formula is as follows:
[0102]
[0103] Rewritten in the form AX = B, it is as follows:
[0104]
[0105] The coefficient X = (A) is obtained by direct solution.T A) -1 A T B.
[0106] In one possible implementation, in the binocular structured light imaging system based on the lifting platform calibration, the camera 3D coordinate solving module is specifically used for:
[0107] Joint H cl and H pl Find the 3D coordinates of the left camera, and similarly find the 3D coordinates of the right camera. The formula is as follows:
[0108] up = I(u,v)*(pw / 2π);
[0109] a1 = h c00 -h c20 *v、b1=h c01 -h c21 *v、c1=h c02 -h c22 *v;
[0110] a2=h c10 -h c20 *u、b2=h c21 -h c21 *u、c2=h c12 -h c22 *u;
[0111] a3 = h p00 -h p20 *up、b3=h p01 -h p21 *up、c3=h p02 -h p22 *up;
[0112] d1 = h c23 *vh c03 d2=h c23 *uh c13 d3 = h p23 *up-h p03 ;
[0113] A1 = (c2*c3*a1 - c1*c2*a3);
[0114] B1 = (c2*c3*b1 - c1*c2*b3);
[0115] C1 = (c2*c3*d1 - c1*c2*d3);
[0116] A2 = (c1*c3*a2 - c1*c2*a3);
[0117] B2 = (c1*c3*b2 - c1*c2*b3);
[0118] C2 = (c1*c3*d2 - c1*c2*d3);
[0119] X=(C1*B2-C2*B1) / (A1*B2-A2*B1);
[0120] Y = (C1 - A1 * X) / B1;
[0121] Z = (d3 - a3 * X - b3 * Y) / c3.
[0122] In one possible implementation, in the binocular structured light imaging system based on the lifting platform calibration, the matching point search module is specifically used for:
[0123] The pixel coordinates corresponding to the 3D coordinates are (u, v), and V is defined as follows: min =I l (u,v), V max =I l (u, v+1), traversing I r For a point (u, vr) in the interval [v-30, v+30], when V... min = < I r (u,mid) <= V max Linear interpolation is then performed, using the following formula:
[0124] lr0=I l (u,v)-I r (u, mid-1);
[0125] lr1=I r (u,mid+1)-I r (u, mid-1);
[0126] ry=(mid-1)+((mid+1)*lr0-(mid-1)*lr0) / lr1.
[0127] In one possible implementation, in the binocular structured light imaging system based on the lifting platform calibration, the binocular 3D coordinate solving module is specifically used for:
[0128] The matching points (L) obtained in the previous steps u =u,L v =v) and (R) u =u,R v Substitute (=ry) into the formula in step S2, and according to the bi-target transformation matrix H x H y H z Obtain the binocular 3D coordinates.
[0129] Thirdly, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the binocular structured light imaging method based on the lifting platform calibration described in the first aspect above.
[0130] Fourthly, the present invention provides a storage medium containing computer-executable instructions, which are executed by a computer processor to implement the binocular structured light imaging method based on lifting platform calibration as described in the first aspect above.
[0131] Compared with the prior art, the present invention has the following beneficial effects:
[0132] This invention provides a binocular structured light imaging method and system based on a lifting platform calibration. By providing a new model for calculating 3D coordinates and using an iterative method to solve the model, it can achieve high-precision and stable imaging results. At the same time, it improves the accuracy of searching for matching points by calculating matching points in reverse based on the monocular imaging results and the calibration model, and reduces the search time by eliminating the need to search the entire row each time. Attached Figure Description
[0133] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0134] Figure 1 This is a schematic flowchart of a binocular structured light imaging method based on lifting platform calibration provided in Embodiment 1 of the present invention;
[0135] Figure 2 This is a schematic diagram of the dual-target positioning error distribution mentioned in Embodiment 1 of the present invention;
[0136] Figure 3 This is a schematic diagram of the functional modules of a binocular structured light imaging method system based on lifting platform calibration provided in Embodiment 2 of the present invention;
[0137] Figure 4 This is a schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. Detailed Implementation
[0138] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Furthermore, those skilled in the art will understand that with technological development and the emergence of new scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0139] In the description of this application, it should be understood that, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. Furthermore, any terminology used is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.
[0140] Furthermore, to better illustrate this application, numerous specific details are provided in the following detailed embodiments. Those skilled in the art should understand that this application can be implemented without certain specific details. In some instances, methods, means, components, and circuits well-known to those skilled in the art have not been described in detail in order to highlight the main points of this application.
[0141] The technical solution of the present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0142] Example 1
[0143] In view of the aforementioned deficiencies in existing binocular structured light technology, the applicant, based on years of extensive practical experience and professional knowledge in the design and manufacturing of this technology, and in conjunction with the application of theoretical principles, has actively conducted research and innovation in order to create a technology that can overcome the shortcomings of existing technologies and make binocular structured light technology more practical. After continuous research, design, and repeated prototype production and improvement, this invention with real practical value has finally been created.
[0144] Please refer to the attached document. Figure 1 This is a flowchart illustrating a binocular structured light imaging method based on a lifting platform calibration, provided in Embodiment 1 of the present invention. This method is applicable to scenarios requiring binocular structured light technology for imaging. The method is executed by a binocular structured light imaging system based on lifting platform calibration, which can be implemented in software and / or hardware. The method specifically includes the following steps:
[0145] S1. Calibrate the binocular camera and projector respectively.
[0146] In the embodiments of this application, step S1 includes:
[0147] Select a calibration plate and place it on the lifting platform;
[0148] Control the lifting platform to rise to different heights and collect images of the calibration plate at different heights;
[0149] At different altitudes, more than 6 sets of calibration board images were collected to calibrate the binocular camera;
[0150] At different heights, more than 6*24 calibration plate stripe images were collected in the X and Y directions to calibrate the projector.
[0151] It should be noted that a calibration plate refers to a type of grid with patterned features of specific known physical dimensions (positions), used as a planar structure for calibrating camera parameters. Due to limitations in manufacturing precision, the physical dimensions (positions) of the features on the calibration plate deviate to some extent from the ideal design. This deviation includes positional deviations within the plane of the calibration plate, as well as deviations in the direction perpendicular to the ideal plane caused by the unevenness of the calibration plate.
[0152] S2. By constructing the same world coordinates, matching points between the left and right cameras are found, and a 17-parameter model is constructed for all matching points to calculate the stereo 3D coordinates.
[0153] In an embodiment of this application, step S2 includes:
[0154] By constructing the same world coordinate system, matching points (L) for the left and right cameras are found. u ,L v ) and (R u ,R v );
[0155] A model with the following 17 parameters is constructed for all matching points to calculate the stereo 3D coordinates:
[0156]
[0157]
[0158]
[0159] It should be noted that this step actually involves extracting the matching points (L) corresponding to the same world coordinate system of the left and right cameras respectively. u ,L v ) and (R u ,R v Then build the model.
[0160] S3. The Gauss-Dessell iterative method is used to solve for the model parameters to obtain the bi-objective transformation matrix H in the X, Y, and Z directions. x H yH z .
[0161] In an embodiment of this application, step S3 includes:
[0162] The Gauss-Seidel iterative method is used to solve for the model parameters, obtaining the bi-objective directional transformation matrix H in the X, Y, and Z directions. x H y H z The iterative formula is as follows:
[0163]
[0164] It should be noted that the Gauss-Seidel iteration is an iterative method in numerical linear algebra that can be used to find approximate values of solutions to systems of linear equations.
[0165] S4. Solve for the absolute phase diagram from the fringe pattern of the calibration plate and find the corresponding projector pixel coordinates.
[0166] In an embodiment of this application, step S4 includes:
[0167] Define the absolute phase diagram in the X and Y directions as P ix P iy Given image point I(ux,uy), and projector width and height pw and ph, the formula for calculating the projector's pixel coordinates P(x,y) is as follows:
[0168] x0 = P ix (floor(uy),floor(ux))*(pw / 2π);
[0169] x1=P ix (ceil(uy),ceil(ux))*(pw / 2π);
[0170] x=x0+(x1-x0)*(ux-floor(ux));
[0171] Similarly, we can obtain: y = y0 + (y1 - y0) * (uy - floor(uy)).
[0172] S5. The homography matrix H of the left and right cameras can be obtained by solving the problem based on the standard pinhole camera model. cl H cr and the homography matrix H of the projector pl H pr .
[0173] In an embodiment of this application, step S5 includes:
[0174] The homography matrix H of the left and right cameras can be obtained by solving the problem based on the standard pinhole camera model. cl H crand the homography matrix H of the projector pl H pr The formula is as follows:
[0175]
[0176] Rewritten in the form AX = B, it is as follows:
[0177]
[0178] The coefficient X = (A) is obtained by direct solution. T A) -1 A T B.
[0179] It should be noted that the pinhole model is a commonly used and effective model. It describes the relationship between a beam of light passing through a pinhole and the image projected onto the back of the pinhole.
[0180] S6. Calculate the absolute phase maps of the left and right cameras for the imaged object. l I r .
[0181] S7, Lianli H cl and H pl Find the 3D coordinates of the left camera, and similarly find the 3D coordinates of the right camera.
[0182] In an embodiment of this application, step S7 includes:
[0183] Joint H cl and H pl Find the 3D coordinates of the left camera, and similarly find the 3D coordinates of the right camera. The formula is as follows:
[0184] up = I(u,v)*(pw / 2π);
[0185] a1 = h c00 -h c20 *v、b1=h c01 -h c21 *v、c1=h c02 -h c22 *v;
[0186] a2=h c10 -h c20 *u、b2=h c21 -h c21 *u、c2=h c12 -h c22 *u;
[0187] a3 = h p00 -h p20 *up、b3=h p01 -hp21 *up、c3=h p02 -h p22 *up;
[0188] d1 = h c23 *vh c03 d2=h c23 *uh c13 d3 = h p23 *up-h p03 ;
[0189] A1 = (c2*c3*a1 - c1*c2*a3);
[0190] B1 = (c2*c3*b1 - c1*c2*b3);
[0191] C1 = (c2*c3*d1 - c1*c2*d3);
[0192] A2 = (c1*c3*a2 - c1*c2*a3);
[0193] B2 = (c1*c3*b2 - c1*c2*b3);
[0194] C2 = (c1*c3*d2 - c1*c2*d3);
[0195] X=(C1*B2-C2*B1) / (A1*B2-A2*B1);
[0196] Y = (C1 - A1 * X) / B1;
[0197] Z = (d3 - a3 * X - b3 * Y) / c3.
[0198] S8. Based on the 3D coordinates of the left camera and H cr Solve for the pixel coordinates on the right camera, and based on the right camera's 3D coordinates and H... cl Solve for the pixel coordinates on the corresponding left camera.
[0199] S9. Based on the pixel coordinates corresponding to the 3D coordinates obtained in step S8 and the absolute phase map I l I r Find the matching points of the left and right cameras within a fixed interval.
[0200] In an embodiment of this application, step S9 includes:
[0201] The pixel coordinates corresponding to the 3D coordinates are (u, v), and V is defined as follows: min =I l (u,v), V max =I l (u, v+1), traversing Ir For a point (u, vr) in the interval [v-30, v+30], when V... min = < I r (u,mid) <= V max Linear interpolation is then performed, using the following formula:
[0202] lr0=I l (u,v)-I r (u, mid-1);
[0203] lr1=I r (u,mid+1)-I r (u, mid-1);
[0204] ry=(mid-1)+((mid+1)*lr0-(mid-1)*lr0) / lr1.
[0205] S10. Based on the matching points and the bi-target transformation matrix H x H y H z Obtain the binocular 3D coordinates.
[0206] In an embodiment of this application, step S10 includes:
[0207] The matching points (L) obtained in the previous steps u =u,L v =v) and (R) u =u,R v Substitute (=ry) into the formula in step S2, and according to the bi-target transformation matrix H x H y H z The binocular 3D coordinates are obtained, and the binocular positioning error distribution diagram is shown below. Figure 2 As shown.
[0208] Although this application frequently uses terms such as binocular, structured light, model, calibration, and matrix, the possibility of using other terms is not excluded. These terms are used merely for the convenience of describing and explaining the essence of the invention; interpreting them as any additional limitation would contradict the spirit of the invention.
[0209] This invention provides a binocular structured light imaging system based on a lifting platform calibration. It defines and calculates a 3D coordinate model according to the actual situation, which improves the calibration accuracy and imaging effect. It calculates pixel coordinates in reverse based on the monocular imaging results as matching points, which improves the accuracy of matching point search. It eliminates the need to search the entire image and only needs to search for matching points near the corresponding pixel positions, which reduces the search time.
[0210] Example 2
[0211] Please refer to the attached document. Figure 3 This is a functional module diagram of a binocular structured light imaging system based on a lifting platform calibration provided in Embodiment 2 of the present invention. This system is suitable for executing the binocular structured light imaging method based on lifting platform calibration provided in this embodiment of the invention. Specifically, the system includes the following modules:
[0212] The calibration module 201 is used to calibrate the binocular camera and the projector respectively;
[0213] Model building module 202 is used to find matching points between the left and right cameras by building the same world coordinates, and to build a 17-parameter model for all matching points to calculate the stereo 3D coordinates;
[0214] Model iteration module 203 is used to solve the model parameters using the Gauss-Dessell iteration method to obtain the bi-objective definite transformation matrix H in the X, Y, and Z directions. x H y H z ;
[0215] The first pixel coordinate solving module 204 is used to solve the absolute phase map of the calibration plate fringe pattern and to find the corresponding projector pixel coordinates.
[0216] Matrix solving module 205 is used to solve for the homography matrix H of the left and right cameras based on the standard pinhole camera model. cl H cr and the homography matrix H of the projector pl H pr ;
[0217] Phase map solving module 206 is used to calculate the absolute phase map I of the left and right cameras for the imaged object. l I r ;
[0218] Camera 3D coordinate solving module 207, used to solve H... cl and H pl Find the 3D coordinates of the left camera, and similarly find the 3D coordinates of the right camera;
[0219] The second pixel coordinate solving module 208 is used to solve for the left camera's 3D coordinates and H... cr Solve for the pixel coordinates on the right camera, and based on the right camera's 3D coordinates and H... cl Solve for the pixel coordinates on the corresponding left camera;
[0220] Matching point search module 209 is used to match the pixel coordinates corresponding to the 3D coordinates obtained in step S8 and the absolute phase map I. l I r Search for matching points between the left and right cameras within a fixed interval;
[0221] The binocular 3D coordinate solving module 210 is used for S10, based on the matching points and the binocular positioning transformation matrix H. x H y H z Obtain the binocular 3D coordinates.
[0222] In another optional implementation, in the binocular structured light imaging system based on the lifting platform calibration, the calibration module 201 is specifically used for:
[0223] Select a calibration plate and place it on the lifting platform;
[0224] Control the lifting platform to rise to different heights and collect images of the calibration plate at different heights;
[0225] At different altitudes, more than 6 sets of calibration board images were collected to calibrate the binocular camera;
[0226] At different heights, more than 6*24 calibration plate stripe images were collected in the X and Y directions to calibrate the projector.
[0227] In another optional implementation, in the binocular structured light imaging system based on the lifting platform calibration, the model building module 202 is specifically used for:
[0228] By constructing the same world coordinate system, matching points (L) for the left and right cameras are found. u ,L v ) and (R u ,R v );
[0229] A model with the following 17 parameters is constructed for all matching points to calculate the stereo 3D coordinates:
[0230]
[0231]
[0232]
[0233] In another optional implementation, in the binocular structured light imaging system based on the lifting platform calibration, the model iteration module 203 is specifically used for:
[0234] The Gauss-Seidel iterative method is used to solve for the model parameters, obtaining the bi-objective directional transformation matrix H in the X, Y, and Z directions. x H y H z The iterative formula is as follows:
[0235]
[0236] In another optional implementation, in the binocular structured light imaging system based on the lifting platform calibration, the first pixel coordinate solving module 204 is specifically used for:
[0237] Define the absolute phase diagram in the X and Y directions as P ix P iy Given image point I(ux,uy), and projector width and height pw and ph, the formula for calculating the projector's pixel coordinates P(x,y) is as follows:
[0238] x0 = P ix (floor(uy),floor(ux))*(pw / 2π);
[0239] x1=P ix (ceil(uy),ceil(ux))*(pw / 2π);
[0240] x=x0+(x1-x0)*(ux-floor(ux));
[0241] Similarly, we can obtain: y = y0 + (y1 - y0) * (uy - floor(uy)).
[0242] In another optional implementation, in the binocular structured light imaging system based on the lifting platform calibration, the matrix solving module 205 is specifically used for:
[0243] The homography matrix H of the left and right cameras can be obtained by solving the problem based on the standard pinhole camera model. cl H cr and the homography matrix H of the projector pl H pr The formula is as follows:
[0244]
[0245] Rewritten in the form AX = B, it is as follows:
[0246]
[0247] The coefficient X = (A) is obtained by direct solution. T A) -1 A T B.
[0248] In another optional implementation, in the binocular structured light imaging system based on the lifting platform calibration, the camera 3D coordinate solving module 207 is specifically used for:
[0249] Joint H cl and H pl Find the 3D coordinates of the left camera, and similarly find the 3D coordinates of the right camera. The formula is as follows:
[0250] up=I(u,v)*(pw / 2π);
[0251] a1=h c00 -h c20 *v、b1=h c01 -h c21 *v、c1=h c02 -h c22 *v;
[0252] a2=h c10 -h c20 *u、b2=h c21 -h c21 *u、c2=h c12 -h c22 *u;
[0253] a3=h p00 -h p20 *up、b3=h p01 -h p21 *up、c3=h p02 -h p22 *up;
[0254] d1=h c23 *v-h c03 、d2=h c23 *u-h c13 、d3=h p23 *up-h p03 ;
[0255] A1=(c2*c3*a1-c1*c2*a3);
[0256] B1=(c2*c3*b1-c1*c2*b3);
[0257] C1=(c2*c3*d1-c1*c2*d3);
[0258] A2=(c1*c3*a2-c1*c2*a3);
[0259] B2=(c1*c3*b2-c1*c2*b3);
[0260] C2=(c1*c3*d2-c1*c2*d3);
[0261] X=(C1*B2-C2*B1) / (A1*B2-A2*B1);
[0262] Y=(C1-A1*X) / B1;
[0263] Z = (d3 - a3 * X - b3 * Y) / c3.
[0264] In another optional implementation, in the binocular structured light imaging system based on the lifting platform calibration, the matching point search module 209 is specifically used for:
[0265] The pixel coordinates corresponding to the 3D coordinates are (u, v), and V is defined as follows: min =I l (u,v), V max =I l (u, v+1), traversing I r For a point (u, vr) in the interval [v-30, v+30], when V... min = < I r (u,mid) <= V max Linear interpolation is then performed, using the following formula:
[0266] lr0=I l (u,v)-I r (u, mid-1);
[0267] lr1=I r (u,mid+1)-I r (u, mid-1);
[0268] ry=(mid-1)+((mid+1)*lr0-(mid-1)*lr0) / lr1.
[0269] In another optional implementation, in the binocular structured light imaging system based on the lifting platform calibration, the binocular 3D coordinate solving module 210 is specifically used for:
[0270] The matching points (L) obtained in the previous steps u =u,L v =v) and (R) u =u,R v Substitute (=ry) into the formula in step S2, and according to the bi-target transformation matrix H x H y H z Obtain the binocular 3D coordinates.
[0271] This invention provides a binocular structured light imaging system based on a lifting platform calibration. By providing a new model for calculating 3D coordinates and using an iterative method to solve the model, it can achieve high-precision and stable imaging results. At the same time, it improves the accuracy of searching for matching points by calculating matching points in reverse based on the monocular imaging results and the calibration model, and reduces the search time by eliminating the need to search the entire row each time.
[0272] The above system can execute the methods provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the methods.
[0273] Example 3
[0274] Figure 4 This is a schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. Figure 4 A block diagram of an exemplary computer device 12 suitable for implementing embodiments of the present invention is shown. Figure 4 The computer device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0275] like Figure 4 As shown, the computer device 12 is represented in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and a bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0276] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0277] Computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0278] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 4 Not shown; usually referred to as a "hard drive"). Although Figure 4Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0279] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0280] Computer device 12 can also communicate with one or more external devices 15 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with the computer device 12, and / or with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, computer device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18. It should be understood that, although... Figure 4 As not shown, it can be used in conjunction with computer device 12 with other hardware and / or software modules, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0281] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the binocular structured light imaging method based on lifting platform calibration provided in the embodiments of the present invention.
[0282] Example 4
[0283] Embodiment 4 of the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the binocular structured light imaging method based on lifting platform calibration as provided in all embodiments of the present application.
[0284] Any combination of one or more computer-readable media may be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
[0285] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0286] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0287] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0288] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of this application can be combined with each other, and any combination of features in different embodiments is also within the protection scope of this application. That is to say, the multiple embodiments described above can also be arbitrarily combined according to actual needs.
[0289] It should be noted that all the above figures are exemplary illustrations of this application and do not represent the actual size of the product. Furthermore, the dimensional proportions between the components in the figures are not intended to limit the actual product of this application.
[0290] Finally, it should be noted that the above descriptions are merely some embodiments and implementations of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. The scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A binocular structured light imaging method based on a lifting platform calibration, characterized in that, The method includes: S1. Calibrate the binocular camera and projector separately; S2. By constructing the same world coordinates, matching points between the left and right cameras are found, and a 17-parameter model is constructed for all matching points to calculate the stereo 3D coordinates. S3. The Gauss-Dessell iterative method is used to solve for the model parameters to obtain the bi-objective transformation matrices in the X, Y, and Z directions. , , ; S4. Solve for the absolute phase diagram from the fringe pattern of the calibration plate and find the corresponding projector pixel coordinates; S5. Obtain the homography matrix of the left and right cameras based on the standard pinhole camera model. , and projector homography matrix , ; S6. Calculate the absolute phase diagrams of the left and right cameras for the imaged object. , ; S7, Lianli and Find the 3D coordinates of the left camera, and similarly find the 3D coordinates of the right camera; S8, based on the 3D coordinates of the left camera and Solve for the corresponding pixel coordinates on the right camera, and based on the right camera's 3D coordinates and... Solve for the pixel coordinates on the corresponding left camera; S9. Based on the pixel coordinates and absolute phase map corresponding to the 3D coordinates obtained in step S8. , Search for matching points between the left and right cameras within a fixed interval; S10. Based on the matching points and the bi-target transformation matrix , , Obtain the binocular 3D coordinates.
2. The binocular structured light imaging method based on lifting platform calibration according to claim 1, characterized in that, Step S1 includes: Select a calibration plate and place it on the lifting platform; Control the lifting platform to rise to different heights and collect images of the calibration plate at different heights; At different altitudes, more than 6 sets of calibration board images were collected to calibrate the binocular camera; At different heights, more than 6*24 calibration plate stripe images were collected in the X and Y directions to calibrate the projector.
3. The binocular structured light imaging method based on lifting platform calibration according to claim 2, characterized in that, Step S2 includes: By constructing the same world coordinate system, matching points for the left and right cameras can be found. and ; A model with the following 17 parameters is constructed for all matching points to calculate the stereo 3D coordinates: ; ; 。 4. The binocular structured light imaging method based on lifting platform calibration according to claim 3, characterized in that, Step S3 includes: The Gauss-Seidel iterative method is used to solve for the model parameters, obtaining the bi-objective directional transformation matrices in the X, Y, and Z directions. , , The iterative formula is as follows: 。 5. The binocular structured light imaging method based on lifting platform calibration according to claim 4, characterized in that, Step S4 includes: Define the absolute phase diagrams in the X and Y directions as follows: , Image points Given the projector's width and height as pw and ph, obtain the projector's pixel coordinates. The calculation formula is as follows: ; ; ; Similarly, we can obtain: .
6. The binocular structured light imaging method based on lifting platform calibration according to claim 5, characterized in that, Step S5 includes: The homography matrices of the left and right cameras are obtained by solving the problem based on the standard pinhole camera model. , and projector homography matrix , The formula is as follows: ; Rewritten in the form AX=B, it is as follows: ; The coefficients are obtained by direct solution. .
7. The binocular structured light imaging method based on lifting platform calibration according to claim 6, characterized in that, Step S7 includes: United and Find the 3D coordinates of the left camera, and similarly find the 3D coordinates of the right camera. The formula is as follows: ; 、 、 ; 、 、 ; 、 、 ; 、 、 ; ; ; ; ; ; ; ; ; 。 8. The binocular structured light imaging method based on lifting platform calibration according to claim 7, characterized in that, Step S9 includes: The pixel coordinates corresponding to the 3D coordinates are (u, v), defined as follows: , traversal Points in When satisfied Linear interpolation is then performed, using the following formula: ; ; 。 9. The binocular structured light imaging method based on lifting platform calibration according to claim 8, characterized in that, Step S10 includes: The matching points obtained in the previous steps and Substitute into the formula in step S2, and based on the bi-target transformation matrix , , Obtain the binocular 3D coordinates.
10. A binocular structured light imaging system based on a lifting platform calibration, characterized in that, The system includes: The calibration module is used to calibrate the binocular camera and the projector separately. The model building module is used to find matching points between the left and right cameras by constructing the same world coordinates, and to build a 17-parameter model for all matching points to calculate the stereo 3D coordinates; The model iteration module is used to solve for the model parameters using the Gauss-Dessell iteration method to obtain the bi-objective definite transformation matrices in the X, Y, and Z directions. , , ; The first pixel coordinate solving module is used to solve the absolute phase map of the calibration plate fringe pattern and find the corresponding projector pixel coordinates. The matrix solving module is used to solve for the homography matrix of the left and right cameras based on the standard pinhole camera model. , and projector homography matrix , ; The phase map solving module is used to calculate the absolute phase maps of the left and right cameras for the imaged object. , ; The camera 3D coordinate solving module is used for simultaneous equation solving. and Find the 3D coordinates of the left camera, and similarly find the 3D coordinates of the right camera; The second pixel coordinate solving module is used to calculate the pixel coordinates based on the 3D coordinates of the left camera and... Solve for the corresponding pixel coordinates on the right camera, and based on the right camera's 3D coordinates and... Solve for the pixel coordinates on the corresponding left camera; The matching point search module is used to search for the pixel coordinates and absolute phase map corresponding to the 3D coordinates obtained in step S8. , Search for matching points between the left and right cameras within a fixed interval; The binocular 3D coordinate solving module is used for S10, based on the matching points and the binocular coordinate transformation matrix. , , Obtain the binocular 3D coordinates.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the binocular structured light imaging method based on the lifting platform calibration as described in any one of claims 1-9.
12. A storage medium containing computer-executable instructions, said computer-executable instructions being executed by a computer processor to implement the binocular structured light imaging method based on a lifting platform calibration as described in any one of claims 1-9.
Citation Information
Patent Citations
3D imaging method based on coded structured light and binocular vision
CN111028295A
Data fusion method based on structured light
CN114067056A