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

How to substitute IPL API iplCreateROI using IPP?

viksy
Beginner
497 Views
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 Kudos
1 Solution
Vladimir_Dudnik
Employee
497 Views

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

View solution in original post

0 Kudos
3 Replies
Vladimir_Dudnik
Employee
498 Views

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 Kudos
viksy
Beginner
497 Views
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 Kudos
Chao_Y_Intel
Moderator
497 Views

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 Kudos
Reply