How to count person in video?
I am use opencv 2.4.9 and python 2.7.6, I need to count people in video. What I already did is:
- Background subtraction
- Find contour and put the bounding box
- Find the centroid (cx,cy)
- Draw a virtual line at (20,75) to (320,75)
I am trying to count people, when they cross the line. I try this code to count it
if 75 <= cy <=77:
counter=counter+1
no error, but the counter count it double, Is there other way to count it?