PIXEL counting at grey scaled picture
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
DIMITRIOS ZAFEIRIOU
am 24 Jan. 2022
Kommentiert: DIMITRIOS ZAFEIRIOU
am 24 Jan. 2022
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!
0 Kommentare
Akzeptierte Antwort
KALYAN ACHARJYA
am 24 Jan. 2022
Bearbeitet: KALYAN ACHARJYA
am 24 Jan. 2022
%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(:))
Weitere Antworten (1)
Image Analyst
am 24 Jan. 2022
And yet another option:
brightRegions = grayImage >= 200;
numBrightPixels = nnz(brightRegions);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!