A monocular structured light three-dimensional reconstruction method based on fringe projection image enhancement
By combining bilateral filtering, nonlocal mean filtering, and the CLAHE algorithm to enhance the stripe projection image, and by combining complementary Gray code and phase shifting method to obtain phase information, the problems of noise and overexposure in monocular structured light 3D reconstruction are solved, and higher accuracy 3D reconstruction is achieved.
Patent Information
- Application Number
- CN202410169303.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-06
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2044-02-06
AI Technical Summary
In monocular structured light 3D reconstruction, fringe projection images are easily affected by noise or overexposure, leading to a decrease in reconstruction accuracy and effect.
A method combining bilateral filtering and nonlocal mean filtering, along with an improved CLAHE image enhancement algorithm, is used to denoise and enhance the contrast of striped projection images. Complementary Gray code and phase shift method are used to obtain the phase information of the object, and the three-dimensional information is calculated by computer.
It improves the accuracy and effect of monocular structured light 3D reconstruction, enhances image contrast and detail, and improves reconstruction accuracy.
Smart Images

Figure CN118037577B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of 3D reconstruction technology, and relates to a monocular structured light 3D reconstruction method based on fringe projection image enhancement. Background Technology
[0002] Currently, computer vision is receiving increasing attention, and 3D reconstruction technology, as a cutting-edge technology in the field of computer vision, has become indispensable in various fields such as medicine and industry. Therefore, efficiently and accurately acquiring the 3D information of research objects and reconstructing their models is a research task that needs further breakthroughs in the field of 3D reconstruction.
[0003] Monocular structured light systems are very suitable for lightweight 3D reconstruction applications due to their simple structure and low cost. Therefore, they rely heavily on structured light projection during the reconstruction process. However, noise or overexposure during the reconstruction process can lead to the loss of stripe projection image information, affecting the reconstruction accuracy and effect of the final 3D reconstruction system. Summary of the Invention
[0004] To address the problems existing in the prior art, this invention provides a monocular structured light 3D reconstruction method with fringe projection image enhancement. The method utilizes a combination of bilateral filtering and nonlocal mean filtering, along with an improved contrast-limited histogram equalization (CLAHE) image enhancement method, to enhance the acquired fringe projection image, recover the information of the fringe projection image, and improve the accuracy of monocular structured light 3D reconstruction.
[0005] The technical solution adopted in this invention is as follows:
[0006] This invention first establishes a monocular structured light 3D reconstruction system, using a projector to project coded structured light patterns onto a calibration board and the object to be reconstructed. Then, the industrial camera and projector are calibrated, and the proposed BN-C image enhancement algorithm is used to enhance the stripe projection image. Then, Gray code and phase shifting method are combined to obtain the phase information of the object and input into the computer. Finally, the computer calculates the 3D information based on the calibration information and phase information to complete the point cloud reconstruction.
[0007] Step 1: Build a monocular structured light 3D reconstruction system, which includes an industrial camera, a projector and a computer;
[0008] Step 2: Project the designed coded structured light pattern onto the circular calibration plate and the reconstructed object using the projector;
[0009] Step 3: Detect the center of the calibration board based on the all-white image projected onto the calibration board;
[0010] Step 4: Perform industrial camera calibration. Use the inverse camera method to calibrate the projector, obtain the internal and external parameters of the industrial camera and the projector, and perform distortion correction separately.
[0011] Step 5: For fringe projection images, a BN-C image enhancement algorithm is proposed. First, a combination of bilateral filtering and nonlocal mean filtering is used to denoise the fringe projection images acquired by the industrial camera. Then, the contrast is adjusted by the improved CLAHE method.
[0012] Step 6: Obtain the phase information of the reconstructed object by combining complementary Gray code and phase shifting method;
[0013] Step 7: Combine the intrinsic and extrinsic parameters of the camera and projector, and use the phase information to obtain the three-dimensional coordinates of each point on the object;
[0014] Step 8: Generate a sparse point cloud map based on the object's three-dimensional coordinates to complete the three-dimensional reconstruction.
[0015] Furthermore, the BN-C image enhancement algorithm is used to enhance the stripe projection image; the specific implementation process is as follows:
[0016] S51 uses a combination of bilateral filtering and nonlocal mean filtering to denoise the image;
[0017] First, calculate the smoothness information F, I of each pixel in the fringe projection image. k For the filter kernel K excluding the center pixel I x For pixels outside the range, F is calculated as follows:
[0018]
[0019] The NLM filter is used to denoise pixels in the boundary region of a striped projection image as follows:
[0020]
[0021] Where S represents the coverage area of the filter window, x is the coordinate of the center pixel within the filter window, q is the coordinate of the neighboring pixels within the filter window, |xq| represents the spatial proximity, and I x I is the value of the center pixel of the neighborhood in the input image. q For other pixel values in the neighborhood, ||I x -I q || represents pixel value similarity, W x Used for weight normalization; V(x) represents the neighborhood of pixel x, V(y) represents the neighborhood of pixel y, α represents the standard deviation of Gaussian noise in the image, h is the filter coefficient, I y Represents the pixel value of y, where α is positively correlated with h; Z xUsed for weight normalization.
[0022] S52, use the improved CLAHE method to enhance the contrast of the denoised striped projection image;
[0023] First, histogram statistics are performed on the striped projection image, and all pixel values are counted within the range of 0-255. The statistical information of the top 5% of dark areas and the bottom 5% of bright areas in grayscale are removed to obtain a new striped projection image histogram T with grayscale level L of [0, 230], which is [12, 242] of the original histogram grayscale level. Then, histogram T is subjected to CLAHE, and finally the removed information is added back to the final histogram.
[0024] CLAHE uses a preset clipping threshold (clip_limit) to clip the histogram of the striped projection image, and then evenly distributes the clipped portion to other gray levels. Finally, it performs histogram equalization on the clipped and redistributed histograms.
[0025] The clipping threshold, clip_limit, is calculated using the following formula:
[0026] clip_limit = β·P a
[0027]
[0028] Where β is the empirical coefficient for the cropping threshold, and its value ranges from [2, 4], P a The number of times each statistical count in the sub-region is evenly distributed among the various gray levels, y l L represents the number of gray levels, where L is the number of gray levels.
[0029] Calculate the dynamic range D of the histogram for each stripe projection image to determine the final clipping threshold coefficient β. The dynamic range D is the ratio of the average brightness of the highlight area to the average brightness of the low-brightness area in the histogram of the stripe projection image. The larger the dynamic range, the smaller the clip_limit, and the greater the contrast limiting effect. Select the low-brightness area occupying the top 50% of the histogram pixel values and the highlight area occupying the bottom 50% of the histogram pixel values, and calculate the average brightness L of the highlight area for each. ave_h The average value L in the low-brightness area ave_l The dynamic range is obtained as
[0030]
[0031] The addition of one is to prevent the number of pixel values in either the highlight or low-light areas from being zero.
[0032] Finally, the cropping threshold coefficient β in each sub-region, where L is the number of gray levels.
[0033] The histogram of the striped projection image is cropped and redistributed according to the clipping threshold clip_limit. The portions of the histogram exceeding clip_limit are clipped and summed to obtain the total number of clipped portions, S. c Calculate as follows:
[0034]
[0035] S c The gray levels are evenly distributed, with each gray level receiving an average of S. a Calculate as follows:
[0036]
[0037] The first allocation is completed as follows:
[0038]
[0039] After the initial allocation, there may be a remaining number of cropped items that cannot be evenly distributed across each grayscale level. For the remaining number of cropped items S... r To redistribute the allocation, calculate the allocation step size as follows:
[0040]
[0041] Starting from the smallest gray level, the scanning proceeds according to the assigned step size. If the current number of gray levels is less than the clipping threshold (clip_limit), one gray level is assigned. This process continues until the last gray level is scanned. If not all pixels are assigned after the scan is completed, a new step size is calculated using the formula to redistribute the pixels until all remaining pixels are assigned. Since the histogram statistics of the striped projection image contain a decimal part, the decimal part is rounded off and added to the statistical value to obtain the final contrast-limited histogram.
[0042] Assuming the relationship between the histogram and grayscale values of the original image's striped projection is f(x), then the cumulative grayscale histogram is F(X). After equalization, the relationship between the histogram and grayscale values is f(y), and the cumulative histogram is F(Y). Therefore, the mapping relationship between the original grayscale value x and the grayscale value y can be expressed as y = H(x).
[0043]
[0044] Finally, the pixels of the removed dark and bright areas are output with their original pixel values to obtain the final enhanced striped projection image.
[0045] Furthermore, the phase information of the reconstructed object is obtained by combining complementary Gray code with the phase-shifting method; the specific implementation process is as follows:
[0046] An encoding method combining Gray code and phase shifting is adopted. The Gray code encoding method first lists 2n-1 encoding sequences of n-1 bits Gray code, then inverts these sequences to obtain their inverse sequences, which are written after the previous encoding sequence. This results in a sequence of 2n code values. Finally, "0"s are added to the left of the positive sequence code values, and "1"s are added to the left of the inverse sequence code values to obtain the n-bit Gray code encoding sequence.
[0047] Before projecting the Gray code pattern, two black and white solid color patterns are projected onto the object to be tested to identify and remove the shadowed parts.
[0048] The leftmost (most significant) bit of the Gray code is taken as the most significant bit of the binary code. The second bit of the binary code is obtained by XORing the second bit of the Gray code with the most significant bit obtained in the previous step. This process is repeated until the least significant bit is reached. Let the Gray code value be G = G n G n-1 ...G2G1, which can be converted to binary code as B=B n B n-1 ...B2B1, the specific conversion relationship is as follows:
[0049]
[0050] A four-step phase-shifting method with N=4 is chosen to design the encoding pattern. Four periodically varying sinusoidal grating patterns are projected onto the surface of the target object in chronological order, shifting by two phases each time. The phase values of the four images vary periodically between 0 and 255. The phase of a pixel and its actual coordinates in the pixel coordinate system have a sinusoidal function relationship. The formula for solving the wrapping phase using the four-step phase-shifting method is as follows:
[0051]
[0052]
[0053]
[0054]
[0055] Simultaneous solution to obtain the package phase
[0056]
[0057] The absolute principal phase is solved using complementary Gray code combined with a four-step phase shift technique. A four-bit Gray code pattern is selected; four Gray code patterns can generate 24 coded values. GC1–GC4 are designed as four-level Gray code patterns, and GC5 is the fifth pattern in a five-level complementary Gray code. k1 corresponds to the fringe order of the four-level Gray code pattern, and k2 corresponds to the fringe order of the fifth complementary Gray code pattern. To extend the wrapper phase to [0, 2π], the final absolute phase is:
[0058]
[0059] Furthermore, the calculation process for the three-dimensional point cloud coordinates is as follows:
[0060] After system calibration, the camera's projection matrix A is obtained. c Projection matrix A of the projector p for
[0061]
[0062]
[0063] in For elements in the camera projection matrix, For elements in the projection matrix of the projector
[0064] For the same point m, the world coordinate system is: [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 These are the x and y coordinates of a pixel on the camera in the pixel coordinate system, u p v p These are the x and y coordinates of the pixel on the projector in the pixel coordinate system.
[0065] Because the world coordinate system and pixel coordinate system have the following relationship
[0066]
[0067]
[0068] A striped pattern is projected onto the object, and the absolute phase is obtained through phase-shift decoding. The phase of the same object point is the same, and the phase of the corresponding pixel at the camera end is... Phase of corresponding pixel at the projector end If all the vertical stripes on the projector are the same, then...
[0069]
[0070] The projector's striped image is composed of uniform stripes, where W is the field width of the coded stripes.
[0071]
[0072] The three-dimensional coordinates of point m can be obtained immediately by combining the two methods.
[0073]
[0074] Compared with existing technologies, the BN-C image enhancement algorithm for striped projection images proposed in this invention considers the selection of filtering methods for flat and boundary regions, effectively denoising different regions of the striped projection image; when achieving contrast enhancement, it avoids the influence of striped projection on the overall contrast, and while enhancing the contrast of the region of interest, it improves the overall detail of the image and effectively improves the reconstruction accuracy. Attached Figure Description
[0075] Figure 1 This is a flowchart of the method of the present invention.
[0076] Figure 2 This is a flowchart of the BN-C image enhancement algorithm.
[0077] Figure 3 This is a structural diagram of a monocular structured light device.
[0078] Figure 4 This is a graph showing the relationship between β and D.
[0079] Figure 5 This is a reconstructed image of an object illuminated by white light.
[0080] Figure 6 This is an image of an object under fringe projection.
[0081] Figure 7 This is an image enhanced using the BN-C algorithm of this invention. Detailed Implementation
[0082] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0083] The technical solution adopted in this invention is a monocular structured light 3D reconstruction method based on stripe projection image enhancement. The method includes the following steps: Step 1, building a monocular structured light 3D reconstruction system, the system including an industrial camera, a projector and a computer;
[0084] Step 2: Project the designed coded structured light pattern onto the circular calibration plate and the reconstructed object using the projector;
[0085] Step 3: Detect the center of the calibration board based on the all-white image projected onto the calibration board;
[0086] Step 4: Perform industrial camera calibration. Use the inverse camera method to calibrate the projector, obtain the internal and external parameters of the industrial camera and the projector, and perform distortion correction separately.
[0087] Step 5: For fringe projection images, a BN-C image enhancement algorithm is proposed. First, a combination of bilateral filtering and nonlocal mean filtering is used to denoise the fringe projection images acquired by the industrial camera. Then, the contrast is adjusted by the improved CLAHE method.
[0088] Step 6: Obtain the phase information of the reconstructed object by combining complementary Gray code and phase shifting method;
[0089] Step 7: Combine the intrinsic and extrinsic parameters of the camera and projector, and use the phase information to obtain the three-dimensional coordinates of each point on the object;
[0090] Step 8: Generate a sparse point cloud map based on the object's three-dimensional coordinates to complete the three-dimensional reconstruction.
[0091] like Figure 2 The diagram shows the flowchart of the BN-C image enhancement algorithm; the specific implementation process is to use the BN-C image enhancement algorithm to enhance the stripe projection image.
[0092] S51 uses a combination of bilateral filtering and nonlocal mean filtering to denoise the image;
[0093] First, calculate the smoothness information F, I of each pixel in the fringe projection image. k For the filter kernel K excluding the center pixel I x For pixels outside the range, F is calculated as follows:
[0094]
[0095] To determine the smoothness information of each pixel in the fringe projection image, different filtering methods are selected. The Border-Frequency (BF) filter gives a higher weight to the center pixel, decreasing its weight as the pixel moves further away. The Non-Limited Filter (NLM) filter, on the other hand, gives almost equal weight to pixels within its search area, paying insufficient attention to the center pixel. Therefore, the BF filter is more effective at denoising pixels in the smooth regions of the fringe projection image. In the NLM filter, pixels with the highest similarity to pixels in the boundary regions of the fringe projection image are almost entirely located in the boundary regions, while pixels in the smooth regions have almost zero weight for pixels centered on the boundary regions. Therefore, the NLM filter is more effective at denoising pixels in the boundary regions of the fringe projection image. The final filtering results are as follows:
[0096]
[0097] Where S represents the coverage area of the filter window, x is the coordinate of the center pixel within the filter window, q is the coordinate of the neighboring pixels within the filter window, |xq| represents the spatial proximity, and I x I is the value of the center pixel of the neighborhood in the input image. q For other pixel values in the neighborhood, ||I x -I q || represents pixel value similarity, W x Used for weight normalization; V(x) represents the neighborhood of pixel x, V(y) represents the neighborhood of pixel y, α represents the standard deviation of Gaussian noise in the image, h is the filter coefficient, I y Represents the pixel value of y, where α is positively correlated with h; Z x Used for weight normalization.
[0098] S52, use the improved CLAHE method to enhance the contrast of the denoised striped projection image;
[0099] First, histogram statistics are performed on the striped projection image, and all pixel values are counted within the range of 0-255. Since the striped projection is black and white and the object reflects or absorbs light, in order not to affect the striped information, the contrast of the region of interest in the striped projection image is enhanced. Therefore, when performing CLAHE, the statistical information of the first 5% of the dark areas and the last 5% of the bright areas of the gray level is removed to obtain a new striped projection image histogram T, with gray level L of [0, 230], which is [12, 242] of the original histogram gray level. Then, CLAHE is performed on histogram T, and finally the removed information is added back to the final histogram.
[0100] CLAHE uses a preset clipping threshold (clip_limit) to clip the histogram of the striped projection image and distributes the clipped portion evenly to other gray levels. Then, it performs histogram equalization on the clipped and redistributed histograms. This limits the slope of the cumulative distribution function and prevents excessive contrast enhancement from interfering with the stripe information of the striped projection image.
[0101] First, calculate the clipping threshold clip_limit, using the following formula:
[0102] clip_limit = β·P a
[0103]
[0104] Where β is the empirical coefficient for the cropping threshold, and its value ranges from [2, 4], P a The number of times each statistical count in the sub-region is evenly distributed across all gray levels, y l L represents the number of gray levels, where L is the number of gray levels.
[0105] To prevent excessive contrast enhancement, the final clipping threshold coefficient β is determined by calculating the dynamic range D of the histogram of each stripe projection image. The dynamic range D is the ratio of the average brightness of the bright areas to the average brightness of the low-bright areas in the histogram of the stripe projection image. The larger the dynamic range, the smaller the clip_limit, and the greater the contrast limiting effect. The low-bright areas occupy the top 50% of the histogram pixel values, and the bright areas occupy the bottom 50%. The average brightness L of the bright areas is then calculated separately. ave_h The average value L in the low-brightness area ave_l The dynamic range is obtained as
[0106]
[0107] The addition of one is to prevent the number of pixel values in either the highlight or low-light areas from being zero.
[0108] The final cropping threshold coefficient β in each sub-region is calculated as follows: Figure 4 As shown, L represents the number of gray levels.
[0109] The histogram of the striped projection image is cropped and redistributed based on the clipping threshold clip_limit. First, the portions of the histogram exceeding clip_limit are clipped and summed to obtain the total number of clipped portions, S. c Calculate as follows:
[0110]
[0111] S c The gray levels are evenly distributed, with each gray level receiving an average of S. a Calculate as follows:
[0112]
[0113] The first allocation is completed as follows:
[0114]
[0115] After the initial allocation, there may be a remaining number of cropped items that cannot be evenly distributed across each grayscale level. For the remaining number of cropped items S... r Perform a reallocation and calculate the allocation step size, as shown in the following formula.
[0116]
[0117] Starting from the smallest gray level, the scanning proceeds according to the allocation step size. If the current number of gray levels is less than the clipping threshold clip_limit, one gray level is allocated. This process continues until the last gray level is scanned. If not all pixels are allocated after the scan is completed, a new step size is calculated using the formula to redistribute the pixels until all remaining pixels are allocated. Since the histogram statistics of the striped projection image in this invention have a decimal part, the decimal part is rounded off and added to the statistical value to obtain the final contrast-limited histogram.
[0118] Assuming the histogram-grayscale value relationship of the original image's striped projection image is f(x), then the cumulative grayscale histogram is F(X). After equalization, the histogram-grayscale value relationship is f(y), and the cumulative histogram is F(Y). Therefore, the mapping relationship between the original grayscale value x and the grayscale value y can be expressed as y = H(x).
[0119]
[0120] Finally, the pixels of the removed dark and bright areas are output with their original pixel values to obtain the final enhanced striped projection image.
[0121] Furthermore, the phase information of the reconstructed object is obtained by combining complementary Gray code with the phase-shifting method; the specific implementation process is as follows:
[0122] This invention employs an encoding method based on a combination of Gray code and phase shifting. The Gray code encoding method first lists 2n-1 encoding sequences for an n-1 bit Gray code. Then, this sequence is inverted to obtain its inverse sequence, which is written after the previous encoding sequence. This results in a sequence of 2n code values. Finally, a "0" is added to the left of the positive sequence code values, and a "1" is added to the left of the inverse sequence code values to obtain the n-bit Gray code encoding sequence.
[0123] However, during the process of the camera acquiring images, due to the difference in the angle of illumination, certain shadow areas will be created on the image. In order to reduce the amount of computation, two black and white solid color patterns will be projected onto the object to be tested before the Gray code coded pattern is projected, in order to identify and remove the shadow parts.
[0124] Gray code decoding involves first converting the Gray code into binary code, and then further converting the binary code into a decimal value, specifically the decimal stripe periodicity k. The specific method is as follows: the leftmost (most significant) bit of the Gray code is taken as the most significant bit of the binary code. The second bit of the binary code is obtained by XORing the second bit of the Gray code with the code obtained in the previous step (i.e., the most significant bit of the binary code), and so on, XORing until the least significant bit. Let there be a Gray code value G = G... n G n- 1...G2G1, which can be converted to binary code as B=B n Bn-1 ...B2B1, the specific conversion relationship is as follows:
[0125]
[0126] This invention employs a four-step phase-shift (N=4) design for the coding pattern. Compared to traditional phase-shift methods, the four-step phase-shift approach maintains accuracy while reducing computational complexity. Four periodically varying sinusoidal grating patterns are projected onto the surface of the target object in chronological order, shifting by two phases each time. The phase values of the four images periodically change between 0 and 255. The phase of a pixel and its actual coordinates in the pixel coordinate system exhibit a sinusoidal relationship. The formula for solving the wrapping phase using the four-step phase-shift method is as follows:
[0127]
[0128]
[0129]
[0130]
[0131] Simultaneous solution to obtain the package phase
[0132]
[0133] This invention employs complementary Gray code combined with a four-step phase shift technique to solve for the absolute principal phase. A four-bit Gray code encoding pattern is selected; four Gray code encoding patterns can generate 24 encoded values. GC1 to GC4 are designed as four-level Gray code encoding patterns, and GC5 is the fifth encoding pattern of the five-level complementary Gray code. k1 corresponds to the fringe order of the four-level Gray code pattern, and k2 is the fringe order of the fifth complementary Gray code pattern. To extend the wrapper phase to [0, 2π], the final absolute phase is:
[0134]
[0135] Furthermore, the calculation process for the three-dimensional point cloud coordinates is as follows:
[0136] After system calibration, the camera's projection matrix A is obtained. c Projection matrix A of the projector p for
[0137]
[0138]
[0139] in For elements in the camera projection matrix, For elements in the projection matrix of the projector
[0140] For the same point m, the world coordinate system is: [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 These are the x and y coordinates of a pixel on the camera in the pixel coordinate system, u p v p These are the x and y coordinates of the pixel on the projector in the pixel coordinate system.
[0141] Because the world coordinate system and pixel coordinate system have the following relationship
[0142]
[0143]
[0144] A striped pattern is projected onto the object, and the absolute phase is obtained through phase-shift decoding. The phase of the same object point is the same, and the phase of the corresponding pixel at the camera end is... Phase of corresponding pixel at the projector end If all the vertical stripes on the projector are the same, then...
[0145]
[0146] Since the projector's striped image is composed of uniform stripes, and W is the field width of the coded stripes, therefore...
[0147]
[0148] The three-dimensional coordinates of point m can be obtained immediately by combining the two methods.
[0149]
[0150] The fringe projection enhancement algorithm in this invention is analyzed experimentally as follows. A fringe projection image from the experiment was selected, and the BN-C image enhancement algorithm was used to enhance the image. The results are shown in the figure. Figure 5 This is a reconstructed image of an object under white light illumination. Figure 6 This is an image of an object under fringe projection. Figure 7The image enhanced using the BN-C algorithm of this invention shows that the contrast of the image is significantly improved, objects in the image are clearer, and details are richer.
[0151] To further verify the effectiveness and feasibility of the algorithm in this invention, a striped projection image was selected, and the algorithm of this invention was compared with other image enhancement algorithms. The comparison data are as follows: PSNR is the peak signal-to-noise ratio. The algorithm of this invention has a PSNR greater than 30, indicating that the method of combining bilateral filtering and non-local mean filtering based on smooth region analysis has a better denoising effect on striped projection images; SSIM is structural similarity, which comprehensively considers image quality from the perspectives of brightness, contrast, and structure. The larger the value, the smaller the image distortion and the better the image enhancement effect; the running time is comparable to the results of the comparison algorithms.
[0152]
Claims
1. A monocular structured light 3D reconstruction method based on fringe projection image enhancement, characterized in that, Includes the following steps: Step 1: Build a monocular structured light 3D reconstruction system, which includes an industrial camera, a projector and a computer; Step 2: Project the designed coded structured light pattern onto the circular calibration plate and the reconstructed object using the projector; Step 3: Detect the center of the calibration board based on the all-white image projected onto the calibration board; Step 4: Perform industrial camera calibration. Use the inverse camera method to calibrate the projector, obtain the internal and external parameters of the industrial camera and the projector, and perform distortion correction separately. Step 5: For fringe projection images, a BN-C image enhancement algorithm is proposed. First, a combination of bilateral filtering and nonlocal mean filtering is used to denoise the fringe projection images acquired by the industrial camera. Then, the contrast is adjusted by the improved CLAHE method. Step 6: Obtain the phase information of the reconstructed object by combining complementary Gray code and phase shifting method; Step 7: Combine the intrinsic and extrinsic parameters of the camera and projector, and use the phase information to obtain the three-dimensional coordinates of each point on the object; Step 8: Generate a sparse point cloud map based on the object's three-dimensional coordinates to complete the three-dimensional reconstruction; The phase information of the reconstructed object is obtained by combining complementary Gray code and phase shifting method; the specific implementation process is as follows: An encoding method based on a combination of Gray code and phase shift method is adopted. The Gray code encoding method is to first list 2n-1 encoding sequences of n-1 bits Gray code, then invert the sequence to obtain its inverse sequence, and write it after the previous encoding sequence. This will result in a sequence of 2n code values. Finally, add the number "0" to the left of the code value of the positive sequence and add "1" to the left of the code value of the inverse sequence to obtain the encoding sequence of n bits Gray code. Before projecting the Gray code pattern, two black and white solid color patterns are projected onto the object to be tested to identify and remove the shadowed parts. The leftmost (most significant) bit of the Gray code is taken as the most significant bit of the binary code. The second bit of the binary code is obtained by XORing the second bit of the Gray code with the most significant bit obtained in the previous step. This process is repeated until the least significant bit is reached. Let there be a Gray code value... Its binary code is The specific transformation relationship is as follows: A four-step phase-shifting method with N=4 is selected to design the encoding pattern. Four periodically varying sinusoidal grating patterns are projected onto the surface of the target object in chronological order, shifting by two phases each time. The phase values of the four images vary periodically between 0 and 255. The phase of a pixel and its actual coordinates in the pixel coordinate system have a sinusoidal function relationship. The formula for solving the wrapping phase using the four-step phase-shifting method is as follows: Simultaneous solution to obtain the package phase The absolute principal phase is solved using complementary Gray code combined with a four-step phase shift technique. Four Gray code patterns are selected, and these four patterns can generate 24 coded values. GC1–GC4 are designed as four-level Gray code patterns, and GC5 is the fifth pattern in a five-level complementary Gray code. k1 corresponds to the fringe order of the four-level Gray code pattern, and k2 is the fringe order of the fifth complementary Gray code pattern. To extend the wrapper phase to [0, 2π], the final absolute phase is: 。 2. The monocular structured light 3D reconstruction method based on fringe projection image enhancement according to claim 1, characterized in that, The BN-C image enhancement algorithm is used to enhance the striped projection image; the specific implementation process is as follows: S51 uses a combination of bilateral filtering and nonlocal mean filtering to denoise the image; First, calculate the smoothness information F for each pixel in the fringe projection image. For the filter kernel K excluding the center pixel For pixels outside the range, F is calculated as follows: The NLM filter is used to denoise pixels in the boundary region of a striped projection image as follows: in, Indicates the area covered by the filter window. The coordinates of the center pixel within the filtering window. The coordinates of the neighboring pixels within the filtering window. This indicates the degree of spatial proximity. The input image contains the center pixel value of the neighborhood. For other pixel values in the neighborhood, Indicates pixel value similarity. Used for weight normalization; Represents pixels The surrounding area Represents pixels The neighborhood of the point This represents the standard deviation of Gaussian noise in the image. These are the filter coefficients. This represents the pixel value of y. and There is a positive correlation; Used for weight normalization; S52, use the improved CLAHE method to enhance the contrast of the denoised striped projection image; First, histogram statistics are performed on the striped projection image, and all pixel values are counted within the range of 0-255. The statistical information of the top 5% of dark areas and the bottom 5% of bright areas in grayscale are removed to obtain a new striped projection image histogram T with grayscale level L of [0, 230], which is [12, 242] of the original histogram grayscale level. Then, histogram T is CLAHEed, and finally the removed information is added back to the final histogram. CLAHE utilizes preset clipping thresholds The histogram of the striped projection image is cropped, and the cropped portion is evenly distributed to other gray levels. Then, histogram equalization is performed on the cropped and redistributed histograms. Calculate the clipping threshold The formula is as follows: in, This is an empirical coefficient for the cropping threshold, with a value range of [2, 4]. The number of times each gray level is evenly distributed among all the statistical counts in the sub-region. L represents the number of counts in each gray level, where L is the number of gray levels. Calculate the dynamic range of the histogram of each fringe projection image. Determine the final clipping threshold coefficient. Dynamic range The dynamic range is the ratio of the mean brightness of the bright areas to the mean brightness of the dark areas in the histogram of the fringe projection image. A larger dynamic range indicates a higher dynamic range. The smaller the value, the greater the contrast limiting effect; select the area with the highest proportion of low-brightness pixels in the histogram. The highlighted area occupies the last pixel value of the histogram. Calculate the average brightness of the highlight areas respectively. Average of low brightness area The dynamic range is obtained as The addition of one is to prevent the number of pixel values in either the highlight or low-light areas from being zero. The final clipping threshold coefficient in each sub-region Where L is the number of gray levels; Based on the clipping threshold The histogram of the fringe projection image is cropped and redistributed, removing elements exceeding a certain threshold from the histogram. The portions are trimmed and summed to obtain the total number of parts that were trimmed. Calculate as follows: Will Distribute evenly among the various gray levels, and distribute evenly among each gray level. Calculate as follows: The first allocation is completed as follows: After the initial allocation, there will be a remaining number of cropped items that cannot be evenly distributed across all gray levels. This remaining number of cropped items... Perform reallocation and calculate the allocation step size. As shown in the following formula: Scanning starts from the smallest gray level according to the allocated step size. If the current statistical count of gray levels is less than the clipping threshold... If a pixel is assigned, it is assigned until the last gray level is scanned. If all pixels are not assigned after the scan is completed, a new step size is calculated using the formula to redistribute the pixels until all remaining pixels are assigned. Since there is a decimal part in the histogram statistics of the striped projection image, the decimal part is rounded off and added to the statistical value to obtain the final contrast-limited histogram. Assume the relationship between the histogram and grayscale values of the original image's fringe projection is as follows: The cumulative grayscale histogram is then... The histogram-grayscale image relationship after equalization is as follows: The cumulative histogram is Then the original grayscale value With grayscale value The mapping relationship between them is expressed as Finally, the pixels of the removed dark and bright areas are output with their original pixel values to obtain the final enhanced striped projection image.
3. The monocular structured light 3D reconstruction method based on fringe projection image enhancement according to claim 1, characterized in that, The process of calculating the coordinates of a 3D point cloud is as follows: After system calibration, the camera's projection matrix is obtained. Projection matrix of the projector for in For elements in the camera projection matrix, For elements in the projection matrix of the projector For the same point m, there is a world coordinate system: Pixel coordinate system: camera Projector ,in These are the x and y coordinates of a pixel on the camera in the pixel coordinate system. These are the x and y coordinates of the pixel on the projector in the pixel coordinate system; The relationship between the world coordinate system and the pixel coordinate system is as follows: A striped pattern is projected onto the object, and the absolute phase is obtained through phase-shift decoding. The phase of the same object point is the same, and the phase of the corresponding pixel at the camera end is... Phase of corresponding pixel on the projector end If all the vertical stripes on the projector are the same, then: The projector's striped image is composed of uniform stripes, where W is the field width of the coded stripes. The three-dimensional coordinates of point m can be obtained immediately by: 。
