# Performance Comparison of Selected Filters in Fast Denoising of Oil Palm Hyperspectral Data
## 3 Results and Discussion  
The proposed method was executed on a MATLAB 2023b platform running an Intel i7 multicore processor (Intel, Santa Clara, CA, USA). It was applied to hyperspectral data containing 300 bands, and the size of the image of each band was 500 \(\times\) 500 pixels. The homogeneous areas of 50 \(\times\) 50 pixels with the lowest means and stds were searched automatically. For noisy images, the stds of these areas were higher, since they contained higher noise levels than the ones in clean images. After calculating the SNR estimates of all channels, the cleanest channel with the highest SNR was identified. The SNR threshold (Th) for determining noisy channels was set at 30% of the highest SNR. All channels whose SNRs fell below the Th were considered noisy. The maximum number of iterations was set at two. The Th and maximum iteration values were selected by trial and error on an ad hoc basis. For the data in this experiment, the noisy channels were the first 8 channels and the last 40 channels of the hyperspectral data. They were clustered into two groups and processed separately. For each group, the channels were arranged sequentially. The collection of pixel values in a 1D array started from the pixel of the channel with the least noise to the channel with the worst noise. Then, the array of each pixel location was subjected to 1D spectral filtering. This was followed by 1D spatial filtering in horizontal and vertical directions. The 1D spectral and spatial filtering were repeated until the number of iterations exceeded the maximum (Max) allowed. After that, the SNRs of the filtered channels were recalculated. All the noisy channels showed marked improvement. Finally, pixel values in copies of the denoised channels were normalized for display. In the experiments, the maximum number of iterations was limited to two to minimize the execution time and preserve the channel content from excessive filtering. The average SNR gain and execution time after filtering the first and last four channels are given in Tables 1 and 2, respectively. provide an estimate. When the Gaussian assumption on the noises and state of the model is not met, the performance of the Kalman filter becomes suboptimal. However, this does not mean that it will not work, and it can still produce respectable performance. Figure 5: The first four channels and the results of filtering them with [PERSON], Wiener, Savitzky–Golay, wavelet, and cosine filters, row-wise from top to bottom. The Kalman filter does not require both filter length and threshold. In the experiments, the best filter length for Wiener and Savitzky-Golay (SG) filters was five. Increasing it above five would have made the output blurry due to it generating a greater lowpass filtering effect. This is because the Wiener filter depends on the value of the mean of the local neighborhood, which is practically obtained by a lowpass moving average filter. As  
Figure 6: The last four channels and the results of filtering them with [PERSON], Wiener, Savitzky–Golay, wavelet, and cosine filters, row-wise from top to bottom. for the SG filter, it can be viewed as a lowpass FIR filter whose coefficients depend on the polynomial function used. As with any other FIR filters, increasing its size would blur the output. Furthermore, a longer SG filter is much slower to implement since it requires fitting a polynomial to more pixel values by minimizing an error function. Shortening the length of the filters to three would make them too short to be effective. In summary, the filter size of five was obtained by trial and error to produce the best results. Making the size adaptive would lead the algorithm to choose size five eventually, although its execution time would increase considerably. The length of the wavelet filter was fixed at four, since we adopted the Daub4 basis. Changing its size entails changing the basis, which might not be favorable. There was no size for the cosine filter, as the cosine transform was performed on the entire row and column of the channel image.