How to show the encrypted share for the Jarvis halftone algorithm in following code?

조회 수: 2 (최근 30일)
How to show the encrypted share for the Jarvis halftone algorithm?
[Merged from duplicate]
function outImg = jarvisHalftone(inImg)
a = imread('D:\our project\crypt\rose.jpg');
figure
imshow(a);
I = rgb2gray(a);
inImg = double(I);
figure
imshow(inImg);
[M,N] = size(inImg);
T = 127.5;
y = inImg;
error = 0;
y= [127.5*ones(M,2) y 127.5*ones(M,2) ; 127.5*ones(2,N+4)];
z = y;
M
N
for rows = 1:M
for cols = 3:N+2
z(rows,cols) =255*(y(rows,cols)>=T);
error = -z(rows,cols) + y(rows,cols);
y(rows,cols+2) = 5/48 * error + y(rows,cols+2);
y(rows,cols+1) = 7/48 * error + y(rows,cols+1);
y(rows+1,cols+2) = 3/48 * error + y(rows+1,cols+2);
y(rows+1,cols+1) = 5/48 * error + y(rows+1,cols+1);
y(rows+1,cols+0) = 7/48 * error + y(rows+1,cols+0);
y(rows+1,cols-1) = 5/48 * error + y(rows+1,cols-1);
y(rows+1,cols-2) = 3/48 * error + y(rows+1,cols-2);
y(rows+2,cols+2) = 1/48 * error + y(rows+2,cols+2);
y(rows+2,cols+1) = 3/48 * error + y(rows+2,cols+1);
y(rows+2,cols+0) = 5/48 * error + y(rows+2,cols+0);
y(rows+2,cols-1) = 3/48 * error + y(rows+2,cols-1);
y(rows+2,cols-2) = 1/48 * error + y(rows+2,cols-2);
end
end
figure
imshow(z);
outImg = z(1:M,3:N+2);
figure
imshow(outImg);
outImg = im2bw(uint8(outImg));
figure
imshow(outImg)
  댓글 수: 5
Mangai s
Mangai s 2017년 2월 22일
The actual encrypted image should be blurred one. But I am not able to extract that from the code.
Walter Roberson
Walter Roberson 2017년 2월 22일
It would help if you posted a copy of your rose.jpg image along with a copy of the image we should be looking to extract (so we would be able to recognize it.)
Is your rose.jpg created in the rather uncommon JPEG lossless compression? If not then the JPEG compression process would have damaged the payload. Though perhaps that is part of the challenge, that perhaps all of the shares together should be able to reconstruct the data even in the face of damage?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Medical Physics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by