How to find energy of the image

7 次查看(过去 30 天)
Please help me to find energy of the image given by equation,
E(x) = for i=1 to x (p(x))

回答(1 个)

Image Analyst
Image Analyst 2014-2-3
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 个评论
Dishant Arora
Dishant Arora 2014-2-3
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 2014-2-3
编辑:Image Analyst 2014-2-3
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(:))

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Get Started with Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by