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

Supersampling interpolation in IPP

Weiss__Daniel
Beginner
1,275 Views
Hi all,
I am using the IPP (3.0) rotate and resize functions and have wondered about the specific implementation of the IPP_INTER_SUPER supersampling mode. What pixel neighbourhoods are used for computing the output pixel, and is for an e.g. resize operation the interpolation dependent on the resize factors?
Take downsizing an image as an example: if the original image was sampled according to the Nyquist condition, correctly downsizing it would really require a spatial lowpass filter (to avoid aliasing) prior to interpolation. This could be implemented by evaluating a pixel neighbourhood and using pixel weights based on the distance from the sample location to each contributing pixel. For larger neighbourhoods this would probably be a costly operation, but it would permit to implement an arbitrary spatial frequency transfer function of the lowpass.
But perhaps "supersampling interpolation" means something quite different after all...
Thanks for all replies,
Daniel
0 Kudos
5 Replies
Intel_C_Intel
Employee
1,275 Views
Daniel,

Supersampling interpolation mode for resize functions (only for factors < 1) is implemented as:
the intensity of destination pixel is equal to sum of intensity of all source pixels given contribution in this destination pixel multiplied on their weights.

Regards,
Vladimir

0 Kudos
Weiss__Daniel
Beginner
1,275 Views

Hi Vladimir,

thanks for your reply. Can you be more specific as to how the weights are calculated? As a function of distance to the sample location? If so, what function? Where do the weights reach zero, i.e., what region size is used?

Thanks for your help,

Daniel

0 Kudos
Intel_C_Intel
Employee
1,275 Views
Hi Daniel,
I would like to recommend you to take a look to the IPP documentation, in particular, I recommend youread ippiman.pdf file,Annex B, Interpolation in Image Geometric Transform Functions.
Regards,
Vladimir
0 Kudos
Weiss__Daniel
Beginner
1,275 Views

Hi Vladimir,

thanks for your response. Is it possible that this annex has only been added to the documentation in IPP version 4 and later? I don't find it in the ippiman.pdf that shipped with our version 3.0 IPP (length 1003 pages), nor do I find any references to this explanatory annex in the appropriate function descriptions (e.g. function Resize, page 12-5 or 533 by Acrobat counting). Is the new documentation available somewhere at the Intel site?

Thanks,

Daniel

0 Kudos
Intel_C_Intel
Employee
1,275 Views

Daniel,

Yes, It's my mistake, I thought you use IPPv4.0. You are right, this annex was added in documentation for IPP v4.0. There is part of it you are interested, and picture is in attachment.

Super Sampling

If the destination image is much smaller than the source image, the above interpolation algorithms may skip some pixels in the source image (that is, these algorithms not necessarily use all source pixels when computing the destination pixels' intensity). In order to use all pixel values of the source image, the

ippiResize and ippiResizeCenter functions support the super-sampling algorithm, which is free of the above drawback.

The super-sampling algorithm is as follows:
1. Divide the source image's rectangular ROI (or the whole image, if there is no ROI) into equal rectangles, each rectangle corresponding to some pixel in the destination image. Note that each source pixel is represented by a 1x1 square.

2. Compute a weighted sum of source pixel values for all pixels that are contained in the rectangle or have a non-zero intersection with the rectangle. If a source pixel is fully contained in the rectangle, that pixel's value is taken with weight 1. If the rectangle and the source pixel's square have an intersection of area a < 1, that pixel's value is taken with weight a. For each source pixel intersecting with the rectangle, Figure B-3 shows the corresponding weight value.

3. To compute the pixel value in the destination image, divide this weighted sum by the ratio of the source and destination rectangle areas

S

Src
/SDst = 1/xFactor*yFactor.

Here

xFactor, and yFactor are the parameters of the functions that specify the factors by which the x and y dimensions of the source image ROI are changed. Note that supersampling interpolation can be used only for xFactor<1, and yFactor<1.

Regards,
Vladimir

0 Kudos
Reply