4

This is my first post here since I cannot find any suitable answer for my research.

I want to use openCV to detect the Head-shoulder pattern to be use in some project.

Camera setting is in the ceiling directly facing down to be used in apps for like people counting etc.

I want my camera to detect/recognize the head and the shoulder from top and not the usual face detection wherein in frontal or back.

Do anyone knows how to? Kindly share me some tips or a simple source code for this one.

User97693321
  • 3,336
  • 7
  • 45
  • 69
mabg
  • 41
  • 3

2 Answers2

1

Apparantly they have used some sort of Time-of-Flight (ToF) Camera, instead of an intesity-based device. I assume that your specific camera is of the latter type, so I don't see any practical approach to the task.

If you had a ToF camera image segmentation would be close to trivial (e.g. thresholding). Afterwards you could simply look for shapes and gradients (distance plateaus and gradients) that are characteristical for head and shoulders and you'd be done.

My suggestion is to go and get a ToF camera and play around with standard CV algorithms. Also have a look at the Kinect, which also is a distance measurement device and could be used as well for this task (though not based on ToF but rather structured light, as far as I know).

moooeeeep
  • 31,622
  • 22
  • 98
  • 187
  • Thanks for the reply, Yes Im currently working on a ToF camera and I guess we have the same device by the one who posted the video. Problem is its a Laboratory experiment from a Univ and cannot ask for some help easily. Actually, we already created some algorithms for face detection. What I want to know now is how to create that kind of head_shoulder classifier/pattern to be use to detect such human image. BTW, we only applied the face_demo from OPenCV thats why its not that hard. This time we dont know the exact classifier for this kind of approach.Thanks. – mabg Oct 19 '12 at 09:30
  • @mabg well, be creative. You could record some images of yourself and try one of them as a template to match as a first shot. – moooeeeep Oct 19 '12 at 09:43
0

I'm afraid the solution is not that simple to describe it in a few lines of code. I think you can start from the face detection sample code in openCV, but, in order to detect people from top, you need a different classifier. You need to find such kind of classifier (I'm sure you can find it somewhere, or you can ask the guy that posted the video you mentioned), and in case you don't get it, you need to train such classifier your self.

An alternative could be subtracting from a background image reference, the current foreground frame, the result is objects passing in the screen, however you cannot distinguish between humans and other objects.

Sdra
  • 2,297
  • 17
  • 30
  • Thanks for the reply...Yes, if there is no other choice, I guess we need to create our own classifier. – mabg Oct 19 '12 at 09:23