Fast three-step phase-shifting algorithm Peisen S. Huang and Song Zhang

We propose a new three-step phase-shifting algorithm, which is much faster than the traditional threestep algorithm. We achieve the speed advantage by using a simple intensity ratio function to replace the arctangent function in the traditional algorithm. The phase error caused by this new algorithm is compensated for by use of a lookup table. Our experimental results show that both the new algorithm and the traditional algorithm generate similar results, but the new algorithm is 3.4 times faster. By implementing this new algorithm in a high-resolution, real-time three-dimensional shape measurement system, we were able to achieve a measurement speed of 40 frames per second at a resolution of 532 ⫻ 500 pixels, all with an ordinary personal computer. © 2006 Optical Society of America OCIS codes: 120.0120, 120.2650, 100.5070.

1. Introduction

Phase wrapping in the phase-shifting method is the process of determining the phase values of the fringe patterns in the range of 0 to 2␲.1 Phase unwrapping, on the other hand, is the process of removing the 2␲ discontinuity to generate a smooth phase map of the object.2 Many algorithms have been developed to increase the processing speed of phase unwrapping.3–5 However, few discussions have been focused on increasing the speed of phase-wrapping algorithm. Traditional phase-wrapping algorithms involve the calculation of an arctangent function, which is too slow in the case when real-time processing is required.6 Wan and Lin proposed a phase reduction algorithm that uses the intensity of a fringe image to approximate the phase.7 The resulting phase error is eliminated by averaging two reductions with ␲兾2 difference in phase. Even though its calculation of phase based on intensity is fast, this algorithm requires finding the fringe centers and normalizing the fringe patterns before phase calculation, which slows down the processing. The averaging method does eliminate most part of the error, but not all. The residual error may still be significant depending on applications.

P. S. Huang is with the Department of Mechanical Engineering, State University of New York (SUNY) at Stony Brook, Stony Brook, New York 11794-2300. S. Zhang ([email protected]) is with the Department of Mathematics, Harvard University, Cambridge, Massachusetts 02138. Received 1 November 2005; revised 6 March 2006; accepted 7 March 2006; posted 13 March 2006 (Doc. ID 65703). 0003-6935/06/215086-06$15.00/0 © 2006 Optical Society of America 5086

APPLIED OPTICS 兾 Vol. 45, No. 21 兾 20 July 2006

Besides, when used for applications other than interferometric testing of optics, the potential existence of texture patterns on the object surface can cause errors in finding fringe centers, thus making the algorithm less reliable. In recent years, we have been developing a highresolution, real-time three-dimensional (3D) shape measurement system based on the phase-shifting method.8,9 As the phase-shifting algorithm for the system, the three-step algorithm has been our choice because it requires the minimum number of fringe images among all the existing algorithms. Less number of images means faster image capture as well as processing, which translates into higher measurement speed. However, our experiments show that even with the three-step algorithm, the image processing speed is still not fast enough for real-time 3D shape reconstruction when an ordinary personal computer is used.6 The bottleneck lies in the calculation of phase, which involves a computationally timeconsuming arctangent function. To solve this problem, we propose a new three-step algorithm, which replaces the calculation of the arctangent function with a simple intensity ratio calculation and therefore is much faster than the traditional algorithm. The phase error caused by this replacement is compensated for by use of a lookup table (LUT). Our experimental results show that both the new algorithm and the traditional algorithm generate similar results, but the new algorithm is 3.4 times faster. The adoption of this new algorithm enabled us to successfully build a highresolution, real-time 3D shape measurement system that captures, reconstructs, and displays the 3D shape of the measured object at a speed of 40 frames per

Fig. 3. (Color online) Nonlinearity error caused by the use of the fast three-step algorithm. (a) Intensity ratio in the region N ⫽ 1. (b) Nonlinearity error.

Fig. 1. Cross sections of the three phase-shifted sinusoidal fringe patterns. (a) I1(␣ ⫽ ⫺120°). (b) I2(␣ ⫽ 0°). (c) I3(␣ ⫽ 120°).

second 共fps兲 and a resolution of 532 ⫻ 500 pixels, all with an ordinary personal computer.10 Section 2 describes the principle of the proposed algorithm. Section 3 discusses the error of the algorithm and proposes an error compensation method. Section 4 presents some experimental results. Finally, Section 5 summarizes the work. 2. Principle

Among the various phase-shifting algorithms available,1 the three-step algorithm requires the minimum number of frames and is the simplest to use. The following equations describe the intensity values of the three measured fringe patterns: I1共x, y兲 ⫽ I⬘共x, y兲 ⫹ I⬙共x, y兲cos关␾共x, y兲 ⫺ ␣兴,

(1)

Fig. 2. Cross sections of the intensity ratio image and the phase image. (a) Intensity ratio. (b) Phase.

I2共x, y兲 ⫽ I⬘共x, y兲 ⫹ I⬙共x, y兲cos关␾共x, y兲兴,

(2)

I3共x, y兲 ⫽ I⬘共x, y兲 ⫹ I⬙共x, y兲cos关␾共x, y兲 ⫹ ␣兴,

(3)

where I⬘共x, y兲 is the average intensity, I⬙共x, y兲 is the intensity modulation, ␾共x, y兲 is the phase, and ␣ is the phase step size. Even though ␣ can be any value, the two commonly used ones are ␣ ⫽ 90° and ␣ ⫽ 120°. The fast phase-shifting algorithm described in this paper applies only to the case of ␣ ⫽ 120°. For ␣ ⫽ 120°, solving Eqs. (1) to (3) for the phase yields



␾共x, y兲 ⫽ arctan 冑3



I1 ⫺ I3 . 2I2 ⫺ I1 ⫺ I3

(4)

Since computers are not that good at computing the arctangent function, the traditional approach of calculating the phase using Eq. (4) directly is relatively slow. We encountered this problem in our effort to develop a real-time 3D shape measurement system based on fringe projection and phase shifting.8,11 As a solution, we proposed a novel phase-shifting method, namely, the trapezoidal phase-shifting method, that used trapezoidal fringe patterns instead of the traditional sinusoidal ones.6 By calculating an intensity ratio using a simple function, instead of phase using the arctangent function, we were able to increase the calculation speed by 4.6 times, which made the real-time reconstruction of 3D shapes possible. However, the use of trapezoidal fringe patterns brought some error due to image defocus, even though the error is small, especially when compared to the traditional intensityratio based methods.12–15 In the course of trying to deal with this error, we discovered that if we apply the algorithm developed for the trapezoidal method to sinusoidal patterns, considering the sinusoidal patterns as the defocused trapezoidal patterns, and then com20 July 2006 兾 Vol. 45, No. 21 兾 APPLIED OPTICS

5087

pensate for the small error due to defocus, we could preserve the calculation speed of the trapezoidal method while achieving the same accuracy of the traditional sinusoidal phase-shifting algorithm. The principle is described in the following paragraphs. Figure 1 shows the cross sections of the three phase-shifted sinusoidal patterns with a phase step size of 120°. We divide the period evenly into six regions 共N ⫽ 1, 2, . . . , 6兲, each covers an angular range of 60°. In each region, the three curves do not cross. Therefore, we can denote the three intensity values to be Imin共x, y兲, Imed共x, y兲, and Imax共x, y兲, which are the minimum, median, and maximum intensity values, respectively. From these three intensity values, we can calculate the so-called intensity ratio r共x, y兲 as follows: r共x, y兲 ⫽

Imed共x, y兲 ⫺ Imin共x, y兲 , Imax共x, y兲 ⫺ Imin共x, y兲

(5)

which has a value between 0 and 1, as shown in Fig. 2(a). The phase can then be calculated by the following equation:



冉 冊



␲ N⫺1 ⫹ 共⫺1兲N⫺1r共x, y兲 , ␾⬘共x, y兲 ⫽ 2 ⫻ round 3 2 (6) whose value ranges from 0 to 2␲, as shown in Fig. 2(b). As we can see from the figure, the phase calculation is not accurate, but with a small error. In Section 3, we analyze this error and discuss how this error can be compensated for. If multiple fringes are used, the phase calculated by Eq. (6) will result in a sawtoothlike shape, just as in the traditional phase-shifting algorithm. In this case, the traditional phase-unwrapping algorithm has to be used to obtain the continuous phase map.2 3. Error Analysis and Compensation

The fast three-step algorithm has the advantage of fast processing speed over the traditional three-step algorithm. However, this method makes the linear phase value ␾共x, y兲 nonlinear, as shown in Fig. 2(b), which produces error. In this section, we discuss the error caused by applying the fast three-step algorithm for sinusoidal patterns first and then propose an error compensation method. From Fig. 2(b), we see that the error is periodical and the pitch is ␲兾3. Therefore, we only need to analyze the error in one period, say, ␾共x, y兲 僆 关0, ␲兾3兲. In this period, Imax共x, y兲 ⫽ I2共x, y兲, Imed共x, y兲 ⫽ I1共x, y兲, and Imin共x, y兲 ⫽ I3共x, y兲. By substituting Eqs. (1) to (3) into Eq. (5), we obtain r共␾兲 ⫽

冉 冊

I1 ⫺ I3 1 冑3 ␲ ⫽ ⫹ tan ␾ ⫺ . I2 ⫺ I3 2 2 6

(7)

The right-hand side of this equation can be considered as the sum of a linear and a nonlinear terms. 5088

APPLIED OPTICS 兾 Vol. 45, No. 21 兾 20 July 2006

That is, r共␾兲 ⫽

␾ ⫹ ⌬r共␾兲, ␲兾3

(8)

where the first term represents the linear relationship between r共x, y兲 and ␾共x, y兲 and the second term ⌬r共x, y兲 is the nonlinearity error, which can be calculated as follows: ⌬r共␾兲 ⫽ r共␾兲 ⫺

冉 冊

␾ ␲ ␾ 1 冑3 ⫺ ⫽ ⫹ tan ␾ ⫺ . ␲兾3 2 2 6 ␲兾3 (9)

Figure 3(a) shows the plots of both the ideal linear ratio and the real nonlinear ratio. Their difference, which is similar to a sine wave in shape, is shown in Fig. 3(b). By taking the derivative of ⌬r共x, y兲 with respect to ␾共x, y兲 and setting it to zero, we can determine that when ␾⫽

␲ ⫾ cos⫺1共冑冑3␲兾6兲, 6

(10)

the ratio error reaches its maximum and minimum values, respectively, as

ⱍ ⫽ ⌬r共␾兲 ⱍ

⌬r共␾兲max ⫽ ⌬r共␾兲

␾⫽␾1

⫽ 0.0186,

(11)

⌬r共␾兲min

␾⫽␾2

⫽ ⫺0.0186.

(12)

Therefore, the maximum ratio error is ⌬r共␾兲max ⫺ ⌬r共␾兲min ⫽ 0.037. Even though this error is relatively small, it needs to be compensated for when accurate measurement is required. Since the ratio error is a systematic error, it can be compensated for by using an LUT method. In this research, an 8-bit camera is used. Therefore the LUT is constructed with 256 elements, which represent the error values determined by ⌬r共␾兲. If a higher-bitdepth camera is used, the size of the LUT should be increased accordingly. Because of the periodical nature of the error, this same LUT can be applied to all six regions. Finally, it should be noted that the phase error can be found by simply multiplying the intensity ratio error by ␲兾3. 4. Experiments

To verify the effectiveness of the proposed algorithm experimentally, we used a projector to project sinusoidal fringe patterns onto the object and an 8-bit blackand-white (B兾W) CCD camera with 532 ⫻ 500 pixels to capture the three phase-shifted fringe images.9 First, we used a flat board as the target object. The captured three fringe images are shown in Fig. 4(a)– 4(c). For comparison, we applied both the traditional algorithm and the newly proposed algorithm to the same fringe images. Figures 5(a), 5(b), and 5(c) show the intensity ratio errors of the traditional three-step

Fig. 5. (Color online) Intensity ratio error (⫻␲/3 for phase error). (a) With the traditional three-step algorithm. (b) With the fast three-step algorithm before error compensation. (c) With the fast three-step algorithm after error compensation.

Fig. 4. Fringe images of a flat board captured by an 8-bit B兾W CCD camera. (a) Fringe image I1(␣ ⫽ ⫺120°). (b) Fringe image I2(␣ ⫽ 0°). (c) Fringe image I3(␣ ⫽ 120°).

algorithm, the fast three-step algorithm before error compensation, and the fast three-step algorithm after error compensation, respectively. From Fig. 5(b), we see that the intensity ratio error (phase error) of the fast three-step algorithm before error compensation is approximately 0.04 (0.042 radians), which is only slightly larger than the theoretical value of 0.037 (0.039 radians) due to the existence of noise. After error compensation, this error, which is shown in Fig. 5(c), is significantly reduced and is comparable to that of the traditional three-step algorithm as shown in Fig. 5(a). Next, we measured an object with more complex surface geometry, a Lincoln head sculpture. The fringe images are shown in Figs. 6(a)– 6(c) and the two-

dimensional (2D) photo of the object is shown in Fig. 6(d). The reconstructed 3D shapes based on the traditional and the proposed three-step algorithms are shown in Figs. 6(e) and 6(f), respectively. The phase difference was found to be less than RMS 0.0002 radians. In our experiment, we used an ordinary personal computer (Pentium 4, 2.8 GHz) for image processing. The traditional three-step algorithm took 20.8 ms, while the proposed new algorithm took only 6.1 ms, which was 3.4 times less. The improvement in processing speed is significant. To demonstrate its usefulness, we implemented this new algorithm in our real-time 3D data acquisition system9 and successfully realized real-time 3D shape acquisition, reconstruction, and display at 40 fps with a image resolution of 532 ⫻ 500. In this system, a PC workstation with dual CPUs 共2.8 GHz兲 and a parallel processing program were used to accomplish the task. Figure 7 shows the experimental setup for the realtime 3D system. The captured 3D shape is projected in real time onto a white board on the side of the object. Figure 8 shows the experiment of using our real-time system to capture human facial expressions. The image on the left is the face of a human 20 July 2006 兾 Vol. 45, No. 21 兾 APPLIED OPTICS

5089

Fig. 6. (Color online) Measurement results of a Lincoln head sculpture. (a) Fringe image I1(␣ ⫽ ⫺120°). (b) Fringe image I2(␣ ⫽ 0°). (c) Fringe image I3(␣ ⫽ 120°). (d) 2D photo. (e) 3D shape by the traditional three-step algorithm. (f) 3D shape by the fast three-step algorithm.

In this paper, we proposed a fast three-step phaseshifting algorithm based on intensity ratio calculation and LUT error compensation for real-time 3D shape measurement. This algorithm originated from the previously proposed trapezoidal phase-shifting method, which was aimed at improving the process-

ing speed of the fringe images. In this research, we found that the same algorithm developed for the trapezoidal fringe patterns could be used to process sinusoidal fringe images with a small error, which could be easily eliminated by using an LUT method. This finding resulted in a new three-step phase-shifting algorithm that is 3.4 times faster than and just as accurate as the traditional three-step algorithm. Experimental results demonstrated the effectiveness of the proposed algorithm. We have successfully imple-

Fig. 7. (Color online) Experimental setup for real-time 3D shape acquisition, reconstruction, and display.

Fig. 8. (Color online) Real-time measurement of human facial expressions.

subject, while the image on the right is the 3D shape of the face generated by our system in real time. 5. Conclusions

5090

APPLIED OPTICS 兾 Vol. 45, No. 21 兾 20 July 2006

mented this algorithm in our real-time 3D shape measurement system, which resulted in a frame rate of 40 fps and a resolution of 532 ⫻ 500 points. This work was supported by the National Science Foundation under grant CMS-9900337 and the National Institute of Health under grant RR13995. References 1. D. Malacara, ed., Optical Shop Testing (Wiley, 1992). 2. D. C. Ghiglia and M. D. Pritt, Two-Dimensional Phase Unwrapping: Theory, Algorithms, and Software (Wiley, 1998). 3. M. A. Herráez, D. R. Burton, M. J. Lalor, and M. A. Gdeisat, “Fast two-dimensional phase-unwrapping algorithm based on sorting by reliability following a noncontinuous path,” Appl. Opt. 41, 7437–7444 (2002). 4. M. A. Herráez, M. A. Gdeisat, D. R. Burton, and M. J. Lalor, “Robust, fast, and effective two-dimensional automatic phase unwrapping algorithm based on image decomposition,” Appl. Opt. 41, 7445–7455 (2002). 5. A. Asundi and W. Zhou, “Fast phase-unwrapping algorithm based on a gray-scale mask and flood fill,” Appl. Opt. 37, 5416 – 5420 (1998). 6. P. Huang, S. Zhang, and F.-P. Chiang, “Trapezoidal phaseshifting method for 3-D shape Measurement,” in Two- and Three-Dimensional Vision Systems for Inspection, Control, and Metrology II, K. G. Harding, ed., Proc. SPIE 5606, 142–152 (2004). 7. D.-S. Wan and D.-T. Lin, “Ronchi test and a new phase reduction algorithm,” Appl. Opt. 29, 3255–3265 (1990).

