How to Identify Circle in a Image using MATLAB

Spread the love


Read the input Image

I = imread('circlesBrightDark.png');
          Rmin = 30;
          Rmax = 65;

Find all the bright circles

          % Find all the bright circles in the image
          [centersBright, radiiBright] = imfindcircles(I,[Rmin Rmax], ...

Find the dark circles

          % Find all the dark circles in the image
          [centersDark, radiiDark] = imfindcircles(I, [Rmin Rmax], ...

Plotting the bright circles

          % Plot bright circles in blue
          viscircles(centersBright, radiiBright,'EdgeColor','b');

Plotting the dark circles

          % Plot dark circles in dashed red boundaries
          viscircles(centersDark, radiiDark,'LineStyle','--');

Leave a Reply

Your email address will not be published. Required fields are marked *

six + nine =