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