How to find out the different intensity values that are used in the image and make out a list of them.Then find the freq. of occurence (probability) of each of intensity values in the image?
4 ビュー (過去 30 日間)
古いコメントを表示
How to find out the different intensity values that are used in the image and make out a list of them. Then find the freq. of occurrence (probability) of each of intensity values in the image?
1 件のコメント
採用された回答
Walter Roberson
2015 年 7 月 30 日
grayImage = rgb2gray(YourImage);
[unique_vals, ~, idx] = unique(grayImage(:));
counts = accumarray(idx(:), 1);
probs = counts ./ sum(counts);
bar(unique_vals, probs);
0 件のコメント
その他の回答 (1 件)
Image Analyst
2015 年 7 月 30 日
You can use
grayImage = rgb2gray(rgbImage);
[pixelCounts, grayLevels] = imhist(grayImage);
grayLevelFrequency = pixelCounts / numel(grayImage);
It depends on what you mean by intensity or how accurate you want to be. It would be best to calibrate your system using a Color Checker Chart and then convert to LAB and take the histogram of the L channel. This is what I do, and what John suggested above. If you just want to get an idea of graylevels for thresholding or something, then you don't need to go through all that.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Modify Image Colors についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!