An infrared thermal imager image processing method
By combining global and local histograms to process infrared images, the problems of low contrast and grayscale level loss in traditional infrared images are solved, contrast improvement and grayscale layer details are achieved, and the image processing of infrared thermal imagers under different temperature environments is suitable for infrared thermal imagers.
Patent Information
- Application Number
- CN202111148227.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2041-09-29
AI Technical Summary
Traditional infrared histogram processing technology leads to low contrast and high noise in infrared images, and the image grayscale level is lost in high dynamic range scenes, resulting in a decrease in visual effects.
Using a method combining global and local histograms, the overall and local histogram equalization of the original infrared image is combined to obtain enhanced grayscale images, and the grayscale of local and global grayscale images are synthesized using global factors to preserve the temperature correspondence of the image.
The quality of infrared images is improved and the contrast of the image is enhanced. Especially in high-temperature objects with large dynamic range scenes, the defect of insufficient low-intensity contrast is compensated and the details of the image grayscale layer are retained.
Smart Images

Figure CN113902635B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of infrared imaging, and particularly relates to an infrared thermal imager image processing method at different ambient temperatures. Background Art
[0002] When the temperature of an object is greater than absolute zero, there will be infrared radiation. Infrared imaging precisely utilizes the radiation temperature difference of an object to convert it into a grayscale image that can be recognized by the human eye, enabling stable measurement of the target without being affected by ambient light. Since infrared detection is made of heat-sensitive materials, the infrared device itself generates heat, resulting in generally low contrast and high noise in infrared images. Histogram equalization technology and the like need to be used to process infrared images. After the infrared focal plane receives thermal radiation and passes through the photoelectric conversion circuit, it outputs in the form of current or voltage. The system then converts the analog signal into a 16-bit digital signal, and the image imaging processing further converts the 16-bit digital signal into an 8-bit grayscale image that can be recognized by the human eye. In this mapping process, there must be a process of compressing the high dynamic range into the dynamic range, which is bound to cause the loss of image gray levels, thereby leading to a decline in the visual effect of the image. For this, infrared histogram processing can be adopted. The traditional histogram equalization technology uniformly magnifies the original image dynamically according to the density of gray levels, inevitably bringing drawbacks such as overexposure or underexposure. Summary of the Invention
[0003] In view of this, in response to the shortcomings of traditional infrared histogram processing, the present invention provides an infrared thermal imager image processing method, which can improve the quality of infrared images.
[0004] To solve the above technical problems, the technical solution provided by the present invention is as follows:
[0005] An infrared thermal imager image processing method, comprising the following steps:
[0006] S1. Perform histogram equalization on the entire original infrared image to obtain a global grayscale image;
[0007] S2. Perform histogram equalization on the local part of the original infrared image to obtain a local grayscale image;
[0008] S3. Merge the local grayscale image and the global grayscale image to map to an enhanced grayscale image.
[0009] Further, step S1 includes:
[0010] (S11) Obtain the probability density function of the original infrared image;
[0011] (S12) Solve the cumulative distribution function of the infrared image;
[0012] (S13) Apply global histogram equalization to the entire original infrared image, map the 16-bit original image to an 8-bit grayscale image to obtain a global grayscale image.
[0013] Further, after step (S13), it further includes:
[0014] (S14) Eliminate the grayscales with a distribution probability of 0 in the global grayscale image, and perform global histogram equalization again to obtain an enhanced global grayscale image.
[0015] Further, first obtain the global grayscale mapping bias value, and then eliminate the grayscales with a distribution probability of 0.
[0016] Further, step S2 includes:
[0017] (S21) Obtain the mean value of the entire original infrared image;
[0018] (S22) Use the mean value as the threshold to segment the original infrared image to obtain the low-temperature part and the high-temperature part. Merge the low-temperature part in the histogram of the original infrared image using the low-temperature threshold, and merge the high-temperature part using the high-temperature threshold;
[0019] (S23) According to the histogram after hierarchical processing, remap the original infrared image from 16-bit to 8-bit grayscale to obtain a local grayscale image.
[0020] Further, in step (S22), the low-temperature histogram starts to compress and approach the mean grayscale using the low-temperature threshold, and the high-temperature part starts to compress and approach the mean grayscale using the high-temperature threshold.
[0021] Further, after step (S23), it further includes:
[0022] (S24) Perform CLAHE histogram equalization on the local grayscale image to obtain an enhanced global grayscale image.
[0023] Further, between step (S23) and step (S24), first eliminate the grayscales with a distribution probability of 0 in the local image.
[0024] Further, in step (S24), use a fixed cropping factor for local histogram enhancement conversion.
[0025] Further, in step S3, use a global factor to synthesize the grayscales of the local grayscale image and the global grayscale image to map to an enhanced processed grayscale image, where the calculation model is:
[0026] g = α * g1 + (1 - α) * g2
[0027] Where g is the synthetic grayscale, α is the global factor, g1 is the grayscale of the global grayscale image, and g2 is the grayscale of the local grayscale image.
[0028] Compared with the prior art, the present invention aims at the shortcomings of traditional infrared histogram processing images and provides an enhanced infrared histogram equalization technology, which can well preserve the details of each grayscale layer of the infrared image, so that the contrast of multiple areas of the image can be improved to different degrees.
[0029] In particular, the present invention adopts a combination of global and local histograms to obtain good contrast while maintaining the original histogram, so that it can handle scenes with a large dynamic range of high-temperature objects and make up for the lack of contrast at low intensity. Among them, for the grayscale image of infrared radiation mapping, the size of its grayscale directly reflects the surface temperature of the object. The method of the present invention retains the temperature correspondence between the image grayscale 8bit and 16bit as much as possible. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 The figure is a flow chart of the infrared thermal imager image processing method of the present invention. DETAILED DESCRIPTION
[0031] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation schemes, but this should not be understood as the protection scope of the present invention being limited to the following implementation schemes.
[0032] See also Figure 1 , showing the overall process of the infrared thermal imager image processing method of the present invention, which is described in detail as follows.
[0033] S1. Perform histogram equalization on the original infrared image as a whole to obtain a global grayscale image.
[0034] In step S1, the method of global histogram equalization specifically includes:
[0035] (S11) Obtaining the probability density function of the original infrared image.
[0036] (S12) Solving the cumulative distribution graph function of the infrared image.
[0037] (S13) Global histogram equalization is applied to the original infrared image as a whole to map the 16-bit original image into an 8-bit grayscale image, so as to obtain a global grayscale image.
[0038] (S14) After eliminating the distribution probability of 0 in the global grayscale image in the above (S13), global histogram equalization is performed again to obtain an enhanced global grayscale image.
[0039] In this step S1, since most infrared images are for low-gray applications, directly performing a global histogram will inevitably amplify the low-temperature noise, and the amplification of the noise is caused by a large number of gray-scale discontinuities in the low-temperature region. Therefore, the present invention again makes a histogram of the mapped 8-bit gray-scale image to eliminate the part with a distribution probability of 0. After that, a histogram mapping is performed again, and at this time, the gray-scale of the image is continuously and evenly distributed in a very small gray-scale range. Since in infrared images, high-temperature objects all correspond to 255, the global gray-scale mapping offset value gray_globle_offset is further obtained, and then the gray-scale after eliminating 0 is calculated again to obtain the enhanced global histogram equalized gray-scale image G1.
[0040] S2. Perform histogram equalization on a local area of the original infrared image to obtain a local gray-scale image.
[0041] In this step, perform CLAHE local histogram on the original infrared image, which further includes the following steps:
[0042] (S21) Obtain the mean Mean of the entire original infrared image.
[0043] (S22) Use the mean as a threshold to segment the original infrared image to obtain the low-temperature part and the high-temperature part. For the low-temperature part in the histogram of the original infrared image, merge it using the threshold th0, and for the high-temperature part, merge it using th1.
[0044] (S23) After the hierarchical processing of the histogram, remap the original infrared image from 16-bit to 8-bit gray-scale to obtain a local gray-scale image.
[0045] (S24) Perform CLAHE histogram equalization on the local gray-scale image in the above (S23) to obtain an enhanced global gray-scale image.
[0046] In this step, perform brightness-limited adaptive histogram transformation (CLAHE) on the latest 8-bit infrared gray-scale image processed by the local histogram. After CLAHE histogram equalization, an enhanced local gray-scale image G2 is obtained.
[0047] S3. Merge the local gray-scale image and the global gray-scale image to map them into an enhanced processed gray-scale image.
[0048] In this step S3, specifically, use the global factor to synthesize the gray-scale of the local gray-scale image and the global gray-scale image and map them into an enhanced processed gray-scale image. The global factor is α, and the adopted model is:
[0049] g = α * g1 + (1 - α) * g2
[0050] Wherein, g is the synthesized gray scale, α is the global factor, g1 is the gray scale of the global gray scale image G1, and g2 is the gray scale of the local gray scale image G2.
[0051] In this way, by adopting the method of combining the global and local histograms, good contrast can be obtained on the basis of maintaining the original histogram. In this way, it can not only process the large dynamic range scene of high-temperature objects, but also make up for the defect of insufficient low-intensity contrast. Among them, for the gray scale image mapped by infrared radiation, the size of its gray scale directly reflects the surface temperature of the object, and as much as possible, the corresponding relationship between the 8-bit and 16-bit temperatures of the image gray scale is retained.
[0052] In order to achieve the above technical effects, the technical solution of the present invention further adopts the following implementation process, which is specifically described as follows.
[0053] (1) Input the infrared image I, perform histogram statistics on the whole original 16-bit infrared image, obtain the frequency density function of the infrared original image, and perform normalization processing.
[0054]
[0055] Wherein, N is the total number of pixels of an image, which is the product of the image width W and the image height H; r k is the k-th gray scale; n k is the number of pixels with the gray scale of r k ; L is the gray scale level.
[0056] (2) Calculate the cumulative distribution function (Cumulative distribution function, CDF) of the 16-bit infrared image, and the calculation model is as follows:
[0057]
[0058] Wherein, C(r k ) is the cumulative probability.
[0059] (3) Use the cumulative distribution function as the transformation function to calculate the transformation function for converting the gray scale from 0 to L to 0-255, and the calculation model is as follows:
[0060] T(r k ) = [C(r k ) * 255], k = 0, 1, 2,... L-1; 0 ≤ r k ≤ 1
[0061] Wherein, T(r k ) is the gray scale.
[0062] (4) Since low-contrast objects in the infrared scene account for the main part of the scene, using the cumulative distribution function directly as the gray-scale conversion function can provide overall contrast, but it will inevitably amplify low-contrast noise. Therefore, for the discontinuous parts of the gray scale in the above T(r k ), processing is performed, that is, the gray scale with an interval of 0 in the T(r k ) function is removed. After merging the gray scales, a new conversion function is obtained.
[0063] S(r k ) = {T(r j )}, 0 ≤ j ≤ L1 - 1;
[0064] In the formula, j is the gray scale after merging; L1 is the gray scale level after merging.
[0065] (5) Calculate the global gray-scale bias.
[0066] gO = 255 - L1
[0067] (6) Calculate the global gray-scale mapping G1.
[0068] G1(r k ) = S(r k ) + gO
[0069] (7) Perform mean threshold processing on the original infrared image.
[0070]
[0071] (8) Use the threshold Mean to perform hierarchical processing on the original 16-bit histogram, where different thresholds are used for the low-temperature and high-temperature parts. Further, similar to step (4), the gray scales in the histogram less than the threshold are removed and then merged before and after. To keep the data transition in the low-temperature and high-temperature parts continuous, the low-temperature and high-temperature histograms need to start from the Mean gray scale. The low-temperature histogram uses th0 to start compressing and approaching the Mean gray scale, and the high-temperature part uses th1 to start compressing and approaching the Mean gray scale.
[0072]
[0073] In the formula, L0 is the lower boundary gray scale after merging the low-temperature gray scales; L1 is the upper boundary gray scale after merging the high-temperature gray scales; L is the original 16-bit gray scale level.
[0074] (9) Calculate the P2 cumulative distribution function (CDF) again. Specifically, the same processing methods as in steps (2) and (3) can be executed to calculate the above S(r k ) for the 8-bit gray scale of the 16-bit original data.
[0075] (10) The locally enhanced histogram transformation of the converted 8-bit grayscale image is performed using Contrast Limited Adaptive Histogram Equalization (CLAHE) with a fixed clipping factor σ.
[0076] G2(r k ) = f(S(r k ), σ)
[0077] (11) A new grayscale image is synthesized using the globally and locally enhanced histograms obtained.
[0078] G(r i ) = α * G1(r i ) + (1 - α) * G2(r i ), (1 ≤ i ≤ N)
[0079] In this way, the present invention can well retain the details of each gray level of the infrared image by adopting this enhanced infrared histogram equalization technique, so that the contrast of multiple regions of the image is improved to different degrees.
[0080] Although the present invention is disclosed above in a preferred manner, it is not intended to limit the present invention. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention should be determined by the scope defined in the claims of the present invention.
Claims
1. An infrared thermal imager image processing method, characterized in that, It includes the following steps: S1. Perform histogram equalization on the entire original infrared image to obtain a global grayscale image; S2. Perform histogram equalization on the local part of the original infrared image to obtain a local grayscale image; S3. Merge the local grayscale image and the global grayscale image to map to an enhanced grayscale image; Among them, step S1 includes: (S11) Obtain the probability density function of the original infrared image; (S12) Solve the cumulative distribution function of the infrared image; (S13) Use global histogram equalization on the entire original infrared image, map the 16-bit original image to an 8-bit grayscale image to obtain a global grayscale image; (S14) First calculate the global grayscale mapping bias value, remove the grayscales with a distribution probability of 0 in the global grayscale image, and perform global histogram equalization again to obtain an enhanced global grayscale image; Step S2 includes: (S21) Calculate the mean value of the entire original infrared image; (S22) Use the mean value as the threshold to segment the original infrared image. For the low-temperature part, start compressing towards the mean grayscale using the low-temperature threshold, and for the high-temperature part, start compressing towards the mean grayscale using the high-temperature threshold to obtain the low-temperature part and the high-temperature part. Merge the low-temperature part in the histogram of the original infrared image using the low-temperature threshold, and merge the high-temperature part using the high-temperature threshold; (S23) According to the histogram after hierarchical processing, remap the original infrared image from 16-bit to 8-bit grayscale to obtain a local grayscale image; (S24) First remove the grayscales with a distribution probability of 0 in the local grayscale image, perform local histogram gray-scale enhancement conversion using a fixed cropping factor, and perform CLAHE histogram equalization on the local grayscale image to obtain an enhanced global grayscale image; In step S3, Use the global factor to synthesize the grayscales of the local grayscale image and the global grayscale image to map to an enhanced grayscale image, and the calculation model is: g = α * g1+(1 - α) * g2 In the formula, g is the synthesized grayscale, α is the global factor, g1 is the grayscale of the global grayscale image, and g2 is the grayscale of the local grayscale image.
Citation Information
Patent Citations
Image enhancement method based on histogram equalization
CN111583162A