how to Matlab function to calculate probability density function of n image?

I want to calculate the probability density function of an image. can you tell me what is the matlab function

 Akzeptierte Antwort

Image Analyst
Image Analyst am 27 Jun. 2014
Assuming you mean the pdf of gray levels, use imhist().

4 Kommentare

yes, pdf of gray levels
can you explain how to get the probability density function of an image in matlab once i have used the imhist() function? I tried this way:
[counts,binLocations] = imhist(image);
pdf=counts/numel(image);
figure
imshow(pdf);
Thank you
pdf is not an image so you don't use imshow(). It's a vector so use plot() or bar():
plot(binLocations, pdf, 'b-', 'LineWidth', 2);
grid on;
Thank you for your help!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by