How to do un-normalized 2D Cross Correlation in IPP
Asked Answered
L

1

2

I'm doing some C++ optimization work and have need of the plain vanilla version of cross correlation without any mean offset or normalization scaling operations. I know that under normal circumstances with image data the influence of brightness is removed using the above means so that only structural similarity can be discerned but in our application brightness is actually needed. I'm using IPP 7.1, does anybody know if there's a means to do this? The next best thing I'll have to do is write the loops manually and exploit SIMD autovectorization together with some OpenMP parallelization.

Lofty answered 23/7, 2015 at 23:47 Comment(0)
D
1

Yes, of course, there are also available CrossCorr functions without normalization - take a look at ippi.h:

IPPAPI( IppStatus, ippiCrossCorrValid_32f_C1R, ( const Ipp32f* pSrc,
    int srcStep, IppiSize srcRoiSize, const Ipp32f* pTpl, int tplStep,
    IppiSize tplRoiSize, Ipp32f* pDst, int dstStep ))

IPPAPI( IppStatus, ippiCrossCorrValid_8u32f_C1R, ( const Ipp8u* pSrc,
    int srcStep, IppiSize srcRoiSize, const Ipp8u* pTpl, int tplStep,
    IppiSize tplRoiSize, Ipp32f* pDst, int dstStep ))

IPPAPI( IppStatus, ippiCrossCorrValid_8s32f_C1R, ( const Ipp8s* pSrc,
    int srcStep, IppiSize srcRoiSize, const Ipp8s* pTpl, int tplStep,
    IppiSize tplRoiSize, Ipp32f* pDst, int dstStep ))

IPPAPI( IppStatus, ippiCrossCorrValid_16u32f_C1R, ( const Ipp16u* pSrc,
    int srcStep, IppiSize srcRoiSize, const Ipp16u* pTpl, int tplStep,
    IppiSize tplRoiSize, Ipp32f* pDst, int dstStep ))

Regards, Igor

Drudge answered 27/7, 2015 at 7:43 Comment(1)
Shucks my bad, documentation fail on my part, my eyes blazed right over that function. I guess I was looking for CrossCorrSame but I can work with the valid flavor. Image Proximity Measures: SqrDistanceFull_Norm, SqrDistanceSame_Norm, SqrDistanceValid_Norm, CrossCorrFull_Norm, CrossCorrSame_Norm, CrossCorrValid_Norm, CrossCorrValid, CrossCorrFull_NormLevel, CrossCorrSame_NormLevel, CrossCorrValid_NormLevelLofty

© 2022 - 2024 — McMap. All rights reserved.