I am new to image processing and python but interested to measure the distance in pixels for both axes (major and minor). Acknowledgment of this link for initial procedures on how to create boundary and axes (major and minor).
I have used the snippet in the link above to create the boundary by changing the parameter in the cv2.drawContours(orig, box.astype('int'),-1, (0, 255, 0), 3)
to cv2.drawContours(orig, ctns,-1, (0, 255, 0), 3)
to obtain the axes but not able to measure the distance as required.
Kindly help me on how to achieve the expected results as per the attachments bearing in mind that the distance between 1
line and another in the bounded object is 1
pixel. The following are the attachments.