Width dissecting with a line on masked image
Dear all,
I am currently working with OpenCV 3.2.0 on Python.
Suppose I have a colored object that is centered against a white backdrop, and that I've filtered it to produce a B&W image, I wish to retrieve information on the respective length of the two sides of the object as well as the width (in pixels) of the object in the image.
Example:
As above, the object is white in colour.
May I know the general approach I should adopt in solving this?
Thank you!
To calculate the length of 2 sides, after pre-processing, you can use canny edge ur picture. Then, find contours. I think you can only find 2 contours matching 2 sides. To calculate the width. you must find distance between of 2 above contours.
To calculate the length of 2 sides, after pre-processing, you can use canny edge ur picture. Then, find contours. I think you can only find 2 contours matching 2 sides. To calculate the width, you must find distance between of 2 above contours.
I think you can find your answer in python tutorials and specifically this one