Implementation of [1] written in MATLAB and C++.
The code uses the roof duality code from [2].
The code has been tested on:
- Windows 7, MATLAB 2015a, Visual Studio 2013.
- Ubuntu 14.04, MATLAB 2015a, GCC 4.8.2.
The code requires SPII, which is used to perform local optimization via automatic differentiation.
Update include/compile_script.m with the correct folders to Eigen and SPII:
...
%%%%%%%%%
% ACTION REQUIRED:
% Point this to your Eigen include directory.
extra_args{end+1} = '-I"C:\Program Files\Eigen"';
%%%%%%%%
% Default installation directories for Spii
extra_args{end+1} = '-I"C:\Program Files\SPII\include"';
extra_args{end+1} = '-L"C:\Program Files\SPII\lib"';
...
Install SPII in the default path.
A good place to start is with the two scripts:
- examples/example_2D.m
- examples/example_3D.m
If you like to add a new cost function update three files and remove the old mex files:
- include/PointCloud.h add a new functor, e.g:
class My_regularization { ...
- include/mex_wrapper.h update with the new functor, e.g.:
...
} else if (!strcmp(problem_type,"my_cost")){
main_function<Quadratic_data, My_regularization>(nlhs, plhs, nrhs, prhs);
} else
...
- PointCloud.m update to allow the new cost function, e.g:
case {'linear','quadratic', 'default', 'length', 'my_cost'}
-
Remove the mex-files in /include
-
You can now switch to the new function as:
Obj.cost_function = 'myCost';
- Johannes Ulén
- Carl Olsson
-
Curvature-based regularization for surface approximation.
IEEE Conference on Computer Vision and Pattern Recognition, 2012
C. Olsson and Y. Boykov. -
Optimizing binary MRFs via extended roof duality.
IEEE Conference on Computer Vision and Pattern Recognition, 2007.
C. Rother, V. Kolmogorov, V. Lempitsky, and M. Szummer.