
2. From the vanishing points the rotation matrix of the camera withrespect to the scene is computed
R = (VpX, VpY,VpZ) ^T
3. Then we use this matrix to rectify the images undoing the rotation R. For example we can see next images where the one on the left is the original image and the right one is the rectified one.

4. We were able to compute the VPs trough an indoors sequence. This sequence has 2200 frames. The rotation angles obtained from the rotation matrix are the following

5. From the last graphic we can observe that the camera is performing a planar motion and the x-axis gives us the orientation. The drastic changes in x-axis indicates a change of direction. This happens when the camera rotates around a corner (~90º). This situation can be observed here
6. Analyzing the rotations about the x-axis (alpha) we are able to detect the changes of orientation and with this information we can build a very general topological map based on rotations.

7. To avoid having all the frames and their respective rectification matrices we need to select some frames, we call these frames "keyframes". These keyframes will represent the nodes of our topological map. The keyframes are selected by computing the Essential matrix between two frames. To do this we use the 5-point algorithm

8. From the estimated Essential matrix we extract the rotation matrix and we compare it to the one extracted from the vanishing points.
Rxy_vanishing = R{frame_x}' * R{frame_y}
Rextracted = extract_R_from_E(E)
Rextracted = extract_R_from_E(E)
9. If the rotation matrix obained from the Essential matrixis congruent with the one computed from the visual compass we select another frame to compute a new Essential matrix. When we can't go on computing Essential matrices we select those frames as keyframe and start the process again from the begining. The output of this process will be the topological map.

