Thermal Infrared-Image-Enhancement Algorithm Based on Multi-Scale Guided Filtering

: Obtaining thermal infrared images with prominent details, high contrast, and minimal background noise has always been a focal point of infrared technology research. To address issues such as the blurriness of details and low contrast in thermal infrared images, an enhancement algorithm for thermal infrared images based on multi-scale guided filtering is proposed. This algorithm fully leverages the excellent edge-preserving characteristics of guided filtering and the multi-scale nature of the edge details in thermal infrared images. It uses multi-scale guided filtering to decompose each thermal infrared image into multiple scales of detail layers and a base layer. Then, CLAHE is employed to compress the grayscale and enhance the contrast of the base layer image. Then, detail-enhancement processing of the multi-scale detail layers is performed. Finally, the base layer and the multi-scale detail layers are linearly fused to obtain an enhanced thermal infrared image. Our experimental results indicate that, compared to other methods, the proposed method can effectively enhance image contrast and enrich image details, and has higher image quality and stronger scene adaptability.


Introduction
Infrared thermal imaging technology plays a crucial role in medical examinations [1], firefighting and rescue [2], and target detection [3], among others.Infrared thermal imaging technology is characterized by its independence from illumination and its ability to operate around the clock [4].It can compensate for the shortcomings of visible-light cameras, which struggle to function normally in special environments such as smoke, night-time, and strong light [5].Limited by the performance constraints of infrared systems and disturbances from external environments, thermal infrared images often suffer from low overall contrast, poor visual effects, and blurred details compared to visible-light images [6].These issues significantly impact the subsequent observation and target detection of thermal infrared images.Therefore, it becomes particularly necessary to enhance the detail features of thermal infrared images, increase image contrast, and reduce noise through algorithms.
In the field of image enhancement, histogram equalization (HE) is one of the most classical algorithms.HE tries to balance the distribution probability of the pixels within each grey level by redistributing the grey values of the image, so as to enhance the average grey difference between the pixels and enhance the contrast of the image [7].However, conventional HE may lose important target details while enhancing image contrast, cause image brightness shift, and amplify noise in the image background [8].In order to solve the problem with HE algorithm enhancement, many scholars have researched and innovated it.Kim [9] proposed Brightness-Preserving Bi-Histogram Equalization (BBHE), which divides the image into two subgraphs to perform the HE algorithm separately, avoiding fine target under-enhancement, but the enhancement process generates noise.Stark [10] Fire 2024, 7, 192 2 of 13 proposed Adaptive Histogram Equalization (AHE) by calculating the local histogram of the image for equalization, which better preserves the image details, but it does not solve the problem of amplifying the image noise.In order to further reduce the noise generated by the histogram equalization algorithm, Zuiderveld [11] proposed Contrast-Limited Adaptive Histogram Equalization (CLAHE).By implementing contrast limitation, CLAHE prevents the excessive enhancement of local contrast during the histogram equalization process, effectively avoiding loss of detail and noise issues in certain regions of the image.Additionally, to eliminate the boundary effects caused by local processing, CLAHE employs bilinear interpolation techniques for smooth transitions between adjacent processing windows, thus ensuring the visual continuity of the image.Zhang [12] proposed a platform histogram equalization algorithm based on brightness segmentation.According to the characteristics of the human visual system's perception of brightness, the image is divided into different brightness areas.Each brightness area is enhanced, effectively balancing the display of details in the dark and bright areas of the image.These improvements to the histogram equalization algorithm have significantly mitigated the drawbacks of the traditional HE algorithm.
Although the histogram equalization-related algorithm can enhance the overall contrast of the infrared image, the histogram equalization related algorithm does not consider the edge characteristics of the image, resulting in poor edge effects in the processed image [13].Therefore, the Unsharp Mask (UM) method based on the idea of image layering has been widely used for the purpose of thermal infrared-image enhancement.This method effectively highlights the details in the image and improves its visual effect by performing multi-level decomposition and reconstruction of the image.However, despite the significant advantages of this method in detail enhancement, the use of linear filtering may cause blurring in the edge areas of the image.This blurring can lead to halos around the edges, making parts of the image appear unnatural and affecting the overall effect.To solve this problem, many researchers have proposed nonlinear filters that can maintain edges and combine additional information to adjust the gain of different regions to obtain better image enhancement effects.Branchitta [14] proposed the method of using a bilateral filter (BF) with edge preservation properties to replace the traditional linear filtering method for the hierarchical processing of image data.The image-enhancement effect is achieved by performing Gamma transformation on the separated detail layer and background layer with different parameters and then fusing them.Although bilateral filtering has achieved certain results, bilateral filtering has a gradient reversal problem.
Zuo et al. [15] introduced adaptive Gaussian filtering into bilateral filtering and proposed a method based on bilateral filtering and adaptive detail enhancement (BF&DDE).This method effectively suppresses the gradient reversal effect that occurs at strong edges of the image after bilateral filtering.However, it still does not completely eliminate this phenomenon and has a high computational cost.He et al. [16] proposed the Guided Filter (GF) technique, which enhances the role of the guide image, ensuring that the output image better aligns with the gradient information of the guide image.This effectively preserves edge details and avoids the occurrence of artifacts that may arise from bilateral filtering.Subsequently, Ren [17] used a weighted-variance-guided filter for image decomposition and Non-Local Means (NLM) for detail enhancement.Although this method eliminates noise, it does not effectively improve contrast.Jiang et al. [18] proposed a method for enhancing maritime infrared target images based on guided filtering.This method addresses the issue of edge blurring by using Gaussian filtering and utilizes the target feature-extraction image as the guided image, thereby effectively enhancing the detectability of maritime targets and improving image clarity.However, the process of extracting the target feature image requires a significant amount of computational time.Ouyang et al. [19] proposed an infrared-image detail-enhancement algorithm based on parameter-adaptive guided filtering.This algorithm suppresses noise through a noise mask function and improves the adaptability of guided filtering to different scenes using adaptive parameters.Although this method effectively enhances images, the guided filtering with a single parameter size is insufficient to fully represent the complex spatial structure information of infrared images.
Aiming to overcome the shortcomings of the above algorithms, in order to avoid under-enhancement and over-enhancement while enhancing the contrast and brightness of the image, and to further highlight the detailed information of the image, multi-scale guided filtering for thermal infrared-image enhancement (MSGF-TIR) is proposed.This method uses multi-scale guided filtering to decompose thermal infrared images into detail layers of small, medium, and large scales, as well as a base layer.For the base layer image, CLAHE is used to effectively improve the image contrast level; for the detail layer images, dynamic linear transformation is utilized to enhance the edges and details of the images.Finally, the multi-scale detail layer and the background layer images are weight-fused to generate a detail-enhanced image, and the algorithm flow chart is shown in Figure 1.
Fire 2024, 7, x FOR PEER REVIEW 3 of 13 adaptive parameters.Although this method effectively enhances images, the guided filtering with a single parameter size is insufficient to fully represent the complex spatial structure information of infrared images.Aiming to overcome the shortcomings of the above algorithms, in order to avoid under-enhancement and over-enhancement while enhancing the contrast and brightness of the image, and to further highlight the detailed information of the image, multi-scale guided filtering for thermal infrared-image enhancement (MSGF-TIR) is proposed.This method uses multi-scale guided filtering to decompose thermal infrared images into detail layers of small, medium, and large scales, as well as a base layer.For the base layer image, CLAHE is used to effectively improve the image contrast level; for the detail layer images, dynamic linear transformation is utilized to enhance the edges and details of the images.Finally, the multi-scale detail layer and the background layer images are weight-fused to generate a detail-enhanced image, and the algorithm flow chart is shown in Figure 1.

