RGB = imread( 'd:\02.jpg'); I=double(RGB); W=size(I,2); H=size(I,1); cform = makecform('srgb2lab'); lab = applycform(RGB,cform); b=lab(:,:,2); [SkinIndexRow,SkinIndexCol] =find(127<b);> clear b; SN=zeros(H,W); for ind=1:length(SkinIndexRow) i= SkinIndexRow(ind); j= SkinIndexCol(ind); SN(i,j)=1; end clear SkinIndexCol; clear SkinIndexRow; L = bwlabel(SN,8); BB = regionprops(L, 'BoundingBox'); bboxes= cat(1, BB.BoundingBox); lenRegions=size(bboxes,1); rgb=label2rgb(L); figure,imshow(rgb); title('face candidates'); drawnow; pause(.1);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)