필터 지우기
필터 지우기

How to connect specified x,y coordinate points in image?

조회 수: 3 (최근 30일)
Alex Zai
Alex Zai 2021년 4월 27일
댓글: Alex Zai 2021년 5월 1일
Hello everyone,
I would like to connect the specified x,y coordinates points in image.
1). First, I did find x,y points of the center of the eyes and mouth. Then I marked that points in the image.
2) I would like to connect 2 points of eyes and one mouth of each face (like Triangle). And then I wanna find the center points of that triangle points. How can I do that, please?
I attached image files (marked points in image, x,y values of center of eyes and mouth).
Someone can suggest or help me, please?
I appreciate your answer.
Thanks alot.
  댓글 수: 1
Alex Zai
Alex Zai 2021년 4월 29일
Someone can suggest or help me, please?
I appreciate your answer.

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

채택된 답변

Matt J
Matt J 2021년 4월 29일
편집: Matt J 2021년 4월 29일
To connect the points you can use the drawpolygon() command, feeding it the known vertices of the 3 points:
drawpolygon('Position',[v1;v2;v3])
To find the triangle centers, just average the vertex coordinates together.
  댓글 수: 1
Alex Zai
Alex Zai 2021년 5월 1일
Thanks for your answer. I appreciate that.
It actually worked.

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

추가 답변 (1개)

Image Analyst
Image Analyst 2021년 4월 29일
You can use plot():
hold on
plot([x1,x2,x3, x1], [y1,y2,y3, y1], 'y-', 'LineWidth', 3);
Make sure you tack on the first point to the end, like I did, to close the triangle, otherwise you'll just get a V.
  댓글 수: 1
Alex Zai
Alex Zai 2021년 5월 1일
Thanks for your answer and suggestion.
I appreciate that.

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

Community Treasure Hunt

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

Start Hunting!

Translated by