8. P. S. Huang, C. Zhang, and F. P. Chiang, “High-speed 3-D shape measurement based on digital fringe projection,” Opt. Eng. 42, 163–168 (2003). 9. S. Zhang and P. Huang, “High-resolution, real-time 3-D shape acquisition,” presented at the IEEE Computer Vision and Pattern Recognition Workshop (CVPRW’04), Washington, D.C., 27 June–2 July 2004. 10. S. Zhang, “High-resolution, real-time 3D shape measurement,” Ph.D. thesis (State University of New York at Stony Brook, 2005). 11. C. Zhang, P. S. Huang, and F.-P. Chiang, “Microscopic phaseshifting profilometry based on digital micromirror device technology,” Appl. Opt. 41, 5896 –5904 (2002). 12. B. Carrihill and R. Hummel, “Experiments with the intensity ratio depth sensor,” Comput. Vis. Graph. Image Process. 32, 337–358 (1985). 13. T. Miyasaka, K. Kuroda, M. Hirose, and K. Araki, “Reconstruction of realistic 3D surface model and 3D animation from range images obtained by real time 3D measurement system,” in Proceedings of the International Conference on Pattern Recognition 2000 (IEEE, 2000), pp. 594 –598. 14. T. Miyasaka, K. Kuroda, M. Hirose, and K. Araki, “High speed 3-D measurement system using incoherent light source for human performance analysis,” in XIXth Congress of the International Society for Photogrammetry and Remote Sensing, K. J. B. M. Molenaar, ed. (ISPRS, 2000), pp. 16 –23. 15. G. Chazan and N. Kiryati, “Pyramidal intensity-ratio depth sensor,” Tech. Rep. 121 (Israel Institute of Technology, 1995).

20 July 2006 兾 Vol. 45, No. 21 兾 APPLIED OPTICS

5091

Fast three-step phase-shifting algorithm

Our experimental results show that both the new algorithm and ... However, our experiments show that ..... Foundation under grant CMS-9900337 and the Na-.

788KB Sizes 1 Downloads 193 Views

Recommend Documents

A Fast String Searching Algorithm
number of characters actually inspected (on the aver- age) decreases ...... buffer area in virtual memory. .... One telephone number contact for those in- terested ...

A Fast String Searching Algorithm
An algorithm is presented that searches for the location, "i," of the first occurrence of a character string, "'pat,'" in another string, "string." During the search operation, the characters of pat are matched starting with the last character of pat

A Fast Bit-Vector Algorithm for Approximate String ...
Mar 27, 1998 - algorithms compute a bit representation of the current state-set of the ... *Dept. of Computer Science, University of Arizona Tucson, AZ 85721 ...

A Fast Line Segment Based Dense Stereo Algorithm ...
Intitute of HCI and Media Integration, Key Lab of Pervasive Computing(MOE). 3-524, Fit building, Tsinghua University, Beijing 100084, P.R. China ... survey by Scharstern and Szeliski [1] and the one by Brown et al. [2]. ..... Two registers stores.

A Fast Algorithm for Mining Rare Itemsets
telecommunication equipment failures, linking cancer to medical tests, and ... rare itemsets and present a new algorithm, named Rarity, for discovering them in ...

A Fast Algorithm For Rate Optimized Motion Estimation
Abstract. Motion estimation is known to be the main bottleneck in real-time encoding applications, and the search for an effective motion estimation algorithm has ...

A Fast and Simple Surface Reconstruction Algorithm
Jun 17, 2012 - Octree decomposition. Root cell smallest bounding cube of P. Splitting rule split a splittable leaf cell into eight children. Balancing rule split a leaf cell C if it has a neighbor C/ s.t. lC < lC /2. Apply the two rules alternately u

Implementation of Fast Radix-2 DCT Algorithm using ...
IJRIT International Journal of Research in Information Technology, Volume 2, Issue 4, ... signal flow graphs, and Coordinate rotation digital computer (CORDIC) .... The following are some major features of our proposed CORDIC-based fast ...

