defocus • deconvolution / inverse filtersweb.mit.edu/2.710/fall06/2.710-wk15-a-sl.pdf ·...

38
MIT 2.71/2.710 Optics 12/12/05 wk15-a-1 Today Defocus Deconvolution / inverse filters

Upload: others

Post on 13-Jul-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-1

Today

• Defocus

• Deconvolution / inverse filters

Page 2: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-2

Defocus

Page 3: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-3

©© 2020thth Century FoxCentury Fox

Page 4: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-4

Focus in classical imaging

inin--focusfocus

defocusdefocus

Page 5: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-5

Focus in classical imaging

inin--focusfocus

defocusdefocus

Page 6: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-6

Intensity distribution near the focus of an ideal lens

( )NA61.0 λ×=∆x

( )2NA2λ

=∆z

(rotationally symmetric wrt z axis)

z

Page 7: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-7

Back to the basics: 4F system

2f 2fx ′′ x′x

1f 1f

imageimageplaneplane

objectobjectplaneplane

FourierFourierplaneplane

z

Page 8: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-8

Back to the basics: 4F system

2f 2fx ′′ x′x

1f 1f

imageimageplaneplane

objectobjectplaneplane

FourierFourierplaneplane

z

maxxa ≡

(NA)1

( )1

max1 NA

fx

=

(NA)2

( )2

max2 NA

fx

=

Page 9: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-9

Back to the basics: 4F system

2f 2fx ′′ x′x

1f 1f

imageimageplaneplane

objectobjectplaneplane

FourierFourierplaneplane

z

( )xg ⎟⎟⎠

⎞⎜⎜⎝

⎛ ′′

1fxGλ ⎟⎟

⎞⎜⎜⎝

⎛′− x

ffg2

1

Page 10: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-10

4F system with defocused input

2f 2fx ′′ x′x

1f 1f

imageimageplaneplane

objectobjectplaneplane

FourierFourierplaneplane

z

( )xg

Page 11: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-11

4F system with defocused input

2f 2fx ′′ x′x

1f 1f

imageimageplaneplane

objectobjectplaneplane

FourierFourierplaneplane

z

( ) ⎟⎟⎠

⎞⎜⎜⎝

⎛∆+

∗zyxixg

λπ

22

exp

Page 12: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-12

4F system with defocused input

2f 2fx ′′ x′x

1f 1f

imageimageplaneplane

objectobjectplaneplane

FourierFourierplaneplane

z

( ) ⎟⎟⎠

⎞⎜⎜⎝

⎛∆

∗z

xixgλ

π2

exp ( )⎥⎥⎦

⎢⎢⎣

⎡⎟⎟⎠

⎞⎜⎜⎝

⎛ ′′∆⋅⎟⎟

⎞⎜⎜⎝

⎛ ′′2

11

expf

xzif

xGλ

λπλ

Page 13: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-13

4F system with defocused input

2f 2fx ′′ x′x

1f 1f

imageimageplaneplane

objectobjectplaneplane

FourierFourierplaneplane

z

( ) ⎟⎟⎠

⎞⎜⎜⎝

⎛∆

∗z

xixgλ

π2

exp ( ) ( )⎥⎦

⎤⎢⎣

⎡ ′′∆⋅⎟⎟

⎞⎜⎜⎝

⎛ ′′2

1

2

1

expf

xzif

xGλ

πλ

Page 14: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-14

Effect of defocus on the Fourier plane

mild defocus

1fxλ′′

( ) ( )⎥⎦

⎤⎢⎣

⎡ ′′∆ 2

1

2

cosf

xzλ

π

( )z∆λ21

1

0

Page 15: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-15

Effect of defocus on the Fourier plane

strong defocus ( ) ( )⎥⎦

⎤⎢⎣

⎡ ′′∆ 2

1

2

cosf

xzλ

π

( )z∆λ21

1

0

1fxλ′′

Page 16: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-16

Effect of defocus on the Fourier plane

mild defocus ( ) ( )⎥⎦

⎤⎢⎣

⎡ ′′∆ 2

1

2

cosf

xzλ

π

( )z∆λ21

⎟⎟⎠

⎞⎜⎜⎝

⎛ ′′

1fxGλ

( ) ( )⎥⎦

⎤⎢⎣

⎡ ′′∆ 2

1

2

cosf

xzλ

