how can remove circle from an image?
Show older comments
hi I have this image

how can I remove the circles that are not fill?? when I use imfiil the images merge but I want to obtain this image as result:

Accepted Answer
More Answers (1)
If thickness of circle boundary is exactly 1 pixel, then its easy.
Loop over each point. For any point, (i,j) there are four pairs of surrounding points:
left (i, j-1) right (i, j+1)
top (i-1, j) bottom (i+1, j)
top-left (i-1, j-1) bottom-right (i+1, j+1)
top-right (i-1, j+1) bottom-left (i+1, j-1)
If there is at least one pair with both points black AND at least one pair with both points white, then make the point black.
Maybe you can extend the idea to circles whose boundary has > 1 thickness.
Categories
Find more on Convert Image Type in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!