Azzera filtri
Azzera filtri

How to find energy of the image

7 visualizzazioni (ultimi 30 giorni)
aarti sawant
aarti sawant il 3 Feb 2014
Modificato: Image Analyst il 3 Feb 2014
Please help me to find energy of the image given by equation,
E(x) = for i=1 to x (p(x))

Risposte (1)

Image Analyst
Image Analyst il 3 Feb 2014
What is p? The units of images are gray levels, and gray levels are units of energy (joules). Why? Well because you have radiation falling on a sensor. That's watts per square meter or joules per second per square meter. But the sensor has an area and it collects photons for a limited time so you multiply by the area of the pixel and the integration time of the pixel and you get joules. So to get the energy in an image you have to sum up all the gray levels.
totalEnergy = sum(imageArray(:));
What is x and p in your equation? Why is E a function of x (whatever x is)?
  7 Commenti
Dishant Arora
Dishant Arora il 3 Feb 2014
h you calculated above in turn comes out to be PDF, it's quite obvious that you will get 1 as answer by summing up h. As mentioned earlier by Image analyst you can simply add up all the pixel values in image to get the energy, why complicate it
Image Analyst
Image Analyst il 3 Feb 2014
Modificato: Image Analyst il 3 Feb 2014
Plus those for loops aren't needed and nullifying zeros in h isn't needed. You could do this:
zeroPixelLocations = (a == 0); % Find all zeros.
a(zeroPixelLocations ) = 1; % Set to 1 instead of 0.
h = imhist(a, 256);
h = h / numel(a); % a must be grayscale if you use numel.
E = sum(h(:))

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by