is transformed into the frequency space and the DCT coefficients containing high frequencies are discarded. For a $h \times h$ matrix $\mathbf{V}$, a DCT operation is defined as $$\label{eq:dct_op}
    \mathbf{U} = \mathbf{C} \mathbf{V} \mathbf{C}^T,$$ where $\mathbf{C}$ is called the DCT matrix. Each element in $\mathbf{C}$ is defined as $$\mathbf{C}_{i,j} = \sqrt{\frac{\alpha_i}{d}} \mathrm{cos} \left[ \frac{\pi (2j+1)i}{2h} \right],$$ where $\alpha_i=1$ if $i=0$ and $\alpha_i=2$ otherwise. In order to adapt (\[eq:dct\_op\]) for a rasterized column vector such as $\Delta \mathbf{i}$ (see Sec. \[subsec:jd\]), let $\left[ \mathbf{B}_1, \mathbf{B}_2, \cdots, \mathbf{B}_n \right]$ be a set of matrices, where each matrix $\mathbf{B}$ has the same size as the image template. Assuming a row-major order, all the elements in $\mathbf{B}_n$ are zero except for the $n^{\mathrm{th}}$ element, which is set to a value of 1. Hence, $\mathbf{B}_n$ is a basis of the template in the image space. The matrix $\mathbf{V}$ in (\[eq:dct\_op\]) is substituted with the basis $\mathbf{B}_n$, and the resultant matrix $\mathbf{U}$ is rasterized as a column vector which we denote as $\mathbf{w}$. Stacking these column vectors together produces an $n\times n$ matrix $\mathbf{W}=[\mathbf{w}_1, \mathbf{w}_2, \cdots, \mathbf{w}_n]$, which is used to transform the error matrix $\mathbf{E}$ into the frequency domain: $$\hat{\mathbf{E}} = \mathbf{W} \mathbf{E}.$$

A faster 