I am trying to find some method to detect people using only one camera 3 meters above the ground. This is a frame returned by camera:

enter image description here

UPDATE: Video test -> http://dl.dropbox.com/u/5576334/top_head_shadow.avi

In order to do that, first I understand that I have to perform a background-foreground segmentation. That is the easy part.

With the foreground mask, I am able to make simple operations such Hough transform to find circles, but this way only detects the 60% of heads, including many false positives.

I could use some other simple techniques like color segmentation, but I found that people heads are very different seen from above because of their hairstyle, color, amount of hair,...

Other option I have though about it is the possibility of using HOG Descriptors, or Haar-like features, but I would need an extensive database of people seen from above to train the models. I have not found anything like that.

I thought this would be a very recurrent problem, but I can not find very much about it in the literature or internet. Any help to resolve this task will be appreciated :-)

UPDATE: For more information, The goal is to implement some generic method to make pedestrian flow tracking. The first prototype will be tested in a Mall.

  • 1
    $\begingroup$ If you can post some videos, there is a chance that someone will write a prototype. Can you post please? $\endgroup$ Oct 30, 2012 at 16:51
  • $\begingroup$ @Andrey, I uploaded a video test showing the problem. $\endgroup$
    – emepetres
    Nov 1, 2012 at 10:15
  • $\begingroup$ @emepetres If you have resources to test this problem, maybe you also have resources to find a secondary camera? Combining views from two cameras (one top-view, and one frontal or from an angle) and using information from both sounds interesting and like a plausible approach to pedestrian flow tracking (depending on the accuracy you need) $\endgroup$
    – penelope
    Nov 1, 2012 at 14:45
  • 4
    $\begingroup$ this task is called "people counting" in literature. $\endgroup$
    – mrgloom
    Mar 6, 2013 at 6:37
  • $\begingroup$ Can you provide link for this video. It is not available in the provided link anymore $\endgroup$ Nov 20, 2018 at 13:26

4 Answers 4


Are there any other objects that can move beside people? If there aren't, you can just find the blobs (connected components) in your foreground mask, and these are your people.

They can also "collide" one with another, creating one blob instead of two. In this case, you can do a motion tracking and resolve the ambiguity by using the fact that the trajectory and the speed is smooth.

If there are other objects (like dogs, cars), you should create a classifier that gets blob parameters like:

  • Blob statistics (size, solidity,etc..)
  • Color
  • Edge information
  • Speed (in case of tracking)

And returns the correct class (Human/No Human).

  • 1
    $\begingroup$ I am looking for a robust method that can distinguish between human/non-human also. In that way, after thinking about your answer I think using blob parameters as you suggested, combined with some features tracking and some statistical information of the blob should be robust enough. $\endgroup$
    – emepetres
    Nov 1, 2012 at 10:28

I have been in the "in order to use well tested methods I would need an extensive database of examples which I don't have" position in a very small company that "couldn't afford it". I regret very much that I didn't simply do whatever was necessary to get as much such data as possible. I think it would have made a world of difference to them in the end.

Any sort of real world vision detection has a million things you didn't think of until you tried it and it failed. It is an old problem many, many times more difficult than it appears. I would recommend sticking to newtons method of "standing on the shoulders of giants" (or, almost as good, on top of a large pile of dwarves). That is, use a method you already know works and is robust. All the stuff that sounds like it will be "good enough" instead will fail miserably.

State of the art in pedestrian detection last I knew was HOG which was originally tested in exactly that setting. You want tracking so you will need to play around in google scholar a bit to find that. Buy my main point is, I have been in a similar position and from that I would recommend you get your database, whatever you have to do, and use something you know works, which is already tested with a known failure rate, not something that just sounds good. The 40 year death march of computer vision algorithms which "sound like they will work" is not something you want to be part of.

P.S. Not trying to critisize computer vision. Its one of my favorite areas. But it's history suggests there are a thousand wrong steps to take and not very many right ones. Its better to follow someone who already found some of those right steps.

  • $\begingroup$ Maybe you are right, and I should spend some time making a good database to train and test a HOG descriptor. In that way, do you know which minimum size would have this database in order to make the training correctly? $\endgroup$
    – emepetres
    Nov 5, 2012 at 8:41
  • 1
    $\begingroup$ I do not know. As wide a variety as possible. Also, HOG is a detector, it returns a "yes there is a person" or "no person" response for an image and nothing else. It says nothing about where the person is (location) or what pixels are the person (segmentation) or whether there are multiple people versus one person. I think some adaptations to HOG have been made (some patented) but the point is what you want is person tracking and HOG as it stands is about detection only, not even location. I've never done it but person tracking is a long standing topic. Check out papers on person tracking. $\endgroup$ Nov 6, 2012 at 16:23
  • 1
    $\begingroup$ @John Robertson HOG is not detector it's just descriptor and it's used with some classificator(SVM+HOG for example) and it can return location of object. $\endgroup$
    – mrgloom
    Mar 6, 2013 at 6:50
  • 1
    $\begingroup$ @mrgloom You are right. It does return the location by doing a windowed search. That is only fast using a method patented by a large corporation though. I wasn't meaning to use the word detector in the technical sense here, just in the plain english sense that it is something that detects. It only provides location in a loose sense that within that window there is someone at roughly 80-90% of the scale of the window but without any identification of which parts of the window are might belong to the person. I am familiar with the descriptor/detector technical distinction. $\endgroup$ Mar 6, 2013 at 7:14

I think that you could get started by combining a few answers from here.

There's two different approaches mentioned in this answer, with the major difference that it's impossible for you to do face detection since you do not see faces. But the other approach is still applicable: decide weather something is a pedestrian or not based on it's actions (movements).

This would, as you predicted, suggest using some kind of foreground-background segmentation. A very fast googling found this recent article that looked pretty promising, but since I never did this personally, you or someone else might have better suggestions for specific algorithm to use in this step.

Now, the first answer I linked just gives a very general approach idea. This answer however could give you idea about your next steps: track the objects, and try to distinguish between them based on the speed or moving direction.

Finally, I never tackled the problem you had, so I'm probably not of much help, but maybe the answers I linked to can give you some general idea for where to start. It also surprised me that I could not find any previous works and articles when searching for an answer to your problem, but then, maybe you just need somebody to tell you the correct keywords to describe this problem.

  • $\begingroup$ Thank you for your answer. The article about foreground segmentation looks very interesting. As you and @Andrey suggested, I will follow the approach of blob analysis to determine the number of humans in each blob. $\endgroup$
    – emepetres
    Nov 1, 2012 at 10:44
  • $\begingroup$ @emepetres It would be nice if you let us know about your results, and how successful was the approach once you try it out and test it $\endgroup$
    – penelope
    Nov 1, 2012 at 14:44

I have some kind of task as described here, counting people. But my requirement is the camera should be facing people from left/right side, not over the head.

That being said, exploring possible solution for my case, I stumble upon an interesting method for your case (overhead detection). Those solutions use stereo camera so that you can handle blobs (people moving too close together) by seeing the depth (e.g. only see blobs on average people head level).

This product might give you better explanation: digiop. See the brochure for more technical explanation.

P.S. I am not representing the company, just pointing out a well documented solution

  • $\begingroup$ Thank you for sharing, It seems to be an interesting way to resolve the problem. $\endgroup$
    – emepetres
    May 15, 2013 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.