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?
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?
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