How can I draw a circle in this image from the edges that I marked and calculate the angle from the circle like this ?

조회 수: 1 (최근 30일)
ankle.jpg
I want to know the code. i'm not good at coding sir.Thankyou.

채택된 답변

Image Analyst
Image Analyst 2020년 1월 26일
편집: Image Analyst 2020년 1월 26일
Assuming you have (x1, y1) on the left side and (x2, y2) on the right side, simply use plot
hold on;
xCenter1 = (x1+x2)/2;
yCenter1 = (y1+y2)/2;
plot(xCenter1, yCenter1, 'w.', 'MarkerSize', 30);
xCenter2 = (x3+x4)/2;
yCenter2 = (y3+y4)/2;
plot(xCenter2, yCenter2, 'w.', 'MarkerSize', 30);
To get the angle of the line, you can use atand2d(), something like
dx = xCenter2-xCenter1;
dy = yCenter2-yCenter1;
angle = atand2d(dy, dx);
  댓글 수: 2
wongsathorn pinwihok
wongsathorn pinwihok 2020년 1월 26일
편집: wongsathorn pinwihok 2020년 1월 26일
how can i define the 2 markers ? if i want to use this markers with every images like this .
Image Analyst
Image Analyst 2020년 1월 26일
편집: Image Analyst 2020년 1월 26일
What markers are you talking about? I assume you have the edge, which you can get from thresholding for the top and bottom left red X. The bottom right X shows up in the middle of skin. You should search Vision Bibliography for papers on feet or ankles. It is a list of all image processing articles.
Or you can use drawpoint() to have the user place them manually.

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by