File Exchange

image thumbnail

Skin Detection

version 1.0 (394 KB) by

Detects skin by producing a map of "skin-like" pixels within a given image.

11 Ratings



View License

This file helps identify the presence of a human face, hand or any other body part by identifying and marking skin-like pixels within a given image. With further image processing techniques, the output produced by this script can be refined and processed to be fed into larger face detection and tracking, gesture recognition, and other HCI applications.

Comments and Ratings (19)

Chen Zane

Basic function. Need to modify for my project.


Aj_ti (view profile)

So basic. Have to set skin threshold manually for different skin color.

how to call function to be the run?
i get error in :
error('usage: generate_skinmap(filename)');

Error using generate_skinmap (line 19)
usage: generate_skinmap(filename)

Nazeer ahmed

Dear vishal these both are of same color as skin you can differentiate face and hand
1:Edge 2.size, 3.Shape representation.

Waheeb Yaqub

The skin detection algorithm performance is not that good, it only depends on detection of skin in single colorspace YCbCr.

working well...

but I wanna know how to reduce noise ?

Y Simson

Y Simson (view profile)

Vishal Kumar

this is a great work but just one question...
how do we differentiate between the hand and the face or anything for that matter...please reply fast...thanks in advance..!!


Satya (view profile)


Ashwin (view profile)

Works excellently

prem preet

??? function [out bin] = generate_skinmap,C:\Users\prempreet\Desktop\major project\skin detection\nadal.jpg;
Error: Function definitions are not permitted at the prompt or in scripts.

how to remove this error .........
rply soon


kal (view profile)

rajesh sharma

what is the need of applying grayworlg algo?
why do we need illumination compensation?
without it also its workikng fine.

its working now but with some change. instead of typical syntax as follows:

function [out bin] = generate_skinmap('E:\DSP\skin detection\skin detect from net\nadal.jpg')

it is working with this:

function [out bin] = generate_skinmap, 'E:\DSP\skin detection\skin detect from net\nadal.jpg';

plz suggest why it is happening like this? brackets have to be replaced with , and ;

hello mr.gaurav,
i implemented your code n it is showing folloeing error:

??? Error: File: generate_skinmap.m Line: 1 Column: 39
Unexpected MATLAB expression.

and it says there is ),],} one of these missing....i hv chekd they r ok....please suggest what to do.....i have to implement it in my project.
thank you.


Azlan (view profile)

i changed the filename,
when i click evalute cell,nothingís happen.

what i'm doin wrong?
is there something i need to modify?

thanks in advance.

Gaurav Jain

Gaurav Jain (view profile)

Hello all,

I'd appreciate it if you can drop a line about the performance of this script for your images, and any cases that you might encounter under which the performance drops down steeply or vice versa.

Or any other functionality you'd like to see. Thanks!

MATLAB Release
MATLAB 7.10 (R2010a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today