Reduce reprojection error from computed Homography
Hello,
I am computing the Homography between two images and using that to estimate the change in camera pose.
- The images are being taken by a camera rotating about the z-axis(or a purely rotating camera)
- I use a feature detection method e.g. SIFT/SURF/ORB and use the Flann matcher to get the putative matches. On visual inspection the matches look correct.
- The outlier detection method being used is RANSAC with a low reprojection threshold of 1.0
- When the yaw between images taken is larger than 15 degrees or so, the matches look right on visual inspection but the average reprojection error((I calculate this myself using x' - H*x)) goes high. And unfortunately its not just a few outliers, the reprojection error is high with all the matches.
- The matches are the close to the image boundaries i.e. in the first image the interest points are close to the right boundary and in the second image its close to the left boundary. Not sure if this changes anything though.
Are there any guidelines to improve the re-projection error(and so the Homography)? Or does anyone know of any literature that could help?
Thanks!
I think you need to be a bit clearer about the problem you're having. You say "in certain scenarios". Do you mean for some image pairs, and not for others? Do you just have a few bad point matches amongst mostly good ones, in all your images? Are you talking about bad average error? You're more likely to get help if you can clarify some of this stuff. This problem is a classic case for using RANSAC, if you aren't already. Although if you're using OpenCV, it might be happening under the hood. If you just a have a few bad matches (i.e. outliers), that should help. Then consider using the final model to compute reprojection errors, culling the outliers, and refitting to all the inlier points. Otherwise, you need to be more specific :)
Thank you for your input. I shall edit my question to be more specific :)
Have you calibrated the camera and undistorted the images? That could be the cause.
I realized that my purely rotating camera has some translation which maybe the cause for the Homography to be bad overall. My scene does not have a planar surface as of now. I shall be testing my hypothesis today. This link states the two conditions when a Homography is valid but doesn't explain it very well :(
This one is a bit clearer: HERE
That helped, thanks! They had a very good depiction of the two valid conditions and how they work.