π⎟⎟⎠

⎞⎜⎜⎝

⎛ ′′

1fxGλ

× not too different from ⎟⎟⎠

⎞⎜⎜⎝

⎛ ′′

1fxGλ

1

0

1fxλ′′

Page 17: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-17

Effect of defocus on the Fourier plane

1

0

⎟⎟⎠

⎞⎜⎜⎝

⎛ ′′

1fxGλ

× very different from

strong defocus ( ) ( )⎥⎦

⎤⎢⎣

⎡ ′′∆ 2

1

2

cosf

xzλ

π

( ) ( )⎥⎦

⎤⎢⎣

⎡ ′′∆ 2

1

2

cosf

xzλ

π⎟⎟⎠

⎞⎜⎜⎝

⎛ ′′

1fxGλ ⎟⎟

⎞⎜⎜⎝

⎛ ′′

1fxGλ

1fxλ′′

Page 18: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-18

Depth of field

( ) ( )⎥⎦

⎤⎢⎣

⎡ ′′∆ 2

1

2

cosf

xzλ

π

( )z∆λ21

1

0

1fxλ′′

system is defocus-insensitiveas long as frequencies

that pass through the systemare confined within this region

Page 19: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-19

Depth of field

( )z∆λ21

1

0

system is defocus-insensitiveas long as frequencies

that pass through the systemare confined within this region

( )

( )( )21max

1

max

2

21

fxz

zfx

′′≤∆⇒

⇒∆

≤′′

λλλ

1fxλ′′

( ) ( )⎥⎦

⎤⎢⎣

⎡ ′′∆ 2

1

2

cosf

xzλ

π

Page 20: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-20

Depth of field

( )z∆λ21

1

0

system is defocus-insensitiveas long as (∆z) is small enough that

frequencies that pass through the systemcan be confined within this region

( )

( )( ) 1

2

1

max

NA2

21

λλλ

≤∆⇒

⇒∆

≤′′

z

zfx

1fxλ′′

( ) ( )⎥⎦

⎤⎢⎣

⎡ ′′∆ 2

1

2

cosf

xzλ

π

Depth of field

Page 21: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-21

Depth of field & Depth of focus

2f 2fx ′′ x′x

1f 1f

objectobjectplaneplane

FourierFourierplaneplane

z

( )( )

( )1

max1

12

NA

NA2

fx

z

′′=

≤∆λ ( )

( )

( )2

max2

22

NA

NA2

fx

z

′′=

≤∆λ

imageimageplaneplane

Depth of fieldDepth of field Depth of focusDepth of focus

(NA)1

(NA)2

Page 22: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-22

NA trade – offs• high NA

– narrow PSF in the lateral direction (PSF width ~1/NA)• sharp lateral features

– narrow PSF in longitudinal direction (PSF depth ~1/NA2)• poor depth of field

• low NA– broad PSF in the lateral direction (PSF width ~1/NA)

• blurred lateral features– broad PSF in longitudinal direction (PSF depth ~1/NA2)

• good depth of field

Page 23: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-23

Depth of focus: Geometrical Optics viewpoint

2f 2fx ′′ x′x

1f 1f

z(NA)1

(NA)2

defocuseddefocusedimageimageplaneplane

∆x

∆z

maxxa ≡

( )2NAxz ∆

=∆From similar triangles:

Now require defocused spot ≈ diffraction spot: ( )2NA61.0 λ

≈∆x

Therefore: ( )22NA61.0 λ

≈∆z

Page 24: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-24

Defocus and Deconvolution(Inverse filters)

Page 25: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-25

2f 2fx ′′ x′x

1f 1f

DepthDepthOf Of

FocusFocus

DefocusDefocus

worsensworsensawayawayfromfromfocalfocalplaneplane

22½½DDobjectobject

z

Imaging a 2½D object

Page 26: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-26

2f 2fx ′′ x′x

1f 1f

portion of objectportion of objectdefocused by defocused by ΔΔzz

z∆z

Imaging a 2½D object

Page 27: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-27

2f 2fx ′′ x′x

1f 1f

…… is equivalent to same portion is equivalent to same portion inin--focusfocus PLUS PLUS ……

…… fictitious quadratic fictitious quadratic phase mask phase mask

on the Fourier planeon the Fourier plane

( )⎭⎬⎫

