我收到了这个错误
错误:(-215)CV_IS_MASK_ARR(掩码)&& CV_IS_MAT_CONT(掩码 - >类型)&& (mask-> rows == 1 || mask-> cols == 1)&& mask-> rows * mask-> cols == count in function cvFindHomography
来自此代码:
std::vector<Point2f> dstPoints(4);
dstPoints[0].x=1;
dstPoints[1].x=3;
dstPoints[2].x=1;
dstPoints[3].x=3;
dstPoints[0].y=0;
dstPoints[1].y=0;
dstPoints[2].y=2;
dstPoints[3].y=2;
std::vector<Point2f> srcPoints(4);
srcPoints[0].x=5;
srcPoints[1].x=6;
srcPoints[2].x=5;
srcPoints[3].x=7;
srcPoints[0].y=0;
srcPoints[1].y=0;
srcPoints[2].y=5;
srcPoints[3].y=5;
Mat floorHomog = findHomography(srcPoints,dstPoints);
我不明白为什么。单应性应该可以用4个点来解决。 谢谢!