Research code for the "Nonlocal Matting" matting paper by P. Lee and Y. Wu in CVPR 2011.
Matlab M
Latest commit e34d7f4 Aug 27, 2013 @rocketman768 Original 2011 code.

Nonlocal Matting

This is the research code used by me, Philip G. Lee, in my nonlocal matting research. Please see the paper here: Nonlocal matting


All of the code is licensed under the GPLv3. The images in gt/ and images/ are from under fair use for research. The images in scribs/ are licensed under the WTFPL-2. For more detail, see the COPYRIGHT file.


The purpose of this code was to do research on incorporating Nonlocal methods into alpha matting. The results of the original code are published in P. Lee, Y Wu. "Nonlocal matting". Computer Vision and Pattern Recognition 2011.


This code is meant for RESEARCH ONLY. It is not production quality or optimized or anything like that. It is written to be easily modified.

Normalized Images

Most of this code assumes that we are working with images whose color channels are normalized to the range [0,1]. For example: I = double(imread('image.png'))./255 is the normalization for an 8-bit image.

Memory Limitations

The code directly solves sparse matrices in memory, limiting the image resolution to something like 128x128, since it will exhaust GB of RAM.