I implement the colorization algorithm described in the paper by Anat Levin. The code is a refactored version of the author’s code. I remove seemingly redundant code, make variables’ names more readable, add comments to describe each step, and implement another weighting function. The code follows the paper closely, except for some tunable parameters which are important but never discussed in the paper.

References:

Colorization using optimization
Anat Levin,	Dani Lischinski, Yair Weiss
ACM Transactions on Graphics (TOG) - Proceedings of ACM SIGGRAPH 2004, Volume 23 Issue 3, August 2004, Pages 689-694 