How to implement gray level probability density function?

18 visualizaciones (últimos 30 días)
chitresh
chitresh el 18 de Feb. de 2014
Respondida: Image Analyst el 18 de Feb. de 2014
the gray-level probability density function given as P(g) = h(g)/M, where h(g) is the number of pixels with gray level g and M is the total number of pixels in the image.
I want to implement this on a gray scale image, my question is what is h(g) in my case and what are gray level g... i know M is (row*colum) please answer

Respuesta aceptada

Image Analyst
Image Analyst el 18 de Feb. de 2014
% Get histogram:
[pixelCounts, grayLevels] = imhist(grayImage);
% Computer probability density function:
pdf = pixelCounts / numel(grayImage);

Más respuestas (1)

Dishant Arora
Dishant Arora el 18 de Feb. de 2014
you can use built in function imhist.

Categorías

Más información sobre Get Started with Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by