Description
.
NON-BLIND DECONVOLUTION
Image deblurring is a long-standing image restoration problem in computer vision and image processing. Most
classical image deblurring methods model blur using a convolution operation. Specifically, they model a blurred image
π as:
π = π β π + π
where π is a blur kernel or a point spread function (PSF), π is a latent sharp image, and π is additive noise, which
is often assumed to be white Gaussian such that π~π(0, π
2
) where `whiteβ noise means the noise variance is constant
for all frequency bands as will be explained later. * is the convolution operator. Then, image deblurring becomes a
deconvolution problem, in which we invert the convolution operation. If we know both π and π, the problem is
called non-blind deconvolution. On the other hand, if we know only π, the problem is called blind deconvolution.
Non-blind deconvolution serves as a fundamental building block in many applications, e.g., removing motion blur,
out-of-focus blur, and chromatic aberration.
INVERSE FILTERING
The most naΓ―ve approach to non-blind deconvolution is the inverse filtering. We can derive the inverse filtering by
applying the Fourier transform to the blur model above. Specifically, we can obtain:
π΅ = πΎ β πΏ + π
where π΅ is the Fourier transform of π, i.e., π΅ = β±(π) where β± represents the forward Fourier transform function.
πΎ, πΏ, and π are also the Fourier transforms of π, π, and π, respectively. β is the element-wise multiplication
operator. Ignoring noise π, we can obtain πΏ as:
πΏ β
π΅
πΎ
where π΅
πΎ
is the pixel-wise division between π΅ and πΎ in the frequency domain. Then, by computing the inverse
Fourier transform, we can obtain a deconvolution result. As this technique directly applies the inverse of a blur kernel
π to the input blurred image π in the frequency domain, it is called the inverse filtering.
The inverse filtering, however, cannot produce satisfying results. The blur kernel πΎ in the frequency domain may
have elements whose values are zero or close to zero, and dividing π΅ with such elements leads to totally corrupted
images with significantly amplified noise. To overcome this issue, we need proper handling of noise and regularization.
WIENER DECONVOLUTION
One classical approach to non-blind deconvolution is the wiener deconvolution. The wiener deconvolution is derived
by minimizing the expected error in the frequency domain. Specifically, we want to find a deconvolution filter π» in
the frequency domain such that
min
π»
πΈ[βπΏ βπ»π΅β
2
]
where π»π΅ is the pixel-wise multiplication between π» and π΅ in the frequency domain. By solving the equation
above, we can obtain a deconvolution filter π» such that π»π΅ is a deconvolution result with the least expected squared
error.
By replacing π΅ in the equation above with π΅ = πΎπΏ + π, we can obtain:
min
π»
πΈ[βπΏ β π»(πΎπΏ +π)β] = min
π»
πΈ[β(1 βπ»πΎ)πΏ β π»πβ]
Then, we can extend the squares and obtain:
min
π»
πΈ[β(1 β π»πΎ)πΏ β π»πβ] = min
π»
{β1 βπ»πΎβ
2πΈ[βπΏβ
2
] β2(1 β π»πΎ)πΈ[πΏπ] + βπ»β
2πΈ[βπβ
2
]}
To further continue the derivation, we assume that noise π is zero-mean Gaussian noise, which is independent to πΏ
(in practice, itβs not, but many image restoration works use this assumption to simplify their problems.). Then
πΈ[πΏπ] = πΈ[πΏ]πΈ[π]. As π is zero-mean, πΈ[π] = 0. As a result, we obtain:
min
π»
{β1 β π»πΎβ
2πΈ[βπΏβ
2
] +βπ»β
2πΈ[βπβ
2
]}
By differentiating the equation above with respect to π», and setting it to zero, we can solve the equation for π»:
β β2(1 β π»πΎ)πΈ[βπΏβ
2
]+ 2π»πΈ[βπβ
2
] = 0
β π» =
πΎπΈ[βπΏβ
2
]
πΎ2πΈ[βπΏβ
2]+ πΈ[βπβ
2]
=
πΎ
2
πΎ2 +
πΈ[βπβ
2]
πΈ[βπΏβ
2]
β
1
πΎ
Finally, multiplying π» to π΅, we can obtain the formulation of the wiener deconvolution:
π = β±
β1 (
|β±(π)|
2
|β±(π)|
2 +
1
πππ
(π)
β
β±(π)
β±(π)
)
where all the multiplication and division operations are pixel-wise operations. πππ
(π) is the signal-to-noise ratio at
each frequency π, which is required to be estimated. πππ
(π) is defined as:
πππ
(π) =
π πππππ π£πππππππ ππ‘ π
ππππ π π£πππππππ ππ‘ π
Natural images tend to have signal variance that scales as 1
π2
. Noise variance tends to be a constant, i.e., ππ(π) =
ππππ π‘πππ‘ for all π. This is called white noise. As a result, we can assume
πππ
(π) =
1
ππ2
and obtain a simplified version of the wiener deconvolution as:
π = β±
β1 (
|β±(π)|
2
|β±(π)|
2 + ππ2
β
β±(π)
β±(π)
)
where π is a constant. In practice, a more simplified version is often used, which is defined as:
π = β±
β1 (
|β±(π)|
2
|β±(π)|
2 + π
β
β±(π)
β±(π)
)
(1)
By setting π = 0, the equation above reduces to the inverse filtering. In this homework, you need to implement this
simplified version of the wiener deconvolution. You also need to discuss the effect of the parameter π with example
images.
TOTAL-VARIATION (TV) DECONVOLUTION
Non-blind deconvolution is an ill-posed problem. Due to the loss of information caused by the noise π, even if we
know π, there can be an infinite number of solutions for π. To resolve such ill-posedness, most methods adopt a
regularization term or a prior on the latent image π. One of the most widely-used prior is the total variation, which is
defined as:
πΈTV(π) = ββx β πβ1 +ββy β πβ
1
where βπβ1
is the πΏ1 norm of an image π which is defined as:
βπβ1 = β|π(π₯, π¦)|
π₯,π¦
and βx and βy are partial derivative filters along the x- and y-axes, e.g., βx = [0,β1,1] and βy = [0,β1,1]
T
. With
the prior πΈTV(π), we can define an energy function for non-blind deconvolution as:
πΈ(π) = βπ β π β πβ
2 + πΌπΈTV(π)
where πΌ is a parameter to control the strength of the regularization term.
You can also formulate the non-blind deconvolution problem as a maximum-a-posteriori estimation problem, and
derive the energy function above from the MAP formulation. Specifically, you can define a posterior distribution:
π(π|π, π) β π(π|π, π)π(π)
where π(π|π, π) is a likelihood, and π(π) is a prior distribution.
Optimization
The regularization term πΈTV(π) in the energy function πΈ(π) is a non-quadratic term, so the optimization of πΈ(π)
needs a non-linear optimization algorithm such as the iterative reweighted least-squares (IRLS) method, which is
explained in the course material (see 15.global_optimization.pdf). At each iteration of the IRLS method, you need to
solve a least-squares problem, which is formulated as:
π₯
β = arg min
π₯
{βπ βππ₯β
2 + πΌ(π₯
Tππ₯
Tππ₯ππ₯π₯+ π₯
Tππ¦
Tππ¦ππ¦π₯)}
where π and π₯ are vector representations of π and π, respectively. π is a matrix representing the convolution
operation with π. The equation above can be re-written as:
π₯
β = arg min
π₯
{π₯
Tπ
Tππ₯ β2π₯
Tπ
Tπ + π
Tπ + πΌ(π₯
Tππ₯
Tππ₯ππ₯π₯+ π₯
Tππ¦
Tππ¦ππ¦π₯)}
As the right-hand side of this equation is a quadratic function with respect to π₯, its solution can be found by setting its
derivative to zero. Specifically, the derivative of the right-hand side is derived as:
2π
Tππ₯β 2π
Tπ +2πΌ(ππ₯
Tππ₯ππ₯ + ππ¦
Tππ¦ππ¦)π₯
By setting the derivative to zero, we can derive the following equation:
(π
Tπ + 2πΌ(ππ₯
Tππ₯ππ₯ + ππ¦
Tππ¦ππ¦)) π₯ = π
Tπ
Note that this equation has the same form as ππ± = π, which means that you can find a solution π₯ using a linear solver.
However, the size of the matrix (π
Tπ+ 2πΌ(ππ₯
Tππ₯ππ₯ +ππ¦
Tππ¦ππ¦)) is huge, so it is hard to directly solve the linear
system. Instead, you can use an iterative solver such as the conjugate gradient method. For more details, refer to the
reference code that is provided with this homework document.
REQUIREMENTS
In this homework, you need to implement two non-blind deconvolution algorithms that remove blur from a given
blurred image π and a blur kernel π. Specifically, you are required to:
β« Wiener deconvolution
βΌ Implement the wiener deconvolution according to Equation (1).
βΌ Discuss the effect of the parameter π with example images.
β« TV deconvolution
βΌ Formulate the non-blind deconvolution problem as a maximum-a-posteriori (MAP) problem, and
derive the energy function πΈ(π) described above.
βΌ Explain the relationship between the MAP formulation, and the energy function. Specifically, you need
to explain how πΌ can be derived from your MAP formulation.
βΌ You need to implement an algorithm to optimize the energy function. The energy function above
involves πΈTV(π), which is non-quadratic. Thus, you need to implement a non-linear optimization
algorithm. In this homework, you can implement the iterative-reweighted-least-squares (IRLS) method,
which was presented in our course material. See the file β15.global_optimization.pdfβ.
The IRLS optimization for non-blind deconvolution needs to compute convolution operations with a blur kernel
several times, which can take an excessive amount of computation time for large blur kernels. To accelerate the
computation, you can use the convolution theorem.
Your report must include:
β« Derivation of the energy function from the MAP formulation and discussion about their relationship
β« Detailed discussion on your implementation of the wiener deconvolution and TV deconvolution
β« Your results with a detailed discussion including the discussion on the parameter π of the wiener
deconvolution
β« Limitations of the techniques that you found
You must upload a single zip file that contains the following to the LMS:
β« code/ – a directory containing all your code for this assignment
β« images/ – a directory containing your input images and their results
β« report.pdf β your report as a PDF file
Due: Dec. 19
th, 23:59
Penalty for late submission
β« 1 day: 70%
β« 2 days: 30%
β« 3 days: 0%
RUBRIC
β« 30 pts: wiener deconvolution
β« 20 pts: Energy function derivation for the TV deconvolution
β« 30 pts: Implementation of the TV deconvolution
β« 20 pts: Report
Your homework will be scored based on your report, and I am not going to compile or run your code. Thus, your
report must include all necessary details of your implementation and results.