06.02.2013 Views

PhD thesis - Institute for Computer Graphics and Vision - Graz ...

PhD thesis - Institute for Computer Graphics and Vision - Graz ...

PhD thesis - Institute for Computer Graphics and Vision - Graz ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.2. Plane Sweep Depth Estimation 47<br />

4.2.2.2 Normalized Correlation Coefficient<br />

The widely used (zero-mean) normalized correlation coefficient <strong>for</strong> window-based local<br />

matching of two images X <strong>and</strong> Y is (where ¯ X <strong>and</strong> ¯ Y denote the means inside the rectan-<br />

gular region W)<br />

ZNCC =<br />

�<br />

i∈W (Xi − ¯ X) (Yi − ¯ Y )<br />

�� i∈W (Xi − ¯ �<br />

X) 2<br />

i∈W (Yi − ¯ Y ) 2<br />

which is invariant under (affine linear) changes of luminance between images, but relatively<br />

costly to calculate. Using integral images the ZNCC can be calculated in constant time<br />

regardless of the correlation window size [Tsai <strong>and</strong> Lin, 2003], since<br />

ZNCC =<br />

� XiYi − ( � Xi) ( � Yi) /N<br />

��� X2 i − ( � Xi) 2 � �� /N Y 2<br />

i − ( � Yi) 2 �<br />

/N<br />

.<br />

From the above <strong>for</strong>mula it can be seen that five integral images are requires to calculate<br />

the ZNCC: the integral image <strong>for</strong> � Xi, � Yi, � X 2 i , � Y 2<br />

i <strong>and</strong> finally � XiYi. The<br />

precision requirement <strong>for</strong> the higher order sums is 8 + 8 + log 2 512 + log 2 512 = 34 bit <strong>for</strong><br />

512 × 512 source images. The 32 bit floating point <strong>for</strong>mat of current GPUs has a mantissa<br />

of 23 bit <strong>and</strong> artefacts due to precision loss may occur. Figure 4.2 illustrates the reduced<br />

precision by depicting a ZNCC error image generated in software on a CPU <strong>and</strong> another<br />

one computed on the GPU. An increasing loss of precision can be seen towards the lower<br />

right corner of the image. Since the integral image generations starts from the upper left<br />

corner, the lower right portion has the highest precision requirements within the integral<br />

image.<br />

Note that the precision requirements <strong>for</strong> the simple sums � Xi <strong>and</strong> � Yi are 26 bit <strong>for</strong><br />

8 bit images with 512 × 512 pixels resolution. By subtracting the image mean in advance<br />

from the source image two additional precision bits can be saved: one by halving the<br />

magnitude of the source values <strong>and</strong> another one by exploiting the sign bit in the integral<br />

image.<br />

Instead of creating full integral images, which allows box filtering with arbitrary window<br />

sizes, it is usually sufficient to sum the values with a given specific window, since we do<br />

not vary the aggregation window size during similarity score computation. Accumulation<br />

of larger windows can be per<strong>for</strong>med using a similar recursive doubling scheme as used <strong>for</strong><br />

integral image generation. Consequently, the precision requirements on the target buffer<br />

storing the aggregated values depend on the window size, <strong>and</strong> these are substantially lower<br />

than the requirements <strong>for</strong> integral images.<br />

,

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

Saved successfully!

Ooh no, something went wrong!