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

Resizing an image without smoothing

alexmelo
Beginner
585 Views
Hello, I'm trying to reize an image, similar to the function of ippiResizeSqrPixel but without any smoothing. I want to basically scale each pixel by a specified amount. Is there a function in IPP for this? Thanks.
0 Kudos
7 Replies
Chao_Y_Intel
Moderator
585 Views

Hello,

Can you check new the IPP 7.1 interfaces on the resize function, and see how it works for you?

http://software.intel.com/en-us/articles/intel-ipp-71-resize-changes/

For scale the image pixel, I think you may call a separated function after the resize.

Thanks,
Chao

0 Kudos
SergeyKostrov
Valued Contributor II
585 Views
Hi Alex,

Quoting alexmelo
Hello, I'm trying to reize an image, similar to the function of ippiResizeSqrPixel but without any smoothing. I want to basically scale each pixel by a specified amount. Is there a function in IPP for this? Thanks.


Did you try to use a Linear Interpolation ( IPPI_INTER_LINEAR )?

0 Kudos
alexmelo
Beginner
585 Views
Yes, linear still gives me interpolated pixels. Does anyone know if IppiScale is appropriate here? the docs make me think its for converting between bit depths rather than pixel scaling. Any other ideas? Or should I just do it manually? Thanks.
0 Kudos
alexmelo
Beginner
585 Views
Thanks Chao but the new version doesn't mention scaling without interpolation. I think it must either be a different function than resize or not supported.
0 Kudos
Jeffrey_M_Intel1
Employee
585 Views

You are right about ippiScale -- it is for converting individual pixel values to different bit depths. For example, ippiScale_8u32f_C1R with vmin of 0.0 and vmax of 1.0wouldconvert the 0-255(integer) data from the single channel image to floating point values between 0 and 1.

There are many choices for interpolation mode since there are tradeoffs between quality and speed. Since you specifically don't want interpolation, I wonder if nearest neighbor interpolation mode might be closer to what you want. (IPPI_INTER_NN for ippiResizeSqrPixel.) The idea behind this algorithm sounds very close to your description, and at least in my tests I'm not seeing interpolated values using this mode.

Best regards,

Jeff

0 Kudos
alexmelo
Beginner
585 Views
Yes - Nearest neighbor is what I wanted, I can't beleive I didn't see it. Thanks for you help.
0 Kudos
SergeyKostrov
Valued Contributor II
585 Views
Quoting alexmelo
Yes - Nearest neighbor is what I wanted, I can't beleive I didn't see it. Thanks for you help.


This is a Feature Request and please consider two additional modes:

IPPI_NOINTER_UPSAMPLE ( scale factors: 2x, 4x, etc )
IPPI_NOINTER_DOWNSAMPLE ( scale factors: 0.5x, 0.25x, etc )

Best regards,
Sergey

0 Kudos
Reply