High dynamic range infrared image enhancement method and device based on SKWGIF
Through the high dynamic range infrared image enhancement method based on SKWGIF, the problems of insufficient edge information retention and "halo" artifacts in traditional methods are solved, and the contrast improvement and rich details are achieved.
Patent Information
- Application Number
- CN202411553461.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-02
- Publication Date
- 2025-02-11
AI Technical Summary
Traditional infrared image layering methods fail to effectively retain the edge information of the image, resulting in problems such as "halo" artifacts after enhancement, and it is impossible to extract good basic layer edge information and rich detail layer edge details at the same time.
Using the high dynamic range infrared image enhancement method based on SKWGIF, the basic layer image is generated by acquiring 16-bit raw infrared images, the SKWGIF algorithm is used to generate the basic layer image, the CLAHE algorithm is enhanced in contrast, Gaussian blur processing, the detail layer image is generated, and the automatic gain control method is used to enhance it. , and finally merge the base layer and the detail layer according to the preset fusion coefficient to linearly compress the dynamic range.
It improves the contrast of the image and enriches the details of the image, avoids "halo" artifacts, and can effectively retain the edge information of the image.
Smart Images

Figure CN119417742A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a high dynamic range infrared image enhancement method and device based on SKWGIF. Background Art
[0002] Since infrared radiation is affected by atmospheric thermal radiation in the process from the target to the sensor, infrared images often have problems such as uneven grayscale distribution, low contrast, unclear details, and easy loss of details. Therefore, image detail enhancement and contrast enhancement are of great significance to infrared imaging systems and are the prerequisite for further application of low-quality infrared images.
[0003] At present, the field of infrared image processing generally adopts a hierarchical method to enhance infrared images. The image is decomposed into a detail layer and a base layer through spatial filtering, and the contrast and details of the image are enhanced respectively. For example, the bilateral filtering and guided filtering methods divide the original image into a base layer containing the image background and a detail layer containing the image texture. These two components are processed separately and then combined into an output image. This type of algorithm can effectively retain image details while enhancing contrast.
[0004] However, the traditional image layering method does not take into account the visual characteristics of the human eye, and the filters it uses fail to retain the edge information of the image well, resulting in problems such as "halo" artifacts in the enhanced image, and it is impossible to simultaneously extract good base layer edge information and rich detail layer edge details. Summary of the invention
[0005] Based on this, it is necessary to provide a high dynamic range infrared image enhancement method and device based on SKWGIF that can maintain the edge of the base layer and enrich the details of the detail layer to address the above technical problems.
[0006] In a first aspect, the present application provides a high dynamic range infrared image enhancement method based on SKWGIF, comprising:
[0007] Obtain the 16-bit original infrared image to be enhanced, and use the SKWGIF algorithm to filter the original infrared image to obtain the base layer image corresponding to the original infrared image;
[0008] The contrast of the base layer image is enhanced using the CLAHE algorithm to obtain an enhanced base layer image;
[0009] Performing Gaussian blur processing on the base layer image to obtain a secondary base layer image;
[0010] Generate a detail layer image based on the secondary base layer image and the original image;
[0011] The detail layer image is enhanced by using an automatic gain control method to obtain an enhanced detail layer image;
[0012] The enhanced base layer image and the enhanced detail layer image are merged according to a preset fusion coefficient to obtain an enhanced image corresponding to the original image;
[0013] Linear compression enhances the dynamic range of the image, resulting in an 8-bit output image.
[0014] In one embodiment, the original infrared image is filtered using the SKWGIF algorithm to obtain a base layer image corresponding to the original infrared image, including:
[0015] The original infrared image is used as the guide image, and the SKWGIF algorithm is used to filter the original image to obtain the base layer image corresponding to the original infrared image.
[0016] In one embodiment, the original infrared image is used as a guide image, and the original infrared image is filtered using the SKWGIF algorithm to obtain a base layer image corresponding to the original infrared image, including:
[0017] Use the following formula to get each pixel I in the guidance image i The corresponding output pixel q i :
[0018]
[0019] Among them, q i For pixel I i The corresponding output pixel, a k and b k It is a window k Adaptive adjustment parameters within; w ik It is controlled by the core C i The calculated weights;
[0020] According to all output pixels q i , and get the base layer image.
[0021] In one embodiment, the contrast of the base layer image is enhanced by using the CLAHE algorithm to obtain an enhanced base layer image, including:
[0022] The base layer image is divided into a plurality of local sub-blocks of equal size and non-overlapping;
[0023] For each local sub-block, a histogram equalization algorithm is used to calculate the histogram of the local sub-block;
[0024] Determine the gray level in the histogram of the local sub-block that is greater than a set pixel number threshold;
[0025] The excess number of pixels in the gray level that exceeds the pixel number threshold is equally divided into other gray levels;
[0026] All local sub-blocks are fused using the bilinear interpolation method to obtain the enhanced base layer image.
[0027] In one embodiment, the detail layer image is enhanced using an automatic gain control method to obtain an enhanced detail layer image, including:
[0028] Use the following formula to process the detail layer image to obtain the enhanced detail layer image:
[0029] I de (i,j)=(g max a(i,j) avg +g min )×I d (i,j)
[0030] Among them, I de (i,j) represents the processed detail layer image, g max and g min are the maximum and minimum values of the gain, a(i,j) avg is the linear coefficient of the filtering algorithm, I d (i,j) is the unenhanced detail layer image.
[0031] In one embodiment, the enhanced base layer image and the enhanced detail layer image are merged according to a preset fusion coefficient to obtain an enhanced image corresponding to the original image, including:
[0032] Use the following formula to merge the enhanced base layer image and the enhanced detail layer image according to the preset fusion coefficient to obtain the enhanced image corresponding to the original image:
[0033] I out =(1-p)×I be +p×I de
[0034] Among them, I out To enhance the image, I be To enhance the base layer image, I de To enhance the detail layer image, p is the fusion coefficient; p = 0.1.
[0035] In a second aspect, the present application also provides a high dynamic range infrared image enhancement device, comprising:
[0036] The base layer image generation module is used to obtain the 16-bit original infrared image to be enhanced, and use the SKWGIF algorithm to filter the original infrared image to obtain the base layer image corresponding to the original infrared image;
[0037] An enhanced base layer image generation module is used to enhance the contrast of the base layer image by using a CLAHE algorithm to obtain an enhanced base layer image;
[0038] A secondary enhanced base layer image generation module is used to perform Gaussian blur processing on the base layer image to obtain a secondary base layer image;
[0039] A detail layer image generation module, used for generating a detail layer image based on the secondary base layer image and the original image;
[0040] An enhanced detail layer image generation module is used to enhance the detail layer image using an automatic gain control method to obtain an enhanced detail layer image;
[0041] The enhanced image generation module is used to merge the enhanced base layer image and the enhanced detail layer image according to a preset fusion coefficient to obtain an enhanced image corresponding to the original image.
[0042] The output image generation module is used to linearly compress and enhance the dynamic range of the image to obtain an 8-bit output image.
[0043] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method described in the first aspect of the present application are implemented.
[0044] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect of the present application are implemented.
[0045] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method described in the first aspect of the present application.
[0046] The above-mentioned high dynamic range infrared image enhancement method and device based on SKWGIF obtains the 16-bit original infrared image to be enhanced, and uses the SKWGIF algorithm to filter the original infrared image to obtain the base layer image corresponding to the original infrared image; uses the CLAHE algorithm to enhance the contrast of the base layer image to obtain an enhanced base layer image; performs Gaussian blur processing on the base layer image to obtain a secondary base layer image; generates a detail layer image based on the secondary base layer image and the original infrared image; uses an automatic gain control method to enhance the detail layer image to obtain an enhanced detail layer image; merges the enhanced base layer image and the enhanced detail layer image according to a preset fusion coefficient to obtain an enhanced image corresponding to the original image; linearly compresses the dynamic range of the enhanced image to obtain an 8-bit output image, which can improve the contrast of the enhanced image and enrich the details of the enhanced image. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 1 is a schematic diagram of a process of a high dynamic range infrared image enhancement method in one embodiment;
[0049] Figure 2 is a schematic diagram of a 16-bit original infrared image in one embodiment;
[0050] Figure 3 is a schematic diagram of enhancing a base layer image in one embodiment;
[0051] Figure 4 is a schematic diagram of enhancing a detail layer image in one embodiment;
[0052] Figure 5 is a schematic flow chart of an infrared image enhancement method in another embodiment;
[0053] Figure 6 is a schematic diagram of outputting an image in one embodiment;
[0054] Figure 7 is a structural block diagram of an infrared image enhancement device in one embodiment;
[0055] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0058] It is to be understood that terms such as “first”, “second”, etc. in the present application are only used to distinguish similar objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features.
[0059] It can be understood that the “connection” in the following embodiments should be understood as “electrical connection”, “communication connection”, etc. if the connected circuits, modules, units, etc. have electrical signals or data transmission between each other.
[0060] It will be understood that “at least one” means one or more, and “plurality” means two or more.
[0061] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.
[0062] In one embodiment, Figure 1 As shown, a high dynamic range infrared image enhancement method is provided. This embodiment takes the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0063] Step 102: Obtain a 16-bit original infrared image to be enhanced, and use the SKWGIF algorithm to filter the original infrared image to obtain a base layer image corresponding to the original infrared image.
[0064] Specifically, the original image may be an infrared image to be enhanced. The infrared image is an image generated using infrared thermal imaging technology. In a specific embodiment, Figure 2As shown in the figure, the original image can be a 16-bit original infrared image. For grayscale images, 16 bits means that each pixel in the image can have 2 to the 16th power (65536) different grayscale values. This means that the image can show very delicate grayscale changes. Compared with 8-bit grayscale images (256 grayscale values), 16-bit grayscale images can more accurately reflect the temperature changes and detailed information of the object.
[0065] Furthermore, filtering the original image is a common image processing technology used to improve image quality, remove noise, enhance specific features, etc. In practical applications, corresponding filtering methods and filtering parameters, such as mean filtering, median filtering, Gaussian filtering, etc., can be determined according to actual requirements for the base layer image.
[0066] In one embodiment, the original infrared image may be used as a guide image, and a steering kernel-based guided filtering (SKWGIF) algorithm may be used to filter the original infrared image to obtain a base layer image.
[0067] Step 104: Use the CLAHE algorithm to enhance the contrast of the base layer image to obtain an enhanced base layer image.
[0068] Among them, enhancing the contrast of an image can be to adjust the distribution of pixel values in the image, such as expanding the grayscale range or highlighting extreme values. By enhancing the contrast of an image, the clarity of the image can be enhanced, the key points and key information in the image can be highlighted, and the subsequent analysis and processing of the image can also be facilitated.
[0069] Exemplarily, a contrast-limited adaptive histogram equalization (CLAHE) algorithm may be used to enhance the contrast of the base layer image to obtain an enhanced base layer image.
[0070] Step 106: Perform Gaussian blur processing on the base layer image to obtain a secondary base layer image.
[0071] Among them, Gaussian blur is an image processing technology that achieves blurring effect by weighted averaging of images. For each pixel in the image, the Gaussian blur algorithm considers the surrounding pixels and determines the weight according to their distance from the central pixel. The closer the pixel is to the central pixel, the greater the weight, and the farther the pixel is, the smaller the weight. Then, the color values of these surrounding pixels are weighted averaged according to the weights to obtain the new color value of the central pixel. By performing such processing on each pixel in the base layer image, the blurring effect of the entire image can be achieved, and a secondary base layer image can be obtained.
[0072] Step 108: Generate a detail layer image based on the secondary base layer image and the original image.
[0073] Specifically, the secondary base layer image can be subtracted from the original image to obtain the detail layer image. Since obtaining the detail layer directly by subtracting the original image from the base image may reduce the detail information it contains, an additional Gaussian blur can be applied to the filtered base layer, that is, a secondary Gaussian blur is performed on the image base layer, which reduces the high-frequency details of the image to a certain extent, but retains the edge information. Subtracting the secondary blurred image from the input image, the image detail layer is obtained, which contains rich detail information.
[0074] Step 110: Use an automatic gain control method to enhance the detail layer image to obtain an enhanced detail layer image.
[0075] Exemplarily, an automatic gain control (AGC) method may be used to enhance the detail layer image to obtain an enhanced detail layer image, thereby obtaining rich detail information.
[0076] Step 112: merge the enhanced base layer image and the enhanced detail layer image according to a preset fusion coefficient to obtain an enhanced image corresponding to the original infrared image.
[0077] Among them, the enhanced base layer and detail layer are fused proportionally instead of directly adding the detail layer to the original image, which can make the final image have a certain denoising effect. This ensures that the final fused image has both good visual effects and proper image noise control.
[0078] In one embodiment, the following formula may be used to merge the enhanced base layer image and the enhanced detail layer image according to a preset fusion coefficient to obtain an enhanced image corresponding to the original image:
[0079] I out =(1-p)×I be +p×I de
[0080] Among them, I out To enhance the image, I be To enhance the base layer image, I de To enhance the detail layer image, p is the fusion coefficient.
[0081] The value of p usually ranges from 0 to 1, and is used to adjust the strength of detail enhancement and global contrast. Preferably, p = 0.1. This increases the proportion of the base layer as much as possible in the final output enhanced image, ensuring a comfortable contrast and clear details for human vision.
[0082] Step 114: linearly compress and enhance the dynamic range of the image to obtain an 8-bit output image.
[0083] Specifically, linear compression of the dynamic range of an image may be performed by adjusting parameters such as the pixel value, color saturation, and color balance of the image to improve the visibility of image details and the overall visual effect. For example, in the infrared image enhancement method provided by the present application, a compression mapping relationship and ratio between a 16-bit enhanced image and an 8-bit image may be established, and each pixel value in the compressed image may be traversed and converted according to the compression mapping ratio to obtain a corresponding 8-bit output image. The embodiment of the present application provides a high dynamic range infrared image enhancement method based on SKWGIF, which obtains a 16-bit original infrared image to be enhanced, and uses the SKWGIF algorithm to filter the original infrared image to obtain a base layer image corresponding to the original infrared image; uses the CLAHE algorithm to enhance the contrast of the base layer image to obtain an enhanced base layer image; performs Gaussian blur processing on the base layer image to obtain a secondary base layer image; generates a detail layer image based on the secondary base layer image and the original infrared image; uses an automatic gain control method to enhance the detail layer image to obtain an enhanced detail layer image; merges the enhanced base layer image and the enhanced detail layer image according to a preset fusion coefficient to obtain an enhanced image corresponding to the original image; linearly compresses the dynamic range of the enhanced image to obtain an 8-bit output image, which can improve the contrast of the enhanced image and enrich the details of the enhanced image.
[0084] In one embodiment, filtering the original infrared image using the SKWGIF algorithm to obtain a base layer image corresponding to the original infrared image may include the following steps:
[0085] Step 202, using the following formula, obtain the value of each pixel I in the guide image: i The corresponding output pixel q i :
[0086]
[0087] Among them, q i For pixel I i The corresponding output pixel, a k and b k It is a window k Adaptive adjustment parameters within; w ik It is controlled by the core C i The calculated weights;
[0088] Step 204, based on all output pixels q i , and get the base layer image.
[0089] Among them, the weighted guided filtering algorithm assumes that there is a linear transformation relationship between the original image and the base layer image, and can be transformed through the window ω k To achieve this linear transformation. For window ωk , the original image can also be called the input image p or the guide image I, and the base layer image can be called the output image q. Exemplarily, the weighted guided image filter with a steering kernel is used to process the original image. Compared with other algorithms, the algorithm used in this case has significant advantages in protecting edges, enhancing details, and adapting to different image conditions. The structural information of the guide image (through the local window and the steering kernel) is used to optimize the output image, thereby maintaining the characteristics of the input image and improving the filtering effect.
[0090] The filtering algorithm assumes that there is a linear transformation relationship between the output image q and the guidance image I. Specifically, for the window ω k For each pixel i in the i Given by the following linear model: q i =a k I i +b k , Among them, a k and b k It is a window k Adaptive adjustment parameters within.
[0091] Determine a by minimizing the mean square error k and b k The optimal solution of , so that the output image q is as close as possible to the input image p. k Inside, the cost function is defined as:
[0092]
[0093] Among them, ε is the regularization parameter, ψ(k) is the edge perception weight, which reflects the edge strength of the pixel and is used to dynamically adjust the regularization parameter.
[0094] By minimizing the cost function a k and b k The value of coefficient a k and b k The optimal solution is:
[0095]
[0096] Among them, I i is the pixel value in the guidance image, p i is the pixel value in the input image p, μ k and σ k 2 They are window ω k The mean and variance of the inner guidance image, |ω| represents the total number of pixel blocks in the window, is the input image in window ω kThe mean within .
[0097] The normalized local steering kernel of the guidance image is used as the weight function to calculate each output pixel q i The weighted average of:
[0098]
[0099] Among them, w ik It is turned to core C i Calculated weights. Turn to core C i The calculation involves the distance x i and x k and the correlation of the smoothing parameter h to reflect the weighted average in the output image q.
[0100] The embodiment of the present application provides a high dynamic range infrared image enhancement method based on SKWGIF, which uses a steering kernel-based guided filter to process the input image. When the guide image is the input image itself, the guided filter can better preserve the details and texture information of the image compared to other filtering methods such as bilateral filtering. When processing edges with large pixel grayscale changes, the possibility of gradient flipping is reduced. In addition, the guiding kernel can dynamically learn edge direction information from the guiding image and integrate this information into the filtering process, thereby improving its reliability in various applications such as edge preservation and detail enhancement.
[0101] In one embodiment, the contrast of the base layer image is enhanced by using the CLAHE algorithm to obtain an enhanced base layer image, including:
[0102] Step 302: divide the base layer image into a plurality of local sub-blocks of the same size and without overlapping.
[0103] Specifically, the base layer image can be divided into multiple 2*2 size sub-blocks (sub-regions) by using a CLAHE algorithm, and then the sub-regions are subjected to histogram equalization. Each sub-block will be subjected to histogram equalization separately.
[0104] Step 304: For each local sub-block, use a histogram equalization algorithm to calculate a histogram of the local sub-block.
[0105] Histogram equalization (HE) is applied to each sub-block. This step aims to enhance the contrast of each local area by redistributing the gray levels.
[0106] Step 306: determine the gray level in the histogram of the local sub-block that is greater than the set pixel number threshold.
[0107] In order to prevent excessive enhancement of local contrast, a contrast limiting mechanism is introduced. A threshold is set to truncate the part of the histogram that exceeds the threshold.
[0108] Step 308: divide the excess pixel number in the gray level that exceeds the pixel number threshold into other gray levels.
[0109] Specifically, when the gray level of a pixel exceeds the threshold, the histogram of the pixel will be truncated. That is, the gray level threshold is determined as the new enhanced gray level, and the truncated part will be redistributed. For the truncated part, it is evenly redistributed to the entire gray range to keep the area of the overall histogram unchanged. This process ensures that there will be no problem of excessive contrast enhancement. Thus, abnormal enhancement of contrast is avoided.
[0110] Step 310: Use a bilinear interpolation method to fuse all local sub-blocks to obtain an enhanced base layer image.
[0111] Specifically, the processed sub-blocks are reassembled into the final enhanced image. The processing of each sub-block is performed locally, so the overall effect is accumulated through local operations. Preferably, in order to eliminate discontinuities (such as block artifacts) between adjacent sub-blocks, bilinear interpolation is used to smooth the transition area between sub-blocks in the image. Bilinear interpolation ensures the visual continuity and smoothness of the processed image. In a specific application example, the enhanced base layer image is obtained as follows Figure 3 shown.
[0112] In one embodiment, performing automatic gain control on the detail layer image to obtain an enhanced detail layer image may include the following steps:
[0113] Use the following formula to process the detail layer image to obtain the enhanced detail layer image:
[0114] I de (i,j)=(g max a(i,j) avg +g min )×I d (i,j)
[0115] Among them, I de (i,j) represents the processed detail layer image, g max and g min are the maximum and minimum values of the gain, a(i, j) avg is the linear coefficient used by the aforementioned filtering algorithm, I d (i, j) is the unenhanced detail layer image. In a specific application example, the enhanced detail layer image obtained is as follows Figure 4 shown.
[0116] In order to further explain the solution of the embodiment of the present application, a specific example is given below. Figure 5 As shown, the present application provides an infrared image enhancement method based on guided kernel weighted guided image filtering, comprising the following steps:
[0117] 1. Use the SKWGIF filtering algorithm to smooth the input image to obtain the base image.
[0118] 2. Furthermore, a weighted average method is adopted to guide the normalized local guide kernel of the image as the weight function to more effectively extract the image edge information.
[0119] 3. Perform Gaussian blur processing on the image base layer to obtain a twice base layer (twice base image), and subtract the Gaussian blurred base layer (twice base image) from the input image to obtain the image detail layer (detailimage).
[0120] 4. Use the CLAHE method to enhance the contrast of the base layer of the image. Specifically, the image is divided into 2*2 sub-blocks, each sub-block is histogram equalized, and a bilinear interpolation method is used at the edge of the sub-block to reduce artifacts between adjacent blocks to obtain an enhanced base layer (base image enhancement).
[0121] 5. Use the linear coefficient of SKWGIF as the parameter of the AGC method to enhance the image detail layer, highlight the image details, and obtain the enhanced detail layer (detail image enhancement).
[0122] 6. The enhanced image base layer and detail layer are proportionally fused to obtain an enhanced image, and the dynamic range of the image is linearly compressed to obtain an 8-bit output image. For example, the final output image is as follows: Figure 6 As shown, good visual effects are ensured and the background ratio in the image is enlarged. At the same time, image fusion also has a denoising effect.
[0123] The embodiment of the present application provides a high dynamic range infrared image enhancement method based on SKWGIF, which uses a steering kernel-based guided filtering algorithm to obtain a base layer of an input image, and the base layer has a good edge preservation effect; Gaussian blur processing is performed on the base layer, and the image after secondary blur processing is subtracted from the input image to obtain a detail layer of the input image, and the detail layer has rich image detail information; the CLAHE algorithm is used to improve the contrast of the image base layer to avoid excessive local enhancement of the image; the AGC method of the SKWGIF linear coefficient is used to enhance the image detail layer, and good results are obtained while reducing the calculation complexity of the algorithm; the enhanced base layer and the detail layer are proportionally fused to ensure a comfortable contrast and clear details perceived by the human eye, thereby improving the image quality and visual experience; finally, the dynamic range of the image is linearly compressed to obtain an 8-bit output image that can be displayed on an electronic device.
[0124] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0125] Based on the same inventive concept, the embodiment of the present application also provides a SKWGIF-based high dynamic range infrared image enhancement device for implementing the SKWGIF-based high dynamic range infrared image enhancement method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more SKWGIF-based high dynamic range infrared image enhancement device embodiments provided below can refer to the above limitations on the SKWGIF-based high dynamic range infrared image enhancement method, which will not be repeated here.
[0126] In an exemplary embodiment, Figure 7 As shown, a high dynamic range infrared image enhancement device 700 based on SKWGIF is provided, comprising:
[0127] The base layer image generation module 701 is used to obtain the 16-bit original infrared image to be enhanced, and use the SKWGIF algorithm to filter the original infrared image to obtain the base layer image corresponding to the original infrared image;
[0128] An enhanced base layer image generation module 702 is used to enhance the contrast of the base layer image using a CLAHE algorithm to obtain an enhanced base layer image;
[0129] A secondary enhanced base layer image generation module 703 is used to perform Gaussian blur processing on the base layer image to obtain a secondary base layer image;
[0130] A detail layer image generation module 704, used to generate a detail layer image based on the secondary base layer image and the original image;
[0131] The enhanced detail layer image generation module 705 is used to enhance the detail layer image using an automatic gain control method to obtain an enhanced detail layer image;
[0132] The enhanced image generation module 706 is used to merge the enhanced base layer image and the enhanced detail layer image according to a preset fusion coefficient to obtain an enhanced image corresponding to the original image.
[0133] The output image generation module 707 is used to linearly compress and enhance the dynamic range of the image to obtain an 8-bit output image.
[0134] In one of the embodiments, the base layer image generation module is further configured to:
[0135] The original infrared image is used as the guide image and filtered to obtain the base layer image.
[0136] In one of the embodiments, the base layer image generation module is further configured to:
[0137] Use the following formula to get each pixel I in the guidance image i The corresponding output pixel q i :
[0138]
[0139] Among them, q i For pixel I i The corresponding output pixel, a k and b k It is a window k Adaptive adjustment parameters within; w ik It is turned to core C i The calculated weights;
[0140] According to all output pixels q i , and get the base layer image.
[0141] In one of the embodiments, the enhanced base layer image generation module is further configured to:
[0142] For each local sub-block, a histogram equalization algorithm is used to calculate the histogram of the local sub-block;
[0143] Determine the gray level in the histogram of the local sub-block that is greater than a set pixel number threshold;
[0144] The excess number of pixels in the gray level that exceeds the pixel number threshold is equally divided into other gray levels;
[0145] All local sub-blocks are fused using the bilinear interpolation method to obtain the enhanced base layer image.
[0146] In one embodiment, the enhanced detail layer image generation module is used to perform automatic gain control on the detail layer image, and the obtained enhanced detail layer image is also used to:
[0147] Use the following formula to process the detail layer image to obtain the enhanced detail layer image:
[0148] I de (i,j)=(g max a(i,j) avg +g min )×I d (i,j)
[0149] Among them, I de (i,j) represents the processed detail layer image, g max and g min are the maximum and minimum values of the gain, a(i, j) avg are the linear coefficients of the filtering algorithm, and Id(i,j) is the unenhanced detail layer image.
[0150] In one embodiment, the enhanced image generation module is further configured to:
[0151] Use the following formula to merge the enhanced base layer image and the enhanced detail layer image according to the preset fusion coefficient to obtain the enhanced image corresponding to the original image:
[0152] I out =(1-p)×I be +p×I de
[0153] Among them, I out To enhance the image, I be To enhance the base layer image, I de To enhance the detail layer image, p is the fusion coefficient; p = 0.1.
[0154] Each module in the high dynamic range infrared image enhancement device based on SKWGIF can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0155] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an infrared image enhancement method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0156] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0157] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above method when executing the computer program.
[0158] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described above are implemented.
[0159] In one embodiment, a computer program product is provided, comprising a computer program, which implements the steps of the above method when executed by a processor.
[0160] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0161] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0162] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A high dynamic range infrared image enhancement method based on SKWGIF, characterized in that: The method comprises: Acquire a 16-bit original infrared image to be enhanced, and use the SKWGIF algorithm to filter the original infrared image to obtain a base layer image corresponding to the original infrared image; Using the CLAHE algorithm to enhance the contrast of the base layer image to obtain an enhanced base layer image; Performing Gaussian blur processing on the base layer image to obtain a secondary base layer image; generating a detail layer image based on the secondary base layer image and the original image; Using an automatic gain control method to enhance the detail layer image to obtain an enhanced detail layer image; Merging the enhanced base layer image and the enhanced detail layer image according to a preset fusion coefficient to obtain an enhanced image corresponding to the original infrared image; The dynamic range of the enhanced image is linearly compressed to obtain an 8-bit output image.
2. The method according to claim 1, characterized in that: The filtering process of the original infrared image using the SKWGIF algorithm to obtain a base layer image corresponding to the original infrared image includes: The linear model and cost function of the SKWGIF algorithm are established, and the original infrared image is used as the guide image in the SKWGIF algorithm; Calculate edge-aware weights within a local window of the guidance image; Calculate the filter coefficients of the SKWGIF algorithm based on the established cost function and edge-aware weights; Calculate the normalized local steering kernel of the guidance image; The brightness value of each pixel in the base layer image corresponding to the original infrared image is calculated according to the filter coefficient and the normalized local steering kernel.
3. The method according to claim 1, characterized in that The step of using the CLAHE algorithm to enhance the contrast of the base layer image to obtain an enhanced base layer image includes: Dividing the base layer image into a plurality of local sub-blocks of the same size and without overlapping; For each of the local sub-blocks, a histogram equalization algorithm is used to calculate a histogram of the local sub-block; Determine a gray level in the histogram of the local sub-block that is greater than a set pixel number threshold; The excess number of pixels in the gray level exceeding the pixel number threshold is equally divided into other gray levels; All the local sub-blocks are fused using a bilinear interpolation method to obtain the enhanced base layer image.
4. The method according to claim 1, characterized in that: The step of enhancing the detail layer image by using an automatic gain control method to obtain an enhanced detail layer image includes: The detail layer image is processed using the following formula to obtain the enhanced detail layer image: I de (i,j)=(g max (i,j) avg +g min )×I d (i,j) Among them, I de (i,j) represents the processed detail layer image, g max and g min are the maximum and minimum values of the gain, respectively, a(i, j) avg is the linear coefficient of the filtering algorithm, I d (i,j) is the unenhanced detail layer image.
5. The method according to claim 1, characterized in that The step of merging the enhanced base layer image and the enhanced detail layer image according to a preset fusion coefficient to obtain an enhanced image corresponding to the original image includes: The enhanced base layer image and the enhanced detail layer image are merged according to a preset fusion coefficient using the following formula to obtain an enhanced image corresponding to the original infrared image: I out =(1-p)×I be +p×I de Among them, I out To enhance the image, I be To enhance the base layer image, I de To enhance the detail layer image, p is the fusion coefficient, p = 0.
1.
6. A high dynamic range infrared image enhancement device based on SKWGIF, characterized in that: The device comprises: A base layer image generation module performs filtering processing on the original infrared image to obtain a base layer image corresponding to the original infrared image; An enhanced base layer image generation module, used for enhancing the contrast of the base layer image to obtain an enhanced base layer image; A secondary enhanced base layer image generation module, used for performing Gaussian blur processing on the base layer image to obtain a secondary base layer image; A detail layer image generation module, used for generating a detail layer image based on the secondary base layer image and the original image; An enhanced detail layer image generation module is used to perform automatic gain control on the detail layer image to obtain an enhanced detail layer image; The enhanced image generation module is used to merge the enhanced base layer image and the enhanced detail layer image according to a preset fusion coefficient to obtain an enhanced image corresponding to the original infrared image. The output image generation module is used to linearly compress the dynamic range of the enhanced image to obtain an 8-bit output image.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Infrared image detail enhancement method based on hierarchical compression
CN112215785A
SF6 infrared image enhancement method and system
CN112419213A
Infrared image dynamic range compression method and system
CN113496531A
Infrared image enhancement method based on weighted guide filtering
CN114092353A
Tone mapping method based on multi-scale WLS filtering fusion
CN115456912A
Cited By
Casting X-ray flaw detection 16-bit grayscale image adaptive enhancement method and system
CN120107137A