How do I find the maximum and minimum of a histogram in MATLAB?
20 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to find max and min of a histogram in matlab please advise me. thanks
4 commentaires
dpb
le 29 Juil 2013
Again, too nebulous. What do you mean "maximum value of the intensity axes"?
You mean the maximum bin count? If so, if you used either hist or histc then it's just max|min on the returned counts vector.
If something else, explain what.
Réponses (4)
Image Analyst
le 29 Juil 2013
[pixelCounts, grayLevels] = imhist(grayImage);
minGrayLevel = min(grayImage(:));
maxGrayLevel = max(grayImage(:));
% or
minGrayLevel = find(pixelCounts > 0, 1, 'first');
maxGrayLevel = find(pixelCounts > 0, 1, 'last');
minCounts = min(pixelCounts(:));
maxCounts = max(pixelCounts(:));
Oliver Herbage
le 25 Oct 2016
Using the function 'histogram.m' H = histogram(X) will plot a histogram and return details to 'H'
'H.Values' returns a vector of the values from these details and the max and min functions can then be used on this to obtain the max and min of the histogram (e.g. 'max(H.Values)' and 'min(H.Values)')
0 commentaires
Voir également
Catégories
En savoir plus sur Data Distribution Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!