PANDORE Version 6 GREYC-IMAGE

prescale



Performs an affine rescaling of image, region map or graph using the nearest neighbor interpolation.



Synopsis

prescale zoomx zoomy zoomyz [im_in|-] [im_out|-]

Description

prescale changes magnification of the input image by a factor zoomx along the x axis, zoomy along the y axis and zoomz along the z axis (for 3D images). The image is enlarged along an axis if the zoom factor is > 1 and is shrunk if the zoom factor is >0 and <1.

This version uses the nearest neighbor interpolation. Thus, the image shrinking consists in a subsampling of the pixels and the image enlargement consists in a replication of the pixels (This has the effect of simply making each pixel bigger):

   im_out[z][y][x]=im_in[z/zoomz][y/zoomy][x/zoomx];

The nearest neighbor interpolation is the most basic and requires the least processing time of all the interpolation algorithms. However, this results in blocky artifacts within the image.

Better results can be obtained with other rescaling operators such as plinearrescale or pbicubicrescale.

Parameters

Inputs

Outputs

Result

Returns SUCCESS or FAILURE.

Examples

See also

Transformation, plinearrescale, pbicubicrescale

C++ prototype

Errc Prescale( const Img2duc &im_in, Img2duc &im_out, const float zoomy, const float zoomx );

Version française

Augmentation ou réduction de la taille d'une image par interpolation selon le plus proche voisin.


Author: Régis Clouard