how do i find maximum points between two given points of a histogram?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
user06
el 21 de Feb. de 2015
Respondida: Image Analyst
el 21 de Feb. de 2015
suppose there are two points a , b and i want a points which lies between these wo and having maximum value.
0 comentarios
Respuesta aceptada
Image Analyst
el 21 de Feb. de 2015
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!