# Image Processing of UAV Imagery for River Feature Recognition of Kerian River, Malaysia
## 3 Results  
We show the oblique UAV images captured in the present study and visualize the study reach for the present study along with the in-channel structure in Figure 3. Apart from this, we also capture the floodplains, water areas, low vegetation, shrub vegetation, and tree vegetation. We also captured the urban areas around the floodplain on the terrace. The present work only focuses on water area and vegetation growth in order to enumerate their variation. We cropped the study region as per the ROI, maintaining the pixel ratio. Further, in order to remove the noise, we apply a bilateral filter. On application of the bilateral filter, we obscured considerable noise and smoothened the site images. The edge preservation benefit of the bilateral filter paves the way for better clustering. Sunlight and water reflectance that are denoised to an extent by the application of the filter influences the various forms of vegetation along the river basin and flow area. The next step post-implementation of the bilateral filter is the clustering of pixels using the k-means clustering algorithm. The necessity of clustering is that it segregates the largely distributed values of color space into desired numbers of color variation equivalent to the number of clusters (\(k\)). Figure 4 shows the color inspection in RGB color space and HSV color space. The color inspector feature of ImageJ software was used for the aforementioned purpose. Prior to clustering of pixels, it was difficult to extract the RGB or HSV limits, which lead to a decrease in the effectiveness of image segmentation. Extracting the RGB or HSV limits from the color inspector models for the water area and vegetation cover region is extremely tedious work. The researcher needs to analyze every pixel of the image for extracting the limits. Figure 5 shows the images filtered and clustered using a bilateral filter and the k-means clustering algorithm. As per the flowchart in Figure 2, for all the site images, we selected the value of \(k\) randomly from \(k\) = 2 onwards until the clusters appeared unchanged. We increased the number of clusters by 2 and visualized them by human vision. Further, we increased the number of clusters in order to classify the image into an optimum number of color clusters. Finally, we clustered Figure 5a,b with \(k\) = 16 as the images converged at this number of clusters. Further increase in \(k\) produced unchanged cluster centroids as observed by human evaluation. Human visualization incorporated with interpreting elbow graphs produces better results in terms of accuracy in predicting an optimum number of clusters [39]. We identified the optimum number of clusters using an elbow graph in the current work. Post clustering of images, the color inspection of HSV components becomes a simple and effective task. We converted the color space of all the images from RGB to HSV. HSV color space proves useful for robustness, removing shadows, lighting changes, etc., because of the separation of color components from the intensity. Thus, increasing the effectiveness of the image segmentation algorithm. Figure 6 shows the color inspection model in HSV color space for clustered image (\(k\) = 16). Compared to Figure 5, the HSV color inspector post-application of the k-means clustering algorithm (Figure 6) produces a better visual for extraction of HSV limits, which saves the energy and time of the human evaluator. We tabulated the thresholding HSV limits of water area and vegetation for sites S1 and S2 in Table 2 and used these values for image thresholding (Figure 7). Then, we counted the white pixels depicting ROI in thresholded images using a pixel counting algorithm in Python. Finally, we performed the RGB to HSV color space conversion and HSV limit evaluation using ImageJ (Version 1.53c). ImageJ allows the human evaluator to move the pointer over the image, which reflects the HSV value on the color inspector. An image with an optimum number of clusters classifies the features of the image into a clear perspective.