## 2 Materials and Methods
### Proposed Method
#### 2.3.1 Improved Trilateral Filtering Algorithm Based on Multi-Feature Combination  
The trilateral filtering algorithm is widely used in the fields of noise suppression and image enhancement [18]. Compared with bilateral filtering, trilateral filtering takes into account the local structure features of the image, and better noise suppression or image enhancement effects can be achieved. Based on this, the trilateral filtering algorithm is introduced in this paper to reduce the algorithm pollution effect caused by anomalies in a collaborative representation by taking advantage of the spatial features of hyperspectral images. As the spatial distribution of hyperspectral images also has a certain continuity, there is a certain similarity between the adjacent pixels. The closer the distance between two points, the greater the possibility of similar attributes. Therefore, it can be considered that the neighborhood pixels that are close to the center should also have greater weight coefficients in the representation process. The first term for improved trilateral filtering is given based on the spatial Euclidean distance weight (SEDW). It is expressed in Equation (9). \[SEDW(x,\epsilon)=\exp\left(-\frac{1}{2}\left(\frac{d_{sedw}(x,\epsilon)}{ \sigma_{sedw}}\right)^{2}\right) \tag{9}\]  
where the coordinate of the center point \(x\) is \((i,j)\), \(\epsilon\) is the coordinates of the neighborhood point \((i_{1},j_{1})\); \(\sigma_{sedw}\) is a parameter used to control the contribution of spatial Euclidean distance weight coefficient; and \(d_{sedw}\) represents the Euclidean distance between two points, which is expressed in Equation (10). \[d_{sedw}(x,\epsilon)=\sqrt{\left(i-i_{1}\right)^{2}+\left(j-j_{1}\right)^{2}} \tag{10}\]In the field of digital image processing, it is considered that the closer the gray magnitude of the neighborhood pixel and the center pixel, the more similar the two points are. Thus, a high weight coefficient should also be given in the reconstruction process. However, in hyperspectral images, the spectral curve vector is more important for each pixel point in space. The spectral curve reflects the true attribution of the object, and the difference between spectral curves can more reflect the difference between different points in hyperspectral images. Therefore, the second term in the improved trilateral filtering is given based on the spectral vector difference weight (\(SVDW\)), expressed in Equation (11). \[SVDW(x,\varepsilon)=\exp\left(-\frac{1}{2}\left(\frac{d_{svdw}(x,\varepsilon) }{\sigma_{svdw}}\right)^{2}\right) \tag{11}\]  
where \(\sigma_{svdw}\) is a parameter used to control the contribution of spectral vector difference weight coefficients; and \(d_{svdw}\) represents the spectral vector difference between two points. The expression is in Equation (12). \[ \begin{split} d_{svdw}(x,\varepsilon)=\frac{1}{n}\times\arccos \left(\sum\limits_{i=1}^{n}\frac{(x_{i})^{T}x_{i}}{\sqrt{(x_{i})^{T}x_{i}} \sqrt{(x_{i})^{T}x_{i}}}\right)\\ +\frac{1}{2}\times\left(1-\frac{\sum\limits_{i=1}^{n}\frac{(x_{i }-\overline{x})}{\sqrt{\sum\limits_{i=1}^{n}\frac{(x_{i}-\overline{x})}{2}} \sqrt{\sum\limits_{i=1}^{n}\frac{(x_{i}-\overline{x})^{2}}{2}}}}{\sqrt{\sum \limits_{i=1}^{n}\frac{(x_{i}-\overline{x})^{2}}{2}}}\right)\end{split}  \tag{12}\]  
where, \(\varepsilon_{1}\) and \(x_{1}\) are the \(i\)-th elements in the corresponding spectral curve for the neighborhood points \(\varepsilon\) and the center point \(x\) and \(n\) is the number of spectral bands. For hyperspectral image processing, the effective use of spatial features is also an essential part. The gradient feature is one of the most important features in two-dimensional space. In hyperspectral images, the gradient feature effectively represents the shape and smoothness of different types of objects. Therefore, the third term of the improved trilateral filtering is given, which is based on the local gradient difference (\(LGD\)), and it is expressed in Equation (13).