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

IppiResizeCenter possible bug

gol
Beginner
277 Views

IPP 5.2, using IppiResizeCenter_8u_C4R.The picture here shows the result of a slight stretching using Lanczos (left) and linear (right).

http://www.flstudio.com/gol/StretchTest.png

Looks like the Lanczos version exposes garbage for some near-white points, (no problem with white, more around 250/255 RGB values (same garbage for just one of the RGB components).
I know the text uses cleartype and I shouldn't expect the sub-pixel color trick to scale well, however this is toougly to be normal (I'd expect it to be more or less like the linear version).

I have checked that no premultiplied RGB was higher than the alpha. I also checked cubic interpolation, result is ok just like linear.

Sorry if I can't post the source bitmap, it's done by code and I have no code to save it in a format with alpha (yet).
Haven't checked yet if this was fixed in 5.3 or higher. Edit: still happens in version 6.0.

0 Kudos
5 Replies
Vladimir_Dudnik
Employee
277 Views
Hi thanks for reporting that, we will do investigation. If you have source bitmamp by this time it can help us.
Regards,
Vladimir

0 Kudos
gol
Beginner
277 Views
Not to dig an old thread, but I just replaced the obsolete IppiResizeCenter_8u_C4R
by the newer IppiResizeSqrPixel_8u_C4R in that piece of code I was talking about there above (btw sry but my image link is dead now).

I thought that I'd try other resampling methods, and funny, I got some bad pixels using Lanczos again (some holes in a bitmap).This is using IppiResizeSqrPixel in IPP 6.1.

I'll try to get more info later, although it's no big deal, I'm as happy with cubic resampling.
But it's weird, as I thought that those 2 functions were unrelated. Could be on my side, but then I don't know why it'd work with other resampling methods.
0 Kudos
Chao_Y_Intel
Moderator
277 Views
Quoting - gol
I thought that I'd try other resampling methods, and funny, I got some bad pixels using Lanczos again (some holes in a bitmap).This is using IppiResizeSqrPixel in IPP 6.1.


Can you try the latested IPP 6.1 update 1 release. We have knew an error for IppiResizeSqrPixel in IPP 6.1 gold. The workaround for IPP 6.1 gold release is

if (size.NxIn < 6 || size.NyIn < 6) {
if (theType == IPPI_INTER_LANCZOS)
theType = IPPI_INTER_CUBIC;
if (size.NxIn < 4 || size.NyIn < 4) {
if ((theType == IPPI_INTER_CUBIC) ||
(theType == IPPI_INTER_CUBIC2P_BSPLINE) ||
(theType == IPPI_INTER_CUBIC2P_CATMULLROM) ||
(theType == IPPI_INTER_CUBIC2P_B05C03))
theType = IPPI_INTER_LINEAR;
}
}


Thanks,
Chao
0 Kudos
gol
Beginner
277 Views

Ok so it's only if width or height is less than 6? I'm afraid my bitmap was bigger than that.

If you ask me, it looked pretty much like an overflow. The source bitmap had premultiplied alpha. You know the common saturated pixels effect when you try to blend a bitmap where the RGB's are higher than the alpha? It looked like that, like if the interpolated pixels were exceeding the alpha. I'll see if I can do it again & save a bitmap.

0 Kudos
Chao_Y_Intel
Moderator
277 Views
Quoting - gol

Ok so it's only if width or height is less than 6? I'm afraid my bitmap was bigger than that.

If you ask me, it looked pretty much like an overflow. The source bitmap had premultiplied alpha. You know the common saturated pixels effect when you try to blend a bitmap where the RGB's are higher than the alpha? It looked like that, like if the interpolated pixels were exceeding the alpha. I'll see if I can do it again & save a bitmap.



Yes, That problem happened when the image size is less that 6. Since it is not the problem, any code to help to reproduce the problem will be very helpuful?

Thanks,
Chao
0 Kudos
Reply