Infrared image detail enhancement method and device for reducing edge blur

By detecting infrared image edge pixels, calculating protection thresholds, applying guide filtering and local histogram equalization, combined with Gaussian blur processing, the problem of edge blurring in infrared images when improving contrast is solved, and image quality and target recognition capabilities are improved.

CN119295360AActive Publication Date: 2025-01-10HANGZHOU AIHUA INSTR
View PDF 10 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

While improving contrast, existing infrared image detail enhancement methods cannot effectively protect edges, resulting in blurring of edges and affecting image quality and target recognition.

Method used

By detecting edge pixels in infrared images, the protection threshold is calculated, and the image is filtered using a guide filter, combined with local histogram equalization to enhance contrast, while protecting edge pixels during equalization, and finally the image is subjected to Gaussian blurring. Reduce noise and halo effects.

Benefits of technology

It effectively reduces edge blur, improves the contrast and quality of infrared images, enhances target recognition capabilities, and maintains edge sharpness and detailed information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295360A_ABST
    Figure CN119295360A_ABST
Patent Text Reader

Abstract

The invention discloses an infrared image detail enhancement method and device capable of reducing edge blurring, relates to the technical field of image processing, and solves the problem that in the prior art, the edge of an infrared image cannot be effectively protected, so that the edge blurring is introduced while the contrast is enhanced. Guided filtering is carried out on the infrared image, the contrast is enhanced through histogram equalization, all pixels in the infrared image are protected in the histogram equalization by using a protection threshold, and finally Gaussian blur processing is carried out, so that edge pixels are protected while the contrast is improved. According to the method, the edge blur in the histogram equalization process is reduced, the guiding filter is applied to filter before equalization, the edge sharpness can be kept, the noise and halo effect in the enhanced infrared image are effectively reduced through Gaussian blur, and meanwhile, the edge details are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method and device for enhancing infrared image details by reducing edge blur. Background Art

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

[0003] The purpose of the present application is to overcome the problem that the prior art cannot effectively protect the edges of infrared images, resulting in edge blurring while enhancing contrast, and to provide an infrared image detail enhancement method and device that reduces edge blurring.

[0004] In a first aspect, a method for enhancing infrared image details by reducing edge blur is provided, comprising:

[0005] Acquire an infrared image to be processed;

[0006] Detecting edge pixels in the infrared image and calculating a protection threshold;

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

[0008] The contrast is enhanced by performing histogram equalization in a local area of ​​the filtered infrared image, and all pixels in the infrared image are protected by the protection threshold during the histogram equalization process;

[0009] The contrast-enhanced infrared image is subjected to Gaussian blur processing to obtain an enhanced infrared image.

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

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

[0012] An edge detection algorithm is used to detect edge pixels.

[0013] In some possible implementations, the method for calculating the protection threshold includes:

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

[0015] Calculate edge strength in the edge map;

[0016] Calculate the average of edge pixel intensities;

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

[0018] Calculating 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 intensity distribution, a threshold corresponding to the median of the gradient intensity is selected as the second threshold;

[0021] Extracting texture features of the infrared image and calculating texture feature values;

[0022] Constructing the texture feature values ​​into a histogram;

[0023] Selecting a third threshold so that texture features are highlighted while suppressing noise and irrelevant texture;

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

[0025] H=x1f1+x2f2+x3f3

[0026] 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.

[0027] In some possible implementations, the infrared image is smoothed using a guided filter and edge sharpness is maintained, including:

[0028] inputting the infrared image and the guided infrared image into a guided filter;

[0029] Set the window and radius r;

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

[0031] According to the local mean and variance, the weight of each pixel is calculated:

[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 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;

[0034] The weights are used to perform weighted averaging on the input infrared images to obtain a filtered infrared image.

[0035] In some possible implementations, contrast is enhanced by performing histogram equalization in a local area of ​​the filtered infrared image, and all pixels in the infrared image are protected by the protection threshold during the histogram equalization process, including:

[0036] segmenting the filtered infrared image into a plurality of sub-regions;

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

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

[0039] 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;

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

[0041] In some possible implementations, Gaussian blur processing is performed on the contrast-enhanced infrared image, 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] The determined parameters are used to perform Gaussian blur processing on the infrared image after contrast enhancement.

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

[0046] In a second aspect, an infrared image detail enhancement device for reducing edge blur is provided, comprising:

[0047] An acquisition module, used for acquiring infrared images to be processed;

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

[0049] A guided filtering module, used for filtering the infrared image 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 to protect all pixels in the infrared image by the protection threshold during the histogram equalization process;

[0051] The Gaussian blur module is used to perform Gaussian blur processing on the infrared image after contrast enhancement to obtain an enhanced infrared image.

