Getting OpenMVG set up on Bash for Windows

OpenMVG is a pipeline for structure from motion.  I’ll go through the basics of downloading, installing, and running it on Windows 10.


It does actually compile on Windows, but it can be a royal pain in the rear to get everything set up properly (requiring Visual Studio, Python, and a lot of luck).  Far easier to do in Linux.  But who wants to install a whole new OS just to run some photogrammetry software? Well, fear not, because just the other day I posted on how to get a Bash terminal in windows, allowing you to natively run linux programs without having to install a whole new OS, virtual Machine, or Cygwin.

So, let’s start….


Downloading and building.

All I’m going to do here is run through the official Build Instructions, wording it a little differently.  I highly recommend you go there for details.  I’m only writing it up here so that all the information needed for a later post is in one place.


Install the required tools cmake, Git, and a c++ compiler by typing the following into Bash:

sudo apt-get install cmake git gcc make g++ python

(enter your password if you previously set one up)


  • Cmake is used to create a Makefile in order to compile the source code
  • Make Will turn the source code files into executables (things that actually run)
  • Git Is the program that lets you download all the source code from github
  • GCC Is the Gnu C Compiler (and g++ is the Gnu C++ Compiler).
  • Python Is required to run the ready-to-use openMVG scripts

Now you’ll need some additional libraries, so type into bash:

sudo apt-get install libpng-dev libjpeg-dev libtiff-dev libxxf86vm1 libxxf86vm-dev libxi-dev libxrandr-dev


Now we’re going to download the repository:

git clone --recursive

Move into that new directory:

cd openMVG

(cd stands for ‘change directory’)


This should list the files in that directory (AUTHORS BUILD docs logo README src …)

cd ..

(this goes back up one directory)


Now we create a new directory to put the compiled code in (to keep it separate from the source)

mkdir openMVG_Build

Then go into that directory:

cd openMVG_Build

And run cmake:


Now we’ve created the necessary configuration files to make the binaries, we just run:



Running OpenMVG

Ok, hopefully that’s built without errors.

If so, let’s test it out.  (If not, I leave the troubleshooting to you!)

One thing to note before we go any further: the home directory for bash, is located in windows space at


Navigate there in Windows explorer, and you’ll see a folder with your username.  Go inside there and you’ll see folders called openMVG and openMVG_Build.

Full instructions are available on the OpenMVG docs page, including how to download tutorial data:

There are two pipelines – sequential and global.  I’ll let you read up on what the difference is.  Both are invoked more-or-less the same way, and I’ve generally found Sequential to be a little more robust.

 (I’m going to assume now that your username is ‘Peter’ and that [using windows explorer] you’ve put all your images in a folder called ‘images’ in your linux home directory (next to openMVG and openMVGBuild). You will want to slightly alter the commands accordingly.)


To run the sequential pipeline on your images in your home directory, and output the results into a new folder called ‘MVGOutput’ in your home directory, type the following (capitalization matters in linux):


python /home/Peter/openMVG_Build/software/SfM/ /home/Peter/images /home/Peter/MVGOutput

That’s it.  Let it run, and inside MVGOutput, you’ll find several PLY files of the camera positions and a sparse point cloud.

You’ll need another package to make a dense cloud and subsequent mesh, and I’ll detail those later.




2 thoughts on “Getting OpenMVG set up on Bash for Windows

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