An infrared image detail enhancement method and device for reducing edge blurring

By detecting edge pixels in infrared image processing, calculating protection thresholds, using guide filters and Gaussian blur processing, the problem of edge blur when infrared image enhances contrast is solved, and image quality and target recognition capabilities are improved.

CN119295360BActive Publication Date: 2025-06-13HANGZHOU AIHUA INSTR
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411820662.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-06-13
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

In the process of enhancing infrared image contrast, the prior art cannot effectively protect the edges of infrared images, resulting in the problem of edge blur.

Method used

By detecting edge pixels in infrared images, the protection threshold is calculated, and filtering is performed using a guide filter during histogram equalization to maintain edge sharpness. At the same time, noise and halo effects are reduced through Gaussian fuzzing.

Benefits of technology

It effectively reduces edge blur, improves the contrast and quality of infrared images, and enhances the target recognition ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295360B_ABST
    Figure CN119295360B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for enhancing infrared image details with reduced edge blurring, relating to the technical field of image processing. It solves the problem in the prior art that the edges of infrared images cannot be effectively protected, resulting in edge blurring being introduced while enhancing the contrast. The method includes: detecting edge pixels and setting a protection threshold, performing guided filtering on the infrared image, enhancing the contrast through histogram equalization and using the protection threshold to protect all pixels in the infrared image during histogram equalization, and finally performing Gaussian blurring. This protects the edge pixels while increasing the contrast, reduces edge blurring during the histogram equalization process, and applying a guided filter for filtering before equalization helps to maintain edge sharpness. Gaussian blurring effectively reduces the noise and halo effects in the enhanced infrared image while enhancing the edge details.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technologies, and in particular, to an infrared image detail enhancement method and device for reducing edge blurring. Background Art

[0002] Traditional infrared image detail enhancement methods, such as histogram equalization, although they can improve the contrast of infrared images, often lead to edge blurring, affecting the quality of infrared images and target recognition. In the prior art, some methods attempt to reduce edge blurring through local histogram equalization or contrast-limited adaptive histogram equalization, but these methods still have limitations when dealing with complex infrared images, that is, they cannot effectively protect the edges of infrared images, resulting in edge blurring being introduced while enhancing the contrast. Summary of the Invention

[0003] The purpose of this application is to overcome the problem in the prior art that the edges of infrared images cannot be effectively protected, resulting in edge blurring being introduced while enhancing the contrast, and to provide an infrared image detail enhancement method and device for reducing edge blurring.

[0004] In a first aspect, an infrared image detail enhancement method for reducing edge blurring is provided, including:

[0005] Obtain the infrared image to be processed;

[0006] Detect the edge pixels in the infrared image and calculate the protection threshold;

[0007] Filter the infrared image using a guided filter;

[0008] Enhance the contrast by performing histogram equalization in a local area of the filtered infrared image, and protect all pixels in the infrared image through the protection threshold during the histogram equalization process;

[0009] Perform Gaussian blurring on the infrared image with enhanced contrast to obtain the enhanced infrared image.

[0010] In some possible implementation manners, detecting the edge pixels in the infrared image includes:

[0011] Perform Gaussian filtering on the infrared image using a Gaussian filter;

[0012] Adopt an edge detection algorithm to detect the edge pixels.

[0013] In some possible implementation manners, the calculation method of the protection threshold includes:

[0014] Adopt an edge detection algorithm to detect the infrared image to obtain an edge map;

[0015] Calculate the edge strength in the edge map;

[0016] Calculate the average value of the edge pixel intensities;

[0017] Use the average value of the edge pixel intensities as the first threshold;

[0018] Calculate the gradient of the infrared image to obtain a gradient map;

[0019] Calculate the gradient strength of each pixel in the gradient map;

[0020] According to the gradient strength distribution, select the threshold corresponding to the median of the gradient strengths as the second threshold;

[0021] Extract the texture features of the infrared image and calculate the texture feature values;

[0022] Construct a histogram from the texture feature values;

[0023] Select a third threshold to make the texture features prominent while suppressing noise and irrelevant textures;

[0024] The calculation formula for the protection threshold is:

