High-speed 3D shape measurement using Fourier transform and stereo vision

In the fast 3D shape measurement, it is an important factor to use the least number of fringe patterns to get the wrapped phase and the wrapped phase is always required to be retrieved to absolute phase. But the process of phase unwrapping may affect the quality of absolute phase. Besides absolute phase retrieval is time-costing especially for high-speed 3D shape measurement. This paper proposes a fast measurement method based on Fourier transform profilometry and stereo vision. Because of the property of stereo vision, every point can find its corresponding point in the wrapped phase. This method can reconstruct 3D surface without phase unwrapping. In order to further increase the measurement speed and overcome the gamma effect of projector, the dithering fringe pattern is used. To resist false matching, the original image matching constraint gives a rough parallax. Phase matching and sub-pixel parallax optimization are used to reduce the matching errors. In order to confirm the phase value of points which are at the edge of wrapped phase, average phase value is calculated. A white mask is measured based on the proposed method. The results from every step show the effect of different functions. To better show the effect of the proposed method, a white house is measured and the measurement is compared with LSSM and MFH. In order to further to show the advantage of the proposed method, discontinuous blocks and continuous blocks are measured. The average height, RMS, average error, maximum error are compared with the method which uses absolute phase to match the corresponding points. Experiment results verify the feasibility of the proposed method and it can measure complex objects with high speed and accuracy. This paper uses Fourier transform and stereo vision to get wrapped phase and reconstruct 3D shape without phase unwrapping. The proposed method contains three part: phase matching, edge points detection and sub-pixel parallax optimization. By comparing matching precision, the proposed method can get high quality surface. Because the process of measurement only need one frame of deformed fringe pattern to get the wrapped phase and the matching process does not need phase unwrapping, the proposed method has the potential to be used in fast measurement.

In general, multi-frame fringe patterns can get more accurate and reliable results, but it is significant to use fewer fringe patterns to get the results in high-speed measurement [10].Among these technologies, Fourier transform profilometry only need one frame of fringe pattern to get the wrapped phase, so it is suitable to be used in high-speed measurement [11].
Though FTP has the advantage, it still has shortcomings.Because FTP only need one frame of fringe pattern, it is sensitive to the quality of fringe pattern [12][13][14][15].It is always affected by the nonlinearity of projector and the wrapped phase will exist noise which will have impact on the measurement directly [16].Moreover, gamma calibration is required but this process will increase the computation complexity [17].The phase error compensation is also required to remove the phase error of reconstruction results [18].But there is not a standard method which can be used in different applications.Another problem which FTP suffers from is that the wrapped phase need to be unwrapped to get the absolute phase.However, the process of phase unwrapping will also affect the accuracy of absolute phase and it will also increase computing time of the measurement [19].
To balance the accuracy and speed, this paper proposes a high-speed 3D shape measurement method based on Fourier transform profilometry and stereo vision.Instead of using 8-bit gray sinusoidal fringe pattern, 1-bit dithering fringe pattern is used.Because it is binary pattern, it can resolve the problem caused by gamma effect by using defocusing technology.In this paper, the fringe pattern is generated based on reference [16].By using the property of stereo vision, original image matching constraint can get a rough parallax.In order to get the accurate corresponding point, phase matching and sub-pixel parallax optimization are used to preclude false points.Phase matching is used to confirm candidate points.When points are at the edge of wrapped phase where the phase value is −πor π, there are missing points or wrong corresponding points.An average phase value is used to increase the robustness of the high-speed measurement.Sub-pixel parallax optimization is used to find the true corresponding point based on the coordinate of sub-pixel.This paper is organized as follows.In Section Methods, the flow of the proposed method and the principle of the proposed method are introduced.Section Results and discussion verifies the feasibility and accuracy of the proposed method.By comparing measurement results, the matching precision is confirmed.Section Conclusion gives the summary of this paper.

