Filter löschen
Filter löschen

How may I parametrise a polygon?

4 Ansichten (letzte 30 Tage)
N/A
N/A am 29 Dez. 2015
Beantwortet: Image Analyst am 31 Dez. 2015
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 !

Antworten (1)

Image Analyst
Image Analyst am 31 Dez. 2015
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.

Kategorien

Mehr zu Elementary Polygons finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by