[0025] H = x 1 f 1 + x 2 f 2 + x 3 f 3

[0026] where H is the protection threshold, f 1 is the first threshold, f 2 is the second threshold, f 3 is the third threshold, x 1 、x 2 、x 3 are the weights of the first threshold, the second threshold, and the third threshold respectively, and x 1 + x 2 + x 3 = 1.

[0027] In some possible implementation manners, smoothing the infrared image by using a guided filter and maintaining the edge sharpness includes:

[0028] Input the infrared image and the guided infrared image into the guided filter;

[0029] Set a window and a radius r;

[0030] Calculate the local mean and variance var_i within the neighborhood of each pixel;

[0031] Calculate the weight of each pixel based on the local mean and variance:

[0032] w_ij = [1 - (p_i - p_j) 2 / (k * var_i + epsilon)] * [1 - d_ij / (2 *r)]

[0033] where w_ij is the weight of pixel i, p_i and p_j are the values of pixel i and pixel j in the guided infrared image respectively, pixel j is other pixel within the neighborhood of pixel i, k is a constant, epsilon is a positive number, d_ij is the Euclidean distance between pixel i and pixel j, r is the radius of the window, and var_i is the variance within the neighborhood of pixel i;

[0034] Perform weighted averaging on the input infrared image using the weights to obtain the filtered infrared image.

[0035] In some possible implementation manners, enhance the contrast by performing histogram equalization within a local region of the filtered infrared image, and protect all pixels in the infrared image through the protection threshold during the histogram equalization process, including:

[0036] Segment the filtered infrared image into multiple sub-regions;

[0037] Calculate the histogram of the pixel values of each sub-region;

[0038] Calculate the cumulative distribution function of the histogram of the pixel values of each sub-region;

[0039] Adjust the pixel value of each pixel according to the cumulative distribution function. If the adjusted pixel value exceeds the protection threshold, limit the pixel value within the protection threshold;

[0040] Merge all enhanced sub-regions back to the size of the original infrared image.

[0041] In some possible implementation manners, perform Gaussian blur processing on the infrared image with enhanced contrast, including:

[0042] Analyze the characteristics of the halo effect;

[0043] Determine the parameters of Gaussian blur according to the characteristics of the halo effect;

[0044] Perform Gaussian blur processing on the infrared image with enhanced contrast using the determined parameters.

[0045] In some possible implementation manners, it further includes: displaying and / or saving the enhanced infrared image.

[0046] Second aspect, there is provided an infrared image detail enhancement device for reducing edge blurring, including:

[0047] An acquisition module, configured to acquire an infrared image to be processed;

[0048] An edge detection module, configured to detect edge pixels in the infrared image and calculate a protection threshold;

[0049] A guided filtering module, configured to filter the infrared image by using a guided filter;

[0050] A contrast enhancement module, configured to enhance the contrast by performing histogram equalization in a local area of the filtered infrared image, and protect all pixels in the infrared image by using the protection threshold during the histogram equalization process;

[0051] A Gaussian blurring module, configured to perform Gaussian blurring on the infrared image with enhanced contrast to obtain an enhanced infrared image.

[0052] Third aspect, there is provided a computer-readable storage medium, and the computer-readable medium stores program codes for a device to execute, and the program codes include steps for executing the method in any one of the implementation manners in the first aspect as described above.

[0053] Fourth aspect, there is provided an electronic device, and the electronic device includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, the method in any one of the implementation manners in the first aspect as described above is implemented.

[0054] The present application has the following beneficial effects: By protecting edge pixels, the present application reduces edge blurring during the histogram equalization process. Secondly, through local equalization, the contrast is improved, and at the same time, edge blurring is reduced. Moreover, applying a guided filter for filtering before equalization helps to maintain edge sharpness. Through Gaussian blurring, the noise and halo effects in the enhanced infrared image are effectively reduced, and at the same time, edge details are enhanced, effectively improving the quality of the enhanced infrared image and the target recognition ability. Description of the Drawings

[0055] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The schematic embodiments of the present application and the descriptions thereof are used to explain the present application and do not constitute an improper limitation to the present application.

