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

3 Ansichten (letzte 30 Tage)
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 Kommentare
Mangai s
Mangai s am 22 Feb. 2017
The actual encrypted image should be blurred one. But I am not able to extract that from the code.
Walter Roberson
Walter Roberson am 22 Feb. 2017
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?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Medical Physics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by