# A New Method for 2D-Adapted Wavelet Construction:
## 2 Materials and Methods
### Strategy for Building 2D-Adapted Wavelets  
We propose a strategy based on the tensor product of one-dimensional vectors to execute a 2D DWT (Theorem 1) but with a different approach regarding the detection conditions. In Equation (4), it is observed that the diagonal detail coefficients of the 2D DWT depend on two factors: the image that is decomposed and the one-dimensional high-pass filter \(u\) used in the decomposition. Then, with the aim to obtain a 1D filter that when used in the 2D discrete wavelet transform should be capable of detecting the considered pattern in the diagonal detail coefficients of the 2D DWT, we include four correlation conditions between the filter coefficients \(q\) (1D) and (i) the samples of the 2D pattern in a specific position, (ii) the samples of the 2D pattern in the contiguous position in the horizontal direction, (iii) the samples of the 2D pattern in the contiguous position in the vertical direction, and (iv) the samples of the 2D pattern in the contiguous position in the diagonal direction.  
Therefore, the NLES of the DST-II was modified by substituting two conditions of vanished moments and the two detection conditions with four detection conditions to locate the 2D pattern. This is a novel proposal since, to the best of the author's knowledge, a 2D-adapted wavelet has not been proposed to detect patterns from the DST-II.  
System of Nonlinear Equations for the Proposed 2D Extension  
Let the 2D pattern be \(m[\cdot,\cdot]\) of \(n_{1}\) rows and \(n_{2}\) columns. Since these quantities must be even to have a perfect reconstruction, as in the DST-II, dimensions \(N_{1}\) and \(N_{2}\) are chosen by taking the even number immediately below the original dimensions. Thus, the 1D filter \(q\) has support size \(N=\max\{N_{1},N_{2}\}\), \(N\geq 8\), and is necessarily even.  
The NLES \(\mathbf{F}(q_{0},q_{1},\cdots,q_{N-1})=\mathbf{0}\) of \(N\) equations and \(N\) unknowns, whose solution is the high-pass filter of the 2D-adapted wavelet, is the following:  
* Unit energy to ensure that the _shapelet_ conserves the energy of the signal: \(\left(\sum\limits_{k=0}^{N-1}q_{k}^{2}\right)-1=0\);
* \(\dfrac{N}{2}-4\) vanished moments for an adequate regularity of the _shapelet_: \(\sum\limits_{k=0}^{N-1}q_{k}\cdot k^{b}=0\), where \(b=0,1,\cdots,\dfrac{N}{2}-5\);
* \(\dfrac{N}{2}-1\) orthogonality conditions: \(\sum\limits_{k=0}^{N-1}q_{k}\cdot q_{k+2l}=\delta_{0J}\), where \(\delta\) is the Dirac delta and \(l\in\mathbb{Z}\);
* Four conditions for pattern detection: \[\sum\limits_{i=1}^{N_{1}}\sum\limits_{j=1}^{N_{2}}q_{i}\cdot q_{j} \cdot m_{i,j}=0, \sum\limits_{i=1}^{N_{1}}\sum\limits_{j=1}^{N_{2}}q_{i}\cdot q_{j} \cdot m_{i,j-1}=0,\] \[\sum\limits_{i=1}^{N_{1}}\sum\limits_{j=1}^{N_{2}}q_{i}\cdot q_{j }\cdot m_{i-1,j}=0, \sum\limits_{i=1}^{N_{1}}\sum\limits_{j=1}^{N_{2}}q_{i}\cdot q_{j }\cdot m_{i-1,j-1}=0.\]  
The NLES is solved numerically using the strategy in [37], where an initial approximation obtained by the continuation method is used to start the Newton iterative algorithm. Then, the perfect reconstruction filter bank is obtained as in the 1D case.  
\[p_{k}=(-1)^{k}\cdot q_{N-k-1};\quad\overline{p}_{k}=p_{N-k-1};\quad\overline{q }_{k}=(-1)^{k+1}\cdot p_{k},\quad k=0,1,\cdots,N-1.\]