1
votes

I am playing with the camshiftdemo.c [1] distributed with opencv. I select my face and it starts tracking but as soon as I move from my desk to a red couch, circle leaves my face and moves on the couch. Is there a way to change this behaviour?

[1] https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/c/camshiftdemo.c?rev=1429

1

1 Answers

0
votes

If you look at the code from line 140, you can see that color is used to detect skin tones. This is a usual but oversimple way to do face detection. You can imagine that

  1. such a method won't be able to detect all skin colors ;
  2. objects whose color is closed to skin (like your red sofa) will interfere with detection.

You then have two options, either you use a method which is more robust on skin-color objects (with shape-based face detection for example) or you don't use this one on your comfortable sofa :-)