[ITK] [ITK Community] Speeding up Cross Correlation

Matt McCormick matt.mccormick at kitware.com
Fri Nov 21 13:56:06 EST 2014


Hi Arjun,

Since computing an FFT requires all of an image, you cannot speed up
this algorithm even if only part of the output is required.

Some other options:

  ConvolutionImageFilter [1]

  A cross correlation metric [2].

Hope this helps,
Matt

[1] http://www.itk.org/Doxygen/html/classitk_1_1ConvolutionImageFilter.html

[2] http://www.itk.org/Doxygen/html/classitk_1_1CorrelationImageToImageMetricv4.html

On Fri, Nov 21, 2014 at 1:18 PM, Arjun S Kumar <arjun89 at cmu.edu> wrote:
> Hi all,
>
> I am trying to cross correlate two images such that the output image displays the similarity of the first image and the second image as a function of the translation of the second image.
>
> Currently, I'm using the itk::FFTNormalizedCorrelationImageFilter class. However, only a small portion, close to the center, of the output image is relevant for me. For example, for two images of sizes 500x500, the output image is about 1000x1000. However, I only need a 50x50 portion of the output image, centered at the center of the output image.
>
> So my question is, can I use this fact to perform the cross correlation faster? I tried using the SetRequiredNumberOfOverlappingPixels method to discard regions outside the 50x50 portion of the image but this didn't have a discernible effect on the speed of the operation. Shouldn't setting the required number of overlapping pixels to a high number decrease the time needed by reducing the domain of the output image?
>
> Is there a different way to manually set the size of the output image so that the computation is made faster? Can I change the requested region of the output image, just as we can do for input images?
>
> Are there other ITK classes that are more suited for this purpose. Does anybody recommend using neighborhood iterators? The problem I see with this is using a 500x500 neighborhood, which is too high isn't it?
>
> Please let me know.
>
> Thanks,
>
> Arjun
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community


More information about the Community mailing list