Mean pixel value

I need to find the mean pixel value ( mean intensity) of the entire image which is a slice obtained from CT. I have trouble when the function regionprops is used since I need to account for the entire image and not only a certain region. Is there any other function that can be used?
Thanks,

回答 (2 件)

Walter Roberson
Walter Roberson 2011 年 5 月 9 日

1 投票

mean(TheImage(:))
Swapnil Kelkar
Swapnil Kelkar 2011 年 5 月 11 日

0 投票

Thanks so much!!

2 件のコメント

Ishtiaq Bercha
Ishtiaq Bercha 2011 年 5 月 13 日
I have a similar problem. I am looking at a medical image but I want to discard the black background and look at the image in the display window. I am thinking about using a nested for loop for this purpose. However I am not sure how to determine pixel value of indiviual pixels. Here is what my code so far looks like.
for m = 1:x
for n= 1:256
if z = impixelinfo(m,n) >=1
A(m,n) = z
else continue
end
end
end
However I am getting an error on the line that determines the pixel value.
That is"if z = impixelinfo(m,n) >=1"
I will appreciate some tips.
Thanks
---Ish
Walter Roberson
Walter Roberson 2011 年 5 月 13 日
Please start a new Question for this issue.

サインインしてコメントする。

質問済み:

2011 年 5 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by