简体   繁体   中英

Fitting a polygon in a image and finding the angles

I have an image of an object that I would like to fit a polygon and extract the internal angles:

图片

I tried to do that fitting lines to the edges of the object using Hough lines from the skimage package .

After that I calculated the angles between the lines. I had more lines than the ones that fitted to the edges of the object, so I had to exclude these lines manually. I have to repeat the algorithm with a large series of images, so I wonder if there is another way that would be simpler and I could apply to an entire stack of images?

To get angles between 2 lines you can check this post this gives some info -

How to measure the angle between 2 lines in a same image using python opencv?

Do refine the edge detection used to get better results, share the actual image I can give it a try.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM