我有2幀由移動(非常慢)的相機完成的視頻流;在使用(通過OpenCV)SIFT算法和findHomography OpenCv函數後,我有描述攝像機在兩幀之間完成移動的變換矩陣。 我想要做的是找到的第一個幀的點在第二個: 所以我的代碼是:通過Homography矩陣變換矢量時出錯 - C++ OpenCV
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))in gemm,file/tmp/buildd/ros-什麼是():/ tmp/buildd/fmt.cpp,在調用'cv :: Exception'的實例後終止調用了什麼():/ tmp/buildd/ROS-福艾爾特馬-opencv2-2.4.2-1precise-20130312-1306 /模塊/核心/ SRC/matmul.cpp :711:error:(-215)type == B.type()& &(type == CV_32FC1 ||鍵入== CV_64FC1 ||鍵入== CV_32FC2 ||類型== CV_64FC2)函數GEMM
中止(核心轉儲)
爲什麼?