Erosion operation (user specifies the connectivity of the structuring
element - 4 or 8).
function call:
[out_img1]=vsg('Erosion',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 erosion should be
carried out.
Description:
Erosion is equivalent to the shrinking of the image set A (in_img1)
by a structuring element B. This is a morphological
transformation which combines two sets using vector subtraction of set
elements. out_img1 – An image which has dimensions the same as
the input image. This is an image which has been eroded.
Example:
img = openimage('crown.jpg');
[out_img1]=vsg('Threshold',img,100);
[out_img2]=vsg('Erosion',out_img1,4);
[out_img3]=vsg('Erosion',img,4);
h=figure;image(uint8(out_img2));set(h,'Name','Erosion -
binary image');
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.