Methods
The process of the proposed method The whole process of the proposed method is shown in Fig. 1.It mainly includes five steps.
Step 1. Preparation before measurement.It includes the generation of dithering pattern and stereo vision calibration.The dithering fringe pattern is insensitive to the gamma of projector which uses 1-bit binary instead of 8-bit gray information to approximate the sinusoidal fringe pattern.Dithering fringe pattern can be used for high speed measurement without projector calibration.Another merit of dithering fringe pattern is that it is suitable to measure objects when wide fringe pattern is used.In this paper, the dithering fringe pattern is generated based on the reference [16].
Step 2. Original image matching constraint.The original image can be captured from left and right cameras respectively.Based on the feature of stereo vision, a rough matching can be implemented.It can be used to provide a rough parallax as a constraint condition.
Step 3. Calculation of the wrapped phase.FTP is applied to the captured image from left camera and right camera respectively.Then the fundamental component is extracted by using a filter and inverse FTP is used to obtain the wrapped phase.Step 4. The wrapped phase matching.Based on the original image matching constraint, the wrapped phase matching can be performed to find the candidate points.Because FTP uses only one frame of fringe pattern to get the phase map, perhaps there are some phase errors at the boundary of wrapped phase where the phase is or -πor π.
Step 5. Sub-pixel parallax optimization.In order to find the corresponding points precisely, the sub-pixel parallax optimization is used.The optimized parallax will correspond the target point.Once the stereo vision system is calibrated, the height of object can be calculated.
In this paper, Step 4 and Step 5 are the mainly proposed method so the principle of them will be introduced in the following part.

The principle of the proposed method
Traditionally, wrapped phase cannot be used to find the corresponding points, because it ranges from -πtoπ with periodical change.Because the dithering fringe pattern is used in this system, the gamma effect of projector can be neglected.The original image matching constraint narrows the range of candidate points within the epipolar line.Without original image matching constraint, the Fig. 2 The process of wrapped phase matching without absolute phase.(a): the true point and false points in the wrapped phase, (b): the rough parallax calculation between the images from left camera and right camera Fig. 3 The determination of boundary points based on the average phase.(a): the phase value of corresponding point is larger than zero, (b): the phase value of corresponding point is smaller than zero false points will be considered and reconstructed which will occupy the process time [21].Traditionally the absolute phase is required to find the correct corresponding points.The algorithm of retrieving absolute phase can be classified into spatial method and temporal method.But both methods have demerits.Spatial method can not be used to retrieve the phase of isolate objects and the phase error will spread along the direction of phase unwrapping.Temporal method need multiple frames to unwrap the phase which will occupy the measurement speed.The process of wrapped phase matching without any absolute phase is shown in Fig. 2. Because absolute phase is not used, there are some false corresponding points with the same phase value.These points can be defined as candidate points which are shown in Fig. 2a.
The target of matching is to find the corresponding points in two cameras.In the theory of stereo vision, the rough parallax can be obtained by making a difference between the two images which are captured from left camera and right camera.Then the rough parallax is applied to the phase matching.Because structure light increases the texture features, it can confirm the corresponding points accurately.For the stereo vision system, the point (x L , y L ) in the left camera corresponds the point (x R , y R ) in the right camera, as shown in Fig. 2b.The original image matching constraint provides a rough corresponding parallax Par, which can be expressed as: The parallax is used in the wrapped phase to find the target phase.When the phase of point (x L , y L ) in the left wrapped phase is Phase L (x L , y L ), the corresponding phase of right wrapped phase is Phase R (x R , y R ), as shown in Eq.( 2): In the proposed method, the point (x R , y R ) and adjacent points are set as candidate points.Considering the computation complexity, adjacent candidate points are shown in Fig. 3.
In order to find the true point, the phase of left point Phase L (x L , y L ) subtracts the phase of these candidate points Phase R (x R + s, y R ) and the absolute difference can be expressed as: Where s is an integer and s ∈ [−2, 2].ΔPhase is the difference of the points phase.The least difference ΔPhase(x R _ min , y R _ min ) is used and (x R _ min , y R _ min ) is the coordinate of candidate point which has the least phase difference.
As mentioned above, because two cameras capture the deformed fringe patterns, the wrapped phase can be generated with deformed information.Based on the principle of stereo vision, the parallax can be used in the wrapped phase, as shown in Eq.( 2).When the parallax is applied into the phase matching, a basic point can be obtained.The proposed method chooses the basic matching point and its two left-and-right neighborhood points as candidate matching points.The wrapped phase is monotonous in a period so these candidate points have different phase value.Theoretically the basic point and true point should have the closest phase value so the point with the least difference is used as the optimal point, as shown in Eq.( 3).
Once the optimal point can be obtained, the parallax Par min can be calculated as: Phase value matching belongs to pixel matching and the parallax of sub-pixel is required.
Although the phase matching can reject most candidate points, there are still some challenges.When the points are at the edge of wrapped phase where the phase is −π or π, it is difficult to find the matching points precisely based on ΔPhase.In order to find the corresponding points accurately, the average phase value is used.As shown in Fig. 3, the middle point (x R , y R ) is on the edge of wrapped phase and the phase Phase R (x R , y R ) is required to be calculated.The average phase value Phase a- ve (x R , y R ) can be described as: The phase value is monotonic in a period.When the phase value Phase ave (x R , y R ) is greater than zero, it can be designed as π otherwise it can be designed as −π which can be expressed as: In the wrapped phase, the phase value range from −π to π and it changes periodically.By using this feature, the coordinate of sub-pixel can be obtained.If the coordinate of original image matching point is (x R _ o , y R ), the coordinate of sub-pixel (x R _ sub , y R ) can be obtained.Because the phase value is monotone in every period, the coordinate of sub-pixel (x R _ sub , y R ) is located between the best corresponding point (x R _ min , y R _ min ) and candidate point (x R _ o , y R ).The phase value of the sub-pixel in the right wrapped phase can be set to Phase R (x R _ sub , y R ).Because Phase R (x R _ sub , y R ) represents the best matching point in the wrapped phase, it should be equivalent to the phase Phase L (x L , y L ) in the left wrapped phase.Then it can be expressed as: As shown in Fig. 4a, when the original image matching point (x R _ o , y R ) is on the left of the best point (x R _ min , y R _ min ), it means x R _ o < x R _ min .Because phase information is robust to the noise from the texture on the surface, the phase difference and ratio is used to find the coordinate of sub-pixel.The phase difference between (x R _ sub , y R )and (x R _ o , y R ) can be calculated as Phase R (x R _ sub , y R ) − Phase R (x R _ o , y R ).Similarly the phase difference between (x R _ min , y R ) and (x R _ o , y R ) can also be expressed as Phase R (x R _ min , y R ) − Phase R (x R _ o , y R ).Instead of calculating the ratio between the different x-coordinate, the ratio of the phase difference is used.Based on the relationship, the coordinate of sub-pixel can be expressed as: When the point (x R _ o , y R ) has the same x-coordinate of the best point (x R _ min , y R _ min ), it means x R _ o = x R _ min .As shown in Fig. 4b, the coordinate of sub-pixel can be expressed as: When the original image matching point (x R _ o , y R ) is on the right of the best point (x R _ min , y R _ min ), it means x R _ o > x R _ min , as shown in Fig. 4c.
Then coordinate of sub-pixel can be expressed as: The sub-pixel parallax ParPhase sub can be obtained as: Based on the baseline and sub-pixel parallax, the height of the object can be calculated.

