How can I draw a circle in this image from the edges that I marked and calculate the angle from the circle like this ?
2 次查看(过去 30 天)
显示 更早的评论
I want to know the code. i'm not good at coding sir.Thankyou.
0 个评论
采纳的回答
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 个评论
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!