I am trying to shuffle the pixels of an image using chaotic standard map.But I got an error "Subscript indices must either be real positive integers or logicals."
Ältere Kommentare anzeigen
I am trying to shuffle the pixels of an image using chaotic standard map by modifying the code in the link https://in.mathworks.com/matlabcentral/answers/uploaded_files/16542/ChaoticEncyption.m .But I got an error "Subscript indices must either be real positive integers or logicals."
% clear all
clc
g=double(imread('rice.png'));
g=double(g)/255;
subplot(221)
imshow(g)
x=g;
[m,n]=size(g);
mo=m;
K=6;
for i=1:m
for j=1:n
r = mod([(i+j),(j+K*sin(((i+1)*n)/2*pi))],mo);
ggg(i,j)=g(r(1)+1,r(2)+1)
end
end
g=ggg;
subplot(222)
imshow(g,[])
Please help me in this regard.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Image Arithmetic finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!