Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

to cross-correlate same size images:

//FORWARD TRANSFORMS
cv::cuda::dft(image1, G_image1, Size(SIZE,SIZE), DFT_SCALE);        
cv::cuda::dft(image2, G_image2, Size(SIZE,SIZE), DFT_SCALE);        

//MULTIPLY CONJUGATE
cv::cuda::mulSpectrums(G_image1,G_image2,G_image1,true);    

//BACKWARD TRANSFORM
cv::cuda::dft(G_image1,RESULT,Size(SIZE,SIZE),DFT_REAL_OUTPUT | DFT_SCALE);

result in unscaled cross-correlation, to scale between (-1,1):

  • normalize source images to have mean(src's) = 0, StdDev(src's) = 1

to cross-correlate same size images:

//FORWARD TRANSFORMS
cv::cuda::dft(image1, G_image1, Size(SIZE,SIZE), DFT_SCALE);        
cv::cuda::dft(image2, G_image2, Size(SIZE,SIZE), DFT_SCALE);        

//MULTIPLY CONJUGATE
cv::cuda::mulSpectrums(G_image1,G_image2,G_image1,true);    

//BACKWARD TRANSFORM
cv::cuda::dft(G_image1,RESULT,Size(SIZE,SIZE),DFT_REAL_OUTPUT | DFT_SCALE);

result in unscaled cross-correlation, to scale between (-1,1):

  • to normalize source images to have mean(src's) = 0, StdDev(src's) = 11 before computation

to cross-correlate same size images:

//FORWARD TRANSFORMS
cv::cuda::dft(image1, G_image1, Size(SIZE,SIZE), DFT_SCALE);        
cv::cuda::dft(image2, G_image2, Size(SIZE,SIZE), DFT_SCALE);        

//MULTIPLY CONJUGATE
cv::cuda::mulSpectrums(G_image1,G_image2,G_image1,true);    

//BACKWARD TRANSFORM
cv::cuda::dft(G_image1,RESULT,Size(SIZE,SIZE),DFT_REAL_OUTPUT | DFT_SCALE);

  • result in unscaled cross-correlation, cross-correlation
  • to scale between (-1,1):

    • to (-1,1): normalize source images to have mean(src's) = 0, StdDev(src's) = 1 before computation