Trajectory-made-by-a-vehicle-with-a-Visual-odometry-approach-

Visual Odometry

In this part we will use the transformations provided by the Kitti dataset : https://www.cvlibs.net/datasets/kitti/

Our objective is to calculate the trajectory made by the vehicle with a visual odometry approach.
We will use the stereo image sequence provided by Kitti to calculate the odometry. Then, we will compare the calculated trajectory with the data provided by the IMU.

Using the simple notions of projective geometry , we can easily calculate the relative pose for each of the images in the sequence (matching →matrix fundamentally →essential →rotation and translation).

The problem is that the translation is calculated with an unknown scale, but thanks to the known configurations of the stereo system (fixed relative position between the stereo pairs), it is possible to find this scale.

The tasks to be accomplished:

  • Start with two consecutive stereo pairs (4 images).
  • Determine the pairs of images where it is necessary to calculate the relative position (according to the proposed method).
  • For each pair, calculate the fundamental matrix.
  • Compute the essential matrix.
  • Extract the rotation and the translation (scale ambiguity) with the recoverPose function.
  • Compute the scale of the translation.
  • Make a loop to compute the complete trajectory (50 couple of images).
  • Display the computed trajectory with the trajectory provided by the IMU on the same figure,
  • compare.

Result :