Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

How to substitute IPL API iplCreateROI using IPP?

viksy
初学者
931 次查看
Dear All,

I am migrating the legacy code to VS2008 and removing all the dependencies on IPL library. I did not find any direct IPP APIs as a replacement for iplCreateROI and iplDeleteROI.

I have gone through the ipl-ipp migration document and sample code but no details are available regarding this. If anyone can provide the steps to create ROI using IPP;will appreciate any help or suggestion.

Thanks,
Vikash
0 项奖励
1 解答
Vladimir_Dudnik
931 次查看

Hi Vikash,

The IplROI structure in IPL library used toaddresssubimage region in bigger image.There is no magick in that, just a way to specify particular offsets in bigger image and sise of your region of interest. In IPP there is nospecial data type to represent ROI. Instead you have access to pointer of your original data, you know number of bytes in your image row and you can access to submimage by shifting pointer to desired numer of rows and columns andspecy size of subimage with IppiSize structure.I would recommend you to check IPP documentation, volume 2 (image processing, especially charter "IPP Concept, Region of Interest in Intel IPP"

Regards,
Vladimir

在原帖中查看解决方案

0 项奖励
3 回复数
Vladimir_Dudnik
932 次查看

Hi Vikash,

The IplROI structure in IPL library used toaddresssubimage region in bigger image.There is no magick in that, just a way to specify particular offsets in bigger image and sise of your region of interest. In IPP there is nospecial data type to represent ROI. Instead you have access to pointer of your original data, you know number of bytes in your image row and you can access to submimage by shifting pointer to desired numer of rows and columns andspecy size of subimage with IppiSize structure.I would recommend you to check IPP documentation, volume 2 (image processing, especially charter "IPP Concept, Region of Interest in Intel IPP"

Regards,
Vladimir

0 项奖励
viksy
初学者
931 次查看
Hello Vladimir,

Thanks foryour support and descriptive reply, I could solve the problem.I have got one more query and need your help. I want to replace IPL API iplSubtractS() with IPP API ippiSubC.

iplSubtractS() will subtract a constant value from pixel values, or pixel values from a constant based on the value of boolean flip parameter passed to the function. But the ippiSubC() subtracts a constant from image pixel values, the reverse subtraction is not supported (i.e. subtract pixel value from a constant).

I want to know how to achieve the reverse subtraction using IPP APIs. Any suggestion is welcome.

Thanks,
Vikash
0 项奖励
Chao_Y_Intel
主持人
931 次查看

Hello,


you can check the IPP-IPL sample on how to map the IPL to IPP: \ipp-samples\image-processing\ipl-ipp:

For example for 8u image, it can use the following code:

ippiConvert_8u16s_C1R(pSrc, src->widthStep, (Ipp16s*)pTmp16, step, roi);
ippiMulC_16s_C1IRSfs(-1, (Ipp16s*)pTmp16, step, roi,0);
ippiAddC_16s_C1IRSfs(val, (Ipp16s*)pTmp16, step, roi, 0);
ippiConvert_16s8u_C1R((Ipp16s*)pTmp16, step, pTmp, dst->widthStep, roi);
ippiCopy_8u_C1MR((Ipp8u*)pTmp, dst->widthStep,(Ipp8u*)pDst, dst->widthStep, roi, pMask, roi.width);

Thanks,
Chao

0 项奖励
回复