An infrared image compression method based on adaptive gamma correction

Through adaptive gamma correction technology, segmented compression processing is performed on infrared images, which solves the problems of poor contrast enhancement effect and detail loss in the prior art, and effectively improves and protects the details of dark and bright areas.

CN115835036BActive Publication Date: 2025-04-11西安中科立德红外科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211659146.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-22
Publication Date
2025-04-11
Estimated Expiration
2042-12-22

AI Technical Summary

Technical Problem

In the gamma correction process, the existing infrared image compression method is difficult to effectively enhance the contrast between the dark and bright areas while maintaining the image details, and it is easy to lose the details of the intermediate gray value.

Method used

The infrared image compression method based on adaptive gamma correction is adopted. By acquiring infrared images in real time, histogram statistics and correction are performed, compression range and starting grayscale value are adaptively set, segmented gamma compression is performed, and the image is reconstructed to obtain infrared images after adaptive gamma correction.

Benefits of technology

This method can further highlight the fine details of the dark and bright areas while retaining the histogram equalization contrast, effectively protect the uniformity of relatively uniform scenes, and suppress excessive stretching of noise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115835036B_ABST
    Figure CN115835036B_ABST
Patent Text Reader

Abstract

The purpose of the present invention is to solve the technical problem that when the existing infrared image compression method usually uses gamma correction to adjust the infrared data, there is an insignificant enhancement effect on some areas or the contrast of the intermediate grayscale value is compressed to a large extent, and the intermediate details are lost, and provide an infrared image compression method based on adaptive gamma correction. The present invention first performs histogram statistics on a frame of infrared image acquired in real time and calculates the cumulative distribution histogram. Secondly, the histogram is corrected and the compression range and the starting grayscale value are adaptively set; then the normalized image grayscale value is obtained through normalization processing; the segmented gamma compression range is adaptively determined again and segmented gamma compression is performed to obtain the compressed image grayscale value, and the infrared image after adaptive gamma correction is obtained after reconstruction. The compression range is adaptively set using the effective grayscale level of the histogram, which effectively protects the uniformity of relatively uniform scenes and suppresses excessive stretching of noise to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of infrared image enhancement processing, and in particular to an infrared image compression method based on adaptive gamma correction. Background Art

[0002] Infrared thermal imaging technology is widely used in remote sensing, security, night vision and many other fields because it can convert the invisible thermal radiation from the target itself in the natural scene into a grayscale image visible to the human eye, and realize the passive imaging of the temperature difference perception of the target of interest. The output signal of the infrared detector is usually 14bit or 16bit, while the display device can generally only display 8bit images. In order to display the output image of the infrared detector on the display, it is necessary to match the original image with a high dynamic range with the dynamic range of the display, and retain the details in the original image as much as possible.

[0003] Histogram equalization is the most widely used image display technology in infrared imaging systems. It emphasizes gray levels with a higher frequency. Therefore, images that have undergone histogram equalization will inevitably have problems such as over-enhancement and noise amplification in uniform areas. Gamma correction is usually used to adjust infrared data. Existing methods for adjustment using gamma correction are mainly divided into two categories. One method is to use a gamma value for global correction, but this method has no obvious enhancement effect on some areas; the other method is currently the most common, which divides the histogram into two parts according to the grayscale mean and compresses them separately. This method will compress the contrast of the intermediate grayscale values ​​to a large extent and lose the intermediate details. Summary of the invention

[0004] The purpose of the present invention is to solve the technical problems that when the existing infrared image compression methods usually use gamma correction to adjust the infrared data, the enhancement effect on some areas is not obvious or the contrast of the intermediate grayscale values ​​is compressed to a large extent, resulting in the loss of intermediate details, and to provide an infrared image compression method based on adaptive gamma correction.

[0005] In order to achieve the above object, the technical solution adopted by the present invention is:

[0006] An infrared image compression method based on adaptive gamma correction is characterized in that it comprises the following steps:

