A Method for Constructing Structured Light Datasets Based on Digital Twin Models of Striped Projection Systems
By constructing a digital twin model of a real fringe projection system, the problems of low efficiency and high cost in dataset construction are solved, a high-precision dataset is generated, the generalization ability of the model is improved, and it is applicable to a variety of deep learning tasks and object surface properties.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-06
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies are inefficient and costly in constructing fringe projection system datasets, and the generated data differs greatly from real-world data. The modeling parameters are incomplete, and the surface characteristics of the target under test are not considered, resulting in inaccurate models and low generalization ability.
By building a real fringe projection system, calibrating its parameters, and constructing a digital twin model in computer graphics software, the surface properties of the object under test and ambient lighting are simulated to achieve virtual projection and data acquisition, generating high-quality fringe images and depth images.
It can quickly build high-precision, high-quality datasets, reduce costs, improve the generalization ability of deep learning models, and is applicable to different deep learning tasks and surface properties of objects to be tested.
Smart Images

Figure CN122089910A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer 3D vision technology, specifically a method for constructing a structured light dataset based on a digital twin model of a fringe projection system. Background Technology
[0002] In the field of optical measurement, structured light measurement, with its advantages of speed, non-contact operation, and high precision, has been widely applied in industrial production, medical imaging, and other fields. Among these, fringe projection profilometry is a method for measuring diffuse reflective surfaces. In recent years, with the development of artificial intelligence technology, many researchers have combined deep learning with fringe projection profilometry, achieving significant results in areas such as fringe denoising, fringe analysis, phase unfolding, and depth calculation. However, as a data-driven method, deep learning requires the construction of large datasets for model training, evaluation, and prediction. In fringe projection systems, constructing datasets requires scanning a large number of different types of objects, resulting in low efficiency and high cost. Furthermore, the trained dataset is only valid for a specific system; if the system changes, the dataset needs to be reconstructed. To address the complex and costly data acquisition process in constructing datasets for fringe projection systems, many researchers have conducted research on establishing simulation datasets.
[0003] Methods for building datasets using simulation can be divided into two categories based on their underlying principles. The first category is mathematical simulation methods, which simulate the mathematical expressions between fringes and phase or between fringes and depth, and generate corresponding phase or depth images based on the fringes, thereby training the dataset. The paper "Jeught SVD, Dirckx JJ J. Deepneural networks for single shot structured light profilometry[J]. OpticsExpress, 2019, 27(12): 17091." designed a random surface map generator and used the relationship formula between phase and height to generate modulated deformed fringes of selected frequency fringes, using the deformed fringes and corresponding heights as the training dataset. The paper "Zhang T, Jiang S, Zhao Z, et al. Rapid and robust two-dimensional phaseunwrapping via deep learning[J]. Optics Express, 2019, 27(16): 23173." used the first ten Zernike polynomials to generate the absolute phase, and then generated the corresponding wrapping phase and fringe order according to the mathematical formula. To approximate experimental data, additive and multiplicative noise were artificially added to the training data. This type of method often fails to fully account for the impact of noise, distortion, and environmental factors in real-world systems on measurements, resulting in data that differs significantly from actual data.
[0004] The second type of method is a simulation method based on Computer Graphics (CG). This method constructs a digital twin model of the real system in computer graphics software, simulating the projection and acquisition process of the FPP system within the software to complete the dataset construction. The paper "Zheng Y, Wang S, Li Q, et al. Fringe projection profilometry by conducting deep learning from its digital twin[J]. OpticsExpress, 2020, 28(24): 36568-36583." first proposes a method to build a digital twin of a real FPP system using the CG software Blender based on the calibration parameters of the real system. This method establishes a large dataset through virtual scanning, enabling the trained network model to be used in specific real systems. The paper "Wang F, Wang C, Guan Q, et al. Single-shot fringe projection profilometry based on deep learning and computer graphics[J]. Optics Express, 2021, 29(6): 8024-8040." considers the factors in the environment that affect the measurement results, maps these factors to a virtual system, and generates different large datasets through different combinations of factors. Experiments have demonstrated the accuracy of the datasets and the generalization ability of the network. This type of method can simulate most factors in reality, but when constructing a digital twin model, it only considers the imaging model of the camera or projector and does not fully consider the imaging model of the fringe projection system, resulting in incomplete modeling parameters and certain errors between the established virtual model and the real system. In addition, when constructing the dataset, it does not consider the light reflection characteristics of the surface of the object to be measured, resulting in a single data sample, underfitting of the model training, and low generalization ability of the model.
[0005] In summary, simulation data generated by CG-based methods can produce data that is difficult to obtain in reality using fringe projection methods, providing richer datasets for networks. However, these methods suffer from incomplete modeling parameters and fail to consider the influence of the surface characteristics of the target object on the measurement, resulting in inaccurate fringe projection system models and limited data samples in the constructed datasets. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a method for constructing a structured light dataset based on a digital twin model of a fringe projection system.
[0007] The technical solution of this invention to solve the aforementioned technical problem is to provide a method for constructing a structured light dataset based on a digital twin model of a fringe projection system, characterized in that the method includes the following steps: Step 1: Build a real stripe projection system and calibrate it to obtain the calibration parameters. The real stripe projection system includes a real camera and a real projector. Step 2: Construct a digital twin model of the real fringe projection system in computer graphics software based on the hardware parameters of the real fringe projection system and the calibration parameters obtained in Step 1; the digital twin model includes a virtual projector and a virtual camera; Step 3: Based on the location of the digital twin model of the real fringe projection system constructed in Step 2, import the model of the object under test into the computer graphics software and adjust the parameters of the model of the object under test; then establish the surface attribute node tree of the model of the object under test, and modify the surface attributes of the model of the object under test by adjusting the parameters in the surface attribute node tree; the surface attributes of the model of the object under test include surface texture characteristics and surface reflection characteristics. Create lights as ambient light sources in computer graphics software and set the light parameters; Step 4: Input the computer-generated stripe image into the virtual projector. Use programming software to control the image texture node in the spotlight node tree of the computer graphics software to input the stripe image, thereby realizing the automatic projection of the virtual projector. Then, use programming software to control the computer graphics software to render the image within the field of view of the virtual camera and solve the corresponding depth image to realize the data acquisition of the virtual camera. Step 5: Adjust the lighting power of the ambient light, the light intensity in the spotlight node tree, and the rotation angle parameters of the object model under test in the computer graphics software to change the ambient light intensity, the light intensity of the virtual projector, and the acquisition angle of the object model under test. Then repeat step 4 until a stripe image and corresponding depth image that meet the user's quantity requirements are generated, and the construction of the structured light dataset is completed.
[0008] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) This invention fully considers the influencing parameters of modeling, determines the modeling method and parameter transformation relationship of the digital twin model of the fringe projection system, and can quickly construct the digital twin model of the system in computer graphics software based on the hardware parameters and calibration parameters of the real fringe projection system. It has the characteristics of fast modeling speed and high accuracy.
[0009] (2) This invention uses a digital twin model of a real fringe projection system to perform virtual measurement of the target. By programming, it realizes automated fringe projection and data acquisition, which can quickly generate high-quality fringe images. It simplifies the complex data acquisition process when the real fringe projection system builds a dataset and reduces the measurement cost when the real fringe projection system builds a dataset. It has the characteristics of fast generation speed, accurate data generation and low cost.
[0010] (3) This invention considers the reflection of light and ambient light on the surface of the target to be tested, uses a node tree to simulate the surface properties of the target to be tested and sets the ambient light of the system, and achieves diversification of the surface properties of the target to be tested and ambient light by adjusting the parameters, providing rich data samples for constructing the dataset and improving the generalization ability of the deep learning network model.
[0011] (4) This invention realizes the automated projection and data acquisition of the virtual system through programming, and outputs stripe images and depth maps corresponding to each image. It can also output stripe images and phase maps or stripe maps corresponding to each image as needed, so as to be applied to different deep learning tasks of the stripe projection system, including prediction from stripe map to depth map, prediction from stripe map to phase map, and prediction from stripe map to stripe map. At the same time, this invention realizes the diversification of the surface properties of the object under test by adjusting the adjustment parameters, so as to be applied to deep learning tasks for objects under test with various surface properties, including diffuse reflection objects and specular objects. Attached Figure Description
[0012] Figure 1 This is an overall flowchart of the present invention; Figure 2 This is a schematic diagram of the digital twin model of the present invention; Figure 3 This is a schematic diagram of the spotlight node tree of the simulated virtual projector of the present invention; Figure 4 This is a schematic diagram of the surface attribute node tree of the object model to be tested according to the present invention; Figure 5 This is a schematic diagram of the object model to be tested in Embodiment 1 of the present invention; Figure 6 This is a schematic diagram of the input stripe image in Embodiment 1 of the present invention; Figure 7 A schematic diagram of the object model to be tested input to the digital twin model of Embodiment 1 of the present invention, the corresponding output fringe image with a fringe period of 64, and the calculated depth image.
[0013] In the diagram, the nodes are: Virtual Projector 1, Virtual Camera 2, Texture Coordinate Node 3, Separate XYZ Node 4, Divide Node 5, Map Node 6, Image Texture Node 7, Self-Emitting Node 8, Light Output Node 9, Light Attenuation Node 10, Object Model Under Test 11, Noise Texture Node 12, RGB to BW Node 13, Color Gradient Node 14, Principled BSDF Node 15, Layer Weight Node 16, Blend Shader Node 17, Material Output Node 18, Glossy BSDF Node 19, and Bump Node 20. Detailed Implementation
[0014] Specific embodiments of the present invention are given below. These specific embodiments are only used to further illustrate the present invention in detail and do not limit the scope of protection of the present invention.
[0015] This invention provides a method for constructing a structured light dataset based on a digital twin model of a fringe projection system (hereinafter referred to as the method), characterized by the following steps: Step 1: Build a real stripe projection system and calibrate it to obtain the calibration parameters. The real stripe projection system includes a real camera and a real projector. Preferably, in step 1, there is a horizontal distance between the real camera and the real projector, and there is an angle between their optical axes, forming a triangular measurement relationship with the object to be measured in space.
[0016] Preferably, in step 1, the horizontal distance between the real camera and the real projector is determined based on the field of view size of the real camera and the real projector, so as to ensure a large overlap of the field of view as much as possible. The angle between the optical axes of the real camera and the real projector is determined based on the measurement distance; for measurement distance < 0.5 meters, the angle is 20~30°; for measurement distance 0.5m ≤ measurement distance ≤ 1m, the angle is 20°; for measurement distance > 1m, the angle is 10~20°.
[0017] Preferably, in step 1, the calibration parameters include the calibration parameters of the real camera and the calibration parameters of the real projector; the calibration parameters of the real camera include focal length, principal point coordinates, skew coefficient, rotation matrix, and translation matrix; the calibration parameters of the real projector include focal length, principal point coordinates, skew coefficient, rotation matrix, and translation matrix.
[0018] Step 2: Based on the hardware parameters of the real fringe projection system and the calibration parameters obtained in Step 1, construct a digital twin model of the real fringe projection system in computer graphics software (e.g., Figure 2 (As shown); the digital twin model includes a virtual projector 1 and a virtual camera 2; Preferably, in step 2, the hardware parameters include the hardware parameters of the real camera and the hardware parameters of the real projector; the hardware parameters of the real camera include resolution, sensor size, aperture and depth of field; the hardware parameters of the real projector include resolution and sensor size.
[0019] Preferably, in step 2, the computer graphics software used is Blender software; Blender software includes texture coordinate node 3, split XYZ node 4, divide node 5, map node 6, image texture node 7, self-illumination node 8, light output node 9, light attenuation node 10, noise texture node 12, RGB to BW node 13, color gradient node 14, schematic BSDF node 15, layer weight node 16, blend shader node 17, material output node 18, gloss BSDF node 19, and bump node 20.
[0020] Preferably, in step 2, constructing the digital twin model of the real fringe projection system involves building a virtual model in computer graphics software with the same parameters as the real camera and projector. Specifically: For virtual camera 2, directly input the hardware and calibration parameters of the real camera into the Blender software; For virtual projector 1, a spotlight node tree is constructed in Blender software to simulate virtual projector 1, and the parameters of the spotlight node tree are set according to the calibration parameters of the real projector obtained in step 1. The specific steps are as follows (e.g.) Figure 3 (as shown) S21. Use texture coordinate node 3 to determine the positioning mode of the image projected by the real projector on the surface of the object to be measured as the normal direction, and use the XYZ separation node 4 to separate XYZ, and then use the division node 5 to divide the XYZ data by Z to achieve normalization, so that the image projected by the virtual projector 1 is a two-dimensional image. S22. The location, orientation, and size of the two-dimensional image are controlled by setting the LocationX, LocationY, RotationZ, ScaleX, and ScaleY parameters in mapping node 6. Preferably, in step S22, the RotationZ parameter is set to 180°, and the LocationX, LocationY, ScaleX, and ScaleY parameters are set according to the calibration parameters of the actual projector obtained in step 1.
[0021] Preferably, in step S22, the position of the two-dimensional image is controlled by the LocationX and LocationY parameters, and their mapping relationship with the hardware parameters and calibration parameters of the actual projector is as follows: (1) In equation (1), , The origin of the image coordinate system of the real projector; , These are the horizontal and vertical resolutions of a real projector, respectively.
[0022] Preferably, in step S22, the magnification of the virtual projector 1 is controlled by the ScaleX and ScaleY parameters, and the mapping relationship between these parameters and the hardware parameters and calibration parameters of the real stripe projection system is as follows: (2) In equation (2), , These represent the horizontal and vertical resolutions of the actual camera, respectively; d is the working distance. , Real cameras u , v Sensor dimensions for orientation; , Real projectors u , v Sensor dimensions for orientation; This refers to the number of pixels occupied by each row of the projected image of virtual projector 1 in the field of view of virtual camera 2. This represents the number of pixels in each column of the projected image from virtual projector 1 within the field of view of virtual camera 2.
[0023] S23. Connect the vector output of the mapping node 6 in step S22 with the vector input of the image texture node 7 to control the position, direction and size of the projected image of the virtual projector 1. Then, use the image texture node 7 to input the projected image of the virtual projector 1. Then, use the light attenuation node 10 to simulate the light attenuation phenomenon of the virtual projector 1 in space. Use the self-illuminating node 8 to control the color and light intensity value of the virtual projector 1. Finally, use the light output node 9 to realize the projection simulation of the virtual projector 1.
[0024] Step 3: Based on the location of the digital twin model of the real fringe projection system constructed in Step 2, import the object model 11 to be tested into the computer graphics software and adjust the parameters of the object model 11; then establish the surface attribute node tree of the object model 11 (e.g., Figure 4 As shown in the figure, the surface properties of the object model 11 under test are modified by adjusting the parameters in the surface property node tree; the surface properties of the object model 11 under test include surface texture properties and surface reflection properties. Create lights as ambient light sources in computer graphics software and set the light parameters; Preferably, in step 3, the parameters of the object model 11 to be tested include size, position, and rotation angle.
[0025] Preferably, in step 3, the specific steps for establishing the surface attribute node tree of the object model 11 to be tested are as follows: S31. Simulate the surface texture characteristics of the object model 11 under test. The surface texture characteristics include irregularity and color. Simulating irregularity: The texture coordinate node 3 is used to determine the positioning of the texture on the surface of the object model 11 as the object surface coordinate. Then, the position, direction and size of the texture on the surface coordinate of the object model 11 are controlled by the mapping node 6. Then, noise is added at the surface coordinate of the object model 11 to simulate the irregularity of the surface texture of the object model 11. Simulated color properties: The color of the surface texture of the object model 11 under test is controlled by the RGB to BW node 13 and the color gradient node 14, and the surface texture of the object model 11 under test is made to have a textured feel by the bump node 20. Preferably, in step S31, if the object is colored, the color gradient node 14 is used to control the color of the surface texture of the object model 11 under test.
[0026] S32. The surface reflection characteristics of the test object model 11 are simulated by using the principle BSDF node 15, the reflection characteristics of the local smooth area on the surface of the test object model 11 are simulated by using the glossy BSDF node 19, and the ratio of rough and smooth areas on the surface of the test object model 11 is controlled by using the layer weight node 16 and the blend shader node 17. Preferably, in step S32, simulating the surface reflection characteristics of the object model 11 under test specifically involves: using the surface texture characteristics of the object model 11 under test set in step S31 as the basic color input to the prototype BSDF node 15, and modifying the surface reflection characteristics of the object model 11 under test by adjusting the metallicity, specular, roughness, and transmission parameters in the prototype BSDF node 15.
[0027] S33. Using the material output node 18, output the surface texture characteristics obtained in step S31 and the surface reflection characteristics obtained in step S32 to realize the simulation of the object material.
[0028] Preferably, in step 3, the type of light in the computer graphics software is set according to the actual light characteristics, and the power and color of the light are adjusted.
[0029] Step 4: Input the computer-generated stripe image into the virtual projector 1. The stripe image is input into the image texture node 7 in the spotlight node tree of the computer graphics software through programming software, thereby realizing the automatic projection of the virtual projector 1. Then, the computer graphics software is programmed to render the image within the field of view of the virtual camera 2 and solve the corresponding depth image through programming software, thereby realizing the data acquisition of the virtual camera 2. Preferably, in step 4, the programming software is Python.
[0030] Preferably, in step 4, for subsequent depth calculation using the N-step phase-shifting method and the optimal three-fringe selection method, the fringe periods of the input fringe image are respectively... , , And the phase shift expression for each periodic fringe image is: (3) In equation (3), The light intensity distribution of the nth fringe image is shown below. Background light intensity, The light intensity modulated by the surface of the object. To wrap the phase value, This represents the number of phase shift steps.
[0031] Step 5: Adjust the ambient light power, spotlight node tree light intensity, and rotation angle parameters of the object model 11 in the computer graphics software to change the ambient light intensity, the light intensity of the virtual projector 1, and the acquisition angle of the object model 11. Then repeat step 4 until stripe images and corresponding depth images that meet the user's quantity requirements are generated, and complete the construction of the structured light dataset.
[0032] Example 1: In this embodiment, using Figure 5 The model in the image is used as the object model 11 to be tested. The steps are as follows: Step 1: Build a real stripe projection system and calibrate it to obtain the calibration parameters. The real stripe projection system includes a real camera and a real projector. Step 2: Construct a digital twin model of the real fringe projection system in Blender software based on the hardware parameters of the real fringe projection system and the calibration parameters obtained in Step 1; the digital twin model includes a virtual projector 1 and a virtual camera 2; In this embodiment, for virtual camera 2, the hardware parameters and calibration parameters of the real camera are directly input into the Blender software; for virtual projector 1, a spotlight node tree is constructed in the Blender software to simulate virtual projector 1, and the parameters of the spotlight node tree are set according to the calibration parameters of the real projector obtained in step 1. The parameters of the spotlight node tree are LocationX=483, LocationY=488, RotationZ=180°, ScaleX=2.004, and ScaleY=3.234.
[0033] Step 3: Based on the location of the digital twin model of the real fringe projection system constructed in Step 2, the following will be used: Figure 5 The object model 11 shown is imported into Blender software, and its parameters are adjusted. Then, a surface attribute node tree for the object model 11 is created, and the surface attributes of the object model 11 are modified by adjusting the parameters in the surface attribute node tree. Create a light source as an ambient light source in Blender software and set the light parameters; In this embodiment, 12 images are captured at each angle position of the object model 11 under test. Then the object is rotated 4 times, each time by 90°, and a total of 48 images are captured.
[0034] Step 4: Input the computer-generated stripe image into the virtual projector 1. Control the image texture node 7 in the spotlight node tree of the Blender software using Python programming to input the stripe image, thereby realizing the automatic projection of the virtual projector 1. Then, control the Blender software using Python programming to render the image within the field of view of the virtual camera 2 and calculate the corresponding depth image to realize the data acquisition of the virtual camera 2. In this embodiment, a four-step phase-shifting method and an optimal three-fringe selection method are used for calculation. The fringe periods of the input fringe images are 64, 63, and 56, respectively. Figure 6 As shown. In the four-step phase shift method, the fringe of each period shifts by π / 2 phase values each time, and shifts four times in one period. Therefore, the phase shift values of each fringe are 0, π / 2, π, and 3π / 2, respectively. By solving the simultaneous equations, the wrapping phase value can be obtained as shown in equation (4): , (4) In equation (4), To wrap the phase value, , , , The light intensity distribution of images with different phase shift fringes.
[0035] The wrapping phase is affected by the arctangent function, and its value ranges from... The phase in question is not the true value of the absolute phase. To obtain continuous absolute phase values, this invention employs the optimal three-fringe selection method to unfold the phase. Using the folded phase of the high-frequency fringe image as the reference phase, difference frequency calculations are performed with the folded phases corresponding to the two low-frequency fringe images to calculate the fringe order of each pixel. This allows for phase unfolding of the reference phase, obtaining the absolute phase, and then a depth map is obtained based on the phase height model.
[0036] Step 5: Adjust the ambient light power, spotlight node tree light intensity, and rotation angle parameters of the object model 11 in the Blender software to change the ambient light intensity, the light intensity of the virtual projector 1, and the acquisition angle of the object model 11. Then repeat step 4 until a stripe image and corresponding depth image that meet the user's quantity requirements are generated, thereby realizing the rapid construction of a high-quality dataset.
[0037] Depend on Figure 7 It can be seen that the stripe image generated by this invention is extremely similar to the stripe image acquired by the real stripe projection system, and can accurately calculate the depth image, which can meet the needs of different deep learning tasks of the stripe projection system.
[0038] Any aspects not covered in this invention are applicable to existing technologies.
Claims
1. A method for constructing a structured light dataset based on a digital twin model of a fringe projection system, characterized in that, The method includes the following steps: Step 1: Build a real stripe projection system and calibrate it to obtain the calibration parameters. The real stripe projection system includes a real camera and a real projector. Step 2: Construct a digital twin model of the real fringe projection system in computer graphics software based on the hardware parameters of the real fringe projection system and the calibration parameters obtained in Step 1; the digital twin model includes a virtual projector (1) and a virtual camera (2). Step 3: Based on the location of the digital twin model of the real stripe projection system constructed in Step 2, import the object model (11) to be tested into the computer graphics software and adjust the parameters of the object model (11); then establish the surface attribute node tree of the object model (11) to be tested, and modify the surface attributes of the object model (11) to be tested by adjusting the parameters in the surface attribute node tree; the surface attributes of the object model (11) to be tested include surface texture characteristics and surface reflection characteristics; Create lights as ambient light sources in computer graphics software and set the light parameters; Step 4: Input the stripe image generated by the computer into the virtual projector (1), and use the programming software to program and control the image texture node (7) in the spotlight node tree of the computer graphics software to input the stripe image, thereby realizing the automatic projection of the virtual projector (1); then use the programming software to program and control the computer graphics software to render the image in the field of view of the virtual camera (2) and solve the corresponding depth image to realize the data acquisition of the virtual camera (2). Step 5: Adjust the lighting power of the ambient light, the light intensity in the spotlight node tree and the rotation angle parameters of the object model (11) in the computer graphics software to change the ambient light intensity, the light intensity of the virtual projector (1) and the acquisition angle of the object model (11). Then repeat step 4 until a stripe image and corresponding depth image that meet the user's quantity requirements are generated, and complete the construction of the structured light dataset.
2. The method for constructing a structured light dataset based on a digital twin model of a fringe projection system according to claim 1, characterized in that, In step 1, there is a horizontal distance between the real camera and the real projector, and there is an angle between their optical axes, forming a triangular measurement relationship with the object to be measured in space. In step 1, the horizontal distance between the real camera and the real projector is determined based on the field of view size of the real camera and the real projector. The angle between the optical axes of the real camera and the real projector is determined based on the measurement distance; for measurement distance < 0.5 meters, the angle is 20~30°; for measurement distance 0.5m ≤ measurement distance ≤ 1m, the angle is 20°; for measurement distance > 1m, the angle is 10~20°.
3. The method for constructing a structured light dataset based on a digital twin model of a fringe projection system according to claim 1, characterized in that, In step 1, the calibration parameters include the calibration parameters of the real camera and the calibration parameters of the real projector; the calibration parameters of the real camera include focal length, principal point coordinates, skew coefficient, rotation matrix and translation matrix; The calibration parameters of a real projector include focal length, principal point coordinates, skew coefficient, rotation matrix, and translation matrix; In step 2, the hardware parameters include the hardware parameters of the real camera and the hardware parameters of the real projector; the hardware parameters of the real camera include resolution, sensor size, aperture and depth of field. The hardware parameters of a real projector include resolution and sensor size.
4. The method for constructing a structured light dataset based on a digital twin model of a fringe projection system according to claim 1, characterized in that, In step 2, the computer graphics software used is Blender software; Blender software includes texture coordinate node (3), split XYZ node (4), divide node (5), map node (6), image texture node (7), self-illumination node (8), light output node (9), light attenuation node (10), noise texture node (12), RGB to BW node (13), color gradient node (14), principled BSDF node (15), layer weight node (16), blend shader node (17), material output node (18), gloss BSDF node (19) and bump node (20).
5. The method for constructing a structured light dataset based on a digital twin model of a fringe projection system according to claim 4, characterized in that, In step 2, the specific steps for constructing a digital twin model of the real fringe projection system are: For the virtual camera (2), the hardware parameters and calibration parameters of the real camera are directly input into the Blender software; For the virtual projector (1), the virtual projector (1) is simulated by constructing a spotlight node tree in the Blender software, and the parameters of the spotlight node tree are set according to the calibration parameters of the real projector obtained in step 1. The specific steps are as follows: S21. Use the texture coordinate node (3) to determine the positioning mode of the image projected by the real projector on the surface of the object to be measured as the normal direction, and use the XYZ separation node (4) to separate XYZ, and then use the division node (5) to divide the XYZ data by Z to achieve normalization, so that the image projected by the virtual projector (1) is a two-dimensional image. S22. The location, orientation, and size of the two-dimensional image are controlled by setting the LocationX, LocationY, RotationZ, ScaleX, and ScaleY parameters in the mapping node (6); S23. Connect the vector output of the mapping node (6) in step S22 with the vector input of the image texture node (7) to control the position, direction and size of the projected image of the virtual projector (1). Then, use the image texture node (7) to input the projected image of the virtual projector (1). Then, use the light attenuation node (10) to simulate the light attenuation phenomenon of the virtual projector (1) in space. Use the self-emitting node (8) to control the color and light intensity value of the virtual projector (1). Finally, use the light output node (9) to realize the projection simulation of the virtual projector (1).
6. The method for constructing a structured light dataset based on a digital twin model of a fringe projection system according to claim 5, characterized in that, In step S22, the RotationZ parameter is set to 180°, and the LocationX, LocationY, ScaleX, and ScaleY parameters are set according to the calibration parameters of the actual projector obtained in step 1. In step S22, the position of the two-dimensional image is controlled by the LocationX and LocationY parameters, and their mapping relationship with the hardware parameters and calibration parameters of the actual projector is as follows: (1) In equation (1), , The origin of the image coordinate system of the real projector; , These are the horizontal and vertical resolutions of a real projector, respectively. In step S22, the magnification of the virtual projector (1) is controlled by the ScaleX and ScaleY parameters. The mapping relationship between the virtual projector (1) and the hardware parameters and calibration parameters of the real stripe projection system is as follows: (2) In equation (2), , These represent the horizontal and vertical resolutions of the actual camera, respectively; d is the working distance. , Real cameras u , v Sensor dimensions for orientation; , Real projectors u , v Sensor dimensions for orientation; The number of pixels in each row of the image projected by the virtual projector (1) in the field of view of the virtual camera (2); The number of pixels in each column of the image projected by the virtual projector (1) in the field of view of the virtual camera (2).
7. The method for constructing a structured light dataset based on a digital twin model of a fringe projection system according to claim 1, characterized in that, In step 3, the specific steps for establishing the surface attribute node tree of the object model (11) to be tested are as follows: S31. Simulate the surface texture characteristics of the object model (11) to be tested. The surface texture characteristics include irregularity and color. Simulate irregularity: Use texture coordinate node (3) to determine the positioning of texture on the surface of the object model (11) as object surface coordinates, then use mapping node (6) to control the position, direction and size of texture on the surface coordinates of the object model (11), and then use noise texture node (12) to add noise at the surface coordinates of the object model (11) to simulate the irregularity of texture on the surface of the object model (11); Simulate color properties: Use RGB to BW node (13) and color gradient node (14) to control the color of the surface texture of the object model (11) under test, and use bump node (20) to make the surface of the object model (11) under test have a bump feel; S32. Use the principled BSDF node (15) to simulate the surface reflection characteristics of the object model (11) under test, use the glossy BSDF node (19) to simulate the reflection characteristics of the local smooth area on the surface of the object model (11) under test, and use the layer weight node (16) and the blend shader node (17) to control the ratio of rough and smooth areas on the surface of the object model (11) under test. S33. Using the material output node (18), output the surface texture characteristics obtained in step S31 and the surface reflection characteristics obtained in step S32 to realize the simulation of the object material.
8. The method for constructing a structured light dataset based on a digital twin model of a fringe projection system according to claim 7, characterized in that, In step S31, if the object is colored, the color gradient node (14) is used to control the color of the surface texture of the object model (11) under test; In step S32, the surface reflection characteristics of the test object model (11) are simulated as follows: the surface texture characteristics of the test object model (11) set in step S31 are used as the basic color input to the prototype BSDF node (15), and the surface reflection characteristics of the test object model (11) are modified by adjusting the metallicity, specular, roughness and transmission parameters in the prototype BSDF node (15).
9. The method for constructing a structured light dataset based on a digital twin model of a fringe projection system according to claim 1, characterized in that, In step 3, the parameters of the object model (11) to be tested include size, position and rotation angle; In step 3, the type of light in the computer graphics software is set according to the actual lighting characteristics, and the power and color of the light are adjusted.
10. The method for constructing a structured light dataset based on a digital twin model of a fringe projection system according to claim 1, characterized in that, In step 4, the programming software is Python; In step 4, to subsequently calculate the depth using the N-step phase-shifting method and the optimal three-fringe selection method, the fringe periods of the input fringe image are respectively... , , And the phase shift expression for each periodic fringe image is: (3) In equation (3), The light intensity distribution of the nth fringe image is shown below. Background light intensity, The light intensity modulated by the surface of the object. To wrap the phase value, This represents the number of phase shift steps.