2.2. Parameters

All parameters are implemented as properties (managed attributes). They are parsed when set: values are clipped to the allowed range and usually several types are accepted, e.g. bool, int, float for numbers and additionally list, tuple, numpy.ndarray for sequences.

Note that some attributes have sub-dependencies, hence dependent attributes might change as well. Circular dependencies are resolved automatically.

2.2.1. Video Shape

shape is the standardized shape ( T, Y, X, C) of the fringe pattern sequence, with

  • T: number of frames

  • Y: height (in pixel units)

  • X: width (in pixel units)

  • C: number of color channels (depends on the coloring and multiplexing schemes activated).

L is the maximum of X and Y and denotes the length (in pixel units) to be encoded.

a can be used to extend L by the factor \(\in [1, 2]\) to Lext.

2.2.2. Coordinate System

The following coordinate systems can be used by setting grid to:

  • 'image': The top left corner pixel of the grid is the origin (0, 0) and positive directions are right- resp. downwards.

axes defines the order of the coordinate system’s axes. Default is (1, 0) i.e. Cartesian indexing.

D = len(axes) is the number of directions/dimensions of the coordinate system to use.

x are the coordinate matrices to be encoded.

2.2.3. Intensity Values

bits is the number of bits.

dtype denotes the data type which can hold \(2\) ^ bits of information. Possible values are:

  • 'uint8' (the default)

  • 'uint16'

  • 'uint32'

  • 'float32'

  • 'float64'

Imax is the maximum gray value and equals 1 for float and \(2\) ^ bits \(- 1\) for unsigned integers.

A is the offset, also called brightness (of the background) \(\in [0,\) Imax \(]\).

B is the amplitude of the cosinusoidal fringes \(\in [0,\) Imax \(]\).

V is the fringe visibility (also called fringe contrast). V = A / B, with V \(\in [0, 1]\).

E is the exposure (relative brightness) \(\in [0, 1]\).

g denotes the gamma correction factor and can be used to compensate non-linearities of the display response curve.

2.2.4. Set

K is the number of sets. It is equal for all directions D. Each set consists of the following attributes:

  • N: number of shifts

  • l: wavelength (in pixel units)

  • v: spatial frequency, i.e. number of periods (per screen length L)

  • f: temporal frequency, i.e. number of periods to shift over

Each is an array with shape (number of directions D, number of sets K). For example, if N.shape = (2, 3), it means that we encode D = 2 directions with K = 3 sets each. Changing D (resp. axes) or K directly, changes the shape of all set attributes. When setting a set attribute with a new shape, D (resp. axes) and K are updated as well as the shape of the other set attributes. If a set attribute is 0D, i.e. a scalar, then all values are simply replaced by the new one. If a set attribute is 1D, then it is stacked to match the number of directions D.

l and v are related by l = L / v. When L changes, v is kept constant and only l is changed.

f = 1 almost always. The most common exception is when frequency division multiplexing FDM is activated.

reverse is a boolean which reverses the direction of the shifts (by multiplying f with -1).

p0 denotes the phase offset, which can be used to e.g. let the fringe patterns start (at the origin) with a gray value of zero.

2.2.5. Coloring and Averaging

h denotes hues and is a sequence of RGB color triplets \(\in [0, 255]\). They are used to colorize the fringe patterns. However, black (0, 0, 0) is not allowed. h must be in shape (H, 3), where H is the number of hues and 3 is the length of the RGB color triplet.

The hues h can also be set by assigning any combination of the following characters as a string:

  • 'r': red

  • 'g': green

  • 'b': blue

  • 'c': cyan

  • 'm': magenta

  • 'y': yellow

  • 'w': white

C is the number of color channels required for either the set of hues h or wavelength division multiplexing. For example, if all hues are monochromatic, i.e. the RGB values are identical for each hue, C equals 1, else 3.

M is the number of averaged intensity samples (repeating hues will be fused by averaging them before decoding).

2.2.6. Multiplexing

The following multiplexing methods can be activated by setting them to True:

  • SDM: Spatial Division Multiplexing

    This results in crossed fringe patterns. It can only be activated if we have two directions D = 2. The number of frames T is reduced by a factor of 2.

  • WDM: Wavelength Division Multiplexing

    The shifts are multiplexed into the color channel, resulting in an RGB fringe pattern. All shifts N must equal 3. The number of frames T is reduced by a factor of 3.

  • FDM: Frequency Division Multiplexing

    Here, the directions D and the sets K are multiplexed. This results in crossed fringe patterns if D = 2. It can only be activated if D > 1 or K > 1. If one wants a static pattern, i.e. one that remains congruent when shifted, set static to True.

SDM and WDM can be used together (reducing T by a factor of 2 * 3 = 6), FDM with neither.

For more details, please refer to Multiplex.

2.2.7. Quality Metrics

UMR denotes the unambiguous measurement range. The coding is only unique within the interval [0, UMR); after that it repeats itself. It is derived from l and v:

  • If l \(\in \mathbb{N}\), UMR = \(lcm(\) l \()\), with \(lcm\) being the least common multiple.

  • Else, if v \(\in \mathbb{N}\), UMR = L / \(gcd(\) v \()\), with \(gcd\) being the greatest common divisor.

  • Else, if v \(\lor\) l \(\in \mathbb{Q}\) , \(lcm\) resp. \(gcd\) are extended to rational numbers.

  • Else, if v \(\land\) l \(\in \mathbb{R} \setminus \mathbb{Q}\) , UMR = \(prod(\) l \()\), with \(prod\) being the product operator.

uq denotes the minimum possible positional uncertainty (standard deviation) of the measurement in pixels when considering only quantization noise. It is based on the phase noise model from [Sur97] and propagated through the unwrapping process and the phase fusion. It is influenced by the parameters

  • \(1 / \sqrt{12}\): standard deviation of quantization noise of the light source or camera,

  • B: modulation of the fringe patterns,

  • M: number of averaged intensity samples,

  • N: number of phase shifts,

  • l: wavelengths

SQNR = L / uq is the signal-to-quantization-noise ratio of the phase shift coding. It is a measure of how many points can be distinguished at most within the screen length [0, L). It remains constant if L and hence l is scaled (the scaling factor cancels out).

DRQ = UMR / uq is the dynamic range of the phase shift coding. It a measure of how many points can be distinguished at most within the unambiguous measurement range \([0,\) UMR \()\). Again, it remains constant if L and hence l is scaled (the scaling factor cancels out).

eta = L / UMR is the spatial coding efficiency and is a measure of how well the coding range UMR fits the screen length L. It makes no sense to choose UMR much larger than L, because then a significant part of the coding range remains unused.