Calculate SNR pixel-by-pixel

5 次查看(过去 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 CenterFile Exchange 中查找有关 Image Segmentation and Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by