⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hide6.m

📁 关于图像隐藏的几个例程。属于matlab图像处理的内容
💻 M
字号:
function hide()
m=input('please input the lock password:');
B=imread('E:\chan\mat\b.bmp','bmp');
imshow(B);pause;close;
[Bx,By,Bz]=size(B);
C=imread('E:\chan\mat\cc.bmp','bmp');
imshow(C);pause;close;
[Cx,Cy,Cz]=size(C);
%%密码分解
m1=fix(m/100);     
m2=m-(fix(m/100))*100;
%%检测
E=bitand(C,240);         
F=bitor(bitshift(bitand(C,240),-4),240);
imshow(E);pause;close;
imshow(F);pause;close;
%%隐藏
for i=1:Bx
    for j=1:By
        for k=1:Bz
            if (i>m1)&(i<=m1+Cx)&(j>m2)&(j<=m2+Cy)
                b=bitand(B(i,j,k),240);
                c=bitshift(bitand(C(i-m1,j-m2,k),240),-4);
                D(i,j,k)=bitor(b,c);
            else
                D(i,j,k)=B(i,j,k);
            end
        end
    end
end
imshow(D);pause;close;
imwrite(D,'E:\chan\mat\d.bmp')
D=imread('E:\chan\mat\d.bmp','bmp');
%%输解码
n=input('please input the unlock password:');
for i=1:10000
    if n==m
        break
    else
        sprintf('put the wrong unlock password!!!')
        n=input('please input the correct unlock password:');
    end
end
%%提取
n1=fix(n/100);  
n2=n-(fix(n/100))*100;
U=bitshift((bitand(D,15)),4);
U=U((n1+1):n1+Cx,(n2+1):n2+Cy,1:Cz);
imwrite(U,'E:\chan\mat\e.bmp')
imshow(U);pause;close;
sprintf('ok')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -