skin detection by BP
이전 댓글 표시
Hi all Kindly i implement below code for RGB skin color detection , 3 input vectors RGB ,1 output vector ( 0 non - skin , 1 skin ) but the outcomes doesn't satisfy me, does NN not trained well or i have wrong , i really appreciate your help
% p=[119 88 82 204 10;79 59 73 150 10 ;53 55 68 103 20 ];
t=[1 1 1 1 0];
net=newff([0 255 ; 0 1],[5,1],{'logsig' 'tansig'});
net.numInputs = 3; % set number of inputs
net.inputs{1}.size = 1; % assign 2 to input size
net.inputs{2}.size = 1;
net.inputs{3}.size = 1;
net.trainParam.show=1;
net.trainParam.epochs=1000;
net.trainParam.goal=0.001;
net.trainParam.lr=0.1;
[net,tr]=train(net,p,t);
im=imread('./test3.jpg');
h=size(im,1);
w=size(im,2);
r=im(:,:,1);
g=im(:,:,1);
b=im(:,:,1);
r=double(reshape(r,1,h*w));
g=double(reshape(g,1,h*w));
b=double(reshape(b,1,h*w));
y=sim(net,[r;g;b]);
y=double(reshape(y,h,w));
imshow(y);
댓글 수: 2
Walter Roberson
2013년 10월 21일
편집: Walter Roberson
2013년 10월 21일
What is "BP" in your Title ?
Have you considered feeding it more examples of non skin tones? Skin tones do not fall into a nice RGB or HSV subsection, so to do a good job you need enough examples near the boundaries (on both sides) for it to be able to deduce where the boundaries are.
Yasir
2013년 10월 21일
채택된 답변
추가 답변 (1개)
Image Analyst
2013년 10월 21일
1 개 추천
Walter is right. The gamut for skin color does not fall nicely into a region in any colorspace that can be segmented nicely by thresholding. For all skin tones that you encounter, the gamut is banana or boomerang shaped. For any one individual you might be able to threshold and get their skin but it will work only for that one individual, not for any arbitrary individual of any race and any color of lighting and any level of exposure. For that you will need more sophisticated algorithms to carve out the skin gamut's true shape from the total possible gamut. But I don't know neural networks so I can say anything about what you are doing. It seems reasonable that if you were to train a NN on one image and then test it on the same image, it should get the skin. Greg Heath will probably respond to your NN question shortly.
카테고리
도움말 센터 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!