MATLAB: Can i get the matlab code for scrambling a digital image based on arnold transformations?

arnold transformarnold's cat mapcat mapimage processingImage Processing Toolbox

clc;
clear all;
close all;
A = imread('cameraman.tif');
imshow(A);
N=256;
T=1.4938*N+40.8689;
disp(T);
t=0;
T2=ceil(T);
disp(T2);
c=[T];
iscram=A;
while t<T2
for i=[0:N-1]
for j=[0:N-1]
iscram(i,j)=iscram(mod(i+j,N),mod(i+(2*j),N));
end
end
t=t+1;
end
figure,imshow(imscram);

Best Answer

I don't really know what this code is doing or if I'm even doing it correctly, but here's a version of the code that "works": [OLD CODE DELETED]
[EDIT] - See vastly improved working code in my comment further down, and also attached here.
Related Question