How to calculate the mean of an image?
96 次查看(过去 30 天)
显示 更早的评论
How to calculate the mean of an image? Does the code mean2(img) give the right result?
0 个评论
采纳的回答
Image Analyst
2015-2-16
To calculate the mean of all pixels in the image, without regard to what color channel they came from (if it's a color image), you do
meanIntensity = mean(img(:));
What you did will not do it, as I'm sure you found out.
2 个评论
Image Analyst
2015-2-16
It could be the same if the image was gray since the blue and green channel would be identical to the red channel. It would also be the same for lots of other cases, like where the green and blue channels are scrambled (spatially rearranged) versions of the red channel since they would have the same pixel values regardless of how they're rearranged.
更多回答(1 个)
Rashmi.D Jeya kumar
2018-1-8
meanval = mean2(I) you can get mean value of an image
3 个评论
Image Analyst
2018-6-13
Why does that mean anything is wrong? Maybe you took a bunch of photos through a microscope and they all have the same mean brightness (or really close to each other). Doesn't seem inherently unusual to me. Why do you think it indicates something is wrong?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!