An infrared image dynamic range compression method based on histogram detail compensation
By using a histogram-based detail compensation method, guided filtering and local detail information are utilized to solve the problem of detail loss in dynamic compression of infrared images, thus preserving detail and contrast and improving image quality.
Patent Information
- Application Number
- CN202510301935.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-03-14
AI Technical Summary
Existing infrared image dynamic compression algorithms lose a large amount of image details during processing, and there is a lack of compression methods that can effectively preserve detailed information.
A histogram-based detail compensation method is adopted. The image is layered by guided filtering, local detail and contrast information is calculated, detail compensation information is obtained, histogram information of the background layer is statistically analyzed, and dynamic compression is performed. Finally, the compressed background layer and detail layer are proportionally fused.
It effectively preserves the details and contrast of infrared images, avoids the loss of texture details during the compression process, and prevents image distortion.
Smart Images

Figure CN120147440B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of infrared image processing technology, specifically to an infrared image dynamic range compression method based on histogram detail compensation. Background Technology
[0002] Infrared imaging has important applications in fields such as medicine and agricultural production, including thermal imagers, night vision devices, and satellite imaging technologies. Infrared imaging sensors typically use 14-bit or higher digital-to-analog converter chips. A larger bit width allows for the inclusion of more image information, enabling the acquisition of thermal radiation differences between objects in the scene and ensuring redundancy during post-processing. However, most devices only support 8 bits, necessitating dynamic range image compression while preserving contrast and detail as much as possible.
[0003] Currently, mainstream dynamic compression algorithms include histogram-based compression algorithms and hierarchical compression algorithms. Histogram-based methods utilize the cumulative distribution function of the original image to achieve a uniform intensity distribution across the entire image range. This method significantly enhances high-probability gray levels while suppressing low-probability gray levels. Hierarchical compression algorithms use spatial filters to divide the image into low-frequency and high-frequency components, processing these two parts separately. However, due to filter limitations, lighting effects may occur at processing edges.
[0004] While the aforementioned algorithms can compress infrared images, they are poor at preserving image details, losing most of these details during processing. Therefore, a targeted, dynamic infrared image compression algorithm that effectively preserves image details and enhances contrast is lacking. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention proposes an infrared image dynamic range compression method based on histogram detail compensation, which is used to compress infrared images with a large dynamic range while overcoming the problem of image detail loss during compression and preserving a large amount of image detail.
[0006] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:
[0007] A dynamic range compression method for infrared images based on histogram detail compensation includes the following steps:
[0008] Step 1: Obtain the n-bit high dynamic range infrared image I to be processed.
[0009] Step 2: Using guided filtering, the input infrared image I to be processed is divided into layers to obtain the background layer component. The original image is subtracted from the background layer to obtain the detail layer component.
[0010] Step 3: Obtain the detail compensation information H(i) by calculating the local detail information and contrast information of the input infrared image I to be processed.
[0011] Step 4: Calculate the histogram information of the background layer components and dynamically compress the background layer components based on the amount of detail compensation information.
[0012] Step 5: Blend the dynamically compressed background layer component and detail layer component proportionally to obtain the compressed image.
[0013] Preferably, in step 1, the size of the n-bit high dynamic range infrared image I(i) to be processed is defined as M×N, and the data bit width of each pixel is n bits.
[0014] Preferably, in step 2, guided filtering is used to filter the input image to be processed, as shown in the following expression:
[0015]
[0016] Where μ k and σ k 2 It is ω k The mean and variance of the pixel data of the guiding image within the window, where λ is the regularization coefficient, |ω k |isω k The number of pixels within, p(i) is the pixel data of the guiding image. It is ω k The mean of the input image, B(i) is the obtained background layer.
[0017] Then, the detail layer components are obtained by subtracting the background layer from the input raw data.
[0018] Preferably, in step 3, the local detail information and contrast information of the image to be processed are calculated. The local detail information is defined as the information centered on a certain pixel of the input image to be processed within a set window ω. k Within the image, the variance raised to the power of α is calculated as the local detail information M(i), and the specific formula is as follows:
[0019] M(i)=(var(I(i)-μ i )) α (4)
[0020] Where M(i) represents local detail information, μ iIt is the local mean within a set window size. By calculating the square of the variance to the power of α, local detail information is obtained.
[0021] Preferably, in step 3, the local detail information and contrast information of the image to be processed are calculated. The contrast information is defined as the reciprocal of the local detail information M(i) centered within a set window ω. k The image contrast information N(i) is obtained by performing a normalization operation within the image, as shown in the following formula:
[0022]
[0023] Where θ is the regularization coefficient to prevent local detail information M(i) from being zero, ω k K(i) is the local window size, and K(i) is the weighting coefficient for each pixel. The contrast information N(i) of the image is obtained by normalizing within the window using the weighting coefficient K(i).
[0024] Preferably, in step 3, the detail compensation information quantity H(i) is obtained. The detail compensation information quantity is defined as being centered on the contrast information N(i) within a set window ω. k The ratio of the inner value to the mean is used to increase the detail and contrast of the image. The specific formula is as follows:
[0025]
[0026] Where ω k This refers to the local window size, which is consistent with the window size mentioned in the steps above.
[0027] Preferably, in step 4, the histogram information of the background layer is statistically analyzed, and dynamic compression of the background layer is performed based on the detail compensation information H(i). The specific steps are as follows:
[0028] First, histogram statistics are performed on the pixel gray levels of the background layer B(i) to obtain the cumulative statistical information G(k) of pixel gray levels. The specific formula is as follows:
[0029] P(k)=P{B(i)=k} k∈1,2,…Gray (8)
[0030]
[0031] Where P(k) is the probability distribution information of all pixels in the background layer B(i), and Gray is all gray levels. In an n-bit image to be processed, G(k) is the cumulative statistical information of gray levels, which is the probability distribution function of the image.
[0032] Then, based on the cumulative statistical information G(k) of the gray levels and the amount of detail information compensation H(i), the histogram is mapped, and the specific formula is as follows:
[0033]
[0034] in It is the background layer image after incorporating the information of detail compensation, where β is the compensation coefficient, and the compressed background image Out(i) with the best effect is obtained.
[0035] This invention has the following characteristics and beneficial effects:
[0036] By adopting the above technical solution, the detailed information in the dynamic range compression process of infrared images can be effectively preserved, and the dynamic range compression of infrared images can be completed. By introducing detail compensation information, a large amount of detailed information and contrast can be preserved, avoiding the loss of texture details in the image during the compression process and effectively preventing image distortion. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a flowchart of an embodiment of the present invention;
[0039] Figure 2 This is a schematic diagram of the compression result output according to an embodiment of the present invention. Detailed Implementation
[0040] This invention provides a method for dynamic range compression of infrared images based on histogram detail compensation, such as... Figure 1 As shown, the specific steps are as follows:
[0041] Step 1: Acquire the 14-bit high dynamic range infrared image I to be processed. Specifically:
[0042] The acquired 14-bit high dynamic range infrared image I(i) is of size M×N.
[0043] Step 2: Using guided filtering, the input image to be processed is layered to obtain the background layer component. The original image is then subtracted from the background layer to obtain the detail layer component. Guided filtering has strong edge-preserving capabilities and low algorithm complexity, effectively layering the image and avoiding problems such as gradient inversion during the final fusion.
[0044] Specifically, it includes the following two parts:
[0045] The first part uses guided filtering to filter the input image to obtain the background layer.
[0046]
[0047] Formula (1) is the formula for guided filtering, where a k and b k It is a window ω k Continuous linear constant coefficients within ω k It is an N×N rectangle, usually set to 3×3 or 5×5, I(i) is the input guide image, p i The image to be processed is the same image in this design, so I(i) = p(i). Formula (2) is based on ω. k Constraint functions within the window.
[0048]
[0049]
[0050] In a k and b k Solving for μ k and σ k 2 It is ω k The mean and variance of the pixel data of the guided image within the window, where λ is the regularization coefficient, intended to prevent σ. k 2 =0 and a k Too large, |ω| is ω k Number of pixels within, It is ω k The mean of the input image.
[0051] The second part involves subtracting the filtered background layer from the input image to be processed to obtain the detail layer.
[0052] D(i)=I(i)-B(i))(5)
[0053] Where D(i) is the detail layer and B(i) is the background layer.
[0054] Step 3: By calculating the local detail information and contrast information of the input image to be processed, the detail compensation information H(i) is obtained, which includes the contrast information of local regions. This can effectively suppress the gray-level concentration problem of the histogram and enhance the contrast. The specific process is as follows:
[0055] The first part calculates the local detail information and contrast pair information of the input image to be processed. The local detail information is calculated by taking the local window ω of the image to be processed. kThe variance α within the variable is used as local detail information M(i).
[0056] Contrast information is obtained based on local detail information:
[0057]
[0058] Where K(i) is the coefficient of local detail information, N(i) is the contrast information obtained by normalizing the coefficient, and θ is a regularization coefficient to prevent the local detail information M(i) from being zero. Local detail information and contrast information can be obtained using formula (6).
[0059] The second part calculates the detail compensation information H(i), centered on the contrast information N(i), within a set window ω. k The ratio of the mean to the mean.
[0060]
[0061] Where, ω k It is the size of a local window. This operation can fully capture the amount of detail compensation information, which contains rich detail information and can enhance the contrast of textures.
[0062] Step 4: Calculate the histogram information of the background layer and perform dynamic compression of the background layer based on the amount of detail compensation information.
[0063] The specific steps are as follows:
[0064] P(k)=P{B(i)=k} k∈1,2,…Gray (8)
[0065]
[0066] Formula (8) is a cumulative statistical analysis of pixel gray levels in the background layer B(i), where Gray represents all gray levels, and Gray has a maximum value of 2. n , where n is the input pixel, that is, the maximum pixel value, and G(k) is the cumulative gray level statistics, that is, the probability distribution function of the image. In this embodiment, Gray takes the value 16383 in the 14-bit data to be processed; Formula (9) is the cumulative gray level statistics, that is, the probability distribution function of the image, which is used for the subsequent mapping work.
[0067]
[0068] Formula (10) is a background layer data fusion formula based on detail compensation information, which performs pixel-by-pixel fusion. This is the final compressed background layer image. β is the compensation coefficient used to adjust the compensation effect and obtain the best-performing compensated background image. The grayscale information of the histogram statistics of the fused background layer will be increased, which can retain a lot of detail information and enhance contrast after mapping. The tanh function is used on the base layer of the image. The final output image Out(i) is obtained by performing a nonlinear mapping.
[0069]
[0070] Step 5: Blend the compressed background layer and detail layer proportionally to obtain the compressed image. The specific steps are as follows:
[0071] O out (i)=υOut(i)+νD(i)(12)
[0072] Among them O out (i) represents the final corrected output, Out(i) represents the mapped background layer, D(i) represents the detail information extracted during the guided filtering layering, and υ and ν are custom weighted fusion coefficients, both constants greater than 0 and less than 1. This method effectively preserves detail information during the dynamic range compression process of infrared images, retaining a large amount of detail and contrast, and avoiding the loss of texture details during image compression.
[0073] Figure 2 This is a schematic diagram of the experiment of the present invention. The left image shows the adaptive linear compression result of the original input image, and the right image shows the compression result. Figure 2 As can be seen, the compression result in this embodiment is relatively clear, and the resolution and contrast in the image are significantly improved.
[0074] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions, and variations can be made to these embodiments, including components, without departing from the principles and spirit of the present invention, and these variations still fall within the protection scope of the present invention.
Claims
1. A method for dynamic range compression of infrared images based on histogram detail compensation, characterized in that, Includes the following steps: Step 1: Acquire the n-bit high dynamic range infrared image to be processed. ; Step 2: Using guided filtering, the input infrared image to be processed is... The image is layered to obtain the background layer component, and the original image is subtracted from the background layer to obtain the detail layer component. Step 3: Calculate the input infrared image to be processed. Local detail information and contrast information are used to obtain detail compensation information. The specific implementation process for obtaining the amount of detail compensation information is as follows: calculate the local detail information and contrast information of the image to be processed, define the local detail information and contrast information, and then obtain the amount of detail compensation information based on the local detail information and contrast information. ; The specific implementation process for defining local detail information and contrast information is as follows: Calculate the local detail information and contrast information of the image to be processed. Local detail information is defined as the information centered on a specific pixel in the input image, within a defined window. Inside, the variance is calculated. The power serves as local detail information for the image. The specific formula is as follows: (4) in Indicates local details. It is the local mean within a set window size, calculated by taking the variance. Squaring the result yields local detail information. Calculate the local detail information and contrast pair information of the image to be processed. Define contrast pair information as local detail information. Centered on the reciprocal, in the settings window Normalization is performed internally to obtain the image contrast information. The specific formula is as follows: (5) (6) in It is a regularization coefficient that prevents local detail information. Zero, It refers to the size of a local window. It is the weighting coefficient for each pixel, using the weighting coefficient Intra-window normalization is performed to obtain the image contrast information. ; The amount of detail compensation information is obtained based on local detail information and contrast level information. The specific implementation process is as follows: Obtain detailed compensation information The definition of detail compensation information is based on contrast information. Centered on the settings window The ratio of the inner value to the mean is used to enhance pixels when the contrast information is greater than the window mean and suppress pixels when the contrast information is less than the window mean, thereby increasing the detail and contrast of the image. The specific formula is as follows: (7) in This is the local window size, which is consistent with the window size mentioned in the steps above. Step 4: Calculate the histogram information of the background layer components and dynamically compress the background layer components based on the amount of detail compensation information. The specific implementation process is as follows: First, for the background layer Histogram statistics of pixel gray levels are performed to obtain cumulative statistical information of pixel gray levels. The specific formula is as follows: (8) (9) in It is the background layer. The probability distribution information of all pixels. It represents all gray levels in the n-bit image to be processed. It is the cumulative statistical information of gray levels, that is, the probability distribution function of the image; Based on cumulative gray level statistics And detailed information to compensate for the amount of information The histogram mapping is performed using the following formula: (10) (11) in It is a background image after incorporating and compensating for details. The compensation coefficient is used to obtain the compressed background image. ; Step 5: Blend the dynamically compressed background layer component and detail layer component proportionally to obtain the compressed image.
2. The infrared image dynamic range compression method based on histogram detail compensation according to claim 1, characterized in that, The specific implementation process of step 2 is as follows: Define the n-bit high dynamic range infrared image to be processed. Size is Each pixel has a data bit width of n bits; Guided filtering is used to filter the input image to be processed. The specific expression is as follows: (1) (2) (3) in and yes The mean and variance of the pixel data of the guide image within the window. It is the regularization coefficient. yes Number of pixels within, It is the pixel data of the guide image. yes The mean of the input image. It is the obtained background layer; The detail layer components are obtained by subtracting the background layer from the input raw data.
Citation Information
Patent Citations
Infrared image dynamic range compression method and system
CN113496531A
High dynamic range infrared image detail enhancement method and device
CN118657679A