Multi-Scale Guided Filtering
Guided filtering is a filtering method based on the local linear model [20].It assumes that any pixel has a certain linear relationship with the pixels in its local neighborhood.During the construction of the convolution kernel, a guidance image is introduced to determine the weights in the weighted average operation.The effectiveness of guided filtering largely depends on the choice of the guidance image, which can be an image related to the original image or the original image itself to be filtered.When the guidance image is chosen as the image to be processed itself, guided filtering can effectively preserve the edge information of the image.Compared to bilateral filtering, guided filtering can more effectively avoid the gradient reversal phenomenon while preserving image edges, offering superior edge preservation.
Through the guided-filtering technique, the original image  can be decomposed into a base layer  containing the image contours and a detail layer  including details and noise, expressed as p q e =+ (1) In this formula, the base layer  is the result of guided filtering.It is assumed that there is a local linear model between the base layer  and the guidance image, which can be expressed as

Multi-Scale Guided Filtering
Guided filtering is a filtering method based on the local linear model [20].It assumes that any pixel has a certain linear relationship with the pixels in its local neighborhood.During the construction of the convolution kernel, a guidance image is introduced to determine the weights in the weighted average operation.The effectiveness of guided filtering largely depends on the choice of the guidance image, which can be an image related to the original image or the original image itself to be filtered.When the guidance image is chosen as the image to be processed itself, guided filtering can effectively preserve the edge information of the image.Compared to bilateral filtering, guided filtering can more effectively avoid the gradient reversal phenomenon while preserving image edges, offering superior edge preservation.
Through the guided-filtering technique, the original image p can be decomposed into a base layer q containing the image contours and a detail layer e including details and noise, expressed as In this formula, the base layer q is the result of guided filtering.It is assumed that there is a local linear model between the base layer q and the guidance image, which can be expressed as Fire 2024, 7, 192 In this formula, k represents a certain pixel in the guidance image I, and ω k refers to the neighborhood centered at k with a radius of r; a k and b k are the parameters of the model.
By deriving this linear relationship, we can obtain the gradient relationship: The result indicates that the gradient of the filtered base layer q is highly consistent with the gradient of the guidance image I, where the parameter a k plays a decisive role in the similarity of the gradients.When a k is greater than 1, the filtering can maintain the gradient details of the image; when a k is less than 1, it mainly achieves smoothing of the image.
The core of the guided filter algorithm lies in the accurate calculation of the linearmodel coefficients a k and b k , ensuring that the output image q after filtering is as close as possible to the original input image p.This process is accomplished by constructing a cost function within the window ω k that minimizes the cost, which is expressed as In this formula, ε is a regularization factor used to prevent a k from becoming too large and causing overfitting.The coefficients a k and b k are solved using the method of least squares, resulting in In this formula, |ω| represents the total number of pixels within the local window.σ 2 k and µ k , respectively, represent the variance and the mean gray level of the pixels of the guidance image I within the window ω k , and p k represents the average gray level of the input image p within the same window ω k .Since a given pixel will appear in multiple local windows, its pixel value is actually determined by the values from these windows collectively.To accurately compute the final pixel value for this specific point, it is necessary to first calculate the linear function values corresponding to all windows that include this pixel.Then, by averaging these function values, the formula is expressed as When the guidance image used is the original image itself, the coefficients a k and b k of the filtering function simplify to In guided filtering, ϵ is a key parameter.When ϵ is 0, the output image q i is consistent with the original image p i , indicating that no filtering has been applied.As the value of ϵ increases, the output image q i tends towards the average gray level µ k of its region, achieving an effect similar to mean filtering.Choosing an appropriate ϵ value is crucial as it ensures that in the smooth areas of the image, the output image q i is mainly influenced by the regional average gray level µ k , while in areas of high contrast, the coefficient a k approaches 1, ensuring consistency of the output image q i with the original image p i and effectively preserving the edge information in the image [21].
The edge details in thermal infrared images have multiple scales, and if the edge details of all scales are mixed and processed for uniform enhancement, it lacks robustness and will inevitably destroy some of the image information.Therefore, this paper adopts a layer-by-layer decomposition method, as shown in Figure 2. Thermal infrared images are processed using multi-scale guided filtering to obtain the base layers B1, B2, and B3, from which the edge details at a small scale (D1), medium scale (D2), and large scale (D3) are extracted for subsequent enhancement processing.
image   and effectively preserving the edge information in the i The edge details in thermal infrared images have multiple sc tails of all scales are mixed and processed for uniform enhancem and will inevitably destroy some of the image information.Theref layer-by-layer decomposition method, as shown in Figure 2. Ther processed using multi-scale guided filtering to obtain the base lay which the edge details at a small scale (D1), medium scale (D2), extracted for subsequent enhancement processing.

Enhancement of the Base Layer Based on CLAHE
The CLAHE algorithm is an extension of the AHE algorithm dressing the noise and over-enhancement issues that may arise w Using the multi-scale layer-by-layer decomposition method shown in Figure 2, the thermal infrared image I is decomposed into detail layers of small, medium, and large scales, as well as a base layer, with the decomposition effect shown in Figure 3.
In guided filtering,  is a key parameter.When  is 0, the output image   is consistent with the original image   , indicating that no filtering has been applied.As the value of  increases, the output image   tends towards the average gray level   of its region, achieving an effect similar to mean filtering.Choosing an appropriate  value is crucial as it ensures that in the smooth areas of the image, the output image   is mainly influenced by the regional average gray level   , while in areas of high contrast, the coefficient   approaches 1, ensuring consistency of the output image   with the original image   and effectively preserving the edge information in the image [21].
The edge details in thermal infrared images have multiple scales, and if the edge details of all scales are mixed and processed for uniform enhancement, it lacks robustness and will inevitably destroy some of the image information.Therefore, this paper adopts a layer-by-layer decomposition method, as shown in Figure 2. Thermal infrared images are processed using multi-scale guided filtering to obtain the base layers B1, B2, and B3, from which the edge details at a small scale (D1), medium scale (D2), and large scale (D3) are extracted for subsequent enhancement processing.Using the multi-scale layer-by-layer decomposition method shown in Figure 2, the thermal infrared image  is decomposed into detail layers of small, medium, and large scales, as well as a base layer, with the decomposition effect shown in Figure 3.  -d) are normalized for ease of observation.

