function detectSkin(filename, r_range, g_range)


im=imread(filename); 


im1=double(im);
R = im1(:,:,1);
G = im1(:,:,2);
B = im1(:,:,3);
I = R+G+B;
I(find(I==0))=Inf;
r = R./I;
g = G./I;
b= B./I;

skin=((g>g_range(1)) & (g<g_range(2)) &(r>r_range(1)) & (r<r_range(2)));
subplot(1,2,1);imshow(im);
subplot(1,2,2);imshow(skin);