Effacer les filtres
Effacer les filtres

how to calculate intensity

3 vues (au cours des 30 derniers jours)
Elysi Cochin
Elysi Cochin le 6 Fév 2013
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.....

Réponse acceptée

Walter Roberson
Walter Roberson le 6 Fév 2013
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 commentaires
Elysi Cochin
Elysi Cochin le 9 Fév 2013
thank u sir...
Image Analyst
Image Analyst le 9 Fév 2013
Modifié(e) : Image Analyst le 9 Fév 2013
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;

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings 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