Texton boost implementation in C++ by Philipp Kraehenbuehl