A MATLAB Implementation of GrabCut (Excluding Border Matting and User Editing)
Switch branches/tags
Nothing to show
Clone or download
Latest commit 6bfc5e9 Aug 2, 2018
Permalink
Failed to load latest commit information.
bin_graphcuts v1 May 1, 2015
results v1 May 1, 2015
README.md Update README.md Aug 2, 2018
assign_gauss.m edit May 17, 2016
compute_pairwise.m edit May 17, 2016
compute_unary.m edit May 17, 2016
cut_Tu.m edit May 17, 2016
fit_gmm.m edit May 17, 2016
get_rgb_double.m edit May 17, 2016
grabcut.m edit May 17, 2016
select_back.m edit May 17, 2016
update_gmm.m edit May 17, 2016

README.md

grabcut

A MATLAB Implementation of GrabCut (Excluding Border Matting and User Editing)

This project implements

@article{rother2004grabcut,
  title={Grabcut: Interactive foreground extraction using iterated graph cuts},
  author={Rother, Carsten and Kolmogorov, Vladimir and Blake, Andrew},
  journal={ACM Transactions on Graphics (TOG)},
  volume={23},
  number={3},
  pages={309--314},
  year={2004},
  publisher={ACM}
}

in MATLAB, and it excludes border matting and user editing. That is, it implements everything up to

Iterative minimisation 4. Repeat from step 1 until convergence

as in Figure 3 in the original paper.

Results

Example Usage

GAMMA = 20;
% Inputs and parameters
im_in = imread('./grabcut/results/test4.jpg');
% GrabCut
im_out = grabcut(im_in, GAMMA);
imwrite(im_out, './grabcut/results/test4_out.jpg');

Acknowledgement

The author would like to thank the Computer Vision Research Group at the University of Western Ontario for making their implementation of the max-flow/min-cut algorithm publicly available here.