📄 hologen.m
字号:
% This program use the phase function generated by 'phasecaculation' then generate CGH with proper pram then try to reconstruct the
% original image
% amplitude is the host image
% phase is the phase function generated by phase retrieval
% alpha is the spatial frequency of the reference wave
% beta is the watermark weight used in watermark embedding
function [hologram]=Hologen(amplitude,phase,alph,beta)
ph=phase;
[M,N]=size(amplitude);
A=double(zeros(M,N));
alpha=alph;
for m=1:1:M
for n=1:1:N
A(m,n)=beta*cos(2*pi*n*alpha-ph(m,n))+(1-beta); %test n -
end
end
B=amplitude;
C=A.*B;
hologram=C;
% imshow(mat2gray(C));
% imwrite(mat2gray(C),'hologram.bmp');
%
%
%
%
%
% WMa=fftshift(fft2(C));
% %WMa=(fft2(C));
% WMi=abs(WMa);
% figure(2)
% imshow(mat2gray(log(1+WMi)));
%
%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -