Disclosure of Invention
Aiming at the technical problems in the background technology, the invention provides a method for constructing a structural light diffuse reflection pattern simulation model in space frequency domain imaging.
The technical scheme adopted by the invention is that the construction method of the structural light diffuse reflection pattern simulation model in the space frequency domain imaging specifically comprises the following steps:
Step 1, calculating any diffuse reflection distribution condition of a sample by using a Partial Current Boundary Condition (PCBC) formula described by Farrell and Patterson;
Step 2, in Spatial Frequency Domain Imaging (SFDI), at fringe spatial frequencies Diffuse reflection coefficient based on optical characteristicsThe calculation formula is as follows:
,
In the formula, Is the effective attenuation coefficient of the light source,Is the extinction coefficient of the light-emitting diode,Is a parameter of the internal reflection and,For the diffuse reflectance of the sample,Is the transmission albedo;
step3, simulating the diffuse reflection pattern, calculating and establishing a PCBC-SFD fusion model;
step 4, predicting the sample parameter wavelength lambda and absorption coefficient of the diffuse reflection pattern Coefficient of reduced scatteringInputting a PCBC-SFD fusion model to obtain a diffuse reflection simulation result corresponding to the projection pattern;
step 5, the upper computer generates 5 pictures, including a full black picture, a full white picture, and three fringe patterns with different initial phases alpha at the selected spatial frequency f x, wherein alpha is respectively ;
Step 6, generating a continuous 8-Bit fringe pattern into a corresponding 1-Bit halftone fringe pattern by using an error diffusion method or a halftone fringe generation method, and controlling a projector to project the fringe pattern to a sample by an upper computer;
and 7, synchronously collecting the reflected light intensity distribution of the sample in the stripe pattern illumination mode by using the CCD camera, and storing image data.
The invention is further configured that, in step 1, the diffuse reflection distribution condition of the sample is calculated by using Partial Current Boundary Condition (PCBC) formulas described by Farrell and Patterson, which is specifically as follows:
,
,
Where r is the radial distance to the light source, Is the distance to the light source and,Is the distance to the image source and,Is the effective attenuation coefficient of the light source,Is a reduced scattering coefficient;
,,,,、、 Is a parameter of the internal reflection and, Is a parameter related to the refractive index of the tissue,And (2) andIs the transmission of the albedo,For reflectivity at a distance r from the light source,For the diffuse reflectance of the sample,Is the extinction coefficient.
The invention is further arranged that in the step 3, the PCBC-SFD fusion model calculation process is as follows:
First, the calculation formula of the light intensity distribution of the projection pattern is as follows, Is the amplitude envelope of the dc component,Is the amplitude envelope of the alternating current component,The intensity distribution of the pattern is corresponding to the three phases, and the calculation formula is as follows:
,
,
the diffuse reflectance of the sample is determined by the ratio to standard reflector ,
For two different samples, the corresponding relation between the two samples can be established
,,,
Assignment:,
The light intensity distribution of the projection, standard panel, sample can be expressed as:
,
,
,
Obtaining the light intensity distribution of the diffuse reflection pattern of the sample and the sample , And the relationship between standard plate and projected pattern intensity is as follows:
,
the intensity of the projected stripe is expressed as 0.5+0.5cos (x), so the value of a is typically set to 0.5,
,
Thus, calculate the sampleThe PCBC-SFD fusion model of the actual light intensity distribution of (a) is as follows,To calculate the diffuse reflectance of the ac component at the projected fringe patch at spatial frequency k using SFDI,The calculated pattern for the PCBC is then,To calculate the diffuse reflectance of the dc component represented at frequency 0 using SFDI,Diffuse reflectance for standard white board:
。
The invention has the beneficial effects that the advantages of the diffuse reflection patterns of PCBC and SFDI in the simulated space frequency domain imaging are analyzed, the PCBC and SFDI are fused through theoretical calculation, a novel method which can simulate the stripe diffuse reflection patterns in large view field, high precision and real time is provided, and the method can still well predict the corresponding 8-Bit result according to the 1-Bit experiment under the conditions of large sample optical characteristic fluctuation, large height fluctuation, different defocusing degree and the like by combining with CNN. The method is beneficial to the on-line detection in the subsequent practical industry.
Detailed Description
The technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In order to solve the problems in the background technology, the application provides a method for constructing a structural light diffuse reflection pattern simulation model in space frequency domain imaging, which specifically comprises the following steps:
Step 1, calculating any diffuse reflection distribution condition of a sample by using a Partial Current Boundary Condition (PCBC) formula described by Farrell and Patterson;
The Partial Current Boundary Condition (PCBC) described by Farrell and Patterson can provide a diffuse reflection transmission simulation result more accurately, and is widely applied to various light transmission simulation experiments, so that the diffuse reflection distribution of a sample is calculated by using a PCBC formula proposed by the two persons.
In step 1, the diffuse reflection distribution of the sample is calculated by using a Partial Current Boundary Condition (PCBC) formula described by Farrell and Patterson, which is specifically as follows:
,
,
Where r is the radial distance to the light source, Is the distance to the light source and,Is the distance to the image source and,Is the effective attenuation coefficient of the light source,Is a reduced scattering coefficient;
,,,,,, Is a parameter of the internal reflection and, Is a parameter related to the refractive index of the tissue,And (2) andIs the transmission of the albedo,For reflectivity at a distance r from the light source,For the diffuse reflectance of the sample,Is the extinction coefficient.
Step 2, in Spatial Frequency Domain Imaging (SFDI), at fringe spatial frequenciesDiffuse reflection coefficient based on optical characteristicsThe calculation formula is as follows:
,
In the formula, Is the effective attenuation coefficient of the light source,Is the extinction coefficient of the light-emitting diode,Is a parameter of the internal reflection and,For the diffuse reflectance of the sample,Is the transmission albedo;
step3, simulating the diffuse reflection pattern, calculating and establishing a PCBC-SFD fusion model;
The SFDI formula can calculate the diffuse reflectance of the sample very accurately, but cannot give the distribution of the light source projection of one pixel point into the medium. The PCBC can give a solution about the radial distance of the light source, but when the radial distance is too small, a larger error exists, so that the predicted intensity of the halftone stripe pattern is in error in space frequency domain imaging.
First, the calculation formula of the light intensity distribution of the projection pattern is as follows,Is the amplitude envelope of the dc component,Is the amplitude envelope of the alternating current component,The intensity distribution of the pattern is corresponding to the three phases, and the calculation formula is as follows:
,
,
the diffuse reflectance of the sample is determined by the ratio to standard reflector ,
For two different samples, the corresponding relation between the two samples can be established
,
,
,
Assignment:,
The light intensity distribution of the projection, standard panel, sample can be expressed as:
,
,
,
Obtaining the light intensity distribution of the diffuse reflection pattern of the sample and the sample , And the relationship between standard plate and projected pattern intensity is as follows:
,
the intensity of the projected stripe is expressed as 0.5+0.5cos (x), so the value of a is typically set to 0.5,
,
Thus, calculate the sampleThe PCBC-SFD fusion model of the actual light intensity distribution of (a) is as follows,To calculate the diffuse reflectance of the ac component at the projected fringe patch at spatial frequency k using SFDI,The calculated pattern for the PCBC is then,To calculate the diffuse reflectance of the dc component represented at frequency 0 using SFDI,Diffuse reflectance for standard white board:
。
step 4, predicting the sample parameter wavelength lambda and absorption coefficient of the diffuse reflection pattern Coefficient of reduced scatteringInputting a PCBC-SFD fusion model to obtain a diffuse reflection simulation result corresponding to the projection pattern;
step 5, the upper computer generates 5 pictures, including a full black picture, a full white picture, and three fringe patterns with different initial phases alpha at the selected spatial frequency f x, wherein alpha is respectively ;
Step 6, generating a continuous 8-Bit fringe pattern into a corresponding 1-Bit halftone fringe pattern by using an error diffusion method or a halftone fringe generation method, and controlling a projector to project the fringe pattern to a sample by an upper computer;
and 7, synchronously collecting the reflected light intensity distribution of the sample in the stripe pattern illumination mode by using the CCD camera, and storing image data.
Experimental example 1:
As shown in fig. 1. In this example, using gypsum sculpture and polytetrafluoroethylene balls and fat emulsion solutions of different concentrations, as shown in fig. 2, samples of different optical properties were prepared by mixing distilled water with the fat emulsion solutions to prepare fat emulsion solutions of different volume concentrations, comprising the steps of:
Step1, generating continuous tone projection stripes;
Step 2, generating corresponding halftone stripes by using an error diffusion method according to the generated continuous tone stripes;
step 3, inputting the absorption and reduced scattering coefficients of the medium to be simulated into a PCBC-SFD fusion model to obtain a simulation result of the diffuse reflection pattern, as shown in figure 3;
And 4, providing a reference for setting experiments according to simulation results.
Experimental example 2:
Comprises the steps of,
Step 1, obtaining a large amount of theoretical data by respectively combining halftones and corresponding continuous tone stripes thereof and inputting different absorption and reduced scattering coefficients into PCBC-SFD;
Step 2, constructing a convolutional neural network architecture and training by using the generated theoretical data as a data set to obtain a model for predicting continuous tone experimental results according to halftone data, as shown in fig. 4;
step 3, the upper computer controls the projector to project a fringe pattern on the sample, and the CCD camera synchronously collects the reflected light intensity distribution of the sample in a fringe pattern illumination mode and stores image data;
and 4, inputting the acquired halftone pattern into a trained network to obtain a prediction result of a corresponding continuous tone experiment, as shown in fig. 5.
As another embodiment, the present embodiment provides another technical solution:
in particular comprising the following steps of the method,
Step 1, inputting data of 1-Bit and 8-Bit projection patterns and samples with different absorption and reduced scattering coefficients into a PCBC-SFD fusion model, and obtaining corresponding simulated diffuse reflection images under 1-Bit and 8-Bit projections of samples with different optical characteristics through simulation;
And 2, establishing a CNN network, inputting the 1-Bit generated by PCBC-SFD and the corresponding 8-Bit pattern data set for training, and obtaining the corresponding relation between the 1-Bit and the corresponding 8-Bit pattern data set. The network architecture of CNN is specifically designed to start with a single channel input layer, of size 1080 x 1920 pixels, using a convolutional layer with a3 x 3 kernel and a ReLU activation function to extract and refine the features of the binary input. This configuration introduces nonlinearity and helps prevent gradient extinction during training. Subsequent MaxPooling D operations reduce the dimension of the feature map, enhancing the generalization capability of the network. To capture the wider patterns, a convolution layer with 11 x 11 kernels was introduced. The UpSampling D layer combines additional convolutions to enlarge the feature map to reconstruct the 8-bit pattern. The network ends with a final convolutional layer that uses a sigmoid activation function to normalize the pixel values between 0 and1, effectively modeling an 8-bit pattern;
step 3, projecting 1-Bit and 8-Bit patterns, synchronously collecting reflected light intensity distribution of a sample in a stripe pattern illumination mode by a CCD camera, and storing image data;
Step 4, inputting 1-Bit experimental data and obtaining a corresponding 8-Bit pattern prediction result by using a CNN network;
The embodiment analyzes the advantages and disadvantages of the diffuse reflection patterns of PCBC and SFDI in the simulated space frequency domain imaging, fuses the PCBC and SFDI through theoretical calculation, provides a novel method capable of simulating the diffuse reflection patterns of stripes in a large view field and high precision in real time, and combines CNN to realize that under the conditions of large fluctuation of the optical characteristics of a sample, large fluctuation of the height, different defocus degrees and the like, the corresponding 8-Bit result can be well predicted according to a 1-Bit experiment. The method is beneficial to the on-line detection in the subsequent practical industry.
Although embodiments of the present invention have been shown and described, it will be obvious to those skilled in the art that the scope of the present invention is defined by the appended claims and equivalents thereof.