Ask Your Question

Revision history [back]

click to hide/show revision 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;
}

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;
}