2013-08-31 125 views
3

我使用SURF功能检测OpenCV来比较两个图像。 当我选择两个相同的图像(有时相同的图像选择),I得到这样的:OpenCV findHomography errors

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 

我重复执行每次都有不同的图像多次,有些测试给了我想要的结果。

回答

2

看起来你没有足够的积分来计算单应性。您至少需要4分才能做到这一点,并且您匹配的积分数量必须相等(imagePointsobjectPoints)。有关说明,请参见reference