Results and Discussion
In order to verify the proposed method, a 3D shape measurement system is developed.The system contains a projector (Samsung SP-P310MEMX) and two digital CCD cameras (Daheng MER-500-14U3M/C-L).Every The first experiment is to measure a white mask.Fig. 5a  and b show the object without fringe patterns from left camera and right camera respectively.The distorted fringe patterns from left camera and right camera are shown in Fig. 5c and d.Based on the theory of Ref. [10], the wrapped phase can be calculated which are shown in Fig. 5e and f.
Figure 6 shows the measurement results based on the proposed method.Fig. 6a shows the reconstructed result when only phase matching is used.Fig. 6b shows the reconstructed result when phase matching and the average phase calculation are used.Fig. 6c shows the reconstructed result from Fig. 6b when the sub-pixel parallax optimization is used.
To better show the reconstructed surface, the details of reconstructed mouths are shown in Fig. 7.By comparing the measured surface, the effect of every step process is shown.Because the system contains two digital cameras, the stereo vision can be calibrated to reconstruct the measured object surface by using phase matching.The measurement result is shown in Fig. 7a .But it can be found that there are wrong corresponding points so the surface is coarse.Besides there are missing points at the edge of the wrapped phase.By adding edge detection into the phase matching, the missing points and blank vertical lines are removed, as shown in Fig. 7b .Compared with the Fig. 7a and b has more accurate matching results and less noise.It has smoother surface.But it also can be found that there are still noise.When the sub-pixel parallax optimization is used, the surface becomes smoother, as shown in Fig. 6c and Fig. 7c.
To further illustrate the effect of proposed method, a white house with more complicated surface is measured.The measurement result from the proposed method is compared with the results from LSSM [20] and MFH [21] .LSSM does not need require a projector to project structure light and it finds the corresponding points based on the surface features.MFH is similar to the proposed method and it uses absolute phase to increase the texture features so that the matching precision can be increased.The measurement results are shown in Fig. 8. Figure 8a shows the deformed fringe patterns.Figure 8b shows the measurement results when the wrapped phase is retrieved.Figure 8c shows the results based on the proposed method.
From the measurement results, it can be found that the result from the proposed method has smoother surface with less noise.To better show the measurement results,   the details of the measurement are shown in Fig. 9.Because the proposed method is based on phase matching and sub-pixel parallax optimization, it can get more accurate corresponding points.By comparing the RMS errors from three methods, it can be found that the average RMS errors from LSSM, MFH and the proposed method are 0.35 rad, 0.21 rad and 0.08 rad respectively.The RMS errors from three methods are shown in Fig. 10.The measurement time consumption is also calculated.In this paper, MATLAB 2015a is used.The corresponding process time of measurement in Fig. 8b-d are 2.31 s, 1.01 s and 0.81 s respectively.These data demonstrate that LSSM generates the largest phase errors.When the projector is not used, the stereo vision system determines the measurement accuracy.It will lead to wrong points matching especially for complex surface.When MFH is applied in practice, the projector will cast the dithering fringe pattern on the surface and it will increase the texture features.If the absolute phase is retrieved for corresponding points matching, the measurement time will be increased and the quality of absolute phase will be affected by the phase unwrapping algorithm.From the comparison results, we can find that the proposed method need the least measurement time and it can get the highest accurate measurement results.
Besides discontinuous blocks and continuous blocks are measured respectively.The step-height is 60 mm, 50 mm, 30 mm respectively.Because MFH uses absolute phase, experiment results are compared between the proposed method and MFH.The measurement results are shown in Fig. 11.From the measurement results, it can be found that the measurement results from MFH have more noise.Because the dithering fringe pattern belongs to binary coding, it can be used to eliminate the effect of high frequency.Although only one frame of fringe pattern is used, the wrapped phase is not required to be retrieved to absolute phase.To better show the difference, the cross section comparison of 200th lines are shown in Fig. 12. From comparison results, it can be found that the proposed method can obtain smoother surface without less errors.
From Table 1 to Table 2, the ideal height, average height, RMS, average error and maximum error are listed for different blocks.From these data, we can find that the height from the proposed method is closer to the ideal height.The height errors from the proposed method are smaller than that from MFH.This further verify the success of the proposed pattern.From the data, we can also find that the proposed method is not affected by the frequency leakage.It can be employed to measure large slope and discontinuous objects.

