I was wondering if there's a way to take an image like the Pentagon below and translate it into an array of points (x,y,x1,y1,x2,y2...) like:
(1,3,
2,6,
6,6,
7,3,
4,1)
With a coordinate system rooted in the top left. I know you can convert an image into array using opencv but that would translate each pixel into an element of the array. I'm looking to get just the non white elements and only the critical points of them (i.e. where they change direction).
Pentagon:



