Three-dimensional reconstruction method based on structured light image enhancement
By introducing structured light image enhancement technology into the three-dimensional reconstruction method, including GF-CL image enhancement algorithm and complementary Gray code dewrap phase, the problem of insufficient three-dimensional reconstruction accuracy of complex surfaces is solved, and higher reconstruction accuracy and stability are achieved.
Patent Information
- Application Number
- CN202411867243.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-05-06
AI Technical Summary
The existing three-dimensional reconstruction method based on stripe projection is prone to problems such as error accumulation and insufficient reconstruction accuracy when complex surfaces or more details are present.
A three-dimensional reconstruction method based on structured light image enhancement is adopted to generate four sinusoidal stripe patterns with different phase shifts, and the image is projected and acquired in combination with MATLAB programming. The captured fringe images are preprocessed using the GF-CL image enhancement algorithm, including a guide filtering algorithm and an improved CLAHE algorithm, to improve image contrast and remove noise. Then, the wrapping phase distribution is extracted through the four-step phase calculation formula, a complementary Gray code pattern is generated, and the wrapping phase is unwrapped, and the three-dimensional reconstruction is finally completed.
It significantly improves the accuracy and stability of 3D reconstruction, eliminates the errors of edge jumps in traditional Grey code reconstruction, ensures the continuity and accuracy of the real phase, and enhances the resolution of details.
Smart Images

Figure CN119941982A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of three-dimensional measurement, and in particular to a three-dimensional reconstruction method based on structured light image enhancement. Background Art
[0002] With the continuous progress of science and technology, people's requirements for obtaining object information have gradually shifted from two-dimensional to three-dimensional. Quickly and accurately obtaining three-dimensional information of objects has become a key demand in all walks of life. This demand not only involves product design and quality inspection, but also includes medical inspection, cultural relics protection, automatic navigation, and virtual reality systems. The rapid development of optical measurement technology and computer technology has promoted the transformation of traditional contact three-dimensional coordinate measurement to optical non-contact measurement. Non-contact measurement technology has the advantage of avoiding direct contact with the object being measured, facilitating automated operation, and showing a wide range of application prospects in various fields. It has high accuracy and meets people's growing needs. However, the existing three-dimensional reconstruction method based on fringe projection is prone to error accumulation and insufficient reconstruction accuracy in the case of complex surfaces or more details. In order to further improve the accuracy of three-dimensional reconstruction, combining complementary Gray code and four-step phase shift method has become an effective solution. The uniqueness of complementary Gray code and high-precision phase calculation of four-step phase shift method can significantly improve the reconstruction accuracy and robustness. At the same time, in order to overcome the influence of image noise and low contrast in reconstruction, the image enhancement algorithm is introduced into the present invention. By enhancing image details and contrast, the stability and accuracy of three-dimensional reconstruction in complex scenes are effectively improved. This improvement not only makes the method suitable for more complex 3D surface reconstruction, but also further broadens its applicability in different application fields. Summary of the invention
[0003] The purpose of the present invention is to provide a three-dimensional reconstruction method based on structured light image enhancement to solve the problems raised in the above background technology.
[0004] To achieve the above object, the present invention provides the following technical solutions:
[0005] A three-dimensional reconstruction method based on structured light image enhancement comprises the following steps:
[0006] Step 1, generate fringe coding patterns: use MATLAB programming to generate four sinusoidal fringe patterns with different phase shifts, and project them onto the surface of the object to be tested;
[0007] Step 2, camera calibration: Use a checkerboard calibration plate of known size to calibrate the camera, take images of the calibration plate at different angles, and then use the camera calibration toolbox in MATLAB to calculate the camera's intrinsic and extrinsic parameters;
[0008] Step 3, projector calibration: place a calibration plate with a marking pattern in the projector field of view, project a set of sinusoidal fringe patterns through the projector, and record the projected fringe images of the calibration plate under different phase shift conditions; use a camera to capture the calibration plate image and decode the fringe code, calculate the absolute phase map of each point on the calibration plate, and thus obtain the absolute phase position of the fringe image captured by the camera; according to the absolute phase value, use the difference method to calculate the lateral absolute phase value of adjacent fringe pixel points to determine the coordinate mapping relationship in the camera and projector field of view, thereby completing the calibration; finally, using the corresponding relationship between the camera and the projector, combined with the intrinsic parameter matrix, extrinsic parameter matrix and image coordinate system transformation matrix of the projector, derive the imaging model of the projector to achieve the unification of the projector and camera coordinate systems;
[0009] Step 4, using a camera to capture four phase-shifted fringe images projected on the surface of the object, and preprocessing the fringe images collected by the camera using the GF-CL image enhancement algorithm. The GF-CL image enhancement algorithm includes a guided filtering algorithm and an improved CLAHE algorithm. The GF-CL image enhancement algorithm processing process includes: first, using the guided filtering algorithm to denoise the fringe projection collected by the camera and smooth the image in the area; then, using the improved CLAHE algorithm to perform histogram homogenization and adjust the image contrast;
[0010] Step 5, obtain the package phase: extract the package phase distribution through the four-step phase calculation formula;
[0011] Step 6, Gray code generation: Generate five Gray code patterns corresponding to the projection area and project them onto the surface of the object to be tested to identify each pixel point;
[0012] Step 7, binary conversion: determine the corresponding threshold value according to the four modulated Gray code images, and perform binary processing on the generated Gray code image;
[0013] Step 8, using complementary Gray code to unwrap the phase: by comparing the changes of the Gray code image on the surface of the object with the original Gray code image, the real phase is solved by combining the unwrapping calculation formula;
[0014] Step 9, 3D reconstruction: Based on the absolute phase value after unwrapping, combined with the calibration parameters of the camera and projector, the 3D coordinates of the object surface are calculated to finally complete the 3D reconstruction of the object.
[0015] Furthermore, the step 1 specifically includes: the phase shift fringe image projected on the surface of the object is expressed by formula (1):
[0016]
[0017] Among them, I(x,y) represents the intensity of the projected fringes, A(x,y) represents the intensity of the image background, and B(x,y) represents the modulation amplitude of the image fringes. is the phase corresponding to the point (x, y), θ represents the known phase shift; the phase shift for each movement is Then a phase shift of 2π is generated four times, generating four pictures in total; the frequency of the fringe pattern is adapted to the detail resolution of the surface of the object being measured.
[0018] Furthermore, the specific steps of the projector calibration in step 3 are as follows:
[0019] Step 3.1, place the calibration plate with a marking pattern in the field of view of the projector, project a set of sinusoidal fringe patterns onto the calibration plate through the projector, and use the camera to collect the fringe images of the calibration plate at different phase shifts to obtain the fringe images Φ in the camera field of view c (u c ,v c );
[0020] Step 3.2: Decode the fringe image captured by the camera and calculate the absolute phase map Φ of each point on the calibration plate. c (u c ,v c ), assuming that the phase value of the corresponding point in the projector field of view is Φ p (u p ,v p ), the corresponding relationship satisfies the following formula:
[0021] Φ c (u c ,v c )=Φ p (u p ,v p )
[0022] where Φ c (u c ,v c ) is the absolute phase position obtained by decoding the fringe image acquired by the camera, Φ p (u p ,v p ) is the absolute phase map of the sinusoidal fringe pattern generated by the projector;
[0023] Step 3.3, based on the absolute phase value, construct the pixel mapping relationship between the camera and the projector, the camera image pixel coordinates (u c ,v c ) and the projector image pixel coordinates (u p ,v p ) satisfies the following formula:
[0024]
[0025]
[0026] Where W and H are the width and height resolution of the projector fringe pattern, respectively;
[0027] Step 3.4, by mapping the calibration plate coordinates to the world coordinate system, using the projector's intrinsic parameter matrix and the extrinsic parameter matrix Establish the imaging model of the projector. The imaging model of the projector is described as follows:
[0028]
[0029] In the formula, Z P is the scaling factor of the projector imaging model, X m , Y m , Z m is the three-dimensional space coordinate of the object in the world coordinate system,
[0030] The definition is as follows:
[0031]
[0032] where f p is the focal length of the projector, dx and dy are the horizontal and vertical dimensions of the projector pixel unit, respectively. is the origin of the projector image coordinate system;
[0033] The definition is as follows:
[0034]
[0035] Where R p and T p They are the rotation and translation matrices from the world coordinate system to the projector coordinate system;
[0036] Step 3.5, using the known absolute phase value φ through the imaging model c (u c ,v c )=Φ p (u p ,v p ) Position the calibration plate points in the camera field of view to the corresponding points in the projector field of view to achieve calibration.
[0037] Furthermore, the guided filtering algorithm in step 4 is used for smoothing filtering in image processing while maintaining the image edge. The specific definition of guided filtering is as follows:
[0038] q i =a k I i +b k ,i∈w k ⑶
[0039] where w k refers to a specific filtering window, i represents all pixels in this filtering window, q i represents the output image, I i represents the guidance image, p i represents the input image, a k and b k is the adaptive factor. By using the least squares method, the mean square error between the output image q and the original image p is minimized, so as to obtain the adaptive factor a k and b k :
[0040]
[0041] Where |w| is the number of pixels in the window, μ k is the mean of the guide image within the window, is the mean of the original image, is the variance of the guide map within the window, and ∈ is the regularization parameter.
[0042] Furthermore, the improved CLAHE algorithm in step 4 includes a pre-processing stage and a post-processing stage, and the pre-processing stage includes:
[0043] Convert the grayscale image to RGB image, then convert the RGB image to XYZ image, and then convert the XYZ image to LAB image; then extract the L channel in the LAB image for image enhancement; when converting a single-channel grayscale image to a three-channel RGB image, the images of the three channels are exactly the same; the following is the process of converting an RGB image to an XYZ image:
[0044]
[0045] Wherein, R represents the red channel, G represents the green channel, B represents the blue channel, R' represents the normalized red channel, G' represents the normalized green channel, and B' represents the normalized blue channel;
[0046] If the normalized value is greater than 0.04045, gamma correction needs to be performed on the normalized value. Otherwise, the result is calculated directly. The calculation formula is as follows:
[0047]
[0048] The conversion matrix from RGB image to XYZ image is:
[0049]
[0050] After getting the XYZ image, convert it to Lab color space, first use the reference white point X n , Y n ,Z n , the corresponding D65 standard values are 95.047, 100.000, 108.883, and XYZ is normalized as follows:
[0051]
[0052] Where XYZ represents the three color spaces of the XYZ image, X' represents the normalized red color space, Y' represents the normalized green color space, and Z' represents the normalized blue color space;
[0053] Define an auxiliary function f(t) and calculate L using formula (9)(10)(11)(12) * , a * , b * Serving size:
[0054]
[0055] L * =116×f(Y')-16 ⑽
[0056] a * =500×[f(X')-f(Y')] ⑾
[0057] b * =200×[f(Y')-f(Z')] ⑿
[0058] After the above calculations, we get the three components of the Lab color space: L * Represents brightness, ranging from 0 to 100, a * represents the change of color from green to red, b * Represents the change of color from blue to yellow;
[0059] The post-processing stage enhances the image by applying histogram equalization in local areas, including:
[0060] S100, firstly, the entire fringe projection image is divided into continuous and non-overlapping sub-blocks, the size of the sub-block is m×n, and each sub-block contains a total number of N pixels;
[0061] S101, performing histogram equalization on the segmented sub-blocks, and obtaining a corresponding grayscale histogram represented by h(x);
[0062] S102, calculate the clipping threshold T, as shown in formula (13):
[0063]
[0064] Among them C clip is the crop factor, N x and N y Respectively represent the number of pixels in the x and y directions of each individual sub-block, and M is the number of gray levels of the corresponding sub-block;
[0065] S103, according to the clipping threshold T obtained in S102, the grayscale histogram is clipped with the threshold. The total number of clipped thresholds is S, and then the total number S is evenly distributed to the grayscale histogram h(x) of each sub-block. The average grayscale value of the histogram of each sub-block is A. The calculation formula is (14)(15). The reallocated histogram is H(x), as shown in formula (16):
[0066]
[0067] S104, performing equalization processing on the sub-block histogram after reallocation;
[0068] S105, through the mapping relationship between the image pixel and the grayscale conversion function of the block area, the grayscale value of the corresponding pixel is calculated by interpolation operation, so as to improve the calculation efficiency. The interpolation operation process includes: according to the number of adjacent points, when the mapping function involves 4 reference points, bilinear interpolation is used; when it involves 2 points, unilinear interpolation is used; if there is only one reference point, the grayscale value of the sub-block is directly used; three different colors of yellow, green and pink are used to mark each block area: the grayscale value of the pixels in the four corner areas marked with yellow is directly calculated according to the mapping function of the sub-block; the pixel values of the four edge areas marked with green are obtained by the mapping function of the two adjacent sub-blocks to obtain two mapping values, and then the two values are linearly interpolated; the interpolation operation formula of the green area is as follows:
[0069]
[0070] In formula (17), f(x, y) is the pixel value of the point to be found, f1 and f2 are the mapping values obtained by transforming the mapping function of the two adjacent sub-blocks of the point to be found, (x1, y1) and (x2, y2) are the central pixel coordinates of the two adjacent sub-blocks;
[0071] The pixel value of the central area marked in pink is transformed by the mapping function of the four surrounding sub-blocks to obtain four mapping values, and then the four values are bilinearly interpolated. The expression is as follows:
[0072]
[0073] Among them, f'1, f'2, f'3, and f'4 are the mapping values of the point obtained by transforming the mapping function of the surrounding four sub-blocks, (x'1, y'1), (x'1, y'2), (x'2, y'1), and (x'2, y'2) are the center pixel coordinates of the four surrounding sub-blocks respectively, and f(x, y) is the pixel value of the point.
[0074] Furthermore, the step 5 specifically includes: combining formula (1) and using formula (2) to solve the phase function
[0075]
[0076] Among them, I1(x, y) represents the light intensity of the first projection fringe, I2(x, y) represents the light intensity of the second projection fringe, I3(x, y) represents the light intensity of the third projection fringe, and I4(x, y) represents the light intensity of the fourth projection fringe.
[0077] Furthermore, in step 6, the Gray code is a set of number series, each number is represented by binary, and a uniquely identifiable binary Gray code pattern is generated. Each projected pixel point will be encoded as a unique Gray code value, and each column or row of the projection will correspond to a Gray code value.
[0078] Furthermore, the step 7 specifically includes: in the binarization of the Gray code image, firstly, a fringe projection is projected by a projector, the projected pattern is photographed by a camera, and the average grayscale is calculated by the photographed image, so as to determine the corresponding threshold value, as shown in formula (19):
[0079]
[0080] Where T(x,y,n1) represents the average intensity of the four shifted patterns, which can be calculated as an appropriate pixel-level threshold, x and y represent the abscissa and ordinate of the point in the image coordinate system, respectively, and m represents the nth image in the four-step phase shift method;
[0081] By comparing the threshold value G(x, y, n2) of the corresponding pixel point in the Gray code pattern with the average intensity threshold value T(x, y, n1), the corresponding binary image is generated. The comparison method is: if G(x, y, n2) is greater than T(x, y, n1), the threshold value is 1, and if it is less than the threshold value, the threshold value is 0. The judgment formula (20) is as follows:
[0082]
[0083] Where Q(z, y, n) is the codeword information obtained through threshold segmentation calculation, n1 is the number of average intensity threshold phase shift patterns, and n2 is the number of Gray code patterns.
[0084] Furthermore, the step 8 specifically includes:
[0085] After obtaining the corresponding codeword information, the obtained codeword information is decoded, and the fringe order K1 can be obtained by the following formula (21) (22):
[0086]
[0087] K1(x,y)=i(V1(x,y)) (22)
[0088] Among them C i (x,y) is the Gray code bit value of the pixel corresponding to the i-th Gray code pattern, V1(x,y) represents the binary value calculated for the n-th corresponding pixel, i(V(x,y)) represents the conversion operation between Gray code and binary code and decimal number, and K1(x,y) represents the result after rearrangement;
[0089] The fifth Gray code pattern is introduced to effectively avoid jump errors. The specific method is: using the obtained fringe order K1, all five Gray code patterns are used to obtain the fringe order K2. In the non-edge area, the wrapping phase unwrapping uses K1; in the edge area, the phase unwrapping is performed through K2, thereby improving the accuracy of the edge area;
[0090] The fringe order K2 can be obtained by formulas (23) and (24):
[0091]
[0092] K2(x,y)=i(V2(x,y)) (24)
[0093] The obtained fringe order information K1 and K2 are combined with the wrapped phase obtained by formula (2) to convert the wrapped phase into a continuous real phase. The calculation formula is as follows:
[0094]
[0095] Where K1 is the phase order obtained from log N frames of Gray code pattern, K2 is extracted from log N+1 frames of Gray code pattern, and ф(x,y) is the unwrapped continuous phase.
[0096] Furthermore, step 9 specifically includes: after obtaining the real phase, the internal and external parameters of the camera and the projector have been obtained by steps 2 and 3, and the absolute phase is obtained and the phase value of each pixel is determined by combining the four-step phase shift fringe pattern and the complementary Gray code fringe pattern, so as to perform three-dimensional reconstruction measurement, and the calibration parameters of the camera and the projector are used to obtain the parameter matrix M of the camera c and the projector parameter matrix M p :
[0097]
[0098] In the formula, is the element in the camera calibration parameter matrix, are the elements in the projector calibration parameter matrix. Substitute the obtained calibration parameters of the projector and camera into formula (26) to obtain the precise three-dimensional coordinates of the object surface;
[0099]
[0100] Where (x c ,y c ) and (x p ,y p ) represent the pixel coordinates of the camera and projector respectively, (X W ,Y W ,Z W ) represents the three-dimensional coordinates of the measured object.
[0101] Compared with the prior art, the present invention has the following beneficial effects: compared with the traditional three-step phase shift method and Gray code three-dimensional reconstruction technology, the present invention improves the contrast by using an image enhancement algorithm and effectively removes noise. In addition, the three-dimensional reconstruction by combining the four-step phase shift method with the complementary Gray code not only eliminates the edge jump error in the traditional Gray code reconstruction, but also ensures that there is no jump and discontinuity when obtaining the true phase. At the same time, the non-prominence between the black and white stripes in the stripe projection is improved, which significantly enhances the details, thereby improving the reconstruction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0102] Figure 1 The present invention is a schematic flow chart of a three-dimensional reconstruction method based on structured light image enhancement.
[0103] Figure 2 This is a schematic diagram of the location of structured light hardware equipment.
[0104] Figure 3 Schematic diagram of image clipping threshold using contrast-limited adaptive histogram equalization method.
[0105] Figure 4 Schematic diagram of sinusoidal fringes projected onto the object to be measured.
[0106] Figure 5 It is a schematic diagram of enhancing the image of the photographed object using the GF-CL algorithm of the present invention.
[0107] Figure 6 Schematic diagram of point cloud data after 3D reconstruction. DETAILED DESCRIPTION
[0108] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0109] See also Figure 1-Figure 6 , a three-dimensional reconstruction method based on structured light image enhancement, the present invention is implemented by a structured light hardware device, the structured light hardware device includes a projector and a camera, the structure diagram is as shown Figure 2 As shown, the three-dimensional reconstruction method includes the following steps:
[0110] Step 1: Generate stripe coding pattern
[0111] Four sinusoidal fringe patterns with different phase shifts were generated using MATLAB programming and projected onto the surface of the object to be tested.
[0112] The phase-shifted fringe image projected on the object surface is expressed by formula (1):
[0113]
[0114] Among them, I(x,y) represents the intensity of the projected fringes, A(x,y) represents the intensity of the image background, and B(x,y) represents the modulation amplitude of the image fringes. is the phase corresponding to the point (x, y), θ represents the known phase shift; the phase shift for each movement is Then a phase shift of 2π is generated four times, generating four pictures in total; the frequency of the fringe pattern is adapted to the detail resolution of the surface of the object being measured.
[0115] Step 2: Camera calibration
[0116] Use a checkerboard calibration plate of known size to calibrate the camera, and take images of the calibration plate at different angles to ensure that the images are clear and unblurred. Then, use the camera calibration toolbox in MATLAB to calculate the camera's intrinsic parameters (such as focal length, distortion coefficient, etc.) and extrinsic parameters (rotation matrix, translation matrix).
[0117] Step 3: Projector calibration
[0118] Place a calibration plate with a marking pattern in the projector's field of view, project a set of sinusoidal fringe patterns through the projector, and record the projected fringe images of the calibration plate under different phase shift conditions. Use a camera to capture the calibration plate image and decode the fringe code, calculate the absolute phase map of each point on the calibration plate, and obtain the absolute phase position of the fringe image captured by the camera. According to the absolute phase value, the differential method is used to calculate the lateral absolute phase value of adjacent fringe pixel points to determine the coordinate mapping relationship in the camera and projector fields of view, thereby completing the calibration. Finally, using the correspondence between the camera and the projector, combined with the intrinsic parameter matrix, extrinsic parameter matrix and image coordinate system transformation matrix of the projector, the imaging model of the projector is derived to achieve the unification of the projector and camera coordinate systems, and the object is photographed and sampled after calibration. Figure 2 As shown, the projector projects the generated fringes onto the object to be measured, and the camera is used to photograph the object to obtain a phase-shifted fringe pattern. The specific steps include:
[0119] Step 3.1, place the calibration plate with a marking pattern in the projector field of view, project a set of sinusoidal fringe patterns onto the calibration plate through the projector, and the projection fringe frequency is f. Use the camera to collect the fringe images of the calibration plate at different phase shifts to obtain the fringe image φ in the camera field of view c (u c ,v c ).
[0120] Step 3.2: Decode the fringe image captured by the camera and calculate the absolute phase map φ of each point on the calibration plate. c (u c ,v c ). Assume that the phase value of the corresponding point in the projector field of view is Φ p (u p ,v p ), the corresponding relationship satisfies the following formula:
[0121] Φ c (u c ,v c )=Φ p (u p ,v p )
[0122] where Φ c (u c ,v c ) is the absolute phase position obtained by decoding the fringe image acquired by the camera, Φ p (u p ,v p ) is the absolute phase diagram of the sinusoidal fringe pattern generated by the projector.
[0123] Step 3.3, based on the absolute phase value, construct the pixel mapping relationship between the camera and the projector. Camera image pixel coordinates (u c ,v c ) and the projector image pixel coordinates (u p ,v p ) satisfies the following formula:
[0124]
[0125] Where W and H are the width and height resolution of the projector fringe pattern, respectively, and f is the fringe frequency.
[0126] Step 3.4, by mapping the calibration plate coordinates to the world coordinate system, using the projector's intrinsic parameter matrix and the extrinsic parameter matrix Establish the imaging model of the projector. The imaging model of the projector is described as follows:
[0127]
[0128] In the formula, Z P is the scaling factor of the projector imaging model, X m , Y m , Z m is the three-dimensional space coordinate of the object in the world coordinate system,
[0129] is the internal parameter matrix of the projector, which is defined as follows:
[0130]
[0131] where f p is the focal length of the projector, dx and dy are the horizontal and vertical dimensions of the projector pixel unit, respectively. is the origin of the projector image coordinate system.
[0132] is the external parameter matrix of the projector, which is defined as follows:
[0133]
[0134] Where R p and T p They are the rotation and translation matrices from the world coordinate system to the projector coordinate system.
[0135] Step 3.5, using the known absolute phase value Φ through the imaging model c (u c ,v c )=Φ p (u p,v p ) Position the calibration plate points in the camera field of view to the corresponding points in the projector field of view to achieve calibration.
[0136] Step 4: Apply image enhancement algorithm
[0137] Use a camera to capture four phase-shifted fringe images projected onto the surface of an object. Figure 4 Figure 1 is a schematic diagram of the projection of sinusoidal stripes onto the object to be measured. The stripe image collected by the camera is preprocessed by the GF-CL image enhancement algorithm, which includes the guided filtering algorithm and the improved CLAHE algorithm. The results obtained after the above algorithm processing are as follows: Figure 5 As shown. The GF-CL image enhancement algorithm processing process includes: first, the guided filtering algorithm is used to denoise the fringe projection collected by the camera and smooth the image in the area. Then, the histogram is equalized by the improved CLAHE (contrast-limited adaptive histogram equalization) method to adjust the image contrast and make the image details richer, including:
[0138] Guided Filtering Algorithm: Guided filtering algorithm (GC) is used in image processing for smoothing filtering while maintaining image edges. The specific definition of guided filtering is as follows:
[0139] q i =a k I i +b k ,i∈w k ⑶
[0140] where w k refers to a specific filtering window, i represents all pixels in this filtering window, q i represents the output image, I i represents the guidance image, p i represents the input image, a k and b k is the adaptive factor. Using the least squares method, the mean square error between the output image q and the original image p is minimized, so as to obtain the adaptive factor a k and b k .
[0141]
[0142] Where |w| is the number of pixels in the window, μ k is the mean of the guide image within the window, is the mean of the original image, is the variance of the guide map within the window, and ∈ is the regularization parameter.
[0143] Improved CLAHE algorithm: Improved contrast-limited adaptive histogram equalization (CLAHE) is used to enhance the image by applying histogram equalization in a local area. The improved CLAHE algorithm includes a pre-processing stage and a post-processing stage. The pre-processing stage includes:
[0144] Convert the grayscale image to RGB image, then convert the RGB image to XYZ image, and then convert the XYZ image to LAB image; then extract the L channel in the LAB image for image enhancement; when converting a single-channel grayscale image to a three-channel RGB image, the images of the three channels are exactly the same; the following is the process of converting an RGB image to an XYZ image:
[0145]
[0146] In the above formula, R represents the red channel, G represents the green channel, B represents the blue channel, R' represents the normalized red channel, G' represents the normalized green channel, and B' represents the normalized blue channel.
[0147] If the normalized value is greater than 0.04045, gamma correction needs to be performed on the normalized value. Otherwise, the result is calculated directly. The calculation formula is as follows:
[0148]
[0149] The conversion matrix from RGB image to XYZ image is:
[0150]
[0151] After getting the XYZ image, convert it to Lab color space, first use the reference white point X n , Y n ,Z n , the corresponding D65 standard values are 95.047, 100.000, 108.883, and XYZ is normalized as follows:
[0152]
[0153] In the above formula, XYZ respectively represent three color spaces of the XYZ image, X' represents the normalized red color space, Y' represents the normalized green color space, and Z' represents the normalized blue color space.
[0154] Define an auxiliary function f(t) and calculate L using formula (9)(10)(11)(12) * , a * , b * Serving size:
[0155]
[0156] L * =116×f(Y')-16 ⑽
[0157] a * =500×[f(X')-f(Y')] ⑾
[0158] b * =200×[f(Y')-f(Z')] ⑿
[0159] After the above calculations, we get the three components of the Lab color space: L * Represents brightness, ranging from 0 to 100, a * represents the change of color from green to red, b * Represents the color change from blue to yellow.
[0160] The post-processing stage enhances the image by applying histogram equalization in local areas, including:
[0161] S100, firstly divide the entire fringe projection image into continuous and non-overlapping sub-blocks, the size of the sub-block is m×n, each sub-block contains a total of N pixels, the larger the sub-block is divided, the more obvious the enhancement effect will be, but the details lost in the original image will also increase.
[0162] S101, performing histogram equalization on the segmented sub-blocks, and obtaining a corresponding grayscale histogram represented by h(x).
[0163] S102, calculate the clipping threshold T, as shown in formula (13):
[0164]
[0165] Among them C clip is the crop factor, N x and N y Respectively represent the number of pixels in the x and y directions of each individual sub-block, and M is the number of gray levels of the corresponding sub-block.
[0166] S103, based on the clipping threshold T obtained in S102, the grayscale histogram is clipped with the threshold. The total number of clipped thresholds is S, and then the total number S is evenly distributed to the grayscale histogram h(x) of each sub-block. The average grayscale value of the histogram of each sub-block is A. The calculation formula is (14)(15). The reallocated histogram is H(x), as shown in formula (16):
[0167]
[0168] S104, performing equalization processing on the reallocated sub-block histogram, such as Figure 3 shown.
[0169] S105, interpolation operation. Through the mapping relationship between the image pixels and the grayscale conversion function of the block area, the grayscale value of the corresponding pixel is calculated by interpolation operation, thereby improving the calculation efficiency. According to the number of adjacent points, when the mapping function involves 4 reference points, bilinear interpolation is used; when it involves 2 points, unilinear interpolation is used; if there is only one reference point, the grayscale value of the sub-block is directly used. Use three different colors to mark each block area: the pixels in the four corner areas marked with yellow directly calculate the grayscale value according to the mapping function of the sub-block where they are located; the pixel values of the four edge areas marked with green obtain two mapping values through the mapping function of the two adjacent sub-blocks, and then linear interpolation operation is performed on these two values; the interpolation operation formula for the green area is as follows:
[0170]
[0171] In formula (17), f(x, y) is the pixel value of the point to be found, f1 and f2 are the mapping values of the point obtained by transforming the mapping function of two adjacent sub-blocks, and (x1, y1) and (x2, y2) are the center pixel coordinates of two adjacent sub-blocks.
[0172] The pixel value of the central area marked in pink is transformed by the mapping function of the four surrounding sub-blocks to obtain four mapping values, and then the four values are bilinearly interpolated. The expression is as follows:
[0173]
[0174]
[0175] Among them, f'1, f'2, f'3, and f'4 are the mapping values of the point obtained by transforming the mapping function of the surrounding four sub-blocks, (x'1, y'1), (x'1, y'2), (x'2, y'1), and (x'2, y'2) are the center pixel coordinates of the four surrounding sub-blocks respectively, and f(x, y) is the pixel value of the point.
[0176] Step 5: Get the package phase
[0177] Use the camera to capture four phase-shifted fringe images projected on the surface of the object, and extract the wrapped phase distribution through the four-step phase calculation formula. Combined with the above formula (1), the phase function is obtained by solving formula (2):
[0178]
[0179] Among them, I1(x, y) represents the light intensity of the first projection fringe, I2(x, y) represents the light intensity of the second projection fringe, I3(x, y) represents the light intensity of the third projection fringe, and I4(x, y) represents the light intensity of the fourth projection fringe.
[0180] Step 6, Gray code generation
[0181] Generate five Gray code patterns corresponding to the projection area and project them onto the surface of the object to be tested to identify each pixel. Gray code is a set of numbers, each number is represented by binary, and a unique binary Gray code pattern is generated. Each projected pixel will be encoded as a unique Gray code value, and each column or row of the projection will correspond to a Gray code value.
[0182] Step 7, Binarization
[0183] The corresponding threshold is determined according to the four modulated Gray code images, and the generated Gray code image is binarized. In the binarization of the Gray code image, a fringe projection is first projected by a projector, and the projected pattern is photographed by a camera. The average grayscale of the photographed image is obtained to determine the corresponding threshold, as shown in formula (19):
[0184]
[0185] Where T(x,y,n1) represents the average intensity of the four shifted patterns, which can be calculated as an appropriate pixel-level threshold, x and y represent the abscissa and ordinate of the point in the image coordinate system, respectively, and m represents the nth image in the four-step phase shift method.
[0186] By comparing the threshold value G(x, y, n2) of the corresponding pixel point in the Gray code pattern with the average intensity threshold value T(x, y, n1), the corresponding binary image is generated. The comparison method is: if G(x, y, n2) is greater than T(x, y, n1), the threshold value is 1, and if it is less than the threshold value, the threshold value is 0. The judgment formula (20) is as follows:
[0187]
[0188] Where Q(x, y, n) is the codeword information obtained through threshold segmentation calculation, n1 is the number of phase shift patterns for calculating the average intensity threshold, and n2 is the number of Gray code patterns.
[0189] Step 8: Unwrap the phase using complementary Gray code
[0190] By comparing the changes of the Gray code image on the surface of the object with the original Gray code image, the true phase is solved by combining the unwrapping calculation formula. Since the edge jump phenomenon will occur at the transition of the Gray code, it will cause errors and accuracy. By using the characteristics of the complementary Gray code, the phase jump between the black and white stripes is eliminated, the wrapped phase is unwrapped, and the continuous true phase is obtained.
[0191] After obtaining the corresponding codeword information, the obtained codeword information is decoded, and the fringe order K1 can be obtained by the following formula (21) (22):
[0192]
[0193] K1(x,y)=i(V1(x,y)) (22)
[0194] Among them C i (x,y) is the Gray code bit value of the pixel corresponding to the i-th Gray code pattern, V1(x,y) represents the binary value calculated for the n-th corresponding pixel, i(V(x,y)) represents the conversion operation between Gray code and binary code and decimal number, and K1(x,y) represents the result after rearrangement;
[0195] The fifth Gray code pattern is introduced to effectively avoid jump errors. The specific method is: using the fringe order K1 obtained above, all five Gray code patterns are used to obtain the fringe order K2. In the non-edge area, the wrapping phase unwrapping uses K1; in the edge area, the phase unwrapping is performed using K2, thereby improving the accuracy of the edge area;
[0196] The fringe order K2 can be obtained by formulas (23) and (24):
[0197]
[0198] K2(x,y)=i(V2(x,y)) (24)
[0199] The obtained fringe order information K1 and K2 are combined with the wrapped phase obtained by formula (2) to convert the wrapped phase into a continuous real phase. The calculation formula is as shown in formula (25):
[0200]
[0201] Where K1 is the phase order obtained from log N frames of Gray code pattern, K2 is extracted from log N+1 frames of Gray code pattern, and ф(x,y) is the unwrapped continuous phase.
[0202] Step 9: 3D Reconstruction
[0203] Based on the absolute phase value after unwrapping and combined with the calibration parameters of the camera and projector, the three-dimensional coordinates of the object surface are calculated, and finally the three-dimensional reconstruction of the object is completed.
[0204] The camera parameter matrix M is obtained by using the calibration parameters of the camera and projector. c and the projector parameter matrix M p :
[0205]
[0206] Above is the element in the camera calibration parameter matrix. Elements in the projector calibration parameter matrix.
[0207] The conversion relationship between the world coordinate system and the pixel coordinate system is as follows:
[0208]
[0209] In the above transformation relationship, the world coordinate system: [X m Y m Z m ] T ; Pixel coordinate system: camera[u c v c ] T , projector[u p v p ] T , where u c v c Respectively represent the horizontal and vertical coordinates of the pixel point on the camera in the pixel coordinate system, u p v p They respectively represent the horizontal and vertical coordinates of the pixel point on the projector in the pixel coordinate system.
[0210] When projecting a structured light fringe pattern onto an object, the real phase of the same point in the real phase obtained by the complementary Gray code and the four-step phase shift method is the same in the coordinates of the camera and the projector. Of course:
[0211] ψ c (u c ,v c )=ψ p (u p ,v p )
[0212] Since the projected fringe images are uniformly distributed, the width (W) of the coded fringe is the same, so:
[0213]
[0214] Substituting the obtained calibration parameters of the projector and camera into formula (26) can obtain the precise three-dimensional coordinates of the object surface.
[0215]
[0216] Where (x c ,y c ) and (x p ,y p ) represent the pixel coordinates of the camera and projector respectively, (X W ,Y W ,Z W ) represents the three-dimensional coordinates of the measured object. The obtained three-dimensional coordinates are displayed, such as Figure 6 As shown in FIG. , this is the result image after three-dimensional reconstruction.
[0217] Compared with the traditional three-step phase shift method and Gray code 3D reconstruction technology, the present invention improves the contrast and effectively removes noise by using an image enhancement algorithm. In addition, the combination of the four-step phase shift method and the complementary Gray code for 3D reconstruction not only eliminates the edge jump error in the traditional Gray code reconstruction, but also ensures that there is no jump and discontinuity when obtaining the true phase. At the same time, the non-prominence between the black and white stripes in the fringe projection is improved, which significantly enhances the details, thereby improving the reconstruction accuracy.
[0218] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A three-dimensional reconstruction method based on structured light image enhancement, characterized in that: The steps include: Step 1, generate fringe coding patterns: use MATLAB programming to generate four sinusoidal fringe patterns with different phase shifts, and project them onto the surface of the object to be tested; Step 2, camera calibration: Use a checkerboard calibration plate of known size to calibrate the camera, take images of the calibration plate at different angles, and then use the camera calibration toolbox in MATLAB to calculate the camera's intrinsic and extrinsic parameters; Step 3, projector calibration: place a calibration plate with a marking pattern in the projector field of view, project a set of sinusoidal fringe patterns through the projector, and record the projected fringe images of the calibration plate under different phase shift conditions; use a camera to capture the calibration plate image and decode the fringe code, calculate the absolute phase map of each point on the calibration plate, and thus obtain the absolute phase position of the fringe image captured by the camera; according to the absolute phase value, use the difference method to calculate the lateral absolute phase value of adjacent fringe pixel points to determine the coordinate mapping relationship in the camera and projector field of view, thereby completing the calibration; finally, using the corresponding relationship between the camera and the projector, combined with the intrinsic parameter matrix, extrinsic parameter matrix and image coordinate system transformation matrix of the projector, derive the imaging model of the projector to achieve the unification of the projector and camera coordinate systems; Step 4, using a camera to capture four phase-shifted fringe images projected on the surface of the object, and preprocessing the fringe images collected by the camera using the GF-CL image enhancement algorithm. The GF-CL image enhancement algorithm includes a guided filtering algorithm and an improved CLAHE algorithm. The GF-CL image enhancement algorithm processing process includes: first, using the guided filtering algorithm to denoise the fringe projection collected by the camera and smooth the image in the area; then, using the improved CLAHE algorithm to perform histogram homogenization and adjust the image contrast; Step 5, obtain the package phase: extract the package phase distribution through the four-step phase calculation formula; Step 6, Gray code generation: Generate five Gray code patterns corresponding to the projection area and project them onto the surface of the object to be tested to identify each pixel point; Step 7, binary conversion: determine the corresponding threshold value according to the four modulated Gray code images, and perform binary processing on the generated Gray code image; Step 8, using Gray code to unwrap the phase: by comparing the changes between the Gray code image on the surface of the object and the original Gray code image, the real phase is solved by combining the unwrapping calculation formula; Step 9, 3D reconstruction: Based on the absolute phase value after unwrapping, combined with the calibration parameters of the camera and projector, the 3D coordinates of the object surface are calculated to finally complete the 3D reconstruction of the object.
2. The three-dimensional reconstruction method based on structured light image enhancement according to claim 1, characterized in that: The step 1 specifically includes: the phase-shifted fringe image projected on the surface of the object is expressed by formula (1): Among them, I(x,y) represents the intensity of the projected fringes, A(x,y) represents the intensity of the image background, and B(x,y) represents the modulation amplitude of the image fringes. is the phase corresponding to the point (x, y), θ represents the known phase shift; the phase shift for each movement is Then a phase shift of 2π is generated four times, generating four pictures in total; the frequency of the fringe pattern is adapted to the detail resolution of the surface of the object being measured.
3. The three-dimensional reconstruction method based on structured light image enhancement according to claim 1, characterized in that: The specific steps of projector calibration in step 3 are as follows: Step 3.1, place the calibration plate with a marking pattern in the field of view of the projector, project a set of sinusoidal fringe patterns onto the calibration plate through the projector, and use the camera to collect the fringe images of the calibration plate at different phase shifts to obtain the fringe images Φ in the camera field of view c (u c ,v c ); Step 3.2: Decode the fringe image captured by the camera and calculate the absolute phase map φ of each point on the calibration plate. c (u c ,v c ), assuming that the phase value of the corresponding point in the projector field of view is Φ p (u p ,v p ), the corresponding relationship satisfies the following formula: Φ c (u c ,v c )=Φ p (u p ,v p ) where Φ c (u c ,v c ) is the absolute phase position obtained by decoding the fringe image acquired by the camera, Φ p (u p ,v p ) is the absolute phase map of the sinusoidal fringe pattern generated by the projector; Step 3.3, based on the absolute phase value, construct the pixel mapping relationship between the camera and the projector, the camera image pixel coordinates (u c ,v c ) and the projector image pixel coordinates (u p ,v p ) satisfies the following formula: Where W and H are the width and height resolution of the projector fringe pattern, respectively; Step 3.4, by mapping the calibration plate coordinates to the world coordinate system, using the projector's intrinsic parameter matrix and the extrinsic parameter matrix Establish the imaging model of the projector. The imaging model of the projector is described as follows: In the formula, Z P is the scaling factor of the projector imaging model, X m , Y m , Z m is the three-dimensional space coordinate of the object in the world coordinate system, The definition is as follows: where f p is the focal length of the projector, dx and dy are the horizontal and vertical dimensions of the projector pixel unit, respectively. is the origin of the projector image coordinate system; The definition is as follows: Where R p and T p They are the rotation and translation matrices from the world coordinate system to the projector coordinate system; Step 3.5, using the known absolute phase value Φ through the imaging model c (u c ,v c )=Φ p (u p ,v p ) Position the calibration plate points in the camera field of view to the corresponding points in the projector field of view to achieve calibration.
4. The three-dimensional reconstruction method based on structured light image enhancement according to claim 1, characterized in that: The guided filtering algorithm in step 4 is used for smoothing filtering in image processing while maintaining the image edge. The specific definition of guided filtering is as follows: q i =a k I i +b k ,i∈w k ⑶ where w k refers to a specific filtering window, i represents all pixels in this filtering window, q i represents the output image, I i represents the guidance image, p i represents the input image, a k and b k is the adaptive factor. By using the least squares method, the mean square error between the output image q and the original image p is minimized, so as to obtain the adaptive factor a k and b k : Where |w| is the number of pixels in the window, μ k is the mean of the guide image within the window, is the mean of the original image, is the variance of the guide map within the window, and ∈ is the regularization parameter.
5. The three-dimensional reconstruction method based on structured light image enhancement according to claim 2, characterized in that: The improved CLAHE algorithm in step 4 includes a pre-processing stage and a post-processing stage, and the pre-processing stage includes: Convert the grayscale image to RGB image, then convert the RGB image to XYZ image, and then convert the XYZ image to LAB image; then extract the L channel in the LAB image for image enhancement; when converting a single-channel grayscale image to a three-channel RGB image, the images of the three channels are exactly the same; the following is the process of converting an RGB image to an XYZ image: Wherein, R represents the red channel, G represents the green channel, B represents the blue channel, R' represents the normalized red channel, G' represents the normalized green channel, and B' represents the normalized blue channel; If the normalized value is greater than 0.04045, gamma correction needs to be performed on the normalized value. Otherwise, the result is calculated directly. The calculation formula is as follows: The conversion matrix from RGB image to XYZ image is: After obtaining the XYZ image, convert it to Lab color space, first use the reference white point X n , Y n ,Z n , the corresponding D65 standard values are 95.047, 100.000, 108.883, and XYZ is normalized as follows: Where XYZ represents the three color spaces of the XYZ image, X' represents the normalized red color space, Y' represents the normalized green color space, and Z' represents the normalized blue color space; Define an auxiliary function f(t) and calculate L using formula (9)(10)(11)(12) * , a * , b * Serving size: L * =116×f(Y')-16 ⑽ a * =500×[f(X')-f(Y')] ⑾ b * =200×[f(Y')-f(Z')] ⑿ After the above calculations, we get the three components of the Lab color space: L * Represents brightness, ranging from 0 to 100, a * represents the change of color from green to red, b * Represents the change of color from blue to yellow; The post-processing stage enhances the image by applying histogram equalization in local areas, including: S100, firstly, the entire fringe projection image is divided into continuous and non-overlapping sub-blocks, the size of the sub-block is m×n, and each sub-block contains a total number of N pixels; S101, performing histogram equalization on the segmented sub-blocks, and obtaining a corresponding grayscale histogram represented by h(x); S102, calculate the clipping threshold T, as shown in formula (13): Among them C clip is the crop factor, N x and N y Respectively represent the number of pixels in the x and y directions of each individual sub-block, and M is the number of gray levels of the corresponding sub-block; S103, according to the clipping threshold T obtained in S102, the grayscale histogram is clipped with the threshold. The total number of clipped thresholds is S, and then the total number S is evenly distributed to the grayscale histogram h(x) of each sub-block. The average grayscale value of the histogram of each sub-block is A. The calculation formula is (14)(15). The reallocated histogram is H(x), as shown in formula (16): S104, performing equalization processing on the sub-block histogram after reallocation; S105, through the mapping relationship between the image pixel and the grayscale conversion function of the block area, the grayscale value of the corresponding pixel is calculated by interpolation operation, so as to improve the calculation efficiency. The interpolation operation process includes: according to the number of adjacent points, when the mapping function involves 4 reference points, bilinear interpolation is used; when it involves 2 points, unilinear interpolation is used; if there is only one reference point, the grayscale value of the sub-block is directly used; three different colors of yellow, green and pink are used to mark each block area: the grayscale value of the pixels in the four corner areas marked with yellow is directly calculated according to the mapping function of the sub-block; the pixel values of the four edge areas marked with green are obtained by the mapping function of the two adjacent sub-blocks to obtain two mapping values, and then the two values are linearly interpolated; the interpolation operation formula of the green area is as follows: In formula (17), f(x, y) is the pixel value of the point to be found, f1 and f2 are the mapping values obtained by transforming the mapping function of the two adjacent sub-blocks of the point to be found, (x1, y1) and (x2, y2) are the central pixel coordinates of the two adjacent sub-blocks; The pixel value of the central area marked in pink is transformed by the mapping function of the four surrounding sub-blocks to obtain four mapping values, and then the four values are bilinearly interpolated. The expression is as follows: Among them, f'1, f'2, f'3, and f'4 are the mapping values of the point obtained by transforming the mapping function of the surrounding four sub-blocks, (x'1, y'1), (x'1, y'2), (x'2, y'1), and (x'2, y'2) are the center pixel coordinates of the four surrounding sub-blocks respectively, and f(x, y) is the pixel value of the point.
6. The three-dimensional reconstruction method based on structured light image enhancement according to claim 1, characterized in that: The step 5 specifically includes: combining formula (1) and using formula (2) to solve the phase function Among them, I1(x, y) represents the light intensity of the first projection fringe, I2(x, y) represents the light intensity of the second projection fringe, I3(x, y) represents the light intensity of the third projection fringe, and I4(x, y) represents the light intensity of the fourth projection fringe.
7. The three-dimensional reconstruction method based on structured light image enhancement according to claim 1, characterized in that: In step 6, the Gray code is a set of number series, each number is represented by binary, and a uniquely identifiable binary Gray code pattern is generated. Each projected pixel point will be encoded as a unique Gray code value, and each column or row of the projection will correspond to a Gray code value.
8. The three-dimensional reconstruction method based on structured light image enhancement according to claim 1, characterized in that: The step 7 specifically includes: in the binarization of the Gray code image, firstly, a fringe projection is projected by a projector, the projected pattern is photographed by a camera, and the average grayscale is calculated by the photographed image, so as to determine the corresponding threshold value, as shown in formula (19): Where T(x,y,n1) represents the average intensity of the four shifted patterns, which can be calculated as an appropriate pixel-level threshold, x and y represent the abscissa and ordinate of the point in the image coordinate system, respectively, and m represents the nth image in the four-step phase shift method; By comparing the threshold value G(x, y, n2) of the corresponding pixel point in the Gray code pattern with the average intensity threshold value T(x, y, n1), the corresponding binary image is generated. The comparison method is: if G(x, y, n2) is greater than T(x, y, n1), the threshold value is 1, and if it is less than the threshold value, the threshold value is 0. The judgment formula (20) is as follows: Where Q(x, y, n) is the codeword information obtained through threshold segmentation calculation, n1 is the number of average intensity threshold phase shift patterns, and n2 is the number of Gray code patterns.
9. The three-dimensional reconstruction method based on structured light image enhancement according to claim 1, characterized in that: The step 8 specifically includes: After obtaining the corresponding codeword information, the obtained codeword information is decoded, and the fringe order K1 can be obtained by the following formula (21) (22): K1(x,y)=i(V1(x,y)) (22) Among them C i (x,y) is the Gray code bit value of the pixel corresponding to the i-th Gray code pattern, V1(x,y) represents the binary value calculated for the n-th corresponding pixel, i(V(x,y)) represents the conversion operation between Gray code and binary code and decimal number, and K1(x,y) represents the result after rearrangement; The fifth Gray code pattern is introduced to effectively avoid jump errors. The specific method is: using the obtained fringe order K1, all five Gray code patterns are used to obtain the fringe order K2. In the non-edge area, the wrapping phase unwrapping uses K1; in the edge area, the phase unwrapping is performed through K2, thereby improving the accuracy of the edge area; The fringe order K2 can be obtained by formulas (23) and (24): K2(x,y)=i(V2(x,y)) (24) The obtained fringe order information K1 and K2 are combined with the wrapped phase obtained by formula (2) to convert the wrapped phase into a continuous real phase. The calculation formula is as follows: Where K1 is the phase order obtained from log N frames of Gray code pattern, K2 is extracted from log N+1 frames of Gray code pattern, and ф(x,y) is the unwrapped continuous phase.
10. The three-dimensional reconstruction method based on structured light image enhancement according to claim 7, characterized in that: The step 9 specifically includes: after obtaining the real phase, the internal and external parameters of the camera and projector obtained by steps 2 and 3 are combined with the four-step phase shift fringe pattern and the complementary Gray code fringe pattern to obtain the absolute phase and determine the phase value of each pixel, so as to perform three-dimensional reconstruction measurement, and use the calibration parameters of the camera and projector to obtain the parameter matrix M of the camera c and the projector parameter matrix M p : In the formula, is the element in the camera calibration parameter matrix, are the elements in the projector calibration parameter matrix. Substitute the obtained calibration parameters of the projector and camera into formula (26) to obtain the precise three-dimensional coordinates of the object surface; Where (x c ,y c ) and (x p ,y p ) represent the pixel coordinates of the camera and projector respectively, (X W ,Y W ,Z W ) represents the three-dimensional coordinates of the measured object.
Citation Information
Patent Citations
Quick three-dimensional measurement method based on sinusoidal and binary fringe projection
CN108534714A
Rapid and effective mirror surface highlight image enhancement method and device and storage medium
CN111833271A
Underwater image enhancement method
CN115937029A
Structured light three-dimensional reconstruction method based on stripe image enhancement
CN116824047A
Monocular structured light three-dimensional reconstruction method based on fringe projection image enhancement
CN118037577A
Cited By
Color Gray code coding auxiliary phase unwrapping method and applied three-dimensional imaging method and system
CN120293034A
Phase unwrapping method, computer equipment and readable storage medium
CN120740499A
Underwater high-speed three-dimensional measurement method based on stripe structured light
CN120760636A
Compartment ore X-ray image three-dimensional reconstruction method and system
CN120852683A
A method and system for three-dimensional reconstruction of a carload of ore x-ray image
CN120852683B