How to calculate the median and mode of an image from the histogram

2 Ansichten (letzte 30 Tage)
I have used the following code to calculate the mode
[pixelCount grayLevels] = imhist(LBP_Im);
maximum=max(pixelCount);
r=find(pixelCount==maximum);
whether this is correct to calculate the mode. Likewise I wish to know the code for calculating the median of an image

Akzeptierte Antwort

Guillaume
Guillaume am 1 Okt. 2015
Bearbeitet: Guillaume am 1 Okt. 2015
Why not simply use the mode and median function?
imgmode = mode(LBP_Im(:));
imgmedian = median(LBP_Im(:));

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by