Image skeletonization - connecting lines

asked 2013-12-30 07:58:43 -0600

patrykw91 gravatar image

updated 2015-09-05 13:24:03 -0600

Hello.

I am working on hand gestures recognition application with OpenCV and C++. Gestures will be recognized, based on hand skeleton pose and angles.

I am currently trying to solve a problem described here: http://stackoverflow.com/questions/20730166/building-tree-graph-from-image-points which is reading data from the skeleton.

I used zhang-suen-thinning algorithm, but the output gave me some redundant pixels which was interpreted as skeleton nodes (which was wrong), so I had to make some additional pixel filtering on that skeleton.

http://stackoverflow.com/a/20789739/2630520 this post describes above problem more specifically.

For now, I'am facing the problem, how to connect lines which got separated by my filtering. (Zoom in screen below, to see that inside red rectangles lines are disconnected). image description

As you can see on the right image, bigger dots represents fingertips, and smaller dots should be representing skeleton nodes . By my lines disconnection, some nodes became tips. I need to somehow reconnect this lines, to create a "tip-node" connections, and create something like that:

image description

After that I will read red lines length and angles between them and learn gestures based on values.

So what I'm asking is "How to reconnect disconnected lines?" .

I read about connecting lines, and i believe cv::dilate could do the job, but I'm not sure hot to use it without messing with my image too much. Any ideas?

edit retag flag offensive close merge delete