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

ippiRotate edge effects

Sergey_Ushakov
Beginner
929 Views

Hi all,

I am experiencing edge effects when trying to use ippiRotate with small images. They (effects) are possibly present on bigger images as well but it is easier to see them on very small ones.

When rotating very small image (w = 8, h = 2) I get wrong result picture - and if I pad it with 4 extra lines at the top and 4 extra lines at the bottom so that input image size if 8 by 10 everything works perfectly well. I do not receive error message in both cases. Am I supposed to add that edge lines (I did not find such requirement in the manual) or is it erroneous behavior?

Thanks a lot,

Sergey

0 Kudos
8 Replies
Chuck_De_Sylva
Beginner
929 Views
Sergey, Were you able to reproduce this by using the IPP ippiDemo.exe? Did the same thing happen? Also, which version of the libary are you using? - Chuck
0 Kudos
Sergey_Ushakov
Beginner
929 Views
Chuck, Thank you for your reply - I have version 7.1 and yes, my result are similar to what I get using Demo - though there is some difference apparently due to different "default" color. Here is what I get when using ippiDemo.exe ippiRotate 5 degrees counterclockwise with shifts x = -0.17431148549531633, y= 0.0076106038165089096 - calculated for rotation center (0, 2). Cubic interpolation. I can interpret this as some edge effect. Sergey
0 Kudos
SergeyKostrov
Valued Contributor II
929 Views
Hi Sergey, >>When rotating very small image (w = 8, h = 2) I get wrong result picture - and if I pad it with 4 extra lines at the top and 4 extra lines >>at the bottom so that input image size if 8 by 10 everything works perfectly well. I do not receive error message in both cases. Could you attach a small test-case?
0 Kudos
Sergey_Ushakov
Beginner
929 Views
Hi Sergey :) The test data for ippDemo.exe are described above in the reply to Chuck. Input image is inp-p2.bmp (8bit unsigned), function being tested is ippiRotate with the described above parameters. The result I got is in pro-p2demo2.bmp. Will that work as case test? I can attach my own code - but the results more or less coincide with ippiDemo... Sergey
0 Kudos
SergeyKostrov
Valued Contributor II
929 Views
>>...The test data for ippDemo.exe are described above in the reply to Chuck... I looked at these bmp-files and I saw how the incorrect image looks like. Thanks for the real example. I will also verify how the ippDemo application rotates the source image ( for 5 degrees ). If you can please post the codes. Thanks in advance.
0 Kudos
SergeyKostrov
Valued Contributor II
929 Views
Hi Sergey, I easily reproduced your problem and I was able to see some strange edge effects when using ippiDemo application. Please take a look at my notes and questions. >>I am experiencing edge effects when trying to use ippiRotate with small images. They (effects) are possibly present on bigger images as well but >>it is easier to see them on very small ones. In case of very small images distortions are inevitable and you're right that they could also be seen in bigger images. My question is did you use ippiRotate_8u_C1R or ippiRotateCenter_8u_C1R function(s)? Did you use a 'Smooth Edge' option? >>When rotating very small image (w = 8, h = 2) I get wrong result picture - and if I pad it with 4 extra lines at the top and 4 extra lines >>at the bottom so that input image size if 8 by 10 everything works perfectly well. I do not receive error message in both cases. >>Am I supposed to add that edge lines (I did not find such requirement in the manual) or is it erroneous behavior? I'm not sure. I did a verification with another image processing program and it rotated your source image pretty well. Take a look at attached image and it demonstrates several counterclockwise rotations in 5-degree steps:
imagejrotatetesta.jpg
Another thing is your "discovery" looks like a very old problem with IPP rotate functions and a verification / investigation by IPP software developers is really needed.
0 Kudos
Sergey_Ushakov
Beginner
929 Views
Hi Sergey - thanks a lot, it all makes sense. I am using ippiRotate_8u_C1R as I like flexibility of adding some extra shifts when rotating. I will try rotateCenter - and if "artifacts" persist I will pad image with extra lines to get clean results... Sergey
0 Kudos
SergeyKostrov
Valued Contributor II
929 Views
>>...I am using ippiRotate_8u_C1R as I like flexibility of adding some extra shifts when rotating... It looks like a workaround and I think you need to live with it for some time. I would do the same and try to use a 'Smooth Edge' option as well. Best regards, Sergey
0 Kudos
Reply