Object Measureent Garments

Hi,

I have to do object measurement of a Garment. I processed the image to do canny edge detection.

My idea is to mark the points/the corners of the outline and number it as follows:

Then take the measurement between the different poitns.
For example, I would want to get the distance between 2 and 3.

Can someone help, please?
Thanks!

I managed to do Harris Corner Detector. But now how do I take only the corners I am interested in and take the measurement in between?

one problem at a time.

suppose you have the first picture, with the numbered points.

do you have those points as (x,y) values?

what ways do you know to calculate the distance between two points when you know their (x,y) values?

Hi,

I do not know their x,y values and do not know how to get them.
I was thinking of getting them then calculate the distance using √[(x₂ - x₁)² + (y₂ - y₁)²] .

you probably have to fit your query points
(no matter if those are from contours or harris)
to a model, e.g. your hand drawn points in the edge image above.

once you know, which point is (2) and which is (3), you can measure.

since your query image (let’s pretend, it’s the one with the harris points) shows perspective / pose distortion, you will need to transform(warp) it into “model space” first

last, to get “real world unit” measurements, you need to calibrate the camera.
since you cannot do this, if your input is from arbitrary cameras/persons, it might need a reference measure in the image (some ruler) instead.

1 Like

use an image editor and find the coordinates of those points. write them down in your source code. that’ll do for now.

later, you can maybe write some code that uses namedWindow and setMouseCallback so you can click in your picture and the code sees where you clicked.

https://docs.opencv.org/master/db/d5b/tutorial_py_mouse_handling.html

I doubt you’re ready for homographies. if you actually want to measure in “real-world units” you will need them. work up to the problem and learn.

Is there a way to automatically get the points of the edges?

read up on “least square fitting”