## 3 Methodology of the Proposed Concept
### Adaptive Histogram Equalization  
In this study, adaptive histogram equalization (AHE) was utilized to increase the local contrast and increase the aspects of edges in each section of a thermal image. This method splits the target image into tiles, and the histogram of each tile is used to generate the  
Figure 7: The histogram equalization technique. intensity remapping function for the respective tile [44]. This intensity remapping performs bilinear interpolation to smooth the inter-tile boundaries, because the basis of contrast enhancement of AHE depends on small regions, based on their local CDF [45]. Moreover, AHE enhances the local contrast and definitions of edges in each region of an image [46]. The AHE enhances the contrast of the images, which aims to provide a linear trend in the cumulative probability function associated with the image. By comparison, the histogram equalization improves on the entire image, while AHE operates on small regions in an image, called tiles. AHE enhances the contrast of each tile and redistributes the lightness values of the image. If the \(f_{i}\) gray value of the \(i\)th gray level in the original image, the position \(j\) of the mapped gray level \(g_{j}\) is given by the ratio of \(\sum_{k=0}^{i-1}p_{k}\) and \(\sum_{k=i+1}^{m-1}p_{k}\) where \(m\) is the number of gray levels in the original image. Then, \(i\) and \(j\) are compared to achieve a uniform distribution or local uniform distribution; if \(j<i\), then the gray color mapping proceeds; otherwise, \((j>i)\), then the gray mapping recedes. \[j=(m-1)\frac{\sum_{k=0}^{i-1}p_{k}}{\sum_{k=0}^{i-1}p_{k}+\sum_{k=i+1}^{m-1}p_ {k}} \tag{7}\]  
When it comes to image segmentation, gray-level thresholding is a technique that is both efficient and accurate. It is a simple and widely used method that is both efficient and accurate. Furthermore, it is quick and easy to use. Consequently, because the quality of gray-level thresholding of an image is such a critical issue, choosing the appropriate gray-level threshold variance is critical. It is possible to successfully remove the unnecessary segments of an image using the automatic gray-level thresholding technique described in this paper. Note: Basically, a good threshold can be selected if the provided histogram characteristics are tall, narrow, symmetric, and separated by deep valleys. Additionally, the thermal image is in uint8. Therefore, it was transformed into uint16 using the function \"im2 uint16\". The Algorithm 2 implemented the data mining layer, as specified above. The MATLAB functions were used to carry out the procedures. Grayscaling is accomplished using the \"_rgb2 gray_\" function, histogram equalization is implemented using the \"_histeq_\" function, and adaptive histogram equalization used the \"_adapthisteq_\" function. Finally, the gray-level thresholding was performed using the \"_graythresh_\" function. Each step of Algorithm 2 is briefly described. These syntaxes are documented in the MATLAB Documentation ([[https://help.mathworks.com/matlab/](https://help.mathworks.com/matlab/)]([https://help.mathworks.com/matlab/](https://help.mathworks.com/matlab/)) (accessed on 7 January 2021)). **Algorithm 2. ** Data mining layer  
The steps are as follows:  
**Step 1: Load the pre-processed dataset from Algorithm 1 and assign it as \(P_{D}\). **  
**Step 2: Grayscaling of image. **  
In this study, grayscale (\(GS\)) representations are frequently used for extracting descriptors rather than directly operating on color images because grayscale simplifies the algorithm and reduces computational requirements. The MATLAB function \"_rgb2 gray_\" was utilized to convert the sample image to a grayscale image, which removes the hue and saturation content information while retaining the luminance. Equation (8) provided the grayscale implementation (\(GS_{I}\)). \[GS_{I}=(P_{D}\ ^{*}\ GS) \tag{8}\]  
Note: The operator \"_\"\" in Equation (8) shows that the image dataset is subjected to the MATLAB function of grayscaling. **Step 3: Histogram Equalization.