Broken code:visual cryptography
Info
This question is closed. Reopen it to edit or answer.
Show older comments
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!
Answers (0)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!