필터 지우기
필터 지우기

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)

Community Treasure Hunt

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

Start Hunting!

Translated by