Enhancement of the Base Layer Based on CLAHE
The CLAHE algorithm is an extension of the AHE algorithm, primarily aimed at addressing the noise and over-enhancement issues that may arise when the AHE algorithm processes images [22].The core of the CLAHE algorithm involves limiting the contrast to redistribute the histogram of the image and performing histogram equalization on each  b-d) are normalized for ease of observation.

Enhancement of the Base Layer Based on CLAHE
The CLAHE algorithm is an extension of the AHE algorithm, primarily aimed at addressing the noise and over-enhancement issues that may arise when the AHE algorithm processes images [22].The core of the CLAHE algorithm involves limiting the contrast to redistribute the histogram of the image and performing histogram equalization on each small block separately.Finally, these blocks are reconnected through bilinear interpolation, thereby eliminating the blocky effect.The steps are as follows: 1.
Segment the original image into (n × n) non-overlapping, equal-sized blocks.

2.
Calculate the histogram for each block separately.3.
Compute the clipping limit T In this formula, the number of pixels in the x direction within a block is denoted by n x ; the number of pixels in the y direction within a block is denoted by n y ; the number of gray levels is represented by K; and the clipping coefficient is denoted by c.

4.
Clip the histogram and distribute the pixels.In each of the segmented blocks, clip the histogram h(n) according to the clipping limit, and then distribute the number of pixels clipped from each gray level evenly, as shown in Figure 4.
1. Segment the original image into ( × ) non-overlapping, equal-sized blo 2. Calculate the histogram for each block separately.3. Compute the clipping limit .

