CN-121095308-B - Pattern generation method, system and device for three-dimensional reconstruction of structured light based on anti-diffraction
Abstract
The invention relates to a pattern generation method, a system and a device for three-dimensional reconstruction of structured light based on anti-diffraction, which comprises the steps of S1 generating simulation stripes projected to an object plane, recording the simulation stripes as an image I 1 , wherein the bit depth of the image I 1 is b, the width and the height of the image I 1 are A times of the resolution of a Digital Micromirror Device (DMD), and A is more than or equal to 2. S2, selecting an anti-diffraction function according to the optical system to conduct anti-diffraction treatment on the pattern. S3, performing deconvolution operation on the image I 1 and the anti-diffraction function once to obtain an image I 2 . S4, performing downsampling operation on the image I 2 to obtain an image I 3 consistent with the resolution of the DMD. S5, performing local binarization processing on the image I 3 to obtain an image I 4 with the bit depth of 1 bit. S6 replaces the original image I 1 with the image I 4 . According to the invention, through simulating the anti-diffraction process, the bit depth 1bit image on the DMD is reversely calculated, and the effect the same as that of the 8 bit image is achieved by using the 1bit image, so that the projection efficiency is improved by tens of times, and the existing technical problem is solved.
Inventors
- QI HAOZHE
Assignees
- 苏州明鉴传感科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20250820
Claims (14)
- 1. The pattern generation method based on anti-diffraction structured light three-dimensional reconstruction is characterized by comprising the following steps of: S1, generating simulation stripes projected to an object plane, recording the simulation stripes as an image I 1 , wherein the bit depth of the image I 1 is b, the width and the height of the image I 1 are A times of the resolution of the DMD, and the A is more than or equal to 2; S2, selecting an anti-diffraction function according to an optical system to perform anti-diffraction treatment on the pattern, wherein the anti-diffraction treatment comprises calculation treatment for improving the definition of the image and recovering the image; S3, performing one deconvolution operation on the image I 1 and the anti-diffraction function to obtain an image I 2 ; Step S4, performing downsampling operation on the image I 2 to obtain an image I 3 with the same resolution as the DMD; Step S5, carrying out local binarization processing on the image I 3 to obtain an image I 4 with the bit depth of 1 bit; Step S6, the original image I 1 is replaced by the image I 4 to be projected, and the image loaded on the DMD is all 1 bit; In the step S5, the binarization processing comprises error diffusion, wherein the error is diffused to other pixel points, the diffusion range or the diffusion ratio meets the energy conservation principle, the energy conservation means that the sum of the diffusion ratios is 100 percent, namely the energy variation of the target pixel point in binarization is equal, and the diffusion ratio meets the following conditions that the farther the target point is, the lower the energy ratio is, and the lower the energy ratio is along the scanning direction; the error diffusion mode is to diffuse to the left and the right and the next row, and specifically comprises the following steps: Step S511, performing threshold segmentation on the image I 3 , if the gray value of the pixel point I 3 (x, y) of the image I 3 is greater than the threshold T, assigning the pixel value V as 255, otherwise assigning as 0; the pixel point coordinates of the image I 3 are assigned results of the pixel points after threshold segmentation; step S512 of calculating the energy of the change , ; Step S513 of changing the energy Pixels spread to the periphery, and the pixels in the directions of 45 degrees right, 45 degrees left lower, 45 degrees right lower and 45 degrees right lower are respectively spread , , And Is a function of the energy of the (c), Is constant and is ; Step S514, starting from the first row, scanning the rows from left to right until the last column is scanned; Step S515, scanning the next row of the last row of pixels from right to left, repeating steps S511-S513, wherein the diffusion mode of step S513 is adjusted to diffuse the pixels in the directions of left side, 45 degrees below left, 45 degrees below right and 45 degrees below right , , And Is a function of the energy of the (c), Is constant and is ; And S516, repeating the steps S511-S515 until the whole image is binarized, and obtaining the final image I 4 with the bit depth of 1 bit.
- 2. The method of claim 1, wherein in step S1, the image I 1 is a vertical stripe or a horizontal stripe, the vertical stripe is a periodic sinusoidal distribution along the gray scale of the horizontal image, and the horizontal stripe is a periodic sinusoidal distribution along the gray scale of the vertical image.
- 3. The method of generating a pattern for three-dimensional reconstruction of structured light as claimed in claim 1, wherein said anti-diffraction function comprises Gaussian Model、Simulated Defocus Model、Born & Wolf Model、Gibson & Lanni Model、Variable Refractive Index Gibson & Lanni Model and Richards & Wolf Model in step S2.
- 4. The method for generating a pattern based on anti-diffraction structured light three-dimensional reconstruction as set forth in claim 1, wherein in the step S5, the image binarization algorithm is Otsu or Huang threshold segmentation method or InterModes threshold segmentation or IsoData threshold segmentation or Li threshold segmentation or Max Entropy maximum entropy segmentation or mean method segmentation or Min Error Minimum threshold segmentation or Moments geometric moment threshold segmentation or PERCENTILE percentile threshold segmentation or Renyi Entropy Raney entropy threshold segmentation or Shanbhag threshold segmentation or Yen threshold segmentation.
- 5. The method for generating a pattern for three-dimensional reconstruction of structured light based on anti-diffraction according to claim 1, wherein the range of the threshold T for dividing the image I 3 is: 。
- 6. a pattern generation system based on anti-diffraction structured light three-dimensional reconstruction is characterized in that the pattern generation method based on anti-diffraction structured light three-dimensional reconstruction is adopted according to any one of claims 1 to 5, and specifically comprises the following steps: The pattern generation module is used for generating a simulation stripe image I 1 projected to the object plane; The anti-diffraction processing module is used for selecting a proper anti-diffraction function according to the optical system and performing anti-diffraction calculation on the pattern to obtain an image I 2 with the influence of the optical system removed; The downsampling module is used for downsampling the image I 2 to obtain an image I 3 with the same resolution as the DMD; And the local binarization module is used for carrying out local binarization processing on the image I 3 to obtain an image I 4 with the bit depth of 1 bit.
- 7. The pattern generation device based on anti-diffraction structured light three-dimensional reconstruction is characterized by comprising: at least one processor, and At least one memory communicatively coupled to the processor; Wherein the memory stores instructions executable by the processor to cause the apparatus to perform the pattern generation method of anti-diffraction structured light based three-dimensional reconstruction of any one of claims 1-5.
- 8. The pattern generation method based on anti-diffraction structured light three-dimensional reconstruction is characterized by comprising the following steps of: S1, generating simulation stripes projected to an object plane, recording the simulation stripes as an image I 1 , wherein the bit depth of the image I 1 is b, the width and the height of the image I 1 are A times of the resolution of the DMD, and the A is more than or equal to 2; S2, selecting an anti-diffraction function according to an optical system to perform anti-diffraction treatment on the pattern, wherein the anti-diffraction treatment comprises calculation treatment for improving the definition of the image and recovering the image; S3, performing one deconvolution operation on the image I 1 and the anti-diffraction function to obtain an image I 2 ; Step S4, performing downsampling operation on the image I 2 to obtain an image I 3 with the same resolution as the DMD; Step S5, carrying out local binarization processing on the image I 3 to obtain an image I 4 with the bit depth of 1 bit; Step S6, the original image I 1 is replaced by the image I 4 to be projected, and the image loaded on the DMD is all 1 bit; In the step S5, the binarization processing comprises error diffusion, wherein the error is diffused to other pixel points, the diffusion range or the diffusion ratio meets the energy conservation principle, the energy conservation means that the sum of the diffusion ratios is 100 percent, namely the energy variation of the target pixel point in binarization is equal, and the diffusion ratio meets the following conditions that the farther the target point is, the lower the energy ratio is, and the lower the energy ratio is along the scanning direction; the error diffusion mode is to diffuse to the left and the right and the upper row, and specifically comprises the following steps: Step S521, performing threshold segmentation on the image I 3 , if the gray value of the pixel point I 3 (x, y) of the image I 3 is greater than the threshold T, assigning the pixel value V as 255, otherwise assigning as 0; the pixel point coordinates of the image I 3 are assigned results of the pixel points after threshold segmentation; step S522 of calculating the energy of the change , ; Step S523, changing energy Pixels spread to the periphery, and pixels in directions of 45 degrees right, 45 degrees left, 45 degrees right and 45 degrees right are spread respectively , , And Is a function of the energy of the (c), Is constant and is ; Step S524, starting from the last row, scanning the rows from left to right until the last column is scanned; Step S525, scanning the last row of pixels from right to left, repeating steps S521-S523, wherein the diffusion mode of step S523 is adjusted to diffuse pixels in directions of 45 degrees left, 45 degrees right and 45 degrees right , , And Is a function of the energy of the (c), Is constant and is ; And S526, repeating the steps S521-S525 until the whole image is binarized, and obtaining the final image I 4 with the bit depth of 1 bit.
- 9. The method of claim 8, wherein in step S1, the image I 1 is a vertical stripe or a horizontal stripe, the vertical stripe is a periodic sinusoidal distribution along the gray scale of the horizontal image, and the horizontal stripe is a periodic sinusoidal distribution along the gray scale of the vertical image.
- 10. The method of generating a pattern for three-dimensional reconstruction of structured light as recited in claim 8, wherein said anti-diffraction function comprises Gaussian Model、Simulated Defocus Model、Born & Wolf Model、Gibson & Lanni Model、Variable Refractive Index Gibson & Lanni Model and Richards & Wolf Model in step S2.
- 11. The method for generating a pattern based on anti-diffraction structured light three-dimensional reconstruction as set forth in claim 8, wherein in the step S5, the image binarization algorithm is Otsu or Huang threshold segmentation method or InterModes threshold segmentation or IsoData threshold segmentation or Li threshold segmentation or Max Entropy maximum entropy segmentation or mean method segmentation or Min Error Minimum threshold segmentation or Moments geometric moment threshold segmentation or PERCENTILE percentile threshold segmentation or Renyi Entropy Raney entropy threshold segmentation or Shanbhag threshold segmentation or Yen threshold segmentation.
- 12. The method for generating a pattern for three-dimensional reconstruction of structured light based on anti-diffraction according to claim 8, wherein the range of the threshold T for dividing the image I 3 is: 。
- 13. a pattern generation system based on anti-diffraction structured light three-dimensional reconstruction is characterized in that the pattern generation method based on anti-diffraction structured light three-dimensional reconstruction is adopted according to any one of claims 8-12, and specifically comprises the following steps: The pattern generation module is used for generating a simulation stripe image I 1 projected to the object plane; The anti-diffraction processing module is used for selecting a proper anti-diffraction function according to the optical system and performing anti-diffraction calculation on the pattern to obtain an image I 2 with the influence of the optical system removed; The downsampling module is used for downsampling the image I 2 to obtain an image I 3 with the same resolution as the DMD; And the local binarization module is used for carrying out local binarization processing on the image I 3 to obtain an image I 4 with the bit depth of 1 bit.
- 14. The pattern generation device based on anti-diffraction structured light three-dimensional reconstruction is characterized by comprising: at least one processor, and At least one memory communicatively coupled to the processor; wherein the memory stores instructions executable by a processor to cause the apparatus to perform the pattern generation method of anti-diffraction structured light based three-dimensional reconstruction of any one of claims 8-12.
Description
Pattern generation method, system and device for three-dimensional reconstruction of structured light based on anti-diffraction Technical Field The invention relates to the field of computer vision detection, in particular to a pattern generation method, a system and a device for three-dimensional reconstruction of structured light based on anti-diffraction. Background The machine vision technology refers to the technology of using vision (namely a common photographing mode such as a camera) to acquire information such as color, texture and outline of an object, and further performing specific algorithm processing on the acquired information to achieve the aim of detection or measurement, thereby improving quality monitoring of links such as manufacturing, assembly and the like. The current technology for measuring the contour of an object is divided into a triangle principle, an interference principle, a TOF (Time of Flight) technology, a chromatic dispersion technology and the like in principle. The principle of triangulation refers to a non-coaxial light path of an illumination system and an imaging system, and a certain included angle exists, so that the three-dimensional coordinates of an object point are uniquely determined. The triangle principle is widely applied to the consumer electronics industry because of the characteristics of high speed and high precision. The industrialized products of the triangulation principle comprise line scanning lasers and area array structured light. The line scanning laser can obtain the complete outline of the object by means of external movement, so that the process is complicated. The area array structured light can be imaged once in the imaging visual field range to obtain three-dimensional information of an object, so that the area array structured light technology is widely applied to the fields of mobile phone screen detection, robot navigation, face recognition and the like, and the production efficiency and the user experience are remarkably improved. The advantages of high precision and rapid imaging make it one of the key technologies in modern industry and smart devices. Existing structured light technology typically uses spatial light modulators, most commonly DLP (DIGITAL LIGHT Projector) modules produced by texas instruments (Texas Instruments, TI) in the united states. The nature of DLP is a set of projection systems that can project patterns with bit depth of 1bit (also called binary) and 8bit, but usually the 1bit projection frame rate is much higher than 8bit. For example, a model DLP4500 module, its maximum projection frame rate of 1bit can reach 4225 Hz, and the maximum projection frame rate of 8bit pattern can reach 120 Hz. A bit depth of 1bit means that the projector has only two states, off and on, and no gray level change. The bit depth of 8 bits means that the projected brightness hasStage change. Area array structured light typically requires projecting multiple patterns with gray scale variations that satisfy a sinusoidal function, producing a phase shift. In some specific application scenarios as described below, there are higher requirements: (1) A need for further improvement of the frame rate. For example, it is required to test the appearance change at the moment of explosion of an automobile safety airbag, and high-speed cameras up to thousands of cameras such as 5000 Hz are used for shooting images at present, but only cameras cannot obtain the appearance, and only two-dimensional information can be obtained. (2) A precondition for still photography is required for structured light. In some high-precision measurement semiconductor scenes, for example, the high measurement precision requirement of micrometers (mum) is met, vibration caused by external excitation exists, and the premise of static photographing of structured light is broken. (3) Other scenes that require high-speed area array structured light. Whether the object itself has a high speed or vibration causes, the essence can be solved by increasing the frame rate of imaging, i.e. the object is relatively stationary as long as the shooting speed is fast enough. However, the planar array structured light is based on the phase shift principle, and a series of patterns with gray level change are required to be projected, that is, in the case of using DLP4500, only a frame rate of 120 Hz can be achieved by using an image with a depth of 8 bit bits, and the requirement of high-speed measurement cannot be met. Disclosure of Invention The technical problem to be solved by the invention is to design a pattern generation method, a system and a device based on anti-diffraction structured light three-dimensional reconstruction, wherein the effect which is the same as that of an 8 bit image is achieved by using a 1bit image by calculating the bit depth 1bit image on the DMD reversely by simulating the anti-diffraction process, namely if the pattern finally projected by DLP is an imag