Calculate from a circle in an image in MATLAB

조회 수: 1 (최근 30일)
songül bagbars
songül bagbars 2021년 4월 3일
편집: songül bagbars 2022년 4월 17일
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
DGM
DGM 2021년 4월 3일
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 2021년 4월 11일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt J
Matt J 2021년 4월 3일
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

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by