# Map Testing

You have already built a map and now want to test its quality to check if it is good enough to use in project. There are two ways to do that.

  1. Mapper App
  2. Python Script (Test images)

# Mapper App

In mapper app you can download the map you just created and try to localize in the same environment. on the top right it will show total how many time you tried to localize and how many times it was successful.

# Python Script

To test map with python script you need test images of the location. You can use Immersal Mapper to take test images in the space, imagining where the end users might stand and the directions their devices (e.g., smartphones) might be facing during the AR experience. Try to cover all possibilities, such as varying lighting conditions, and take as many images as possible. You can capture images with manual mode when you have captured desired dataset of that location, press share button on top right button and export the data to your laptop/computer

Share images
Share images
Export to
Export to

This process will export a zip file. Now you can extract the zip file and it will show you some ".png" and ".json" files

Extract Zip file
Extract Zip file
Extracted data
Extracted data

These images will be our test dataset for later use in remote localization tests. From the test results, we can determine the positioning success rate of this dataset and identify which specific images failed to position correctly. Every time we optimize or customize the map, we need to use the same dataset for localization tests to observe whether the success rate increases or decreases.

For example, after try rebuilding the map with different parameters, you need to perform localization tests to understand if the success rate has increased. Similarly, if we reduce the map size by some means, testing is necessary to see if and how the localization success rate is affected and whether the impact is acceptable.

Then you would get a bunch of images and json files. Now you need to run script ‘encode_images_and_json.py’ to convert the exported data to be able to run the localization test. After that, the image files will be renamed.

Before and after encoding images
Before and after encoding images

Copy the link to your image folder and pase it into

Path of your images
e.g. inputDirectory = r'/Users/Name/workspaces/TestMap/img'
inputDirectory = "path_of_frames"

copy the token from your developer portal and paste it in the script

token = "your_token from Dev portal"
mapId = 123

Add your map id of the map that you want to test

And run the script then you will see the script iterating all images and perform localization again the given map, in the end you get the localization success rate. (e.g. 65.22% in the example below). In addition, for all the images that can get localized, you see a visualization and how feature points are matched to the space

Successful localizations
Successful localizations

Here you can get the script to run localization tests