fitLine(points_vec, vec, CV_DIST_L1, 0, 0.01, 0.01);
line( img, Point(vec[2],vec[3]), Point(vec[2]+vec[0]*50,vec[3]+vec[1]*50),1);
Even though I have long lines in the images I am using for some reason fitLine recgonizes lines between points that are not on the same line. This is odd since points_vec includes many points that are on the same line
I tried changing the distance function,reps and aep but the line parameters that are returned define lines that are not real lines in the image. points_vec has ~600 points. Any suggestions?