An image encoding and decoding method based on coded structured light
By optimizing the decoding process through longitudinal stripe coding and Gray code coding, invalid reconstruction areas are eliminated and median filtering is performed for noise reduction. This solves the decoding instability problem caused by global illumination and improves the reconstruction accuracy and efficiency of the coded structured light system.
Patent Information
- Application Number
- CN202211187028.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-28
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2042-09-28
AI Technical Summary
Existing technologies in coded structured light systems suffer from instability and errors in decoding results due to global illumination phenomena, affecting reconstruction accuracy and efficiency.
A method combining longitudinal stripe coding and Gray code coding is adopted to optimize the coding pattern and decoding process by eliminating invalid reconstruction areas and performing median filtering for noise reduction.
It improves the stability of binarization and the accuracy of decoded images, reduces errors, and expands the application range of structured light sensors.
Smart Images

Figure CN115564893B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of image processing, specifically relating to an image encoding and decoding method based on coded structured light. Background Technology
[0002] Currently, with the development of intelligent manufacturing, non-contact structured light vision sensors are increasingly widely used in industrial applications. They are already widely applied in fields such as reverse engineering, workpiece quality inspection, and workpiece dimension measurement. Point cloud reconstruction using coded structured light vision sensors requires a triangulation measurement model. Triangulation is a non-contact, fast, and highly accurate measurement method. Coded structured light uses a projector to project a special coded pattern onto the object being measured. Three-dimensional reconstruction is performed by acquiring the deformed coded pattern, and the changes contain depth information about the object's surface. The conventional existing technology involves decoding and analyzing the acquired scene coded image to obtain the decoded value of each pixel. Based on the triangular geometric model formed by the camera and projector, the spatial position of the pixels in the image is calculated, thus obtaining the three-dimensional information of the object's surface.
[0003] In 3D reconstruction using a coded structured light system, the encoding and decoding strategy of the structured light projection pattern is a crucial step. Image encoding and decoding aim to determine the coordinates of the projection points onto the object within the projector's image coordinate system and reduce decoding errors. Existing technologies for coded structured light reconstruction suffer from global illumination phenomena such as mutual reflection of scene light and subsurface scattering. Global illumination leads to incorrect binarization decoding results, poor binarization stability, and the reconstruction of invalid regions, impacting encoding and decoding efficiency and significantly interfering with reconstruction accuracy. Summary of the Invention
[0004] In order to overcome one or more defects and shortcomings of the existing technology, the present invention provides an image encoding and decoding method based on coded structured light, which is used to reduce the error in image decoding and reconstruction.
[0005] To achieve the above objectives, the present invention adopts the following technical solution.
[0006] An image encoding and decoding method based on coded structured light includes the following steps:
[0007] By using stripe coding, the pattern in the structured light image is projected into multiple scene images containing positive and negative coded patterns;
[0008] The optimization method based on global illumination reduces the impact of global illumination, and Gray code encoding is used to reconstruct the scene image in three dimensions, eliminating invalid reconstruction areas to obtain the undecoded captured image;
[0009] Binarization is performed on the captured image after eliminating invalid reconstruction areas to obtain a binarized image;
[0010] The binarized images are superimposed to construct the decoded image, and then the decoded image is filtered and denoised to remove noise points.
[0011] Preferably, vertical stripe coding is used when performing stripe coding.
[0012] Furthermore, when performing stripe coding, 11-bit vertical stripe coding is specifically used;
[0013] Corresponding to the 11-bit vertical stripe coding, when projecting the positive coding pattern and the negative coding pattern, the positive coding pattern projects a total of 11 scene images, and the negative coding pattern projects a total of 11 scene images, resulting in a total of 22 scene images.
[0014] Furthermore, when performing 3D reconstruction of the scene image, the Gray code encoding used is a long-bit-width Gray code encoding.
[0015] Furthermore, the process of eliminating ineffective reconstruction areas includes:
[0016] Get the maximum grayscale value I of each pixel in the entire scene image. max and minimum gray value I min Then calculate the maximum grayscale value I. max and minimum gray value I min The difference I dis The calculation formula is as follows:
[0017] I dis =I max -I min
[0018] If I dis If the value is less than the set threshold, the pixel is located in the invalid reconstruction region, and the grayscale value of the pixel is then set to zero. dis If the value is greater than the set threshold, then the pixel is a visible pixel;
[0019] I in the scene image dis After setting the grayscale value of all pixels below a set threshold to zero, the captured image after eliminating invalid reconstructed areas is obtained.
[0020] Furthermore, the process of binarizing the captured image includes:
[0021] A set of captured images containing corresponding positive and negative encoded patterns are superimposed, and then binarization is performed. The binarization result is used to replace the gray value of the pixel to obtain a binarized image.
[0022] Furthermore, the binarization judgment process includes:
[0023] Let I be the gray value of the positively encoded pattern of a pixel in the 3D reconstructed image. Let m represent the grayscale value of the pixel in the inverse encoded pattern in the 3D reconstructed image, and m represent the result of pixel binarization. Then, when the forward encoded pattern and the inverse encoded pattern overlap, the formula for determining the pixel binarization result is as follows:
[0024]
[0025] Where 1 represents a bright stripe in the vertical stripe code corresponding to the pixel binarization result, and 0 represents a dark stripe in the vertical stripe code corresponding to the pixel binarization result.
[0026] Furthermore, the process of constructing a decoded image by overlaying binarized images includes:
[0027] All binarized images are superimposed, and the binarization results of pixels at the same location in each image are accumulated to obtain an accumulated value. Then, the accumulated value is set as a grayscale value to obtain a decoded image.
[0028] Furthermore, the specific method for filtering and denoising the decoded image is median filtering.
[0029] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0030] By optimizing the positive encoding pattern, negative encoding pattern, and encoding stripes, the stability of binarization is improved and invalid reconstruction areas are removed. Noise is removed from the decoded image by median filtering, reducing the error during decoding and reconstruction, improving the accuracy of reconstruction and the efficiency of encoding and decoding, and expanding the application range of structured light sensors and point cloud reconstruction. Attached Figure Description
[0031] Figure 1 This is a general flowchart of one of the image encoding and decoding methods based on coded structured light according to the present invention;
[0032] Figure 2 The effect of projecting a positive coding pattern;
[0033] Figure 3 This is a diagram showing the effect of projecting the reverse-encoded pattern.
[0034] Figure 4 This is a diagram showing the result of binarizing the image;
[0035] Figure 5 This is a screenshot of the decoded image before filtering and denoising.
[0036] Figure 6This is a screenshot showing the result after filtering and denoising the decoded image. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0038] Example
[0039] like Figure 1 As shown in the figure, the specific steps of the image encoding and decoding method based on coded structured light in this embodiment are as follows:
[0040] S1. Using a vertical stripe coding method, the pattern in the structured light image is projected into multiple scene images containing two coded patterns, one positive and one negative.
[0041] In this embodiment, 11-bit vertical stripe encoding is preferably used during projection. Therefore, the positive encoding pattern needs to project a total of 11 scene images, and the negative encoding pattern also needs to project a total of 11 scene images, resulting in a total of 22 scene images.
[0042] S2. Based on the optimization method of global illumination, the influence of global illumination is reduced. Gray code with a longer bit width is used to perform three-dimensional reconstruction of the scene image in step S1, increase the minimum width of the encoded stripes, and then eliminate the invalid reconstruction area to obtain the undecoded captured image.
[0043] In the 3D reconstruction process, since the illumination from the projector has almost no effect on the grayscale values of the invalid areas, the invalid reconstruction areas can be eliminated directly based on the changes in the grayscale values of the captured images.
[0044] The process of eliminating invalid reconstruction regions includes:
[0045] Get the maximum grayscale value I of each pixel in the entire scene image. max and minimum gray value I min Then calculate the maximum grayscale value I. max and minimum gray value I min The difference I dis The calculation formula is as follows:
[0046] I dis =I max -I min
[0047] If I dis If the value is less than the set threshold, the pixel is located in the invalid reconstruction region, and the grayscale value of the pixel is then set to zero; if I dis If the value is greater than the set threshold, then the pixel is a visible pixel;
[0048] I in the scene image dis After setting the grayscale value of all pixels smaller than the set threshold to zero, the captured image after eliminating invalid reconstruction areas is obtained.
[0049] In this embodiment, it is preferable to perform three-dimensional reconstruction on all 22 scene images generated in step S1 and eliminate invalid reconstruction areas, thereby removing the field of view and areas occluded by objects in the captured images.
[0050] S3. Perform binarization on the captured image obtained in step 2 after eliminating invalid reconstruction areas to obtain a binarized image; the process of obtaining the binarized image includes:
[0051] A set of images containing corresponding positive and negative coded patterns, representing the eliminated invalid reconstruction regions, are superimposed and binarized. The binarized result is used to replace the grayscale value of each pixel to obtain a binarized image. The positive and negative coded patterns are themselves a set of binary coded patterns arranged in chronological order, containing only two types of coded patterns: bright coded stripes and dark coded stripes. Let I be the grayscale value of a pixel in the positive coded pattern of the 3D reconstructed image. Let m represent the grayscale value of the pixel in the inverse encoded pattern of the captured image after 3D reconstruction, and m represent the result of pixel binarization. Then, the formula for determining the pixel binarization result when the positive and negative encoded patterns coincide is as follows:
[0052]
[0053] Where 1 represents a bright stripe in the vertical stripe code corresponding to the pixel binarization result, and 0 represents a dark stripe in the vertical stripe code corresponding to the pixel binarization result; in this embodiment, preferably after the scene image in the binarization decoding step S2, 11 binarized images are obtained; as Figures 2 to 4 As shown, Figure 2 Projected orthogonal coding pattern, Figure 3 The reverse encoded pattern is obtained after binarization. Figure 4 Binarized image;
[0054] S4. Overlay the binarized images from step S3 to construct a decoded image, and then filter and denoise the decoded image to remove noise points and improve the stability of structured light image decoding.
[0055] The process of constructing a decoded image by superimposing binarized images is as follows: superimposing all binarized images, accumulating the binarization results of pixels at the same position in each image to obtain an accumulated value, and then setting the accumulated value as a grayscale value to obtain a decoded image; in this embodiment, the decoded image is preferably constructed from the 11 binarized images obtained in step S3.
[0056] The decoded image is filtered and denoised, specifically using median filtering to remove high-frequency salt-and-pepper noise, thus preserving the complete pattern edges; for example... Figure 5 and Figure 6 The comparison shows that there is a significant difference in salt-and-pepper noise before and after filtering and denoising. There is high-frequency salt-and-pepper noise before filtering and denoising, while the salt-and-pepper noise after filtering and denoising is significantly lower than that before filtering and denoising.
[0057] Compared with existing technologies, the image encoding and decoding method based on coded structured light in this embodiment has the following advantages:
[0058] This embodiment improves the stability of binarization and removes invalid reconstruction areas by optimizing the positive encoding pattern, negative encoding pattern, and encoding stripes. It also removes noise from the decoded image by using median filtering, reducing errors during decoding and reconstruction, improving reconstruction accuracy and encoding / decoding efficiency, and expanding the applicability of structured light sensors and point cloud reconstruction.
[0059] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.
Claims
1. An image coding method based on coded structured light, characterized in that, The steps comprise the following: The pattern in the structured light image is projected as a plurality of scene images containing positive coding patterns and reverse coding patterns by using a stripe coding mode; The influence of global illumination is reduced based on an optimization mode of global illumination, three-dimensional reconstruction of the scene images is performed using Gray code coding, and invalid reconstruction areas are eliminated to obtain un-decoded shooting images; Binaryzation operation is performed on the shooting images from which the invalid reconstruction areas are eliminated to obtain binary images; The binary images are superimposed to construct decoding images, and then the decoding images are filtered and denoised to remove noise points in the decoding images; The process of eliminating invalid reconstruction areas comprises: The maximum gray value I of each pixel point in all scene images is obtained max and the minimum gray value I min , then the difference I between the maximum gray value I max and the minimum gray value I min is calculated dis , and the calculation formula is as follows: I dis = I max - I min If I dis is less than a set threshold, the pixel point is located in an invalid reconstruction region, and then the pixel point gray value is set to zero. If I dis is greater than the set threshold, the pixel point is a visible point. I dis all pixel gray values less than the set threshold are set to zero, a photographed image after elimination of the invalid reconstruction region is obtained; The process of binaryzation operation on the shooting images comprises: A group of shooting images containing corresponding positive coding patterns and reverse coding patterns are superimposed, and then binaryzation judgment is performed, so that the binaryzation results are used to replace the gray values of the pixel points to obtain binary images; The positive coding patterns and the reverse coding patterns are a group of binary coding patterns arranged in time sequence, and only two types of bright coding stripes and dark coding stripes exist in the coding patterns; The process of binaryzation judgment comprises: Let I be the gray value of the pixel point in the positive encoding pattern in the photographed image after three-dimensional reconstruction, Let I be the gray value of the pixel point in the positive encoding pattern in the photographed image after three-dimensional reconstruction, Let I be the gray value of the pixel point in the positive encoding pattern in the photographed image after three-dimensional reconstruction, 1 represents a bright stripe in vertical stripe coding corresponding to the binaryzation result of a pixel point, and 0 represents a dark stripe in vertical stripe coding corresponding to the binaryzation result of a pixel point; The process of superimposing the binary images to construct decoding images comprises: All the binary images are superimposed, the binaryzation results of the pixel points at the same position in each image are added to obtain an addition value, and then the addition value is set as a gray value, so as to obtain a decoding image; The filtering and denoising mode of the decoding image is specifically a median filtering mode.
2. The method of claim 1, wherein, When the stripe coding is performed, vertical stripe coding is adopted.
3. The method of claim 2, wherein, When the stripe coding is performed, 11-bit vertical stripe coding is specifically adopted. Corresponding to the 11-bit vertical stripe coding, when the positive coding patterns and the reverse coding patterns are projected, the positive coding patterns are projected as 11 scene images, the reverse coding patterns are projected as 11 scene images, and a total of 22 scene images are obtained.
4. The method of claim 3, wherein, When the three-dimensional reconstruction of the scene images is performed, the Gray code coding used is long-bit-width Gray code coding.
Citation Information
Patent Citations
Accurate high-density point cloud acquisition method
CN109000587A
Structured Light for 3D Shape Reconstruction Subject to Global Illumination
US20120237112A1