1 | initial version |
your Homography Mat is empty() !
yes, that can happen, if you did not have enough "good" points for findHomography().
you have to add a check here:
Mat H = findHomography( obj, scene, RANSAC );
if (H.empty()) {
cerr << "bad homography." << endl;
return 1;
}
2 | No.2 Revision |
your Homography Mat is empty() !
yes, that can happen, if you did not have enough "good" points for findHomography().findHomography(), it returns an empty Mat.
you have to add a check here:
Mat H = findHomography( obj, scene, RANSAC );
if (H.empty()) {
cerr << "bad homography." << endl;
return 1;
}