Commit 6f5e15f4 authored by Leon Merten Lohse's avatar Leon Merten Lohse

Minor changes in MBA

parent 7104c33a
Pipeline #139716 passed with stage
in 1 minute and 44 seconds
......@@ -105,20 +105,20 @@ switch (settings.reg_type)
case 'none'
% avoid division by 0
laplaceKernel(0,0) = 1;
filterKernel = 1 ./ laplaceKernel;
filterKernel = 1 ./ (-laplaceKernel);
% set zero frequency (singularity) to 0
filterKernel(0,0) = 0;
case 'mba'
filterKernel = -1 ./ (-laplaceKernel + settings.reg_alpha);
filterKernel = 1 ./ (-laplaceKernel + settings.reg_alpha);
case 'tikhonov'
filterKernel = laplaceKernel ./ (laplaceKernel.^2 + settings.reg_alpha^2);
filterKernel = -laplaceKernel ./ (laplaceKernel.^2 + settings.reg_alpha^2);
otherwise
error(['Invalid reg_method ' settings.reg_method])
end
% apply inversion filter kernel to reconstruct the phase
phase = (-2 * pi * fresnelNumber) * real(ifft2(fft2(hologramPadded-1).*filterKernel));
phase = (2 * pi * fresnelNumber) * real(ifft2(fft2(hologramPadded-1).*filterKernel));
% undo padding
phase = croparray(phase, [settings.pady, settings.padx]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment