This repository contains a collection of tools (primarily in the file fpp_tools.py
) for doing fringe projection profilometry (FPP) --- projecting sinusoidal fringes onto an object and observing the resulting pattern with a camera. By projecting a sequence of fringes with different phase shifts, and saving an image at each step, we can measure the height profile of the object.
The set of images below show a conventional set of fringe projection images, using phase shift values of 0, 90, 180, and 270deg. We will call these images
We can see that some areas within the images do not contain fringes. While some FPP algorithms can handle this without trouble, some cannot. So, we crop the images down to the fringe-only region, such as shown here:
The conventional FPP algorithm takes these four shifts and estimates the object bias
The arctangent function will produce a wrapped phase. Once we unwrap this, we get a steadily increasing (or decreasing) function. When viewing a flat object, the unwrapped phi should be a tilted plane. This approach is calculated using the fpp_4_uniform_frames()
function.
If we take a sequence of images without an object, and then a second sequence with an object placed in front of the background, then the difference
In order to translate the height in radians to a physical unit (such as mm), we use
where
The above algorithm for calculating
This approach is calculated using the fpp_N_uniform_frames()
function.
A nice paper worked out how to generalize all of the FPP algorithms for nonunifom fringe spacing:
G. A. Ayubi, C. D. Perciante, J. L. Flores, J. M. D. Martino, and J. A. Ferrari, "Generation of phase-shifting algorithms with N arbitrarily spaced phase-steps," Applied Optics 53:7168-7176 (2014).
Before giving the algorithm in its most general form, I will give the calculation for 4 phases, which is easily verified against the standard 4-frame algorithm:
This approach is calculated using the fpp_4_nonuniform_frames()
function.
This really just amounts to using the fpp_N_nonuniform_frames()
function.
To further generalize this, what if we are doing FPP but don't actually know the phase relationships from the projector. There is a clever way of doing this developed in
Zhaoyang Wang and Bongtae Han, "Advanced iterative algorithm for phase extraction of randomly phase-shifted interferograms," Optics Letters 29:1671-1674 (2004).
The function fpp_estimate_deltas_and_phi()
gives an example of this algorithm.