[0007] Step 1) Obtain a frame of infrared image iImg in real time, and perform histogram statistics on it to obtain the histogram and histogram data Hist(r k );

[0008] Among them, r k is the kth gray level in the gray range of the infrared image iImg, r k∈[0,65536); k∈[1,65536), and is an integer; Hist(r k ) is the number of pixels that appear at the kth gray level in the histogram;

[0009] Step 2), correct the histogram and adaptively set the compression range and the starting grayscale value;

[0010] Step 3) Normalize the corrected histogram to obtain the normalized image grayscale value s rk :

[0011]

[0012] Among them, Hist″(r k ) is the number of pixels that appear at the kth gray level in the final corrected histogram;

[0013] Step 4), adaptively determine the segmented gamma compression range;

[0014] Step 5) Perform segmented gamma compression to obtain the grayscale value of the compressed image, and reconstruct the infrared image after adaptive gamma correction.

[0015] Further, step 2) is specifically as follows:

[0016] 2.1. Set the upper platform threshold to upThr (upThr>0) to correct the histogram and obtain the corrected histogram data Hist′(r k ):

[0017]

[0018] Among them, Hist′(r k ) is the number of pixels that appear at the kth gray level in the corrected histogram;

[0019] 2.2. The histogram is corrected again with one ten-thousandth of the image resolution as the effective grayscale threshold to obtain the final corrected histogram data Hist″(r k ):

[0020]

[0021] Where W×H is the resolution of the infrared image iImg;

[0022] 2.3. Count the total number of gray levels in the cumulative distribution histogram to get the adaptive compression range nRange:

[0023] nRange = min(validRange, 240)

[0024] Among them, validRange is the number of pixels with valid gray levels, that is, the number of pixels with non-zero gray levels in the histogram;

[0025] 2.4. Determine the starting gray value startGray after compression:

[0026] startGray=max(80-nRange,0)

[0027] Further, step 4) is specifically as follows:

[0028] Set two sliding windows with a step size of 5 and 1*5, and start scanning from the left and right sides of the statistical histogram at the same time. Count the maximum grayscale value each time you scan, and compare it with the statistical result of the previous scan. When the maximum grayscale value counted for three consecutive times remains unchanged, record the current grayscale peak value.

[0029] The normalized value corresponding to the grayscale peak on the left is denoted as a, and the normalized value corresponding to the peak on the right is denoted as b. The adaptive segmented gamma compression range is [0, a], (a, b), [b, 1].

[0030] Further, step 5) is specifically as follows:

[0031] On the three compressed segments [0,a], (a,b) and [b,1], grayscale redistribution is performed according to their respective compression rules. The grayscale segment [0,a] is compressed using γ1 as the gamma correction parameter, and the grayscale segment [b,1] is compressed using γ2 as the gamma correction parameter. The intermediate grayscale segment is compressed using the histogram normalization data itself to obtain the compressed image grayscale value. After reconstruction, the infrared image after adaptive gamma correction is obtained.

[0032] Furthermore, in step 5), γ1∈[0.5,3] and γ2∈[0.5,3].

[0033] Compared with the prior art, the present invention has the following beneficial effects:

[0034] 1. The infrared image compression method based on adaptive gamma correction provided by the present invention combines the platform histogram equalization and gamma correction algorithm to improve and optimize the existing technology. It uses the statistical histogram to normalize the original image data and dynamically calculates the segmentation parameters according to the histogram peak value, which can not only retain the contrast of the histogram equalization to a large extent, but also further highlight the fine details of the dark and bright areas on this basis; at the same time, the present invention uses the histogram effective grayscale to adaptively set the compression range, effectively protects the uniformity of relatively uniform scenes, and suppresses the excessive stretching of noise to a certain extent.

[0035] 2. During the calculation and compression process of the present invention, only one frame of data needs to be cached for statistical histogram, and the remaining calculations are all point operations, which occupy few resources, have low calculation complexity and a wide range of applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a flow chart of an embodiment of an infrared image compression method based on adaptive gamma correction of the present invention;

