Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

program for calculating skin probability not working. please help.

조회 수: 3 (최근 30일)
Nidhi
Nidhi 2012년 6월 26일
마감: MATLAB Answer Bot 2021년 8월 20일
I was making a program using gmdistribution. But, it is giving error at the gmdistribution command. I saw the algo of this on internet itself and tried it.
The program is :
frame20 = double(imread('image6.jpg'));
[rows,cols,bands] = size(frame20);
skin_detection = zeros(rows, cols);
for row = 1:rows
for col = 1:cols
red = frame20(row, col, 1);
green = frame20(row, col, 2);
blue = frame20(row, col, 3);
r = gmdistribution(red_mean, red_std, red); red_pr=pdf(r,red);
g = gmdistribution(green_mean, green_std, green) green_pr=pdf(g,green);
b = gmdistribution(blue_mean, blue_std, blue); blue_pr=pdf(b,blue);
prob = red_pr .* green_pr .* blue_pr; skin_detection(row, col)= prob;
end
end
This is giving error:
??? Error using ==> gmdistribution.gmdistribution>gmdistribution.gmdistribution at 158 The mixing proportions must be positive.
Error in ==> trial_gauss_fullimage at 51 g = gmdistribution(green_mean, green_std, green); Error in ==> trial_gauss_fullimage at 52 green_pr=pdf(g,green);
The name of my file is trial_gauss_fullimage.
In this the mean and std values of red, green and blue it calculated and these are 1*1 matrix i.e. constant one value eg. red_mean is 237.2865 and red_std is 13.8627. Same holds for red also.
I hope I have been able to explain my problem. If you can help me out it would be great.
Thanks,
Nidhi

답변 (1개)

Tom Lane
Tom Lane 2012년 6월 26일
Best to keep the discussion in a single thread here.

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by