Conclusion
This paper proposes a high-speed 3D shape measurement algorithm based on FTP and stereo vision.It can use one-shot fringe pattern to get wrapped phase and 3D shape can be reconstructed without phase unwrapping.
The original image matching constraint and sub-pixel phase matching are used to find the correct corresponding points.In order to increase the robustness and reduce missing rate of the boundary of the wrapped phase where phase value is π or −π, the average value is used based on the adjacent phase value.By comparing the matching precision, the proposed method can get high quality surface.Because the process of measurement only need one frame of deformed fringe pattern to get the wrapped phase and the matching process does not need phase unwrapping, the proposed method can be used in fast measurement.

Fig. 1
Fig.1The flowchart of the proposed method

Fig. 4
Fig. 4 The coordinate calculation of sub-pixel point.(a): the original image matching point is on the left of the best point, (b): the original image matching point and the best point have the same coordinate, (c): the original image matching point is on the right of the best point

Fig. 5 Fig. 6 Fig. 7
Fig. 5 The calculation of wrapped phase from left and right cameras respectively.(a) and (b): the original images from left and right camera, (c) and (d): the deformed images from left and right camera, (e) and (f): the wrapped phase from left and right camera

Fig. 8 Fig. 9
Fig. 8 The measurement results comparison among LSSM, MFH and the proposed method.(a): the deformed fringe patterns, (b): the measurement from LSSM, (c): the measurement from MFH, (d): the measurement from the proposed method

Fig. 10
Fig. 10 The average RMS comparison among three different methods

Fig. 12
Fig. 12 The cross section comparison of 200th lines

Table 1
The blocks measurement results comparison from MFH. (Units:mm)

Table 2
The blocks measurement results comparison from the proposed method.(Units:mm)