MATLAB: I want to smooth the boarder of all white areas in this Binary Image (even the tiny ones). Consider it like smoothing with your hand.
image processingImage Processing Toolbox
Best Answer
In addition of the above links provided by @Walter morphological operations, imdilate and imclose, you may try with the following code also (@Image Analyst related answer, I cant find the link right now).
*Here image_binary is the input binary image, please note you have to manage the tradeoff between original shape changes vs. smoothness.
Assuming your foreground blobs are white/true/1, imerode and imopen will enlarge the black areas and eat away at the white areas. imdilate and imclose will enlarge/smooth the white areas and fill in black areas near borders/perimeters. imfill() fills in black islands in a white blob. Usually you use only one: imfill. However if you want your blobs to have a bit smoother outline, then you can use imclose() before imfill().
Best Answer