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

Ipp resize functions not giving desirable results.

elevenmice
Beginner
723 Views
Hi guys,

I've tried IppiResize IppiResizeCenter IppiResizeSqrPixel to resize an image that is 400x300 to 320x240 but none of the functions do a good job.

I have saved some sample images from LINEAR, NN and CUBIC to upload on this forum but apparently I can only upload one image per post. So I'm giving u the input image. Please use a photo editor to view the image. It has thin white lines and a lot of transparent regions that will not be seen if you view it on ur browser. If you try to resize the image I'm giving you using IPP, the results are horrible.

Below is the code I used when trying out ippiResizeSqrPixel


IppStatus status;
IppiSize inSize = { bmWidth, bmHeight };
IppiRect inRect = { 0, 0, bmWidth, bmHeight };
IppiSize outSize = { width, height };
IppiRect outRect = { 0, 0, width, height };

double xFactor = width / (double)bmWidth;
double yFactor = height / (double)bmHeight;
double xShift = 0.0;
double yShift = 0.0;
int nChannel = 4;
int BufferSize;
Ipp8u* pBuffer;

BYTE* scan0 = new BYTE[ width * height * 4 ];

memset( scan0, 0, width * height * 4 );

status = ippiResizeSqrPixelGetBufSize( outSize, nChannel, IPPI_INTER_NN, &BufferSize );

pBuffer = (Ipp8u*)ippMalloc(BufferSize);

BitmapData* bmData = new BitmapData;

Rect rect( 0, 0, bmWidth, bmHeight );

m_bitmapVec[bitmapID].get()->LockBits( &rect,ImageLockModeRead, PixelFormat32bppARGB, bmData);

status = ippiResizeSqrPixel_8u_C4R( (Ipp8u*)bmData->Scan0, //contains the input buffer
inSize,
&nbs p; bmWidth * 4,
inRect,
scan0, //contains the output buffer.
width * 4,
outRect,
xFactor,
yFactor,
xShift,
yShift,
IPPI_INTER_NN,
pBuffer
);

If you try to use this code on the sample image I gave u, most of the lines are gone!

If u want me to email you my results, just let me know and give me an email address .

Btw since Ipp does not solve my issue, I'm currently using GDI+. Although it's slow, the results are fantastic. And I get good results not matter what interpolation mode I use in GDI+. weird hun.

-chetan
0 Kudos
3 Replies
Ying_S_Intel
Employee
723 Views

Dear Customer,
What version of Intel IPP did you use? Our latest version of Intel IPP 5.2 have fixed several issues in ippiResize* functions, I am not sure if it is related to the issue you reported here. I will forward this issue to our Premier Suppport channel for further investigation.

If you happen to have account with Intel Premier, please submit this issue report.
Thanks,
Ying

0 Kudos
elevenmice
Beginner
723 Views
Hello Ying,

My ipp version is:

Intel Integrated Performance Primitives
version: v5.1, [5.1.217.80]
name: ippit7l.lib
date: Mar 1 2006


I dont have an Intel Premier account so thx for forwarding it to them.

As for ungrading to IPP5.2, this can be quite tricky. The reason being that I am not the only person using IPP in my company and it would require me to consult other people before doing such a change. So if I need to upgrade, I'd be nice to know that my problem will be solved for sure.

Please let me know as soon as u get an answer from the Intel Premier guys. tnx.

-chetan
0 Kudos
elevenmice
Beginner
723 Views
Hi Nikolay,

I have tried IPPI_INTER_SUPER with IppiResize . To be fair, all the lines do appear. But they are of uneven greyish colors and faint (instead of white). Nothing like the results I get with GDI+, be it with high or low quality.
0 Kudos
Reply