Addition of all pixel values in image

6 visualizzazioni (ultimi 30 giorni)
Tricky
Tricky il 6 Nov 2011
hi.. How to add all pixel values in a image?

Risposte (1)

Walter Roberson
Walter Roberson il 6 Nov 2011
sum(YourImage(:))
I wonder, though, whether you really want to do that for RGB images? The sum per layer would tend to make more sense. That or converting the image to grayscale and summing the grayscale values.
Warning: your total is going to come out very different depending on whether the image is represented as floating point or uint8 or uint16. And if your image is pseudo-color, you would need to convert to RGB before you did the addition.

Categorie

Scopri di più su Convert Image Type in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by