msgm
====

An implementation of the framework described in

"A Multiscale Variable-grouping Framework for MRF Energy Minimization",
by Omer Meir, Meirav Galun, Stav Yagev, Ronen Basri and Irad Yavneh

The code was designed to support simple replacement of the main components,
namely the variable-grouping algorithm and the interpolation rule.

You are welcome to use to use, modify and redistribute the code,
but please cite our paper if you do.

Omer Meir, 2015 (contact: oymeir@gmail.com)
========================================================================


USAGE
=====
Set parameters in msgmParams() (can leave default),
select an optimization method (can replace with your own!),
and pass a graphical model G to msgm() (see description in msgm()).

See 'msgmDemo()' for a demo script that compares the performance
of multiscale and single-scale inference on a square grid with
random energy potentials.


OPTIMIZATION MODULES
====================

The framework can be run without an optimization module by setting
(params.optimization = 'NONE'), or with an external optimization module.
We provide interface to two optimization algorithms which can be
downloaded from the authors' websites.

	- QPBO, by Vladimir Kolmogorov
	  http://pub.ist.ac.at/~vnk/software/QPBO-v1.4.src.zip
	
	- LSA, by Lena Gorelick
	  http://www.csd.uwo.ca/~ygorelic/LSA_TR_v2.02.zip	
		
	  LSA needs to be patched to handle a degenerate case
	  that may occur when used within our framework.
	  Replace Gorelick's 'reparamEnergy.m' with the version supplied herein.
	  
  For multilabel models we implement alpha-beta Swap with LSA/QPBO moves
  for the binary sub-problem.