[0052] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable medium stores a program code for execution by a device, wherein the program code includes steps for executing the method in any one of the implementations of the first aspect described above.

[0053] In a fourth aspect, an electronic device is provided, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements a method as in any one of the implementations in the first aspect above.

[0054] The present application has the following beneficial effects: the present application reduces edge blur in the histogram equalization process by protecting edge pixels; secondly, by local equalization, the contrast is improved while reducing edge blur; and, applying a guided filter for filtering before equalization helps to maintain edge sharpness; by Gaussian blur, the noise and halo effects in the enhanced infrared image are effectively reduced while the edge details are enhanced, thereby effectively improving the quality of the enhanced infrared image and the target recognition capability. BRIEF 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 illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application.

[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0057] Figure 1 is a flow chart of the infrared image detail enhancement method for reducing edge blur in Example 1 of the present application;

[0058] Figure 2is a structural block diagram of an infrared image detail enhancement device for reducing edge blur according to Embodiment 2 of the present application;

[0059] Figure 3 It is a schematic diagram of the internal structure of the electronic device of Example 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 DESCRIPTION

[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0063] Example 1

[0064] like Figure 1 As shown, a method for enhancing infrared image details by reducing edge blurring according to Embodiment 1 of the present application includes:

[0065] S100, obtaining an infrared image to be processed;

[0066] It should be noted that infrared images are obtained by measuring the heat radiated from an object. Infrared remote sensors can detect infrared radiation emitted by an object and convert it into electrical signals, which are then processed to form images. Since different objects have different temperature and thermal radiation characteristics, infrared images can reflect the temperature distribution and thermal radiation differences of objects. Usually, infrared images have the characteristics of low resolution, low contrast, and low signal-to-noise ratio. Therefore, it is very necessary to improve the quality of infrared images and target readability.

[0067] S200, detecting edge pixels in the infrared image and calculating a protection threshold;

[0068] Specifically, edge detection is performed using an edge detection algorithm, such as Canny, Sobel, Prewitt, etc., to identify edge pixels in the infrared image. In this embodiment, the Canny algorithm is used as an example for description:

[0069] First, a Gaussian filter is applied 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] The non-maximum suppression and double threshold method in the Canny edge detection algorithm are used 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 choice of threshold depends on the contrast and noise level of the infrared image.

[0071] Secondly, during the histogram equalization process, a protection threshold is set for the detected edge pixels to prevent these pixels from being over-enhanced during the equalization process. The selection of the protection threshold needs to balance the edge protection and equalization effects. The calculation method of the protection threshold includes:

[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 of edge detection, which specifically includes the following steps:

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

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

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

[0076] d. Use the average value of the edge pixel intensities as the first threshold f1.

[0077] S202, based on the gradient of the infrared image: calculate the gradient of the infrared image. The area with a larger gradient is usually the edge area. A gradient threshold can be selected so that pixels with a gradient exceeding this threshold are considered edge pixels, and a protection threshold is dynamically selected based on this, which specifically includes the following steps:

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

[0079] b. After obtaining the gradient map, calculate the gradient strength 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 f2, so that the edge is highlighted.

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

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

[0083] b. Texture feature histogram construction: The extracted texture feature values ​​are constructed into a histogram, where the abscissa of the histogram represents the texture feature value and the ordinate represents the frequency of occurrence of the feature value;

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

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

[0086] S204, the calculation formula of the protection threshold is: H = x1f1 + x2f2 + x3f3

[0087] Among them, H is a function, representing 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, x1+x2+x3=1, for example: x1, x2, x3 are 0.5, 0.3 and 0.2 respectively, x1, x2, x3 are 0.4, 0.4 and 0.2 respectively, x1, x2, x3 are 0.4, 0.3 and 0.3 respectively, and so on. Users can adjust the weights x1, x2, x3 according to their needs and the characteristics of infrared images. The benefits of determining the protection threshold by different weights are mainly reflected in the following aspects:

[0088] 1. Personalized adjustment: Different weights can be adjusted for different image features. For example, for images with clear edges, the weight of edge features can be increased to better protect edge information; for images with rich details, the weight of detail features can be increased to better preserve detail information.

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

[0090] 3. Anti-noise ability: By adjusting the weight, the impact of image noise on the enhancement effect can be reduced. For example, for an image with large noise, the weight of the noise feature can be increased to reduce the impact of noise on the enhancement effect.

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

[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] In general, by determining the protection threshold through different weights, personalized adjustments can be made according to the local characteristics and needs of the image, thereby improving image contrast while maintaining edge clarity and detail information, thereby improving image quality and target recognition capabilities.

[0094] S300, filtering the infrared image using a guided filter;

[0095] Apply a 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 guiding field, filter radius, etc., which need to be selected according to the content of the infrared image. The guided filter specifically includes the following steps:

[0096] S301, input infrared image and guide infrared image: First, it is necessary to input infrared image I and guide infrared image p. The input infrared image is the infrared image to be filtered, and the guide infrared image is the infrared image used to guide the filtering process (the guide 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 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 local mean and variance: for each pixel i, calculate the local mean mean_i and variance var_i in its neighborhood. This can be obtained by averaging and calculating the variance of the pixel values ​​in the window.

[0099] S304, weight calculation: Calculate the weight w_ij of each pixel i based on the local mean mean_i and variance var_i. The weight reflects the similarity between pixel i and other pixels j in 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] Among them, 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.

[0102] S305, filtering: Use the calculated weights to perform weighted averaging on the input infrared image to obtain a 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 calculated dynamically based on the local features of the image (for example: image gradient, etc.). By setting the protection threshold, it is possible to avoid over-enhancement of edge pixels when enhancing contrast, thereby maintaining the edge clarity of the image. w_i is the weight of pixel i; sum(w_ij * I_j) is the sum of the product of the pixel i weight w_ij and I_j, which represents the weighted average of the neighborhood 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, 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 small constant, for example: 10 −4 , 10 −5 wait; is the image gradient The modulus of , that is, the absolute value of the gradient.

[0105] S306, output 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 formula can be used:

[0107] mean_i = sum(p_j) / N

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

[0109] Where p_j is the value of pixel j in the window in the guided infrared image, and N is the number of pixels in 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 filter's ability to preserve infrared image details, and epsilon controls the filter's ability to suppress noise. The following are some guidelines for selecting k and epsilon:

[0111] Selection of parameter k: k controls the filter's ability to preserve details of the infrared image. A smaller k value will make the filter pay more attention to the details of the infrared image, while a larger k value will make the filter smoother the infrared image. Usually, the value of k is chosen in the range [0,1]. A common starting point is k = 0.1. If you find that the infrared image after filtering loses too much detail, you can try to reduce the value of k. On the contrary, if the infrared image still contains too much noise, you can try to increase the value of k.

[0112] Selection of parameter epsilon: epsilon controls the filter's ability to suppress noise. A smaller epsilon value makes the filter more sensitive to noise, while a larger epsilon value makes the filter more robust. The value of epsilon is usually set to a small positive number, for example: 10 -4 or 10 -5 Etc. If the filtered infrared image still contains noise, you can try to reduce the value of epsilon. If the filtered infrared image is too smooth, you can try to increase the value of epsilon.

[0113] Experimentation and adjustment: Since different infrared images and guided infrared images may require different k and epsilon values, it is usually necessary to experiment to find the best parameter combination. In actual applications, you can try different k and epsilon values, observe the filtering effect, and adjust as needed.

[0114] S400, enhancing contrast by performing histogram equalization in a local area of ​​the filtered infrared image, and protecting all pixels in the infrared image by 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 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 (select 32x32 windows for the sub-regions).

[0117] S402, calculating a histogram of each sub-region: for each sub-region, calculating a histogram of its pixel values.

[0118] S403, determine the protection threshold: the protection threshold H calculated according to the edge preservation technology in step S204 is used to limit the pixel value after enhancement to not exceed this threshold.

[0119] S404, calculating the cumulative distribution function (ie, CDF): for each sub-region, calculating the cumulative distribution function (ie, CDF) of its histogram.

[0120] S405, applying local histogram equalization:

[0121] Adjust pixel value: 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 will be limited within the protection threshold.

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

[0124] S500: In order to reduce noise and halo effects in the enhanced infrared image, Gaussian blur processing is performed on the infrared image after contrast enhancement to obtain an enhanced infrared image.

[0125] Gaussian blur is a linear filter widely used in the field of infrared image processing. It uses a Gaussian function to perform weighted averaging on infrared images. Gaussian blur can be used to reduce infrared image noise, smooth infrared images, and remove the halo effect in infrared images. Gaussian blur processing specifically includes the following steps:

[0126] S501. Analyze the halo effect: Before applying Gaussian blur, it is necessary to analyze the characteristics of the halo effect, including the location, 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 standard deviation (σ) and blur radius (radius). The standard deviation determines the width of the Gaussian function, while the blur radius is the size of the Gaussian kernel. Here is how to select these parameters:

[0128] Standard Deviation (σ): The larger the standard deviation, the more obvious the blurring effect. Usually, the choice of standard deviation depends on the strength of the halo effect. If the halo is light, you can choose a smaller standard deviation; if the halo is heavy, you can choose a larger standard deviation.

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

[0130] S503, applying Gaussian blur: using the selected Gaussian blur parameters to perform blur processing on 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, an enhanced infrared image can be obtained. According to user needs, the enhanced infrared image can be displayed on the display of some terminal devices, such as: notebooks, desktop computers, mobile phones, monitors, etc. The enhanced infrared image can also be stored: for example: stored in a U disk, mechanical hard disk, solid hard disk, memory card and other storage devices. Of course, it can also be displayed and stored simultaneously.

[0132] In this embodiment, edge preservation technology is used to protect edge pixels, thereby reducing edge blur in the histogram equalization process. Local equalization is performed through local contrast enhancement technology, which improves the contrast of the infrared image and reduces edge blur. In addition, guided filtering is applied before equalization to help maintain edge sharpness. Gaussian blur is used to effectively reduce noise and halo effects in the enhanced infrared image. This application combines multiple technical means to greatly improve the quality of infrared images and target recognition capabilities.

[0133] Example 2

[0134] like Figure 2 As shown, an infrared image detail enhancement device for reducing edge blurring according to Embodiment 2 of the present application includes:

[0135] An acquisition module 100 is used to acquire an infrared image to be processed;

[0136] The edge detection module 200 is used 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 to protect all pixels in the infrared image by the protection threshold during the histogram equalization process;

[0139] The Gaussian blur module 500 is used to perform Gaussian blur processing on the infrared image after contrast enhancement to obtain an enhanced infrared image.

[0140] It should be noted that other specific implementations of the infrared image detail enhancement device for reducing edge blur in this embodiment can refer to the specific implementations of the infrared image detail enhancement method for reducing edge blur mentioned above, and will not be described again here to avoid redundancy.

[0141] Example 3

[0142] A computer-readable storage medium according to Embodiment 3 of the present application, wherein the computer-readable storage medium stores a program code for execution by a device, wherein the program code includes steps for executing a method in any one of the implementations in Embodiment 1 of the present application;

[0143] Among them, the computer-readable storage medium can 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 can store program code, and when the program stored in the computer-readable storage medium is executed by the processor, the processor is used to execute the steps of the method in any one of the implementation methods in Example 1 of the present application.

[0144] Example 4

[0145] like Figure 3 As shown, an electronic device involved in Embodiment 4 of the present application includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, and when the program or instruction is executed by the processor, a method in any one of the implementations in Embodiment 1 of the present application is implemented;

[0146] Among them, the processor can adopt 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 to execute relevant programs to implement the method in any one of the implementation methods in Example 1 of the present application.

[0147] The processor may also be an integrated circuit electronic device with signal processing capability. In the implementation process, each step of the method in any implementation of Embodiment 1 of the present application may be completed by an integrated logic circuit of hardware in the processor or by instructions 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 gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. 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 the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a 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. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the functions required to be performed by the unit included in the data processing device of the embodiment of the present application in combination with its hardware, or executes the method in any one of the implementation modes in the embodiment 1 of the present application.

[0149] The above are only preferred specific implementations of the present application; however, the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solution and its improved ideas of the present application within the technical scope disclosed in the present application, which should be included in 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 ​​the filtered infrared image, and all pixels in the infrared image are protected by the protection threshold during the histogram equalization process; The contrast-enhanced infrared image is subjected to Gaussian blur processing to obtain an enhanced infrared image.

2. The infrared image detail enhancement method for reducing edge blur according to claim 1, characterized in that: 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.

3. The infrared image detail enhancement method for reducing edge blur according to claim 2, characterized in that: 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.

4. 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.

5. The infrared image detail enhancement method for reducing edge blur according to any one of claims 1 to 4, characterized in that: The contrast is enhanced by performing histogram equalization in a local area of ​​the filtered infrared image, and all pixels in the infrared image are protected by the protection threshold during the histogram equalization process, including: segmenting the filtered infrared image into a plurality of sub-regions; Calculate the histogram of pixel values ​​in each sub-region; Calculate the cumulative distribution function of the histogram of pixel values ​​in each sub-region; 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; Merge all enhanced sub-regions back to the size of the original infrared image.

6. The infrared image detail enhancement method for reducing edge blur according to claim 5, 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.

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

8. 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; A contrast enhancement module, configured 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; The Gaussian blur module is used to perform Gaussian blur processing on the infrared image after contrast enhancement to obtain an enhanced infrared image.

9. 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 7.

10. 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 7 when executed by the processor.

Citation Information

Patent Citations

  • Underwater image enhancement method based on structure-texture layering

    CN107798665A

  • Intra-frame division method and device based on guiding filtering and edge detection and medium

    CN113518220A

  • Image processing method and device and storage medium

    CN113888438A

  • Image enhancement method and system based on double histogram equalization

    CN116402729A

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

    CN116579953A