⎩⎨⎧ ∆′′+′′− 2

1

22

2expf

zyxiλ

π (applied(appliedlocally locally ))

z

Imaging a 2½D object

Page 28: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-28

Example

focal plane

2 (DoF)s 4 (DoF)s

Page 29: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-29

Distance between planes ≈ 2 Depths of Fieldleft-most “M” : image blurred by diffraction onlycenter and right-most “M”s : image blurred by diffraction and defocus

Raw image (collected by camera – noise-free)

Page 30: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-30

Raw image explanation: convolution

“M” convolvedwith standard

diffraction PSF

“M” convolvedwith diffraction PSF

and defocus

“M” convolvedwith diffraction PSFand more defocus

Page 31: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-31

Raw image explanation: Fourier domain

{ } ndiffractioM"" H×ℑ { }( )2DoF

M""

defocus

ndiffractio

HH

××ℑ { }

( )4DoFM""

defocus

ndiffractio

HH

××ℑ

Page 32: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-32

Can diffraction and defocus be “undone” ?• Effect of optical system (expressed in the Fourier plane):

• To undo the optical effect, multiply by the “inverse transfer function”

{ } defocusndiffractiosystemsystem e wherM"" HHHH ×=×ℑ

{ }( ) { } !!! M"" 1M"" system

system ℑ=××ℑH

H

Page 33: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-33

Can diffraction and defocus be “undone” ?• Effect of optical system (expressed in the Fourier domain):

• To undo the optical effect, multiply by the “inverse transfer function”

• Problems– Transfer function goes to zero outsize the system pass-band– Inverse transfer function will multiply the FT of the noise as well

as the FT of the original signal

2umax–2umax

1

0

transfer function

{ } systemM"" H×ℑ

{ }( ) { } !!! M"" 1M"" system

system ℑ=××ℑH

H

defocusndiffractiosystem HHH ×=where

Page 34: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-34

Solution: Tikhonov regularization

2

system

*system

systemobjectoriginal

imagefinal

H

HH

+×⎟⎟⎠

⎞⎜⎜⎝

⎛×

⎭⎬⎫

⎩⎨⎧

ℑ=⎭⎬⎫

⎩⎨⎧

ℑµ

“raw image”(formed by the optics)

post-processing(“inverse filter”)

2f 2fx ′′ x ′x

1f 1f

image planeimage plane““raw imageraw image””

originaloriginalobjectobject

z

⎭⎬⎫

⎩⎨⎧

×⎭⎬⎫

⎩⎨⎧

ℑℑ−system

1

objectoriginal H

CCDcamera

finalfinalimageimage

COMPUTATIONALCOMPUTATIONALIMAGINGIMAGING

Page 35: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-35

On Tikhonov regularization

2

system

*system

systemobjectoriginal

imagefinal

H

HH

+×⎟⎟⎠

⎞⎜⎜⎝

⎛×

⎭⎬⎫

⎩⎨⎧

ℑ=⎭⎬⎫

⎩⎨⎧

ℑµ

• µ is the “regularizer” or “regularization parameter”• choice of µ : depends on the noise and signal energy• for Gaussian noise andand image statistics, optimum µ is

“Wiener filter”

• More generally, the optimal inverse filters are nonlinear and/orprobabilistic (e.g. maximum likelihood inversion)

• For more details: 2.717

poweroptimum SNR

1=µ

Page 36: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-36

Deconvolution using Tikhonov regularized inverse filterUtilized a priori knowledge of depth of each digit (alternatively,needs depth-from defocus algorithm)

Artifacts due primarily to numerical errors getting amplifiedby the inverse filter (despite regularization)

Deconvolution: diffraction and defocusnoise free

Page 37: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-37

Noisy raw imageSNR=10

Page 38: Defocus • Deconvolution / inverse filtersweb.mit.edu/2.710/Fall06/2.710-wk15-a-sl.pdf · 2005-11-27 · Deconvolution using Tikhonov regularized inverse filter Utilized a priori

MIT 2.71/2.710 Optics12/12/05 wk15-a-38

Deconvolution using Wiener filter (i.e. Tikhonov with µ=1/SNR)Noise is destructive away from focus (4DOFs)Utilized a priori knowledge of depth of each digit

Artifacts due primarily to noise getting amplified by the inverse filter

Deconvolution in the presence of noiseSNR=10