how to calculate intensity

3 次查看(过去 30 天)
I really appreciate your help and I would be so grateful if you help me with this?,
how to calculate, the difference between the number of pixels in a block and the ratio of the sum of pixel intensities in the block to the maximum in the block
i wanted to substitute the values in the equation in the link below.....
please do reply.....

采纳的回答

Walter Roberson
Walter Roberson 2013-2-6
I = rgb2gray( im2double( YourImage) );
T = M(x : x+M-1, y : y+M-1);
sum(T(:))
max(T(:))
and I'll leave you to work out the ratio.
  9 个评论
Image Analyst
Image Analyst 2013-2-9
编辑:Image Analyst 2013-2-9
Of course you could do this all in one to three lines with a vectorized approach using conv2() and imdilate(), like this (untested):
blurredImage = -conv2(yourImage, ones(M)/M^2, 'same') + M^2;
maxImage = imdilate(yourImage, true(M));
BDIP = blurredImage ./ maxImage;

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by