3x3Thresh

Adaptive threshold in a 3x3 region.

 

function call:

[out_img1]=vsg('3x3Thresh',in_img1,offset);

 

Arguments:

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

offset – an integer or double specifying the threshold offset  for the 3x3 threshold function.

 

Description:

Threshold = mean of 3×3 region – offset (α), where alpha is a user defined offset value .

out_img1 – An image which has dimensions the same as the input image. The output values are black if the input values are smaller than the 3×3 mean minus the offset, otherwise they are white.

 

Example:

img = openimage('crown.jpg');

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

[out_img1]=vsg('3x3Thresh',img, 0);

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

 

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