How can I create a variable changing with index number?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Mahmoud
le 16 Nov 2013
Réponse apportée : Image Analyst
le 16 Nov 2013
how can I create a variable N such that it's value changing with the index and then do the summation, i.e:
∑_Ni from i=0 to i=255 ,
where Ni is the number of pixels that have intensity value Ri
For knowledge, I have an image with its histogram.
0 commentaires
Réponse acceptée
Image Analyst
le 16 Nov 2013
You can do
i = 0:255;
though you don't need to do that to take the sum. To sum the histogram of the image you can do
[pixelCounts, grayLevels] = imhist(grayscaleImage);
theSum = sum(pixelCounts(:));
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Image Filtering and Enhancement dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!