Julian Stöttinger

Skin Detection

Our proposed skin detection approach has been described and evaluated in various publications. Since it is also part of commercial software products, there is no framework available. I get a lot of emails about the code, therefore I provide some hints.

In case you want to play with it, 

1.) read

Skin Paths for Contextual Flagging Adult Videos

Julian Stöttinger, Allan Hanbury, Christian Liensberger, Rehanulla Khan, Proceedings of the 5th International Symposium on Visual Computing (ISVC), Las Vegas, NV, Nov 30 - Dec 2, 2009. [bibtex]

2.) get comfortable with handling videos (in Matlab e.g. use my pack) or just stick with images.

3.) learn how to detect faces (in Matlab e.g. use my code)

4.) Matlab pseudo code:

% create color array for the two models
modelcr = zeros(1,256);
modelcb = zeros(1,256);

% convert image to YCbCr (e.g. use this great code)
im = ycbcr(inputimage);

% get skin colors in all detected faces
for each face
cbarea += hist(facearea[]);
cbarea += hist(facearea[]);

% estimate model (hint: I use logical indexing, cbrange and crrange are the parameters from the paper)
modelcb(mean(cbarea)-cbrange:mean(cbarea)+cbrange) = 1;
modelcr(mean(crarea)-crrange:mean(crarea)+crrange) = 1;  

% apply model (result is a binary matrix where true is detected skin)
result = modelcb(im(:,:,2))) & modelcr(im(:,:,3));