Info

此问题已关闭。 请重新打开它进行编辑或回答。

Broken code:visual cryptography

3 次查看(过去 30 天)
parth jai
parth jai 2017-7-21
关闭: Walter Roberson 2017-7-21
The code is:
clc;
clear all;
i=imread('lena256x256.jpg');
i=im2bw(i,0.3);
s=size(i);
a=s(1);
b=s(2);
s1a=[1 0;1 0];
part1=zeros(a,2*b);
part2=zeros(a,2*b);
[x y]=find(i==1);
len=length(x);
for I=1:len
a1=x(I);b1=y(I);
part1((a1),(2*b1-1):(2*b1))=s1a(1,1:2);
part2((a1),(2*b1-1):(2*b1))=s1a(2,1:2);
end
[x y]=find(i==0);
len=length(x);
s1a=[1 0;0 1];
for I=1:len
a1=x(I);b1=y(I);
part1((a1),(2*b1-1):(2*b1))=s1a(1,1:2);
part2((a1),(2*b1-1):(2*b1))=s1a(2,1:2);
end
decrypt=bitor(part1,part2);
decrypt=~decrypt;
figure;imshow(decrypt);
figure;imshow(part1);
figure;imshow(part2);
Images of each part, decrypted image and original image are attached.
Thank you!

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by