SMIL  0.9.1
FFT(W) based functions
+ Collaboration diagram for FFT(W) based functions:


template<class T1 , class T2 >
RES_T correlation (Image< T1 > &imIn1, Image< T1 > &imIn2, Image< T2 > &imOut)
 2D image (normalized) cross correlation using FFT. More...

Detailed Description

Function Documentation

RES_T smil::correlation ( Image< T1 > &  imIn1,
Image< T1 > &  imIn2,
Image< T2 > &  imOut 

2D image (normalized) cross correlation using FFT.

Input images must have same size.

Can be used to find a template image within a larger one:

correlation(sourceImg, templateImg, corrImg)
pt = UintPoint()
maxVal(corrImg, pt)
print pt.x, pt.y # gives the position of the template image within the source image