Hamid
Hamid

Reputation: 73

Remove noises inside circles with morphological operations

In the following image which is edges of some coins detected by Canny, I want to remove the extra edges detected inside the coins.

Since widths of all the edges are the same, I think I can't use erosion. Is there a way to remove these lines just using morphological operations?

enter image description here

Upvotes: 1

Views: 473

Answers (1)

Kevin M
Kevin M

Reputation: 178

You can try remove_small_objects from the sklearn package. You would probably have to do some dilation/closing prior.

Another strategy is to do a dilation/closing followed by performing a regionprops to find each region's perimeter and radius. If the perimeter is similar to the radius * 2pi (perimeter of a circle), than you keep that region in your image.

You have options!

Upvotes: 2

Related Questions