to take histogram of image pixels
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
Image Analyst
2015-3-13
[pixelCounts, grayLevels] = imhist(grayImage, nBins);
2 个评论
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 Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!