0

How do I transform a binary image with one single mask in it (whose values are one) into a polygon in PYTHON? My goal is to calculate the inner-angles of this mask and the orientation of the countor-lines. I assume I have to transform the mask into a polygon before I can use other libraries that do these calculations for me. I rather not use Open Cv to tdo this transformation since I have faced problems installing it in a Windows 64/Spyder envronment. Thanks for any help!

1 Answers1

1

While you can surely write your own code, I suggest to have a look at libraries like AutoTrace or potrace. They should already do most of the work. Just run them via the command line and read the resulting vector output.

If you want to do it yourself, try to find the rough outline and then apply an algorithm to smooth the outline.

Related:

Community
  • 1
  • 1
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820