how to find intensity of a gray image?

22 views (last 30 days)
how to find intensity of a gray image?
  1 Comment
Prashanth J
Prashanth J on 10 Mar 2023
Hi. You posted the solution to your problem in the following link.
The link is not working now. Can you please share the same if you have a copy.
Thank you

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 4 May 2013
It depends on what you mean by intensity. I know you've been working, and instructing students at your university, long enough in the image processing field that you know how to take a histogram:
% Let's compute and display the histogram.
[pixelCount, grayLevels] = imhist(grayImage);
subplot(2, 2, 2);
bar(pixelCount);
grid on;
title('Histogram of original image', 'FontSize', fontSize);
xlim([0 grayLevels(end)]); % Scale x axis manually.
and I know that you know how to get the overall mean of the image:
meanGrayLevel = mean2(grayImage);
I know you already know all that. So now we need to have you explain what you mean by "intensity". What you (and most others) may not know is that the units of a standard optical image are NOT intensity. They're lumens-seconds, a form of visible energy. Why? Think of lumens like watts, but just in the visible wavelength. So it's like energy per second. Because you have Lux (lumens per square meter) at the sensor (CCD), and you integrate that over the area (square meters) of a pixel and over time (seconds), then the units are lumen-seconds, kind of like a visible energy. See this for further discussion.
Now, intensity is an SI base unit along with meter, second, ampere, kelvin, mole, and kilogram. Its units are candela. You can not get the luminous intensity of an image - it doesn't make sense. It is a characteristic of the light source, not a surface with light incident on it. Wikipedia goes into a great amount of detail on all these units.
Anyway, we're back to what you mean by intensity. The mean gray level and histogram are too trivial (and you already know those), so please explain exactly what you mean.
  7 Comments
Sivakumaran Chandrasekaran
declare FontSize variable at the beginning itself
Image Analyst
Image Analyst on 28 Aug 2019
And, of course, you'll also need to create the grayImage variable. Usually with imread(), like
grayImage = imread(fullFilename);
where you also have to create fullFileName before that by assigning it to the name of your file, like
fullFileName = c:\whatever\myRGBimage.png' % or whatever it is.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!