【发布时间】:2013-04-18 11:09:57
【问题描述】:
我有 2 帧由移动(非常慢)的相机完成的视频流;在使用(通过 OpenCV)SIFT 算法和 findHomography OpenCv 函数后,我得到了描述相机在 2 帧之间完成的运动的变换矩阵。 我想做的是在第二帧中找到第一帧的一个点: 所以我的代码是:
H = findHomography( point1, point2, CV_RANSAC ); //compute the transformation matrix using the
// matching points (the matrix is correct, i checked it)
Mat dstMat(3, 1, H.type());
vector<Point3f> vec;
Mat srcMat(3, 1, H.type());
vec.push_back(Point3f(Ptx,Pty,-1)); // fill the 3x1 vector with the coordinate
// of the interest point in frame 1
srcMat= Mat(vec).reshape(1).t(); //conversion of vec in Mat (the vector is correct, i checked it)
dstMat = H*srcMat; //compute the arrival point in frame 2 // ERROR
但是,在写入错误的地方,我收到以下错误: OpenCV 错误:断言失败 (type == B.type() && (type == CV_32FC1 || type == CV_64FC1 || type == CV_32FC2 || type == CV_64FC2)) 在 gemm,文件 /tmp/buildd/ros -fuerte-opencv2-2.4.2-1precise-20130312-1306/modules/core/src/matmul.cpp,第 711 行 在抛出 'cv::Exception' 的实例后调用终止 什么():/tmp/buildd/ros-fuerte-opencv2-2.4.2-1precise-20130312-1306/modules/core/src/matmul.cpp:711:错误:(-215)类型== B.type( ) && (type == CV_32FC1 || type == CV_64FC1 || type == CV_32FC2 || type == CV_64FC2) 在函数gemm中
中止(核心转储)
为什么?
【问题讨论】:
标签: opencv