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

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) ...@@ -105,20 +105,20 @@ switch (settings.reg_type)
case 'none' case 'none'
% avoid division by 0 % avoid division by 0
laplaceKernel(0,0) = 1; laplaceKernel(0,0) = 1;
filterKernel = 1 ./ laplaceKernel; filterKernel = 1 ./ (-laplaceKernel);
% set zero frequency (singularity) to 0 % set zero frequency (singularity) to 0
filterKernel(0,0) = 0; filterKernel(0,0) = 0;
case 'mba' case 'mba'
filterKernel = -1 ./ (-laplaceKernel + settings.reg_alpha); filterKernel = 1 ./ (-laplaceKernel + settings.reg_alpha);
case 'tikhonov' case 'tikhonov'
filterKernel = laplaceKernel ./ (laplaceKernel.^2 + settings.reg_alpha^2); filterKernel = -laplaceKernel ./ (laplaceKernel.^2 + settings.reg_alpha^2);
otherwise otherwise
error(['Invalid reg_method ' settings.reg_method]) error(['Invalid reg_method ' settings.reg_method])
end end
% apply inversion filter kernel to reconstruct the phase % 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 % undo padding
phase = croparray(phase, [settings.pady, settings.padx]); phase = croparray(phase, [settings.pady, settings.padx]);
......
Supports Markdown
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