ScaleImg

An image is scaled by user defined dimensions.

 

function call:

[out_img1]=vsg('ScaleImg',in_img1,dimx,dimy);

 

 Arguments:

in_img1 input image, 3 channel RGB, 1 channel greyscale or binary image, or DICOM image.

dimx – the new width of the image specified as an integer.

dimy – the new height of the image specified as an integer.

 

Description:

[out_img1]=vsg('ScaleImg',in_img1,dimx,dimy) - out_img1 is an image which is a scaled version of the input image, the dimensions of which have changed as follows. The output image width is the same as the specified dimx and the output image height is the same as the specified dimy.

 

Example:

img1 = openimage('lake.jpg');

h=figure;image(uint8(img1));set(h,'Name','Input image');

[out_img1]=vsg('ScaleImg',img1,200,150);

h=figure; image(uint8(out_img1));set(h,'Name', 'Scaled image');

 

Notes:

The output image is a scaled version of the input, the scaling is performed using a bi-linear interpolation.
Home       Functions       Back