[0037] Figure 2 This is the image after the infrared image is compressed using the traditional histogram equalization technique;

[0038] Figure 3 The image is obtained by compressing the same infrared image using the compression method of the present invention. DETAILED DESCRIPTION

[0039] In order to make the purpose, advantages and features of the present invention clearer, the infrared image compression method based on adaptive gamma correction proposed by the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood by those skilled in the art that these implementations are only used to explain the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0040] like Figure 1 As shown, the present embodiment provides an infrared image compression method based on adaptive gamma correction, which specifically includes the following steps:

[0041] Step 1) Obtain a frame of infrared image iImg in real time, and perform histogram statistics on it to obtain the histogram and histogram data Hist(r k );

[0042] Let the grayscale range of the infrared image iImg be [0, R), r k is the kth gray level in the infrared image iImg, r k ∈[0,65536), k∈[1,65536), and is an integer; Hist(r k ) is the number of pixels that appear at the kth gray level in the infrared image iImg.

[0043] Step 2), correct the histogram and adaptively set the compression range and the starting grayscale value;

[0044] 2.1. Set the upper platform threshold to upThr (upThr>0) to correct the histogram, and obtain the corrected histogram data Hist′(r k ):

[0045]

[0046] Among them, Hist′(r k) is the number of pixels that appear at the kth gray level in the corrected histogram;

[0047] 2.2. The histogram is corrected again with one ten-thousandth of the image resolution as the effective grayscale threshold to obtain the final corrected histogram data Hist″(r k ):

[0048]

[0049] Among them, Hist″(r k ) is the number of pixels with the kth gray level in the final corrected histogram; W×H is the resolution of the infrared image iImg;

[0050] 2.3. Count the total number of gray levels in the histogram and get the adaptive compression range nRange:

[0051] nRange = min(validRange, 240)

[0052] Among them, validRange is the number of pixels with valid gray levels, that is, the number of pixels with non-zero gray levels in the histogram;

[0053] 2.4. Determine the starting gray value startGray after compression:

[0054] startGray=max(80-nRange,0)

[0055] Step 3) Normalize the corrected histogram to obtain the normalized image grayscale value s rk :

[0056]

[0057] Step 4) Adaptively determine the segmented gamma compression range

[0058] Set two sliding windows of 1*5 with a step size of 5, and start scanning from both sides of the statistical histogram at the same time. Count the maximum grayscale value each time you scan and compare it with the statistical result of the previous scan until the maximum grayscale value remains unchanged for three consecutive times, then record the current grayscale peak value.

[0059] The normalized value corresponding to the grayscale peak on the left is denoted as a, and the normalized value corresponding to the peak on the right is denoted as b. The adaptive segmented gamma compression range is [0, a], (a, b), [b, 1].

[0060] Step 5), perform segmented gamma compression to obtain the grayscale value of the compressed image, and reconstruct the infrared image after adaptive gamma correction;

[0061] On the three compression segments [0,a], (a,b) and [b,1], grayscale redistribution is performed according to their respective compression rules. The grayscale segment [0,a] is compressed using γ1 as the gamma correction parameter, and the grayscale segment [b,1] is compressed using γ2 as the gamma correction parameter. The intermediate grayscale segment is compressed using the histogram normalization data itself to obtain the compressed image grayscale value. After reconstruction, the infrared image after adaptive gamma correction is obtained. γ1 and γ2 are empirical values, matched according to different scenes, and γ1∈[0.5,3] and γ2∈[0.5,3].

[0062] The present invention combines platform histogram equalization with gamma correction algorithm to improve and optimize the existing technology. It uses statistical histogram to normalize the original image data and dynamically calculates the segmentation parameters according to the histogram peak value. It can not only retain the contrast of histogram equalization to a large extent, but also further highlight the fine details of dark and bright areas on this basis. At the same time, the compression range is adaptively set by using the effective grayscale of the histogram, which effectively protects the uniformity of relatively uniform scenes and suppresses excessive stretching of noise to a certain extent.

