How can i plot Histogram for this??

1 次查看(过去 30 天)
How can i plot histogram for an image with 3 bins, where the bins holds the pixel values falling in the region 0-40, 41-90, 91-255. Also how can i write these stats, as in the number of pixels in each of those regions. Plz Help ?

采纳的回答

Image Analyst
Image Analyst 2015-7-21
Try
edges = [0,41,91,255];
pixelCounts = histcounts(grayImage(:), edges);
  4 个评论
Steven Lord
Steven Lord 2015-7-21
Or call HISTOGRAM instead of HISTCOUNTS. If you want both the counts and the graphics object, call HISTOGRAM with an output argument and take a look at the properties of that graphics object.

请先登录,再进行评论。

更多回答(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