Extracting circles in an image.

4 views (last 30 days)
Portgas Ace
Portgas Ace on 30 Aug 2014
Answered: Image Analyst on 30 Aug 2014
I've found several codes regarding on how to find circles in an image. We also have edited it in a way that we can extract the circle out of an image but only on a grayscaled image. But we need to extract the circle in an RGB image so is there a way to do that? Or any codes in the internet where we can start?

Answers (1)

Image Analyst
Image Analyst on 30 Aug 2014
Convert the image to hsv with rgb2hsv. Then use imfindcircles on the h channel:
hsv = rgb2hsv(rgbImage);
h = hsv(:,:,1);
[centers, radii, metric] = imfindcircles(h);
viscircles(................

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!