Info

This question is closed. Reopen it to edit or answer.

Can I know how to extract the encrypted image shares in the following matlab code?

1 view (last 30 days)
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)
  1 Comment
Walter Roberson
Walter Roberson on 21 Feb 2017
Duplicates https://www.mathworks.com/matlabcentral/answers/325913-how-to-show-the-encrypted-share-for-the-jarvis-halftone-algorithm

Answers (0)

Community Treasure Hunt

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

Start Hunting!