Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.

ippiConv

dotrung_d_
Beginner
160 Views

Hi. Can anybody help me with this problem. I have 2 images src1 and src2 of Mat type.

I want to use ippiConv to convolve but there was a problem of accessing memory.

Here is my code

    Mat src1, src2, dest;

    const IppiSize src1Size = { src1.size().width, src1.size().height };
    const IppiSize src2Size = { src2.size().width, src2.size().height};
    
    
    IppEnum funCfgFull = (IppEnum)(ippAlgAuto | ippiROIFull | ippiNormNone);
    IppEnum funCfgValid = (IppEnum)(ippAlgAuto | ippiROIValid | ippiNormNone);
    Ipp8u *pBuffer;
    int bufSizeFull, bufSizeValid, bufSizeMax;
    IppStatus status;    
    

    status = ippiConvGetBufferSize(src1Size, src2Size, ipp32f, 1, funCfgFull, &bufSizeFull);
    
    status = ippiConvGetBufferSize(src1Size, src2Size, ipp32f, 1, funCfgValid, &bufSizeValid);
    
    bufSizeMax = IPP_MAX(bufSizeFull, bufSizeValid); // get max buffer size
    pBuffer = ippsMalloc_8u(bufSizeMax);

    dest.create(src1.size(), CV_32F);
    const IppiSize dstSize = { dest.size().width, dest.size().height };

    ippiSet_32f_C1R(0, (Ipp32f*)dest.data, dest.step, dstSize);

    ippiConv_32f_C1R((Ipp32f*)src1.data, src1.step, src1Size, (Ipp32f*)src2.data,
        src2.step, src2Size, (Ipp32f*)&dest.data, dest.step, funCfgFull, pBuffer);

    ippsFree(pBuffer);

Thank you in advance

 

0 Kudos
1 Reply
Chao_Y_Intel
Employee
160 Views

Hello, 

Could you provide the full test code for this problem?  Also which version of IPP are you using now,  and how IPP is linked there? 

That will help us to reproduce this problem. 

Thanks,
Chao

Reply