[0056] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0057] Figure 1 is the flowchart of the infrared image detail enhancement method for reducing edge blurring in Embodiment 1 of the present application;

[0058] Figure 2 is the structural block diagram of the infrared image detail enhancement device for reducing edge blurring in Embodiment 2 of the present application;

[0059] Figure 3 is the internal structural schematic diagram of the electronic device in Embodiment 4 of the present application.

[0060] Reference numerals:

[0061] 100, acquisition module; 200, edge detection module; 300, guided filtering module; 400, contrast enhancement module; 500, Gaussian blur module. Detailed implementation manners

[0062] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0063] Embodiment 1

[0064] As Figure 1 shown, a method for enhancing the details of an infrared image with reduced edge blurring involved in Embodiment 1 of the present application includes:

[0065] S100. Obtain the infrared image to be processed;

[0066] It should be noted that the infrared image is obtained by measuring the heat radiated by an object. The infrared remote sensor can detect the infrared radiation emitted by the object, convert it into an electrical signal, and then form an image after processing. Since the temperature and thermal radiation characteristics of different objects are different, the infrared image can reflect the temperature distribution and thermal radiation difference of the object. Usually, the infrared image has the characteristics of low resolution, low contrast, and low signal-to-noise ratio. Therefore, it is very necessary to improve the quality and target readability of the infrared image.

[0067] S200. Detect edge pixels in the infrared image and calculate a protection threshold;

[0068] Specifically, use edge detection algorithms, such as Canny, Sobel, Prewitt and other edge detection algorithms for edge detection to identify edge pixels in the infrared image. In this embodiment, the Canny algorithm is taken as an example for illustration:

[0069] First, apply a Gaussian filter to the infrared image to reduce noise. The standard deviation (σ) of the Gaussian filter needs to be selected according to the noise level of the infrared image, usually between 1.0 and 2.0;

[0070] Apply non-maximum suppression and double-threshold method in the Canny edge detection algorithm to detect edges. The double-threshold method includes a high threshold and a low threshold. The high threshold is used to detect strong edges, and the low threshold is used to connect edges. The selection of the threshold depends on the contrast and noise level of the infrared image.

[0071] Secondly, during the histogram equalization process, set a protection threshold for the detected edge pixels to avoid these pixels being over-enhanced during the equalization process. The selection of the protection threshold needs to balance edge protection and equalization effect. The calculation methods of the protection threshold include:

[0072] S201. Based on the result of edge detection: After edge detection, the first threshold can be dynamically selected according to the intensity or density of edge pixels. For example, the average value, median or a certain percentile of the edge pixel intensity can be selected as the protection threshold. In this embodiment, the average value of the edge pixel intensity is used as the first threshold for edge detection, which specifically includes the following steps:

[0073] a. Apply an edge detection operator (Canny) to obtain an edge map;

[0074] b. Calculate the edge intensity in the edge map, usually the output value of the edge detection operator;

[0075] c. Calculate the average value of the edge pixel intensity;

[0076] d. Take the average value of the edge pixel intensity as the first threshold f 1 .

[0077] S202. Based on the gradient of the infrared image: Calculate the gradient of the infrared image. Regions with larger gradients are usually edge regions. A gradient threshold can be selected so that pixels whose gradients exceed this threshold are considered edge pixels, and the protection threshold is dynamically selected accordingly, which specifically includes the following steps:

[0078] a. Calculate the gradient of the infrared image, for example, the Laplacian operator can be used.

[0079] b. After obtaining the gradient map, calculate the gradient intensity of each pixel.

[0080] c. According to the gradient intensity distribution, select the threshold corresponding to the median of the gradient intensity as the second threshold f 2 so that the edges are highlighted.

[0081] S203. Texture analysis based on infrared images: Analyzing the texture characteristics of infrared images, such as texture complexity, edge density, etc., can be used to dynamically select the protection threshold. For example, in areas with complex textures, a lower protection threshold may need to be set to avoid over-enhancement. The specific steps include the following:

[0082] a. Texture feature extraction: Use texture analysis methods (such as gray-level co-occurrence matrix GLCM) to extract the texture features of the infrared image and calculate texture features, such as energy, entropy, correlation, etc.;

