One handy function of VisualSfM which can save a huge amount of time in bundle adjustment is instructing the software on which photos overlap, and which don’t. This will save time on the software trying to match images which have no overlapping area, and will generally just be a lot cleaner.
At the high end level, people can do this by inputting GPS coordinates as an initial ‘guess’, with which the bundle adjustment can then play around with. Our solution assumes we know the overlap of the input photos, and so we know which possible matches there can be. From this, we can produce a file with candidate image pairs for speeding up BA.
I’ve put together a simple python script for this with a few options for creating the file needed to preselect image pairs. The script assumes photos have been taken in order, in either a ‘linear’ (where the ends don’t meet) or ‘circular’ (where the last photo overlaps the first) configuration, and pairs each photo with x photos either side of it. It needs to be executed in the folder where the image files are located and produces a file named ‘list.txt’. This can be inputted into VSfM, with more instructions available here.
The script takes 4 parameters.
- Number of images infront/behind the current image with which to make pairs, assuming the images were taken in order
- The filetype (case sensitive for now)
- The imaging configuration – ‘linear’ if the first image does not overlap the last, ‘circular’ if it does
- The delimiter, options are ‘comma’ and ‘space’ (used in VSfM)
Sample: ‘python Make_list.py 3 tif circular comma’
It can be downloaded from the public Github repository here. Hope this helps someone 🙂