Implementing http://mafahir.wordpress.com/2011/02/02/image-thinningskeletonization-cc-implementation/ , doesn't work yet