Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A C++ implementation of alpha-expansion moves using QPBO for minimisation of non-submodular energies. qpbo_alpha_expand is inspired by [Shai Bagon's MATLAB wrapper] 1 and uses [Vladimir Kolmogorov's QPBO implementation] 2.

This project was motivated by the need to minimise problems with large label spaces where direct instantiation of the unary and pairwise energy matrices was not possible. For the problems of interest, the label spaces for each node were also restricted. This qpbo_alpha_expand implementation makes use of templates to enable straightforward lazy evaluation of the unary and pairwise energies and restriction of the label spaces.

Author: Richard Stebbing

License: MIT (refer to LICENSE).

As per the license for QPBO, this software can be used for research purposes only.


  • [QPBO] 2
  • [Eigen 3] 3


  • [rstebbing/common] 4
  • Numpy
  • Scipy


  1. Extract [] 2 to the subdirectory external/ under the project root. All QPBO files should reside under external/QPBO-v1.32.src/.
  2. Run CMake with an out of source build.
  3. Set EIGEN_INCLUDE_DIR to the full path up to and including eigen3/. (Add -std=c++11 to CMAKE_CXX_FLAGS if compiling with gcc.)
  4. Configure.
  5. Build.
  6. Run example.


  1. Extract [] 2 as above.
  2. Set EIGEN_INCLUDE and COMMON_CPP_INCLUDE in site.cfg.
  3. Build the Python extension in place: python build_ext --inplace. (Use export CFLAGS=-std=c++11 beforehand if compiling with gcc.)
  4. With rstebbing/common installed, run

To make qpbo_alpha_expand available to other projects (either globally or under a virtualenv):

  1. Build: python build. (Use export CFLAGS=-std=c++11 beforehand if compiling with gcc.)
  2. Install: python install.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.