how do i find maximum points between two given points of a histogram?

1 次查看(过去 30 天)
suppose there are two points a , b and i want a points which lies between these wo and having maximum value.

采纳的回答

Image Analyst
Image Analyst 2015-2-21
See this snippet:
img = uint8(randi(256, [800,600])-1); % Synthesize an image.
% Get the histogram.
[counts grayLevels] = imhist(img);
a = 4
b = 9
% Find the minimum count in the range [a,b]
minCountInRange = min(counts(a:b))
% Get a logical vector that says if the count is
% the min count value or not.
indexesWithCount = (counts == minCountInRange)
% Filter to get only those gray levels in the range [a,b]
% Now get the actual index number(s):
indexOfMin = find(indexesWithCount(a:b)) + a - 1
gls = grayLevels(indexOfMin)
% Note: gray level, say, 6 occurs at index 7 because
% a gray level of 0 starts at index 1, not index 0.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by