Infrared image compression and contrast enhancement method, storage medium and device
By combining global and local dynamic range compression and using grayscale adaptive adjustment coefficients, the details loss and image block effect problems of infrared images in compression and contrast enhancement are solved, and the effective retention and enhancement of contrast and details are achieved, and the improvement of the improvement of the Stability of image quality.
Patent Information
- Application Number
- CN202210556671.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-20
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-05-20
AI Technical Summary
When retaining detailed information and enhancing contrast, the existing infrared image dynamic range compression method has problems such as image block effect and over-enhancement, and the effects are unstable in different scenarios, so it is impossible to fully utilize the advantages of global and local compression algorithms.
Using a combination of global dynamic range compression and local dynamic range compression, the grayscale adaptive adjustment coefficient is used to adjust grayscale by referring to the global and local compressed images, and the grayscale adaptive adjustment coefficient γ is calculated to realize the dynamic range compression of the final image. and contrast enhancement.
While maintaining the global and local contrast of the image, it retains detailed information, significantly reducing image block effects and over-enhancement problems, and improving the stability and effect of image quality.
Smart Images

Figure CN114881882B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and relates to an infrared image compression and contrast enhancement method, storage medium and device, and in particular to an infrared image compression and contrast enhancement method, storage medium and device based on local information adaptation. Background Art
[0002] The temperature information in the environment is widely distributed. The dynamic range of general infrared detectors can reach 12-16 bits, which is much higher than the accuracy of currently commonly used displays and the range of grayscale images that can be distinguished by the human eye. Therefore, in actual application scenarios, it is usually necessary to perform dynamic range compression processing on the original infrared image output by the detector.
[0003] After compression, infrared images with high dynamic range usually have problems such as concentrated histogram distribution, reduced contrast, and low signal-to-noise ratio, which causes the loss of detailed information in the image, affects the subjective visual quality of the image, and is not conducive to the application of subsequent detection, recognition, tracking and other algorithms. Therefore, while compressing the dynamic range of the original infrared image, retaining the detailed information of the original image as much as possible and enhancing the visual information such as image contrast are the core and key of the dynamic range compression algorithm of infrared images.
[0004] Infrared image dynamic range compression can be divided into two categories: global compression and local compression. The computational complexity of global compression is relatively low, and it can maintain the overall grayscale distribution characteristics of the original image, but there are problems such as low contrast and detail loss after compression. After local compression, the image has strong local contrast and good detail retention, but the image block effect is obvious and the global contrast of the image is poor. The combined use of the two types of methods can complement each other and improve the final image compression effect, but simply superimposing the images obtained by the two types of methods will result in unstable effects in different scenarios, and cannot give full play to the advantages of each algorithm, resulting in poor image quality. Therefore, an effective comprehensive method is a technical problem that technicians need to solve. Summary of the invention
[0005] The purpose of the present invention is to provide an infrared image compression and contrast enhancement method, storage medium and device. The global dynamic range compression method adopted by the present invention can retain the global information in the original image, and the local dynamic range compression can enhance the local contrast of the image. The combination of the two can achieve image dynamic range compression while ensuring the image global contrast, local contrast and detail retention, and greatly weaken the image block effect, over-enhancement and other problems.
[0006] Based on the first aspect, the present invention provides an infrared image compression and contrast enhancement method, the method comprising:
[0007] Performing global dynamic range compression on the image to obtain a globally compressed image;
[0008] Performing local dynamic range compression on the image to obtain a local compressed image;
[0009] According to the grayscale adaptive adjustment coefficient, the grayscale of the local compressed image is adjusted with reference to the global compressed image, or the grayscale of the global compressed image is adjusted with reference to the local compressed image to obtain a final compressed image; the grayscale adaptive adjustment coefficient is calculated based on the difference in grayscale values after the two compressions.
[0010] Further, the grayscale adjustment of the local compressed image with reference to the global compressed image according to the grayscale adaptive adjustment coefficient includes:
[0011] Calculating a grayscale adaptive adjustment coefficient according to a grayscale value difference between the global compressed image and the local compressed image;
[0012] According to the grayscale adaptive adjustment coefficient, the grayscale of the local compressed image is adjusted with reference to the global compressed image to obtain a final compressed image.
[0013] Furthermore, the calculating of the grayscale adaptive adjustment coefficient according to the grayscale value difference between the global compressed image and the local compressed image includes:
[0014] According to the gray value difference between the global compressed image and the local compressed image, the gray adaptive adjustment coefficient γ is calculated. The gray adaptive adjustment coefficient γ calculation formula is as follows:
[0015]
[0016] Where G(i,j) represents the global compressed image, L(i,j) represents the local compressed image, and a and b represent the grayscale adjustment coefficients (the value range is generally 0.1 to 0.5).
[0017] Further, the grayscale adjustment of the local compressed image with reference to the global compressed image according to the grayscale adaptive adjustment coefficient includes:
[0018] According to the grayscale adaptive adjustment coefficient, with reference to the global compressed image, the local compressed image is mapped to obtain a final compressed image, and the mapping relationship is as follows:
[0019] I(i,j)=L(i,j) γ(i,j)
[0020] Where I(i,j) represents the final compressed image, L(i,j) represents the local compressed image, and γ(i,j) represents the grayscale adaptive adjustment coefficient.
[0021] Alternatively, the grayscale adjustment of the global compressed image with reference to the local compressed image according to the grayscale adaptive adjustment coefficient includes:
[0022] Calculating a grayscale adaptive adjustment coefficient according to a grayscale value difference between the local compressed image and the global compressed image;
[0023] According to the grayscale adaptive adjustment coefficient, the grayscale of the global compressed image is adjusted with reference to the local compressed image to obtain a final compressed image.
[0024] Furthermore, the calculating of the grayscale adaptive adjustment coefficient according to the grayscale value difference between the local compressed image and the global compressed image includes:
[0025] According to the gray value difference between the local compressed image and the global compressed image, the gray adaptive adjustment coefficient γ is calculated. The gray adaptive adjustment coefficient γ calculation formula is as follows:
[0026]
[0027] Where L(i,j) represents the local compressed image, G(i,j) represents the global compressed image, and a and b represent the grayscale adjustment coefficients (the value range is generally 0.3 to 0.8).
[0028] Further, the grayscale adjustment of the global compressed image with reference to the local compressed image according to the grayscale adaptive adjustment coefficient includes:
[0029] According to the grayscale adaptive adjustment coefficient, the global compressed image is mapped with reference to the local compressed image to obtain a final compressed image. The mapping relationship is as follows:
[0030] I(i,j)=G(i,j) γ(i,j)
[0031] Where I(i,j) represents the final compressed image, G(i,j) represents the global compressed image, and γ(i,j) represents the grayscale adaptive adjustment coefficient.
[0032] Based on the second aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is read and executed by a processor, the steps of the infrared image compression and contrast enhancement method of the present invention are implemented.
[0033] Based on the third aspect, the present invention provides an infrared image compression and contrast enhancement device, including a processor, wherein the processor is used to execute a computer program stored in a memory to implement the steps of the infrared image compression and contrast enhancement method of the present invention.
[0034] Based on the third aspect, the present invention further provides an infrared image compression and contrast enhancement device, comprising:
[0035] An image global dynamic range compression module, used to implement step S1 of the method described in the present invention;
[0036] An image local dynamic range compression module, used to implement step S2 of the method described in the present invention;
[0037] A grayscale adaptive adjustment coefficient calculation module, used to implement step S3 of the method described in the present invention, and calculate the grayscale adaptive adjustment coefficient according to the grayscale value difference after the global dynamic range compression and the local dynamic range compression of the image;
[0038] The grayscale adaptive adjustment module is used to implement step S3 of the method described in the present invention, and adjusts the grayscale of the local compressed image with reference to the global compressed image according to the grayscale adaptive adjustment coefficient, or adjusts the grayscale of the global compressed image with reference to the local compressed image to obtain a final compressed image.
[0039] Beneficial effects of the present invention:
[0040] Global dynamic range compression has low computational complexity and can preserve the global information in the original image. Local dynamic range compression can enhance the local contrast of the image and preserve detail information. Combining the two compression methods, the grayscale value difference after global compression and local compression is adaptively adjusted to achieve the complementary performance advantages of the two methods. While achieving image dynamic range compression, the global contrast, local contrast and detail retention of the image are guaranteed, and the problems of image block effect and over-enhancement are greatly weakened.
[0041] In addition, the present invention also provides a corresponding implementation device and a computer-readable storage medium for the method, which improves the practicability of the infrared image compression and contrast enhancement method, and the device and computer-readable storage medium have corresponding advantages. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 The present invention is a flow chart of an infrared image compression and contrast enhancement method.
[0043] Figure 2 A schematic diagram of the result after using a global compression method in an exemplary application scenario provided by an embodiment of the present invention.
[0044] Figure 3 A schematic diagram of the result of using a local compression method in an exemplary application scenario provided by an embodiment of the present invention.
[0045] Figure 4A schematic diagram of the result of using a local reference global compression method in an exemplary application scenario provided by an embodiment of the present invention.
[0046] Figure 5 A schematic diagram of the result of using a global reference local compression method in an exemplary application scenario provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to enable technicians to better understand the content, technical solutions and advantages of the present invention, the present invention is further described below in conjunction with the accompanying drawings and specific implementation methods. The embodiments are only some embodiments, not all embodiments. Based on the embodiments in the present invention, all other embodiments obtained without creative work are within the scope of protection of the present invention.
[0048] Example 1
[0049] The embodiment of the present invention provides a method for dynamic range compression and detail enhancement of infrared images based on adaptive parameter filtering. Figure 1 , the specific methods include the following:
[0050] Step 101: Perform global dynamic range compression on an image to obtain a globally compressed image.
[0051] Step 102: Perform local dynamic range compression on the image to obtain a local compressed image.
[0052] Step 103: According to the grayscale adaptive adjustment coefficient, the grayscale of the local compressed image is adjusted with reference to the global compressed image, or the grayscale of the global compressed image is adjusted with reference to the local compressed image to obtain a final compressed image; the grayscale adaptive adjustment coefficient is calculated based on the difference in grayscale values after the two compressions.
[0053] Example 2
[0054] The method for compressing the local compressed image and enhancing the contrast with reference to the global compressed image in Embodiment 1 is further introduced below with reference to specific formulas and examples:
[0055] In the embodiment of the present invention, the method of global dynamic range compression in step 101 is not limited, such as linear compression, logarithmic compression, Gamma compression, histogram equalization compression, etc. In this example, a simple linear mapping is used to achieve global dynamic range compression, and the processing result is shown in FIG. Figure 1 shown.
[0056] In the embodiment of the present invention, the method of local dynamic range compression in step 102 is not limited, such as local histogram compression, gradient domain compression, etc. In this example, a method based on local histogram compression and Gaussian distance weighted interpolation is used to achieve dynamic range compression. The processing result is shown in FIG. Figure 2 shown.
[0057] In Embodiment 1, for adjusting the grayscale of the local compressed image with reference to the global compressed image according to the grayscale adaptive adjustment coefficient, an implementation method is provided in this embodiment, which may include the following steps:
[0058] A1: Calculate the grayscale adaptive adjustment coefficient γ according to the grayscale value difference between the global compressed image and the local compressed image. The grayscale adaptive adjustment coefficient γ calculation formula is as follows:
[0059]
[0060] Where G(i,j) represents the global compressed image, L(i,j) represents the local compressed image, a and b represent the grayscale adjustment coefficients, and the value range is 0.1 to 0.5. The calculated γ is approximately 0.8 to 1.2.
[0061] A2: According to the grayscale adaptive adjustment coefficient, with reference to the global compressed image, the local compressed image is mapped to obtain a final compressed image, and the mapping relationship is as follows:
[0062] I(i,j)=L(i,j) γ(i,j)
[0063] In the formula, I(i,j) represents the final compressed image, L(i,j) represents the local compressed image, and γ(i,j) represents the grayscale adaptive adjustment coefficient. The processing result is as follows: Figure 4 shown.
[0064] Example 3
[0065] The method for compressing the global compressed image and enhancing the contrast with reference to the local compressed image in Embodiment 1 is further introduced below with reference to specific formulas and examples:
[0066] Similar to Example 2, the method of global dynamic range compression in step 101 is not limited. In this example, a simple linear mapping is used to achieve global dynamic range compression. The processing result is shown in FIG. Figure 1 The method of local dynamic range compression in step 102 is not limited. In this example, a method based on local histogram compression and Gaussian distance weighted interpolation is used to achieve dynamic range compression. The processing result is shown in FIG. Figure 2 shown.
[0067] In Embodiment 1, for adjusting the grayscale of the global compressed image with reference to the local compressed image according to the grayscale adaptive adjustment coefficient, an implementation method is provided in this embodiment, which may include the following steps:
[0068] B1: Calculate the grayscale adaptive adjustment coefficient γ according to the grayscale value difference between the local compressed image and the global compressed image. The grayscale adaptive adjustment coefficient γ calculation formula is as follows:
[0069]
[0070] Where L(i,j) represents the local compressed image, G(i,j) represents the global compressed image, a and b represent the grayscale adjustment coefficients, and the value range is 0.3 to 0.8. The calculated γ is approximately 0.8 to 1.2.
[0071] B2: According to the grayscale adaptive adjustment coefficient, refer to the local compressed image, map the global compressed image to obtain a final compressed image, and the mapping relationship is as follows:
[0072] I(i,j)=G(i,j) γ(i,j)
[0073] In the formula, I(i,j) represents the final compressed image, G(i,j) represents the global compressed image, and γ(i,j) represents the grayscale adaptive adjustment coefficient. The processing result is as follows: Figure 5 shown.
[0074] By comparison, it can be seen that global dynamic range compression can retain the global information in the original image, and local dynamic range compression can enhance the local contrast of the image. The combination of the two can achieve image dynamic range compression while ensuring the global contrast, local contrast and detail retention of the image, and greatly weaken image blocking effects, over-enhancement and other problems.
[0075] Example 4
[0076] The embodiment of the present invention provides an infrared image compression and contrast enhancement device, which further improves the practicability of the method. From the perspective of functional modules, the device includes:
[0077] An image global dynamic range compression module is used to perform global dynamic range compression on an image to obtain a globally compressed image;
[0078] An image local dynamic range compression module is used to perform local dynamic range compression on an image to obtain a local compressed image;
[0079] The image mapping module adjusts the grayscale of the local compressed image with reference to the global compressed image according to the grayscale adaptive adjustment coefficient, or adjusts the grayscale of the global compressed image with reference to the local compressed image to obtain a final compressed image; the grayscale adaptive adjustment coefficient is calculated based on the difference in grayscale values after the two compressions.
[0080] Optionally, in some implementation methods of this embodiment, the image mapping module may include:
[0081] Grayscale adaptive coefficient calculation submodule: calculates grayscale adaptive adjustment coefficient according to the grayscale value difference between the global compressed image and the local compressed image;
[0082] When grayscale adjustment is performed on the local compressed image with reference to the global compressed image, the grayscale adaptive adjustment coefficient γ is calculated as follows:
[0083]
[0084] Where G(i,j) represents the global compressed image, L(i,j) represents the local compressed image, and a and b represent the grayscale adjustment coefficients (the value range is generally 0.1 to 0.5).
[0085] When grayscale adjustment is performed on the global compressed image with reference to the local compressed image, the grayscale adaptive adjustment coefficient γ is calculated as follows:
[0086]
[0087] Where L(i,j) represents the local compressed image, G(i,j) represents the global compressed image, and a and b represent the grayscale adjustment coefficients (the value range is generally 0.3 to 0.8).
[0088] Grayscale adaptive adjustment submodule: grayscale adjustment is performed on the local compressed image according to the grayscale adaptive adjustment coefficient and with reference to the global compressed image to obtain a final compressed image.
[0089] When grayscale adjustment is performed on the local compressed image with reference to the global compressed image, the mapping relationship is as follows:
[0090] I(i,j)=L(i,j) γ(i,j)
[0091] Where I(i,j) represents the final compressed image, L(i,j) represents the local compressed image, and γ(i,j) represents the grayscale adaptive adjustment coefficient.
[0092] When grayscale adjustment is performed on the global compressed image with reference to the local compressed image, the mapping relationship is as follows:
[0093] I(i,j)=G(i,j) γ(i,j)
[0094] Where I(i,j) represents the final compressed image, G(i,j) represents the global compressed image, and γ(i,j) represents the grayscale adaptive adjustment coefficient.
[0095] Example 5
[0096] The functions of the functional modules of the infrared image compression and contrast enhancement device described in the embodiment of the present invention can be specifically implemented according to the above method, and the specific process can refer to the relevant description of the above method embodiment.
[0097] From a hardware perspective, the present invention also provides an infrared image compression and contrast enhancement device, the device comprising:
[0098] A processor, the processor is used to execute the computer program stored in the memory to implement the steps of any of the above-mentioned infrared image compression and contrast enhancement methods. The specific form, model and performance are not limited.
[0099] The memory is used to store computer programs, and the stored contents include but are not limited to computer programs, operating systems, input / output and operation data, etc., used to implement the steps of any of the above-mentioned embodiments. The present invention does not limit the specific type of memory.
[0100] In addition, the device may also include an input and output interface, a communication interface, a communication bus, a power supply and a display screen. The structure is not limited to the image dynamic range compression and detail enhancement method described in the embodiment, and components can be increased or decreased according to specific circumstances.
[0101] Example 6
[0102] The infrared image compression and contrast enhancement method described in the above embodiments can be stored in a computer-readable medium for separate exchange and use. Therefore, the present invention also provides a computer-readable storage medium on which an infrared image compression and contrast enhancement program is stored. When the infrared image compression and contrast enhancement program is read and executed, the steps of the infrared image compression and contrast enhancement method described in any one of the above items are implemented.
[0103] The method of the present invention can complement the advantages of the global dynamic range compression method and the local dynamic range compression method of infrared images, and the image grayscale is adaptively adjusted. The combination of the two can achieve image dynamic range compression while ensuring the image global contrast, local contrast and detail retention, and greatly weaken the image block effect, over-enhancement and other problems.
[0104] The above is a detailed introduction to the infrared image compression and contrast enhancement method, device and computer-readable storage medium provided by the present invention. This article uses specific embodiments to elaborate on the principles and implementation methods of the present invention. The above embodiment description is only used to help technicians understand and use the methods and ideas of the present invention. Modifications made without departing from the principles of the present invention also fall within the scope of protection of the claims of this application.
Claims
1. A method for compressing and contrast enhancing an infrared image, characterized in that: The following steps are involved: Step S1, performing global dynamic range compression on the image to obtain a globally compressed image; Step S2, performing local dynamic range compression on the image to obtain a local compressed image; Step S3 includes any of the following methods: Method 1, according to the grayscale adaptive adjustment coefficient, grayscale adjustment is performed on the local compressed image with reference to the global compressed image to obtain the final compressed image, including: Calculate the grayscale adaptive adjustment coefficient based on the grayscale value difference between the global compressed image and the local compressed image : , In the formula, represents a globally compressed image, represents a locally compressed image, and Represents the grayscale adjustment coefficient, using the grayscale adaptive adjustment coefficient The local compressed image is mapped to obtain the final compressed image. The mapping relationship is as follows: , In the formula, represents the final compressed image, represents a locally compressed image, Represents the grayscale adaptive adjustment coefficient; Method 2, according to the grayscale adaptive adjustment coefficient, the grayscale of the global compressed image is adjusted with reference to the local compressed image to obtain the final compressed image, including: calculating the grayscale adaptive adjustment coefficient according to the grayscale value difference between the local compressed image and the global compressed image : , In the formula, represents a locally compressed image, represents a globally compressed image, and Represents the grayscale adjustment coefficient, using the grayscale adaptive adjustment coefficient The global compressed image is mapped to obtain the final compressed image, and the mapping relationship is as follows: , In the formula, represents the final compressed image, represents a globally compressed image, Represents the grayscale adaptive adjustment coefficient.
2. The method according to claim 1, characterized in that The grayscale adjustment coefficient and When the grayscale of the global compressed image is adjusted with reference to the local compressed image, the value range is 0.1~0.5, and when the grayscale of the local compressed image is adjusted with reference to the global compressed image, the value range is 0.3~0.
8.
3. The method according to any one of claims 1 to 2, characterized in that: In step S1, the global dynamic range compression of the image is performed by linear compression, logarithmic compression, Gamma compression or histogram equalization compression.
4. The method according to any one of claims 1 to 2, characterized in that: In step S2, the local dynamic range compression of the image is performed based on local histogram compression or gradient domain compression.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the steps of the infrared image compression and contrast enhancement method as described in any one of claims 1 to 4.
6. An infrared image compression and contrast enhancement device, characterized in that: Includes a processor and the computer-readable storage medium as claimed in claim 5.
7. An infrared image compression and contrast enhancement device, characterized in that: include: An image global dynamic range compression module, used to implement step S1 of the method described in any one of claims 1 to 4; An image local dynamic range compression module, used to implement step S2 of the method described in any one of claims 1 to 4; A grayscale adaptive adjustment coefficient calculation module, used to implement step S3 of the method described in any one of claims 1 to 4, and calculate the grayscale adaptive adjustment coefficient according to the grayscale value difference after the global dynamic range compression and the local dynamic range compression of the image; A grayscale adaptive adjustment module, used to implement step S3 of the method described in any one of claims 1 to 4, using the grayscale adaptive adjustment coefficient Mapping the local compressed image to obtain the final compressed image; or using the grayscale adaptive adjustment coefficient The global compressed image is mapped to obtain the final compressed image.
Citation Information
Patent Citations
Infrared image enhancement method based on particle swarm optimization
CN109919880A
Infrared image adaptive enhancement method based on generalized histogram equalization
CN112837250A
Histogram adjustment for high dynamic range image mapping
US20070268534A1
Method and image processing device for image dynamic range compression with local contrast enhancement
US20140254928A1
Processing method and device of image contrast
WO2011127825A1