[0083] b. Construction of texture feature histogram: Construct the extracted texture feature values into a histogram, where the abscissa of the histogram represents the texture feature values and the ordinate represents the frequency of occurrence of this feature value;

[0084] c. Threshold selection: Analyze the texture feature histogram, find the peaks and valleys of the feature value distribution, and select a suitable threshold so that the texture features are highlighted while suppressing noise and irrelevant textures;

[0085] d. Threshold selection strategy: Automatically select a threshold according to the shape of the texture feature histogram. For example, in this embodiment, select the valley value of the histogram as the third threshold f 3 .

[0086] S204. The calculation formula for the protection threshold is: H = x 1 f 1 + x 2 f 2 + x 3 f 3

[0087] where H is a function representing the protection threshold, f 1 is the first threshold, f 2 is the second threshold, f 3 is the third threshold, x 1 , x 2 , x 3 are the weights of the first threshold, the second threshold, and the third threshold respectively, and x 1 + x 2 + x 3 = 1. For example: x 1 , x 2 , x 3Take 0.5, 0.3, and 0.2 respectively, x 1 , x 2 , x 3 Take 0.4, 0.4, and 0.2 respectively, x 1 , x 2 , x 3 Take 0.4, 0.3, and 0.3 respectively, and so on. The user can adjust the weights x 1 , x 2 , x 3 according to their own needs and the characteristics of the infrared image. The benefits of determining the protection threshold through different weights are mainly reflected in the following aspects:

[0088] 1. Personalized adjustment: Different weights can be used for personalized adjustment according to different image features. For example, for an image with clear edges, the weight of the edge feature can be increased to better protect the edge information; for an image with rich details, the weight of the detail feature can be increased to better retain the detail information.

[0089] 2. Enhanced adaptability: By adjusting the weights, enhanced adaptability to different regions of the image can be achieved. For example, for flat regions in the image, the degree of enhancement can be reduced to avoid distortion caused by over-enhancement; for edge and detail regions in the image, the degree of enhancement can be increased to better highlight these features.

[0090] 3. Noise resistance: By adjusting the weights, the influence of image noise on the enhancement effect can be reduced. For example, for an image with a large amount of noise, the weight of the noise feature can be increased to reduce the influence of noise on the enhancement effect.

[0091] 4. Image quality improvement: By adjusting the weights, the contrast, edge sharpness, and detail information of the image can be better balanced, thereby improving the overall quality of the image.

[0092] 5. Target recognition ability: By adjusting the weights, the target features in the image can be better highlighted, thereby improving the target recognition ability.

[0093] Generally speaking, by determining the protection threshold through different weights, personalized adjustment can be made according to the local characteristics and needs of the image, so as to improve the image contrast while maintaining edge sharpness and detail information, and enhancing the image quality and target recognition ability.

[0094] S300. Filter the infrared image using a guided filter;

[0095] Apply the guided filter before histogram equalization, that is, use the guided filter to smooth the infrared image while maintaining edge sharpness. The parameters of the guided filter include the guidance field, filtering radius, etc., which need to be selected according to the content of the infrared image. The specific steps of guided filtering are as follows:

[0096] S301. Input the infrared image and the guidance infrared image: First, it is necessary to input the infrared image I and the guidance infrared image p. The input infrared image is the infrared image to be filtered, and the guidance infrared image is the infrared image used to guide the filtering process (the guidance infrared image uses a known infrared image, which is a picture collected under sufficient ambient light, and the eye area has sufficient details and contrast).

[0097] S302. Set the window and radius: Select a window size (8x8) and radius r (r = 4) for calculating the local mean mean_i and variance var_i.

[0098] S303. Calculate the local mean and variance: For each pixel i, calculate the local mean mean_i and variance var_i within its neighborhood. This can be obtained by calculating the average and variance of the pixel values within the window.

[0099] S304. Weight calculation: According to the local mean mean_i and variance var_i, calculate the weight w_ij of each pixel i. The weight reflects the similarity between pixel i and other pixels j within its neighborhood. The weight calculation formula is as follows:

[0100] w_ij = [1 - (p_i - p_j) 2 / (k * var_i + epsilon)] * [1 - d_ij / (2 *r)]

