Three-dimensional reconstruction method for structured light on surface of reflective object based on multi-stage deep learning
Through the improved pix2pix and DC-UNet networks, combined with position awareness loss and global guidance path, the problem of highlight interference in traditional structured light 3D reconstruction technology is solved, high-precision 3D shape reconstruction of reflective object surfaces is achieved, and the problem of highlight interference is avoided. measurement error.
Patent Information
- Application Number
- CN202410803303.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-18
AI Technical Summary
Traditional structured light 3D reconstruction technology is prone to high-light interference when processing the surface of reflective objects, resulting in stripe image distortion and inaccurate phase calculation. Existing solutions such as surface pretreatment, multi-angle multi-view technology and polarized light methods have limitations and are difficult to Completely eliminate highlight interference.
Using a method based on multi-stage deep learning, we build a structured light three-dimensional measurement system, use improved pix2pix network and DC-UNet network, combine position-aware loss and mean square error loss to remove highlight interference, and improve the three-dimensional shape through global guidance paths Reconstruction accuracy.
It effectively eliminates the specular reflection component, accurately reconstructs the three-dimensional shape, improves the accuracy of three-dimensional imaging and measurement, avoids measurement errors caused by high-light interference, and reduces system complexity and cost.
Smart Images

Figure CN118799490A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision measurement technology, and in particular to a three-dimensional reconstruction method of structured light on the surface of a reflective object based on multi-stage deep learning. Background Art
[0002] In modern industry and scientific research, 3D reconstruction technology has become a key tool and is widely used in manufacturing, inspection, medical treatment, and cultural heritage protection. 3D reconstruction technology based on structured light has become an important method for measuring the surface of complex objects due to its high precision and efficiency. However, when the surface of the target object has highly reflective characteristics, traditional structured light 3D reconstruction methods often face huge challenges. In recent years, with the development of deep learning technology, researchers have begun to explore the application of deep learning to the 3D reconstruction of reflective object surfaces. In particular, the introduction of generative adversarial networks (GANs) and convolutional neural networks (CNNs) has provided new ideas for 3D reconstruction technology.
[0003] Traditional structured light 3D reconstruction methods usually include the following steps: First, a projector is used to project a fringe pattern onto the surface of an object, and then a camera is used to capture the fringe image after being modulated by the surface of the object. By analyzing the deformation of the fringe in these images, the 3D shape of the object surface can be calculated. However, the reflective surface of the object will cause strong specular reflection, resulting in highlight spots and fringe distortion in the fringe pattern in the image, which affects the accurate acquisition of the phase. This phenomenon is called high light interference, which is a difficult problem to solve in the current structured light 3D reconstruction technology. In response to the problem of high light interference, researchers have proposed a variety of solutions. A common method is to reduce reflections by surface pretreatment, such as spraying matte materials or using matte sprays. However, these methods often destroy the surface characteristics of the object and are not suitable for some sensitive objects or measurement scenarios where the surface integrity needs to be maintained. Another method is to use multi-angle multi-view technology to reduce the impact of reflections on phase calculation by taking multiple images from different angles and fusing the data later. However, this method increases the complexity and cost of the system, and data matching and calibration in the multi-view fusion process is also a technical difficulty. In addition, polarized light-based technology has also been used to reduce high light interference. By using polarized light in the projection and shooting process, the reflected light at a certain angle can be effectively filtered out. However, the polarized light method has high requirements on lighting conditions, and it is still difficult to completely eliminate high light interference on some complex surfaces. As a conditional generative adversarial network, the pix2pix network has been widely used in image-to-image conversion tasks, but there is still room for improvement when dealing with reflective surfaces. The DC-UNet network structure, as a model that combines the advantages of UNet and deep convolutional networks, demonstrates its potential in 3D reconstruction. Summary of the invention
[0004] To solve the above problems, the present invention provides a three-dimensional reconstruction method of structured light on the surface of reflective objects based on multi-stage deep learning, which is used to improve the accuracy of three-dimensional reconstruction of light-reflecting objects and solve the difficulties encountered in visual measurement in modern manufacturing.
[0005] To achieve the above purpose, the specific technical solution of the present invention is as follows:
[0006] S1. Build a structured light three-dimensional measurement system to obtain a modulated fringe image on the surface of an object. The system includes: a projection device, an object to be measured, a computer and a camera. Specifically, the following steps are included:
[0007] S1.1. Generate structured light coding patterns using a computer;
[0008] S1.2, project it onto the surface of the object to be measured through a projection device;
[0009] S1.3, photographing the object to be measured by a camera to obtain a deformation fringe image after being modulated on the surface of the object;
[0010] S1.4, the fringe images obtained by S1.3 are transmitted to a computer, and the height data of the object surface is obtained by extracting the phase information.
[0011] S2. Based on step S1, polarizing lenses are installed in front of the camera and the projector to collect highlight images and non-highlight images as a data set; the specific operation is: by rotating the angle of the polarizing lens in front of the camera lens, the image collected by the camera is viewed on the computer at the same time; when the highlight disappears from the picture, stop rotating the polarizing lens to obtain an image without highlights; continue to rotate the polarizing lens 90 degrees to obtain an image with highlights.
[0012] S3. Based on step S2, collect n groups of data sets, randomly select 2n / 3 groups as training sets, n / 6 groups as test sets to train the network model, and the remaining n / 6 groups are used to verify the trained network model; the data set is composed of n groups of highlight stripe images and their corresponding non-highlight stripe images spliced into one image in the width direction, so that the image can be correctly input into the improved pix2pix network for training.
[0013] S4. Obtain the de-highlighted network image by introducing position-aware loss and mean square error loss into the improved pix2pix network. The specific steps are as follows:
[0014] S4.1 Initialize various parameters of the network;
[0015] S4.2 passes the data set into the improved pix2pix for training;
[0016] S4.3 The generator trains two mapping functions;
[0017] S4.4 Calculate local loss and global loss in the network;
[0018] S4.5 feedback training, cyclic update of the discriminator;
[0019] Based on the generator loss function of the original pix2pix network, the present invention introduces position-aware loss and mean square error loss to achieve fine pixel-to-pixel mapping, thereby enhancing the ability to predict highlight-free images; the introduced perceptual loss function is used to describe the differences between the predicted image and the target image to ensure their consistency in content and global structure;
[0020] The improved pix2pix network is based on the original pix2pix, replacing the U-Net in the generator part with DC-UNet. DC-UNet relies on the basic structure of U-Net, but is equipped with residual learning mechanism and deep separable convolution that U-Net does not have. In the DC-UNet network structure, residual learning mechanism and deep separable convolution are usually applied to DCBlock and Res Path modules.
[0021] DC Block is the core component of DC-UNet, which consists of two branches. Each branch contains three convolutional layers with kernel sizes of 3×3, 5×5, and 7×7. The outputs of these convolutional layers are concatenated and then normalized through a batch normalization layer. Then, the outputs of the two branches are added together and activated through a ReLU activation function. Finally, batch normalization is performed again.
[0022] Res Path is another important component in DC-UNet, which consists of multiple residual blocks. Each residual block consists of two convolutional layers with a convolution kernel size of 3×3. The output of the residual block is added to the input and activated by the ReLU activation function. Then batch normalization is performed again. The number of residual blocks can be controlled by specifying the length of the residual block. The structure of the model consists of a series of DC Block and Res Path modules, where DC Block is used for the downsampling path and Res Path is used for the upsampling path. In the downsampling path, downsampling is performed through the maximum pooling layer, and then feature extraction is performed through the DC Block. In the upsampling path, upsampling is performed through the transposed convolution layer and connected to the output of the corresponding downsampling path, and then feature extraction is performed again through the DC Block.
[0023] S5. By introducing a global guiding path into the DC-UNet network, a 3D shape reconstruction model of a stripe image is constructed; the improved DC-UNet network model adopted in the present invention consists of three parts: an encoder, a decoder and a global guiding path. The entire architecture covers three core components: DC Block, Res Path and Third module.
[0024] Each level of encoding process corresponds to a decoding process, where the encoding path is composed of a convolutional layer and a pooling layer. In the encoding process, the convolutional layer is mainly used to extract local features in the image, while the pooling layer is responsible for downsampling the image and passing the features to the next level.
[0025] Correspondingly, the decoding path upsamples the downsampled feature map and then refines the edges and shapes of the objects through the convolution layer to compensate for the loss of details caused by the pooling operation.
[0026] Based on this structure, the present invention adds a global guidance path, the purpose of which is to further improve the accuracy of shape reconstruction by decoding the additional image information captured by the path.
[0027] The global guided path integrates five unique Third modules that use 1×1 convolutions and transposed convolutions with a single channel depth to adjust the range of the receptive field to the minimum while restoring the image resolution to the same as the input, and finally outputs it through a linearly activated 1×1 convolution.
[0028] S6, inputting the image of the data set in S3 to the image without highlights obtained by training the highlight network model in step S4;
[0029] S7, inputting the non-highlight image obtained in step S6 into the fringe image 3D shape reconstruction model in step S5 for training, so as to achieve three-dimensional shape reconstruction of the reflective object.
[0030] Beneficial effects of the present invention
[0031] 1. The present invention is used to eliminate the specular reflection component in the grating fringe image and accurately reconstruct the three-dimensional shape of a single fringe image.
[0032] 2. The improved pix2pix network can efficiently estimate the process and predict images without highlight stripes; the optimized DC-UNet network can effectively remove the highlight part of the object surface and accurately obtain its three-dimensional shape. The present invention can effectively eliminate the influence of highlights and avoid the measurement errors caused by it in three-dimensional imaging.
[0033] 3. The generator model of the pix2pix network is carefully designed, and position-aware loss and mean square error loss are introduced into its adversarial loss function to ensure accurate mapping at the pixel level and optimize the generation of highlight-free images.
[0034] 4. A global guidance path is integrated into the network structure of DC-UNet, which improves the accuracy of shape reconstruction by making full use of the additional image information extracted from the decoder path.
[0035] 5. The present invention eliminates the need for multi-camera image acquisition and still performs well in the case of strong reflection or missing color information. The reconstructed three-dimensional image has excellent surface smoothness, and the phase measurement deviation of the fringe projection method caused by reflection is effectively corrected while maintaining the original high measurement accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is a system flow chart of the present invention;
[0037] Figure 2 is a diagram of a structured light measurement system of the present invention;
[0038] Figure 3 A stripe image highlight removal model diagram for improving the pix2pix network of the present invention;
[0039] Figure 4 The 3D shape reconstruction model diagram of the stripe image of the improved DC-UNet network of the present invention;
[0040] Figure 5 This is a diagram of the structured light 3D reconstruction technology of the reflective object surface based on multi-stage deep learning of the present invention; DETAILED DESCRIPTION
[0041] The following will be described in detail and in depth with reference to the accompanying drawings in conjunction with the technical solutions of the embodiments of the present invention. The embodiments mentioned are only for explanation of the present invention and are not intended to limit its scope. This flexible selection makes the application of the present invention more extensive and flexible.
[0042] This embodiment provides a 3D reconstruction method for structured light on the surface of a reflective object based on multi-stage deep learning. The trained pix2pix network is used to predict a stripe image without highlights, and the stripe image without highlights is used as the input of the improved DC-UNet network to achieve a single stripe reconstruction method. Figure 3 D shape reconstruction. The relevant process is shown as follows Figure 1 The specific steps are as follows:
[0043] S1, such as Figure 2As shown, a structured light three-dimensional measurement system is built to obtain a modulated fringe image on the surface of an object. The system includes: a projection device, an object to be measured, a computer and a camera; specifically, the following steps are included:
[0044] S1.1. Generate structured light coding patterns using a computer;
[0045] S1.2, projecting it onto the surface of the object to be measured through a projection device; the height change of the surface of the object to be measured will cause the projected coding pattern to deform, from which the three-dimensional coordinate information of the surface of the object can be extracted;
[0046] S1.3, photographing the object to be measured by a camera to obtain a deformation fringe image after being modulated on the surface of the object;
[0047] S1.4, the fringe images obtained by S1.3 are transmitted to a computer, and the height data of the object surface is obtained by extracting the phase information.
[0048] S2. Based on step S1, polarizing lenses are installed in front of the camera and the projector to collect highlight images and non-highlight images as a data set; the specific operation is: by adjusting the angle of the polarizing lens in front of the camera lens, the image collected by the camera is viewed on the computer at the same time; when the highlight disappears from the picture, stop rotating the polarizing lens to obtain an image without highlights; continue to rotate the polarizing lens 90 degrees to obtain an image with highlights.
[0049] S3. Based on step S2, collect n groups of data sets, randomly select 2n / 3 groups as training sets, n / 6 groups as test sets to train the network model, and the remaining n / 6 groups are used to verify the trained network model; the data set described in step S3 is composed of n groups of highlight stripe images and their corresponding non-highlight stripe images spliced into one image in the width direction, so that the image can be correctly input into the improved pix2pix network for training.
[0050] S4. By introducing position-aware loss and mean square error loss into the improved pix2pix network, the de-highlighting network image is obtained; the de-highlighting model of the improved pix2pix is shown in the figure Figure 3 As shown, the specific steps are as follows:
[0051] S4.1 Initialize various parameters of the network;
[0052] S4.2 passes the data set into the improved pix2pix for training;
[0053] S4.3 The generator trains two mapping functions;
[0054] S4.4 Calculate local loss and global loss in the network;
[0055] S4.5 feedback training, cyclic update of the discriminator;
[0056] Based on the generator loss function of the original pix2pix network, the present invention introduces position-aware loss and mean square error loss to achieve fine pixel-to-pixel mapping, thereby enhancing the ability to predict non-highlight images;
[0057] Furthermore, the perceptual loss function is introduced to describe the differences between the predicted image and the target image to ensure their consistency in content and global structure. This loss function extracts the feature map of the image through the 8th layer of the VGG16 network, so that the predicted image is closer to the target image in terms of semantic information and spatial information. The introduction of the perceptual loss function further improves the accuracy of the predicted image.
[0058] Perceptual loss function L k The specific expression is as follows:
[0059]
[0060] Where: P represents the predicted image, S is the target image, C×H×W describes the number of channels, height and width of the feature image, and f i The i-th pixel in the feature map f can be obtained.
[0061] The mean square error introduced in the present invention is a very common and intuitive loss function, which directly measures the Euclidean distance between the predicted image and the target image.
[0062] The mean square error function L of the image ASE The expression is as follows:
[0063]
[0064] Where: P k (i, j) represents the pixel of the predicted image on the specified k channel (i, j). In the same channel, S k (i,j) represents the pixel value of the target image.
[0065] The improved pix2pix network is based on the original pix2pix, replacing the U-Net in the generator part with DC-UNet. DC-UNet relies on the basic structure of U-Net, but is equipped with residual learning mechanism and deep separable convolution that U-Net does not have. In the DC-UNet network structure, residual learning mechanism and deep separable convolution are usually applied to DCBlock and Res Path modules.
[0066] Furthermore, DC Block is the core component of DC-UNet, which consists of two branches. Each branch contains three convolutional layers with kernel sizes of 3×3, 5×5, and 7×7. The outputs of these convolutional layers are concatenated and then normalized by a batch normalization layer. Then, the outputs of the two branches are added and activated by a ReLU activation function. Finally, batch normalization is performed again.
[0067] Res Path is another important component in DC-UNet, which consists of multiple residual blocks. Each residual block consists of two convolutional layers with a convolution kernel size of 3×3. The output of the residual block is added to the input and activated by the ReLU activation function. Then batch normalization is performed again. The number of residual blocks can be controlled by specifying the length of the residual block. The structure of the model consists of a series of DC Block and Res Path modules, where DC Block is used for the downsampling path and Res Path is used for the upsampling path. In the downsampling path, downsampling is performed through the maximum pooling layer, and then feature extraction is performed through the DC Block. In the upsampling path, upsampling is performed through the transposed convolution layer and connected to the output of the corresponding downsampling path, and then feature extraction is performed again through the DC Block.
[0068] In the DC-UNet network architecture, the image input first goes through a series of preprocessing steps, including passing through a 3×3 convolutional layer and using a ReLU activation function.
[0069] Then it is passed to the encoder. The encoder consists of five stages, namely DC Block1 to DC Block5. In each stage, DC Block processes the output of the previous stage and passes the processed result to the next stage through 2×2 maximum pooling. This process is performed on all DC Blocks until DC Block5.
[0070] Next, the output of DC Block5 is processed by 2×2 transposed convolution and passed to DC Block6 together with the corresponding decoding stage (i.e., the joint information passed from DC Block4 through Res Path4), where the decoder begins.
[0071] The decoder is divided into four stages, namely DC Block6 to DC Block9. The information processing and transmission method of each stage is similar to DC Block5 to DC Block6, except that the corresponding DC Block and Res Path have changed.
[0072] The DC Blocks in the symmetric encoder and decoder adopt the same structure and have the same parameter configuration, such as DC Block1 and DC Block9, DC Block2 and DC Block8, and DC Block3 and DC Block7. In each such DC Block, the left and right branches contain three 3×3 convolutional layers, and the number of channels of the layers are 8, 17, 26, 17, 35, 53 and 35, 71, 106 respectively. The number of channels of the 3x3 convolutional layers of the left and right branches of DC Block4 and DC Block6 are 71, 142, 213 respectively. The number of channels of the 3×3 convolutional layers of the left and right branches of DC Block5 is 142, 284, 427.
[0073] In addition, each DC Block in the encoder is connected to the DC Block in its corresponding decoder through Res Path. For example, Res Path1 connects DC Block1 and DC Block9, Res Path2 connects DC Block2 and DC Block8, and Res Path3 connects DC Block3 and DC Block7. These Res Paths all have 3×3 and 1×1 convolutional layers in parallel with residual connections, and are connected in series along the information propagation path, with the number of 4, 3, 2, and 1 respectively. In these Res Paths, the number of channels of the 3×3 convolutional layer and the 1×1 convolutional layer is in increasing mode, which are 32, 64, 128, and 256 respectively. Finally, the information processed by DC Block9 passes through a 1×1 convolutional layer and a sigmoid activation function to obtain the final output of the network.
[0074] S5. By introducing the global guidance path in the DC-UNet network, a 3D shape reconstruction model of the stripe image is constructed, such as Figure 4 As shown; the improved DC-UNet network model adopted in the present invention consists of three parts: encoder, decoder and global guide path. The whole architecture covers three core components: DC Block, Res Path and Third module.
[0075] Each level of encoding process corresponds to a decoding process, where the encoding path is composed of a convolutional layer and a pooling layer. In the encoding process, the convolutional layer is mainly used to extract local features in the image, while the pooling layer is responsible for downsampling the image and passing the features to the next level.
[0076] Correspondingly, the decoding path upsamples the downsampled feature map and then refines the edges and shapes of the objects through the convolution layer to compensate for the loss of details caused by the pooling operation.
[0077] Based on this structure, the present invention adds a global guidance path, the purpose of which is to further improve the accuracy of shape reconstruction by decoding the additional image information captured by the path.
[0078] The global guidance path integrates five unique Third modules that use 1×1 convolutions and transposed convolutions with a single channel depth to adjust the range of the receptive field to the minimum while restoring the image resolution to the same as the input, and finally outputs it through a linearly activated 1×1 convolution.
[0079] S6, inputting the image of the data set in S3 to the image without highlights obtained by training the highlight network model in step S4;
[0080] S7, input the non-highlight image obtained in step S6 into the fringe image 3D shape reconstruction model in step S5 for training, and finally realize the multi-stage deep learning three-dimensional reconstruction of the reflective object surface structured light, such as Figure 5 shown.
[0081] In summary, the present invention adopts an innovative sinusoidal stripe highlight removal and single stripe Figure 3 D shape reconstruction technology. First, the phase-shifted fringe projection technology is applied to obtain fringe images modulated by the object surface, including highlight images and non-highlight images. Then, the present invention improves the generator architecture of the pix2pix network and introduces position-aware loss and mean square error loss, so that the improved pix2pix network can predict and obtain non-reflection images. Finally, the present invention inputs these non-reflection images into the optimized DC-UNet network to achieve single-fringe reconstruction. Figure 3 This innovation effectively solves the problem that the phase acquisition may be inaccurate due to the reflection of the object surface during the measurement process, thus affecting the accuracy of the 3D data. More importantly, it provides an end-to-end solution that directly maps from fringe images to depth maps.
[0082] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered in all respects as exemplary and non-restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and range of equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0083] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A three-dimensional reconstruction method of structured light on the surface of a reflective object based on multi-stage deep learning, characterized in that: The steps include: S1. Build a structured light 3D measurement system to obtain the modulated fringe image of the object surface; S2, based on step S1, collecting the number of highlight images and non-highlight images in the streak image as a data set; S3, based on step S2, collect n sets of data sets, randomly select 2n / 3 sets as training sets, n / 6 sets as test sets, and n / 6 sets as validation sets; S4. By improving the generator model of the pix2pix network structure and introducing position-aware loss and mean square error loss, a stripe image highlight removal network model is constructed. S5, constructing a 3D shape reconstruction model of stripe images by introducing a global guidance path into the DC-UNet network; S6, inputting the image of the data set in S3 to the image without highlights obtained by training the highlight network model in step S4; S7, inputting the non-highlight image obtained in step S6 into the fringe image 3D shape reconstruction model in step S5 for training, so as to achieve three-dimensional shape reconstruction of the reflective object.
2. The method for three-dimensional reconstruction of structured light on the surface of a reflective object based on multi-stage deep learning according to claim 1, characterized in that: The system comprises: a projection device, an object to be measured, a computer and a camera; step S1 specifically comprises the following steps: S1.
1. Generate structured light coding patterns using a computer; S1.2, project it onto the surface of the object to be measured through a projection device; S1.3, photographing the object to be measured by a camera to obtain a deformation fringe image after being modulated on the surface of the object; S1.4, the fringe images obtained by S1.3 are transmitted to a computer, and the height data of the object surface is obtained by extracting the phase information.
3. The method for 3D reconstruction of structured light on the surface of a reflective object based on multi-stage deep learning according to claim 1, characterized in that: The specific operation of step S2 is: install a polarizing lens in front of the camera and the projector, rotate the angle of the polarizing lens in front of the camera lens, and when the highlight disappears from the picture, stop rotating the polarizing lens to obtain an image without highlights; continue to rotate the polarizing lens 90 degrees to obtain an image with highlights.
4. The method for 3D reconstruction of structured light on the surface of a reflective object based on multi-stage deep learning according to claim 1, characterized in that: The data set described in step S3 is composed of n groups of highlight stripe images and their corresponding non-highlight stripe images spliced into one image in the width direction.
5. The method for 3D reconstruction of structured light on the surface of a reflective object based on multi-stage deep learning according to claim 1, characterized in that: The improved pix2pix network described in step S4 is based on the original pix2pix, replacing the U-Net in the generator part with DC-UNet. The specific steps of step S4 are as follows: S4.1 Initialize various parameters of the network; S4.2 passes the data set into the improved pix2pix for training; S4.3 The generator trains two mapping functions; S4.4 Calculate local loss and global loss in the network; S4.5 Feedback training, cyclic update of the discriminator.
6. The method for three-dimensional reconstruction of structured light on the surface of a reflective object based on multi-stage deep learning according to claim 5, characterized in that: The improved DC-UNet network model in step S5 includes three parts: an encoder, a decoder, and a global guidance path.
Citation Information
Cited By
Incoherent digital holographic weak light three-dimensional imaging method based on multistage deep learning
CN121169721A
