Go to the source code of this file.
|
| fclose ('all') |
|
| imwrite (I_rec, sprintf('OPH_point_3_%.2fmm.jpg', zz/mm+20)) |
|
| title (sprintf('ASM 3 point Reconst %.2f mm', zz/mm)) |
|
| saveas (fig, sprintf('ASM 3 point Reconst %.2f mm.jpg', zz/mm)) |
|
| pause (0.2) |
|
|
| clc |
|
unit | mm = 1e-3 |
|
| um = mm*mm |
|
| nm = um*mm |
|
command | asm_kernel = @(f, wvl, x, y, res, pp) exp(-2j*pi*f .* sqrt( wvl^-2 - ((x/pp - 0.5)./pp/res).^2 - ((y/pp - 0.5)./pp/res).^2)) |
|
angular spectrum method kernel | norm2int = @(img) uint8(255.*img./max(max(img))) |
|
parameters | h = 2160 |
|
| v = 3840 |
|
| wvl = 525 * nm |
|
green | pp = 3.6*um |
|
pixel pitch | res = v/2 |
|
| ReconstLength = 1 |
|
input file name | fim_py = 'File name_IM.bmp' |
|
| fre_py = 'File name_RE.bmp' |
|
Convert to complex image phase part | im_py = imread(fim_py) |
|
crop | phase = (im_py - 0.5) .* (2*pi) |
|
amplitude part | re_py = imread(fre_py) |
|
adapt ASM | r = (-pp*h/2 + pp/2):pp:(pp*h/2 - pp/2) |
|
| c = r |
|
Complex image | ch = real + 1j*imag |
|
| A = fftshift(fft2(fftshift(ch))) |
|
| p = asm_kernel(zz, wvl, C, R, h, pp) |
|
Reconstruction part | figure |
|
for | zz |
|
| Az1 = A .* p |
|
| EI = fftshift(ifft2(fftshift(Az1))) |
|
| I_rec = EI .* conj(EI) |
|
| fig = imagesc(I_rec) |
|
◆ fclose()
◆ imwrite()
imwrite |
( |
I_rec |
, |
|
|
sprintf( 'OPH_point_3_%.2fmm.jpg', zz/mm+20) |
|
|
) |
| |
◆ pause()
◆ saveas()
saveas |
( |
fig |
, |
|
|
sprintf( 'ASM 3 point Reconst %.2f mm.jpg', zz/mm) |
|
|
) |
| |
◆ title()
title |
( |
sprintf( 'ASM 3 point Reconst %.2f mm', zz/mm) |
| ) |
|
A = fftshift(fft2(fftshift(ch))) |
◆ asm_kernel
command asm_kernel = @(f, wvl, x, y, res, pp) exp(-2j*pi*f .* sqrt( wvl^-2 - ((x/pp - 0.5)./pp/res).^2 - ((y/pp - 0.5)./pp/res).^2)) |
|
inline |
◆ Az1
◆ ch
◆ clc
◆ EI
EI = fftshift(ifft2(fftshift(Az1))) |
◆ fig
◆ figure
Reconstruction part figure |
◆ fim_py
input file name fim_py = 'File name_IM.bmp' |
◆ fre_py
fre_py = 'File name_RE.bmp' |
◆ I_rec
normalize term I_rec = EI .* conj(EI) |
◆ im_py
◆ mm
◆ nm
◆ norm2int
angular spectrum method kernel norm2int = @(img) uint8(255.*img./max(max(img))) |
◆ phase
crop phase = (im_py - 0.5) .* (2*pi) |
◆ pp
◆ re_py
◆ ReconstLength
◆ res
◆ um
◆ wvl
◆ zz