[0101] where w_ij is the weight of pixel i, p_i and p_j are the values of pixel i and pixel j in the guidance infrared image respectively, pixel j is other pixels within the neighborhood of pixel i, k is a constant, epsilon is a positive number, d_ij is the Euclidean distance between pixel i and pixel j, r is the radius of the window, and var_i is the variance within the neighborhood of pixel i.

[0102] S305. Filtering: Use the calculated weights to perform weighted averaging on the input infrared image to obtain the filtered infrared image q. The filtering formula is as follows:

[0103] q_i = (w_i * I_i + sum(w_ij * I_j)) / (sum(w_ij))

[0104] Among them, \(q_i\) represents the protection threshold of the \(i\)-th pixel in the image. The protection threshold is usually dynamically calculated based on local features of the image (such as image gradient, etc.). By setting the protection threshold, it can be avoided that edge pixels are over-enhanced when enhancing the contrast, thus maintaining the edge sharpness of the image. \(w_i\) is the weight of pixel \(i\); \(\sum(w_{ij} * I_j)\) is the sum of the product of the weight \(w_{ij}\) of pixel \(i\) and \(I_j\), representing the weighted average of the neighboring pixels around the \(i\)-th pixel in the image; \(I_i\) is the value of pixel \(i\) in the input infrared image, \(I_j\) is the value of pixel \(j\) in the input infrared image, and \(\sum(w_{ij})\) is the sum of the weights \(w_{ij}\). , is the image gradient at pixel \(i\). is a small positive number used to prevent the denominator from being zero, usually a very small constant, such as: 10 −4 、10 −5 etc.; is the image gradient modulus of, that is, the absolute value of the gradient.

[0105] S306. Output the infrared image: Output the filtered infrared image \(q\).

[0106] It should be noted that when calculating the local mean \(mean_i\) and variance \(var_i\), the following formulas can be used:

[0107] \(mean_i=\sum(p_j) / N\)

[0108] \(var_i=\sum((p_j - mean_i)^2) / N\)

[0109] Among them, \(p_j\) is the value of pixel \(j\) in the guided infrared image within the window, and \(N\) is the number of pixels within the window.

[0110] \(k\) and \(\epsilon\) in the weight calculation formula are two important parameters in guided filtering, and their selection will affect the filtering effect. \(k\) controls the ability of the filter to preserve details of the infrared image, and \(\epsilon\) controls the ability of the filter to suppress noise. The following are some guiding principles for selecting the two parameters \(k\) and \(\epsilon\):

[0111] Selection of parameter \(k\): \(k\) controls the ability of the filter to preserve details of the infrared image. A smaller value of \(k\) will make the filter pay more attention to the details of the infrared image, while a larger value of \(k\) will make the filter smoother the infrared image. Usually, the value of \(k\) is selected within the range of \([0,1]\). A common starting point is \(k = 0.1\). If it is found that too many details are lost in the filtered infrared image, the value of \(k\) can be tried to be reduced. On the contrary, if the infrared image still contains too much noise, the value of \(k\) can be tried to be increased.

[0112] Selection of parameter epsilon: Epsilon controls the noise suppression ability of the filter. A smaller value of epsilon makes the filter more sensitive to noise, while a larger value of epsilon makes the filter more robust. The value of epsilon is usually set to a very small positive number, for example: 10 -4 or 10 -5 etc. If the filtered infrared image still contains noise, try reducing the value of epsilon. If the filtered infrared image is too smooth, try increasing the value of epsilon

[0113] Experimentation and adjustment: Since different infrared images and guiding infrared images may require different values of k and epsilon, it is usually necessary to conduct experiments to find the optimal parameter combination. In practical applications, different values of k and epsilon can be tried, the filtering effect can be observed, and adjustments can be made as needed.

[0114] S400. Enhance the contrast by performing histogram equalization in the local area of the filtered infrared image, and protect all pixels in the infrared image through the protection threshold during the histogram equalization process;

[0115] Among them, local histogram equalization (LHE) is a method to enhance the contrast of infrared images, which is achieved by performing histogram equalization in the local area of the infrared image. The following are the steps to set the protection threshold and perform local histogram equalization:

