compare the levels of gray
1 view (last 30 days)
Show older comments
Could you tell me how to compare the levels of gray between several photographs and show (increase)it on the graph ? By histogram ?
0 Comments
Accepted Answer
Image Analyst
on 4 Jan 2015
See this snippet
% Let's compute and display the histogram.
[pixelCount, grayLevels] = imhist(grayImage);
bar(grayLevels, pixelCount);
grid on;
title('Histogram of image', 'FontSize', 22);
xlim([0 255]); % or 65535 if image is uint16
% Compute and display mean
meanGrayLevel = mean2(grayImage);
message = sprintf('The mean gray level is %.2f', meanGrayLevel);
uiwait(helpdlg(message));
0 Comments
More Answers (0)
See Also
Categories
Find more on Histograms in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!