Info
This question is closed. Reopen it to edit or answer.
Hi I'm trying to execute a program but I keep getting this error: "Attempted to access y(1,207); index out of bounds because size(y)=[154,206,1]. but I'm not able to fix it, I need some help. Here is the code with the error:
1 view (last 30 days)
Show older comments
a=imread('images (9).jpg'); d=imread('images (8).jpg'); N = size(a); %convert image into double x=im2double(a); y=im2double(d); %Now calculate MSE then PSNR for a original and encrypted image acc = 0;
for k1=1:N(1) for k2=1:N(2) acc = acc+ ( x(k1,k2) - y(k1,k2) )^2; end end mse = acc/(N(1)*N(2)) %calculate psnr for the original and encrypted image psnr = 10*log10((255^2)/mse) RMSE = sqrt(mse)
1 Comment
Jonathan Campelli
on 10 Apr 2015
Hello Priyank,
If you attach the two image files you've references in your code, I can be of more help.
-Jonathan
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!