草庐IT

vTestPoints

全部标签

ios - 拟合一条线 - MatLab 不同意 OpenCV

取样本点(10,10)、(20,0)、(20,40)、(20,20)。在Matlab中,polyfit返回斜率1,但对于相同的数据,openCVfitline返回斜率10.7。根据手工计算,接近垂直线(斜率10.7)是更好的最小二乘拟合。为什么我们从两个库中得到不同的行?OpenCV代码-(在iOS上)vectorvTestPoints;vTestPoints.push_back(cv::Point(10,10));vTestPoints.push_back(cv::Point(20,0));vTestPoints.push_back(cv::Point(20,40));vTestPo