[0116] S401. Window: Divide the infrared image into multiple sub-regions (the sub-regions select a 32x32 window).

[0117] S402. Calculate the histogram of each sub-region: For each sub-region, calculate the histogram of its pixel values.

[0118] S403. Determine the protection threshold: According to the protection threshold H calculated by the edge-preserving technique in step S204, it is used to limit the enhanced pixel values not to exceed this threshold.

[0119] S404. Calculate the cumulative distribution function (i.e., CDF): For each sub-region, calculate the cumulative distribution function (i.e., CDF) of its histogram.

[0120] S405. Apply local histogram equalization:

[0121] Adjust pixel values: For each pixel in each sub-region, adjust its pixel value according to its CDF value. The adjusted pixel value can be obtained by looking up the CDF table;

[0122] Limit pixel value: If the adjusted pixel value exceeds the protection threshold, it is limited within the protection threshold.

[0123] S406. Merge the enhanced sub-regions: Merge all the enhanced sub-regions back to the size of the original infrared image.

[0124] S500. To reduce the noise and halo effects in the enhanced infrared image, perform Gaussian blur on the infrared image with enhanced contrast to obtain the enhanced infrared image.

[0125] Gaussian blur is a linear filter widely used in the field of infrared image processing. It performs weighted averaging on the infrared image through the Gaussian function. Gaussian blur can be used to reduce infrared image noise, smooth the infrared image, and remove the halo effect in the infrared image. The specific steps of Gaussian blur processing are as follows:

[0126] S501. Analyze the halo effect: Before applying Gaussian blur, it is necessary to analyze the characteristics of the halo effect, including the position, size, and intensity of the halo. This will help determine the appropriate Gaussian blur parameters.

[0127] S502. Select Gaussian blur parameters. The key parameters of Gaussian blur are the standard deviation (σ) and the blur radius (radius). The standard deviation determines the width of the Gaussian function, and the blur radius is the size of the Gaussian kernel. The following is how to select these parameters:

[0128] Standard deviation (σ): The larger the standard deviation, the more obvious the blur effect. Generally, the selection of the standard deviation depends on the intensity of the halo effect. If the halo is light, a smaller standard deviation can be selected; if the halo is heavy, a larger standard deviation can be selected.

[0129] Blur radius (radius): The blur radius is usually 3 times the standard deviation. This is because the Gaussian function contains approximately 99.7% of the energy within a distance of 3σ. The blur radius determines the size of the Gaussian kernel, thus affecting the blur effect.

[0130] S503. Apply Gaussian blur: Use the selected Gaussian blur parameters to blur the infrared image. This can be achieved by calling the corresponding Gaussian blur function in the infrared image processing library.

[0131] After processing the infrared image through the above steps, the enhanced infrared image can be obtained. The enhanced infrared image can be displayed on the monitors of some terminal devices according to the user's needs, such as laptops, desktop computers, mobile phones, monitors, etc. It can also be stored for the enhanced infrared image, such as storing it in storage devices such as USB flash drives, mechanical hard drives, solid-state hard drives, memory cards, etc. Of course, it can also be both displayed and stored synchronously.

[0132] In this embodiment, by adopting edge-preserving technology to protect edge pixels, edge blurring during the histogram equalization process is reduced. Local contrast enhancement technology is used for local equalization, improving the contrast of the infrared image while reducing edge blurring. Also, guided filtering is applied before equalization, which helps to maintain edge sharpness. Gaussian blurring effectively reduces noise and halation effects in the enhanced infrared image. This application combines multiple technical means, greatly improving the quality of infrared images and the target recognition ability.

[0133] Embodiment 2

[0134] As Figure 2 shown, a device for enhancing details of an infrared image with reduced edge blurring according to Embodiment 2 of this application includes:

[0135] An acquisition module 100, configured to acquire an infrared image to be processed;

[0136] An edge detection module 200, configured to detect edge pixels in the infrared image and calculate a protection threshold;

[0137] A guided filtering module 300, configured to filter the infrared image using a guided filter;