𝑇 = 𝑐 × 𝑛 𝑥 𝑛 𝑦 𝐾
In this formula, the number of pixels in the  direction within a block is d   ; the number of pixels in the  direction within a block is denoted by   ; th of gray levels is represented by ; and the clipping coefficient is denoted by .
4. Clip the histogram and distribute the pixels.In each of the segmented bloc histogram ℎ() according to the clipping limit, and then distribute the pixels clipped from each gray level evenly, as shown in Figure 4.In this formula, the total number of pixels exceeding the clipping limit  by ; the number of pixels allocated on average to each gray level is represen and the histogram after redistribution is represented by ℎ ′ ().Then, we have: Performed histogram equalization on each sub-block after the pixels hav distributed.6.To avoid block artifacts in the processed image, carry out interpolation ca to determine the values of pixels in each sub-block, as shown in Figure 5.The pixels in the four corner areas marked in black are calculated using th function of their respective sub-blocks.For the pixels in the four edge areas In this formula, the total number of pixels exceeding the clipping limit T is denoted by S; the number of pixels allocated on average to each gray level is represented by A; and the histogram after redistribution is represented by h ′ (x).Then, we have: 5.
Performed histogram equalization on each sub-block after the pixels have been redistributed.6.
To avoid block artifacts in the processed image, carry out interpolation calculations to determine the values of pixels in each sub-block, as shown in Figure 5.
In this formula, the number of pixels in the  direction within a blo   ; the number of pixels in the  direction within a block is denoted by of gray levels is represented by ; and the clipping coefficient is denoted 4. Clip the histogram and distribute the pixels.In each of the segmente histogram ℎ() according to the clipping limit, and then distribut pixels clipped from each gray level evenly, as shown in Figure 4.The pixels in the four corner areas marked in black are calculated us function of their respective sub-blocks.For the pixels in the four edge  The pixels in the four corner areas marked in black are calculated using the mapping function of their respective sub-blocks.For the pixels in the four edge areas marked in white, the mapping functions of the two adjacent sub-blocks are used for transformation, followed by a linear interpolation operation between the two obtained mapping values.The formula is as follows: In this formula, the pixel value of the point being calculated is denoted by f (x, y); the mapping values obtained from the transformation using the mapping functions of the two adjacent sub-blocks are denoted by f 1 and f 2 ; and the center pixel coordinates of the two adjacent sub-blocks are denoted by (x 1 , y 1 ) and (x 2 , y 2 ).
The pixel values in the center area marked in gray are transformed using the mapping functions of the four surrounding adjacent sub-blocks.Then, the four obtained mapping values are processed using bilinear interpolation, and the processing formula is as follows: In this formula, f ′ 1 , f ′ 2 , f ′ 3 , and f ′ 4 represent the mapping values obtained for the point through the transformation using the mapping functions of the four surrounding sub-blocks.

Detail Layer Enhancement Based on Dynamic Linear Enhancement
Since the detail layer only retains texture and edge information, without containing the wide-range brightness distribution of the image, continuing to enhance the detail layer with CLAHE may lead to inconsistent brightness and contrast changes in different areas of the image, failing to meet the requirements.Therefore, to overcome these issues, a new dynamic enhancement method is proposed.This method dynamically adjusts the contrast based on the image's average brightness, thereby better maintaining the image's naturalness and global consistency.The steps of the algorithm are as follows: (1) Average brightness calculation.Calculate the average intensity µ of the input image I.
The calculation formula is as follows: In this formula, N is the total number of pixels in the image, and I i is the brightness value of the i-th pixel.
(2) Contrast Adjustment.Adjust the contrast of the image using the contrast factor α If the contrast factor is greater than 1, the contrast is enhanced.If the contrast factor is less than 1, the contrast is reduced.The adjusted image I adj is calculated as follows: In this formula, I(x, y) is the original brightness value of the pixel at coordinates (x, y) in the image, and I adj (x, y) is the adjusted brightness value of the corresponding pixel.This process adjusts the brightness of pixels relative to the average intensity of the image, thereby changing the contrast of the image.
(3) Return the adjusted image.After the above steps, an image with adjusted contrast is obtained, where the intensity of each pixel has been dynamically linearly transformed based on the contrast factor provided by the user, offering a certain degree of flexibility.

