close all;
clear all;
figure
imshow(image)
figure
imhist(image)
for k = 1:w
for i = 1:u
for j = 1:v
threebyone = mod(matrixA * [i; j; k], 256);
shuffled(threebyone(1,1) + 1, threebyone(2,1) + 1,
mod(threebyone(3,1),w) + 1) = image (i,j,k);
end
end
end
%threebyone
%figure
%imshow(shuffled)
%----------------------ARNOLD CAT MAP ENDS-----------------------%
%----------------------CHAOTIC MAP-------------------------------%
R1 = shuffled(:,:,1); % Red channel
G1 = shuffled(:,:,2); % Green channel
B1 = shuffled(:,:,3); % Blue channel
R1 = de2bi(R1);
G1 = de2bi(G1);
B1 = de2bi(B1);
chaotic = de2bi(chaotic);
em = bitxor(R1, chaotic);
%to make it into a 1D matrix from 2D of [65536,8]
reshape(em,[65536*8, 1]);
%converting the 65536*8 binary matrix into a*b matrix after intialisation
ei = zeros(u, v, 'uint8');
count = 1;
for index = 1 : 8 : 256*256*8
substring = em(index:index+7);
substring = num2str(substring);
ei(count) = bin2dec(substring);
count = count+1;
end
R2 = ei;
em = bitxor(G1, chaotic);
%to make it into a 1D matrix from 2D of [65536,8]
reshape(em,[65536*8, 1]);
%converting the 65536*8 binary matrix into a*b matrix after intialisation
ei = zeros(u, v, 'uint8');
count = 1;
for index = 1 : 8 : 256*256*8
substring = em(index:index+7);
substring = num2str(substring);
ei(count) = bin2dec(substring);
count = count+1;
end
G2 = ei;
em = bitxor(B1, chaotic);
%to make it into a 1D matrix from 2D of [65536,8]
reshape(em,[65536*8, 1]);
%converting the 65536*8 binary matrix into a*b matrix after intialisation
ei = zeros(u, v, 'uint8');
count = 1;
for index = 1 : 8 : 256*256*8
substring = em(index:index+7);
substring = num2str(substring);
ei(count) = bin2dec(substring);
count = count+1;
end
B2 = ei;