[0138] A contrast enhancement module 400, configured to enhance the contrast by performing histogram equalization in a local area of the filtered infrared image, and protect all pixels in the infrared image through the protection threshold during the histogram equalization process;

[0139] A Gaussian blurring module 500, configured to perform Gaussian blurring on the infrared image with enhanced contrast to obtain an enhanced infrared image.

[0140] It should be noted that for other specific implementation manners of the device for enhancing details of an infrared image with reduced edge blurring in this embodiment, reference can be made to the specific implementation manners of the method for enhancing details of an infrared image with reduced edge blurring described above. To avoid redundancy, they will not be elaborated here.

[0141] Embodiment 3

[0142] A computer-readable storage medium according to Embodiment 3 of this application, where the computer-readable medium stores program code for a device to execute, and the program code includes steps for executing the method in any one of the implementation manners in Embodiment 1 of this application;

[0143] Among them, the computer-readable storage medium may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM); the computer-readable storage medium may store program codes. When the program stored in the computer-readable storage medium is executed by a processor, the processor is configured to execute the steps of the method in any one of the implementation manners in Embodiment 1 of this application.

[0144] Embodiment 4

[0145] As Figure 3 shown, an electronic device involved in Embodiment 4 of this application, the electronic device includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, it implements the method in any one of the implementation manners in Embodiment 1 of this application;

[0146] Among them, the processor may be a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU), or one or more integrated circuits, and is configured to execute relevant programs to implement the method in any one of the implementation manners in Embodiment 1 of this application.

[0147] The processor may also be an integrated circuit electronic device with the ability to process signals. During the implementation process, each step of the method in any one of the implementation manners in Embodiment 1 of this application may be completed by the integrated logic circuit in the hardware of the processor or the instruction in software form.

[0148] The above-mentioned processor may also be a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor, or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the functions required to be executed by the units included in the data processing device of the embodiments of the present application, or executes the method in any one of the implementation manners in Embodiment 1 of the present application.

[0149] The above is only a preferred specific implementation manner of the present application; however, the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application, according to the technical solution of the present application and its improved concept, makes an equivalent substitution or change, and should be covered by the protection scope of the present application.

Claims

1. A method for enhancing infrared image details by reducing edge blur, characterized in that: include: Acquire an infrared image to be processed; Detecting edge pixels in the infrared image and calculating a protection threshold; filtering the infrared image using a guided filter; The contrast is enhanced by performing histogram equalization in a local area of ​​a filtered infrared image, and all pixels in the infrared image are protected by the protection threshold during the histogram equalization process, specifically comprising: dividing the filtered infrared image into a plurality of sub-areas; calculating a histogram of pixel values ​​of each sub-area; calculating a cumulative distribution function of the histogram of pixel values ​​of each sub-area; adjusting the pixel value of each pixel according to the cumulative distribution function, and if the adjusted pixel value exceeds the protection threshold, limiting the pixel value within the protection threshold; merging all enhanced sub-areas back to the size of the original infrared image; Performing Gaussian blur processing on the infrared image after contrast enhancement to obtain an enhanced infrared image; Wherein, detecting edge pixels in the infrared image includes: Performing Gaussian filtering on the infrared image using a Gaussian filter; An edge detection algorithm is used to detect edge pixels; The calculation method of the protection threshold includes: Using an edge detection algorithm to detect the infrared image to obtain an edge map; Calculate edge strength in the edge map; Calculate the average of edge pixel intensities; Taking the average value of the edge pixel intensities as a first threshold; Calculating the gradient of the infrared image to obtain a gradient map; Calculate the gradient strength of each pixel in the gradient map; According to the gradient intensity distribution, a threshold corresponding to the median of the gradient intensity is selected as the second threshold; Extracting texture features of the infrared image and calculating texture feature values; Constructing the texture feature values ​​into a histogram; Selecting a third threshold so that texture features are highlighted while suppressing noise and irrelevant texture; The calculation formula of the protection threshold is: H=x1f1+x2f2+x3f3 Wherein, H is the protection threshold, f1 is the first threshold, f2 is the second threshold, f3 is the third threshold, x1, x2, x3 are the weights of the first threshold, the second threshold and the third threshold respectively, and x1+x2+x3=1.

