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

4 ビュー (過去 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