This function performs image segmentation according to this procedure
1.Binarization of the image using Otsu method
2. Image dilation.
3. Hole filling.
4. Image erosion.
5. Selection of the biggest region.
6. Contour extraction
It receives the image and kernel size for dilation and erosion.
Returns the segmentation mask as well as the segmented image
Carlos Sanchez (2019). segmentation (https://www.mathworks.com/matlabcentral/fileexchange/70066-segmentation), MATLAB Central File Exchange. Retrieved .
Create scripts with code, output, and formatted text in a single executable document.