How to calculate pixel with same gray value are labeled with same number,for each kernal in the image?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Akshay Gore
el 16 de Dic. de 2013
Comentada: Image Analyst
el 16 de Dic. de 2013
How to calculate pixel with same gray value are labeled with same number,for each kernal in the image?
0 comentarios
Respuesta aceptada
Image Analyst
el 16 de Dic. de 2013
I have no idea what you mean so all I can suggest is this: http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer
You did not attach your image so I can't imagine what "each kernal in the image" means. Are you analyzing popcorn? And if your image is already labeled so that each blob has it's own unique ID number (label) then what does "calculate pixel" mean ? What is there to calculate???
2 comentarios
Image Analyst
el 16 de Dic. de 2013
You can do this with conv2() and stdfilt() in the Image Processing Toolbox to get mu and sigma in a sliding 3*3 window.
meanImage = conv2(double(y), ones(3)/9, 'same');
stdDevImage = stdfilt(double(y), ones(3));
zImage = (y - meanImage).^2 ./ (2*stdDevImage .^ 2);
firstSum = sum(zImage(:))
logSigmaImage = log(stdDevImage);
secondSum = sum(logSigmaImage(:))
I'm not exactly sure what x is. I don't know if it's the pixel value in the window (essentially the same as y), or if you have a labeled matrix calculated in advance. Can you explain more about x?
Más respuestas (0)
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!