New bundler version

May 26th, 2012 by Henri Leave a reply »

I’ve compiled a new version of Bundler with 2 interesting new options:

--ba sba

BTW those options should be passed as command arguments to bundler.exe directly (and not been added to the options.txt file).

The parallel_epipolar option allows to estimate the fundamental matrices (ransac + lm) in parallel. This problem is embarrassingly parallel but due to some global variables used in the callback passed to lmfit it wasn’t that easy to implement: I’ve used a functor to hide the global variables used by the callback but sadly lmfit doesn’t have a void* userData parameter (only a pointer to the callback). Thus I’ve modified lmfit and add this missing parameter that allow me to pass a pointer to my functor. Furthermore I had to compile almost everything in C++ instead of C to use my functor inside lmfit. Thus I had to fix a lot of malloc calls that weren’t compiling in C++ due to missing cast. To keep a “backward behavior compatibility” this option is disabled by default.

The ba option allows to change the bundle adjustment “engine” used. Here is the list of available “engine”:

  • sba (default)
  • none (for debug only)
  • pba_cpu_double
  • pba_cpu_float
  • pba_gpu_float

Pba stand for Parallel Bundle Adjustment: I’ve integrated mcba from Changchang Wu.

So if you have an Nvidia GPU card and installed the Cuda runtime you can add those options:

bundler.exe list_focal_absolute.txt --ba pba_gpu_float --parallel_epipolar
--options_file options.txt //on the same line

Timing on a 245 pictures dataset:

Bundler BA Time Nb pictures registered
SBA 2h18min 233
PBA CPU double 23min 230
PBA CPU float 9min 230
PBA GPU float 6min 230
none (for debug) 2min 189 (bad reconstruction)

You can download this new version of bundler:
Update: the source code is available on the MCBA branch of my Bundler fork.



  1. whatnick says:

    Nice work, I got stuck on the globals while multi-threading the compute_epipolar method. Have you seen the work done on passing GPS locations of cameras ? It will be handy to build that in. I have been working on SFMToolkit, you can check some of the changes here:

  2. Hi Henry

    Where are can put this blunder.exe file?
    Is it at blunder directory at Photosynth11?

    Thanks in advance.

  3. Henri says:

    @whatnick: Nice to see that someone else tried to multi-thread the epipolar geometry computation :-) BTW I’ve taken a look at your changes to BundlerMatcher and your blog post: I can give you some hint on how to deal with extra high resolution images (contact me by mail). Furthermore selecting the matching pairs based on GPS coords is not really a good idea if you don’t have the camera orientation (in case your are also shooting oblique imagery). You may want to use the unstructured linear matching solution available with OpenSynther instead. There is already a BundlerMatcher replacement in OpenSynther (with more matching mode). But this version is resizing the input images to reduce the number of features (as photosynth does) which is not a good idea if you need high accuracy.

    @Fabricio: Bundler must be used with SFMToolkit not PhotoSynthToolkit. This version of Bundler is useful for advanced user only. If I have enough time I’ll release a new version of SFMToolkit packaged with this version of Bundler.

  4. Kyle says:

    Hi Henri,

    I followed your website for a long time and learned heaps here. Thank you very much.

    It is exciting to run bundler with multiple threading. However, currently do you just release the binary executable file instead of the source codes? In order to run this bundler.exe, what kind of dll files should I include, otherwise I always got runtime error when I launch this new bundler.exe.

    Your response will be appreciated.


  5. Henri says:

    @Kyle: you need to install visual studio redistribuable 2010 x64 and cuda runtime 4.1.28 x64 (cudart64_41_28.dll). BTW Dependencies walker is a great tool to find out the dll needed for an executable…

    I’ll post my modification on a github fork once I’ll get a decent internet connexion back (should happen in a few week).

  6. Ken says:

    What’ up dawg?

  7. Sergiy says:

    The bundler.exe is dependant on cudart64_41_28.dll (CUDA 4.1 Runtime I presume), and the current CUDA release is 4.2, so the only dll they ship is cudart64_42_9.dll. Could you recompile for the new CUDA, or post all the .dlls? Thanks!

  8. Henri says:

    @Sergiy: I’ve added the cudart dll (v4.1) in my zip file now. I’ve also started to commit my changes to Bundler on my Github fork. The parallel epipolar optimization is not yet commited as I need to modify the cmake file to compile some project in c++ instead of c. But the bundle adjustment selector is commited.

  9. Vit says:

    If used parametrs –ba, error “The program bundler.exe has stopped working”. Tell me what’s the problem?
    CUDA drivers installed.

  10. Henri says:

    @Vit: Does it work without specifying the –ba option? If not you may need to install visual studio redistribuable. If yes I don’t know. You can check with depency walker to track for missing dll on your system. Or you can also compile bundler from source (as I’ve uploaded all my modifications on my github bundler fork now.

Leave a Reply