I'm new with IPP and I'm looking for a simple way to calculate the center of gravity of an image. At the moment I'm using:
IppStatus ippiMoments64s_(const Ipp8u* pSrc, int srcStep, IppiSize roiSize, IppiMomentState_64s* pState); and IppStatus ippiGetSpatialMoment_64s(const IppiMomentState_64s* pState, int mOrd, int nOrd, int nChannel, IppiPoint roiOffset, Ipp64s* pValue, int scaleFactor);
as decriped in the ipp manual 11-47 p.774 to get the center of gravity in x and y.
This costs me 144us on a Core2Duo 2,15Mhz and 850us on an Atom 1,6Ghz.
Is there a faster way to calculate the center of gravity? My feeling is that a simple for-loop is already faster than calculation all the moments.
It seems yes, to calculte the center of gravity, the simple for-loop may faster than calculation all the moments. oruse some ofipp function combinations, for exmaple, M(0,0)=ippisum(); M(1,0)=ippiDotProd (pSrc, X Coordinate matrix) M(0,1)=ippiDotProd (PSrc, y Coordinate matrix)
Would you like submit this as a feature request, for example ippiGetCenterGravity()?