hologen.m

来自「关于半色调编码计算全息图的信息隐藏Matlab程序的说明: 算法实现主程」· M 代码 · 共 46 行

M
46
字号
% 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 + =
减小字号Ctrl + -
显示快捷键?