[Insight-users] Minimum/Maximum Image Filters

Luis Ibanez luis.ibanez at kitware.com
Fri Dec 10 17:31:19 EST 2010


Hi Ryan,

I just created an example in the Wiki at:
http://www.itk.org/Wiki/ITK/Examples/SpectralAnalysis/CrossCorrelationInFourierDomain

WARNING: It still needs some debugging !     :-)

but the essential elements are there....

You take the FFT of the two input images,
multiply their spectra, and do the inverse
FFT of the resulting multiplication.

That should be equivalent to performing
cross-correlation in the spatial domain.

This only works well for face detection
if the object are aligned (not rotated)
and are not scaled,.... and the distribution
of intensities is similar. (so, it is mostly a
text-book example, rather than something
that you want to deploy in a working
system.


If I remember correctly , you still will
need to normalize by the auto-correlation
of each one of the two input images...


As usual, the images work better if their
size is a power of 2 (number of pixels
along X, and Y)

Please give it a try and let us know
if you find any problems, or make
any improvements.


    Luis


------------------------------------------------------------
On Fri, Dec 10, 2010 at 12:14 PM, Ryan Smith <ryanleesmith at gmail.com> wrote:
> Hi Luis-
>
> "FFT crosscorrelation if you were looking for a face in a group photograph"
>
> Is there any example code available for determining the location of a
> predefined template pattern image in another image using the aforementioned
> technique? If not, can you recommend some filters for me to check out
> myself? Thanks-
>
> -Ryan
>
> On Fri, Dec 10, 2010 at 7:12 AM, Luis Ibanez <luis.ibanez at kitware.com>
> wrote:
>>
>> Gaetan,
>>
>> Thanks for the clarification.
>>
>> An example has now been added for the
>> ValuedRegionalMaximaImageFilter:
>>
>>
>> http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/ValuedRegionalMaximaImageFilter
>>
>>
>>
>>       Luis
>>
>>
>> ------------------------------------------------
>> On Fri, Dec 10, 2010 at 7:49 AM, Gaëtan Lehmann
>> <gaetan.lehmann at jouy.inra.fr> wrote:
>> >
>> > Le 10 déc. 10 à 12:59, Luis Ibanez a écrit :
>> >
>> >> Hi David,
>> >>
>> >> Thanks for posting the example.
>> >>
>> >> I just modified the CreateImage() method
>> >> to better illustrate what this filter does.
>> >>
>> >>
>> >>
>> >> http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/RegionalMaximaImageFilter
>> >>
>> >> It essentially find the local maxima in the
>> >> input image and mark them in the output
>> >> image.  So, the output image is a binary
>> >> image that is zero everywhere, except at
>> >> the pixels that are local intensity maxima
>> >> in the input image.
>> >>
>> >> This is the filter that you may want to
>> >> run on the output of an FFT crosscorrelation
>> >> if you were looking for a face in a group
>> >> photograph, or the if you were analyzing
>> >> the parameter space of an Hough transform.
>> >>
>> >>
>> >> I'm not sure that this is what Robert was
>> >> asking for...   from his email, it looks like
>> >> he wanted the output pixel to have the
>> >> value of the input pixel.   On the bright side
>> >> that probably can be done with a minor
>> >> retouch of the filter source code.
>> >
>> > Hi,
>> >
>> > This is exactly what itk::ValuedRegionalMaximaImageFilter is doing.
>> > IIRC, itk::RegionalMaximaImageFilter use the output of
>> > itk::ValuedRegionalMaximaImageFilter to produce its output image.
>> >
>> > Regards,
>> >
>> > Gaëtan
>> >
>> >
>> >>
>> >> but, maybe now that the example is clearer,
>> >> it would be easier for Robert to give it a try
>> >> and let us know.
>> >>
>> >>
>> >>    Luis
>> >>
>> >>
>> >> -----------------------------------------------
>> >> On Thu, Dec 9, 2010 at 11:25 AM, David Doria <daviddoria at gmail.com>
>> >> wrote:
>> >>>
>> >>> On Thu, Dec 9, 2010 at 11:16 AM, Ryan Smith <ryanleesmith at gmail.com>
>> >>> wrote:
>> >>>>
>> >>>> Hi Robert-
>> >>>>
>> >>>> You might take a look at the itk::RegionalMaximaFilter.
>> >>>>
>> >>>> Here is a previous response that helped me with a similar task:
>> >>>>
>> >>>>
>> >>>>
>> >>>> http://public.kitware.com/pipermail/insight-users/2010-September/038088.html
>> >>>>
>> >>>> Cheers-
>> >>>> -Ryan
>> >>>
>> >>> (small typo:  itk::RegionalMaximaFilter ->
>> >>>  itk::RegionalMaximaImageFilter)
>> >>>
>> >>> I put a shell example here:
>> >>>
>> >>>
>> >>> http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/RegionalMaximaImageFilter
>> >>>
>> >>> I'm not exactly sure what this filter is supposed to do. If someone
>> >>> can modify the CreateImage function so that the resulting filtered
>> >>> image demonstrates the point that would be great.
>> >>>
>> >>> David
>> >>> _____________________________________
>> >>> Powered by www.kitware.com
>> >>>
>> >>> Visit other Kitware open-source projects at
>> >>> http://www.kitware.com/opensource/opensource.html
>> >>>
>> >>> Kitware offers ITK Training Courses, for more information visit:
>> >>> http://www.kitware.com/products/protraining.html
>> >>>
>> >>> Please keep messages on-topic and check the ITK FAQ at:
>> >>> http://www.itk.org/Wiki/ITK_FAQ
>> >>>
>> >>> Follow this link to subscribe/unsubscribe:
>> >>> http://www.itk.org/mailman/listinfo/insight-users
>> >>>
>> >> _____________________________________
>> >> Powered by www.kitware.com
>> >>
>> >> Visit other Kitware open-source projects at
>> >> http://www.kitware.com/opensource/opensource.html
>> >>
>> >> Kitware offers ITK Training Courses, for more information visit:
>> >> http://www.kitware.com/products/protraining.html
>> >>
>> >> Please keep messages on-topic and check the ITK FAQ at:
>> >> http://www.itk.org/Wiki/ITK_FAQ
>> >>
>> >> Follow this link to subscribe/unsubscribe:
>> >> http://www.itk.org/mailman/listinfo/insight-users
>> >
>> > --
>> > Gaëtan Lehmann
>> > Biologie du Développement et de la Reproduction
>> > INRA de Jouy-en-Josas (France)
>> > tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
>> > http://voxel.jouy.inra.fr  http://www.itk.org
>> > http://www.mandriva.org  http://www.bepo.fr
>> >
>> >
>
>


More information about the Insight-users mailing list