Hi every one,
I am writing project in IPP 7.0. I need to resize and shift image. I found two functions that can respond my requirement, they are:
- ippiResizeCenter function
- ippiResizeSqrPixel function
After trying to use these functions, the output result between these two functions are different.
I wonder, which function can give the better quality for resizing image ? Which function should I use to resize and shift image ?
And I also would like to know the reason for selecting
Hope you can help me answer these questions.
I suggest you measure the performance and the output quality of both functions:
Calculate the time taken by each function.
Compare the PSNR of both products.
The main difference between ResizeCenter and ResizeSqrPixel scaling approaches is that the first one uses the "point" pixel model, while the second one uses the "square" pixel model. So ResizeCenter considers a pixel as a point without size, assuming that image pixels are equidistant from each other. While ResizeSqrPixel considers an image as a set of "square" pixels, where pixels are placed closely.
Thus ResizeCenter resizes a number of "distances" between image pixels, while ResizeSqrPixel resizes a number of "square" pixels. For example, if we 2x increase 4x4 image, in the first case for image width = 4 we have 3 distances and applying scale=2 we will have 6 distances and 7 pixels output while for the second approach we will have 8 pixels. Most likely this is the reason of differences between output images of the functions ResizeSqrPixel and ResizeCenter.