[Resolved] ippiFilter

[Resolved] ippiFilter

I have trouble with filter functions. Why does the code given throw an exception? dimX is 336, dimY is 333. The incoming image is single channel Ipp32f* type.

Pulling my hair out.

Thanks!

 


bool GetSmoothImage(const ImageCoreC&pInMap, int dimX, int dimY) {
IppStatus ippStatus =ippStsNoErr;

int bytesperPix =sizeof(Ipp32f);

int filterWing = 1;

IppiSize srcSize = {dimX,dimY};

int srcStepOrg = srcSize.width * bytesperPix;

IppiSize roiSize = {dimX- (2*filterWing),dimY- (2*filterWing)};
 

int dstStep;

Ipp32f*pDst = ippiMalloc_32f_C1(srcSize.width,srcSize.height,&dstStep);

Ipp32f* pSrcStartpoint =pInMap.Data() + (filterWing * srcSize.width) + filterWing;

Ipp32f* pDstStartpoint = pDst + (filterWing * srcSize.width) + filterWing;
ippStatus = ippiFilterGauss_32f_C1R(pSrcStartpoint, srcStepOrg, pDstStartpoint, dstStep, roiSize,

ippMskSize3x3);

publicaciones de 3 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

Works in my case:

#include <ipp.h>
#include <stdlib.h>
const static int dimX = 336, dimY = 333;
int main()
{
    ippInit();
    IppStatus ippStatus = ippStsNoErr;
    Ipp32f *pSrcImage;
    int bytesperPix = sizeof(Ipp32f);
    int filterWing = 1;
    pSrcImage = (Ipp32f*)malloc(dimX * bytesperPix * dimY);
    IppiSize srcSize = {dimX, dimY};
    ippiImageJaehne_32f_C1R(pSrcImage, dimX * bytesperPix, srcSize);
    int srcStepOrg = dimX * bytesperPix;
    IppiSize roiSize = {dimX - (2 * filterWing), dimY - (2 * filterWing)};
    int dstStep;
    Ipp32f *pDst = ippiMalloc_32f_C1(dimX, dimY, &dstStep);
    Ipp32f *pSrcStartpoint = pSrcImage + (filterWing * dimX) + filterWing;
    Ipp32f* pDstStartpoint = pDst + (filterWing * srcSize.width) + filterWing;
    ippStatus = ippiFilterGauss_32f_C1R(pSrcStartpoint, srcStepOrg, 
                pDstStartpoint, dstStep, roiSize, ippMskSize3x3);
    
    ippiFree(pDst);
    free(pSrcImage);
    return 0;
}

:))

Regards,
Sergey 

 

Regards,
Sergey

Thank you Sergey, I'll have to continue fishing. Like you if I run your code in a stand-alone environment, it works. I am running my original code in a DLL invoked from a separate thread. Something must be wrong there, at least I now know that the code fragment in question is not the culprit.

Uwe

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya