# Is it possible to calculate a homography matrix for any 2 views?

I've been experimenting with opencv to estimate the homography matrix between 2 images captured with my computer's webcam. I have noticed that when the 2 views are not very far apart (that's when I don't move my computer far away), when I warp the second image with my homography matrix, the warped image and the first image nearly overlap. But when the 2 views are very wide apart, warping the second image with the homography matrix that I estimated gives a view that is very different from that of the first image.
So my question is, why is that? are there conditions on the motion model of the camera between the 2 views that have to be met so that the homography estimation can be performed correctly?
And in very simple terms, what is a homography anyway? (In my understanding, an image is a 3D world projection on a certain 2D plane (the camera plane), a homography matrix allows us to project the 3D world on another plane by way of our first projection on the camera plane)

• Is the scene planar? Jun 2, 2019 at 16:31
• @PeterCorke The scene contains planes like the surface of the wall, but it contains bumps too Jun 2, 2019 at 16:58
• Homography assumes the scene is a perfect plane Jun 2, 2019 at 18:01
• @PeterCorke If this is the case, then homographies are a really limited tool because real scenes not planar. Are there conditions on the camera angle with regard to the plane? (Perpendicular,...?) Jun 2, 2019 at 18:13
• No constraints on the angle, but you need to ensure that you correct for lens distortion. Yes, they are limited but nevertheless there many useful applications. Jun 2, 2019 at 20:10