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 で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!