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)
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)

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!