Detecting garbage homographies from findHomography in OpenCV?
I'm using findHomography on a list of points and sending the result to warpPerspective . The problem is that sometimes the result is complete garbage and the resulting image is represented by weird gray rectangles. How can I detect when findHomography sends me bad results? There are several sanity tests you can perform on the output. On top of my head: Compute the determinant of the homography, and see if it's too close to zero for comfort. Even better, compute its SVD, and verify that the ratio of the first-to-last singular value is sane (not too high). Either result will tell you whether the