Calculate from a circle in an image in MATLAB

1 view (last 30 days)
Hi,
I have to measure the diameter from a circle in a image and I don't quite know where to start.
I began by loading the image and turning it into a blacknwhite image.
img = imread (file);
labimg = rgb2lab(img);
Now I basically need my program to detect the circle and measure the diameter. and then plot it
I really hope someone could help me out
Thanks a lot
  2 Comments
DGM
DGM on 3 Apr 2021
Circle measuring aside, you didn't convert your image into black&white. You converted it to L*a*b*. It's still a color image. If you want a grayscale image, you can just use rgb2gray(img) to get the luma. If you want to reduce it to a black & white (binary) image, then you'll need to determine how to best preprocess the image and perform thresholding.
Rik
Rik on 11 Apr 2021
I recovered the removed content from the Google cache (something which anyone can do). Editing away your question is very rude. Someone spent time reading your question, understanding your issue, figuring out the solution, and writing an answer. Now you repay that kindness by ensuring that the next person with a similar question can't benefit from this answer.

Sign in to comment.

Answers (1)

Matt J
Matt J on 3 Apr 2021
You can use drawcircle() to do it interactively,
h =
Circle with properties:
Center: [166.8343 125.4267]
Radius: 66.4091
Label: ''
Color: [0 0.4470 0.7410]
Parent: [1×1 Axes]
Visible: on
Selected: 0

Categories

Find more on Convert Image Type in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!