失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > opencv直线拟合cv::fitLine()

opencv直线拟合cv::fitLine()

时间:2018-10-13 03:15:57

相关推荐

opencv直线拟合cv::fitLine()

通过2D或者2D点集拟合直线

void fitLine( InputArray points, OutputArray line, int distType,double param, double reps, double aeps );

@parampointsInput vector of 2D or 3D points, stored in std::vector\<\> or Mat.

@paramlineOutput line parameters. In case of 2D fitting, it should be a vector of 4 elements

(like Vec4f) - (vx, vy, x0, y0), where (vx, vy) is a normalized vector collinear to the line and

(x0, y0) is a point on the line. In case of 3D fitting, it should be a vector of 6 elements (like

Vec6f) - (vx, vy, vz, x0, y0, z0), where (vx, vy, vz) is a normalized vector collinear to the line

and (x0, y0, z0) is a point on the line.

@paramdistTypeDistance used by the M-estimator, see cv::DistanceTypes

@paramparamNumerical parameter ( C ) for some types of distances. If it is 0, an optimal value

is chosen.

@paramrepsSufficient accuracy for the radius (distance between the coordinate origin and the line).

@paramaepsSufficient accuracy for the angle. 0.01 would be a good default value for reps and aeps.

可供选的距离类型如下表所示,ri表示的是输入的点到直线的距离:

M估计

参考:M-estimators

如果觉得《opencv直线拟合cv::fitLine()》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。