arnold(猫脸变换).ppt

上传人:小飞机 文档编号:6501716 上传时间:2023-11-07 格式:PPT 页数:14 大小:658.50KB
返回 下载 相关 举报
arnold(猫脸变换).ppt_第1页
第1页 / 共14页
arnold(猫脸变换).ppt_第2页
第2页 / 共14页
arnold(猫脸变换).ppt_第3页
第3页 / 共14页
arnold(猫脸变换).ppt_第4页
第4页 / 共14页
arnold(猫脸变换).ppt_第5页
第5页 / 共14页
点击查看更多>>
资源描述

《arnold(猫脸变换).ppt》由会员分享,可在线阅读,更多相关《arnold(猫脸变换).ppt(14页珍藏版)》请在三一办公上搜索。

1、arnold(猫脸变换),arnold(猫脸变换),Arnold变换,俗称猫脸变换.设像素的坐标x,yS=0,1,2,N-1,则Arnold变换为:原文图像密文原文图像加密解密密钥密钥数字图像加密算法研究与实现式中的N表示数字图像的阶数,(x,y)为像素点的坐标。将二维Arnold变换应用在图像f(x,y)上,可以通过像素坐标的改变而改变原始图像灰度值的布局。原始图像可以看作一个矩阵,经过Arnold变换后的图像会变的“混乱不堪”,由于Arnold变换的周期性,继续使用Arnold变换,可以重现图像1。利用Arnold变换的这种特性,可实现图像的加密与解密。n维Arnold变换同二维Arnol

2、d变换一样具有周期性,继续使用Arnold变换,也可以重现原始图像。利用n维Arnold变换对图像的相空间进行置乱,也能实现图像的加密。,arnold(猫脸变换),Arnold变换是V.JArnold在遍历理论的研究中提出的一种变换,原意为catmapping,俗称猫脸变换。Arnold变换直观、简单、具有周期性,使用非常方便。Arnold变换的原理是先作x轴方向的错切变换,再作y轴方向的错切变换,最后的模运算相当于切割回填操作。,arnold(猫脸变换)matlab 代码,function index=arnold(row,col,s,number)%This function is to

3、permutate matrix%row and col are the coordinates of matrix%s is the size of matrix%number is the number of permutation permutate=1 1;1 2;index=mod(permutate*row-1;col-1),s);for i=1:number-1 index=mod(permutate*index),s);end,矩阵大小与置乱周期的关系,clc;clear;permutation=1 1;1 2;m=1;1;s=48;n=mod(permutation*m),s

4、);N=1;while 1 n=mod(permutation*n),s);N=N+1;if n=m break;endendN,矩阵大小与置乱周期的关系,加密图像,function a=arnold()%读取图像aa=imread(C:UsersAdministratorDesktoplena.bmp);%置换次数iTimes=1;%读取aa图像大小iH iW=size(aa);if iH=iW%必须是正方形 error(The cover must be a square!);return;end,%矩阵转换outImg=uint8(zeros(iH,iW);tempImg=aa;for

5、i=1:iTimes for u=1:iH for v=1:iW temp=tempImg(u,v);%置乱 取模运算 ax=mod(3*(u-1)-(v-1),iW)+1;ay=mod(v-1)-2*(u-1),iW)+1;outImg(ax,ay)=temp;end end tempImg=outImg;endoutImg=tempImg;%图像展示figure,imshow(outImg);%将置乱后的图像保存为:imwrite(outImg,C:UsersAdministratorDesktopmysecret.bmp),原始图像,一次猫脸变换后,解密图像,function a=una

6、rnold()%读取加密图像aa=imread(C:UsersAdministratorDesktopmysecret.bmp);%和原来一样置换一次iTimes=1;iH iW=size(aa);if iH=iW%必须是正方形 error(The cover must be a square!);return;endoutImg=uint8(zeros(iH,iW);tempImg=aa;,for i=1:iTimes for u=1:iH for v=1:iW temp=tempImg(u,v);ax=mod(u-1)+(v-1),iW)+1;ay=mod(2*(u-1)+3*(v-1),iW)+1;outImg(ax,ay)=temp;end end tempImg=outImg;endoutImg=tempImg;figure,imshow(outImg);%输出原图imwrite(outImg,unmysecret.bmp),解密后,谢谢!,

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号