there are two images
alt text http://bbs.shoucangshidai.com/attachments/month_1001/1001211535bd7a644e95187acd.jpg alt text http://bbs.shoucangshidai.com/attachments/
Background vs Foreground detection is very subjective. The application scenario defines background or foreground. However in the application you detail, I guess you are implicitly saying that the person is the foreground. Using the above assumption, what you seek is a person detection algorithm. A possible solution is:
- Run a haar feature detector+ boosted cascade of weak classifiers (see the opencv wiki for details)
- Compute inter-frame motion (differences)
- If there is a +ve face detection for a frame, cluster motion pixels around the face (kNN algorithm)
voila... you should have a simple person detector.