The homography matrix is a 3 x 3 matrix that provides transformation up to scale from a given image and a new one, which must be coplanar. In
src/homography.cpp, there is an extensive example that takes the first image acquired by the camera and then computes the homography for every new frame in respect to the first image. In order to run the example, take something planar, such as a book cover, and run the following command:
$ roslaunch chapter5_tutorials homography.launch
This runs the camera driver that should grab frames from your camera (webcam), detect features (
SURF by default), extract descriptors for each of them, and match them with the ones extracted from the first image using Flann-based matching ...