beginner question: approaches for detecting a person in front of a store window
I need to read a video stream from a camera mounted about 10 feet in the air, and pointed at a steep downward toward a sidewalk. I simply need to detect if ANY person-sized object has moved into the camera's view, and remained there for a few seconds.
I know this is fairly trivial if I have a controlled environment and a relatively static background. I can remove the background, then run a contour detector. However, if it's an outdoor camera, I'll need to be constantly grabbing new background shots, waiting until the sidewalk is empty before grabbing, which seems far from foolproof.
I've experimented with HOG:
HOGDescriptor hog;
hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector());
This seems to give some false positives, and may be more complex than I need (I don't care if an object is a person or not, I just care if it's present and big).
What approach would you all take for simply detecting whether there's a big thing on a sidewalk or not, across a wide range of weather and light conditions?
**** EDIT *******
This looks like it may be most of what I want.
http://docs.opencv.org/trunk/doc/tutorials/video/background_subtraction/background_subtraction.html
the HOG descriptors for people were trained on a plain side-view.
@berak -- right, so I suppose if I wanted to use HOG I'd need to do some of my own training. More reason to avoid HOG if I can get away with something less sophisticated.
at least look at backgroundsubtractormog2 for a more sophisticated bg-removal
Sample images will be helpful for more tips.
I suggest like @berak using the mog2 background subtractor with updating set to true. After that, perform some closing and opening operations on the image to remove noise, maybe even a Gaussian filter before applying the BG subtractor (it removes speckle noise) and then you have an image with white blobs on a black background. Secondly perform a findContours operation and a contourArea to define the size of these contours. This will get you pretty far if you do not want to know if it is actually a person or just a large box walking in front of the camera.