Infrared image enhancement method and system combining background equalization and detail stretching
Through the infrared image enhancement method combined with background equalization and detail stretching, the problems of low contrast and noise of grayscale infrared images are solved, and the significant improvement of image details and noise suppression are achieved, and the accuracy of ablation fault judgment is improved.
Patent Information
- Application Number
- CN202411922432.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-06-27
AI Technical Summary
In the prior art, grayscale infrared images have low contrast, difficult to observe details, and often there is noise, which leads to difficulty in determining ablation faults.
The infrared image enhancement method combined with background equalization and detail stretching is adopted. Through the image decomposition method of combining average gradient and guided filtering, the original gray-scale infrared image is decomposed into the background layer and the detail layer, and the enhancement processing and denoising stretching are performed respectively, and fusion and pseudo-color processing are finally carried out.
It effectively improves the contrast and detail significance of the image, suppresses noise, improves visual effects, helps identify the heating area of the cable, and significantly improves the accuracy of ablation fault judgment.
Smart Images

Figure CN120219265A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electrical information processing, and particularly to an infrared image enhancement method and system combining background equalization and detail stretching for cable infrared image enhancement, denoising, and pseudo-color processing. Background Art
[0002] High-voltage cables are important components of urban power supply systems and are the "arteries" of power transmission. In recent years, ablation failures of the buffer layer of high-voltage cables have occurred frequently, attracting wide attention in the industry. Ablation of the buffer layer can damage the cable body, reduce the service life of the cable, and seriously threaten the safe and stable operation of high-voltage cables. At the same time, ablation failures of the buffer layer occur inside the cable and are difficult to directly observe, which brings inconvenience to actual on-site diagnosis.
[0003] Research shows that the key inducement of buffer layer ablation failure may be poor electrical contact. Poor contact between the aluminum sheath and the buffer layer of high-voltage cables will cause the original current path in the buffer layer to be blocked, resulting in current concentration and heat generation in local areas. Therefore, the use of infrared temperature measurement technology can well monitor the temperature distribution of high-voltage cables, and then judge whether there is an ablation failure and its location.
[0004] However, due to the performance limitations of temperature measurement equipment and the small temperature difference between different parts of the cable, the directly collected grayscale infrared images have low contrast, making it difficult to observe details, and usually have noise, which causes difficulties in judging ablation failures. To solve the above problems, the present invention performs adaptive enhancement processing on the original grayscale infrared images of the cable, including enhancing the contrast and suppressing noise, so that the image details are more prominent. Further, the enhanced grayscale infrared images are subjected to pseudo-color processing to achieve a better visual effect, highlighting the cable temperature distribution, so as to better identify the cable heating area from the image.
[0005] CN117367589A discloses an all-weather auxiliary temperature measurement system for substation main equipment based on AI technology. This patent relates to the technical field of substation equipment temperature measurement, and specifically discloses an all-weather auxiliary temperature measurement system for substation main equipment based on AI technology, including: a real-time online auxiliary temperature measurement module, an AI autonomous detection module, a data processing module, a data transmission module, and a feedback module; through the real-time online auxiliary temperature measurement module of the present invention, using integrated design process technology, an infrared high-definition video unit, an infrared temperature measurement unit, a sensing device, and a data receiving gateway are integrated and applied. The data receiving gateway is installed and deployed on the accessory bracket of the substation main transformer equipment, and a wireless temperature measurement device is used for blind spot filling installation and deployment to achieve all-weather online temperature measurement of the substation main transformer equipment. By using AI self-supervised learning technology to detect the images of cables and equipment, using AI to identify abnormally high or low temperature areas, and generating alarms, an integrated wireless sensing monitoring unit is integrated to ensure that data can be wirelessly transmitted to the central control system. This patent focuses on the system, software and hardware, which is different from the focus of the present invention. The method of this patent only uses existing denoising methods, so the method of this patent has poor effects and weak practicability.
[0006] CN105469374A discloses a method for real-time display of high-speed and large-capacity infrared image data. This patent relates to a method for real-time display of high-speed and large-capacity infrared image data; after the collected image data is sent into the system, it is sorted according to the set main sequence and stored in the memory. Then, data format and image display transformation operations are performed on the image data stored in the memory. In the system, at least one memory buffer area of a set size, that is, a high-speed buffer area, is opened around the display area. The high-speed buffer area reads the image data obtained after the above processing, and then copies the image data in the high-speed buffer area to the display buffer area to achieve high-speed drawing of the image. This patent realizes fast and clear display of large-capacity images, and greatly improves the speed of large-capacity image roaming. This patent focuses on storage and display, which has little relevance to the present invention. Moreover, the method of this patent has high costs and a small scope of application. Summary of the Invention
[0007] To solve the deficiencies in the prior art such as poor effects, weak practicability, high costs, and small scope of application, the present invention provides an infrared image enhancement method and system that combines background equalization and detail stretching to at least solve the problems in the related art such as low contrast of grayscale infrared images, difficulty in observing details, and usually existing noise.
[0008] The present invention adopts the following technical solutions.
[0009] On the one hand, the present invention discloses an infrared image enhancement method that combines background equalization and detail stretching, including:
[0010] Step 1: Decompose the original grayscale infrared image into an image background layer and an image detail layer using an image decomposition method based on the comprehensive average gradient and guided filter;
[0011] Step 2: Perform image enhancement processing on the image background layer based on contrast-limited adaptive histogram equalization to obtain the enhanced image background layer; perform denoising and stretching on the image detail layer based on adaptive bilateral filtering to obtain the denoised and stretched detail layer;
[0012] Step 3: Fuse the enhanced image background layer and the denoised and stretched detail layer, and perform stretching processing to obtain the enhanced grayscale infrared image;
[0013] Step 4: Perform pseudo-color processing on the enhanced grayscale infrared image to generate a color infrared image.
[0014] Further preferably,
[0015] The image background layer I b is obtained according to the following formula:
[0016]
[0017] where i is an integer and i ∈ [1, N]; N is the total number of image pixel points; I bi is the value of the image background layer at pixel point i; is the mean of the first local coefficients of each pixel point in the window ω ki centered at pixel point i in the original grayscale infrared image; I i is the value of the original grayscale infrared image at pixel point i; is the mean of the second local coefficients of each pixel point in the window ω ki centered at pixel point i.
[0018] The image detail layer I d is obtained by subtracting the image background layer from the original grayscale infrared image.
[0019] Further preferably,
[0020] The first local coefficient and the second local coefficient are obtained by optimizing the following cost function in the window:
[0021]
[0022] where a ki is the first local coefficient in the square window ω ki centered at pixel point i; b ki is the second local coefficient in the square window ω ki centered at pixel point i; E(a ki ,bki ) is the cost function optimized in the square window ω centered on the pixel point i ki ; z represents any pixel point in the window ω centered on i ki ; p z is the pixel value of the guidance image at the pixel point z; I z is the pixel value of the original grayscale infrared image at the pixel point z; ε is the regularization parameter.
[0023] Further preferably,
[0024] as shown in the following formula:
[0025]
[0026] where j is an integer and j ∈ [1, N]; N is the total number of image pixel points, ζ is the compensation coefficient; g z represents the average gradient value of the pixels within the window centered on the pixel point z, and g j represents the average gradient value of the pixels within the window centered on the pixel point j.
[0027] Further preferably,
[0028] In step 2, the method for performing image enhancement processing on the image background layer based on contrast-limited adaptive histogram equalization is as follows:
[0029] Divide the image background layer into several background layer sub-blocks with equal size, the same shape, and non-overlapping; the total number of pixels corresponding to the long side of each background layer sub-block is m, and the total number of pixels corresponding to the short side is n;
[0030] Average the number of pixels in each background layer sub-block to the average value of each gray level;
[0031] Clip the number of pixels exceeding the clipping threshold in the gray histogram of each background layer sub-block, and evenly distribute the clipped number of pixels to each gray level to complete the contrast limitation of the background layer sub-block;
[0032] After each background layer sub-block completes the contrast limitation, perform histogram equalization processing respectively; through bilinear interpolation processing, eliminate the block effect between the background layer sub-blocks to obtain the enhanced background image I bCLAHE .
[0033] Further preferably,
[0034] The calculation formula of the clipping threshold is as follows:
[0035]
[0036] where, Represents the shear threshold of the l-th background layer sub-block; Represents the average value obtained by evenly distributing the number of pixels of the l-th background layer sub-block to each gray level; Is the shear coefficient of the l-th background layer sub-block; a is the first shear coefficient of the background layer; g lb Is the average gradient value within the l-th background layer sub-block in the image background layer; b is the second shear coefficient of the background layer.
[0037] Further preferably,
[0038] In step 2, the method for denoising and stretching the image detail layer based on adaptive bilateral filtering is as follows:
[0039] Perform bilateral filtering on the image detail layer to obtain the denoised detail layer I dbf , and then stretch the denoised detail layer to obtain the denoised and stretched detail layer I dbfw ;
[0040] The formula for stretching the denoised detail layer is as follows:
[0041] I dbfw = g a I dbf + g b ;
[0042] Among them, g a Is the linear stretching gain coefficient; g b Is the brightness gain coefficient.
[0043] Further preferably,
[0044] The method for performing bilateral filtering on the image detail layer to obtain the denoised detail layer is as follows:
[0045] Divide the image detail layer into several detail layer sub-blocks with equal size, the same shape, and non-overlapping; set coordinate axes for each detail layer sub-block, and the total number of pixels corresponding to the long side of each detail layer sub-block is m d , and the total number of pixels corresponding to the wide side is n d ;
[0046] Perform improved bilateral filtering on each detail layer sub-block to obtain each denoised detail layer sub-block;
[0047] Stitch the denoised detail layer sub-blocks to obtain the denoised and stretched detail layer.
[0048] Further preferably,
[0049] Perform bilateral filtering on each detail layer sub-block through the following formula to obtain each denoised detail layer sub-block:
[0050]
[0051] where c is an integer, and c ∈ [1, N dc , N dc is the total number of detail layer sub - blocks divided from the image detail layer; t is an integer, and t ∈ [1, N c , N c is the total number of pixel points in each detail layer sub - block; is the c - th detail layer sub - block after denoising; S is the local neighborhood centered on pixel point t; q is any pixel point in the local neighborhood centered on pixel point t; is the pixel value of the c - th detail layer sub - block at pixel point q; ω c (t, q) is the weight of the c - th detail layer sub - block at pixel point q; W ct is the sum of the weights of each pixel point in the local neighborhood centered on pixel point t within the c - th detail layer sub - block;
[0052] Further preferably,
[0053] The weight of the c - th detail layer sub - block at pixel point q is calculated according to the following formula:
[0054]
[0055] where e is the natural logarithm base; is the pixel value of the c - th detail layer sub - block at pixel point t.
[0056] Further preferably,
[0057] Calculate according to the following formula:
[0058]
[0059] where a S is the first weight coefficient; g cd is the average gradient within the c - th detail layer sub - block; b S is the second weight coefficient;
[0060] Calculate according to the following formula:
[0061]
[0062] where a r is the third weight coefficient; b r is the fourth weight coefficient.
[0063] Further preferably,
[0064] In step 3, the stretching process obtains the enhanced grayscale infrared image I en The formula is as follows:
[0065]
[0066] Among them, I e is the image after fusing the enhanced image background layer and the denoised and stretched detail layer; I e_max is the image I e 's maximum gray value; I e_min is the image I e 's minimum gray value; R is the gray correlation coefficient.
[0067] On the other hand, the present invention discloses an infrared image enhancement system based on an infrared image enhancement method combining background equalization and detail stretching, including an image background and detail layer decomposition module, an image background layer equalization enhancement module, an image detail layer denoising and stretching module, an image background and detail layer fusion and stretching module, and an enhanced gray infrared image pseudo-color processing module;
[0068] The image background and detail layer decomposition module decomposes the original gray infrared image into an image background layer and an image detail layer based on an image decomposition method combining comprehensive average gradient and guided filtering;
[0069] The image background layer equalization enhancement module performs image enhancement processing on the image background layer based on restricted contrast adaptive histogram equalization to obtain an enhanced image background layer;
[0070] The image detail layer denoising and stretching module performs denoising and stretching on the image detail layer based on adaptive bilateral filtering to obtain a denoised and stretched detail layer;
[0071] The image background and detail layer fusion and stretching module is used to fuse the enhanced image background layer and the denoised and stretched detail layer, and perform stretching processing to obtain an enhanced gray infrared image;
[0072] The enhanced gray infrared image pseudo-color processing module is used to perform pseudo-color processing on the enhanced gray infrared image to generate a color infrared image.
[0073] On the other hand, the present invention discloses an electronic device, including a processor and a storage medium; characterized in that:
[0074] The storage medium is used to store instructions;
[0075] The processor is used to operate according to the instructions to execute the infrared image enhancement method according to the foregoing combination of background equalization and detail stretching.
[0076] The present invention also discloses a computer-readable storage medium, on which a computer program is stored, characterized in that when the program is executed by a processor, the infrared image enhancement method according to the foregoing combination of background equalization and detail stretching is implemented.
[0077] The beneficial effects of the present invention are as follows. Compared with the prior art,
[0078] (1) The present invention divides the infrared image into a background layer and a detail layer, processes them separately and then performs fusion stretching, which can effectively filter out noise while enhancing details and retain as much useful information in the original image as possible;
[0079] (2) The present invention uses an image decomposition method that combines the average gradient and guided filtering to decompose the image into a background layer and a detail layer. Compared with traditional guided filtering, it can effectively avoid the generation of halo artifacts after image filtering;
[0080] (3) The present invention determines the contrast limit threshold of CLAHE for histogram equalization of the background layer according to the average gradient of the image block, and alleviates the problems of difficult parameter setting and excessive image contrast after processing through adaptive parameters;
[0081] (4) The present invention sets the filtering parameters of bilateral filtering denoising ABF for the image detail layer according to the average gradient of the image block, retains details as much as possible while filtering out noise, and further stretches to improve the fusion effect;
[0082] (5) The present invention performs pseudo-color processing on the enhanced grayscale infrared image of the cable, improves the visual visualization effect, highlights the cable temperature distribution, and is conducive to the identification of cable heating areas and fault judgment.
[0083] (6) The present invention has outstanding advantages such as good effect, strong practicability, low cost, and wide application range. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Figure 1 is a schematic flow chart of the method of the present invention;
[0085] Figure 2 is a schematic structural diagram of the system of the present invention;
[0086] Figure 3 is a comparison diagram of the effects of Experiment 1 of the method of the present invention;
[0087] Figure 4 is a comparison diagram of the effects of Experiment 2 of the method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0088] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. The embodiments described in the present invention are only a part of the embodiments of the present invention, rather than all embodiments. Based on the spirit of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
[0089] The present invention discloses an infrared image enhancement method combining background equalization and detail stretching, including:
[0090] Step 1: Decompose the original grayscale infrared image into an image background layer and an image detail layer by an image decomposition method based on the comprehensive average gradient and guided filter;
[0091] The image background layer I b is obtained according to the following formula:
[0092]
[0093] where i is an integer, corresponding to the i-th pixel point in the image, and i ∈ [1, N]; N is the total number of image pixel points; I bi is the value of the image background layer at the pixel point i; is the mean value of the first local coefficients of each pixel point in the window ω ki centered at the pixel point i in the original grayscale infrared image; I i is the value of the original grayscale infrared image at the pixel point i; is the mean value of the second local coefficients of each pixel point in the window ω ki centered at the pixel point i; where each pixel point in the image corresponds to a first local coefficient and a second local coefficient. Preferably, before decomposing the original grayscale infrared image into an image background layer and an image detail layer, the edges of the original grayscale infrared image are first mirrored to ensure that there are also neighborhoods in the edge parts, so as to ensure that each pixel point in the image will definitely correspond to a first local coefficient and a second local coefficient.
[0094] The first local coefficient and the second local coefficient are obtained by optimizing the following cost function in the window:
[0095]
[0096] where a ki is the first local coefficient in the square window ω ki centered at the pixel point i; b ki is the second local coefficient in the square window ω ki centered at the pixel point i; E(a ki , b ki ) is the cost function optimized in the square window ω ki centered at the pixel point i; z represents any pixel point in the window ω ki centered at i; p z is the pixel value of the guided image at the pixel point z; I zis the pixel value of the original grayscale infrared image at pixel point z; preferably, in the present invention, the guidance image is the same as the original grayscale infrared image. ε is a regularization parameter, and its preferred value range is 598 - 602.
[0097] As shown in the following formula:
[0098]
[0099] where j is an integer, corresponding to the j-th pixel point in the image, and j ∈ [1, N]; N is the total number of image pixel points, ζ is a compensation coefficient, and its preferred value range is 0.01 - 0.06; g z represents the average gradient value of the pixels within the window centered on pixel point z, and g j represents the average gradient value of the pixels within the window centered on pixel point j.
[0100] Set coordinate axes for each window. The average gradient value of the pixels within the window centered on pixel point z is calculated by the following formula:
[0101]
[0102] where n is the side length of the square window centered on pixel point z; x is the abscissa in the square window centered on pixel point z; y is the ordinate in the square window centered on pixel point z; I(x, y) is the original grayscale infrared image, and it is the value at the pixel point with coordinates (x, y) in the square window centered on pixel point z; refers to obtaining the gradient value in the z direction at the pixel point with coordinates (x, y) in the square window centered on pixel point z from the original grayscale infrared image; refers to obtaining the gradient value in the y direction at the pixel point with coordinates (x, y) in the square window centered on pixel point z from the original grayscale infrared image.
[0103] The image detail layer I d is obtained by subtracting the image background layer from the original grayscale infrared image.
[0104] Step 2: Perform image enhancement processing on the image background layer based on contrast - limited adaptive histogram equalization to obtain the enhanced image background layer; perform denoising and stretching on the image detail layer based on adaptive bilateral filtering to obtain the denoised and stretched detail layer;
[0105] The method for performing image enhancement processing on the image background layer based on contrast - limited adaptive histogram equalization is:
[0106] Divide the image background layer into several fixed background layer sub - blocks of equal size, the same shape, and non - overlapping, each with dimensions \(m\times n\); set coordinate axes for each background layer sub - block. The total number of pixels corresponding to the long side of each background layer sub - block, that is, the number of pixels in the \(x\) - direction is \(m\), and the total number of pixels corresponding to the short side, that is, the number of pixels in the \(y\) - direction is \(n\).
[0107] Average the number of pixels of each background layer sub - block to the average value of each gray - level. The formula is as follows:
[0108]
[0109] In the formula, represents the average value of the number of pixels of the \(l\) - th background layer sub - block evenly distributed to each gray - level; \(l\) is an integer, and \(l\in[1,N bL ; \(N bL is the total number of background layer sub - blocks divided from the image background layer, \(N bL = m\times n\); \(L l is the number of gray - levels contained in the background layer sub - block \(l\).
[0110] Clip the number of pixels in the gray - level histogram of each background layer sub - block that exceeds the clipping threshold, that is, limit the number of pixels contained in each gray - level of each background layer sub - block not to exceed the clipping threshold. Then clip the gray - level histogram of each background layer sub - block, and evenly distribute the clipped number of pixels to each gray - level to complete the contrast limitation of the background layer sub - block.
[0111] The calculation formula of the clipping threshold is as follows:
[0112]
[0113] Where, represents the clipping threshold of the \(l\) - th background layer sub - block; represents the average value of the number of pixels of the \(l\) - th background layer sub - block evenly distributed to each gray - level; is the clipping coefficient of the \(l\) - th background layer sub - block, and its preferred value range is \(0.87 - 1.11\); \(a\) is the first clipping coefficient of the background layer, and its preferred value range is \(0.95 - 1.15\); \(g lb is the average gradient value within the \(l\) - th background layer sub - block in the image background layer; \(b\) is the second clipping coefficient of the background layer, and its preferred value range is \(3.79 - 4.21\).
[0114] Image background layer \(I b The average gradient within the \(l\) - th background layer sub - block in is calculated by the following formula:
[0115]
[0116] x is the abscissa within the l-th background layer sub-block; y is the ordinate within the l-th background layer sub-block;
[0117] is the image background layer, and the value at the pixel point with coordinates (x, y) within the l-th background layer sub-block; represents obtaining the gradient value in the x direction at the pixel point with coordinates (x, y) within the l-th background layer sub-block of the image background layer; represents obtaining the gradient value in the y direction at the pixel point with coordinates (x, y) within the l-th background layer sub-block of the image background layer.
[0118] When evenly distributing the clipped number of pixels into each gray level, first calculate the number of pixels N evenly distributed to each gray level in each background layer sub-block a Calculate according to the following formula:
[0119]
[0120] where, is the number of pixels evenly distributed to each gray level in the l-th background layer sub-block; is the total number of pixels clipped in the l-th background layer sub-block; [·] represents rounding down the content in the brackets.
[0121] Then distribute the calculated number of pixels to each gray level, and finally evenly distribute the remaining unassigned number of pixels to the gray levels less than the clipping threshold C limit in a cyclic distribution until the remaining number of pixels is zero.
[0122] After each background layer sub-block completes contrast limitation, perform histogram equalization processing respectively; through bilinear interpolation processing, eliminate the block effect between background layer sub-blocks to obtain the enhanced background image I bCLAHE .
[0123] The method for denoising and stretching the image detail layer based on adaptive bilateral filtering is as follows:
[0124] Perform bilateral filtering on the image detail layer to obtain the denoised detail layer I dbf ;
[0125] The method for performing bilateral filtering on the image detail layer to obtain the denoised detail layer is as follows:
[0126] Divide the image detail layer into several non-overlapping m d ×n d fixed detail layer sub-blocks; set coordinate axes for each detail layer sub-block, and the total number of pixels corresponding to the long side of each detail layer sub-block, that is, the number of pixels in the x direction is m d , and the total number of pixels corresponding to the wide side, that is, the number of pixels in the y direction is nd ;
[0127] Perform bilateral filtering on each sub-block of the detail layer to obtain the denoised sub-blocks of each detail layer;
[0128] Perform bilateral filtering on each sub-block of the detail layer through the following formula to obtain the denoised sub-blocks of each detail layer:
[0129]
[0130] where c is an integer and c ∈ [1, N dc , N dc is the total number of sub-blocks of the detail layer divided from the image detail layer; t is an integer, corresponding to the t-th pixel point in the sub-block of the detail layer, and its value corresponds to its position in the sub-block of the detail layer, and t ∈ [1, N c , N c is the total number of pixel points in each sub-block of the detail layer, N c = m d × n d ; is the c-th denoised sub-block of the detail layer; S is the local neighborhood centered on the pixel point t; q is any pixel point in the local neighborhood centered on the pixel point t, and its value range is from 1 to the closed interval of the total number of pixel points in the local neighborhood centered on the pixel point t, and its value corresponds to its position in the local neighborhood centered on the pixel point t; is the pixel value of the c-th detail layer sub-block at the pixel point q; ω c (t, q) is the weight of the pixel point q in the local neighborhood centered on the pixel point t in the c-th detail layer sub-block; W ct is the sum of the weights of each pixel point in the local neighborhood centered on the pixel point t in the c-th detail layer sub-block; that is, W ct can be expressed by the following formula:
[0131] W ct = ∑ q∈S ω c (t, q).
[0132] ω c (t, q) is the weight of the pixel point q in the local neighborhood centered on the pixel point t in the c-th detail layer sub-block calculated by the following formula:
[0133]
[0134] where e is the natural base; is the pixel value of the c-th detail layer sub-block at the pixel point t.
[0135] Perform the calculation according to the following formula:
[0136]
[0137] Among them, a S is the first weight coefficient, and its preferred value range is 74.5 - 75.5; g cd is the average gradient within the c-th detail layer sub-block; b S is the second weight coefficient, and its preferred value range is 0 - 0.15;
[0138] The average gradient g within the c-th detail layer sub-block cd is calculated by the following formula:
[0139]
[0140] Among them, is the image detail layer, and it is the value at the pixel point with coordinates (x, y) within the c-th detail layer sub-block; represents obtaining the gradient value in the x direction at the pixel point with coordinates (x, y) within the c-th detail layer sub-block of the image detail layer; represents obtaining the gradient value in the y direction at the pixel point with coordinates (x, y) within the l-th detail layer sub-block of the image detail layer.
[0141] It is calculated according to the following formula:
[0142]
[0143] Among them, a r is the third weight coefficient, and its preferred value range is 74.4 - 75.5; b r is the fourth weight coefficient, and its preferred value range is 0 - 0.15.
[0144] The denoised detail layer sub-blocks are spliced to obtain the denoised and stretched detail layer.
[0145] Then, the denoised detail layer is stretched to obtain the denoised and stretched detail layer I dbfw ;
[0146] Among them, the formula for stretching the denoised detail layer is as follows:
[0147] I dbfw = g a I dbf + g b ;
[0148] Among them, g a is the linear stretching gain coefficient, and its value range is [0, 255]; g b is the brightness gain coefficient, and its value range is [0, 255].
[0149] Step 3: Fuse the enhanced image background layer and the detail layer after denoising and stretching, and perform stretching processing to obtain an enhanced grayscale infrared image;
[0150] The formula for fusing the enhanced image background layer and the detail layer after denoising and stretching is as follows:
[0151] I e = I bCLAHE + I dbfw ;
[0152] where, I e is the image after fusing the enhanced image background layer and the detail layer after denoising and stretching; I bCLAHE is the enhanced image background layer; I dbfw is the detail layer after denoising and stretching, and fusing them gives I e .
[0153] The formula for the stretching process to obtain the enhanced grayscale infrared image I en is as follows:
[0154]
[0155] where, I e is the image after fusing the enhanced image background layer and the detail layer after denoising and stretching; I e_max is the maximum grayscale value of the image I e ; I e_min is the minimum grayscale value of the image I e ; R is the grayscale correlation coefficient, and its preferred value range is 255 - 256.
[0156] Step 4: Perform pseudo-color processing on the enhanced grayscale infrared image, map pixels with different grayscale levels in the enhanced grayscale infrared image into different colors, and generate a color infrared image.
[0157] Example 1
[0158] The present invention provides an infrared image enhancement method combining background equalization and detail stretching. As Figure 1 shown, it includes five parts: adaptive image background layer and detail layer decomposition by an image decomposition method of comprehensive average gradient and guided filtering for the grayscale infrared image, adaptive equalization enhancement of the decomposed image background layer based on contrast-limited adaptive histogram equalization (CLAHE), adaptive denoising and stretching of the decomposed image detail layer based on adaptive bilateral filtering (ABF, full English name: adaptive bilateral filtering), fusing and stretching the enhanced background layer and the detail layer after denoising and stretching to obtain an enhanced grayscale infrared image, and performing pseudo-color processing on the enhanced grayscale infrared image to obtain a pseudo-color infrared image.
[0159] The overall framework and processing process of adaptive infrared image enhancement are as follows:
[0160] For a given grayscale infrared image I of a cable, first, filter it through an image decomposition method that combines the average gradient and guided filter to obtain the background image I b , and subtract the original image from the background image to obtain the detail image I d ; Next, for the background image I b , use the improved CLAHE for enhancement to obtain the enhanced background image I bCLAHE ; For the detail image I d , use the improved adaptive bilateral filter for denoising and stretching to obtain the filtered detail image I dbfw ; Then, fuse and stretch I bCLAHE and I dbfw to obtain the enhanced grayscale infrared image I of the cable en ; Finally, perform pseudo-color processing on I en to generate the pseudo-color infrared image I of the cable enc .
[0161] Step 1: Decompose the original grayscale infrared image into an image background layer and an image detail layer based on a set image decomposition method;
[0162] Adaptive image background and detail layer decomposition based on the image decomposition method that combines the average gradient and guided filter
[0163] For the input grayscale infrared image I of the cable, first, filter it through the image decomposition method that combines the average gradient and guided filter to obtain the background image I b , and this process can be expressed as:
[0164] I b = GF(I) (1)
[0165] In the formula, GF(I) represents performing the average gradient and guided filter on the grayscale infrared image I of the cable.
[0166] Furthermore, subtract the input image from the background image to obtain the detail image I d :
[0167] I d = I - I b (2)
[0168] Among them, guided filtering is an image filtering technique aimed at smoothing the image while preserving the details and edge information of the image. It filters using a guiding image, which can be the input image itself or other images related to the input image, such as a gradient map or a low-resolution version of the input image. In the present invention, the input image itself is used as the guiding image.
[0169] Some parameters need to be set in traditional guided filtering, such as the filtering radius and intensity parameters, etc. If the parameters are not selected properly, it may lead to the generation of the halo effect. The present invention optimizes the regularization parameter and proposes an image decomposition method combining the comprehensive average gradient and guided filtering. The method for realizing the comprehensive average gradient and guided filtering is as follows.
[0170] The pixel values in the original grayscale infrared image are collected using a sliding window. Preferably, the sliding step of the sliding window is 1 pixel value.
[0171] Specifically, given the input image I and the guiding image p, in the present invention p = I, and the local linear relationship model between the output image I of the guided filtering and the guiding image p is: b
[0172]
[0173] where i is an integer; corresponding to the i-th pixel point in the image, and i ∈ [1, N]; N is the total number of image pixel points; ω ki is a square window centered on the pixel point i; I bi is the value of the image I b at i; p i is the value of the image p at i; a k and b k are the local coefficients in the square window ω ki centered on the pixel point i. The linear function correlation coefficients a k , b k are calculated by the following formula, and the following cost function is optimized in the window:
[0174]
[0175] where a ki is the first local coefficient in the square window ω ki centered on the pixel point i; b ki is the second local coefficient in the square window ω ki centered on the pixel point i; E(a ki , b ki ) is the cost function optimized in the square window ω ki centered on i; z represents the window ω centered on iki Any pixel point in; p z Is the pixel value of the guidance image at pixel point z; I z Is the pixel value of the original grayscale infrared image at pixel point z; Preferably, in the present invention, the guidance image is the same as the original grayscale infrared image. ε is a regularization parameter, and its preferred value is 600.
[0176] Is given by the following formula:
[0177]
[0178] In the above formula, j is an integer, corresponding to the j-th pixel point in the image, and j ∈ [1, N]; N is the total number of image pixel points, ζ is a constant, and its preferred value is 0.06; g z Represents the average gradient value of the pixels within the window centered on pixel point z, g j Represents the average gradient value of the pixels within the window centered on pixel point j;
[0179] The calculation method of the average gradient value of the pixels within the window centered on pixel point i in image I is:
[0180] The average gradient value of the pixels within the window centered on pixel point z is calculated by the following formula:
[0181]
[0182] Among them, n is the side length of the square window centered on pixel point z; x is the abscissa in the square window centered on pixel point z; y is the ordinate in the square window centered on pixel point z; I(x, y) is the original grayscale infrared image, and at the pixel point with coordinates (x, y) in the square window centered on pixel point z, the value at that pixel point; Refers to obtaining the original grayscale infrared image, at the pixel point with coordinates (x, y) in the square window centered on pixel point z, the gradient value in the z direction; Refers to obtaining the original grayscale infrared image, at the pixel point with coordinates (x, y) in the square window centered on pixel point z, the gradient value in the y direction.
[0183] Solving gives a ki 、b ki Are:
[0184]
[0185] Among them, |ω| is the number of pixels in window ω ki In; μ ki And Are respectively the guidance image p in window ω kiThe mean and variance in; is the mean pixel value of the input image I in the window ω ki in.
[0186] The output image I bi is expressed as:
[0187]
[0188] where, is the mean of the first local coefficients of each pixel in the window ω centered at the pixel point i in the original grayscale infrared image; I ki is the value of the original grayscale infrared image at the pixel point i; i is the mean of the second local coefficients of each pixel in the window ω centered at the pixel point i in. ki in.
[0189] Step 2: Perform image enhancement processing on the image background layer based on improved contrast limited adaptive histogram equalization;
[0190] For the background image I obtained by the image decomposition method of comprehensive average gradient and guided filtering b , use improved CLAHE to enhance it to obtain I bCLAHE , this process can be expressed as:
[0191] I bCLAHE = CE(I b ) (10)
[0192] where, CE(I b ) represents performing improved CLAHE enhancement on the background image I b .
[0193] Among them, histogram equalization is a common image enhancement method, which enhances the contrast of an image by stretching the grayscale distribution of the image. Contrast limited adaptive histogram equalization CLAHE improves histogram equalization, but there are still problems such as difficult parameter adjustment. The performance of CLAHE usually depends on the selection of parameters, such as the size of the block region and the threshold of contrast limitation. The selection of these parameters has an important impact on the final image enhancement effect, but often requires experience or repeated experiments to determine. The present invention improves CLAHE, so as to achieve adaptive selection of parameters when processing different images, and its algorithm steps are as follows:
[0194] 2.1 Divide the background image I b into several fixed sub-blocks of the same size, shape, and non-overlapping m×n.
[0195] 2.2 Calculate the image I bThe average gradient g within each sub-block ib :
[0196]
[0197] where g lb is the average gradient within the l-th background layer sub-block of the image background layer I b ; x is the abscissa within the l-th background layer sub-block; y is the ordinate within the l-th background layer sub-block; is the value at the pixel point with coordinates (x, y) within the l-th background layer sub-block of the image background layer; denotes obtaining the gradient value in the x direction at the pixel point with coordinates (x, y) within the l-th background layer sub-block of the image background layer;
[0198] denotes obtaining the gradient value in the y direction at the pixel point with coordinates (x, y) within the l-th background layer sub-block of the image background layer.
[0199] 2.3 Evenly distribute the number of pixels in each sub-block to the average value N of each gray level aver , which can be expressed as:
[0200]
[0201] In the formula, represents the average value obtained by evenly distributing the number of pixels in the l-th background layer sub-block to each gray level; l is an integer, and l ∈ [1, N bL ; N bL is the total number of background layer sub-blocks divided from the image background layer, N bL = m × n; L l is the number of gray levels included in the background layer sub-block l.
[0202] 2.4 Limit the number of pixels included in each gray level within each sub-block not to exceed the clipping threshold The formula is:
[0203]
[0204] where, represents the clipping threshold of the l-th background layer sub-block; represents the average value obtained by evenly distributing the number of pixels in the l-th background layer sub-block to each gray level; is the clipping coefficient of the l-th background layer sub-block, and its preferred value range is 0.87 - 1.11; a is the first clipping coefficient of the background layer, and its preferred value range is 0.95 - 1.15; g lbis the average gradient value within the l-th background layer sub-block in the image background layer; b is the second shear coefficient of the background layer, and its preferred value range is 3.79 - 4.21.
[0205] 2.5 Clip the gray-level histogram of each sub-block, and evenly distribute the extra clipped pixel count to each gray level. The number of pixels N evenly distributed to each gray level a is:
[0206]
[0207] where, where, is the number of pixels evenly distributed to each gray level in the l-th background layer sub-block; is the total number of pixels clipped in the l-th background layer sub-block; [·] represents rounding down the content within the brackets.
[0208] After the above distribution, the remaining unallocated pixel count is evenly distributed to gray levels less than C limit in a cyclic manner until the remaining pixel count is zero.
[0209] 2.6 Perform histogram equalization processing on each sub-block after contrast limitation; further perform bilinear interpolation processing to eliminate block effects and improve the operation speed.
[0210] Step 3: Denoising and stretching of the image detail layer based on adaptive bilateral filtering ABF
[0211] For the detail image I d obtained by subtracting the original image from the background image, use improved adaptive bilateral filtering for denoising and stretching to obtain I dbfw . First, perform bilateral filtering on I d to obtain I dbf , that is:
[0212] I dbf = BF(I db ) (15)
[0213] In the formula, BF(I db ) represents performing bilateral filtering on the image I db ; then stretch I dbf :
[0214] I dbfw = g a I dbf + g b (16)
[0215] where, g a is the linear stretching gain coefficient, and its value range is [0, 255], g bis the brightness gain coefficient, and its value range is [0, 255].
[0216] Those skilled in the art should know that the linear stretching gain coefficient is used to control the stretching degree of the image, and the brightness gain coefficient is used to adjust the brightness of the image. Those skilled in the art can adjust the linear stretching gain coefficient and the brightness gain coefficient according to the actual situation.
[0217] Among them, the bilateral filtering algorithm is a non-linear filtering technology, which is widely used in the field of image processing, especially achieving remarkable achievements in image denoising and edge preservation. Compared with traditional linear filters, the bilateral filter takes into account both the spatial distance between pixels and the difference between pixel values, so it can better retain the edge information and details of the image. Its basic principle is to introduce a weight composed of the spatial distance and the similarity between pixel values on the basis of pixel values to balance the effects of smoothing and edge preservation. The present invention optimizes the bilateral filtering, and the method for optimizing the bilateral filtering is as follows.
[0218] Specifically, for a given detail image I d , it is divided into several non-overlapping m d ×n d fixed image sub-blocks. Coordinate axes are set for each detail layer sub-block. The total number of pixels corresponding to the long side of each detail layer sub-block, that is, the number of pixels in the x direction is m d , and the total number of pixels corresponding to the wide side, that is, the number of pixels in the y direction is n d ;
[0219] Perform bilateral filtering on each sub-block respectively, and calculate each pixel value of the output sub-block image through the following formula:
[0220]
[0221] where c is an integer, and c ∈ [1, N dc , N dc is the total number of detail layer sub-blocks divided from the image detail layer; t is an integer, corresponding to the t-th pixel point in the detail layer sub-block, and its value corresponds to its position in the detail layer sub-block, and t ∈ [1, N c , N c is the total number of pixel points in each detail layer sub-block, N c =m d ×n d ; is the c-th detail layer sub-block after denoising; S is the local neighborhood centered on pixel point t; q is any pixel point in the local neighborhood centered on pixel point t, and its value range is from 1 to the closed interval of the total number of pixel points in the local neighborhood centered on pixel point t, and its value corresponds to its position in the local neighborhood centered on pixel point t; is the pixel value of the c-th detail layer sub-block at pixel point q; ω c (t, q) is the weight of pixel point q in the local neighborhood centered on pixel point t within the c-th detail layer sub-block; W ct is the sum of the weights of each pixel point in the local neighborhood centered on pixel point t within the c-th detail layer sub-block; that is, W ct can be expressed by the following formula:
[0222] W ct = ∑ q∈S ω c (t, q) (18)
[0223] ω c (t, q) is the weight of pixel point q in the local neighborhood centered on pixel point t within the c-th detail layer sub-block, calculated by the following formula:
[0224]
[0225] where e is the natural base; I d c (t) is the pixel value of the c-th detail layer sub-block at pixel point t.
[0226] ||x|| 2 represents the 2-norm of x;
[0227] is calculated according to the following formula:
[0228]
[0229] where a S is the first weight coefficient, and its preferred value range is 74.5 - 75.5; g cd is the average gradient within the c-th detail layer sub-block; b S is the second weight coefficient, and its preferred value range is 0 - 0.15;
[0230] is calculated according to the following formula:
[0231]
[0232] where a r is the third weight coefficient, and its preferred value range is 74.4 - 75.5; br is the fourth weight coefficient, and its preferred value range is 0 - 0.15.
[0233] is the standard deviation of the Gaussian kernel of the pixel values applied to block i, representing the degree of difference between pixel values. The smaller it is, the more sensitive it is to the difference in pixel values, that is, only the pixel points with relatively small differences in pixel values will calculate the weight, thus making the detailed information of the image richer; g in formulas (19) and (20) cd is calculated according to the following formula:
[0234]
[0235] where is the image detail layer, and it is the value at the pixel point with coordinates (x, y) in the c-th detail layer sub-block; represents obtaining the x-direction gradient value at the pixel point with coordinates (x, y) in the c-th detail layer sub-block of the image detail layer; represents obtaining the y-direction gradient value at the pixel point with coordinates (x, y) in the l-th detail layer sub-block of the image detail layer.
[0236] Furthermore, stretch the denoised detail image to obtain the stretched detail layer after denoising.
[0237] Step 4: Fuse the enhanced image background layer and the stretched detail layer after denoising, and perform stretching processing to obtain the enhanced grayscale infrared image;
[0238] Fuse the enhanced background image I bCLAHE and the stretched detail image I dbfw to obtain I e :
[0239] I e = I bCLAHE + I dbfw (23)
[0240] Furthermore, stretch I e to obtain the enhanced grayscale infrared image I en :
[0241]
[0242] where I e_max , I e_min are the maximum grayscale value and the minimum grayscale value of the image I e respectively; for an 8-bit image, R is the grayscale correlation coefficient, and its preferred value is 256.
[0243] Pseudo-color processing of grayscale infrared images
[0244] Finally, perform pseudo-color processing on I en to map pixels with different gray levels in the enhanced image into different colors, obtaining a color infrared image I enc .
[0245] The present invention also discloses a joint background equalization and detail stretching infrared image enhancement system for the infrared image enhancement method based on joint background equalization and detail stretching. The system is used to enhance grayscale infrared images and generate color infrared images. Figure 2 is a structural block diagram of the infrared image enhancement system, as Figure 2 shown. The system includes: an image background and detail layer decomposition module, an image background layer equalization and enhancement module, an image detail layer denoising and stretching module, an image background and detail layer fusion and stretching module, and an enhanced grayscale infrared image pseudo-color processing module, where:
[0246] The image background and detail layer decomposition module decomposes the original grayscale infrared image into an image background layer and an image detail layer based on an image decomposition method combining the comprehensive average gradient and guided filtering;
[0247] The image background layer equalization and enhancement module performs image enhancement processing on the image background layer based on contrast-limited adaptive histogram equalization to obtain an enhanced image background layer;
[0248] The image detail layer denoising and stretching module performs denoising and stretching on the image detail layer based on adaptive bilateral filtering to obtain a denoised and stretched detail layer;
[0249] The image background and detail layer fusion and stretching module is used to fuse the enhanced image background layer and the denoised and stretched detail layer, and perform stretching processing to obtain an enhanced grayscale infrared image;
[0250] The enhanced grayscale infrared image pseudo-color processing module is used to perform pseudo-color processing on the enhanced grayscale infrared image to generate a color infrared image.
[0251] To verify the effectiveness of the adaptive infrared image enhancement method based on joint background equalization and detail stretching described in the present invention, Figure 3 and Figure 4 show two groups of experimental results. Figure 3 The effect comparison diagram corresponding to Experiment 1; Figure 4 The effect comparison diagram corresponding to Experiment 2; In each group of experimental result diagrams, the first row is respectively the original grayscale infrared image of the cable directly collected, the grayscale infrared image enhanced by CLAHE, and the grayscale infrared image enhanced by the present invention; the second row is respectively the pseudo-color processing results of the original grayscale infrared image, the pseudo-color processing results of the CLAHE-enhanced grayscale infrared image, and the pseudo-color processing results of the grayscale infrared image enhanced by the present invention.
[0252] From Figure 3 and Figure 4 It can be seen that the visual effects of the directly collected original grayscale infrared images of the cable and their pseudo-color images are poor, and it is difficult to observe the detailed differences; the visual effects of the grayscale infrared images and pseudo-color images enhanced by CLAHE have been improved to a certain extent, and the structure and details are clearer, but the noise is more obvious; generally speaking, the visual effects of the grayscale infrared images and the corresponding pseudo-color images enhanced by the present invention have been significantly improved, the noise has been effectively suppressed, and more structures and details can be observed, and thus the temperature changes and differences can be found, demonstrating the superiority of the present invention in enhancing the grayscale infrared images of the cable.
[0253] The present invention may be a system, a method, and / or a computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions thereon for causing a processor to implement various aspects of the present invention.
[0254] The computer-readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device. The computer-readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punched card or raised structures in grooves having instructions stored thereon, and any suitable combination of the foregoing. The computer-readable storage medium used herein is not construed as being a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated through a waveguide or other transmission medium (e.g., an optical pulse through an optical fiber cable), or an electrical signal transmitted through a wire.
[0255] The computer-readable program instructions described herein may be downloaded from the computer-readable storage medium to various computing / processing devices, or downloaded to an external computer or external storage device through a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include a copper transmission cable, an optical fiber transmission, a wireless transmission, a router, a firewall, a switch, a gateway computer, and / or an edge server. The network adapter or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0256] The computer program instructions for carrying out the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state-setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider). In some embodiments, by using the state information of the computer-readable program instructions to customize an electronic circuit, such as a programmable logic circuit, a field-programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer-readable program instructions to implement various aspects of the present invention.
[0257] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: modifications or equivalent replacements can still be made to the specific embodiments of the present invention, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention shall be covered by the protection scope of the claims of the present invention.
Claims
1. A method for infrared image enhancement combining background equalization and detail stretching, characterized in that: include: The image decomposition method based on comprehensive average gradient and guided filtering decomposes the original grayscale infrared image into image background layer and image detail layer; Performing image enhancement processing on the image background layer based on limited contrast adaptive histogram equalization to obtain an enhanced image background layer; Denoising and stretching the image detail layer based on adaptive bilateral filtering to obtain the denoised and stretched detail layer; The enhanced image background layer and the denoised and stretched detail layer are fused and stretched to obtain an enhanced grayscale infrared image; The enhanced grayscale infrared image is processed with pseudo color to generate a color infrared image.
2. The infrared image enhancement method according to claim 1, characterized in that: The image background layer I b Obtained by the following formula: Where i is an integer and i∈[1,N]; N is the total number of image pixels; I bi is the value of the image background layer at pixel i; is the window ω centered at pixel i in the original grayscale infrared image ki The mean value of the first local coefficient of each pixel point in I i is the value of the original grayscale infrared image at pixel i; is the window ω centered at pixel i ki The mean value of the second local coefficient of each pixel in ; The image detail layer I d It is obtained by subtracting the original grayscale infrared image from the image background layer.
3. The infrared image enhancement method according to claim 2, characterized in that: The first local coefficient and the second local coefficient are obtained by optimizing the following cost function in the window: Among them, a ki is a square window ω centered at pixel i ki The first local coefficient in b ki is a square window ω centered at pixel i ki The second local coefficient in; E(a ki ,b ki ) is a square window ω centered at pixel i ki The optimized cost function in ; z represents the window ω centered on i ki Any pixel point in z is the pixel value of the guide image at pixel point z; I z is the pixel value of the original grayscale infrared image at pixel point z; ε is the regularization parameter.
4. The infrared image enhancement method according to claim 3, characterized in that: As shown below: Where j is an integer and j∈[1,N]; N is the total number of image pixels, ζ is the compensation coefficient; g z Represents the average gradient value of pixels in the window centered at pixel point z, g j Represents the average gradient value of the pixels in the window centered on pixel j.
5. The infrared image enhancement method according to claim 1, characterized in that: The method for image enhancement processing of the image background layer based on limited contrast adaptive histogram equalization is: Divide the image background layer into a number of background layer sub-blocks of equal size, same shape and non-overlapping; The total number of pixels corresponding to the long side of each background layer sub-block is m, and the total number of pixels corresponding to the wide side is n; Evenly distribute the number of pixels of each background layer sub-block to the average value of each gray level; The number of pixels exceeding the clipping threshold in the grayscale histogram of each background layer sub-block is clipped, and the clipped pixels are evenly distributed to each grayscale level to complete the contrast limitation of the background layer sub-block; After the contrast of each background layer sub-block is limited, histogram equalization is performed respectively; the block effect between the background layer sub-blocks is eliminated through bilinear interpolation processing to obtain the enhanced background image I bCLAHE .
6. The infrared image enhancement method according to claim 5, characterized in that: The calculation formula of the clipping threshold is as follows: in, Indicates the clipping threshold of the lth background layer sub-block; It represents the average value of the number of pixels of the lth background layer sub-block distributed evenly to each gray level; is the shear coefficient of the lth background layer sub-block; a is the first shear coefficient of the background layer; g lb is the average gradient value in the lth background layer sub-block in the background layer of the image; b is the second shear coefficient of the background layer.
7. The infrared image enhancement method according to claim 1, characterized in that: The method for denoising and stretching the image detail layer based on adaptive bilateral filtering is: Perform bilateral filtering on the image detail layer to obtain the denoised detail layer I dbf , and then stretch the denoised detail layer to obtain the denoised and stretched detail layer I dbfw ; The formula for stretching the denoised detail layer is as follows: I dbfw =g a I dbf +g b ; Among them, g a is the linear stretch gain coefficient; g b is the brightness gain coefficient.
8. The infrared image enhancement method according to claim 7, characterized in that: The method of performing bilateral filtering on the image detail layer to obtain the denoised detail layer is: The image detail layer is divided into several detail layer sub-blocks of equal size, same shape and non-overlapping; the coordinate axis is set for each detail layer sub-block, and the total number of pixels corresponding to the long side of each detail layer sub-block is m d , the total number of pixels corresponding to the wide side is n d ; Perform improved bilateral filtering on each detail layer sub-block to obtain denoised detail layer sub-blocks; The denoised detail layer sub-blocks are spliced together to obtain the denoised and stretched detail layer.
9. The infrared image enhancement method according to claim 8, characterized in that: The following formula is used to perform bilateral filtering on each detail layer sub-block to obtain the denoised detail layer sub-blocks: Where c is an integer and c∈[1, N dc ],N dc is the total number of detail layer sub-blocks divided into the image detail layer; t is an integer, and t∈[1, N c ],N c is the total number of pixels in each detail layer sub-block; is the cth detail layer sub-block after denoising; S is the local neighborhood centered on pixel t; q is any pixel in the local neighborhood centered on pixel t; is the pixel value of the c-th detail layer sub-block at pixel point q; ω c (t,q) is the weight of the c-th detail layer sub-block at pixel q; W ct is the sum of the weights of all pixels in the local neighborhood centered on pixel t in the cth detail layer sub-block.
10. The infrared image enhancement method according to claim 9, characterized in that: The weight of the c-th detail layer sub-block at pixel q is calculated as follows: Among them, e is the natural base; is the pixel value of the cth detail layer sub-block at pixel point t.
11. The infrared image enhancement method according to claim 10, characterized in that: Calculate as follows: Among them, a S is the first weight coefficient; g cd is the average gradient in the cth detail layer sub-block; b S is the second weight coefficient; Calculate as follows: Among them, a r is the third weight coefficient; b r is the fourth weight coefficient.
12. The infrared image enhancement method according to claim 1, characterized in that: The stretching process obtains an enhanced grayscale infrared image I en The formula is as follows: Among them, I e The image is the image after the enhanced image background layer and the denoised and stretched detail layer are fused; I e_max For image I e The maximum gray value of e_min For image I e The minimum gray value of ; R is the gray correlation coefficient.
13. An infrared image enhancement system combining background equalization and detail stretching using the infrared image enhancement method according to any one of claims 1 to 12, characterized in that: It includes image background and detail layer decomposition module, image background layer equalization enhancement module, image detail layer denoising and stretching module, image background and detail layer fusion and stretching module, and enhanced grayscale infrared image pseudo-color processing module: Image background and detail layer decomposition module, which decomposes the original grayscale infrared image into image background layer and image detail layer based on the image decomposition method of comprehensive average gradient and guided filtering; The image background layer equalization enhancement module performs image enhancement processing on the image background layer based on the limited contrast adaptive histogram equalization to obtain an enhanced image background layer; The image detail layer denoising and stretching module denoises and stretches the image detail layer based on adaptive bilateral filtering to obtain the denoised and stretched detail layer; The image background and detail layer fusion stretching module is used to fuse the enhanced image background layer and the denoised and stretched detail layer, and perform stretching processing to obtain an enhanced grayscale infrared image; The enhanced grayscale infrared image pseudo-color processing module is used to perform pseudo-color processing on the enhanced grayscale infrared image to generate a color infrared image.
14. An electronic device comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is used to operate according to the instructions to execute the infrared image enhancement method according to claims 1-12.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the infrared image enhancement method described in claims 1-12 is implemented.
Citation Information
Patent Citations
High-speed high-capacity infrared image data real time display method
CN105469374A
AI technology-based all-weather auxiliary temperature measurement system for main equipment of transformer substation
CN117367589A
Cited By
Two-wheeled electric vehicle battery temperature change detection method and system based on machine vision
CN121366150A