07.11.2014 Views

Application and Optimisation of the Spatial Phase Shifting ...

Application and Optimisation of the Spatial Phase Shifting ...

Application and Optimisation of the Spatial Phase Shifting ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

197<br />

Appendix B: Real-time phase calculation<br />

To utilise <strong>the</strong> real-time phase measuring capability that SPS <strong>of</strong>fers, <strong>the</strong> generation <strong>of</strong> phase maps must be<br />

accelerated by saving as many processor operations as possible. Particularly <strong>the</strong> arctangent calls, usually<br />

one for each pixel, lead to a great computational burden that is unnecessary when <strong>the</strong> input "sine" <strong>and</strong><br />

"cosine" terms have a reasonably narrow range <strong>of</strong> discrete values.<br />

Given <strong>the</strong> expression<br />

I−1 − I1<br />

ϕOmod 2π<br />

= arctan 3 , 2 I − I − I<br />

(B.1)<br />

0 −1 1<br />

<strong>the</strong> atan2 call, <strong>and</strong> <strong>the</strong> division, can be circumvented by generating a 2-D array from all possible values<br />

<strong>of</strong> numerator <strong>and</strong> denominator <strong>and</strong> assigning <strong>the</strong> corresponding ϕ O (converted to a discrete grey value) to<br />

each grid point, as shown in Fig. B.1. Also, <strong>the</strong> construction <strong>of</strong> M I is indicated; it can be seen that it is<br />

simply <strong>the</strong> length <strong>of</strong> <strong>the</strong> phasor composed by <strong>the</strong> sine <strong>and</strong> cosine terms.<br />

(2I 0 –I -1 –I 1 )<br />

– 510 0 510<br />

255<br />

(I -1 –I 1 )<br />

0<br />

j<br />

O<br />

I−1 − I1<br />

= arctan 3 2 I − I − I<br />

0 −1 1<br />

look-up table<br />

2<br />

−1 1<br />

2<br />

0 −1 1<br />

∝ M I = 3 ( I − I ) + ( 2 I − I − I )<br />

– 255<br />

Fig. B.1: Calculation <strong>of</strong> ϕ O <strong>and</strong> M I for 3-sample phase shifting formula with α=120°.<br />

For 8-bit digitisation <strong>of</strong> <strong>the</strong> I n , <strong>the</strong> size <strong>of</strong> <strong>the</strong> array thus defined (1021511 points) is still manageable<br />

with a formula involving terms from 2 or 3 intensity samples. It is well known that for α=90° <strong>and</strong> (3.16)<br />

or (3.19), only 511511 points are necessary. However, Fig. B.1 shows that also (3.17) can be<br />

implemented by a LUT without exaggerated expense. It is unnecessary to use <strong>the</strong> factor <strong>of</strong> L3 for <strong>the</strong><br />

arrangement <strong>of</strong> grid points; instead it can be integrated in <strong>the</strong> LUT. Fig. B.2 presents <strong>the</strong> central portion <strong>of</strong><br />

<strong>the</strong> LUT, where <strong>the</strong> anisotropy is visualised by reduction <strong>of</strong> <strong>the</strong> grey scale to 4 bits.<br />

Fig. B.2: Anisotropy <strong>of</strong> LUT for (3.17) due to horizontal stretching <strong>and</strong> inclusion <strong>of</strong><br />

3 from <strong>the</strong> sine term.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!