Calculate SNR pixel-by-pixel

1 回表示 (過去 30 日間)
Med_Imager
Med_Imager 2012 年 3 月 9 日
I am trying to figure out the Signal to Noise Ratio (SNR) in an image matrix (64x64x16). (called Image_Matrix_3D in the code)
The SNR = mean signal / stdev
However, I need to compute this pixel by pixel wise. so I need the mean signal in each pixel for each slice and the stdev in each pixel for each slice.
The code should look something like the following I think. However, it doesn't look entirely correct. Also I get the stdev to be zero.
for i=1:64
for j=1:64
for k=1:N
m(i,j,k) = mean(Image_Matrix_3D( i,j, k),[3]);
stdev(i,j,k)= std(m( i,j, k));
end
end
end
If anyone on Matlab Central is familiar with this type of analysis, can you please help?
Thanks!

回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 3 月 9 日
The standard deviation of a single value is always 0.
You need be applying mean() and std() to the same vector of values. "vector" is a key term here.
Hint:
pixelvector = squeeze(Image_Matrix_3D(i,j,:));
mean(pixelvector)
std(pixelvector)

カテゴリ

Help Center および File ExchangeImage Processing and Computer Vision についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by