I have an image with several ROIs(polygon). I need to calculate the middle points of the two sides of the polygon and therefore I need to draw a rectangle inside the polygons and need the corner points' coordinated of each rectangle. Minimum bounding box did not work for my image as I need to fit is inside the ROIs. Could you please help me with this?
I have attached the image.