## GPU-assisted high-resolution, real-time 3-D shape measurement

Optics Express, Vol. 14, Issue 20, pp. 9120-9129 (2006)

http://dx.doi.org/10.1364/OE.14.009120

Acrobat PDF (1229 KB)

### Abstract

This paper describes a Graphics Processing Unit (GPU)-assisted real-time three-dimensional shape measurement system. Our experiments demonstrated that the absolute coordinates calculation and rendering speed of a GPU is more than four times faster than that of a dual CPU workstation with the same graphics card. By implementing the GPU into our system, we realized simultaneous absolute coordinate acquisition, reconstruction and display at 30 frames per second with a resolution of approximately 266K points per frame. Moreover, a 2+1 phase-shifting algorithm was employed to alleviate the measurement error caused by motion. Applications of the system include medical imaging, manufacturing, entertainment, and security.

© 2006 Optical Society of America

## 1. Introduction

1. M. Takeda and K. Mutoh, “Fourier Transform Profilometry for the Automatic Measurement of 3-D Object Shape,” Appl. Opt. **22**, 3977–3982 (1983). [CrossRef] [PubMed]

2. S. Almazán-Cuéllar and D. Malacara-Hernández, “Two-step Phase-shifting Algorithm,” Opt. Eng. **42**, 3524–3531 (2003). [CrossRef]

3. C. Quan, C. J. Tay, X. Kang, X. Y. He, and H. M. Shang, “Shape Measurement by Use of Liquid-crystal Display Fringe Projection with Two-step Phase-Shifting,” Appl. Opt. **42**, 2329–2335 (2003). [CrossRef] [PubMed]

4. P. S. Huang and S. Zhang, “A Fast Three-Step Phase Shifting Algorithm,” Appl. Opt.45 (2006). [CrossRef] [PubMed]

5. S. Zhang and P. S. Huang, “High-Resolution, Real-time 3-D Shape Measurement,” Opt. Eng. (2006). In Press. [CrossRef]

8. P. L. Wizinowich, “Phase Shifting Interferometry in the Presence of Vibration: A New Algorithm and System,” Appl. Opt. **29**, 3271–3279 (1990). [CrossRef] [PubMed]

9. J. C. Wyant, “Phase Shifting Interferometry,” http://www.optics.arizona.edu/jcwyant/Optics513/optics513.htm (1998).

## 2. Fundamentals of the GPU

*x,y, z,w*). The vertex shader generates the clip space coordinates (

*cx,cy, cz,cw*) by multiplying the input position coordinates with the model-view matrix. The color for each vertex is also needed to be assigned for each vertex in order to visualize it. The vertex shader takes the input vertex normal (

*nx,ny,nz*) from CPU and computes the vertex color from the lighting condition in a form, (

*r,g,b*), for example. The vertex data is streamed into the GPU where the polygon vertices are processed and assembled based on the order of the incoming data. The GPU handles the transfer of streaming data to parallel computation automatically. Although the clock rate of a GPU is significantly slower than that of a CPU (e.g. our system’s 425MHz Quadro FX 3450 GPU compared to our system’s 3.4GHz Pentium 4 CPU), it has multiple vertex processors (8) acting in parallel, therefore, the throughput of the GPU can exceed that of the CPU. As GPUs increase in complexity the number of vertex processors increase leading to great improvements in performance. Pixel shaders are mostly used to compute color properties of each pixel. Pixel shaders are applied for each pixel and are run on a pixel processor. They usually have much more processing power than its vertex-oriented counterpart.

## 3. Principle

### 3.1. Three-step phase shifting algorithm

*π*/3 can be written as,

*I*

^{′}(

*x,y*) represents the average intensity,

*I*

^{″}(

*x,y*) the intensity modulation, and

*ϕ*(

*x,y*) the phase to be resolved. Solving these equations simultaneously, we can obtain the phase

### 3.2. 2+1 phase-shifting algorithm

*ϕ*(

*x,y*) in Eq. (4) or Eq. (9) is the so-called modulo 2

*π*at each pixel, whose value ranges from 0 to 2

*π*. If the fringe patterns have multiple fringes, phase unwrapping is necessary to remove the sawtooth-like discontinuities and obtain a continuous phase map [16]. In this research, we employed a multi-level quality-guided phase unwrapping algorithm that is robust and fast. The detailed algorithm is in a paper under revision at current stage [17

17. S. Zhang, X. Li, and S.-T. Yau, “Multi-level Quality-Guided Phase Unwrapping Algorithm for Real-time 3-D Reconstruction,” Appl. Opt. (2006). In Revision. [PubMed]

18. S. Zhang and P. S. Huang, “A Novel Structured Light System Calibration,” Opt. Eng.45 (2006). [CrossRef]

*γ*(

*x,y*) in Eq. (5) or Eq. (10) has a value between 0 and 1 and can be used to determine the quality of the phase data at each pixel with 1 being the best.

4. P. S. Huang and S. Zhang, “A Fast Three-Step Phase Shifting Algorithm,” Appl. Opt.45 (2006). [CrossRef] [PubMed]

### 3.3. Absolute phase to absolute coordinate conversion

18. S. Zhang and P. S. Huang, “A Novel Structured Light System Calibration,” Opt. Eng.45 (2006). [CrossRef]

*A*and projector matrix

_{c}*A*,

_{p}*x,y,z*) (or the absolute coordinates) and the camera pixel coordinates (

*u*) and the projector pixel coordinates (

^{c},v^{c}*u*) are

^{p},v^{p}*s*are camera and projector scaling factor, respectively.

^{c}, s^{p}*ϕ*is obtained, the relationship between the camera coordinates and the projector coordinates can be established,

_{a}*P*, the number of pixels per fringe period, and the total number of pixels in the

*x*direction being

*W*,

_{p}*W*/2 in this equation is used to convert the center of the projected fringe image to be absolute phase 0.

^{p}### 3.4. GPU aided computation and rendering

*v*and

_{0}, v_{1}*v*

_{2}of one triangle have absolute phase

*ϕ*

_{0},

*ϕ*

_{1}and ϕ2, respectively, and v0 has index

*id*

_{0}in the phase image. The position coordinate input of the vertex data is (

*ϕ*

_{0},

*ϕ*

_{1},

*ϕ*

_{2},

*id*

_{0}). Since the relationship between the three vertices is known, the indices of the other two vertices are uniquely determined from the index of

*v*

_{0}. Therefore, the absolute coordinates for each vertex can be computed using Eq. (18). Once the absolute coordinates are known, the vertex normal (

*nx,ny,nz*)0 for vertex

*v*

_{0}can be computed on the GPU from the three vertices of the triangle. Once the vertex normal is known, the color (

*r,g,b*)

_{0}for this vertex can be calculated from the light condition setup. Vertex data for vertex

*v*

_{0}will be used for the following pipeline, while the other two vertex data are discarded from this vertex shader. Figure 3 shows the diagram of our vertex shader. Once the coordinates and the normal for each vertex are known, the GPU then generates the clip-space coordinates and lighting. Finally, the streaming points are assembled into polygon sets and rendered by the GPU.

## 4. Experiments

## 5. Conclusions and FutureWorks

## Acknowledgement

## References and links

1. | M. Takeda and K. Mutoh, “Fourier Transform Profilometry for the Automatic Measurement of 3-D Object Shape,” Appl. Opt. |

2. | S. Almazán-Cuéllar and D. Malacara-Hernández, “Two-step Phase-shifting Algorithm,” Opt. Eng. |

3. | C. Quan, C. J. Tay, X. Kang, X. Y. He, and H. M. Shang, “Shape Measurement by Use of Liquid-crystal Display Fringe Projection with Two-step Phase-Shifting,” Appl. Opt. |

4. | P. S. Huang and S. Zhang, “A Fast Three-Step Phase Shifting Algorithm,” Appl. Opt.45 (2006). [CrossRef] [PubMed] |

5. | S. Zhang and P. S. Huang, “High-Resolution, Real-time 3-D Shape Measurement,” Opt. Eng. (2006). In Press. [CrossRef] |

6. | S. Zhang and S.-T. Yau, “High-resolution, Real-time 3D Absolute Coordinate Measurement Based on a Phase-shifting Method,” Opt. Express45 (2006). |

7. | J. R. P. Angel and P. L. Wizinowich, “A Method of Phase Shifting in the Presence of Vibration,” in |

8. | P. L. Wizinowich, “Phase Shifting Interferometry in the Presence of Vibration: A New Algorithm and System,” Appl. Opt. |

9. | J. C. Wyant, “Phase Shifting Interferometry,” http://www.optics.arizona.edu/jcwyant/Optics513/optics513.htm (1998). |

10. | M. Ujaldon and J. Saltz, “Exploiting Parallelism on Irregular Applications Using the GPU,” in |

11. | B. Khailany, W. Dally, S. Rixner, U. Kapasi, J. Owens, and B. Towles, “Exploring the VLSI Scalability of Stream Processors,” in |

12. | E. Lindholm, M. J. Kligard, and H. Moreton, “A user-programmable vertex engine,” in |

13. | R. Fernando and M. J. Kilgard, |

14. | D. Malacara, ed., |

15. | S. Zhang, “High-Resolution, Real-Time 3-D Shape Measurement,” Ph.D. thesis, Stony Brook University, State University of New York (2005). |

16. | D. C. Ghiglia and M. D. Pritt, |

17. | S. Zhang, X. Li, and S.-T. Yau, “Multi-level Quality-Guided Phase Unwrapping Algorithm for Real-time 3-D Reconstruction,” Appl. Opt. (2006). In Revision. [PubMed] |

18. | S. Zhang and P. S. Huang, “A Novel Structured Light System Calibration,” Opt. Eng.45 (2006). [CrossRef] |

