opencv直线拟合cv::fitLine()

Posted larry-xia

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了opencv直线拟合cv::fitLine()相关的知识,希望对你有一定的参考价值。

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

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

@param points Input vector of 2D or 3D points, stored in std::vector<> or Mat.
@param line Output 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.
@param distType Distance used by the M-estimator, see cv::DistanceTypes
@param param Numerical parameter ( C ) for some types of distances. If it is 0, an optimal value
is chosen.
@param reps Sufficient accuracy for the radius (distance between the coordinate origin and the line).
@param aeps Sufficient accuracy for the angle. 0.01 would be a good default value for reps and aeps.

 











以上是关于opencv直线拟合cv::fitLine()的主要内容,如果未能解决你的问题,请参考以下文章

[opencv]直线拟合函数支持类

OpenCV实战——拟合直线

OpenCV直线拟合检测

opencv利用hough概率变换拟合得到直线后,利用DDA算法得到直线上的像素点坐标

C++ OpenCV透视变换改进---直线拟合的应用

OpenCV求最小外接圆最小外接矩形椭圆拟合直线拟合