Overlaying map using GIMP

From Lofaro Lab Wiki
Jump to: navigation, search

In order to overlay the map of the Engineering building 3rd floor, generated by RGBDSLAM, onto the ground truth map, an image manipulation program called GIMP is used. The first step in overlaying the map is to crop out the areas on the map that is not part of the path. In order to do this, do following steps:

1. Select ‘Crop tool’ in the toolbox window (or press shift + C) and trace the areas that you want to crop out of the image

2. Go to Layer --> Transparancy --> Add Alpha Channel

3. Select ‘Erase tool’ in the toolbox window (or press shift + E) and erase the area that you have cropped out The image below shows the map before and after the unwanted areas were cropped out.

Cropped map comparison

The map on the left shows the original map before it was cropped, and the map on the right shows the map after everything except the path was cropped out.


The next step is to place the modified RGBDSLAM map on top of the ground truth map as a layer. This is done by:

1. Go to File → Open → select the image file of the ground truth map

2. Go to File → Open as layers → select the map file you want to overlay onto the ground truth map (in this case, the modified RGBDSLAM map) When this was done, it can be seen that the scale of the RGBDSLAM map does not match the ground truth map, as shown below.

Map before transformation

Therefore, a few transformations on the RGBDSLAM map were required in order to overlay the map to the ground truth map in the appropriate scale. The transformation on the RGBDSLAM map image was done using the perspective tool located in the toolbox (or by pressing shift + p). An example of how the perspective transforms the map image is shown below:

Transformation example

As seen in the image above, the transformation is controlled by clicking and dragging one of the four corners of the map image. Along with this, the resulting transformation matrix is displayed on the box on the top right. With multiple transformations on the map image, the RGBDSLAM map can be completely overlaid on the ground truth map. The following transformation matrices were applied on the map image to overlay it onto the ground truth map:


Transformation #1:

Transformation matrix 1

Transformation #2:

Transformation matrix 2

Transformation #3:

Transformation matrix 3

After these transformation are applied, the resulting image is a completely overlaid map, shown in the image below.

Overlayed Map


GIMP does not keep track of the transformation matrix once the transformation is complete. Therefore, it is required to keep track of the transformation matrices for each map transformation if a user wants to re-use the same transformation indices on a map image later on.