[Insight-users] Passing an image to NormalizedCorrelationImageFilter::SetTemplate

Markus Neuner neuner.markus at gmx.net
Fri Feb 4 15:21:25 EST 2011


On 04.02.2011 02:48, David Doria wrote:
> Hi Markus,
>
> One last hurdle before I put this to rest.
>
> I tried to do the same thing but using a color image (and therefore a
> color query patch):
> http://www.itk.org/Wiki/ITK/Examples/WishList/ImageProcessing/ColorNormalizedCorrelation
>
> It doesn't like my call to
>   correlationFilter->SetTemplate(kernelOperator);
>
> error: no matching function for call to
> ‘itk::NormalizedCorrelationImageFilter<itk::Image<itk::CovariantVector<float,
> 3u>, 2u>, itk::Image<itk::CovariantVector<float, 3u>, 2u>,
> itk::Image<float, 2u>,
> float>::SetTemplate(itk::ImageKernelOperator<itk::CovariantVector<float,
> 3u>, 2u, itk::NeighborhoodAllocator<itk::CovariantVector<float, 3u> >&)’
>   
> note: candidates are: void
> itk::NormalizedCorrelationImageFilter<TInputImage, TMaskImage,
> TOutputImage, TOperatorValueType>::SetTemplate(const typename
> itk::NeighborhoodOperatorImageFilter<TInputImage, TOutputImage,
> TOperatorValueType>::OutputNeighborhoodType&) [with TInputImage =
> itk::Image<itk::CovariantVector<float, 3u>, 2u>, TMaskImage =
> itk::Image<itk::CovariantVector<float, 3u>, 2u>, TOutputImage =
> itk::Image<float, 2u>, TOperatorValueType = float]
>
> I specified the correlation filter as:
>
> typedef itk::NormalizedCorrelationImageFilter<FloatVectorImageType,
> FloatVectorImageType, FloatImageType> CorrelationFilterType;
>
> and the kernel operator as:
>
> itk::ImageKernelOperator<FloatVectorType> kernelOperator;
>
> Do you see a problem with that?
>
> Thanks,
>
> David
>
>   

Hi David,

The operator and NormalizedCorrelationImageFilter require scalar inputs.
Either extract each channel of the RGB-Image, compute the correlation
for each channel and combine the resulting correlations with a method of
choice.
Or  you can extract the luminance to calculate the correlation.

A more general question here is is how you define correlation of color
images.

To enable vetor images the ImageKernelOperator, NeighborhoodOperator and
NormalizedCorrelationImageFilter must be adapted.

I hope this helps.

Cheers,
Markus








More information about the Insight-users mailing list