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

IPP warp perspective border issue

JunChen
Employee
340 Views

Hello IPP team,

I'm testing ipp warpPerspective functions, we found that it doesn't handle border as expected. For example, when set borderType = ippBorderConst with border value 0.0, there’re some unexpected pixels in transformed picture, highlighted in below picture.

JunChen_0-1643093851034.png

 

Pseudo code:

Mat src=imread(source_image);

Mat dst(row, col, CV_8UC3); // source image is 8uc3, row*col

 

IppiBorderType borderType = ippBorderConst;

Ipp64f pBorderValue[3] = {0.};

for (i = 0; i < numChannels; ++i) pBorderValue[i] = 0.0;

...

ippiWarpPerspectiveGetSize();

pSpec = (IppiWarpSpec*)ippsMalloc_8u(specSize);

ippiWarpPerspectiveLinearInit(srcSize, srcRoi, dstSize, ipp8u, coeffs, direction, numChannels, borderType, pBorderValue, smoothEdge, pSpec);

ippiWarpGetBufferSize();

pBuffer = ippsMalloc_8u(bufSize);

ippiWarpPerspectiveLinear_8u_C3R(src->data, srcStep, dst->data, dstStep, dstOffset, dstSize, pSpec, pBuffer);

 

Environment:

IPP Version: 2021.4.0

Opencv version: 4.5.5

 

Could you please help to take a look? Thanks in advance!

 

0 Kudos
1 Solution
JunChen
Employee
310 Views

Hi Vidya,

Thanks for asking. 

With help from China team, we found that this is caused by srcRoi paramter. I was passed a specified ROI instead of ippRectInfinite to call warpPerspective related functions.

After I changed it, it worked.

 

Thanks a lot!

Regards,

Jun.

View solution in original post

3 Replies
VidyalathaB_Intel
Moderator
319 Views

Hi,


Thanks for reaching out to us.


>>IPP Version: 2021.4.0

Could you please try the latest IPP version (2021.5.0) and see if it works as expected?

If the issue still persists, please provide us with the following details


> Complete sample reproducer

> Steps to reproduce the issue (if any)

> OS details


so that we can work on it from our end.


Regards,

Vidya.




JunChen
Employee
311 Views

Hi Vidya,

Thanks for asking. 

With help from China team, we found that this is caused by srcRoi paramter. I was passed a specified ROI instead of ippRectInfinite to call warpPerspective related functions.

After I changed it, it worked.

 

Thanks a lot!

Regards,

Jun.

VidyalathaB_Intel
Moderator
301 Views

Hello Jun,


>>After I changed it, it worked.


Glad to know that your issue is resolved and thanks for letting us know about it.

As your issue is resolved, we are going ahead and closing this thread. Please post a new question if you need any additional assistance from Intel as this thread will no longer be monitored.


Have a Great Day!


Regards,

Vidya.



Reply