0
votes

I loaded an image in Matlab which has properties:

 Name(X)   , Size (512x512)  , Bytes (262144)  , Class(uint8) ,  

I added gaussian noise and remove that noise by using wavelet transform. By doing Inverse wavelet transform I get the final output image:

Name(Xsyn) , Size (504x504)  , Bytes (2032128) , Class(Double)

Now I am trying to calculate the signal-to-noise ratio (SNR) by using

SNR = 20*log10(norm(X(:))/norm(X(:)-Xsyn(:)));

But it show the following error:

??? Error using ==> minus
Matrix dimensions must agree.

So I think I should change my matrix dimension of the final image (Xsyn). Now how can I change this matrix dimension of image Xsyn (504x504 ) to Xsyn size (512x512)?

Or is there another way to find out the SNR?

1
you need to be more specific. What was the wavelet transform you used?bla
I used db2 , Now can you answer?Afsana

1 Answers

0
votes

Given that the function you use doesn't have a handle that keeps the original size of the matrix (for instance conv2 has the option to output the same size using (conv2(Image,filer,'same')) , you can always do this quick and dirty fix:

 X=imresize(X,size(Xsyn));

and the rest will follow...