[0063] In order to prove the effect of the infrared image compression method based on adaptive gamma correction of the present invention, the hybrid dimming algorithm of linear and platform histogram equalization and the method of the present invention are used to process two identical original images respectively, and the obtained results are as follows: Figure 2 and Figure 3 The pair of processing result graphs shown are from Figure 2 and Figure 3 It can be seen that by adopting the method of the present invention, the details of the dark areas on the top and right side of the image are significantly improved. At the same time, the details of the bright areas such as billboards are also stretched and displayed at the same time, which has a significant effect on improving the details of infrared images with a high dynamic range.

[0064] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the present invention.

Claims

1. An infrared image compression method based on adaptive gamma correction, characterized in that: The following steps are involved: Step 1) Obtain a frame of infrared image iImg in real time, and perform histogram statistics on it to obtain the histogram and histogram data Hist(r k ); Among them, r k is the kth gray level in the gray range of the infrared image iImg, r k ∈[0,65536); k∈[1,65536), and is an integer; Hist(r k ) is the number of pixels that appear at the kth gray level in the histogram; Step 2), correct the histogram and adaptively set the compression range and the starting grayscale value; Step 3) Normalize the corrected histogram to obtain the normalized image grayscale value s rk : Among them, Hist″(r k ) is the number of pixels that appear at the kth gray level in the final corrected histogram; Step 4), adaptively determine the segmented gamma compression range; Set two sliding windows with a step size of 5 and 1*5, and start scanning from the left and right sides of the statistical histogram at the same time. Count the maximum grayscale value each time you scan, and compare it with the statistical result of the previous scan. When the maximum grayscale value counted for three consecutive times remains unchanged, record the current grayscale peak value. The normalized value corresponding to the grayscale peak on the left is recorded as a, and the normalized value corresponding to the peak on the right is recorded as b. The adaptive segmented gamma compression range is [0, a], (a, b), [b, 1]; Step 5) Perform segmented gamma compression to obtain the grayscale value of the compressed image, and reconstruct the infrared image after adaptive gamma correction, specifically: On the three compressed segments [0,a], (a,b) and [b,1], grayscale redistribution is performed according to their respective compression rules. The grayscale segment [0,a] is compressed using γ1 as the gamma correction parameter, and the grayscale segment [b,1] is compressed using γ2 as the gamma correction parameter. The intermediate grayscale segment is compressed using the histogram normalization data itself to obtain the compressed image grayscale value. After reconstruction, the infrared image after adaptive gamma correction is obtained.

2. The infrared image compression method based on adaptive gamma correction according to claim 1, characterized in that: Step 2) is specifically as follows: 2.

1. Set the upper platform threshold to upThr to correct the histogram and obtain the corrected histogram data Hist′(r k ): Among them, Hist′(r k ) is the number of pixels with the kth gray level in the corrected histogram, upThr>0; 2.

2. The histogram is corrected again with one ten-thousandth of the image resolution as the effective grayscale threshold to obtain the final corrected histogram data Hist″(r k ): Where W×H is the resolution of the infrared image iImg; 2.

3. Count the total number of gray levels in the cumulative distribution histogram to get the adaptive compression range nRange: nRange = min(validRange, 240) Among them, validRange is the number of pixels with valid gray levels, that is, the number of pixels with non-zero gray levels in the histogram; 2.

4. Determine the starting gray value startGray after compression: startGray=max(80-nRange,0).

3. The infrared image compression method based on adaptive gamma correction according to claim 2, characterized in that: In step 5), γ1∈[0.5,3] and γ2∈[0.5,3].

Citation Information

Patent Citations

  • Infrared-image enhancement method and system based on self-adaptive histogram segmentation

    CN107945122A

  • Image contrast enhancement detection method based on histogram

    CN114677333A