Remove image background in Matlab
Date: 2022-12-05 10:51:49
In this example of edge detection:
http://www.mathworks.com/help/images/edge-detection.html#buh9ylp-13
How would I remove the gray background in the grayscale image at the beginning?
Answer:
Removing the background befor you apply an edge detector makes no sense as the more or less homogeneous low frequency background will result in a zero gradient anyway. It won't improve the results of your edgedetection.
If you only want to cut out the coins to put them on a different background simply apply a global threshold
Remove thos tiny speckles with some morphological operators and blur the mask so you won't have fringed coin edges
Apply some logical operations to mask the original image