Image Intensity

163 vues (au cours des 30 derniers jours)
M@lik Ali
M@lik Ali le 4 Juin 2012
Commenté : Image Analyst le 10 Juin 2021
Hi all, Can any one tel me the command in matlab to calculate the intensity of image.
  2 commentaires
Jean
Jean le 5 Juil 2013
Does anyone further know how to do this for a specific area of pixels? For example, image(100:1:200,100:1:200) for a 100 by 100 pixel area, and get the intensity in this area as an average?
Image Analyst
Image Analyst le 5 Juil 2013
Modifié(e) : Walter Roberson le 11 Fév 2014
meanGrayLevel = mean2(yourImage(100:200,100:200));
Don't use "image" as the name of your variable since it's a function.

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 4 Juin 2012
The mean of a particular pixel is just simply the pixel value, since there is only one sample - nothing really to take the mean of:
intensityValue = grayImage(100, 230);
meanIntensityValue = mean(grayImage(100, 230));
Here, of course meanIntensityValue will equal intensityValue.
To get the mean of all the pixel values in the entire image, you can do any of these:
meanIntensityValue = mean2(grayImage);
meanIntensityValue = mean(grayImage(:));
meanIntensityValue = mean(mean(grayImage));
  13 commentaires
Walter Roberson
Walter Roberson le 9 Juin 2021
If you are using a grayscale image in which the values are "brightness" (as opposed to something like Hue), then the real unit would be closer to "brightness per pixel^2". Summing that over a number of pixels in a row or column would give you "brightness per pixel^2 * pixels" which would be "brightness per pixel".
... Brightness would not be the real physical unit. Eyes do not perceive brightness in a linear manner. https://www.pathwaylighting.com/products/downloads/brochure/technical_materials_1466797044_Linear+vs+Logarithmic+Dimming+White+Paper.pdf
"Approximate perceived brightness = sqrt(measured brightness)"
I just woke up, and digging into luminance and chromaticities and transfer functions this early in my day is making my brain hurt. @Image Analyst studied those things, so he would be in a much better position to talk about what the real physical units would be.
Image Analyst
Image Analyst le 10 Juin 2021
The usual nomenclature of your vertical profile (the image summed horizontally across columns) is "integrated gray value" and it will have units of gray levels. For a standard digital camera which measures illuminance Lux or irradiance (watts per square meter), the units of gray level correspond to units of energy (Joules).
(watts/m^2) * (area of pixel in m^2) * (seconds of exposure time) = joules.
Note that watts = joules/second so everything cancels out except for joules.
Note: units prefixed with "Phot" or "Lum" (like illuminance) refer to radiation in the visible range 400-700 nm. If it doesn't have a prefix or has "rad" prefix (like irradiance), then it applies to all energy across the whole electromagnetic spectrum.

Connectez-vous pour commenter.

Plus de réponses (4)

swetha Derangula
swetha Derangula le 5 Août 2017
Modifié(e) : Walter Roberson le 5 Août 2017
Is this code correct for entire image intensity? I didn't get any intensity value
clear all;
close all;
o=imread('450.jpg');
i=rgb2gray(o);
imshow(i)
intensityValue = i(100, 230);
meanIntensityValue = mean(mean(i));
please suggets me
  2 commentaires
Walter Roberson
Walter Roberson le 5 Août 2017
No code that contains "clear all" can be correct.
Your line
intensityValue = i(100, 230);
extracts one particular pixel's intensity, and only that one pixel. However,
meanIntensityValue = mean(mean(i));
should be fine for taking the mean intensity of the entire image.
Image Analyst
Image Analyst le 6 Août 2017
You could also use mean2().

Connectez-vous pour commenter.


Adina Stoica
Adina Stoica le 4 Juin 2012
Well, the intensity of the image is the average of the intensities of all pixels in an image (unless you're doing anything more specific than that). So if you do
mean(imagefile(:))
you should get the intensity of the image.
  1 commentaire
M@lik Ali
M@lik Ali le 4 Juin 2012
Modifié(e) : Walter Roberson le 11 Fév 2014
Adina thanks for your response,
But actually i want to calculate the intensity value of all elements of the images.
someone told me like
intensityValue = grayImage(100, 230);
But in i have to calculate the intensity value of each pixel or total image, i think i can do it by calculating the intensity of each pixel and then add it but i am not sure.
Kindly help me about it..

Connectez-vous pour commenter.


Saranya
Saranya le 30 Jan 2014
hi image analyst i want to measure the intensity profile for gray scale image.. can you help me..?
  18 commentaires
Rasika Devi
Rasika Devi le 21 Mar 2017
Modifié(e) : Rasika Devi le 21 Mar 2017
Thank you so much sir.. One more thing from that weight value,how do i perform the image segmentation by using any algorithm? kindly help me...
Walter Roberson
Walter Roberson le 21 Mar 2017
I suggest you look in the File Exchange, for Image Analyst's Image Segmentation Tutorial

Connectez-vous pour commenter.


Syakira Akmal
Syakira Akmal le 3 Avr 2017
May I know how to convert intensity of image inform of histogram?
  1 commentaire
Image Analyst
Image Analyst le 3 Avr 2017
[counts, grayLevels] = imhist(grayImage);

Connectez-vous pour commenter.

Catégories

En savoir plus sur Lighting, Transparency, and Shading dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by