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

7 次查看(过去 30 天)
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

采纳的回答

Guillaume
Guillaume 2015-10-1
编辑:Guillaume 2015-10-1
Why not simply use the mode and median function?
imgmode = mode(LBP_Im(:));
imgmedian = median(LBP_Im(:));

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Filtering and Enhancement 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by