PIXEL counting at grey scaled picture

1 次查看(过去 30 天)
I have a picture which is greyscaled and i want to count the number of pixels from 200-255( the bright ones) from the histogram.Any ideas about the coding or other way? Thank you!

采纳的回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2022-1-24
编辑:KALYAN ACHARJYA 2022-1-24
%Using Histogram (Considering 256 Levels)
[counts,binLocations]=imhist(grayImage);
pix_counts=sum(counts(200:end))
##
%% 2nd Method, easier
high_pix=grayImage>199;
pix_counts=sum(high_pix(:))

更多回答(1 个)

Image Analyst
Image Analyst 2022-1-24
And yet another option:
brightRegions = grayImage >= 200;
numBrightPixels = nnz(brightRegions);

类别

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