我正在使用g ++和opencv 2.4.6编写OpenCV项目
我有一些像这样的代码:
try
{
H = findHomography( obj, scene, CV_RANSAC );
}
catch (Exception &e)
{
if (showOutput)
cout<< "Error throwed when finding homography"<<endl;
errorCount++;
if (errorCount >=10)
{
errorCount = 0;
selected_temp = -99;
foundBB = false;
bb_x1 = 0;
bb_x2 = 0;
bb_y1 = 0;
bb_y2 = 0;
}
return -1;
}
Run Code Online (Sandbox Code Playgroud)
当findHomography无法找到时,将抛出错误.错误消息包括:
OpenCV Error: Assertion failed (npoints >= 0 && points2.checkVector(2)
== npoints && points1.type() == points2.type()) in findHomography,
file /Users/dji-mini/Downloads/opencv- 2.4.6/modules/calib3d/src/fundam.cpp,
line 1074
OpenCV …Run Code Online (Sandbox Code Playgroud)