PANDORE Version 6 | GREYC-IMAGE |
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.
if a zoom factor is > 1 then the image is enlarged along
the related axis.
if a zoom factor is < 1 then the image is shrunk along
the related axis.
zoomz is ignored for 2D images but must be given.
Returns SUCCESS or FAILURE.
prescale 2 2 0 tangram.pan a.pan
prescale 0.5 0.5 0 tangram.pan a.pan
Augmentation ou réduction de la taille d'une image par interpolation selon le plus proche voisin.
Author: Régis Clouard