Infrared image dynamic range compression method based on histogram detail compensation
Through the method based on histogram detail compensation, infrared images are processed layer by layer, local detail information and contrast information are calculated, and background layer dynamic compression and proportional fusion are performed, which solves the problem of insufficient detail retention ability of infrared images in the prior art, and effectively retains image details and contrast.
Patent Information
- Application Number
- CN202510301935.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-03-14
AI Technical Summary
The existing infrared image dynamic compression algorithm has poor ability to retain image details during the compression process, resulting in loss of details and reduced contrast of images after compression.
The infrared image dynamic range compression method based on histogram detail compensation is adopted. The background layer and detail layer are obtained through guide filtering layering, local detail information and contrast information are calculated, and the amount of detail compensation information is obtained. Based on this, dynamic compression and proportional fusion of the background layer are carried out to preserve image details and contrast.
Effectively retain detailed information during the dynamic range compression process of infrared images, enhance contrast, avoid the disappearance of texture details during the compression process, and prevent image distortion.
Smart Images

Figure CN120147440A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of infrared image processing, and specifically refers to a method for compressing the dynamic range of infrared images based on histogram detail compensation. Background Art
[0002] Infrared images are mainly applied in important fields such as medical treatment and agricultural production, mainly including technologies such as thermal imagers, night vision devices, and satellite imaging. In infrared imaging sensors, generally 14-bit or higher-bit analog-to-digital conversion chips are used. For a larger bit width, more image information can be accommodated to obtain the thermal radiation difference information of objects in the scene and ensure the redundancy during the later image processing. However, most devices only support 8 bits, so it is necessary to perform dynamic range image compression. While compressing, it is also necessary to retain contrast and detail information as much as possible.
[0003] Currently, the mainstream dynamic compression algorithms include histogram-based compression algorithms, hierarchical compression algorithms, etc. For histogram-based methods, the cumulative distribution function of the original image is utilized to make the resulting image have a uniform intensity distribution within the full range. This method will significantly enhance the gray levels with a high probability distribution, while the gray levels with a low probability distribution will be suppressed; for hierarchical compression algorithms, these methods use spatial filters to divide the image into low-frequency components and high-frequency components, and these two parts are processed separately. However, limited by the defects of the filters, at the edges during processing, light and shadow phenomena will occur.
[0004] Although the above algorithms can compress infrared images, their ability to preserve image details is poor, and most of the image details will be lost during the processing. Therefore, there is a lack of a targeted infrared image dynamic compression algorithm that can well preserve image details and enhance the contrast. Summary of the Invention
[0005] Aiming at the deficiencies of the existing technology, the present invention proposes a method for compressing the dynamic range of infrared images based on histogram detail compensation, which is used to compress infrared images with a dynamic range and at the same time overcome the problem of image detail loss during the compression process and retain a large amount of image details.
[0006] To solve the above technical problems, the technical solution of the present invention is as follows:
[0007] A method for compressing the dynamic range of infrared images based on histogram detail compensation includes the following steps:
[0008] Step 1: Obtain an n-bit high-dynamic range infrared image I to be processed.
[0009] Step 2: Use guided filtering to layer the input infrared image I to be processed, obtain the background layer component, and subtract the original image from the background layer to obtain the detail layer component.
[0010] Step 3: Calculate the local detail information and contrast information of the input infrared image I to be processed, and obtain the detail compensation information amount H(i).
[0011] Step 4: Statistically analyze the histogram information of the background layer component, and perform dynamic compression on the background layer component based on the detail compensation information amount.
[0012] Step 5: Perform proportional fusion on the dynamically compressed background layer component and the detail layer component to obtain the compressed image.
[0013] Preferably, in Step 1, define the size of the n-bit high-dynamic-range infrared image I(i) to be processed as M×N, and the data bit width of each pixel is n bits.
[0014] Preferably, in Step 2, use guided filtering to filter the input image to be processed. The specific expression is as follows:
[0015]
[0016] where μ k and σ k 2 are the mean and variance of the pixel data of the guidance image within the ω k window, λ is the regularization coefficient, |ω k | is the number of pixels within ω k , p(i) is the pixel data of the guidance image, is the mean of the input image within ω k , and B(i) is the obtained background layer.
[0017] Then, subtract the input original data from the background layer to obtain the detail layer component.
[0018] Preferably, in Step 3, calculate the local detail information and contrast information of the image to be processed. Define the local detail information as taking a certain pixel of the input image to be processed as the center, and within the set window ω k , calculate the α-th power of the variance as the local detail information M(i) of the image. The specific formula is as follows:
[0019] M(i) = (var(I(i) - μ i )) α (4)
[0020] where M(i) represents the local detail information, μ iis the local mean within the set window size. By taking the α-th power of the variance, 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 defined contrast information is centered on the reciprocal of the local detail information M(i), and within the set window ω k a normalization operation is performed to obtain the contrast information N(i) of the image. The specific formula is as follows:
[0022]
[0023] where θ is a regularization coefficient to prevent the local detail information M(i) from being zero, ω k is the local window size, K(i) is the weighting coefficient of each pixel, and the contrast information N(i) of the image is obtained by performing normalization within the window using the weighting coefficient K(i).
[0024] Preferably, in step 3, the detail compensation information amount H(i) is obtained. The defined detail compensation information amount is the ratio to the mean within the set window ω k centered on the contrast information N(i), thereby increasing the detail information and contrast of the image. The specific formula is as follows:
[0025]
[0026] where ω k is the local window size, which is the same as the window size in the above steps.
[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 amount H(i). The specific steps are as follows:
[0028] First, the pixel grayscale of the background layer B(i) is statistically analyzed to obtain the cumulative statistical information G(k) of the pixel grayscale 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 of the background layer B(i), Gray is all grayscale levels, and in an n-bit image to be processed, G(k) is the cumulative statistical information of the grayscale levels, that is, the probability distribution function of the image.
[0032] Then, according to the cumulative statistical information G(k) of the grayscale levels and the detail information compensation amount H(i), histogram mapping is performed. The specific formula is as follows:
[0033]
[0034] Among them is the background layer image after fusing the detail compensation information amount, β is the compensation coefficient, and the compressed background image Out(i) with the best effect is obtained.
[0035] The present invention has the following characteristics and beneficial effects:
[0036] By adopting the above technical solution, it is possible to effectively retain the detail information in the infrared image dynamic range compression process, complete the infrared image dynamic range compression. By introducing the detail compensation information amount, a large amount of detail information and contrast can be retained, avoiding the disappearance of texture details during the image compression process, and effectively preventing image distortion. Brief Description of the Drawings
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0038] Figure 1 is the flowchart of the embodiment of the present invention;
[0039] Figure 2 is the schematic diagram of the compression result output of the embodiment of the present invention. Detailed Embodiments
[0040] The present invention provides an infrared image dynamic range compression method based on histogram detail compensation, as Figure 1 shown, the specific steps are as follows:
[0041] Step 1: Obtain a 14-bit high dynamic range infrared image I to be processed. Specifically:
[0042] The obtained 14-bit high dynamic range infrared image I(i) has a size of M×N.
[0043] Step 2: Use guided filtering to layer the input image to be processed to obtain the background layer component, and subtract the original image from the background layer to obtain the detail layer component. Guided filtering has strong edge-preserving ability and low algorithm complexity, and can effectively layer the image, avoiding problems such as gradient inversion during the final fusion.
[0044] Specifically, it includes the following two parts:
[0045] In the first part, the input image to be processed is filtered using guided filtering to obtain the background layer.
[0046]
[0047] Equation (1) is the formula for guided filtering, where a k and b k are continuous linear constant coefficients within the window ω k , ω k is an N×N rectangular box, generally set to 3×3 or 5×5, I(i) is the input guidance image, and p i is the image to be processed. In this design, the guidance image and the image to be processed are the same image, so I(i) = p(i). Equation (2) is the constraint function within the window ω k .
[0048]
[0049]
[0050] In the solution of a k and b k , μ k and σ k 2 are the mean and variance of the pixel data of the guidance image within the window ω k , λ is the regularization coefficient, aiming to prevent σ k 2 = 0 and a k from being too large. |ω| is the number of pixels within ω k , and is the mean of the input image within ω k .
[0051] In the second part, the input image to be processed is subtracted from the filtered background layer 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, obtain the detail compensation information amount H(i), which contains the contrast information of the local area and can effectively suppress the problem of gray-level concentration in the histogram and enhance the contrast. The specific process is as follows:
[0055] In the first part, calculate the local detail information and contrast information of the input image to be processed. The local detail information is to calculate the local window ω kThe α of the variance within is used as the local detail information M(i).
[0056] The contrast information is obtained based on the local detail information:
[0057]
[0058] Among them, K(i) is the coefficient of the local detail information, and the contrast information N(i) is obtained by normalizing this coefficient. θ is a regularization coefficient to prevent the local detail information M(i) from being zero. The local detail information and the contrast information can be obtained using formula (6).
[0059] The second part is to calculate the detail compensation information H(i), which is the ratio to the mean within the set window ω centered on the contrast information N(i). k within the set window ω
[0060]
[0061] where ω k is the local window size. Through this operation, the detail compensation information amount can be fully captured. This information amount contains rich detail information and can enhance the contrast at the texture.
[0062] Step 4: Statistically calculate the histogram information of the background layer and perform dynamic compression on the background layer based on the detail compensation information amount.
[0063] The specific operation is as follows:
[0064] P(k) = P{B(i) = k} k ∈ 1, 2, … Gray(8)
[0065]
[0066] Formula (8) is the cumulative statistical calculation of the pixel gray levels of the background layer B(i). Among them, Gray is all gray levels, and the maximum value of Gray is 2 n , where n is the input pixel, that is, the maximum pixel value, and G(k) is the cumulative statistical information of the gray levels, that is, the probability distribution function of this image. In this embodiment, the value of Gray for the data to be processed with 14 bits is 16383; formula (9) is the cumulative statistical information of the gray levels that is statistically calculated, that is, the probability distribution function of this image, and is used for the subsequent mapping work.
[0067]
[0068] Formula (10) is the background layer data fusion formula based on the detail compensation information amount, and performs pixel-by-pixel fusion. Among them is the finally compressed background layer image, and β is the compensation coefficient used to adjust the compensation effect to obtain the compensated background image with the best effect. The gray-level information of the histogram statistics of the fused background layer will increase, and a large amount of detailed information can be retained after mapping, and the contrast is enhanced. The tanh function is used for the basic layer of the image to perform non-linear mapping to obtain the final output image Out(i).
[0069]
[0070] Step 5: Perform proportional fusion on the compressed background layer and the detail layer to obtain the compressed image. The specific operation is as follows:
[0071] O out (i) = υOut(i) + νD(i) (12)
[0072] where O out (i) is the output of the final corrected result, Out(i) is the mapped background layer obtained, D(i) is the detailed information extracted when guiding the filtering layer, and υ, ν are self-defined weighted fusion coefficients, both of which are constants greater than 0 and less than 1. It can effectively retain the detailed information in the process of infrared image dynamic range compression, retain a large amount of detailed information and contrast, and avoid the disappearance of texture details during the image compression process.
[0073] Figure 2 is the experimental schematic diagram of the present invention. The left figure is the result of adaptive linear compression of the original input image, and the right figure is the compression result. Through Figure 2 it can be seen that the compression result in this embodiment is relatively clear, and the resolution and contrast in the image are significantly improved.
[0074] The above has described the embodiments of the present invention in detail with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, without departing from the principle and spirit of the present invention, various changes, modifications, substitutions and variations to these embodiments including components 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: The following steps are involved: Step 1, obtaining an n-bit high dynamic range infrared image I to be processed; Step 2: Using guided filtering, the input infrared image I to be processed is layered to obtain a background layer component, and the original image is subtracted from the background layer to obtain a detail layer component; Step 3, obtaining detail compensation information by calculating local detail information and contrast information of the input infrared image I to be processed; Step 4: Count the histogram information of the background layer component, and dynamically compress the background layer component based on the amount of detail compensation information; Step 5: Proportionally fuse the dynamically compressed background layer component with the detail layer component to obtain a compressed image.
2. The method for infrared image dynamic range compression based on histogram detail compensation according to claim 1, characterized in that: The specific implementation process of step 2 is as follows: Define the size of the n-bit high dynamic range infrared image I(i) to be processed as M×N, and the data bit width of each pixel is n bits; Using guided filtering, the input image to be processed is filtered. The specific expression is as follows: where μ k and σ k 2 Yes k The mean and variance of the pixel data of the guidance image within the window, λ is the regularization coefficient, |ω k |Yesω k The number of pixels in, p(i) is the pixel data of the guidance image, Yes k The mean of the internal input image, B(i) is the obtained background layer; The input original data is subtracted from the background layer to obtain the detail layer component.
3. The method for infrared image dynamic range compression based on histogram detail compensation according to claim 2, characterized in that: The specific implementation process of obtaining the detail compensation information amount is: calculating the local detail information and contrast information of the image to be processed, defining the local detail information and contrast information, and then obtaining the detail compensation information amount H(i) based on the local detail information and contrast information.
4. The method for infrared image dynamic range compression based on histogram detail compensation according to claim 3, characterized in that: The specific implementation process of defining local detail information and contrast information is as follows: Calculate the local detail information and contrast information of the image to be processed. Define the local detail information as a pixel of the input image to be processed, within the set window ω k , calculate the αth power of the variance as the local detail information M(i) of the image. The specific formula is as follows: M(i)=(var(I(i)-μ i )) α (4) Where M(i) represents local detail information, μ i It is the local mean within the set window size. By taking the square of the variance to get the local detail information; Calculate the local detail information and contrast information of the image to be processed, define the contrast information, which is centered on the inverse of the local detail information M(i), and set the window ω k Normalization operation is performed inside to obtain the contrast information N(i) of the image. The specific formula is as follows: Where θ is the regularization coefficient to prevent the local detail information M(i) from being zero, ω k is the local window size, K(i) is the weighting coefficient of each pixel, and the weighting coefficient K(i) is used to perform normalization within the window to obtain the image contrast information N(i).
5. The method for infrared image dynamic range compression based on histogram detail compensation according to claim 4, characterized in that: The specific implementation process of obtaining the detail compensation information amount H(i) based on the local detail information and the contrast information is as follows: Obtain the amount of detail compensation information H(i) and define the amount of detail compensation information, which is centered on the contrast information N(i) and within the set window ω k The ratio of the inner value to the mean value. When the contrast information is greater than the window mean, the pixel is enhanced. When the contrast information is less than the window mean, the pixel is suppressed, thereby increasing the detail information and contrast of the image. The specific formula is as follows: where ω k is the local window size, which is the same as the window size in the above steps.
6. The method for infrared image dynamic range compression based on histogram detail compensation according to claim 5, characterized in that: The specific implementation process of step 4 is as follows: First, the pixel grayscale of the background layer B(i) is counted by histogram to obtain the pixel grayscale cumulative statistical information G(k). The specific formula is as follows: P(k)=P{B(i)=k} k∈1,2,…Gray (8) Where P(k) is the probability distribution information of all pixels in the background layer B(i), Gray is all gray levels, and in the n-bit image to be processed, G(k) is the cumulative statistical information of the gray level, that is, the probability distribution function of the image; According to the gray level cumulative statistical information G(k) and the detail information compensation information H(i), the histogram is mapped. The specific formula is as follows: in It is the background layer image after integrating the detail compensation information, β is the compensation coefficient, and the compressed background image Out(i) is obtained.
Citation Information
Patent Citations
Infrared image dynamic range compression method and system
CN113496531A
High dynamic range infrared image detail enhancement method and device
CN118657679A
Brightness control for spatially adaptive tone mapping of high dynamic range (HDR) images
US20180047141A1
Smart infrared image scene enhancement method
WO2019144581A1