opencv提供了fitline函数用于直线拟合,原型为: C++: void fitLine(InputArray points, OutputArray line, int distType, double param, double reps, double aeps) Python: cv2.fitLine(points, distType, param, reps, aeps) → line C: void cvFitLine(const CvArr* points, int dist