Optimal Coding Strategy
As makes sense intuitively, more sets K
as well as more shifts N
per set reduce the uncertainty u
after decoding.
A minimum of 3 shifts is needed to solve for the 3 unknowns brightness A
, modulation B
and coordinates x
.
Any additional 2 shifts compensate for one harmonic of the recorded fringe pattern.
Therefore, higher accuracy can be achieved using more shifts N
, but the time required to capture them
sets a practical upper limit to the feasible number of shifts.
Generally, shorter wavelengths l
(or equivalently more periods v
) reduce the uncertainty u
,
but the resolution of the camera and the display must resolve the fringe pattern spatially.
Hence, the used hardware imposes a lower bound for the wavelength lmin
(or upper bound for the number of periods vmax
).
Also, small wavelengths might result in a smaller unambiguous measurement range UMR
.
If two or more sets K
are used and their wavelengths l
resp. number of periods v
are relative primes,
the unmbiguous measurement range can be increased many times.
As a consequence, one can use much smaller wavelenghts l
(larger number of periods v
).
However, it must be assured that the unambiguous measurment range is always equal or larger than both,
the width X
and the height Y
.
Else, temporal phase unwrapping would yield wrong results and thus instead
spatial phase unwrapping is used.
Be aware that in the latter case only a relative phase map is obtained,
which lacks the information of where exactly the camera sight rays were looking at during acquisition.
To simplify finding and setting the optimal parameters, one can choose from the followng options:
v
can be set to'optimal'
. This automatically determines the optimal integer set ofv
, based on the maximal resolvable spatial frequencyvmax
.Equivalently,
l
can also be set to'optimal'
. This will automatically determine the optimal integer set ofl
, based on the minimal resolvable wavelengthlmin
=L
/vmax
.T
can be set directly, based on the desired acquisition time. The optimalK
,N
and - if necessary - the multiplexing will be determined automatically.Instead of the options above, one can simply use the function
optimize()
: Ifumax
is specified, the optimal parameters are determined that allow a maximal uncertainty ofumax
with a minimum number of frames. Else, the parameters of the Fringes instance are optimized to yield the minimal uncertainty possible using the given number of framesT
.
However, these methods only perform optimally
if the recorded modulation B
is known (or can be estimated)
for certain spatial frequencies v
.
Measure the modulation transfer function (MTF) at a given number of sample points:
Set
K
to the required number of sample points (usually > 10 is a good value).Set
v
to'exponential'
. This will create spatial frequenciesv
spaced evenly on a log scale (a geometric progression), starting from 0 up tovmax
.Encode, acquire and decode the fringe pattern sequence.
Mask the values of
B
with nan where the camera wasn’t looking at the screen. The decoded modulationB
can be used as an indicator.Call
Bv(B)
with the estimated modulation from the measurement as the argument.Finlly, to get the modulation
B
at certain spatial frequenciesv
, simply callMTF(v)
. This method interpolates the modulation from the measurement at the pointsv
.
A linear MTF is assumed [1]: It starts at
v
= 0 with B = 1 and ends atv
=vmax
with B = 0. Therefore, the optimal wavelength isvopt
=vmax
/ 2.
As a last resort, a constant modulation transfer function is assumed: MTF(
v
) = 1.