to take histogram of image pixels

1 次查看(过去 30 天)
POOJA KJ
POOJA KJ 2015-3-13
sir, i have to Take a histogram of image pixels. I use nBins=100 equally spaced between [0,1]. can u tell the code for this

回答(1 个)

Image Analyst
Image Analyst 2015-3-13
[pixelCounts, grayLevels] = imhist(grayImage, nBins);
  2 个评论
POOJA KJ
POOJA KJ 2015-3-13
where should i specify the spacing of 100 bins from 0 to 1
Image Analyst
Image Analyst 2015-3-13
It's done automatically if grayImage is a double image, not uint8.
If you don't trust it, you can use histc()
edges = linspace(0,1,100);
counts = histc(grayImage, edges);

请先登录,再进行评论。

类别

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