**OCIS Codes**

(100.2650) Image processing : Fringe analysis

(110.6880) Imaging systems : Three-dimensional image acquisition

(120.3940) Instrumentation, measurement, and metrology : Metrology

(120.5800) Instrumentation, measurement, and metrology : Scanners

(120.6650) Instrumentation, measurement, and metrology : Surface measurements, figure

(150.6910) Machine vision : Three-dimensional sensing

**ToC Category:**

Imaging Systems

**History**

Original Manuscript: June 30, 2006

Revised Manuscript: August 29, 2006

Manuscript Accepted: August 30, 2006

Published: October 2, 2006

**Virtual Issues**

Vol. 1, Iss. 11 *Virtual Journal for Biomedical Optics*

**Citation**

Song Zhang, Dale Royer, and Shing-Tung Yau, "GPU-assisted high-resolution, real-time 3-D shape measurement," Opt. Express **14**, 9120-9129 (2006)

http://www.opticsinfobase.org/vjbo/abstract.cfm?URI=oe-14-20-9120

Sort: Year | Journal | Reset

### References

- M. Takeda and K. Mutoh, "Fourier Transform Profilometry for the Automatic Measurement of 3-D Object Shape," Appl. Opt. 22, 3977-3982 (1983). [CrossRef] [PubMed]
- S. Almaz´an-Cu´ellar and D. Malacara-Hern´andez, "Two-step Phase-shifting Algorithm," Opt. Eng. 42, 3524-3531 (2003). [CrossRef]
- C. Quan, C. J. Tay, X. Kang, X. Y. He, and H. M. Shang, "Shape Measurement by Use of Liquid-crystal Display Fringe Projection with Two-step Phase-Shifting," Appl. Opt. 42, 2329-2335 (2003). [CrossRef] [PubMed]
- P. S. Huang and S. Zhang, "A Fast Three-Step Phase Shifting Algorithm," Appl. Opt. 45 (2006). [CrossRef] [PubMed]
- S. Zhang and P. S. Huang, "High-Resolution, Real-time 3-D Shape Measurement," Opt. Eng. (2006). In Press. [CrossRef]
- S. Zhang and S.-T. Yau, "High-resolution, Real-time 3D Absolute Coordinate Measurement Based on a Phaseshifting Method," Opt. Express 1414, 2644-2649 (2006).
- J. R. P. Angel and P. L. Wizinowich, "A Method of Phase Shifting in the Presence of Vibration," in ESO Proc., vol. 30 (1988).
- P. L. Wizinowich, "Phase Shifting Interferometry in the Presence of Vibration: A New Algorithm and System," Appl. Opt. 29, 3271-3279 (1990). [CrossRef] [PubMed]
- J. C. Wyant, "Phase Shifting Interferometry," http://www.optics.arizona.edu/jcwyant/Optics513/optics513.htm (1998).
- M. Ujaldon and J. Saltz, "Exploiting Parallelism on Irregular Applications Using the GPU," in Intl. Conf. on Paral. Comp., pp. 13-16 (2005).
- B. Khailany, W. Dally, S. Rixner, U. Kapasi, J. Owens, and B. Towles, "Exploring the VLSI Scalability of Stream Processors," in Proc. 9th Symp. on High Perf. Comp. Arch., pp. 153-164 (2003).
- E. Lindholm, M. J. Kligard, and H. Moreton, "A user-programmable vertex engine," in Proc. of SIGGRAPH, pp. 149-158 (2001).
- R. Fernando and M. J. Kilgard, The Cg Tutorial (Addison-Wesley, Boston, 2003).
- D. Malacara, ed., Optical Shop Testing (John Wiley and Songs, NY, 1992).
- S. Zhang, "High-Resolution, Real-Time 3-D Shape Measurement," Ph.D. thesis, Stony Brook University, State University of New York (2005).
- D. C. Ghiglia and M. D. Pritt, Two-Dimensional Phase Unwrapping: Theory, Algorithms, and Software (John Wiley and Sons, Inc, 1998).
- S. Zhang, X. Li, and S.-T. Yau, "Multi-level Quality-Guided Phase Unwrapping Algorithm for Real-time 3-D Reconstruction," Appl. Opt. (2006). In Revision. [PubMed]
- S. Zhang and P. S. Huang, "A Novel Structured Light System Calibration," Opt. Eng. 45 (2006). [CrossRef]

## Cited By |
Alert me when this paper is cited |

OSA is able to provide readers links to articles that cite this paper by participating in CrossRef's Cited-By Linking service. CrossRef includes content from more than 3000 publishers and societies. In addition to listing OSA journal articles that cite this paper, citing articles from other participating publishers will also be listed.

### Multimedia

Multimedia Files | Recommended Software |

» Media 1: MOV (2383 KB) |

« Previous Article | Next Article »

OSA is a member of CrossRef.