Photo pairs in VisualSFM (VSfM)

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.

  1. Number of images infront/behind the current image with which to make pairs, assuming the images were taken in order
  2. The filetype (case sensitive for now)
  3. The imaging configuration – ‘linear’ if the first image does not overlap the last, ‘circular’ if it does
  4. The delimiter, options are ‘comma’ and ‘space’ (used in VSfM)

Sample: ‘python 3 tif circular comma’

It can be downloaded from the public Github repository here. Hope this helps someone 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s