首页 > > 详细

辅导S20/CIS解析Python语言程序

CIS 4930.006S20/CIS 6930.013S20: Computational
Methods for Imaging and Vision
Spring 2020
Homework #4
The University of South Florida
Department of Computer Science and Engineering
Tampa, FL
Assigned: April 06, 2020
Due: April 19, 2020 (11:59 PM)
1 1D and 2D Convolutions
(a) Write your own Matlab/Python function to implement 1D discrete convolution, between two
vectors:
• Use it to compute the convolution between the following two vectors:
h =

−3
9
4
−10
9
 , and f =
 6−5
3

• Verify the output of your result by computing the h ? f by hand.
(b) (Optional) In this question, you will compute the convolution between an image of your choice,
and the Gaussian filter. The PSF for the Gaussian filter is:
H =
1
320

1 4 6 4 1
4 16 24 16 4
6 24 36 24 6
4 16 24 16 4
1 4 6 4 1
 .
• For an image of your choice (please keep it PG!), load the image (read it in as a matrix), on
Matlab you can use the function: ‘imread’.
• Convolve that image with the matrix H.
• Display the result of your discrete convolution.
• Comment on the difference between the result and the original image.
1
2 Digital Holography
Holography is a 3D imaging technique, in the sense that it allows recreate the 3D scene (optically or
digitally) from a single intensity measurement. In this problem, we will explore the general idea of
in-line (Gabor) holography and understand the unique feature about holography from the linear system
perspective.
A schematic of the in-line holography is shown in Fig. 2. To record a hologram, a coherent light source
(e.g. laser) is needed to illuminate the 3D scene. The hologram (the intensity image captured by the
camera) is the result from the interference between the unperturbed illumination (reference beam) and
the light scattered from the object.
The formation of the hologram from a 2D object can be approximated using the following linear shift
invariant (LSI) model:
gout(x, y) = gin(x, y; z) ? h(x, y; z), (1)
where ? denotes the 2D convolution (i.e. over (x, y)), gout(x, y) is the output term of interest contained
in the hologram, gin(x, y; z) is the object function, and h(x, y; z) is the point spread function (PSF),
determined by the free-space propagation and diffraction theory, which has the following form,
h(x, y; z) =
1
jλz
ejk
x2+y2
2z , (2)
and the corresponding transfer function,
H(fx, fy; z) = F{h(x, y; z)} = e−jpiλz(f2x+f2y ), (3)
where k = 2pi/λ is the wavenumber, λ is the wavelength of illumination, (x, y) denote the lateral
coordinates and z denotes the axial direction (along which the light propagates) and (fx, fy) denote the
spatial frequency coordinates, according to the following Fourier transform relation
H(fx, fy; z) =
∫ +∞
−∞
∫ +∞
−∞
h(x, y; z)e−j2pi(fxx+fyy) dxdy, (4)
note that we have used the substitutions (or change of variables) ωx = 2pifx and ωy = 2pify in the usual
definition of the Fourier transform we saw in class.
(a) Construct the forward models in both operator and matrix forms. Assume square pixels with
size ∆ and number of pixels in each spatial dimension is N . Discretization of the object space is
performed on the standard basis with square pixel of size δ, and number of pixels in each spatial
dimension M is chosen such that Mδ = N∆.
(b) Find adjoint, and inverse of the system.
(c) Write a Matlab/Python script for the forward model in (a).
(d) Plot the system transfer functions with the following parameters: λ = 0.5 µm, N = 1000.
(i) Keep z = 50 mm fixed, δ = ∆ = 2 µm, 5 µm, 10 µm, 20 µm. How does sampling affect the
performance of digital holography?
(ii) Keep δ = 5 µm fixed, while z ranges from 30 mm to 70 mm (use a small step-size). How does
object distance affect the performance of digital holography?
(iii) Keep ∆ = 5 µm and z = 50 mm fixed, while δ ranges from 1 µm to 10 µm in 2 µm step size.
How does discretization of the object affect the performance of digital holography?
2
Figure 1: Digital holography schematic
Digital holographic reconstruction: Inverse Write Matlab scripts to complete the following questions.
Submit both your Matlab scripts as well as the output results. The object, ‘f2’ located at z1 = 50mm is
given in the mat-file o2.mat. Use the following parameters throughout this problem for forming the
hologram: λ = 0.5µm, N = 1000, and ∆ = δ = 5µm. Consider the object o2 is present.
(e) Simulate the hologram using the discrete forward model (y = Ax) derived from.
(f) Next, we will consider holographic reconstruction using the same parameters as in (e).
• What is the condition number of the imaging matrix A?
(g) Finally, we will investigate the effect of Gaussian noise. Gaussian noise is commonly encountered
in imaging. The fundamental assumption is that the noise is independent of the measured intensity.
The simplest case is the white Gaussian noise (WGN), which assumes the mean as the noise-free
image Inoisefree, and the same variance nstd across all pixels. The noisy image under WGN, Inoisy,
can be generated using the following Matlab script:
Inoisy = normrnd(Inoisefree, nstd, Ny, Nx);
(where Ny , Nx are the dimensions of the image along vertical and horizontal directions.)
Consider white Gaussian noise (WGN) with nstd = 0 + 0j (i.e. noise-free), 0.1 + 0.1j, 0.5 + 0.5j:
• What is the direct deconvolution result?
• What is the result from the least square solution?
• What is the optimal Tikhonov deconvolved result?
• Comment on what you have observed by comparing the three results. Why?
3
(Optional for Extra credit: 3D Digital Holography) Consider the 3D holographic imaging problem.
The formation of the hologram from an extended scene can be approximated using the following linear
model
gout(x, y) =

zl
gin(x, y; zl) ? h(x, y; zl)dzl (5)
where ? denotes the 2D convolution in (x, y), gin(x, y; zl) is the object function at the distance zl.
(h) Construct the forward models in both operator and matrix forms. Assume that the discretization
of the object space is performed on the standard basis with lateral spacing δx = δy = δ, and axial
spacing δz .
(i) Is the system shift invariant? If so, plot the system transfer function. If not, plot the singular values
of the system.
(j) Find the image space, object space, range, null space, and adjoint of the system. Does the inverse
exist?
(k) Write a Matlab/Python script for the forward model in part (e).

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!