Image Fusion
The primary objective of the image-detail-enhancement algorithm is to address issues such as low contrast and poor detail in traditional thermal infrared images.In this process, the CLAHE algorithm effectively compresses the image's grayscale range by limiting contrast enhancement during histogram equalization, thereby improving the overall visibility of the image.Dynamic linear enhancement is applied to multi-scale detail layers to intensify the edge detail information of the image and enhance the presentation of the detail layer.Through weighted fusion of the base layer processed with CLAHE and the enhanced multi-scale detail layers, an enhanced image is obtained.The weighted fusion formula is as follows: In this formula, I is the final fused output image, I B is the enhanced base layer, I D is the enhanced multi-scale detail layer, and p and q are the fusion coefficients, which can be selected according to different scenarios and requirements.

Results
To verify and evaluate the effectiveness of the proposed algorithm in enhancing thermal infrared images, we selected three groups of thermal infrared images for experimental analysis.The first group of scenes was captured with an iRay T3-Pro camera, while the second and third groups of scenes were derived from the FLIR dataset [24].The experiment was conducted on a Windows 10 operating system, using hardware configured with an AMD Ryzen 7 5800H processor equipped with Radeon Graphics, clocked at 3.20 GHz.We compared these three groups of thermal infrared images from both subjective and objective perspectives.The subjective evaluation was based on direct visual observation of the processed images by the human eye.The objective assessment was conducted using image quality assessment metrics, including the Peak Signal-to-Noise Ratio (PSNR), Information Entropy (IE), Average Gradient (AG), and the Perception-based Image Quality Evaluator (PIQE) [25].The experiment compared the algorithm proposed in this paper with HE, Detail Enhancement based on Guided Filtering (GF&DDE) [26], and Detail Enhancement based on Bilateral Filtering (BF&DDE) [14].

•
Peak Signal-to-Noise Ratio PSNR is a metric commonly used to evaluate the quality of images and videos.It measures the quality loss of an image by comparing the original image to a compressed or processed image.Specifically, PSNR is the logarithmic value of the ratio between the peak signal energy and the average noise energy.The higher the PSNR value, the better the image quality [27].The calculation formula is as follows: In this formula, I(i, j) represents the pixel value of the original image, I m (i, j) repre- sents the processed pixel value, and n is the number of gray levels in the image.

•
Information Entropy IE is a metric used to measure the amount of information and the complexity of details contained in an image [28].Based on information theory, it determines the average information content of an image by calculating the probability distribution of its grayscale levels or color values.The higher the value of information entropy, the more information the image contains.The formula for calculating information entropy is as follows: In this formula, n is the number of gray levels in the image, and p(x i ) is the probability of the occurrence of gray level i in the image.

• Average Gradient
The average gradient can be used to assess the edge information and clarity of an image [29].It represents the average rate of change in grayscale or color between adjacent pixels in the image, reflecting the variation in small details in multiple dimensions [30].The higher the value, the greater the clarity of the image details.The specific calculation steps are as follows: Assume the rows and columns of an image are m and n respectively; the average gradient can be represented as In this formula, H(i, j) represents the grayscale value of the image in the i-th row and j-th column.

Subjective Evaluation
The enhancement effects of various algorithms on Scene 1 are shown in Figure 6.Scene 1 features buildings, with the original image being dark and lacking in contrast.After processing with HE, the overall image becomes overexposed and whitened.The images processed with GF&DDE and BF&DDE have improved brightness, but the contrast in dark areas remains low.The contrast enhancement of the algorithm proposed in this paper is significant without overexposure; the details in the dark areas are clear and visible, achieving a better result.
Fire 2024, 7, x FOR PEER REVIEW 9 of 13 In this formula,  is the number of gray levels in the image, and (  ) is the probability of the occurrence of gray level  in the image.

• Average Gradient
The average gradient can be used to assess the edge information and clarity of an image [29].It represents the average rate of change in grayscale or color between adjacent pixels in the image, reflecting the variation in small details in multiple dimensions [30].The higher the value, the greater the clarity of the image details.The specific calculation steps are as follows: Assume the rows and columns of an image are  and  respectively; the average gradient can be represented as In this formula, (, ) represents the grayscale value of the image in the -th row and -th column.

