An adaptive infrared image equalization method
Through the adaptive infrared image equalization method, segmentation processing and improved bilinear interpolation mapping are used to solve the problem of poor contrast equalization of infrared images in field observation scenes in the prior art, and more efficient contrast adjustment and image quality improvement are achieved.
Patent Information
- Application Number
- CN202510103975.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2045-01-23
AI Technical Summary
When the existing infrared image equalization method deals with field observation scenes, especially when the background proportion is high, it is difficult to effectively adjust the global and local contrast of infrared images, which easily leads to overexposure or over-lighting of the target.
An adaptive infrared image equalization method is proposed. By counting the total histogram of the original infrared data and performing segmentation processing, the image is divided into multiple sub-blocks, and the adaptive crop threshold limit contrast histogram equalization is performed, and an improved bilinear interpolation mapping method is adopted.
This method improves the adaptability of the algorithm without adjusting the data segmentation points and cropping thresholds according to the scene switching, effectively improving the block effect of infrared images and improving the contrast equalization effect of the image.
Smart Images

Figure CN119540066B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of infrared image processing, and in particular to an adaptive infrared image equalization method. Background Art
[0002] The infrared imaging system obtains 14-bit infrared image data through thermal imaging technology. Most of the infrared images obtained by simple linear stretching and other methods are low in contrast and the target appears blurred, which is not conducive to the use of subsequent application functions. It is necessary to use an excellent equalization method to adjust the global and local contrast of the infrared image. The histogram equalization method is the most commonly used and best performing infrared data processing method. It adjusts the intervals between gray levels with a high proportion according to the cumulative histogram of the data, and merges the intervals between gray levels with a low proportion to achieve a balanced effect. However, infrared equipment is often used for field observations. The dynamic range of the scene varies greatly, and the background often accounts for a high proportion. Histogram equalization and various improved processing methods do not handle such scenes well, resulting in overexposure or overbrightness of the target. Summary of the invention
[0003] Based on the above technical problems, the present invention proposes an adaptive infrared image equalization method, and the specific technical solution is as follows.
[0004] An adaptive infrared image equalization method comprises the following steps:
[0005] Step S1: Count the total histogram HIST of the original infrared data DA and perform segment processing on the histogram;
[0006] Step S2: Divide the original infrared data DA into i sub-blocks, and calculate the histogram Hi of each sub-block data DAI;
[0007] Step S3: each sub-block histogram Hi is subjected to segmented adaptive clipping threshold limiting contrast histogram equalization processing;
[0008] Step S4: Perform improved bilinear interpolation mapping on the equalization results of each sub-block.
[0009] Specifically, step S1 includes the following sub-steps:
[0010] Step S11: traverse all the pixels of the original infrared data DA, establish a total histogram HIST, and calculate the total number of pixels NUM. During the traversal process: ; ;in, , represents the pixel value at the (x, y) coordinate of the original infrared data DA;
[0011] Step S12: traverse the total histogram HIST and find the median MED calculation formula: , MED is equal to the k value that satisfies the MED calculation formula for finding the median;
[0012] Step S13: Find all flat areas AllPi in the total histogram HIST;
[0013] Step S14: traverse all flat areas AllPi and retain their lengths Greater than The flat area is Mpi. If i is greater than 2, that is, the number of Mpi is greater than 2, the two flat areas with longer lengths are retained as the segmented flat areas Pi, which can be expressed as:
[0014] ;
[0015] ;
[0016] in, represents the i+1th flat area, and the subscript LP represents the left endpoint of the flat area; represents the i-th flat area, and the subscript RP represents the right end point of the flat area;
[0017] Step S15: Divide the total histogram HIST into a low temperature segment LD, a normal segment ND and a high temperature segment HD according to the segmented flat area Pi; wherein the low temperature segment LD is from the left end point IL of the image to the right end point of the first longer flat area The regular segment ND is the right end point of the first longer flat area. To the left end point of the second longer flat area The high temperature segment HD is the left end point of the second longer flat area. The data segment from the right endpoint IR of the image to the right endpoint IR of the image.
[0018] Specifically, the judgment conditions of the flat area AllPi include:
[0019] ;
[0020] ;
[0021] Where i represents the number of sub-blocks of the original infrared data DA, , represents the threshold of the whole image; NUM is the total number of pixels of the original infrared data DA; ; The flat area represents the data segment where the difference in histogram height between adjacent pixels on the histogram is small.
[0022] Specifically, step S2 includes the following sub-steps:
[0023] Step S21: Divide the image into i sub-blocks DAI according to the width and height of the original infrared data DA;
[0024] Step S22: traverse all pixels in each sub-block and establish a sub-block histogram Hi:
[0025] ;
[0026] in, , represents the pixel value at the (x, y) coordinate of each sub-block data DAI;
[0027] Step S23: traverse the sub-block histogram Hi and find the sub-block median MEDI:
[0028] ;
[0029] Among them, MEDI represents the value, NUM represents the total number of pixels, and i represents the number of divided sub-blocks.
[0030] Specifically, step S3 includes the following sub-steps:
[0031] Step S31: traverse the low temperature segment of the sub-block histogram Hi and perform adaptive clipping threshold limiting contrast histogram equalization processing;
[0032] Step S32: traverse the normal temperature section of the sub-block histogram Hi and perform adaptive clipping threshold limiting contrast histogram equalization processing;
[0033] Step S33: traverse the high temperature segment of the sub-block histogram Hi and perform adaptive clipping threshold limiting contrast histogram equalization processing.
[0034] Specifically, the step S31 further includes the following sub-steps:
[0035] Step S311: Count the number of valid pixels nullowD and the number of invalid pixels nullowP in the low temperature segment in the sub-block histogram Hi, as well as the total value of valid pixels sumLowD and the total value of invalid pixels sumLowP, and the calculation formulas are:
[0036] ;
[0037] ;
[0038] ;
[0039] ;
[0040] in, represents the pixel value in the histogram, , from the left end point IL of the image to the right end point of the first relatively long flat area The data segment between
[0041] Step S312: Calculate the adaptive clipping threshold clipTupLow of the low temperature segment: ;
[0042] Step S313: Count the total value of pixels sumUpLow exceeding the adaptive clipping threshold clipTupLow in the low temperature segment of the sub-block histogram Hi, and calculate the filling height clipMeanLow. The calculation formula is:
[0043] , ;
[0044] ;
[0045] Step S314: Count the total value of pixels sumDownLow in the low temperature segment of the sub-block histogram Hi that is less than or equal to the full image threshold T, and calculate the redistribution height downMeanLow, which is calculated as follows:
[0046] , ;
[0047] ;
[0048] Step S315: Perform histogram equalization on the low temperature segment of the sub-block histogram Hi to obtain an equalized histogram Ehi, which is calculated as follows:
[0049] ;
[0050] in, represents the pixel value in the histogram, , from the left end point IL of the image to the right end point of the first relatively long flat area The data segment between.
[0051] Specifically, the step S32 further includes the following sub-steps:
[0052] Step S321: Count the number of valid pixels numNorD and the number of invalid pixels numNorP in the normal temperature section in the sub-block histogram Hi, as well as the total value of valid pixels sumNorD and the total value of invalid pixels sumNorP, and the calculation formula is:
[0053] , ;
[0054] , ;
[0055] , ;
[0056] , ;
[0057] in, represents the pixel value in the histogram, , is the right end point of the first long flat area To the left end point of the second longer flat area The data segment between
[0058] Step S322: Calculate the adaptive clipping threshold clipTupNor of the normal temperature section, the calculation formula is: ;
[0059] Step S323: Count the total value of pixels sumUpNor exceeding the adaptive clipping threshold clipTupNor in the normal temperature section of the sub-block histogram Hi, and calculate the filling height clipMeanNor. The calculation formula is:
[0060] , ;
[0061] ;
[0062] Step S324: Count the total value of pixels sumDownNor that are less than or equal to the full image threshold T in the normal temperature segment of the sub-block histogram Hi, and calculate the redistribution height downMeanNor, and the calculation formula is:
[0063] , ;
[0064] ;
[0065] Step S325: Perform histogram equalization on the normal temperature section of the sub-block histogram Hi to obtain an equalized histogram Ehi, which is calculated as follows:
[0066] ;
[0067] in, represents the pixel value in the histogram, , is the right end point of the first long flat area To the left end point of the second longer flat area The data segment between.
[0068] Specifically, the step S33 further includes the following sub-steps:
[0069] Step S331: Count the number of valid pixels numHighD and the number of invalid pixels numHighP in the high temperature section of the sub-block histogram Hi, as well as the total value of valid pixels sumHighD and the total value of invalid pixels sumHighP. The specific calculation formula is:
[0070] , ;
[0071] , ;
[0072] , ;
[0073] , ;
[0074] in, represents the pixel value in the histogram, , is the left end point of the second longer flat area The data segment from the right endpoint IR of the image;
[0075] Step S332: Calculate the adaptive clipping threshold clipTupHigh of the high temperature segment, the calculation formula is: ;
[0076] Step S333: Count the total value of pixels sumUpHigh exceeding the adaptive clipping threshold clipTupHigh in the high temperature segment of the sub-block histogram Hi, and calculate the filling height clipMeanHigh. The specific calculation formula is:
[0077] , ;
[0078] ;
[0079] Step S334: Count the total value of pixels sumDownHigh that are less than or equal to the full image threshold T in the high temperature segment of the sub-block histogram Hi, and calculate the redistribution height downMeanHigh. The specific calculation formula is:
[0080] , ;
[0081] ;
[0082] Step S335: Perform histogram equalization on the high temperature segment of the sub-block histogram Hi to obtain an equalized histogram Ehi. The specific calculation formula is:
[0083] ;
[0084] in, represents the pixel value in the histogram, , is the left end point of the second longer flat area The data segment from the right endpoint IR of the image to the right endpoint IR of the image.
[0085] Specifically, step S4 includes the following sub-steps:
[0086] Step S41: traverse the redistribution histograms Ehi of i sub-blocks and establish the cumulative histogram cdfi of each sub-block. The calculation formula is: ;
[0087] Step S42: Calculate the mapping values medD and medDi of the median MED and the median MEDI of each sub-block in the cumulative histogram of each sub-block. The specific calculation formula is:
[0088] ;
[0089] ;
[0090] Step S43: According to the median mapping value calculated in step S42, the compensation value diffI of each sub-block interpolation result is obtained and expressed as: ;
[0091] Step S44: traverse the original infrared image data DA, and according to the pixel value pi at (x, y) and the equalization results in the i cumulative histograms , , , , and obtain the bilinear interpolation mapping result of the pixel value. The specific calculation formula is:
[0092] ;
[0093] Wherein, (x, y) represents pixel coordinates, w represents the width of infrared image data, h represents the height of infrared image data, LU represents the upper left block, RU represents the upper right block, LD represents the lower left block, and RD represents the lower right block.
[0094] Beneficial effects of the invention: The invention proposes an adaptive infrared image equalization method with a high degree of algorithm adaptability. Data segmentation points and cropping thresholds do not need to be adjusted according to scene switching. At the same time, an improved interpolation method is used to effectively improve the block effect of infrared images. BRIEF DESCRIPTION OF THE DRAWINGS
[0095] Figure 1 is a schematic diagram of image segmentation in an embodiment of the present invention;
[0096] Figure 2 is an overall flow chart of the adaptive infrared image equalization method in an embodiment of the present invention;
[0097] Figure 3 1 is a flow chart of step S1 of the adaptive infrared image equalization method in an embodiment of the present invention;
[0098] Figure 4 1 is a flow chart of step S2 of the adaptive infrared image equalization method in an embodiment of the present invention;
[0099] Figure 5 1 is a flow chart of step S3 of the adaptive infrared image equalization method in an embodiment of the present invention;
[0100] Figure 6 1 is a flow chart of step S4 of the adaptive infrared image equalization method in an embodiment of the present invention. DETAILED DESCRIPTION
[0101] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described with reference to the accompanying drawings.
[0102] The present invention proposes an adaptive infrared image equalization method, such as Figure 2 As shown, the following steps are included:
[0103] Step S1: Count the total histogram HIST of the original infrared data DA and perform segment processing on the histogram;
[0104] Step S2: Divide the original infrared data DA into i sub-blocks, and calculate the histogram Hi of each sub-block data DAI;
[0105] Step S3: Each sub-block histogram Hi is subjected to segmented adaptive clipping threshold-limited contrast histogram equalization processing, such as Figure 1 As shown;
[0106] Step S4: Perform improved bilinear interpolation mapping on the equalization results of each sub-block.
[0107] In a preferred embodiment, step S1 is as follows Figure 3 As shown, it includes the following sub-steps:
[0108] Step S11: traverse all the pixels of the original infrared data DA, establish a total histogram HIST, and calculate the total number of pixels NUM. During the traversal process: ; ;in, , represents the pixel value at the (x, y) coordinate of the original infrared data DA;
[0109] Step S12: traverse the total histogram HIST and find the median MED: , MED represents the k value when this formula is satisfied;
[0110] Step S13: Find all flat areas AllPi in the total histogram HIST;
[0111] Step S14: traverse all flat areas AllPi and retain their lengths Greater than The flat area is Mpi. If i is greater than 2, that is, the number of Mpi is greater than 2, the two flat areas with longer lengths are retained as the segmented flat areas Pi, which can be expressed as:
[0112] ;
[0113] ;
[0114] in, represents the i+1th flat area, and the subscript LP represents the left endpoint of the flat area; represents the i-th flat area, and the subscript RP represents the right end point of the flat area;
[0115] Step S15: Divide the total histogram HIST into a low temperature segment LD, a normal segment ND and a high temperature segment HD according to the segmented flat area Pi; wherein the low temperature segment LD is from the left end point IL of the image to the right end point of the first longer flat area The regular segment ND is the right end point of the first longer flat area. To the left end point of the second longer flat area The high temperature segment HD is the left end point of the second longer flat area. The data segment from the right endpoint IR of the image to the right endpoint IR of the image.
[0116] In a preferred embodiment, the determination conditions of the flat area AllPi include:
[0117] ;
[0118] ;
[0119] in, , represents the threshold of the whole image; NUM is the total number of pixels of the original infrared data DA; ; The flat area represents the data segment where the difference in histogram height between adjacent pixels on the histogram is small.
[0120] In a preferred embodiment, step S2 is as follows Figure 4 As shown, it includes the following sub-steps:
[0121] Step S21: Divide the image into i sub-blocks DAI according to the width and height of the original infrared data DA;
[0122] Step S22: traverse all pixels in each sub-block and establish a sub-block histogram Hi:
[0123] ;
[0124] in, , represents the pixel value at the (x, y) coordinate of each sub-block data DAI;
[0125] Step S23: traverse the sub-block histogram Hi and find the sub-block median MEDI:
[0126] ;
[0127] Among them, MEDI represents the value, NUM represents the total number of pixels, and i represents the number of divided sub-blocks.
[0128] In a preferred embodiment, step S3 is as follows Figure 5 As shown, it includes the following sub-steps:
[0129] Step S31: traverse the low temperature segment of the sub-block histogram Hi and perform adaptive clipping threshold limiting contrast histogram equalization processing;
[0130] Step S32: traverse the normal temperature section of the sub-block histogram Hi and perform adaptive clipping threshold limiting contrast histogram equalization processing;
[0131] Step S33: traverse the high temperature segment of the sub-block histogram Hi and perform adaptive clipping threshold limiting contrast histogram equalization processing.
[0132] In a preferred embodiment, step S31 further includes the following sub-steps:
[0133] Step S311: Count the number of valid pixels nullowD and the number of invalid pixels nullowP in the low temperature segment in the sub-block histogram Hi, as well as the total value of valid pixels sumLowD and the total value of invalid pixels sumLowP, and the calculation formulas are:
[0134] ;
[0135] ;
[0136] ;
[0137] ;
[0138] in, represents the pixel value in the histogram, , from the left end point IL of the image to the right end point of the first relatively long flat area The data segment between
[0139] Step S312: Calculate the adaptive clipping threshold clipTupLow of the low temperature segment: ;
[0140] Step S313: Count the total value of pixels sumUpLow exceeding the adaptive clipping threshold clipTupLow in the low temperature segment of the sub-block histogram Hi, and calculate the filling height clipMeanLow. The calculation formula is:
[0141] , ;
[0142] ;
[0143] Step S314: Count the total value of pixels sumDownLow in the low temperature segment of the sub-block histogram Hi that is less than or equal to the full image threshold T, and calculate the redistribution height downMeanLow, which is calculated as follows:
[0144] , ;
[0145] ;
[0146] Step S315: Perform histogram equalization on the low temperature segment of the sub-block histogram Hi to obtain an equalized histogram Ehi, which is calculated as follows:
[0147] ;
[0148] in, represents the pixel value in the histogram, , from the left end point IL of the image to the right end point of the first relatively long flat area The data segment between.
[0149] In a preferred embodiment, step S32 further includes the following sub-steps:
[0150] Step S321: Count the number of valid pixels numNorD and the number of invalid pixels numNorP in the normal temperature section in the sub-block histogram Hi, as well as the total value of valid pixels sumNorD and the total value of invalid pixels sumNorP, and the calculation formula is:
[0151] , ;
[0152] , ;
[0153] , ;
[0154] , ;
[0155] in, represents the pixel value in the histogram, , is the right end point of the first long flat area To the left end point of the second longer flat area The data segment between
[0156] Step S322: Calculate the adaptive clipping threshold clipTupNor of the normal temperature section, the calculation formula is: ;
[0157] Step S323: Count the total value of pixels sumUpNor exceeding the adaptive clipping threshold clipTupNor in the normal temperature section of the sub-block histogram Hi, and calculate the filling height clipMeanNor. The calculation formula is:
[0158] , ;
[0159] ;
[0160] Step S324: Count the total value of pixels sumDownNor that are less than or equal to the full image threshold T in the normal temperature segment of the sub-block histogram Hi, and calculate the redistribution height downMeanNor, and the calculation formula is:
[0161] , ;
[0162] ;
[0163] Step S325: Perform histogram equalization on the normal temperature section of the sub-block histogram Hi to obtain an equalized histogram Ehi, which is calculated as follows:
[0164] ;
[0165] in, represents the pixel value in the histogram, , is the right end point of the first long flat area To the left end point of the second longer flat area The data between.
[0166] In a preferred embodiment, step S33 further includes the following sub-steps:
[0167] Step S331: Count the number of valid pixels numHighD and the number of invalid pixels numHighP in the high temperature section of the sub-block histogram Hi, as well as the total value of valid pixels sumHighD and the total value of invalid pixels sumHighP. The specific calculation formula is:
[0168] , ;
[0169] , ;
[0170] , ;
[0171] , ;
[0172] in, represents the pixel value in the histogram, , is the left end point of the second longer flat area The data segment from the right endpoint IR of the image;
[0173] Step S332: Calculate the adaptive clipping threshold clipTupHigh of the high temperature segment, the calculation formula is: ;
[0174] Step S333: Count the total value of pixels sumUpHigh exceeding the adaptive clipping threshold clipTupHigh in the high temperature segment of the sub-block histogram Hi, and calculate the filling height clipMeanHigh. The specific calculation formula is:
[0175] , ;
[0176] ;
[0177] Step S334: Count the total value of pixels sumDownHigh that are less than or equal to the full image threshold T in the high temperature segment of the sub-block histogram Hi, and calculate the redistribution height downMeanHigh. The specific calculation formula is:
[0178] , ;
[0179] ;
[0180] Step S335: Perform histogram equalization on the high temperature segment of the sub-block histogram Hi to obtain an equalized histogram Ehi. The specific calculation formula is:
[0181] ;
[0182] in, represents the pixel value in the histogram, , is the left end point of the second longer flat area Data between the right endpoint IR of the image.
[0183] In a preferred embodiment, step S4 is as follows Figure 6 As shown, it includes the following sub-steps:
[0184] Step S41: traverse the redistribution histograms Ehi of i sub-blocks and establish the cumulative histogram cdfi of each sub-block. The calculation formula is: ;
[0185] Step S42: Calculate the mapping values medD and medDi of the median MED and the median MEDI of each sub-block in the cumulative histogram of each sub-block. The specific calculation formula is:
[0186] ;
[0187] ;
[0188] Step S43: According to the median mapping value calculated in step S42, the compensation value diffI of each sub-block interpolation result is obtained and expressed as: ;
[0189] Step S44: traverse the original infrared image data DA, and according to the pixel value pi at (x, y) and the equalization results in the i cumulative histograms , , , , and obtain the bilinear interpolation mapping result of the pixel value. The specific calculation formula is:
[0190] ;
[0191] Wherein, (x, y) represents pixel coordinates, w represents the width of infrared image data, h represents the height of infrared image data, LU represents the upper left block, RU represents the upper right block, LD represents the lower left block, and RD represents the lower right block.
[0192] The present invention has shown and described the basic principles and main features of the present invention and the advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. An adaptive infrared image equalization method, characterized in that: The following steps are involved: Step S1: Count the total histogram HIST of the original infrared data DA and perform segment processing on the histogram; Step S2: Divide the original infrared data DA into i sub-blocks, and calculate the histogram Hi of each sub-block data DAI; Step S3: each sub-block histogram Hi is subjected to segmented adaptive clipping threshold limiting contrast histogram equalization processing; Step S4: Performing improved bilinear interpolation mapping on the equalization results of each sub-block, including the following sub-steps: Step S41: traverse the redistribution histograms Ehi of i sub-blocks and establish the cumulative histogram cdfi of each sub-block. The calculation formula is: Step S42: Calculate the mapping values medD and medDi of the median MED and the median MEDI of each sub-block in the cumulative histogram of each sub-block. The specific calculation formula is: medD = cdfi(MED+1); medDi = cdfi(MEDI+1); Step S43: According to the median mapping value calculated in step S42, the compensation value diffI of each sub-block interpolation result is obtained and expressed as: diffI = medDi - medD; Step S44: traverse the original infrared image data DA, and obtain the bilinear interpolation mapping result of the pixel value according to the pixel value pi at (x, y) and the equalization results cdf_LU(pi+1), cdf_RU(pi+1), cdf_LD(pi+1), cdf_RD(pi+1) in the i cumulative histograms. The specific calculation formula is: Wherein, (x, y) represents pixel coordinates, w represents the width of infrared image data, h represents the height of infrared image data, LU represents the upper left block, RU represents the upper right block, LD represents the lower left block, and RD represents the lower right block.
2. The adaptive infrared image equalization method according to claim 1, characterized in that: The step S1 comprises the following sub-steps: Step S11: traverse all pixel points of the original infrared data DA, establish a total histogram HIST, and calculate the total number of pixel points NUM. During the traversal process: HIST(pi+1)=HIST(pi+1)+1; NUM=NUM+1; wherein pi=DA(x, y), indicating the pixel value at the (x, y) coordinate of the original infrared data DA; Step S12: traverse the total histogram HIST and find the median MED calculation formula: MED is equal to the k value that satisfies the MED calculation formula for finding the median; Step S13: Find all flat areas AllPi in the total histogram HIST; Step S14: traverse all flat areas AllPi, and retain the flat areas whose length lengthPi is greater than lengthT as Mpi. If i is greater than 2, that is, the number of Mpi is greater than 2, retain the two flat areas with longer lengths as segmented flat areas Pi, which can be expressed as: lengthPi=Mpi RP -War LP ; lengthT=AllP(i+1) LP -AllP(i) RP ; Wherein, AIIP(i+1) represents the i+1th flat area, and the subscript LP represents the left endpoint of the flat area; AIIP(i) represents the ith flat area, and the subscript RP represents the right endpoint of the flat area; Step S15: Divide the total histogram HIST into a low temperature segment LD, a normal segment ND and a high temperature segment HD according to the segmented flat area Pi; wherein the low temperature segment LD is from the left end point IL of the image to the right end point P1 of the first longer flat area RP The regular segment ND is the first longer flat area right end point P1 RP To the left end point P2 of the second longer flat area LP The high temperature segment HD is the left endpoint P2 of the second longer flat area. LP The data segment from the right endpoint IR of the image to the right endpoint IR of the image.
3. The adaptive infrared image equalization method according to claim 2, characterized in that: The judgment conditions of the flat area AllPi include: HIST(i) <T&&HIST(i+1)<T; abs(HIST(i+1)-HIST(i)) <deltaT; Where i represents the number of sub-blocks of the original infrared data DA, Indicates the threshold of the entire image; NUM is the total number of pixels in the original infrared data DA; The flat area represents the data segment where the difference in histogram height between adjacent pixels on the histogram is small.
4. The adaptive infrared image equalization method according to claim 3, characterized in that: The step S2 comprises the following sub-steps: Step S21: Divide the image into i sub-blocks DAI according to the width and height of the original infrared data DA; Step S22: traverse all pixels in each sub-block and establish a sub-block histogram Hi: Hi(pi+1)=Hi(pi+1)+1; Wherein, pi=DAI(x, y), represents the pixel value at the (x, y) coordinate of each sub-block data DAI; Step S23: traverse the sub-block histogram Hi and find the sub-block median MEDI: Among them, MEDI represents the k value when the above formula is satisfied, NUM represents the total number of pixels, and i represents the number of divided sub-blocks.
5. The adaptive infrared image equalization method according to claim 4, characterized in that: The step S3 comprises the following sub-steps: Step S31: traverse the low temperature segment of the sub-block histogram Hi and perform adaptive clipping threshold limiting contrast histogram equalization processing; Step S32: traverse the normal temperature section of the sub-block histogram Hi and perform adaptive clipping threshold limiting contrast histogram equalization processing; Step S33: traverse the high temperature segment of the sub-block histogram Hi and perform adaptive clipping threshold limiting contrast histogram equalization processing.
6. The adaptive infrared image equalization method according to claim 5, characterized in that: The step S31 further includes the following sub-steps: Step S311: Count the number of valid pixels nullowD and the number of invalid pixels nullowP in the low temperature segment in the sub-block histogram Hi, as well as the total value of valid pixels sumLowD and the total value of invalid pixels sumLowP, and the calculation formulas are: numLowD=numLowD+1,Hi(k)>T; numLowP=numLowP+1,Hi(k)>0and Hi(k)<=T; sumLowD=sumLowD+Hi(k),Hi(k)>T; sumLowP=sumLowP+Hi(k),Hi(k)>0andHi(k)<=T; Among them, k represents the pixel value in the histogram, k∈[IL,P1 RP ], from the left end point IL of the image to the right end point P1 of the first relatively long flat area RP The data segment between Step S312: Calculate the adaptive clipping threshold clipTupLow of the low temperature segment: Step S313: Count the total value of pixels sumUpLow exceeding the adaptive clipping threshold clipTupLow in the low temperature segment of the sub-block histogram Hi, and calculate the filling height clipMeanLow. The calculation formula is: sumUpLow=sumUpLow+Hi(k),Hi(k)>clipTupLow; Step S314: Count the total value of pixels sumDownLow in the low temperature segment of the sub-block histogram Hi that is less than or equal to the full image threshold T, and calculate the redistribution height downMeanLow, which is calculated as follows: sumDownLow=sumDownLow+Hi(k),Hi(k)>0and Hi(k)<=T; Step S315: Perform histogram equalization on the low temperature segment of the sub-block histogram Hi to obtain an equalized histogram Ehi, which is calculated as follows: Among them, k represents the pixel value in the histogram, k∈[IL,P1 RP ], from the left end point IL of the image to the right end point P1 of the first relatively long flat area RP The data segment between.
7. The adaptive infrared image equalization method according to claim 5, characterized in that: The step S32 further comprises the following sub-steps: Step S321: Count the number of valid pixels numNorD and the number of invalid pixels numNorP in the normal temperature section in the sub-block histogram Hi, as well as the total value of valid pixels sumNorD and the total value of invalid pixels sumNorP, and the calculation formula is: numNorD=numNorD+1,Hi(k)>T; numNorP=numNorP+1, Hi(k)>0andHi(k)<=T; sumNorD=sumNorD+Hi(k), Hi(k)>T; sumNorP=sumNorPHi(k),Hi(k)>0and Hi(k)<=T; Among them, k represents the pixel value in the histogram, k∈[P1 RP , P2 LP ], which is the right end point P1 of the first relatively long flat area RP To the left end point P2 of the second longer flat area LP The data segment between Step S322: Calculate the adaptive clipping threshold clipTupNor of the normal temperature section, the calculation formula is: Step S323: Count the total value of pixels sumUpNor exceeding the adaptive clipping threshold clipTupNor in the normal temperature section of the sub-block histogram Hi, and calculate the filling height clipMeanNor. The calculation formula is: sumUpNor=sumUpNor+Hi(k),Hi(k)>clipTupNor; Step S324: Count the total value of pixels sumDownNor that are less than or equal to the full image threshold T in the normal temperature segment of the sub-block histogram Hi, and calculate the redistribution height downMeanNor, and the calculation formula is: sumDownNor=sumDownNor+Hi(k),Hi(k)>0and Hi(k)<=T; Step S325: Perform histogram equalization on the normal temperature section of the sub-block histogram Hi to obtain an equalized histogram Ehi, which is calculated as follows: Among them, k represents the pixel value in the histogram, k∈[P1 RP , P2 LP ], which is the right end point P1 of the first relatively long flat area RP To the left end point P2 of the second longer flat area LP The data segment between.
8. The adaptive infrared image equalization method according to claim 5, characterized in that: The step S33 also includes the following sub-steps: Step S331: Count the number of valid pixels numHighD and the number of invalid pixels numHighP in the high temperature section of the sub-block histogram Hi, as well as the total value of valid pixels sumHighD and the total value of invalid pixels sumHighP. The specific calculation formula is: numHighD=numHighD+1,Hi(k)>T; numHighP=numHighP+1,Hi(k)>0and Hi(k)<=T; sumHighD=sumHighD+Hi(k),Hi(k)>T; sumHighP=sumHighP+Hi(k), Hi(k)>0and Hi(k)<=T; Among them, k represents the pixel value in the histogram, k∈[P2 LP , IR], is the left end point P2 of the second longer flat area LP The data segment from the right endpoint IR of the image; Step S332: Calculate the adaptive clipping threshold clipTupHigh of the high temperature segment, the calculation formula is: Step S333: Count the total value of pixels sumUpHigh exceeding the adaptive clipping threshold clipTupHigh in the high temperature segment of the sub-block histogram Hi, and calculate the filling height clipMeanHigh. The specific calculation formula is: sumUpHigh=sumUpHigh+Hi(k), Hi(k)>clipTupHigh; Step S334: Count the total value of pixels sumDownHigh that are less than or equal to the full image threshold T in the high temperature segment of the sub-block histogram Hi, and calculate the redistribution height downMeanHigh. The specific calculation formula is: sumDownHigh=sumDownHigh+Hi(k), Hi(k)>0and Hi(k)<=T; Step S335: Perform histogram equalization on the high temperature segment of the sub-block histogram Hi to obtain an equalized histogram Ehi. The specific calculation formula is: Among them, k represents the pixel value in the histogram, k∈[P2 LP ,IR], which is the left end point P2 of the second longer flat area LP The data segment from the right endpoint IR of the image to the right endpoint IR of the image.
Citation Information
Patent Citations
Infrared image denoising enhancement method, device and system based on local adaptive CLAHE, and computer readable storage medium
CN112365424A
Infrared segmentation double-platform histogram enhancement method based on redistribution
CN119228656A