Signal-to-noise ratio color image

조회 수: 2 (최근 30일)
jack higher
jack higher 2015년 12월 16일
댓글: jack higher 2015년 12월 18일
I get a matrix image (64*64*3) and want to compute signal-to-noise. The formula is SNR=20lg(S/N). N is the noise standard deviation that I can get. But I don't know how to compute S. Should I use R,G,B channel to compute SNR and get three values? Thank you
<<
>>
  댓글 수: 1
Image Analyst
Image Analyst 2015년 12월 17일
How are you getting your noise image? Are you covering the lens and snapping a photo? Or showing it a uniform field and snapping a photo? Or both and estimating the noise as a function of intensity? Somehow you need to get a measure of the noise alone which means a photo of something uniform with no structure in the scene.

댓글을 달려면 로그인하십시오.

답변 (2개)

harjeet singh
harjeet singh 2015년 12월 16일
i hope you are using image in the format of uint8 so maximum value will be 255, in this case S=255.^2 you can use this code for psnr
image=imread('onion.png');
image=imresize(image,[64 64]);
figure(1)
imshow(image);
drawnow
image_n=imnoise(image,'salt & pepper',0.1);
figure(2)
imshow(image_n)
drawnow
I=double(image);
K=double(image_n);
[m n x]=size(I);
MSE=(I-K).^2;
MSE=sum(MSE(:))/(m*n*x)
PSNR=10*log10(255.^2/MSE)
  댓글 수: 4
Image Analyst
Image Analyst 2015년 12월 17일
Jack, you didn't see my comment did you? From just some arbitrary image, we can't produce a noise image without making some assumptions. Maybe it doesn't even have noise because it's a computer graphics synthesized image. You can't just pull noise out of a hat from some arbitrary image. In case you don't know, the standard deviation of the image values is NOT noise, contrary to what many many novices incorrectly think. Please upload your image and noise image. Otherwise I'll just say the SNR is infinite because of the lack of any information on the noise.
jack higher
jack higher 2015년 12월 18일
You mean I must know the original image? I have uploaded my image from my camera.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2015년 12월 18일
Don't you think you need some way of estimating the noise? Of course you do. How are you going to do that? Are you going to do some experiments to measure it? Or just guess? It looks like you've added an image of a "uniform" image. If you define that image to be uniform, then take the std dev and compute the mean divided by the standard deviation.

Community Treasure Hunt

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

Start Hunting!

Translated by