Computing the homography of two images
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 with a cross-check filter. Once the program has the matches, the homography matrix H
is computed. With H
, we can warp the new frame to obtain the original one, as shown in the following screenshot (matches on the top, warped image using H
, which...