Lably
Skip to content

Homography (computer vision)

  • 2 min read
  • 3 chapters

Related on Lably

Through Computer vision, Augmented reality and Euclidean vector

3D plane to plane equation

We have two cameras a and b, looking at points Pi in a plane. Passing from the projection bpi=(bui;bvi;1) of Pi in b to the projection api=(aui;avi;1) of Pi in a:

api=bziaziKa⋅Hab⋅Kb−1⋅bpi

where azi and bzi are the z coordinates of P in each camera frame and where the homography matrix Hab is given by

Hab=R−tnTd.

R is the rotation matrix by which b is rotated in relation to a; t is the translation vector from a to b; n and d are the normal vector of the plane and the distance from origin to the plane respectively. Ka and Kb are the cameras' intrinsic parameter matrices.

The figure shows camera b looking at the plane at distance d. Note: From above figure, assuming nTPi+d=0 as plane model, nTPi is the projection of vector Pi along n, and equal to −d. So t=t⋅1=t(−nTPid). And we have HabPi=RPi+t where Hab=R−tnTd.

This formula is only valid if camera b has no rotation and no translation. In the general case where Ra,Rb and ta,tb are the respective rotations and translations of camera a and b, R=RaRbT and the homography matrix Hab becomes

Hab=RaRbT−(−Ra∗RbT∗tb+ta)nTd

where d is the distance of the camera b to the plane.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Robotics