Large-depth-of-field three-dimensional measurement method based on electronic control lens
By using an electric adjustable focus lens to divide a large depth of field range and perform sub-depth of field calibration in fringe projection profilometry, the measurement error caused by the defocus of the camera and projector under large depth of field is solved, and high-precision and efficient three-dimensional measurement is achieved.
Patent Information
- Application Number
- CN202410393534.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-02
- Publication Date
- 2024-08-23
AI Technical Summary
In fringe projection profilometry, the large depth of field range of the object to be measured causes the camera and projector to lose focus, resulting in measurement accuracy errors. It is difficult for existing methods to effectively expand the depth of field and reduce noise and high-order harmonic errors.
Two types of electric adjustable focus lenses are used for cameras and projectors respectively. By dividing the large depth of field range into sub-depths of field, and adjusting the lens current value in each sub-depth of field to achieve focusing, three-dimensional measurements are performed in combination with calibration parameters, using low-step Digital phase shifting fringes and Gray code methods reduce phase errors.
It effectively solves the measurement errors caused by the defocus of cameras and projectors under large depth of field, achieves high-precision three-dimensional measurement, and significantly improves measurement efficiency and accuracy.
Smart Images

Figure CN118533093A
Abstract
Description
Technical Field
[0001] The invention relates to a large depth of field three-dimensional measurement method based on an electric-controlled lens, and belongs to the technical field of three-dimensional measurement. Background Art
[0002] Fringe Projection Profilometry (FPP) has been widely used in the field of industrial inspection due to its advantages of high speed, high precision and non-contact. However, it also has its own disadvantages. In FPP, when the object to be measured has large depth information, due to the limited depth of field of the measurement system, the defocus of the camera and the projector will have a huge impact in the measurement task with a large depth of field, resulting in serious measurement accuracy errors. The depth of field is extended by analyzing the measurement error in the large depth of field scene: First, in terms of the projector, the measurement error caused by the projector defocusing in the large depth of field three-dimensional measurement scene is mainly reflected in two aspects. One is that the severe reduction of the modulation degree of the stripes amplifies the influence of random noise, and the other is the phase error caused by high-order harmonics. Nowadays, it is a common way to improve the measurement efficiency by making the projector project low-step binary stripes to the object to be measured and then defocusing it to achieve the effect of projecting sinusoidal stripes. However, as the sinusoidality decreases, the phase error it brings will become more obvious. Although the impact can be significantly reduced by using high-step phase-shift stripes, the measurement efficiency will also be greatly reduced; from the camera side, it is the camera defocusing caused when the object to be measured exceeds the measurement depth of field. The emergence of electric adjustable focus lenses makes it possible to reduce the measurement errors caused by the defocusing of the camera and projector at the same time.
[0003] Therefore, a new three-dimensional measurement method with large depth of field based on an electronically controlled lens is needed to solve the above problems. Summary of the invention
[0004] The object of the present invention is to provide a three-dimensional measurement method with a large depth of field based on an electrically controlled lens, so as to solve the problems raised in the above-mentioned background technology.
[0005] A method for measuring a three-dimensional object with a large depth of field based on an electrically controlled lens is provided. The method adopts a three-dimensional measurement system with a large depth of field. The three-dimensional measurement system with a large depth of field comprises a first electrically adjustable focus lens, a second electrically adjustable focus lens, a camera and a projector. The camera and the projector are both facing an object to be measured. The first electrically adjustable focus lens is arranged in front of the camera, and the second electrically adjustable focus lens is arranged in front of the projector. The method comprises the following steps:
[0006] 1. Divide the large depth of field range to be measured into multiple sub-depths of field;
[0007] 2. In each sub-depth of field, the camera is focused on the focal plane by adjusting the first current value of the first electric adjustable focus lens, and the projector is focused on the focal plane by adjusting the second current value of the second electric adjustable focus lens in each sub-depth of field, and the camera parameters and the projector parameters are calibrated in each sub-depth of field;
[0008] 3. Use the focused projector to project onto the object to be measured, use the focused camera to locate the specific position of the object to be measured, and combine the calibrated camera parameters and projector parameters to achieve three-dimensional measurement under a large depth of field.
[0009] Furthermore, in step 2, the focusing of the focal plane of the camera is completed by adjusting the first current value of the first electrically adjustable focus lens, specifically: when the first current value makes the gradient value of the image maximum, the focusing of the camera on the focal plane is completed.
[0010] Furthermore, the focus of the camera on the focal plane in step 2 is obtained by the following formula:
[0011]
[0012]
[0013] Among them, η(i) is the focal length corresponding to the i-th image, η * is the image at the focus position, I i is the i-th image taken continuously by the camera, G i is the gradient of the i-th image, and (u,v) is the focus position.
[0014] Furthermore, the phase obtained by solving the fifteen-step phase-shifting stripes in step two is used as the ideal first wrapping phase that does not contain high-order harmonic errors, and the phase obtained by solving the three-step phase-shifting stripes is the true second wrapping phase. The difference between the first wrapping phase and the second wrapping phase is used to determine the sinusoidality of the stripes, thereby completing the focusing of the projector on the focal plane.
[0015] Furthermore, in step 2, the following formula is used to determine the quality of the fringe sinusoidality, thereby completing the focusing of the projector on the focal plane:
[0016]
[0017] in, represents the wrapped phase obtained by solving the fifteen-step phase-shifted fringe. represents the wrapped phase obtained by three-step phase-shift fringe solution.
[0018] Furthermore, in step 1, the large depth of field range to be measured is divided into three sub-depths of field, denoted as DOF1, DOF2 and DOF3.
[0019] Furthermore, in step 2, after the calibration of the camera parameters and the projector parameters is completed, the calibrated camera parameters of each sub-depth of field form a one-to-one correspondence with the current value of the first electric adjustable focus lens, and the calibrated projector parameters of each sub-depth of field form a one-to-one correspondence with the current value of the second electric adjustable focus lens.
[0020] Furthermore, in step 2, the camera parameters and projector parameters are calibrated by minimizing the following equation:
[0021]
[0022] Among them, n ca For different pictures, p ca is the number of feature points on the calibration plate in each image, is the projector coordinate corresponding to the j-th feature point coordinate of the calibration plate on the i-th image, and T i p They are the intrinsic parameter matrix, rotation matrix and translation matrix of the projector respectively. is an object point P in three-dimensional space ij The two-dimensional projector coordinates are obtained after the projector's internal and external parameter matrices are transformed. c1 and c2 are the first-order and second-order distortion coefficients. and is the distortion parameter of the projector, is the coordinate of the jth feature point of the calibration plate on the i-th image, P ij is the three-dimensional coordinate of the jth feature point of the calibration plate on the i-th image, P ij The two-dimensional coordinates obtained by transforming the external parameter matrix and the internal parameter matrix are: i and T i is the rotation matrix and translation matrix in the external parameter matrix corresponding to the i-th picture.
[0023] Furthermore, in step 3, the specific position of the object to be measured is obtained by solving the following formula:
[0024]
[0025] in
[0026]
[0027] M cis the product of the internal parameter matrix and the external parameter matrix of the camera and projector, M p is the product of the internal parameter matrix and the external parameter matrix of the projector, P(X w ,Y w ,Z w ) is the three-dimensional coordinate of the object to be measured, (u c ,v c ) is the coordinate of the object to be measured in the two-dimensional pixel coordinate system of the camera, (u p ,v p ) is the coordinate of the object to be measured in the two-dimensional pixel coordinate system of the projector.
[0028] Furthermore, in step 3, the following formula is used to achieve three-dimensional measurement under a large depth of field:
[0029]
[0030] Among them, Φ w and Φ h are the absolute phase diagrams of the fringes in the horizontal and vertical directions projected by the projector, respectively, w and f h are the fringe frequencies in the horizontal and vertical directions of the projector, w and h are the resolutions in the horizontal and vertical directions of the projector, respectively. c ,v c ) is the coordinate of the object to be measured in the two-dimensional pixel coordinate system of the camera, (u p ,v p ) is the coordinate of the object to be measured in the two-dimensional pixel coordinate system of the projector.
[0031] Beneficial effect: The large depth of field three-dimensional measurement method based on the electric-controlled lens of the present invention divides the measurement task of the large depth of field into several sub-depths of field, and applies the electric adjustable focus lens to the projector and the camera at the same time to realize the three-dimensional measurement under the large depth of field through the phase-shifting stripes with low steps, effectively solves the measurement influence caused by the defocusing of the camera and the projector under the large depth of field, and realizes high-precision three-dimensional measurement under the large depth of field. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 Schematic diagram of the camera imaging process Figure 1 ;
[0033] Figure 2 Schematic diagram of the camera imaging process Figure 2 ;
[0034] Figure 3 To simulate the effect of camera defocus on 3D measurement under data;
[0035] Figure 4 Schematic diagram of the effect of depth on projector defocus;
[0036] Figure 5 This is the schematic diagram of a large depth of field three-dimensional measurement system based on an electronically controlled lens;
[0037] Figure 6 This is a physical picture of the three-dimensional measurement system with a large depth of field;
[0038] Figure 7 Schematic diagram of CMOS camera and optical fixed focus lens;
[0039] Figure 8 This is a schematic diagram of the components of the Lightcrafter 4500 DMD projector;
[0040] Fig. 9 This is a schematic diagram of an electrically adjustable focus lens and its driver:
[0041] Fig.10 This is a diagram of the camera focusing process;
[0042] Fig.11 Projector focusing process diagram;
[0043] Fig.12 Current value and phase error relationship curve;
[0044] Fig.13 Physical picture of the dot calibration plate;
[0045] Fig.14 Calibration plate image with structured light information;
[0046] Fig.15 Calibration plate image with structured light information;
[0047] Fig.16 Reprojection error map of camera and projector
[0048] Fig.17 The reconstruction effects of different methods at sub-depth of field 1;
[0049] Fig.18 The reconstruction effects of different methods at two sub-depths;
[0050] Fig.19 The reconstruction effects of different methods at three sub-depths;
[0051] Fig. 20 The relationship between the four coordinate systems of the pinhole imaging model;
[0052] Fig.21 This is the principle diagram of binocular stereo vision method;
[0053] Fig. 22 Schematic diagram of the fringe projection profilometry measurement system
[0054] Fig.23It is the gray value distribution of the 200th row with four-step phase shift;
[0055] Fig.24 is the phase value of the wrapped phase in row 200;
[0056] Fig.25 This is the phase unwrapping principle diagram;
[0057] Fig.26 This is the principle diagram of dual-frequency heterodyne phase unwrapping;
[0058] Fig. 27 Schematic diagram of phase unwrapping using Gray code: (a) Gray code diagram; (b) schematic diagram of phase unwrapping. DETAILED DESCRIPTION
[0059] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, various equivalent forms of modifications to the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.
[0060] 0. Principle of 3D reconstruction using binocular stereo vision
[0061] 0.1 Equipment calibration
[0062] The measurement system realizes 3D reconstruction through the mapping relationship between pixel coordinates and world coordinates, and the calibration of the device is the process of fitting and solving the parameters in the mapping relationship. We first have a deep understanding of the calibration process of the 3D measurement system by studying the pinhole imaging model. The physical core meaning of the pinhole imaging model is that the 3D coordinates are converted into 2D coordinates through the world coordinate system, camera coordinate system, image coordinate system and pixel coordinate system. The corresponding relationship is as follows: Fig. 20 shown.
[0063] For any point P(X w ,Y w ,Z w ), after the conversion of the four coordinate systems in the pinhole imaging model, its two-dimensional pixel coordinates can be expressed as (u, v), and the calculation process is as follows. Since point P is three-dimensional data in both the camera coordinate system and the world coordinate system, the coordinates (X w ,Y w ,Z w ) and coordinates (X c ,Y c ,Z c ) There are only rotation transformation and translation transformation between them, and the relationship between them is as follows:
[0064]
[0065] Among them, R is a 3×3 dimensional orthogonal rotation matrix, and T is a 3×1 dimensional translation matrix. The camera coordinate system represents three-dimensional data, while the image coordinate system represents two-dimensional data. The conversion between the two is the transformation from three-dimensional information to two-dimensional information. The coordinates of point P in the camera coordinate system (X c ,Y c ,Z c ) and the coordinates (x, y) in the image coordinate system have the following relationship:
[0066]
[0067] Where f represents the focal length of the camera. Since both the image coordinate system and the pixel coordinate system represent two-dimensional data, the following relationship exists between the coordinates (x, y) of point P in the image coordinate system and the coordinates (u, v) in the pixel coordinate system:
[0068]
[0069] Among them, dx and dy represent the size of the unit pixel, and (u0, v0) represents the position of the origin in the image coordinate system, that is, the projection of the optical center to the pixel coordinate system.
[0070] By combining the above formulas, we can get the coordinates of the actual object point in the world coordinate system (X w ,Y w ,Z w ) is projected to the coordinates (u,v) in the pixel coordinate system. The process is as follows:
[0071]
[0072] where s c is the normalization coefficient, and γ is the non-perpendicular factor between the horizontal and vertical axes of the camera, which is usually 0. The parameters in M1, such as focal length, pixel size, and principal point coordinates, can only be determined by the internal structure of the camera, so M1 is called the internal parameter matrix of the camera. The rotation matrix and translation matrix in M2 are determined by the relationship between the camera coordinate system and the world coordinate system, so M2 is called the external parameter matrix of the camera. M1M2 is called the projection matrix.
[0073] In order to match the coordinates of the object points in the objective three-dimensional world with the coordinate points captured by the camera, the above-mentioned intrinsic matrix and extrinsic matrix are needed. The camera calibration process is the process of solving the above parameters. Camera calibration methods can currently be divided into two types: one is calibration based on calibration blocks and the other is self-calibration algorithms. The calibration algorithm based on calibration blocks, as the name implies, is to achieve camera calibration by letting the camera shoot the calibration blocks made by the staff. This method has high accuracy and is currently the most commonly used camera calibration method. The latter does not require the use of calibration blocks. Generally speaking, it only needs to move the camera in a static environment, and the camera's intrinsic matrix and extrinsic matrix can be obtained through the correspondence between images. Although this calibration method is relatively simple in operation, it is difficult to obtain a reliable result every time because there are more parameters to be estimated. However, before 1998, this calibration method based on calibration blocks was almost only used in laboratories, because the calibration blocks at that time were generally composed of two or three planes orthogonal to each other, and the configuration cost of these devices was extremely expensive. In this case, Zhang Zhengyou proposed a camera calibration method based on a calibration plane, which extended camera calibration to ordinary desktop cameras. Zhang's calibration method has been applied to various fields due to its advantages of simple equipment, convenient operation, and high robustness. The subsequent parameter calibration of the three-dimensional measurement system of the present invention is completed by Zhang's calibration method.
[0074] Zhang's calibration method uses a plane calibration plate with many feature points, and the parameters of the calibration plate are known. Usually, the calibration plate has a checkerboard or dot calibration plate. During the calibration process, the calibration plate is repeatedly moved to change its spatial position, and the two-dimensional coordinates of its feature points are extracted, and the spatial coordinate system Z of the calibration plate is set. w = 0 position, combined with the known parameters of the calibration plate, the three-dimensional coordinates of each feature point in the world coordinate system can be obtained. According to formula (0.4), the following relationship can be obtained:
[0075]
[0076] Among them, r1 and r2 are the first and second columns of the rotation matrix respectively, and H is the homography matrix, which is obtained by multiplying the intrinsic parameter matrix by the extrinsic parameter matrix.
[0077] Zhang's calibration method mainly includes solving the homography matrix H and the intrinsic parameter matrix, calculating the extrinsic parameter matrix, maximum likelihood estimation optimization, lens distortion estimation and other processes.
[0078] (1) Solve the homography matrix H, the intrinsic parameter matrix and the extrinsic parameter matrix
[0079] From formula (0.5), we can get:
[0080]
[0081] Since the degree of freedom of the homography matrix is 8, only four sets of feature points are required on the calibration plate to solve the homography matrix.
[0082] The internal parameter matrix and the external parameter matrix can be obtained by decomposing the homography matrix H. From the above discussion, it can be concluded that r1 and r2 are mutually orthogonal column vectors with equal magnitude, that is, they satisfy:
[0083]
[0084] And because H=M1[r1 r2 T], we can get:
[0085]
[0086] At this point, we define a matrix B as follows:
[0087]
[0088] From the above, we can see that B is a symmetric matrix, so B has 6 valid elements. We define these 6 elements as a vector b:
[0089] b=[B 11 B 12 B 13 B 22 B 23 B 33 ] T (0.10)
[0090] It can be deduced that:
[0091]
[0092] In the above formula, v ij =[h 1i h 1j h 1i h 2j +h 2i h 1j h 2i h 2j h 1i h 3j +h 3i h 1j h 2i h 3j +h 3i h 2j h 3i h 3j ], where h ij is the element of the i-th row and j-th column of the homography matrix. The following formula can be obtained through the constraints:
[0093]
[0094] From the above formula, we can know that only with three or more calibration plate images can B be solved, and finally the internal parameter matrix M1 is solved by the Cholesky decomposition method. Due to the characteristics of the homography matrix H itself, the external parameter matrix M2 can also be obtained at the same time.
[0095] (2) Maximum Likelihood Estimation
[0096] The above derivation process is based on an ideal model. It should be noted that noise and other problems will inevitably be introduced during the experiment. Therefore, we often select calibration plates with more than 4 sets of feature points, and the placement of calibration plates will also be more than 3 sets. Finally, the maximum likelihood estimation is used to optimize the results. ca , the number of feature points on the calibration plate in each image is p ca , the coordinates of the jth feature point of the calibration plate on the i-th image are The corresponding three-dimensional coordinates are P ij , P ij The two-dimensional coordinates obtained by transforming the external parameter matrix and the internal parameter matrix are: Where R i and T i is the rotation matrix and translation matrix in the external parameter matrix corresponding to the i-th picture. Then the optimization function is as follows:
[0097]
[0098] (3) Radial distortion estimation
[0099] Usually, the above process will be different from the real scene, which is mainly caused by the processing and assembly errors of the camera optical system. The camera lens cannot fully satisfy the relationship between the object and the image to form a similar triangle. This effect is called lens distortion
[49] . Lens distortion has radial distortion and tangential distortion. Zhang's calibration method only discusses radial distortion, which has a greater impact on the experimental results. This is mainly due to the larger angle of refraction of light at the edge of the lens, which leads to imaging distortion. The pixel coordinate offset caused by radial distortion is usually corrected by the second-order coefficient. For the ideal pixel coordinate (u, v), its actual coordinate in the pixel coordinate system is It can be expressed by the following formula:
[0100]
[0101] Among them, c1 and c2 are the first-order and second-order distortion coefficients. Adding the influence of camera distortion to the calibration process, a new optimization function can be obtained:
[0102]
[0103] For a 3D measurement system consisting of a single camera and a projector, calibration of the projector is also a necessary step. The most commonly used method is the one proposed by Zhang et al. from Purdue University. This method regards the projector as an inverse camera model, so it is also applicable to the pinhole imaging model and Zhang's calibration method for calibration. The projector is given the ability to "see" by projecting a special coded pattern when the position of the calibration plate is changed. The main steps are:
[0104] (1) Select a suitable angle to build the projector and camera, and fix them to ensure the relative stillness of the entire system.
[0105] (2) Let the projector project a coded pattern that has been prepared by the computer in advance: a set of horizontal and vertical stripes, and trigger the camera to shoot synchronously
[0106] (3) Change the position of the calibration plate and repeat step 2 to complete 20 to 30 sets of photographs of calibration plates in different positions.
[0107] (4) The data captured by the camera is processed to obtain the camera's internal and external parameter matrix and save the feature point information on the calibration plate at each position.
[0108] (5) Decode the coded pattern and calculate its phase information.
[0109] (6) Based on the feature point information and phase information, the two-dimensional coordinate values of the feature points on the pixel plane of the projector are obtained, and then the internal and external parameters of the projector are calculated through Zhang's calibration method.
[0110] Finally, the system calibration is essentially to use the geometric relationship of the two devices at different viewing angles to solve more accurate parameters using a more reasonable optimization function. Based on formula (0.13), the optimization parameters are:
[0111]
[0112] in, The projector coordinates corresponding to the j-th feature point coordinates of the calibration plate on the i-th image, and T i p are the intrinsic parameter matrix, rotation matrix and translation matrix of the projector, and is the distortion parameter of the projector, is an object point P in three-dimensional space ij The two-dimensional projector coordinates are obtained after transforming the projector's intrinsic parameter matrix and extrinsic parameter matrix.
[0113] 0.2 3D measurement
[0114] In the stereo vision method, a point in the three-dimensional space can obtain three-dimensional information through its two-dimensional coordinates mapped in the camera coordinate system of two cameras combined with the device calibration parameters. The principle is as follows Fig.21 As shown, O l and O r They represent the optical centers of the left and right cameras respectively. For any point P in three-dimensional space, the projection point of the left camera is P l , the projection point of the right camera is P r If only for P l or P r , we cannot determine that point P is on the line OP l or OP r The specific position on the l and P r When , we can uniquely determine the position of point P in three-dimensional space.
[0115] In fringe projection profilometry, the process is similar. We replace one of the cameras with a projector and w ,Y w ,Z w ) whose coordinates mapped to the two-dimensional pixel coordinate system of the camera and projector are (u c ,v c ) and (u p ,v p ). Combining the internal and external parameters of the equipment obtained after calibration, the following formula can be obtained from formula (0.5):
[0116]
[0117]
[0118] Among them, M c With M p are the products of the internal parameter matrix and the external parameter matrix of the camera and projector respectively. Combining equations (0.17) and (0.18), we can get the following four linear equations:
[0119]
[0120] The above formula contains four equations, but there are only three unknowns, so there are only three independent equations, which we can definitely solve. However, in our actual experimental process, industrial cameras will inevitably bring noise, so we can use the least squares method to obtain the optimal solution. In the actual measurement process, in order to improve efficiency, we often only let the projector project stripes in one direction, horizontally or vertically. In this way, the above formula will only contain three linear equations, but the only solution can also be calculated.
[0121] 1. Image correspondence
[0122] In binocular stereo vision, it is particularly important to establish the image correspondence between the two devices, which determines whether we can accurately achieve 3D reconstruction. Fringe projection profilometry usually consists of a projector and a camera. The system diagram is as follows: Fig. 22 During the measurement process, a projector projects sinusoidal fringes onto the object to be measured, and the camera captures the fringes information modulated by the object, which is demodulated by a computer to obtain the phase information, and then the projector coordinates corresponding to the point are calculated.
[0123] 1.1 Fringe Projection Profilometry
[0124] 1.1.1 Phase recovery
[0125] In fringe projection profilometry, the most commonly used phase recovery method is phase shift profilometry based on the time domain. It uses a projector to project a number of pre-designed sinusoidal fringes with different phase shifts on the object to be measured, thereby encoding it in the time domain. Its sinusoidal graph can be expressed by the following formula:
[0126]
[0127] In the formula, I n represents the light intensity distribution of the nth fringe image, (x, y) is the pixel coordinate, a represents the background light intensity at that point, b represents the modulation degree of the fringe, represents the phase value to be solved, δ n =2π(n-1) / N represents the phase shift number, and N represents the phase shift step number.
[0128] From the above, we can see that a, b and All are unknowns, so at least three phase shifts are needed to solve the phase value we need. That is, N ≥ 3. The following formula can be used to calculate the phase value of N fringe patterns:
[0129]
[0130] We take four-step phase shift as an example to discuss the next step, that is, N = 4. At this time, the gray value distribution of the stripes is as follows: Fig.23 As shown:
[0131] The expressions of the four fringe patterns are:
[0132]
[0133] After phase recovery, we get the wrapped phase. We randomly select one row to display it, such as Fig.24 shown.
[0134] 1.1.2 Phase Unwrapping
[0135] The phase value of the phase image after phase recovery is wrapped between (-π, π], which is determined by equation 0.21. Due to the particularity of the inverse tangent function, the phase we get cannot be directly applied to the subsequent 3D reconstruction. Therefore, we need to unfold the wrapped phase to make it unique, so as to achieve accurate correspondence between the camera and projector coordinates. The principle is as follows: Fig.25 As shown:
[0136] The basic principle of phase unwrapping is to compare the wrapped phases of adjacent pixels. When the phase difference exceeds the range of (-π,π], 2π is added or subtracted from the latter until the obtained phase is continuous. In this way, the phase unwrapping is completed. The process can be expressed as follows:
[0137]
[0138] Where Φ is the absolute phase, is the wrapping phase, k is the order of the fringe, generally an integer.
[0139] At present, phase unwrapping is generally divided into two categories according to different principles: spatial phase unwrapping and time domain phase unwrapping. As a time domain phase unwrapping method, this type of method projects multiple pictures on the object to be tested through a projection device and shoots them, encodes each pixel of the camera in the time domain, and then calculates the fringe order required for phase unwrapping. This type of method encodes the pixels independently so that they are not interfered by the surrounding pixels during the phase unwrapping process. Therefore, it has high robustness. The time domain phase unwrapping method has therefore become the most commonly used phase unwrapping method in fringe projection profilometry. Next, for time domain phase unwrapping, the two most classic methods will be introduced: multi-frequency phase unwrapping method and Gray code phase unwrapping method.
[0140] The multi-frequency phase unwrapping method projects multiple sets of sinusoidal fringes of specific frequencies onto the object to be tested. Each sinusoidal fringe of different frequencies can be used to obtain a set of wrapped phase diagrams through phase recovery. Through the specific relationship between frequencies, the wrapped phase diagram of each frequency is unfolded to finally obtain the absolute phase diagram of the highest frequency fringe diagram. Taking the dual-frequency heterodyne method as an example, assuming that there are wrapped phase diagrams obtained from fringes of different frequencies and Their corresponding frequencies are λ1 and λ2. and By performing subtraction, we can obtain a phase map Φ covering the entire field of view and with a lower frequency. 12 , its principle is as follows Fig.26 As shown:
[0141] and Φ 12 The relationship can be expressed by the following formula:
[0142]
[0143] where Φ 12 The frequency λ 12 It can be expressed by the following formula:
[0144]
[0145] From the above formula, we can see that in order to perform unambiguous phase unwrapping in the entire field of view, it is necessary to select appropriate λ1 and λ2 so that λ 12 =1, that is, in the entire field of view Φ 12 Monotonically increasing.
[0146] Finally, according to Φ 12 The relationship with the wrapped phase gives the absolute phase:
[0147]
[0148] in Indicates a rounding operation.
[0149] Gray code phase unwrapping is a typical time domain phase unwrapping method. Its encoding method has good noise resistance and robustness. Due to its good decoding reliability, it is widely used in the field of fringe projection profilometry. The subsequent experiments of this invention also use the Gray code phase unwrapping method. The Gray code method is further introduced below.
[0150] Gray code phase unwrapping method requires the projector to project m coded binary images onto the object to be measured. The wrapped phase obtained after the camera shoots can be divided into 2 m regions, each region has its own encoding value different from other regions. Assume that the binary image of the projector is G i, i=1,2,...,m, then the code information of each pixel can be expressed as follows:
[0151]
[0152] Here we take the 3-bit Gray code as an example. The Gray code images G1, G2 and G3 projected by the projector are as follows: Fig. 27 As shown in part a, Fig. 27 Part b is a schematic diagram of phase unfolding using a 3-bit Gray code. The three Gray code images can divide the wrapped phase image with a frequency of 8 into 8 regions, each of which has its own independent encoding value. Through the decoding principle of Gray code, we can obtain the corresponding fringe order of each region, thereby completing the unfolding of the wrapped phase. It is worth mentioning that the Gray code image captured by the camera needs to be binarized to determine whether the encoding value is 0 or 1. During the binarization process, ambiguity is easily generated at the intersection of the encoding of 0 and 1, causing decoding errors. Median filtering can usually be used to solve this problem.
[0153] The absolute phase diagram of the horizontal and vertical stripes projected by the projector is obtained by adding the above phase shift method to the Gray code method, which is called Φ w and Φ h , let the fringe frequency of the projectors in these two directions be f w and f h , the resolution of the projector in the corresponding direction is w and h. Then for a feature point (u c ,v c ), which is expressed in the projector's pixel coordinate system as follows:
[0154]
[0155] Embodiment 1:
[0156] 1 Error analysis in large depth of field scenes
[0157] 1.1 Error analysis caused by camera defocus
[0158] As an important part of the 3D measurement system, the camera is responsible for receiving the stripes modulated by the object. The projector projects the coded pattern to the object to be measured, and the image is reflected by the object and formed on the focal plane of the camera. However, in the experiment of the large depth of field scene, the working distance and the depth of field of the camera are fixed after the entire measurement system is built. For objects beyond its depth of field, it is difficult for the camera to present a clear image, resulting in image distortion, which affects the system's accurate measurement of the object to be measured. Assuming that the camera sensor is in focus, it will only receive light reflected from a point on the object plane, such as Figure 1However, once the camera is out of focus, the reflected light from a point on the object plane will be received by a circular area on the image plane, as shown in Figure 2 shown.
[0159] Generally speaking, we can use the Gaussian function to model the camera defocus model, that is, convolve the camera's clear focused image with a Gaussian filter to simulate the camera's defocus. The different degrees of camera defocus can be simulated by changing the standard deviation of the Gaussian function. For a point (x, y) on a two-dimensional image, the convolution process of the Gaussian filter can be expressed as follows:
[64] :
[0160]
[0161] Where σ is the standard deviation of the Gaussian filter, is the coordinate of its center point. From this formula, we can see that the standard deviation is proportional to the degree of defocus of the camera. Therefore, combined with formula (1), when we define the window size of the Gaussian filter as (2w+1)×(2h+1), the blurred image can be expressed as:
[0162]
[0163] Then the formula for the wrapped phase can be rewritten as follows:
[0164]
[0165] If we assume that the ideal wrapping phase is Then, when the effect of camera defocus is taken into account, the phase error can be expressed as follows:
[0166]
[0167] In order to further and more clearly demonstrate the error caused by camera defocus in the previous principle analysis, we use simulated data to perform experimental explanations and provide quantitative data to assist in verification. In the experiment, we selected a standard sphere with a diameter of 50.8 mm and reconstructed it using a five-step phase shift and Gray code method. During this period, we convolved the captured focused fringe pattern with Gaussian filters of different parameter sizes to simulate different degrees of camera defocus, and then reflected the impact of different degrees of camera defocus on the measurement by fitting the radius error of the standard sphere. Figure 3 (a) is the focused image of the standard sphere with a phase shift of 0 taken when the camera is focused. Figure 3 (b) to Figure 3 (f) shows the simulated blurred images after the focused image is convolved with Gaussian filters with window sizes w = h = 9, 19, 29, 39, and 49. The measurement results of the standard ball are shown in Figure 3 (g) shows that the horizontal axis represents the window size of the Gaussian filter, and the vertical axis represents the measurement error of the diameter obtained by fitting after the 3D reconstruction of the standard sphere. As shown in the figure, when the window size is less than 19, the defocus of the camera for objects such as standard parts will not cause measurement errors, and even make the 3D data smoother and improve the accuracy. When the window size is 33, the image is obviously distorted, and the measurement error increases exponentially, all exceeding 0.2mm.
[0168] 1.2 Error analysis caused by projector defocus
[0169] In the field of fringe projection profilometry, in order to ensure high efficiency and high precision, the system is often built using a projector with DMD chip technology. DMD is composed of many tiny lenses, each of which represents a pixel. By applying different signals, the flip angle of the lens on the DMD can be controlled, but there are only two flip angles. When encountering an eight-bit coding image, multiple flips are required to change the output light intensity. Based on this, the working efficiency of the projector will be greatly reduced, thereby affecting the measurement speed. Therefore, Lei et al. from Iowa State University proposed to project a binary fringe image to the object to be measured, and then adjust the focal length of the projector to make it slightly out of focus, so as to simulate the sinusoidal fringe to make the binary fringe image obtain a better sinusoidal property. In this process, the DMD is only flipped once. However, this method cannot accurately control the defocus amount, so that the fringe always contains high-order harmonics. This phenomenon is more obvious in scenes with a large depth of field. Although it can be effectively improved by binary fringe with a high number of steps, it cannot avoid the burden on the efficiency of three-dimensional measurement. On the other hand, in scenes with large depth of field, the defocus of the projector will also cause a significant decrease in the fringe modulation, thereby amplifying the impact of random noise on the measurement. Next, we will fully model the impact of these two errors on the measurement, and we can get the binary fringe expression cast by the projector:
[0170]
[0171] Where E represents the maximum value of the fringe, s = 2π / N, and N is the number of phase shift steps.
[0172] The defocus of the projector can be approximated by Gaussian blur, because the convolution in the spatial domain is equivalent to the multiplication in the frequency domain, and the defocused stripes can be expressed as follows:
[0173]
[0174] Among them, I d Binary fringe diagram representing defocus, F[·] and F -1 [·] denotes Fourier transform and inverse Fourier transform, σ drepresents the defocus kernel of the projector system, and T represents the period of the binary fringes. This term can be called the modulation attenuation coefficient. Obviously, as the defocus of the projector increases, the modulation of the stripes will decrease significantly. d Combination Figure 4 It can be expressed by the following formula:
[0175]
[0176] Where k is a constant determined by the projector parameters, R(z) is the radius of the blurred spot on the projector defocus plane, D is the diameter of the aperture, z represents the object distance, and z f is the focal length, v is the distance from the DMD chip to the projector lens, and r is the radius of a unit on the DMD chip
[0177] Substituting the modulation attenuation coefficient into equation (3.6), we can get the expression of the defocused fringes:
[0178]
[0179] During the experiment, the image captured by the camera is determined by the defocused binary fringes, the reflection of the object, the ambient light and the response of the camera. The captured fringe image can be expressed by the following formula:
[0180]
[0181] Among them, a0 represents the ambient light intensity, Δa is the random noise of the camera, which can be expressed as σ n is the variance of random noise, a1 and a2 are the DC component and harmonic component respectively.
[0182] Furthermore, we can derive the formula for phase error as follows:
[0183]
[0184] in represents the phase error, represents the phase calculated from the acquired diagram, is the ideal phase. Substituting equation (3.9) into equation (3.10), we can further improve the expression of phase error:
[0185]
[0186] Where u follows a standard normal distribution and M is the least common multiple of 2 and N.
[0187] It can be seen from the formula that the phase error caused by the projector defocusing can be divided into two parts: random noise and high-order harmonics. The first half of the formula can reduce the influence of random noise by increasing the denominator, that is, making the projector appropriately defocused to increase the modulation degree of the stripes, increase the aperture of the projector, or increase the number of phase shift steps of the binary stripes; the influence of high-order harmonics corresponding to the second half can obviously be eliminated or reduced by appropriately defocusing the projector to improve the sinusoidality of the stripes, or increase the number of phase shift steps. In summary, the present invention applies the electric adjustable focus lens to both the projector and the camera to achieve high-speed three-dimensional measurement under a large depth of field through low-step phase shift stripes.
[0188] 2 Algorithm Flow
[0189] The invention provides a method for 3D reconstruction with a large depth of field based on an electronically controlled lens. The method provides a system such as Figure 5 As shown in the figure, the system includes two electric adjustable focus lenses, an industrial camera and a projector. The electric adjustable focus lenses are applied to the projector and the camera to extend the depth of field of the camera and the projector. and Represent the i-th focal plane of the projector and the camera respectively. The windows drawn by the dotted lines next to the focal plane of the camera correspond to the sampling targets at their respective focal lengths. Through their respective close-up images, it can be found that by setting different focal lengths on the projector and the camera using the electronically controlled lens, the target can be clearly focused on, and the binary fringes can be reasonably defocused on the target object to have a good sinusoidal property. In this experiment, three discrete focal planes are set by the electronically controlled lens. These three focal planes correspond to 400mm, 800mm and 1200mm respectively, and switch between these three focal planes to cover the depth range of the entire scene. The system parameters are pre-calibrated on each focal plane, and the three-dimensional reconstruction is completed on the selected focal plane. By selecting these targets to be measured in the focal plane, the entire three-dimensional scene is merged together. Next, the implementation of this method will be introduced from the device calibration under the sub-depth of field.
[0190] During the equipment calibration process under the sub-depth of field, this method uses the electric adjustable focus lens to complete the system parameter calibration process and complete the construction of the current relationship between the system calibration parameters and the electric adjustable focus lens. The electric adjustable focus lens is installed in front of the camera lens and the projector. This component can adjust the input current value through the driver software on the computer to change the refractive power of the electric adjustable focus lens, thereby adjusting the focus position of the camera and the projector. The large depth of field three-dimensional reconstruction method based on the electric-controlled lens divides the large depth of field range to be measured into several sub-depths of field. In each sub-depth of field, the focal plane of the camera and the focal plane position of the projector and the current value of the electric adjustable focus lens are respectively measured. The specific implementation process is introduced by taking one of the sub-depths of field as an example:
[0191] (1) Camera focus
[0192] In order to achieve high-precision 3D measurement, not only isolated objects at different positions but also objects with large depth information changes need to be accurately reconstructed. In this method, we use the magnitude of the image gradient as a contrast measure, as shown in the following formula:
[0193]
[0194] Among them, I i is the i-th image taken continuously by the camera, G i is the gradient of the i-th image, and the focal position of each pixel can be expressed as follows:
[0195]
[0196] Among them, η(i) is the focal length corresponding to the i-th image, η * is the image at the focus position.
[0197] In other words, after the equipment is set up, by repeatedly adjusting the current value of the electric adjustable focus lens in front of the camera, a current value is found that makes the gradient value of the image maximum. At this time, the camera at this current value is in a focused state.
[0198] (2) Focus of the projector
[0199] After analyzing the implementation method of camera focusing in the above text, after completing the positioning of the focal plane in the sub-depth of field based on the current value applied by the camera through the electric adjustable focus lens, we complete the focusing process of the projector. The projector is used to project binary fringes to improve the efficiency of three-dimensional measurement. When we use the projector to project binary fringes, we need to ensure that it is properly defocused or use high-step phase-shift fringes to achieve high-quality sinusoidal properties. In this method, we will set the fixed exposure time in the sub-depth of field when the camera completes the focusing. The setting standard is that the objects in the sub-depth of field are not overexposed in this case, and then set the current value of the electric adjustable focus lens on the projector to 0mA, and use the projector to project 15-step phase-shift fringes and 3-step phase-shift fringes on the focal plane. At the same time, the current value of the electric adjustable focus lens in front of the projector is repeatedly adjusted, that is, the current value is changed once for each group of 15-step phase-shift fringes and 3-step phase-shift fringes, to simulate the defocus degree of the projector at different degrees. It should be noted that the two groups of phase-shift fringes with different steps need to have the same fringing period. After the above operation, we can get several groups of 15-step and 3-step phase shift fringe images. The two parts of the fringe images are used to obtain the wrapped phase. The phase obtained by the 15-step phase shift fringe is used as the ideal wrapped phase that does not contain high-order harmonic errors, and the phase obtained by the three-step phase shift fringe is the real wrapped phase. The difference between the two parts of the wrapped phase is used to intuitively reflect the sinusoidal quality of the fringe. The process can be expressed by the following formula:
[0200]
[0201] in represents the wrapped phase obtained by solving the fifteen-step phase shift, represents the wrapped phase obtained by the three-step phase shift solution.
[0202] (3) System calibration
[0203] In order to cover the entire depth of the scene, it is necessary to reasonably divide the coverage range of the sub-depth of field to achieve accurate three-dimensional measurement under a large depth of field. In this method, the depth of field (DOF) of the entire field of view is divided into three sub-depths of field, represented as DOF1, DOF2, and DOF3, which divides the depth of field (400mm, 1200mm) into three parts. For several sub-depths of field, the focusing method of the camera and projector mentioned above is repeated, and then the system parameters are calibrated through the calibration process of the three-dimensional measurement system based on a single camera and a projector mentioned in 2.1.1.
[0204] (4) 3D reconstruction
[0205] After the system calibration is completed, the calibration parameters of each sub-depth of field can correspond to the current values of the electric adjustable focus lens on the camera and projector. When performing three-dimensional measurement tasks with a large depth of field, the specific position of the object to be measured is located by the camera, and the system parameters obtained in advance are combined to achieve high-speed three-dimensional measurement with a large depth of field.
[0206] FPP experiments in 3 depth of field scenes
[0207] 3.1 Experimental equipment assembly and system calibration
[0208] In order to prove the feasibility of the method proposed by the present invention through experiments, this section will analyze it from two aspects: qualitative and quantitative experiments. The present invention has built a monocular structured light 3D measurement system. The experimental system is as follows: Figure 6 As shown in the figure, the construction of the whole measurement system and the experimental process are completed in a light-proof environment to avoid the influence of ambient light on the measurement results. The system mainly includes: a DMD model Lightcrafter4500 projector (with a resolution of 912×1140), a Basler acA800-510um industrial camera (with a resolution of 600×800), an optical fixed focus lens (Computar, 12mm), an Optotune EL-16-40-TC electric adjustable focus lens, a high-precision electric control lens driver with a resolution of 0.1mA and a model Optotune Lens driver 4i to accurately control the electric control lens, a dot calibration plate, an optical platform, and a PC. The entire large depth of field range is divided into various sub-depth of field ranges in advance, and the camera and projector are focused by the electric adjustable focus lens in each sub-depth of field range, and the system parameters are obtained by calibration.
[0209] exist Figure 6 In the system diagram shown, the optical fixed focus lens is mounted on the CMOS, such as Figure 7 As shown in the figure, the electric adjustable focus lens is installed in front of the camera lens. At the same time, the amount of light can be changed by adjusting the lens, and the projector is clamped to place the electric adjustable focus lens in front of the projector lens. Use M4 screws to fix the camera and projector on the optical platform to avoid accidental shaking and collision of the equipment after calibration. The baseline distance of the entire 3D measurement system is about 15cm.
[0210] The synchronization between the camera and the projector is achieved by hard triggering. When the projector projects the fringe pattern, a trigger signal is sent through the trigger out port (output trigger). Figure 8As shown in the figure, the trigger signal is transmitted to the camera through the trigger line. After receiving the trigger signal sent by the projector, the camera takes the image, thereby realizing the synchronization of projection and acquisition between the projector and the camera. The entire 3D measurement system is connected to the PC through the USB interface to realize data transmission.
[0211] The Optotune EL-16-40-TC electric focusable lens is Fig. 9 As shown in part a, its response time and stabilization time are 5 milliseconds and 25 milliseconds respectively, which is many orders of magnitude faster than most mechanical alternatives. Its OEM version with a threaded adapter can be easily used with off-the-shelf imaging lenses. It can be assembled on the lens in front of the CMOS camera to achieve electric focus, while for projectors, an additional customized fixture is required to fix it in front of the projector lens to achieve electric focus. The lens driver model is Optotune Lens driver 4i. Fig. 9 As shown in part b, the driver provides a simple and precise way to control Optotune's electric adjustable focus lens. The communication with the driver follows an open simple serial protocol that can be implemented in any programming language on Windows or Linux. As a compact USB-powered current source, it is also used to drive LEDs or laser diodes. It is linked to the electric adjustable focus lens through an aviation head connector, and the other end is connected to the PC through a USB3.0 interface.
[0212] In addition, we will install driver software on the PC to control the hardware systems such as the camera, projector and electric adjustable focus lens. The driver software used in this experimental equipment is DLP LightCrafter4500, pylonViewer (64bit) and Lens Driver Controller, which control the projector, camera and electric adjustable focus lens respectively. Researchers can easily create, store and display high-speed graphic sequences through the USB-based application programming interface (API) and graphical user interface (GUI) of DLP LightCrafter4500. At the same time, the software can adjust parameters such as projection cycle and exposure time to meet the task requirements in various working environments. Pylon Viewer provides a series of rich functions to set up the researcher's Basler camera, so that we can capture images with the best imaging quality, which greatly facilitates the use of researchers. As the driver software of the lens driver, Lens Driver Controller provides a current control range of -290 to +290mA with a step size of 0.07mA, and its output frequency ranges from 0.25 to 2000Hz. The output modes include rectangular wave, triangle wave and sine wave.
[0213] In order to complete the three-dimensional measurement under a large depth of field of this method, it is necessary to calibrate the system parameters under each sub-depth of field. Now we will explain the actual calibration process of one of our sub-depths of field DOF1, which is the position where the camera focuses at 400mm, combined with the algorithm process.
[0214] Matlab is a famous commercial mathematical computing software developed by MathWorks in the United States. It is widely used in data processing, computer vision, signal processing and other fields. Matlab integrates the common algorithms required for three-dimensional measurement. For system calibration, the Stereo Camera Calibrator calibration toolbox it provides has the advantages of fast calculation speed and high calibration accuracy. As a simple and practical function fitting toolbox of Matlab, cftool provides a wealth of fitting algorithms and can realize a variety of linear and nonlinear function fitting. Therefore, the present invention adopts this scheme to calibrate the constructed structured light three-dimensional measurement system.
[0215] (1) Camera focus
[0216] After completing the equipment construction, we repeatedly adjusted the current value of the electric adjustable focus lens in front of the camera to continuously change the focal plane position, and simultaneously recorded the corresponding current value and the gradient value G of the captured image. i , Fig.10 The defocus degree of the lens, the blur degree of the camera and the gradient value of the image captured under different current values are shown. By importing it into Matlab's cftool for fitting, we can get the functional relationship curve between the current value and the gradient value. In the curve, we find the current value corresponding to the maximum gradient value to make the camera in the focus position. The fitting process in Matlab is basically the same as that of the projector, so this process is only shown in the projector part.
[0217] (2) Focus of the projector
[0218] Similarly, for the focus of the projector, we still describe the part of the projector in the algorithm flow with experimental data. After completing the focus of the camera, we use the method of analyzing the phase error to determine whether the binary fringes have obtained the appropriate defocus and the quality of their sinusoidal properties. Here, we still use 15-step phase shift and 3-step phase shift as the encoding diagram for solving the wrapped phase. Fig.11 The figure shows the defocus of the fringes at different current values, as well as the error diagram of the wrapped phase.
[0219] The first row shows the fringe patterns captured by the camera at different current values; the second row shows the phase error at different current values
[0220] The figure also verifies the phase error caused by the projector defocusing analyzed above. When the electric adjustable focus lens is applied with a current value of 120mA, the stripes at 400mm of the projector are basically in a binary state, that is, the sinusoidality is poor. The phase error diagram also shows that there is a very obvious influence of high-order harmonics. When the current value applied to the electric adjustable focus lens changes to 0mA, that is, when it is not working, it can be seen that the modulation degree of the stripes has been greatly affected by the defocusing, and the phase error is also high. When the current value becomes 60mA, it is obvious that the binary stripes have obtained a better sinusoidality and stripe modulation degree through appropriate defocusing. At this time, the wrapping phase error is also relatively low. Therefore, the optimal current value can be found near 60mA. Fig.12 The relationship curve obtained by fitting with Matlab's cftool toolbox is shown, where the horizontal axis is the current value applied to the electric adjustable focus lens in front of the projector, and the vertical axis is the wrapped phase error. Consistent with the above analysis, it is obvious that when the current of the electric adjustable focus lens is set at around 60mA, the phase error we get is at a low level, that is, the binary fringes have a suitable defocus, and the subsequent peak corresponds to the focal plane of the projector moving to 400mm at around 120mA. Obviously, when we continue to increase the current value through the lens driver, another trough will appear later, which also corresponds to the suitable defocus position on the other side of the projector focal plane, but for convenience we choose the value of this trough with a lower current value.
[0221] After the above two steps, we can conclude that under sub-depth of field DOF1, the current values of the electric adjustable focus lenses on the camera and projector should be set to 60.07mA and 53.63mA to achieve the most appropriate focusing degree and sinusoidal nature of the fringes.
[0222] (3) System calibration
[0223] After completing the focusing of the camera and projector, we use Zhang's calibration method to calibrate the 3D system parameters under the sub-depth of field. It should be noted that before calibration, we need to select a suitable calibration plate, especially in this method, each sub-depth of field needs to be pre-calibrated. We selected 3 dot calibration plates of different sizes to complete the calibration. By using the dot calibration plate, the impact of noise on calibration can be reduced to a greater extent. Fig.13 This is a display picture of one of the calibration plates used. The calibration plate has a black background with white dots, and the matte finish of anodized aluminum can reduce reflections to a certain extent.
[0224] Each sub-depth of field is calibrated by the projector by projecting a pre-designed 15-step phase-shifted stripe with a period of 15 and a Gray code stripe. Fig.14 As shown:
[0225] After a total of 27 groups of calibration images are collected, the coordinates of the center of the circle on the corresponding camera and projector are processed and imported into the Stereo Camera Calibrator of Matlab to obtain the system parameters. The system parameters under the sub-depth of field DOF1 are as follows: Fig.15 As shown, we evaluate the calibration accuracy of the system through the reprojection error. The reprojection error of the calibration parameters of the sub-depth of field DOF1 is as follows Fig.16 As shown:
[0226] 3.2 Three-dimensional reconstruction capability test
[0227] The test of 3D reconstruction capability includes two parts. One part is the 3D measurement of actual objects such as plaster toys to qualitatively evaluate the effect of 3D measurement. The other part is the 3D measurement of standard parts. This invention quantitatively evaluates the measurement accuracy under large depth of field by performing 3D measurement on a standard ball of ceramic process. Next, we will expand on these two parts respectively.
[0228] (1) Qualitative experiment
[0229] In order to verify the effectiveness of the large depth of field three-dimensional measurement method proposed above, three objects were placed at DOF1, DOF2 and DOF3 respectively in a qualitative experiment, and were reconstructed using the method of the present invention, the traditional method of only applying an electric adjustable focus lens to a camera, and the traditional FPP method, and their reconstruction effects were compared.
[0230] First, the initial position of the system is set at 650mm, the current value of the electric adjustable focus lens is set to 0, and the system parameters are calibrated. The three-dimensional data is obtained by the five-step phase shift method. This process shows the ability of the traditional FPP to perform three-dimensional measurement tasks in large depth of field scenes. Then, the electric adjustable focus lens on the projector is kept inoperative, that is, no current is applied at all times, and the calibration under each sub-depth of field is completed by changing the current of the electric adjustable focus lens on the camera, and the three-dimensional data is also obtained by the five-step phase shift method. This set of three-dimensional data contains the measurement error caused by the projector's defocus. This method is referred to as PE. Finally, we adjust the two electrically controlled lenses to make the camera and projector achieve the best focus or defocus at each sub-depth of field, and complete the calibration of the system parameters at each sub-depth of field. Similarly, the five-step phase shift method is used to complete the three-dimensional measurement work. This method is referred to as DOFEM (Depth-of-Field Enhancing Method, DOFEM).
[0231] We qualitatively analyze the reconstruction capability of the proposed method through the reconstruction effects of objects at different positions in the entire field of view. We select three toys and plaster statues with rich details to assist our qualitative experiments. We can easily draw conclusions through the three-dimensional reconstruction results for the restoration of detail capabilities.
[0232] First, due to the defocus of the camera and projector, the sub-depth of field DOF1 not only loses details of the captured object but also greatly reduces the modulation of the coded stripes. The captured image and 3D reconstruction effect are as follows: Fig.13 As shown: the first, second and third columns correspond to the processes of DOFEM, PE and FPP methods respectively; the first row is the fringe pattern captured by the camera, the second row is the 3D reconstruction result of the actual object, and the third row is a close-up of the object details.
[0233] From the results of 3D reconstruction, the traditional FPP cannot fully restore the map route of the toy surface due to the loss of object details caused by the camera's defocus. Another part is that the modulation of the stripes is greatly reduced due to the excessive defocus of the projector, resulting in a large amount of noise on the reconstructed 3D information surface. The PE method only considers the refocusing of the camera end, so although the map route of the object is restored, due to the problem of stripe modulation, a large amount of noise on the point cloud surface cannot be avoided. Finally, the DOFEM method of the present invention can obviously obtain more accurate, detailed and smooth 3D information when the camera and projector are working at a suitable focal length.
[0234] Then, for the sub-depth of field DOF2, since it is not far from the original initial position of the original system, it is still within the working depth of field of FPP, so the details of the captured object are still preserved, and the fringe pattern also has appropriate sinusoidality and modulation. The captured image and 3D reconstruction effect are as follows Fig.14 As shown in the figure: the first, second and third columns correspond to the processes of DOFEM, PE and FPP respectively; the first row is the fringe pattern captured by the camera, the second row is the 3D reconstruction result of the actual object, and the third row is a close-up of the object details. From the results of 3D reconstruction, since they are still within the working depth of field of FPP, there is no obvious difference in the reconstruction effects of the three methods.
[0235] Finally, for the sub-depth of field DOF3, due to the defocus of the camera, the detailed information of the object cannot be clearly obtained, and the sinusoidality of the fringe pattern is very poor because the projector does not have appropriate defocus. The captured image and 3D reconstruction effect are as follows: Fig.15 The first, second and third columns correspond to the processes of DOFEM, PE and FPP methods respectively; the first row is the fringe pattern captured by the camera, the second row is the 3D reconstruction result of the actual object, and the third row is a close-up of the object details.
[0236] We zoomed in on the cheek of the plaster statue of David and analyzed it. We can see that when the PE is in a phase shift method with a lower number of steps and the binary stripes cannot be properly defocused, the poor sinusoidal nature of the high-order harmonics will have a strong impact. The smoother part of the cheek can be clearly seen to have striped undulations. In this case, the traditional FPP reconstruction method can even filter this smooth part due to the slight defocus of the camera, making the 3D information smoother.
[0237] From the reconstruction results of the three sub-depths of field, we can qualitatively illustrate that the DOFEM proposed in the present invention can work well in the three-dimensional measurement task under a large depth of field.
[0238] Next, we will demonstrate the feasibility of the proposed method in a quantitative way. We select a standard ball of ceramic technology and place it in three sub-depths of field to obtain three-dimensional information through the above reconstruction methods, and perform spherical fitting on it. We compare the measurement accuracy of the three methods, and the standard deviation results of the fitting are shown in Table 1:
[0239] Table 1 Results of spherical fitting standard deviation at each sub-depth of field
[0240] RMSE / mm DOFEM PE FPP <![CDATA[DOF1]]> 0.033 0.060 0.062 <![CDATA[DOF2]]> 0.100 0.097 0.100 <![CDATA[DOF3]]> 0.143 0.207 0.164
[0241] From Table 1, we can get the conclusion consistent with the qualitative experiment. When the working distance exceeds the traditional FPP, we cannot ignore the error caused by the defocus of the projector when performing three-dimensional measurement with a large depth of field based on the low-step phase shift method. The DOFEM proposed in this invention can solve this problem well.
[0242] The present invention first analyzes the impact of camera defocus and projector defocus on three-dimensional measurement in a large depth of field scene, and then proposes a three-dimensional measurement method under a large depth of field based on an electrically controlled lens to address these problems. The measurement task of a large depth of field is divided into several sub-depths of field, and the pre-calibration of system parameters under the sub-depth of field is completed through the advantages of the stability and efficiency of the electrically controlled lens. This method solves the dilemma of the limited working depth of field range of the projector under a large depth of field by adding an electrically controlled lens to the front of the projector, that is, the measurement error caused by high-order harmonics cannot be solved by low-step phase shifting. The method is analyzed and its feasibility is verified through qualitative and quantitative experiments in a large depth of field scene. Finally, it is shown that the method can very effectively solve the measurement impact caused by the defocus of the camera and projector under a large depth of field, and realize high-speed and high-precision three-dimensional measurement under a large depth of field.
Claims
1. A method for three-dimensional measurement with a large depth of field based on an electronically controlled lens, characterized in that: A large depth of field three-dimensional measurement system is used, which includes a first electric adjustable focus lens, a second electric adjustable focus lens, a camera and a projector, wherein the camera and the projector are both facing the object to be measured, the first electric adjustable focus lens is arranged in front of the camera, and the second electric adjustable focus lens is arranged in front of the projector, and the following steps are included:
1. Divide the large depth of field range to be measured into multiple sub-depths of field; 2. In each sub-depth of field, the camera is focused on the focal plane by adjusting the first current value of the first electric adjustable focus lens, and the projector is focused on the focal plane by adjusting the second current value of the second electric adjustable focus lens in each sub-depth of field, and the camera parameters and the projector parameters are calibrated in each sub-depth of field; 3. Use the focused projector to project onto the object to be measured, use the focused camera to locate the specific position of the object to be measured, and combine the calibrated camera parameters and projector parameters to achieve three-dimensional measurement under a large depth of field.
2. The method for three-dimensional measurement with a large depth of field based on an electronically controlled lens as claimed in claim 1, characterized in that: In step 2, the focusing of the focal plane of the camera is completed by adjusting the first current value of the first electrically adjustable focus lens. Specifically, when the first current value makes the gradient value of the image maximum, the focusing of the camera on the focal plane is completed.
3. The method for three-dimensional measurement with a large depth of field based on an electronically controlled lens as claimed in claim 1, characterized in that: The focus of the camera on the focal plane in step 2 is obtained by the following formula: Among them, η(i) is the focal length corresponding to the i-th image, η * is the image at the focus position, I i is the i-th image taken continuously by the camera, G i is the gradient of the i-th image, and (u,v) is the focus position.
4. The method for three-dimensional measurement with a large depth of field based on an electrically controlled lens according to claim 1, characterized in that: In step 2, the phase obtained by solving the fifteen-step phase-shifting stripes is used as the ideal first package phase that does not contain high-order harmonic errors. The phase obtained by solving the three-step phase-shifting stripes is the true second package phase. The difference between the first package phase and the second package phase is used to determine the sinusoidality of the stripes, thereby completing the focusing of the projector on the focal plane.
5. The method for three-dimensional measurement with a large depth of field based on an electronically controlled lens according to claim 1, characterized in that: In step 2, the following formula is used to determine the quality of the fringe sinusoidality, thereby completing the focusing of the projector on the focal plane: in, represents the wrapped phase obtained by solving the fifteen-step phase-shifted fringe. represents the wrapped phase obtained by three-step phase-shift fringe solution.
6. The method for three-dimensional measurement with a large depth of field based on an electronically controlled lens according to claim 1, characterized in that: In step 1, the large depth of field range to be measured is divided into three sub-depths of field, denoted as DOF1, DOF2 and DOF3.
7. The method for three-dimensional measurement with a large depth of field based on an electronically controlled lens according to claim 1, characterized in that: In step 2, after the calibration of the camera parameters and the projector parameters is completed, the calibrated camera parameters of each sub-depth of field form a one-to-one correspondence with the current value of the first electric adjustable focus lens, and the calibrated projector parameters of each sub-depth of field form a one-to-one correspondence with the current value of the second electric adjustable focus lens.
8. The method for three-dimensional measurement with a large depth of field based on an electronically controlled lens according to claim 1, characterized in that: In step 2, the camera parameters and projector parameters are calibrated by minimizing the following equation: Among them, n ca For different pictures, p ca is the number of feature points on the calibration plate in each image, is the projector coordinates corresponding to the j-th feature point coordinates of the calibration plate on the i-th image, and They are the intrinsic parameter matrix, rotation matrix and translation matrix of the projector respectively. is an object point P in three-dimensional space ij The two-dimensional projector coordinates are obtained after the projector's internal and external parameter matrices are transformed. c1 and c2 are the first-order and second-order distortion coefficients. and is the distortion parameter of the projector, is the coordinate of the jth feature point of the calibration plate on the i-th image, P ij is the three-dimensional coordinate of the jth feature point of the calibration plate on the i-th image, P ij The two-dimensional coordinates obtained by transforming the external parameter matrix and the internal parameter matrix are: i and T i is the rotation matrix and translation matrix in the external parameter matrix corresponding to the i-th picture.
9. The method for three-dimensional measurement with a large depth of field based on an electrically controlled lens according to claim 1, characterized in that: In step 3, the specific position of the object to be measured is obtained by solving the following formula: in, M c is the product of the internal parameter matrix and the external parameter matrix of the camera and projector, M p is the product of the internal parameter matrix and the external parameter matrix of the projector, P(X w ,Y w ,Z w ) is the three-dimensional coordinate of the object to be measured, (u c ,v c ) is the coordinate of the object to be measured in the two-dimensional pixel coordinate system of the camera, (u p ,v p ) is the coordinate of the object to be measured in the two-dimensional pixel coordinate system of the projector.
10. The method for three-dimensional measurement with a large depth of field based on an electronically controlled lens according to claim 1, characterized in that: In step 3, the following formula is used to achieve three-dimensional measurement under large depth of field: Among them, Φ w and Φ h are the absolute phase diagrams of the fringes in the horizontal and vertical directions projected by the projector, respectively, w and f h are the fringe frequencies in the horizontal and vertical directions of the projector, w and h are the resolutions in the horizontal and vertical directions of the projector, respectively. c ,v c ) is the coordinate of the object to be measured in the two-dimensional pixel coordinate system of the camera, (u p ,v p ) is the coordinate of the object to be measured in the two-dimensional pixel coordinate system of the projector.
Citation Information
Cited By
Method for correcting distortion of camera and projector based on structured light
CN118761942A
