How to use the output of cv2.fitLine() [closed]
I am basically trying to fit 2 lines to 2 sets of points (each has 100 points) and find the normal distance between the lines, I am using cv2.fitLine() to fit the line in python
From the documentation, fitLine returns a vector containing: (vx, vy, x0, y0), Where vx,vy are normalized vector collinear to the line and x0,y0 is a point on the line. I am confused on how to get the equation of the line from these values so that I can find the normal distance between the two lines.
not at all an opencv problem, but a plain maths one.
(and maybe your expectation is somewhat wrong here)
in 2d it only makes sense, if your lines are parallel (else they meet at some point, and the distance is 0) non-parallel lines also cannot have a normal shared by both lines.
in 3d it's a skew lines problem