Face Tracking - A solution?
Pete Turner from United Kingdom  [5 posts]
13 year

Using the standard modules of RoboRealm, I seem to have created a "sensible" way of tracking a face or skin.

Please follow this short tutorial!

1.) Start with your source image (source.jpg)
2.) Use the Skin module - in this example I have used a Hysteresis value of 2 (Skin.jpg)
3.) RGB_filter - I have found that I produce lots of magenta from skin that my camera can detect. I filter my magenta at the following values : Min. Intensity - 128, Min. Hue - 16, Hue Hysteresis - 23
All of these values though will change depending on ambient lighting conditions and your camera (RGB filter magenta.jpg)
4.) Next I use a Temporal Median over 10 frames and make it continuous (temporal median.jpg)
5.) Inrease this source by using the Max Filter and set it to 2 or 3 to "beef up" the signal. (Max filter 2.jpg)
6.) Finally, apply a Smooth Hull - I use a window size of 7 and a weight of 60% (smooth hull.jpg)

I hope this helps someone, it has allowed me to track skin (and faces) fairly accurately....

Pete Turner from United Kingdom  [5 posts] 13 year
*** Update ***

I have just received my Bots new camera in the post - it's a "CIF Single Chip" based camera.

It appears that it doesn't pick up magenta unlike my Acer Aspire one internal camera, and it is biased towards the yellow end of the spectrum.

As always, careful balancing depending on the lighting situation is essential for successful tracking!
Anonymous 13 year

Try adding on the Color_Balance module set to automatic infront of all the other modules. This will help equalize the colors before processing begins. Note that with this module you may need to tweak your color values somewhat.

In the gist of things here is another way to do this:

1. Color Balance
2. Flood fill - connects similar colors
3. Blob Filter - remove objects that are very flat in color (i.e. wall)
4. Erode and smooth the result
5. Remove all but the largest remaining blob

Robofile is attached using your image.

Note this is just another way of doing what you're after. They are somewhat fragile routines in that if color or lighting changes then the match may not .... but it is worth playing with to see if anything more stable comes out.

Pete Turner from United Kingdom  [5 posts] 13 year
Thankyou STeven!

That is a most useful file (and a lot more robust than my method!)

I'm considering using the IR ability of webcams to "limit" the range of my camera and hopfully to make it a bit more tuneable.
This involves :
removing the IR filter from the camera
replacing the filter with 2 or 3 pieces of exposed, but not shot camera negative film (to block out all other light EXCEPT IR)
adding a bank of IR LEDs with diffusion to get the "maxiumum" range that you require.

Damn my want for a person tracking robot that has to be able to operate in multiple environments!
Pete Turner from United Kingdom  [5 posts] 13 year
Thankyou for all the help and hard work. Even with extensive fiddling, the camera prefers to look at the walls and wooden doors!

is there a way that the skin module could be modified to allow the user to select a range of sking colours allowing a bit more flexibiliy in this module?

Anonymous 13 year
Sure, we now expose the YCrCb color values that we use to detect skin. Perhaps some fine tuning of those values will yield a better result?

See this change in 2.24.11

Note that the [variable] expression notation should work in these boxes too.


This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index