Subjective Evaluation
The enhancement effects of various algorithms on Scene 1 are shown in Figure 6.Scene 1 features buildings, with the original image being dark and lacking in contrast.After processing with HE, the overall image becomes overexposed and whitened.The images processed with GF&DDE and BF&DDE have improved brightness, but the contrast in dark areas remains low.The contrast enhancement of the algorithm proposed in this paper is significant without overexposure; the details in the dark areas are clear and visible, achieving a better result.
In this formula,  is the number of gray levels in the image, and (  ) is the probability of the occurrence of gray level  in the image.

• Average Gradient
The average gradient can be used to assess the edge information and clarity of an image [29].It represents the average rate of change in grayscale or color between adjacent pixels in the image, reflecting the variation in small details in multiple dimensions [30].The higher the value, the greater the clarity of the image details.The specific calculation steps are as follows: Assume the rows and columns of an image are  and  respectively; the average gradient can be represented as In this formula, (, ) represents the grayscale value of the image in the -th row and -th column.

Subjective Evaluation
The enhancement effects of various algorithms on Scene 1 are shown in Figure 6.Scene 1 features buildings, with the original image being dark and lacking in contrast.After processing with HE, the overall image becomes overexposed and whitened.The images processed with GF&DDE and BF&DDE have improved brightness, but the contrast in dark areas remains low.The contrast enhancement of the algorithm proposed in this paper is significant without overexposure; the details in the dark areas are clear and visible, achieving a better result.The enhancement effects of the various algorithms on Scene 3 are shown in Figure 8, which includes pedestrians, trees, and buildings.After processing with HE, it is difficult to distinguish pedestrians from the background in the image.Both GF&DDE and BF&DDE increase the brightness of the image but do not effectively enhance the contrast, making it hard to distinguish pedestrians from background objects, and the overall image is too bright.The algorithm proposed in this article improves the details in dark areas (trees, grass) and avoids increasing the overall brightness of the image, making it easier to distinguish people from the background and providing a better visual effect.The enhancement effects of the various algorithms on Scene 3 are shown in Figure 8, which includes pedestrians, trees, and buildings.After processing with HE, it is difficult to distinguish pedestrians from the background in the image.Both GF&DDE and BF&DDE increase the brightness of the image but do not effectively enhance the contrast, making it hard to distinguish pedestrians from background objects, and the overall image is too bright.The algorithm proposed in this article improves the details in dark areas (trees, grass) and avoids increasing the overall brightness of the image, making it easier to distinguish people from the background and providing a better visual effect.Overall, Figures 5a, 6a, and 7a respectively depict scenes of high-rise buildings, cars, and a person walking.After processing with the proposed algorithm, the boundaries between windows and buildings in the first scene become clearer; the contours and details of the headlights and body in the second scene are more distinct, and the texture details of the background trees are preserved; the contour of the person in the third scene is clear, and the surrounding buildings and trees also exhibit certain texture features.Each image demonstrates different textures and details, indicating that the proposed algorithm performs well in various scenarios.

Objective Assessment
The quality of algorithms cannot be solely judged by subjective human evaluation [31]; objective evaluation parameters are also necessary, such as PSNR, AG, and IE.PSNR is used to measure image quality, IE measures the amount of information contained in the image, and AG measures the clarity of the image.Although these metrics have their advantages in evaluating image-enhancement effects, they do not fully reflect the perceptual quality of the image.Therefore, this paper introduces PIQE as a complementary indicator.While AG and IE focus on specific aspects of the image, such as clarity and information content, PIQE provides a holistic quality assessment approach.It is based on human visual perception to evaluate image quality and can better reflect the subjective quality of the image [25].PIQE considers the degree of distortion in the image, such as noise, blur, and block effects, making the evaluation results more aligned with the actual perception of the human eye.The evaluation results are presented in Table 1.Overall, Figure 5a, Figure 6a, and Figure 7a respectively depict scenes of high-rise buildings, cars, and a person walking.After processing with the proposed algorithm, the boundaries between windows and buildings in the first scene become clearer; the contours and details of the headlights and body in the second scene are more distinct, and the texture details of the background trees are preserved; the contour of the person in the third scene is clear, and the surrounding buildings and trees also exhibit certain texture features.Each image demonstrates different textures and details, indicating that the proposed algorithm performs well in various scenarios.

