Adaptive threshold in a 5x5 region.
function call:
[out_img1]=vsg('5x5Thresh',in_img1,offset);
Arguments:
in_img1
input image, 3 channel
offset
– an integer or double specifying the threshold offset
for the 5x5 threshold function.
Description:
Threshold = mean of
5×5 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 5×5 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('5x5Thresh',img,
0);
h=figure;image(uint8(out_img1));set(h,'Name','5x5Threshold');
Notes:
1. For DICOM images,
the function operates on all slices separately.
2. For