Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

program for calculating skin probability not working. please help.

3 vues (au cours des 30 derniers jours)
Nidhi
Nidhi le 26 Juin 2012
Clôturé : MATLAB Answer Bot le 20 Août 2021
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

Réponses (1)

Tom Lane
Tom Lane le 26 Juin 2012
Best to keep the discussion in a single thread here.

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by