ippiFilterMedian_64f_C1R exception

ippiFilterMedian_64f_C1R exception

Hello,

I used ippiFilterMedian_64f_C1R in my application. Here is the code:

IppiPoint anchor = {mskSizeX/2, mskSizeY/2};

IppiSize roi = {(int)xdim_len - (mskSizeX - 1),(int)ydim_len - (mskSizeY -1)}, mask={mskSizeX, mskSizeY};   

Ipp32u bufSize = 0;   

status = ippiFilterMedianGetBufferSize_64f(roi, mask, 1, &bufSize);     

Ipp8u *buf;      

buf = ippsMalloc_8u((int) bufSize * sizeof(Ipp8u));       

status = ippiFilterMedian_64f_C1R((Ipp64f*)src_data.get_data(), xdim_len * sizeof(Ipp64f),(Ipp64f*)dst_data.get_data(), xdim_len * sizeof(Ipp64f), roi, mask, anchor, buf};

if(buf)    {     ippsFree( buf );    }

However, I got an exception when excuting the above code "... Access voliation reading location 0x...".

I also used other ippiFilterMedian functions like ippiFilterMedian_32f_C1R in my code. If I apply median filter using ippiFilterMedian_32f_C1R for a 32bit floating point image. Then used the above code and apply median filter for a 64bit floating point image, no exception is thrown in this case. I can get correctly processed images.

Please let me know is there any issue with my code? Or there is something wroing with ippiFilterMedian_64f_C1R?

Thanks.

 

4 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

Could you provide a complete test-case, please?

Thanks for the reply. I double checked my code and found that for the 64f case I did not offset the data pointers to jump at the roi’s beginning. After adding code to offset the data pointers, I got correctly processed images. I guess IPP median filter can provide an error code for this case instead of an unhandled exception.
BTW, in our application, we need to support larger masks up to 11 by 11 for median filters. However, IPP median filters only provides mask size up to 5 by 5. Will you consider improve IPP median filters by providing larger mask sizes to up to 11 by 11? Currently only FilterMedian has support for 32f and 64f, while FilterMedianHoriz, FilterMedianVert, and FilterMedianCross do not have support for 32f and 64f. Will you consider adding 32f and 64f for FilterMedianHoriz, FilterMedianVert, and FilterMedianCross? Thanks!

>>...I guess IPP median filter can provide an error code for this case instead of an unhandled exception...

I don't think it is a right decision for IPP. Take into account that IPP is a highly optimized library and any use of structured exception hadling ( SEH ) could affect performance because it creates an overhead.

In your case it is possible to use a try-catch block in the application in order to catch any exceptions.

发表评论

登录添加评论。还不是成员?立即加入