Community
cancel
Showing results for 
Search instead for 
Did you mean: 
SHawk
Beginner
77 Views

ippiWarpPerspective returning ippStsRectErr

I have an application which uses ippiWarpPerspective to apply a perspective warp to an image. The parameters of the perspective warp depend on the input parameters to the application. In certain situations, the dstRoi I want is actually a single row of pixels. Unfortunately ippiWarpPerspective returns ippStsRectErr in this case (as stated in the documentation).

More often than not, when this happens it turns out that I actually don't need a full perspective warp but only a copy or a translation and/or rotation. I can detect these circumstances and use alternative functions (which also gives me a speed improvement). However, in some cases I also need the non-uniform sample spacing of an actual perspective transform.

Does anyone have any neat suggestions for how to solve my problem?

 

0 Kudos
2 Replies
Chao_Y_Intel
Employee
77 Views

Hi, 

thanks for your report.  For your problem, Does it happen only when the dstRoi is a single row?   

Regards,
Chao

SHawk
Beginner
77 Views

I haven't tried it and it wouldn't ever really occur in my application but the documentation suggests it would probably also happen if dstRoi was a single column. So yes, in my application I've only seen it occur when dstRoi is a single row.

Curiously, despite what the documentation says, even when dstRoi is a single row I don't necessarily get this error. It seems to depend on the coefficients. In particular, if c20 and c21 are both zero then I get this error but if c21 is non-zero then I get no error.

In my case c20 is always zero anyway so the best solution I've come up with so far is to test c21 and if it is non-zero I use ippiWarpPerspective (even if dstRoi is a single row) and if it is zero then I use ippiWarpAffine instead. My concern is that this is relying on behaviour which appears to be contrary to the documentation and that there could be cases where it won't work (or it may stop working in a future version of IPP).

Reply