The image on the left it the hand cluster area reduced to a foreground / background map. This is the data that the thinning algorithm uses. The image right to it is the result, where only lines remain.
My implementation is currently not fast enough to process 30 FPS in real-time. I had to shrink the target image and even now it's not really smooth. I'm not sure if this is the way to go.