How do i extract points from roi using roipoly?

So i have set of random x and y cordinate , i draw roi by roipoly. How can i just get the x and y coordinates of the points that are inside of roi( as shown in attached)? or any other way i could do ?

 採用された回答

Cris LaPierre
Cris LaPierre 2020 年 10 月 30 日

0 投票

Assign the output of roipoly to a variable. See the syntax section of the documentation page. You probably want the following syntax:
[BW,xi2,yi2] = roipoly(___)

2 件のコメント

Prakash Raut
Prakash Raut 2020 年 10 月 30 日
Thanks Cris for your reply but i want to extract coordinates of points that are inside the roi (see attached), not the coordinates of the polygon(roi). Any suggestion would be really helpful.
Cris LaPierre
Cris LaPierre 2020 年 10 月 30 日
Ah, thank you for clarifying. In that case, try using inpolygon. You will need the xi2 and yi2 outputs above as inputs to inpolygon.

サインインしてコメントする。

その他の回答 (0 件)

質問済み:

2020 年 10 月 29 日

編集済み:

2020 年 10 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by