can i get the matlab code for scrambling a digital image based on arnold transformations??

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

4 件のコメント

namita chandrakar
namita chandrakar 2014 年 11 月 23 日
I tried your code but its seems like its not working. Its giving error of "Attempted to access iscram(0,0); index must be a positive integer or logical.
Error in ==> iscram(i,j)=iscram(mod(i+j,N),mod(i+(2*j),N)); "
how can i solve this error ??
add a 1 to both the coordinates after the mod
mamoona
mamoona 2024 年 1 月 31 日
hey! do you have the matlab code for image scrambling and unscrambling using arnold cat map? i am working on colored images.
Image Analyst
Image Analyst 2024 年 1 月 31 日
@mamoona, yes I do. Did you look at my answer below? The code is attached.

サインインしてコメントする。

 採用された回答

Image Analyst
Image Analyst 2014 年 11 月 23 日
編集済み: Image Analyst 2016 年 12 月 30 日

1 投票

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.

16 件のコメント

namita chandrakar
namita chandrakar 2014 年 11 月 26 日
hello sir, can u please explain me what is arnold transformation?
Thorsten
Thorsten 2014 年 11 月 26 日
google: Arnold Transform Based Image Scrambling Method
Yash
Yash 2015 年 1 月 13 日
can you please send code for obtaining original image from scrambled image?
Image Analyst
Image Analyst 2015 年 1 月 13 日
Here's one, attached, but it's very simple - not the "Arnold Transform" one.
Yash
Yash 2015 年 1 月 14 日
thank you very much
Pradeep  Kumar
Pradeep Kumar 2015 年 9 月 30 日
how can i apply inverse arnold transform on transformed image?? any matlab code?????
cathrin philo
cathrin philo 2016 年 2 月 4 日
how can i obtain original gray image from scrambled gray image?
Walter Roberson
Walter Roberson 2016 年 2 月 4 日
catherine, you apply the transform enough more times in a row that eventually the pixels move back to the original location.
Veera Kalyani S
Veera Kalyani S 2016 年 12 月 30 日
the code given above is only for square image right?? But i'm getting output for 135*298 image also...
Image Analyst
Image Analyst 2016 年 12 月 30 日
I redid that code I posted, now that I understand it a little more, and a "fixed" version is attached. From Wikipedia, it seems that the code only works on square images. I tried to generalize it for rectangular images and always got the image wrapped around vertically. It never reconstituted itself. So maybe you'll have to use other scrambling methods.
Hyelda Kefas
Hyelda Kefas 2018 年 2 月 19 日
Good day sir!!! Please sir i tried modifying the attached code above to read in two images that is the Original image and the Key image in the case of encryption then the scrambling and unscrambling procedures to get back the original image using Arnold's cat map but i keep getting errors. Please i need further help on it. Thanks for always being there for us.
PRAVIN M
PRAVIN M 2019 年 11 月 6 日
編集済み: PRAVIN M 2019 年 11 月 6 日
Hi,
inverse of matrix[1 1;1 2]--> [2 -1; -1 1] doesnot work for inverse arnold
is there any code for inverse arnold transform
Image Analyst
Image Analyst 2019 年 11 月 6 日
I don't think directly. The only way I know of is to repeatedly do the transform over and over again until you get the original image back. Why do you want to use this cat transform anyway?
Sunita Pradhan
Sunita Pradhan 2022 年 4 月 23 日
if u have code for dwt for watermarking then please help
Vivek
Vivek 2022 年 10 月 20 日
This code is working only those images which are in image toolbox but if we put an image like LEENA or Baboon it shows an error that N which is N> maxallowablesize is unrecognized variable. Anybody can help me bcz we have to test our encryption result on Baboon, Leena, Camerman because they are general image. So please help me what do I change in my code after sending Lena's picture to that Image toolboox folder.
Image Analyst
Image Analyst 2022 年 10 月 20 日
@Vivek You forgot to attach your image! Probably because you've never see posting guidelines:
I'll check back later for your image that the code throws an error for.

サインインしてコメントする。

その他の回答 (1 件)

Manpreet
Manpreet 2015 年 5 月 1 日

0 投票

I am doing a project on Image watermarking using Discrete Wavelet Transform(DWT) and Encryption. It is carried out in the following steps 1.) Select the host image( Image in which watermark will be hided). 2.) Select the watermark. 3.) Encrypt the watermark using the following code as given by sir(Image analyst) 4.) Watermarking using DWT.
5.) Recover the Encrypted watermark using recovery formula.
6.) Decryption of watermark using the following code which is also attached. This is also given by Image Analyst
My Question is that I have made many attacks on Watermarked Image like Rotation, Scaling, Croping but PSNR and MSE between (Watermark and Decrypted watermark) after and before attack remain Infinity and Zero respectively.
I think During Decryption, I have used same ran permutation that I used to ENCRYPT the image. So I think, Attacks have no effect on decrypted image.
Question is how to improve my code or what suggestions you can give me.
I need Help. Though, I am trying but yr valuable suggestions can make code more effective and fast
Thanks............

7 件のコメント

Image Analyst
Image Analyst 2015 年 5 月 1 日
What does this have to do with the original topic of scrambling via Arnold Transform???? How is this an answer to that????
Manpreet
Manpreet 2015 年 5 月 1 日
#Here are the Attached files to make my above question more understandable
<<
>> #Even after these croping/noise attacks there comes no difference between watermark image and decrypted image???????????
Image Analyst
Image Analyst 2015 年 5 月 1 日
How does this answer sumaya's question at the top of this page?????
Walter Roberson
Walter Roberson 2015 年 5 月 4 日
Manpreet you need to move your material here into a new Question. It is out of place here and probably no-one will even read it carefully until you create a new Question for it.
iron man
iron man 2016 年 7 月 28 日
manpreet , could u please help me ..i m having a same problem with using RSA in watermarking.
Walter Roberson
Walter Roberson 2016 年 7 月 28 日
Discussion of RSA or any other non-trivial encryption is not permitted here due to the laws of the USA.
Sunita Pradhan
Sunita Pradhan 2022 年 4 月 23 日
Any body having dwt code for watermarking please help

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by