フィルターのクリア

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 Center および File ExchangeElementary Polygons についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by