Morphological valley operation (user specifies the connectivity of the
structuring element - 4 or 8) [Default=8].
function call:
[out_img1]=vsg('Valley',in_img1,connected);
Arguments:
in_img1
mask image, 3 channel RGB, 1 channel greyscale or binary image, or DICOM
image.
connected
– an integer specifying whether 4 or 8 connected morphological
operations.
Description:
The valley detector is the dual of the white Top-hat by opening. The
valley detector is defined as BTH(A) = (A●K) – A; where is A is
the input image, K is the structuring element and (●) is the closing
operation. out_img1 – An image which has dimensions the same as
the input image. This is the difference between the original image and
the same image after being morphologically closed.
Example:
img = openimage('A.jpg');
h=figure;image(uint8(img));set(h,'Name','Input Image');
[img]=vsg('Threshold',img,100);
[out_img1]=vsg('Valley',img,8);
h=figure;image(uint8(out_img1));set(h,'Name','Valley');
Notes:
1. For DICOM images, the function operates on all slices separately.
2. For RGB images, the function operates on all colour planes
separately.
3. If any number other than 4 or 8 is provided to the function, it
defaults to 4.