# Supersampling interpolation in IPP

## Supersampling interpolation in IPP

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

6 posts / 0 nouveau(x)
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

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,

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

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,

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

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

SSrc/SDst = 1/xFactor*yFactor.

Here xFactor, and NT size=2>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,