Stretcher

Stretch the LUT between the lower and upper threshold to occupy the entire range between BLACK (0) and WHITE (255).

 

function call:

[out_img1]=vsg('Stretcher',in_img1,num1,num2);

 

Arguments:

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

num1 – an integer specifying the low greyscale value, below which input pixels will be set to black.

num2 – an integer specifying the high greyscale value, above which input pixels will be set to white.

 

Description:

out_img1 – An image which has dimensions the same as the input image. The output image is the input image which has had its greyscale histogram from num1 to num2 stretched to fill the full range.

 

Example:

img = openimage('crown.jpg');

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

[out_img1]=vsg('Stretcher',img,50,100);

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

 

Notes:

1. For DICOM images, the function operates on all slices separately.

2. For RGB images, the function operates on all colour planes separately.

Home       Functions    Back