cv::fitLine用法

本文介绍了OpenCV中的fitLine函数,用于拟合二维数据点的直线。通过代码示例展示了如何使用该函数,包括y = x + 1和y = -x + 1两种情况,详细解释了输出参数的含义,并提供了相应的C++代码片段。
摘要由CSDN通过智能技术生成

定义

在opencv官方文档定义如下:

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

#include <opencv2/imgproc.hpp>
Fits a line to a 2D or 3D point set.

Parameters
points	Input vector of 2D or 3D points, stored in std::vector<> or Mat.
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),
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值