compare the levels of gray

1 view (last 30 days)
Justyna
Justyna on 4 Jan 2015
Answered: Image Analyst on 4 Jan 2015
Could you tell me how to compare the levels of gray between several photographs and show (increase)it on the graph ? By histogram ?

Accepted Answer

Image Analyst
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));

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!