A Fast and Efficient Algorithm for Low-rank ... - Semantic Scholar
The Johns Hopkins University [email protected]. Thong T. .... time O(Md + (n + m)d2) where M denotes the number of non-zero ...... Computer Science, pp. 143–152 ...

A Fast and Efficient Algorithm for Low-rank ... - Semantic Scholar
republish, to post on servers or to redistribute to lists, requires prior specific permission ..... For a fair comparison, we fix the transform matrix to be. Hardarmard and set .... The next theorem is dedicated for showing the bound of d upon which

A Fast Line Segment Based Dense Stereo Algorithm ...
problem stems from the pixel-based tree construction. Many edges in ... Stereo correspondence has been one of the most important problems in computer vision ...

A Fast Bit-Vector Algorithm for Approximate String ...
Mar 27, 1998 - Simple and practical bit- ... 1 x w blocks using the basic algorithm as a subroutine, is significantly faster than our previous. 4-Russians ..... (Eq or (vin = ;1)) capturing the net effect of. 4 .... Figure 4: Illustration of Xv compu

A BIO-INSPIRED FAST SWARMING ALGORITHM ...
Dynamic radio access techniques have been investigated in recent years as a way .... be avoided by the swarm individuals as fast as possible, while idle bands represent regions rich of food that the agents have to occupy reducing their speed. Mimicki

A Fast Distributed Approximation Algorithm for ...
We present a fast distributed approximation algorithm for the MST problem. We will first briefly describe the .... One of our motivations for this work is to investigate whether fast distributed algo- rithms that construct .... and ID(u) < ID(v). At

A Fast Bresenham Type Algorithm For Drawing Ellipses
We define a function which we call the which is an .... refer to the ellipse's center point coordinates and its horizontal and vertical radial values. So. \V+.3?= œ +.

Fast Web Clustering Algorithm using Divide and ...
5 : Simulate adding d to c. 6: HR. ( ) ... Add d to c. 9: end if. 10: end for. 11: if (d was not added to any cluster) then. 12: Create a ... Basic theme of the algorithm is ...

A fast optimization transfer algorithm for image ...
Inpainting may be done in the pixel domain or in a transformed domain. In 2000 ... Here f and n are the original noise-free image and the Gaussian white noise ...... Step: δ t=0.08. Step: δ t=0.04. Step: Linear Search. Our Method. 0. 100. 200.

Fast Web Clustering Algorithm using Divide and ...
Clustering is the unsupervised classification of patterns .... [3] A.K. Jain, M.N. Murty, P.J. Flynn, Data clustering: a review, ACM Computing. Surveys 31 (3) (1999) ...

A fast convex conjugated algorithm for sparse recovery
of l1 minimization and run very fast on small dataset, they are still computationally expensive for large-scale ... quadratic constraint problem and make use of alternate minimiza- tion to solve it. At each iteration, we compute the ..... Windows XP

A Fast Greedy Algorithm for Generalized Column ...
In Proceedings of the 52nd Annual IEEE Symposium on Foundations of Computer. Science (FOCS'11), pages 305 –314, 2011. [3] C. Boutsidis, M. W. Mahoney, and P. Drineas. An improved approximation algorithm for the column subset selection problem. In P

A Fast Line Segment Based Dense Stereo Algorithm Using Tree ...
correspondence algorithm using tree dynamic programming (LSTDP) is ..... Scharstein, D., Szeliski, R.: A taxonomy and evaluation of dense two-frame.

An Algorithm for Fast, Model-Free Tracking ... - Research at Google
model nor a motion model. It is also simple to compute, requiring only standard tools: ... All these sources of variation need to be modeled for ..... in [5] and is available in R [27], an open source sys- tem for .... We will analyze the performance

a fast algorithm for vision-based hand gesture ...
responds to the hand pose signs given by a human, visually observed by the robot ... particular, in Figure 2, we show three images we have acquired, each ...

A Fast Algorithm For Rate Optimized Motion Estimation
uous motion field reduces the bit rate for differentially encoded motion vectors. Our motion ... In [3], we propose a rate-optimized motion estimation based on a “true” motion tracker. ..... ftp://bonde.nta.no/pub/tmn/software/, June 1996. 477.