필터 지우기
필터 지우기

How may I parametrise a polygon?

조회 수: 4 (최근 30일)
N/A
N/A 2015년 12월 29일
답변: Image Analyst 2015년 12월 31일
Hi all, I'm not asking for a code per se but I was just wondering if anyone here would be able to help with a problem I have.
Data: I have a set of co-ordinates, i.e. 10 sets of n (x,y) points, which form the outline of a closed polygon (not a curve).
What I want to do: Is there anyway I may write an equation / techniques such that by varying certain parameter(s), I may be able to obtain the outline of any shape.
In simple terms, if I have a 4-sided polygon, the parameters could be 1) the ratio of the two lengths of the diagonal and 2) the angle in between the diagonals. By varying these two parameters, I am able to obtain any 4-sided polygon, e.g. kites, squares, rectangles, etc.
Hence, for a more complicated problem such as the one I have described, is there anyway I can go about this?
Thank you for your time !

답변 (1개)

Image Analyst
Image Analyst 2015년 12월 31일
poly2mask can turn any set of coordinates into a binary image. bwboundaries() can get you the list of (x,y) coordinates along every pixel in the image. bwperim() can get you a binary image with the edge pixels set to white and black everywhere else. regionprops() can get you a whole bunch of metrics about a polygon in a binary image.

카테고리

Help CenterFile Exchange에서 Elementary Polygons에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by