PIXEL counting at grey scaled picture
2 ビュー (過去 30 日間)
古いコメントを表示
DIMITRIOS ZAFEIRIOU
2022 年 1 月 24 日
コメント済み: DIMITRIOS ZAFEIRIOU
2022 年 1 月 24 日
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!![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/871795/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/871795/image.png)
0 件のコメント
採用された回答
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
2022 年 1 月 24 日
And yet another option:
brightRegions = grayImage >= 200;
numBrightPixels = nnz(brightRegions);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Histograms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!