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."
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Image Arithmetic dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!