How do I find the maximum and minimum of a histogram in MATLAB?
20 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I want to find max and min of a histogram in matlab please advise me. thanks
4 Kommentare
dpb
am 29 Jul. 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.
Antworten (4)
Image Analyst
am 29 Jul. 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
am 25 Okt. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!