Objective Assessment
The quality of algorithms cannot be solely judged by subjective human evaluation [31]; objective evaluation parameters are also necessary, such as PSNR, AG, and IE.PSNR is used to measure image quality, IE measures the amount of information contained in the image, and AG measures the clarity of the image.Although these metrics have their advantages in evaluating image-enhancement effects, they do not fully reflect the perceptual quality of the image.Therefore, this paper introduces PIQE as a complementary indicator.While AG and IE focus on specific aspects of the image, such as clarity and information content, PIQE provides a holistic quality assessment approach.It is based on human visual perception to evaluate image quality and can better reflect the subjective quality of the image [25].PIQE considers the degree of distortion in the image, such as noise, blur, and block effects, making the evaluation results more aligned with the actual perception of the human eye.The evaluation results are presented in Table 1.
From the PSNR metric, in all scenarios, our algorithm and the BF&DDE algorithm show higher PSNR values, indicating that they are better at preserving image quality and information.The HE algorithm has the lowest PSNR values, suggesting its reconstructed image quality is relatively low.Looking at the IE metric, our algorithm exhibits higher values, indicating that it can retain more information and details in the image.From the AG metric, due to the HE algorithm's over-enhancement, it results in a too-high average gradient, whereas our algorithm generally performs well in terms of average gradient.Regarding the PIQE metric, our algorithm achieves the best results in most cases.

Figure 2 .Figure 3 .
Figure 2. Multi-scale extraction of detail layers and base layers of therma

Figure 2 .
Figure 2. Multi-scale extraction of detail layers and base layers of thermal infrared images.

Figure 2 .
Figure 2. Multi-scale extraction of detail layers and base layers of thermal infrared images.

Figure 3 .
Figure 3. Extraction effect of multi-scale detail layers and basic layer.(a) Original image.(b) Smallscale detail layer.(c) Medium-scale detail layer.(d) Large-scale detail layer.(e) Base layer, where (b-d) are normalized for ease of observation.

Figure 3 .
Figure 3. Extraction effect of multi-scale detail layers and basic layer.(a) Original image.(b) Smallscale detail layer.(c) Medium-scale detail layer.(d) Large-scale detail layer.(e) Base layer, where (b-d) are normalized for ease of observation.

Figure 6 .Figure 7 .
Figure 6.(a) Original image; (b) HE; (c) GF&DDE; (d) BF&DDE; (e) our algorithm.The enhancement effects of the various algorithms on Scene 2 are shown in Figure7.Scene 2 includes information about vehicles and trees.The image processed with HE shows overexposure, especially in the main body of the vehicle.GF&DDE, BF&DDE, and the algorithm proposed in this paper have similar effects on Scene 2, but the algorithm proposed in this paper performs better on the vehicle headlights and emblems, with clearer object contours.

Figure 6 .
Figure 6.(a) Original image; (b) HE; (c) GF&DDE; (d) BF&DDE; (e) our algorithm.The enhancement effects of the various algorithms on Scene 2 are shown in Figure7.Scene 2 includes information about vehicles and trees.The image processed with HE shows overexposure, especially in the main body of the vehicle.GF&DDE, BF&DDE, and the algorithm proposed in this paper have similar effects on Scene 2, but the algorithm proposed in this paper performs better on the vehicle headlights and emblems, with clearer object contours.

Figure 6 .Figure 7 .
Figure 6.(a) Original image; (b) HE; (c) GF&DDE; (d) BF&DDE; (e) our algorithm.The enhancement effects of the various algorithms on Scene 2 are shown in Figure7.Scene 2 includes information about vehicles and trees.The image processed with HE shows overexposure, especially in the main body of the vehicle.GF&DDE, BF&DDE, and the algorithm proposed in this paper have similar effects on Scene 2, but the algorithm proposed in this paper performs better on the vehicle headlights and emblems, with clearer object contours.