An adaptive contrast enhancement method for infrared images
By employing an adaptive contrast enhancement method, combined with linear mapping dimming and adaptive platform histogram equalization, the problem of reduced background contrast in dynamic high-brightness scenes caused by traditional methods is solved, achieving efficient contrast enhancement and improved environmental adaptability of infrared images.
Patent Information
- Application Number
- CN202211659139.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-22
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-12-22
AI Technical Summary
Existing infrared image enhancement methods cannot effectively improve target contrast in dynamic high-brightness scenes with real-time changes in dynamic range. Traditional linear dimming and platform histogram equalization dimming cannot effectively improve target contrast. At the same time, they compress the background image ratio, resulting in a significant reduction in background target contrast or suppression of background contrast.
An adaptive contrast enhancement method is adopted. By performing histogram statistics on the original infrared image, a linear mapping dimming model and an adaptive platform histogram equalization model are established. Combined with weighted hybrid dimming, the algorithm parameters are adjusted in real time to improve the contrast between the target and the background.
It effectively suppresses excessive background noise stretching in dynamic bright scenes, improves the image's environmental adaptability and contrast enhancement, and is especially suitable for dynamic scenes with bright targets.
Smart Images

Figure CN115908195B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of infrared image enhancement processing, in particular to an adaptive contrast enhancement method for infrared image. BACKGROUND
[0002] In the infrared imaging technology, due to the inherent resolution limitation of the infrared sensor and the effect of atmospheric absorption and scattering on the transmission of infrared rays, the infrared image has the shortcomings of low signal-to-noise ratio, fuzzy target edge and details. In order to correctly identify the target, the infrared image must be preprocessed by enhancement.
[0003] Histogram equalization (HE) is a commonly used image enhancement method, which adjusts the gray level according to the cumulative histogram of the image to enhance the image. It has the characteristics of simple operation and good enhancement effect on visible light images. Because the background and noise of the infrared image occupy a large number of gray levels, and the gray level of the target is less, after histogram equalization, the contrast of the background and noise is improved, the contrast of the target is reduced, and the "over-bright" phenomenon appears in the high gray level area. Therefore, the general histogram equalization is not suitable for the enhancement of infrared image.
[0004] Platform histogram equalization (PHE) is an improved algorithm of histogram equalization. By setting an upper limit platform for the statistical histogram, the background which occupies a large number of pixels in the image is moderately suppressed, and space is left for the promotion of target details.
[0005] Traditional linear stretching dimming can stretch low dynamic range scenes, but when high-brightness targets appear, the contrast of the background target will be significantly reduced. Traditional platform histogram equalization dimming can extract details in wide dynamic range targets, so that the gray scale distribution of wide dynamic range static scenes can be uniformly adjusted, but for dynamic high-brightness scenes with real-time changes in dynamic range, there is a feature of compressing the proportion of background image, which will also suppress the contrast of the background. SUMMARY
[0006] The present application provides an adaptive contrast enhancement method for infrared image to solve the technical problem that when extracting dynamic high-brightness scene targets with real-time changes in dynamic range, traditional linear dimming and traditional platform histogram equalization dimming can only stretch low dynamic range scenes, compress the proportion of background image, and significantly reduce the contrast of the background target or suppress the contrast of the background.
[0007] To achieve the above purpose, the technical scheme adopted by the present application is as follows:
[0008] An adaptive contrast enhancement method for infrared image, characterized in that it comprises the following steps:
[0009] Step S1, obtaining an original infrared image;
[0010] Step S2, histogram statistics is performed on the original infrared image, and an actual mapping gray level range of the original infrared image is obtained based on a histogram statistics result, and two end bad pixel points are filtered out by histogram clipping, and an infrared image after filtering out bad pixel points is obtained;
[0011] Step S3, a linear mapping dimming model is established, and the infrared image after filtering out bad pixel points is linearly compressed to obtain a linear mapping dimming image gray value result;
[0012] Meanwhile, adaptive plateau histogram equalization is performed on the infrared image after filtering out bad pixel points to obtain an adaptive plateau histogram equalization mapping image gray value result;
[0013] Step S4, the linear mapping dimming image gray value result and the adaptive plateau histogram equalization mapping image gray value result obtained in step S3 are weighted and mixed to obtain a weighted mixed dimming mapping image gray value, and an infrared image after adaptive contrast enhancement is reconstructed.
[0014] Further, step S2 specifically includes:
[0015] 2.1, histogram statistics is performed on the original infrared image, and pixel points of all gray levels appearing in a gray level range of the original infrared image are traversed to count the number of pixel points of each gray level;
[0016] Let the gray level range of the original infrared image be [0, L), r k is the kth gray level, r k ∈ [0, L), n rk is the number of pixel points of the kth gray level;
[0017] 2.2, based on the histogram statistics result, a gray level range threshold T noise is set, an actual mapping gray level range (xMin, xMax) of the original infrared image is obtained, two end bad pixel points are filtered out by histogram clipping, and an infrared image after filtering out bad pixel points is obtained;
[0018] The gray level range threshold T noise satisfies:
[0019] The minimum gray level xMin is the first gray level greater than the gray level range threshold T noise found by searching from the gray level 0; and the maximum gray level xMax is the first gray level greater than the gray level range threshold T noise found by searching from the highest gray level;
[0020] All the gray levels less than the minimum gray level xMin and greater than the maximum gray level xMax are filtered out by clipping to remove bad pixel points at both ends, to obtain the infrared image after filtering out bad pixel points.
[0021] Further, in step S3, the infrared image after filtering out bad pixel points is subjected to adaptive plateau histogram equalization to obtain an image gray value result of adaptive plateau histogram equalization mapping, which is specifically:
[0022] A.1, a linear mapping dimming model is established to dim and compress the infrared image after filtering out bad pixel points to an 8-bit image;
[0023] The linear mapping dimming model is:
[0024] LineRes ij = K × X ij + B
[0025] Wherein, LineRes ij is the gray value of the image after linear mapping dimming; X ij represents the gray value of the original infrared image; K is the linear mapping gain, and B is the bias constant;
[0026] A.2, the linear mapping gain K and the bias constant B are calculated according to the image data corresponding to the minimum gray level xMin and the maximum gray level xMax;
[0027] The image data corresponding to the minimum gray level xMin and the maximum gray level xMax should satisfy:
[0028]
[0029] Wherein, yMin is the minimum gray level of the image after linear mapping dimming; yMax is the maximum gray level of the image after linear mapping dimming;
[0030] Solving can obtain:
[0031]
[0032]
[0033] A.3, the image gray value LineRes ij after linear mapping dimming is calculated according to the linear mapping gain K and the bias constant B.
[0034] Further, in step 3, the infrared image after filtering out bad pixel points is subjected to adaptive plateau histogram equalization to obtain an image gray value result of adaptive plateau histogram equalization mapping, which is specifically:
[0035] B.1, set the upper threshold T of the plateau histogramclip , the peak data of the infrared image after filtering out the bad pixel points is corrected;
[0036]
[0037] wherein, is the number of pixel points of the kth gray level in the corrected histogram;
[0038] B.2, set the adaptive platform histogram left and right threshold, and further correct the boundary data of the infrared image after filtering out the bad pixel points;
[0039]
[0040] wherein, is the number of pixel points of the kth gray level in the secondary corrected histogram;
[0041] B.3, calculate the adaptive histogram mapping range;
[0042] B.3.1, calculate the dynamic range nRange of the infrared image after filtering out the bad pixel points:
[0043] nRange = xMax - xMin
[0044] B.3.2, calculate the adaptive histogram mapping range foBitDepth:
[0045]
[0046] B.4, probability statistics is performed on the corrected histogram to obtain a cumulative histogram;
[0047] The kth gray level r of the corrected histogram k The distribution probability p of the pixel point gray value rk :
[0048]
[0049] wherein, is the gray level cumulative sum of all pixel points on the kth gray level,
[0050] Then the corrected cumulative histogram is:
[0051]
[0052] B.5, using the cumulative histogram, the image gray value PheRes of adaptive platform histogram equalization mapping is obtained ij :
[0053]
[0054] wherein, r start is the starting gray scale of the equalization mapping output.
[0055] Further, in step S4, the weighted mixed dimming mapping image gray scale value I ij :
[0056] I ij = w x LineRes ij + (1-w) x PheRes ij
[0057] wherein, w is a weighting coefficient;
[0058]
[0059] Compared with the prior art, the present application has the beneficial technical effects as follows:
[0060] 1. The adaptive contrast enhancement method for infrared images provided by the present application, aiming at the dynamic highlight target characteristics of real-time dynamic range change, extracts the information of the image in real time, analyzes the gray scale distribution of the image, adaptively changes the dynamic target scene, and calculates the optimal algorithm parameters in real time, so as to achieve the effect of automatically changing the contrast of the target and the background, especially suitable for dynamic scenes with high-light targets, effectively inhibits the problem of excessive stretching of noise of traditional platform histogram equalization, and improves the environmental adaptability of dynamic infrared images.
[0061] 2. The adaptive contrast enhancement method for infrared images provided by the present application, first, the original image gray scale information is statistically analyzed in real time, the actual mapping gray scale range of the original infrared image is obtained based on histogram statistics, and the weighted mixed dimming is performed within the range, on the one hand, the mixing ratio of linear stretching dimming and platform histogram equalization dimming is controlled, so that the wider the gray scale distribution range of the image, the higher the proportion of histogram equalization dimming; on the other hand, the mapping parameters of platform histogram equalization dimming are controlled, so that the wider the gray scale distribution range of the image, the wider the mapping range. In order to facilitate the dynamic application scene with high-light targets, the background information is not only not submerged, but also has the advantages of contrast enhancement and high scene adaptability. BRIEF DESCRIPTION OF DRAWINGS
[0062] Figure 1 is the flow chart of the embodiment of the adaptive contrast enhancement method for infrared images of the present application;
[0063] Figure 2 is the linear mapping dimming principle diagram in the embodiment of the present application;
[0064] Figure 3This is the original image of an outdoor location where no bright targets appear in an embodiment of the present invention;
[0065] Figure 4 For based on Figure 3 An image showing the effect of processing the method according to the embodiments of the present invention, resulting in the appearance of a highlighted target;
[0066] Figure 5 This is the original image showing no bright targets appearing indoors in this embodiment of the invention;
[0067] Figure 6 For based on Figure 5 The image shows the effect of highlighting the target after processing using the method of the embodiments of the present invention. Detailed Implementation
[0068] To make the objectives, advantages, and features of this invention clearer, the adaptive contrast enhancement method for infrared images proposed by this invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Those skilled in the art should understand that these embodiments are merely used to explain the technical principles of this invention and are not intended to limit the scope of protection of this invention.
[0069] like Figure 1 As shown, the adaptive contrast enhancement method for infrared images provided in this embodiment specifically includes the following steps:
[0070] Step S1: Obtain the original infrared image.
[0071] Step S2: Perform histogram statistics on the original infrared image, obtain the actual mapped gray level range of the original infrared image based on the histogram statistics results, and truncate the histogram to filter out bad pixels at both ends to obtain the infrared image after filtering out bad pixels.
[0072] 2.1 Perform histogram statistics on the original infrared image, traverse all pixels appearing at all gray levels in the gray range of the original infrared image, and count the number of pixels at each gray level;
[0073] Assuming the original infrared image has a grayscale range of [0, L), r k Let r be the k-th gray level. k ∈[0,L), n rk This represents the number of pixels appearing at the k-th gray level.
[0074] 2.2 Based on the histogram statistical results, set the grayscale range threshold T. noise The actual mapped grayscale range (xMin, xMax) of the original infrared image is obtained, and then the histogram is truncated to obtain the truncated histogram.
[0075] Gray range threshold T noise satisfy:
[0076] The minimum gray level xMin is the first gray level greater than the gray range threshold T searched from the 0th gray level upwards; the maximum gray level xMax is the first gray level greater than the gray range threshold T searched from the highest gray level downwards. noise noise
[0077] All the gray levels less than the minimum gray level xMin and greater than the maximum gray level xMax are filtered out to obtain the histogram after the clipping.
[0078] Generally, the gray levels of the bad pixel points account for a small proportion of the overall gray levels of the image and are at the two ends of the histogram, so that the determination of the actual mapping gray level range can filter out the bad pixel points to a certain extent.
[0079] Step S3, establishing a linear mapping dimming model to linearly compress the infrared image after the bad pixel points are filtered out to obtain the image gray value after the linear mapping dimming;
[0080] 3.1, establishing a linear mapping dimming model to dim and compress the infrared image after the bad pixel points are filtered out to an 8-bit image, and the principle of the linear mapping dimming is as shown in Figure 2
[0081] The linear mapping dimming model is:
[0082] LineRes ij =K×X ij +B
[0083] wherein, LineRes ij is the gray value of the image after the linear mapping dimming; X ij represents the gray value of the original infrared image; K is the linear mapping gain, and B is the bias constant.
[0084] 3.2, the image data corresponding to the minimum gray level xMin and the maximum gray level xMax are used to calculate the linear mapping gain K and the bias constant B.
[0085] The image data corresponding to the minimum gray level xMin and the maximum gray level xMax should satisfy:
[0086]
[0087] wherein, yMin is the minimum gray level of the image after the linear mapping dimming; yMax is the maximum gray level of the image after the linear mapping dimming.
[0088] The solution is:
[0089]
[0090]
[0091] 3.3, according to the linear mapping gain K and the bias constant B, the linear mapping dimming image gray value LineRes is calculated ij :
[0092] LineRes ij = K x X ij + B.
[0093] Step S4, the adaptive platform histogram equalization of the infrared image after filtering out the bad pixel points is performed to obtain the image gray value of the adaptive platform histogram equalization mapping;
[0094] The central idea of histogram equalization is to change the gray histogram of the original image from a certain gray interval which is relatively concentrated to the distribution in the whole gray range as much as possible. However, the traditional histogram equalization is not suitable for all scenes, especially for the uniform surface target. The traditional platform histogram equalization will significantly stretch the noise and reduce the visual observation effect. For the dynamic highlight scene with real-time change of dynamic range, the traditional platform histogram equalization has the characteristics of compressing the proportion of background image and will also suppress the contrast of the background. In order to improve the scene adaptability of platform histogram equalization, the improved adaptive platform histogram equalization method is also proposed in the embodiment.
[0095] 4.1, setting the upper threshold T of the platform histogram clip , the peak data of the infrared image after filtering out the bad pixel points is corrected;
[0096] For the case that most of the image is background, if the histogram equalization mapping is directly performed, due to too many background pixels, too many mapping values will be used for the background part, and the target obtains fewer mapping values, which leads to too low overall contrast of the picture, causing excessive stretching of the background noise. Therefore, the peak data of the histogram is corrected.
[0097]
[0098] wherein, is the number of pixel points of the kth gray level in the corrected histogram;
[0099] 4.2, setting the adaptive platform histogram left and right threshold, further correcting the boundary data of the infrared image after filtering out the bad pixel points;
[0100] The minimum gray level xMin and the maximum gray level xMax obtained in step S2 are respectively taken as the left and right thresholds of the adaptive platform histogram, which can avoid the problem of brightness mutation caused by individual pixels when the scene changes.
[0101]
[0102] wherein, is the number of pixels of the kth gray level in the histogram after the second correction;
[0103] 4.3, calculate the adaptive histogram mapping range;
[0104] The main principle of platform histogram equalization is to map the gray value to the set mapping range according to the probability density, and the greater the mapping range, the greater the difference between the mapping values. Therefore, different mapping ranges are adaptively selected for scenes with different uniformity, which can effectively solve the problem of background information of high-light target being submerged and the problem of uniform surface noise amplification.
[0105] 4.3.1, calculate the dynamic range nRange of the infrared image after filtering out bad pixels:
[0106] nRange = xMax - xMin
[0107] 4.3.2, calculate the adaptive histogram mapping range foBitDepth:
[0108]
[0109] 4.4, probability statistics is carried out on the corrected histogram to obtain a cumulative histogram;
[0110] The kth gray level r of the corrected histogram k Distribution probability of pixel gray value
[0111]
[0112] wherein, is the gray sum of all pixels on the kth gray level, that is,
[0113] Then the corrected cumulative histogram is is:
[0114]
[0115] 4.5, using the cumulative histogram, the image gray value PheRes of adaptive platform histogram equalization mapping is obtained ij :
[0116]
[0117] wherein, r startTo balance the start gray scale of the output, generally, no adjustment is made according to the scene.
[0118] Step S5, according to the result of the linear mapping dimming obtained in step S3 and the result of the adaptive plateau histogram equalization mapping obtained in step S4, weighted mixed dimming mapping is performed to obtain the image gray scale value after the weighted mixed dimming mapping, and the infrared image after the adaptive contrast enhancement is reconstructed.
[0119] The image gray scale value I after the weighted mixed dimming mapping ij :
[0120] I ij =w×LineRes ij +(1-w)×PheRes ij
[0121] Wherein, w is a weighted coefficient;
[0122]
[0123] After the data reconstruction of the weighted mixed dimming mapping, the infrared image after the adaptive contrast enhancement is obtained.
[0124] Compared with the prior art, for the dynamic high-light scene with rapid change of dynamic range, the present application realizes real-time adjustment of algorithm parameters, effectively solves the problem that the background data proportion is compressed by the traditional plateau histogram equalization, the contrast of the background is suppressed, and the background information is submerged; at the same time, for the uniform scene, the present application can effectively suppress the problem of excessive stretching of noise by the traditional plateau histogram equalization, and improve the scene adaptability of the plateau histogram equalization algorithm.
[0125] To prove the effect of the adaptive contrast enhancement method of the infrared image, the method of the present application, i.e., the mixed dimming algorithm of linear and plateau histogram equalization, is used to process two same original images respectively to obtain Figure 3 and Figure 4 a pair of outdoor scene processing result images shown in Figure 5 and Figure 6 another pair of indoor scene processing result images shown in Figure 3 and Figure 4 It can be seen from Figure 5 and Figure 6 that when there is a high-light target, the building scene in the distance and the cloud in the sky are highlighted by using the method of the present application.
[0126] It should be noted that the above examples are only used to illustrate the technical solutions of the present application, and are not intended to limit the present application; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that the technical solutions recorded in the foregoing examples can be modified, or some or all of the technical features can be replaced by equivalents; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the present application.
Claims
1. A method of adaptive contrast enhancement of an infrared image, characterized in that, The method comprises the following steps: Step S1, obtaining an original infrared image; Step S2, performing histogram statistics on the original infrared image, obtaining an actual mapping grayscale range of the original infrared image based on the histogram statistics result, filtering out bad pixel points at both ends of the histogram, and obtaining an infrared image after filtering out the bad pixel points; Step S3, establishing a linear mapping dimming model, performing linear compression on the infrared image after filtering out the bad pixel points, and obtaining a grayscale value result of the infrared image after linear mapping dimming; Meanwhile, performing adaptive plateau histogram equalization on the infrared image after filtering out the bad pixel points, and obtaining a grayscale value result of the image after adaptive plateau histogram equalization mapping; The adaptive plateau histogram equalization on the infrared image after filtering out the bad pixel points to obtain the grayscale value result of the image after adaptive plateau histogram equalization mapping is specifically: B.
1. Set a threshold T on the platform histogram clip The peak data of the infrared image after filtering out the bad pixel points is corrected. wherein, is the number of pixels of the kth gray level in the corrected histogram; B.2, setting adaptive plateau histogram left and right threshold values, and further performing secondary correction on boundary data of the infrared image after filtering out the bad pixel points; wherein, is the number of pixels of the kth gray level in the histogram after the second correction. B.3, calculating an adaptive histogram mapping range; B.3.1, calculating a dynamic range nRange of the infrared image after filtering out the bad pixel points: nRange = xMax - xMin; B.3.2, calculating the adaptive histogram mapping range foBitDepth: B.4, performing probability statistics on the corrected histogram, and obtaining a cumulative histogram; kth gray level r of the modified histogram k distribution probability of pixel gray values wherein, is the accumulated gray value of all pixels at the kth gray level, then the corrected cumulative histogram is: B.
5. Using the cumulative histogram, obtain the image gray value PheRes of adaptive platform histogram equalization mapping ij : wherein r start is the start gray level of the equalized mapping output; Step S4, performing weighted hybrid dimming mapping on the grayscale value result of the infrared image after linear mapping dimming and the grayscale value result of the image after adaptive plateau histogram equalization mapping obtained in step S3, obtaining a grayscale value of the image after weighted hybrid dimming mapping, and reconstructing to obtain an infrared image after adaptive contrast enhancement.
2. The method of adaptive contrast enhancement of an infrared image according to claim 1, characterized in that, Step S2 is specifically: 2.1, performing histogram statistics on the original infrared image, traversing all pixel points of each grayscale level in the grayscale range of the original infrared image, and counting the number of pixel points of each grayscale level; Let the gray scale range of the original infrared image be [0, L), r k is the kth gray scale, r k ∈ [0, L), is the number of pixels of the kth gray scale. 2.2, based on the histogram statistics results, set the gray scale range threshold T noise , get the original infrared image actual mapping gray scale range (xMin, xMax), intercept the histogram to filter out the bad pixel points at both ends, and obtain the infrared image after filtering out the bad pixel points; grayscale range threshold T noise satisfies: The minimum gray level xMin is the first gray level greater than the gray range threshold T searched from the 0th gray level upwards noise The maximum gray level xMax is the first gray level greater than the gray range threshold T searched from the highest gray level downwards noise All grayscale levels less than the minimum grayscale level xMin and greater than the maximum grayscale level xMax are filtered out to obtain the infrared image after filtering out the bad pixel points.
3. The adaptive contrast enhancement method of the infrared image according to claim 2, characterized in that: In step S3, the adaptive plateau histogram equalization on the infrared image after filtering out the bad pixel points to obtain the grayscale value result of the image after adaptive plateau histogram equalization mapping is specifically: A.1, establishing a linear mapping dimming model, and dimming and compressing the infrared image after filtering out the bad pixel points to an 8-bit image; The linear mapping dimming model is: LineRes ij = K x X ij + B; where LineRes ij is the gray value of the linearly mapped dimmed image; X ij represents the gray value of the original infrared image; K is the linear mapping gain, and B is the bias constant; A.2, calculating a linear mapping gain K and a bias constant B according to image data corresponding to the minimum grayscale level xMin and the maximum grayscale level xMax; The image data corresponding to the minimum grayscale level xMin and the maximum grayscale level xMax should satisfy: Wherein, yMin is the minimum grayscale level of the image after linear mapping dimming; yMax is the maximum grayscale level of the image after linear mapping dimming; The solution is: A.3、According to the linear mapping gain K and the bias constant B, the image gray value after linear mapping dimming LineRes is calculated ij .
4. The method for adaptive contrast enhancement of an infrared image according to claim 3, characterized in that: In step S4, the weighted mixed dimming mapping image gray value I ij : I ij = w x LineRes ij + (1 - w) x PheRes ij ; Wherein, w is a weighting coefficient;
Citation Information
Patent Citations
Infrared-thermometer self-adaption three platform histogram equalization system and method thereof
CN103353349A
Scene-adaptive real-time infrared image enhancement method
CN108122217A