First, let's analyze the problem by formulating it. The model is given by:
$$ \boldsymbol{y} = H \boldsymbol{x} + \boldsymbol{n} $$
Where $ \boldsymbol{y} $ is the given image, $ H $ is an unknown linear shift invariant blur operator, $ \boldsymbol{x} $ is the image we're after and $ \boldsymbol{n} $ is the added noise. We'll assume it is a White Noise (Independent of $ \boldsymbol{x} $ and with no spatial correlation).
Then, the formulation of the problem can be given by:
$$ \arg \min_{H, \boldsymbol{x}} \frac{1}{2} {\left\| H \boldsymbol{x} - \boldsymbol{y} \right\|}_{2}^{2} $$
The main issues with the Blind Deconvolution problem are:
- There is a perfect solution: $ H = I $ and $ \boldsymbol{x} = \boldsymbol{y} $.
- The problem is Ill Posed.
- The problem isn't Convex.
This means we need to add priors. Better have one for the Kernel ($ H $) and for the image ($ \boldsymbol{x} $).
A very popular formulation with priors is given by:
$$\begin{aligned}
\arg \min_{H, \boldsymbol{x}} \quad & \frac{1}{2} {\left\| H \boldsymbol{x} - \boldsymbol{y} \right\|}_{2}^{2} + \lambda {\left\| \boldsymbol{x} \right\|}_{TV} \\
\text{subject to} \quad & H \boldsymbol{1} = \boldsymbol{1} \\
& H \geq 1
\end{aligned}$$
Namely we add the following model / priors:
- The gradients of the looked after image are distributed by Exponential Distribution.
- The blur kernel is a low pass in the meaning its DC component (Its sum) is 1 and its coefficients are non negative.
Remark: In the above formulation the constraint $ H \boldsymbol{1} = \boldsymbol{1} $ could actually be reduced to a single row of $ H $ which contains all coefficients of the kernel. This can be done by assuming the kernel is Spatially Invariant. In case it is invariant then one needs to chose on which rows to employ. Usually excluding borders, etc...
There are some hyper parameters of this model:
- The support of the blurring kernel (
3 x 3
, 5 x 5
, etc..).
- The initial guess for the iterative solver.
By iteratively optimizing:
- Assume a given $ H $ solve for $ \boldsymbol{x} $.
This is just like solving the non blind deblurring problem.
- Assume $ \boldsymbol{x} $ is given and solve for $ H $.
For this you may see my solution for Orthogonal Projection onto the Unit Simplex.
This is not a trivial task to solve. The fine tuning of the solver and hyper parameters requires some experience and domain knowledge.