## 3 Algorithm Development
### Algorithm's Implementation
The so-called group-wise sparsity was proposed where similar patches of image are grouped and processed together Equation (22). It is obvious that the similarity inside the groups enhances the sparsity potential. Within the framework of nonlocal group-wise sparse image modeling, a family of the BM3D algorithms has been developed where the both ideas grouping of similar patches and the transform design are taken into consideration. This type of the algorithms proposed initially for image denoising [54] being modified for various problems demonstrate the state-of-the-art performance [59; 60]. Let us recall some basic ideas of this popular BM3D technique. At the first stage the image is partitioned into small overlapping square patches. For each patch a group of similar patches is collected which are stacked together and form a 3D array (group). This stage is called _grouping_. The entire 3D group-array is projected onto a 3D transform basis. The obtained spectral coefficients are hard-thresholded and the inverse 3D transform gives the filtered patches, which are returned to the original position of these patches in the image. This stage is called _collaborative_ filtering. This process is repeated for all pixels of the entire wavefront and obtained overlapped filtered patches are aggregated in the final image estimate. This last stage is called _aggregation_. The details of BM3D as an advanced image filter can be seen in [54]. It follows from [61; 62], that the above operations including the _grouping_ define the analysis and synthesis transforms which can be combined in a single algorithm. The notation BM3D is used for this filtering algorithm. In Step 3 of the proposed algorithm, \(u_{o,\lambda}^{t+1}=BM3D(u_{o,\lambda}^{t+1/2})\), the BM3D is applied to the complex-valued variables \(u_{o,\lambda}^{t+1/2}\). It is implemented in this paper as independent filtering of amplitude and phase:  
\[|u_{o,\lambda}^{t+1}|=BM3D_{ampl}(|u_{o,\lambda}^{t+1/2}|), \tag{22}\] \[\text{angle}(u_{o,\lambda}^{t+1})=BM3D_{phase}(\text{angle}(u_{o, \lambda}^{t+1/2})),\]  
thus the updated the complex-valued \(u_{o,\lambda}^{t+1}\) is calculated as \(u_{o,\lambda}^{t+1}=|u_{o,\lambda}^{t+1}|\exp(j\text{-angle}(u_{o,\lambda}^{t+ 1/2}))\). In real experimental samples, edges and varying features in phase and amplitude often co-exist in the same image pixels. Then, the joint phase/amplitude sparsity is a more efficient instrument for complex-valued object reconstruction. Novel forms of a BM3D based joint phase-amplitude processing are developed in [63], where the high-order singular value decompositions (HOSVD) are exploited for design of sparse basis functions for complex valued variables without separation phase and amplitude. In Step 4 of the proposed algorithm, \(\varphi_{o}^{t+1}=BM3D(\varphi_{o}^{t+1/2})\), the BM3D is applied for filtering of the real-valued \(\varphi_{o}\). In our experiments the parameters of the algorithm are fixed for all tests. The parameters defining the iterations of the algorithm are as follows: \(\gamma_{1}=1/\chi\), where \(\chi\) is the parameter of the Poissonian distribution, \(\gamma_{1}/\gamma_{2}=0.2\). The parameters of BM3D filters can be seen in [32].