Info

この質問は閉じられています。 編集または回答するには再度開いてください。

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

1 回表示 (過去 30 日間)
Mangai s
Mangai s 2017 年 2 月 21 日
閉鎖済み: Walter Roberson 2017 年 2 月 21 日
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 件のコメント
Walter Roberson
Walter Roberson 2017 年 2 月 21 日
Duplicates https://www.mathworks.com/matlabcentral/answers/325913-how-to-show-the-encrypted-share-for-the-jarvis-halftone-algorithm

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by