本文主要是介绍PCG共轭梯度最小二乘相位解包裹-matlab(可直接运行),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
phase_unwrap.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 根据Ghiglia和Romero(1994)提出的方法,基于加权和非加权最小二乘法进行相位解包裹
% 链接:https://doi.org/10.1364/JOSAA.11.000107
% 输入参数:
% * psi: 包裹的相位图,范围从-pi到pi
% * weight: 相位的权重(可选,默认为全1)
% 输出参数:
% * phi: 解包裹后的相位图,通过加权(或非加权)最小二乘相位解包裹得到
% 作者:Muhammad F. Kasim (University of Oxford, 2016)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function phi = phase_unwrap(psi, weight)if (nargin < 2) % 非加权相位解包裹% 计算包裹值的一阶差分,并包裹差分值dx = [zeros([size(psi,1),1]), wrapToPi(diff(psi, 1, 2)), zeros([size(psi,1),1])];dy = [zeros([1,size(psi,2)]); wrapToPi(diff(psi, 1, 1)); zeros([1,size(psi,2)])];rho = diff(dx, 1, 2) + diff(dy, 1, 1);% 通过求解泊松方程来得到结果phi
这篇关于PCG共轭梯度最小二乘相位解包裹-matlab(可直接运行)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!