1 | initial version |
Hi, i think you will have no luck when you use MatchTemplate to compare your SLAM map with the ground truth map. One reason is that MatchTemplate isn't rotation invariant. In SLAM the robot learns it's unknown environment while exploring it. The robot builds a map in it's own reference frame. Typically the origin of the reference frame is where the robot starts SLAM. So this reference frame can have another orientation as the ground truth reference frame. The different orientation is caused by an initial displacement of the robot, loop closing in SLAM algorithm, laserscan matching errors or map optimizations. You see, its not possible to guaranty that the maps have the same orientations.
You see, determining the accuracy of a generated SLAM map is a difficult task. But, since SLAM has a large research community there exist some papers about determining the accuracy of a map.
You should read this paper: On Measuring the Accuracy of SLAM Algorithms by Rainer Kümmerle, Bastian Steder, Christian Dornhege, Michael Ruhnke, Giorgio Grisetti, Cyrill Stachniss, and Alexander Kleiner Journal of Autonomous Robots, 27(4):387-407, 2009.
Take a look at the related work section. In this section some approaches to compare the SLAM map are discussed. For example one of these approaches use translation and rotation invariant Hausdorff metric. I think this could be a better method to compare the maps than MatchTemplate.