Counting human movement of exercise using ROI or pre-set passing line with OpenCV
This might help partially - 

You can, possibly track the person's head from his hair color(usually black), so can be distinguished from the background. This tracking just needs a simple RGB Filter like ( r&lt;val2 &amp;&amp; g&lt;val4 &amp;&amp; b&lt;val3). Then, you can calibrate the program to respond when the centroid of that hair-region crosses your desired lines/boundaries.