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

조회 수: 3 (최근 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에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by