2. The infrared image detail enhancement method for reducing edge blur according to claim 1, characterized in that: The infrared image is smoothed by using a guided filter and edge sharpness is maintained, including: inputting the infrared image and the guided infrared image into a guided filter; Set the window and radius r; Calculate the local mean and variance var_i within each pixel neighborhood; According to the local mean and variance, the weight of each pixel is calculated: w_ij = [1 − (p_i − p_j) 2 / (k * var_i + epsilon)] * [1 - d_ij / (2 * r)] Where w_ij is the weight of pixel i, p_i and p_j are the values ​​of pixel i and pixel j in the guided infrared image respectively, pixel j is the other pixels in the neighborhood of pixel i, k is a constant, epsilon is a positive number, d_ij is the Euclidean distance between pixel i and pixel j, r is the radius of the window, and var_i is the variance in the neighborhood of pixel i; The weights are used to perform weighted averaging on the input infrared images to obtain a filtered infrared image.

3. The infrared image detail enhancement method for reducing edge blur according to claim 2, characterized in that: Gaussian blur processing is performed on the contrast-enhanced infrared image, including: Analyze the characteristics of the halo effect; Determine the parameters of Gaussian blur according to the characteristics of the halo effect; The determined parameters are used to perform Gaussian blur processing on the infrared image after contrast enhancement.

4. The infrared image detail enhancement method for reducing edge blur according to any one of claims 1 to 3, characterized in that: Also includes: The enhanced infrared image is displayed and / or saved.

5. An infrared image detail enhancement device for reducing edge blur, characterized in that: include: An acquisition module, used for acquiring infrared images to be processed; An edge detection module, used to detect edge pixels in the infrared image and calculate a protection threshold; A guided filtering module, used for filtering the infrared image using a guided filter; The contrast enhancement module is used to enhance the contrast by performing histogram equalization in a local area of ​​the filtered infrared image, and to protect all pixels in the infrared image by the protection threshold during the histogram equalization process, specifically comprising: dividing the filtered infrared image into a plurality of sub-areas; calculating a histogram of the pixel values ​​of each sub-area; calculating a cumulative distribution function of the histogram of the pixel values ​​of each sub-area; adjusting the pixel value of each pixel according to the cumulative distribution function, and if the adjusted pixel value exceeds the protection threshold, limiting the pixel value within the protection threshold; merging all enhanced sub-areas back to the size of the original infrared image; A Gaussian blur module is used to perform Gaussian blur processing on the infrared image after contrast enhancement to obtain an enhanced infrared image; Wherein, detecting edge pixels in the infrared image includes: Performing Gaussian filtering on the infrared image using a Gaussian filter; An edge detection algorithm is used to detect edge pixels; The calculation method of the protection threshold includes: Using an edge detection algorithm to detect the infrared image to obtain an edge map; Calculate edge strength in the edge map; Calculate the average of edge pixel intensities; Taking the average value of the edge pixel intensities as a first threshold; Calculating the gradient of the infrared image to obtain a gradient map; Calculate the gradient strength of each pixel in the gradient map; According to the gradient intensity distribution, a threshold corresponding to the median of the gradient intensity is selected as the second threshold; Extracting texture features of the infrared image and calculating texture feature values; Constructing the texture feature values ​​into a histogram; Selecting a third threshold so that texture features are highlighted while suppressing noise and irrelevant texture; The calculation formula of the protection threshold is: H=x1f1+x2f2+x3f3 Wherein, H is the protection threshold, f1 is the first threshold, f2 is the second threshold, f3 is the third threshold, x1, x2, x3 are the weights of the first threshold, the second threshold and the third threshold respectively, and x1+x2+x3=1.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program code for execution by a device, wherein the program code includes steps for executing the method according to any one of claims 1 to 4.

7. An electronic device, characterized in that: The electronic device comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction implements the method as claimed in any one of claims 1 to 4 when executed by the processor.

Citation Information

Patent Citations

  • Self-supervised water surface image enhancement method and related equipment

    CN116579953A

  • Infrared image enhancement method based on Retinex algorithm

    CN118071630A