Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/160.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ OpenCV findHomography错误_C++_Qt_Opencv - Fatal编程技术网

C++ OpenCV findHomography错误

C++ OpenCV findHomography错误,c++,qt,opencv,C++,Qt,Opencv,我正在使用OpenCV的冲浪特征检测来比较两幅图像。 当我选择两个相同的图像(有时选择相同的图像)时,我得到以下结果: OpenCV Error: Assertion failed (CV_IS_MAT(imagePoints) && CV_IS_MAT(objectPoints)) in cvFindHomography, file /home/OpenCV/OpenCV-2.4.3/modules/calib3d/src/fundam.cpp, line 232 Qt h

我正在使用OpenCV的冲浪特征检测来比较两幅图像。 当我选择两个相同的图像(有时选择相同的图像)时,我得到以下结果:

 OpenCV Error: Assertion failed (CV_IS_MAT(imagePoints) && CV_IS_MAT(objectPoints)) in cvFindHomography, file /home/OpenCV/OpenCV-2.4.3/modules/calib3d/src/fundam.cpp, line 232 
Qt has caught an exception thrown from an event handler. Throwing 
exceptions from an event handler is not supported in Qt. You must 
reimplement QApplication::notify() and catch all exceptions there. 

terminate called after throwing an instance of 'cv::Exception' 
what(): /home/OpenCV/OpenCV-2.4.3/modules/calib3d/src/fundam.cpp:232: error: (-215) CV_IS_MAT(imagePoints) && CV_IS_MAT(objectPoints) in function cvFindHomography 

Le programme s'est terminé subitement
第二次使用两个不同的图像执行代码时表示:

what(): /home/OpenCV/OpenCV-2.4.3/modules/calib3d/src/fundam.cpp:235: error: (-215) count >= 4 in function cvFindHomography

每次我都用不同的图像重复执行多次,一些测试给了我期望的结果

看起来您没有足够的点来计算单应性。要做到这一点,您至少需要4个点,并且匹配的点数量必须相等(
imagePoints
objectPoints
)。有关说明,请参阅