⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 phasesl.m

📁 关于半色调编码计算全息图的信息隐藏Matlab程序的说明: 算法实现主程序为CGHwatermark; 位相恢复函数为phaseSL; 用计算全息记录已知振幅和位相的复波前函数为Hol
💻 M
字号:
% This program caculate the phase function of the input image of a 2f system.

function [phase]=PhaseSL(Spinput,Froutput)
input=Spinput;
[m,n]=size(input);
a=Froutput;
E2=sqrt(a);
b=Spinput;
E1=sqrt(b);
iter=1;         % 迭代次数
iterations=100;
E_1=rand(m);
while(iter<iterations+1)
    E_plane_2=fftshift(fft2(E1));
    E_2=E_plane_2;
    I_2=E_2.*conj(E_2);
    E_plane_2_new=E2.*exp(i.*angle(E_plane_2));
    E_plane_1=fftshift(ifft2(E_plane_2_new));
    phase=angle(E_plane_1);
    E_1=E1.*exp(i.*angle(E_plane_1));
    iter=iter+1;
end

% figure
% imshow(mat2gray(phase));

% save 'phase.mat',phase;

% figure(2)
% c=E1.*exp(i.*phase);
% d=fft2(c);
% I=d.*conj(d);
% imshow(mat2gray(log(1+I)))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -