Calculate SNR pixel-by-pixel

5 visualizaciones (últimos 30 días)
Med_Imager
Med_Imager el 9 de Mzo. de 2012
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!

Respuestas (1)

Walter Roberson
Walter Roberson el 9 de Mzo. de 2012
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)

Categorías

Más información sobre Image Segmentation and Analysis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by