s4rout3.m
来自「Industrial Mathematics」· M 代码 · 共 24 行
M
24 行
% Routine 4.3 encryption
B = rand(m,n); % choose a blurring matrix
save blur B
% blur the image via circular convolution:
Xhat = fft2(X);
Bhat = fft2(B);
Yhat = Bhat.*Xhat;
Y = ifft2(Yhat);
Y = real(Y);
Y = round(Y);
%
% to see how scambled the data, rescale:
Z= Y/(m*n);
a = min(min(Z));
Z = Z - a;
b = max(max(Z));
Z = Z*64/b;
image(Z) % display the encrypted image
colormap gray
axis off
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?