answered Jun 3 '13
std::vector<cv::Point2f> points; points.push_back(cv::Point2f(3,3)); points.push_back(cv::Point2f(4,4)); points.push_back(cv::Point2f(5,5)); Vec4f line; cv::fitLine(points,line,CV_DIST_L2,0,0.01,0.01);