## 3 Blur Kernel Estimation
### Blure Kernel Estimation Algorithm  
#### 3.2.1 Intermediate Latent Image X Estimation  
In order to solve Equation (2), we first need to use the semi-quadratic splitting algorithm [26] to introduce auxiliary variables. Then it is solved by alternating minimization. After introducing auxiliary variables, the equation is shown in Equation (3). \[ \begin{split}(X^{\prime},h^{\prime})=\underset{X,h}{\text{argmin}} \parallel Y-S_{i}GS_{r}\parallel\frac{2}{2}+\lambda(GNR(f_{1}\otimes X)+GNR( f_{2}\otimes X))\\ +\gamma\parallel h\parallel_{2}^{2}+\delta\parallel\Psi^{T}X \parallel_{1}+\varepsilon\parallel h\otimes X-G\parallel_{2}^{2}\end{split}  \tag{3}\]  
When solving the intermediate latent image x, we only need to pay attention to the following parts of the Equation (3). \[ \begin{split}(X^{\prime},h^{\prime})=\underset{X,h}{\text{argmin}} \lambda(GNR(f_{1}\otimes X)+GNR(f_{2}\otimes X))+\delta\parallel\Psi^{T}X \parallel_{1}+\varepsilon\parallel h\otimes X-G\parallel_{2}^{2}\end{split}  \tag{4}\]  
Equation (4) contains the GNR function and the \(L_{1}\) norm. We cannot solve it directly with fast Fourier transform, so auxiliary variables \(W_{i}\) and \(\widetilde{X}\) are introduced. Where \(W\) corresponds to \(f_{i}\otimes X\) and \(\widetilde{X}\) corresponds to \(\Psi^{T}X\). Then, (4) can be transformed into (5):  
\[ \begin{split}\left(X^{\prime},W_{i}^{\prime},\widetilde{X}^{ \prime}\right)=\underset{X,W_{i},\widetilde{X}}{\text{argmin}}\lambda^{\prime }\parallel f_{i}\otimes X-W_{i}\parallel\frac{2}{2}+\lambdaGNR(w_{i})\\ +\delta^{\prime}\parallel\widetilde{X}-\Psi^{T}X\parallel_{2}^{2 }+\delta\parallel\widetilde{X}\parallel_{1}+\varepsilon\parallel h\otimes X-G \parallel_{2}^{2}\end{split}  \tag{5}\]  
where \(\lambda^{\prime}\) and \(\delta^{\prime}\) are the regularization parameters; \(i=1,\ 2\). The above optimization problem can be solved by minimizing \(X\) and \(W_{i}\) and \(\widetilde{X}\), respectively. First, fix the other variables, and \(X\) solves the equation as:  
\[X^{\prime}=\underset{X}{\text{argmin}}\lambda^{\prime}\parallel f_{i}\otimes X -W_{i}\parallel_{2}^{2}+\delta^{\prime}\parallel\widetilde{X}-\Psi^{T}X \parallel_{2}^{2}+\varepsilon\parallel h\otimes X-G\parallel_{2}^{2} \tag{6}\]  
where \(\parallel f_{i}\otimes X-W_{i}\parallel_{2}^{2}=\parallel f_{1}\otimes X-W_{1 }\parallel_{2}^{2}+\parallel f_{2}\otimes X-W_{2}\parallel_{2}^{2}\). We use fast Fourier transform to solve Equation (6):  
\[X=F^{-1}\left(\frac{\lambda^{\prime}F_{W}+\delta^{\prime}F\left(\Psi\widetilde {X}\right)+\varepsilon\overline{F(h)}\circ F(G)}{\lambda^{\prime}F_{f}+\delta ^{\prime}+\varepsilon\overline{F(h)}\circ F(h)}\right) \tag{7}\]  
where \(F_{W}\) is \(\overline{F(f_{1})}\circ F(W_{1})+\overline{F(f_{2})}\circ F(W_{2})\); \(F_{f}\) is \(\overline{F(f_{1})}\circ F(f_{1})+\overline{F(f_{2})}\circ F(f_{2})\); \(F(\cdot)\) and \(F^{-1}(\cdot)\) denote the fast Fourier transform and inverse fast Fourier transform, respectively; \(\overline{F(\cdot)}\) is the complex conjugate operator; \(\circ\) denotes component multiplication, and the division in Equation (7) is component division. After the calculation of \(X\), the \(\widetilde{X}\) can be obtained by:  
\[\widetilde{X}^{\prime}=\underset{\widetilde{X}}{\text{argmin}}\delta^{\prime }\parallel\widetilde{X}-\Psi^{T}X\parallel_{2}^{2}+\delta\parallel\widetilde{ X}\parallel_{1} \tag{8}\]  
We solve for \(\widetilde{X}\) by soft-threshold contraction:  
\[\widetilde{X}=\max\biggl{\{}\left|\Psi^{T}X\right|-\frac{\delta}{2\delta^{ \prime}},0\biggr{\}}\circ\text{sign}\left(\Psi^{T}X\right) \tag{9}\]  
where \(\text{sign}(\cdot)\) is a sign function.