Infrared image enhancement method and device, electronic equipment and storage medium

By iteratively segmenting, probability density correction and fusion of the source grayscale histogram of infrared images, and combining with the determination of grayscale mapping curves, the problem of information loss caused by infrared image contrast enhancement in the prior art is solved, and a more efficient contrast enhancement effect is achieved.

CN120182102APending Publication Date: 2025-06-20ZHEJIANG UNIVIEW TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311753374.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-19
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

The prior art can easily lead to information loss in the image when the infrared image contrast is enhanced.

Method used

By obtaining the source grayscale histogram of the to-process infrared image, iteratively segmenting iteratively based on its distribution feature information, and obtaining the target sub-histogram set; each target sub-grayscale histogram is corrected for probability density to obtain a weighted grayscale histogram; then the source grayscale histogram and the weighted grayscale histogram are fused to obtain a target grayscale histogram, and then the grayscale mapping curve is determined and grayscale mapping is performed to achieve contrast enhancement.

Benefits of technology

It effectively reduces information loss in infrared images and improves the contrast enhancement effect of infrared images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120182102A_ABST
    Figure CN120182102A_ABST
Patent Text Reader

Abstract

The invention provides an infrared image enhancement method and device, electronic equipment and a storage medium, and relates to the technical field of image processing, and the method comprises the steps: obtaining a source gray histogram of a to-be-processed infrared image, and carrying out the iterative segmentation of the source gray histogram based on the distribution feature information of the source gray histogram, and obtaining a target sub-histogram set; performing probability density correction on each target sub gray histogram in the target sub histogram set to obtain a weighted gray histogram; fusing the source gray histogram and the weighted gray histogram to obtain a target gray histogram; and determining a gray mapping curve of the target gray histogram, and performing gray mapping on the to-be-processed infrared image based on the gray mapping curve to obtain a contrast-enhanced image of the to-be-processed infrared image. According to the technical scheme provided by the invention, the information loss in the infrared image can be effectively reduced in the infrared image enhancement process, and the contrast enhancement effect of the infrared image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and particularly to an infrared image enhancement method, apparatus, electronic device, and storage medium. Background Art

[0002] Thermal infrared monitoring devices, such as thermal infrared cameras, are devices that can visualize the thermal radiation energy radiated by the object to be measured into the natural world, and have been widely used in the fields of military, medicine, industry, and transportation. However, since the thermal radiation energy of the object to be measured is not high, and the temperature difference range on the surface of the same object to be measured is small, the gray-scale dynamic range of the infrared image is small and the contrast is low, resulting in low recognition of the infrared image by the naked eye. This problem can be solved by contrast enhancement in the infrared image visualization process. Therefore, the contrast enhancement of infrared images is of great significance for improving the quality of infrared images.

[0003] In the related art, the histogram equalization algorithm can be used to enhance the contrast of infrared images. It can adjust the gray-scale distribution of the infrared image to a uniform distribution and perform gray-scale mapping according to this uniform distribution to achieve the purpose of contrast enhancement. Although the uniform distribution has the largest information entropy among all distributions and can bring the strongest contrast effect in terms of visual perception, changing the original gray-scale distribution from a relatively concentrated gray-scale interval to a uniform distribution over the entire gray-scale range will result in information loss in the image. Summary of the Invention

[0004] The present invention provides an infrared image enhancement method, apparatus, electronic device, and storage medium to solve the problem of information loss in the image easily caused during the contrast enhancement of infrared images in the prior art and improve the contrast enhancement effect of infrared images.

[0005] The present invention provides an infrared image enhancement method, including:

[0006] Obtaining the source gray-scale histogram of the infrared image to be processed, and iteratively segmenting the source gray-scale histogram based on the distribution feature information of the source gray-scale histogram to obtain a set of target sub-histograms;

[0007] Performing probability density correction on each target sub-gray-scale histogram in the set of target sub-histograms to obtain a weighted gray-scale histogram;

[0008] Fusing the source gray-scale histogram and the weighted gray-scale histogram to obtain a target gray-scale histogram;

[0009] Determining the gray-scale mapping curve of the target gray-scale histogram, and performing gray-scale mapping on the infrared image to be processed based on the gray-scale mapping curve to obtain the contrast-enhanced image of the infrared image to be processed.

[0010] According to an infrared image enhancement method provided by the present invention, when the current iteration number is 0, determine that the initial set of sub-histograms to be processed is the source gray-scale histogram, and determine that the initial set of result sub-histograms is an empty set; the initial value of the current iteration number is 0;

[0011] When the current iteration number is greater than 0, update the initial set of sub-histograms to be processed to the target set of sub-histograms to be processed obtained after the previous iteration of the current iteration number, and update the initial set of result sub-histograms to the target set of result sub-histograms obtained after the previous iteration;

[0012] For each initial sub-histogram to be processed in the initial set of sub-histograms to be processed, determine whether the initial sub-histogram to be processed needs to be segmented;

[0013] When the initial sub-histogram to be processed needs to be segmented, move the initial sub-histogram to the first set of sub-histograms to be processed;

[0014] When the initial sub-histogram to be processed does not need to be segmented, move the initial sub-histogram to the first set of result sub-histograms, and the initial state of the first set of result sub-histograms is the initial set of result sub-histograms;

[0015] For each first sub-histogram to be processed in the first set of sub-histograms to be processed, segment the first sub-histogram to be processed based on the distribution feature information of the first sub-histogram to be processed, and move the segmentation result to the second set of sub-histograms to be processed;

[0016] After traversing the initial set of sub-histograms to be processed, update the target set of sub-histograms to be processed to the second set of sub-histograms to be processed finally obtained in this iteration, update the target set of result sub-histograms to the first set of result sub-histograms finally obtained in this iteration, and increment the current iteration number by 1;

[0017] Determine whether the iteration ends, and when the iteration ends, determine the finally obtained target set of result sub-histograms as the target set of sub-histograms; when the iteration does not end, enter the next iteration.

[0018] According to an infrared image enhancement method provided by the present invention, the determination of whether the initial sub-histogram to be processed needs to be segmented includes:

[0019] Determine whether the initial sub-histogram to be processed satisfies the joint discrimination condition of the current iteration number and the skewed distribution;

[0020] When the initial sub-histogram to be processed satisfies the joint discrimination condition of the current iteration number and the skewed distribution, it is determined that the initial sub-histogram to be processed needs to be segmented;

[0021] When the initial sub-histogram to be processed does not satisfy the joint discrimination condition of the current iteration number and the skewed distribution, it is determined that the initial sub-histogram to be processed does not need to be segmented.

[0022] According to an infrared image enhancement method provided by the present invention, the distribution feature information includes an average value, a standard deviation, and a skewness; the segmenting the first sub-histogram to be processed based on the distribution feature information of the first sub-histogram to be processed includes:

[0023] Based on the average value, the standard deviation, and the skewness of the first sub-histogram to be processed, determine the gray-level segmentation point of the first sub-histogram to be processed;

[0024] Use the gray-level segmentation point to segment the first sub-histogram to be processed.

[0025] According to an infrared image enhancement method provided by the present invention, it further includes:

[0026] When the set of initial sub-histograms to be processed is empty, it is determined that the iteration ends.

[0027] According to an infrared image enhancement method provided by the present invention, the obtaining the source gray-level histogram of the infrared image to be processed includes:

[0028] Perform gray-level statistics on the infrared image to be processed to obtain a first gray-level histogram;

[0029] Sort the statistical values of the first gray-level histogram in descending order to obtain a second gray-level histogram, and determine the cumulative distribution of the second gray-level histogram;

[0030] Locate the target gray-level value whose cumulative distribution ratio is greater than or equal to a preset ratio threshold for the first time in the cumulative distribution, and determine the statistical value corresponding to the target gray-level value in the second gray-level histogram as the target gray-level threshold;

[0031] Perform gray-level filtering on the second gray-level histogram based on the target gray-level threshold to obtain the source gray-level histogram.

[0032] According to an infrared image enhancement method provided by the present invention, the performing probability density correction on each target sub-gray-level histogram in the set of target sub-histograms to obtain a weighted gray-level histogram includes:

[0033] For each target sub - gray - level histogram in the set of target sub - histograms, determine the sum of probability densities of the target sub - gray - level histogram;

[0034] Based on the sum of probability densities, perform weighted processing on the target sub - gray - level histogram to obtain a weighted gray - level sub - histogram corresponding to the target sub - gray - level histogram;

[0035] Determine each of the weighted gray - level sub - histograms as the weighted gray - level histogram.

[0036] According to an infrared image enhancement method provided by the present invention, the fusing of the source gray - level histogram and the weighted gray - level histogram to obtain a target gray - level histogram includes:

[0037] Determine the cumulative distribution of the source gray - level histogram;

[0038] Based on the cumulative distribution, fuse the source gray - level histogram and the weighted gray - level histogram to obtain a target gray - level histogram.

[0039] The present invention also provides an infrared image enhancement device, including:

[0040] An acquisition module, configured to acquire the source gray - level histogram of the infrared image to be processed;

[0041] A segmentation module, configured to perform iterative segmentation on the source gray - level histogram based on the distribution feature information of the source gray - level histogram to obtain a set of target sub - histograms;

[0042] A correction module, configured to perform probability density correction on each target sub - gray - level histogram in the set of target sub - histograms to obtain a weighted gray - level histogram;

[0043] A fusion module, configured to fuse the source gray - level histogram and the weighted gray - level histogram to obtain a target gray - level histogram;

[0044] A mapping module, configured to determine the gray - level mapping curve of the target gray - level histogram and perform gray - level mapping on the infrared image to be processed based on the gray - level mapping curve to obtain a contrast - enhanced image of the infrared image to be processed.

[0045] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the infrared image enhancement method as described in any one of the above is implemented.

[0046] The present invention also provides a computer - readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the infrared image enhancement method as described in any one of the above is implemented.

[0047] The present invention also provides a computer program product, including a computer program which, when executed by a processor, implements the infrared image enhancement method described in any one of the above.

[0048] For the infrared image enhancement method, device, electronic device and storage medium provided by the present invention, first, the source gray histogram of the infrared image to be processed is obtained, and the source gray histogram is iteratively segmented based on the distribution feature information of the source gray histogram to obtain a set of target sub-histograms; then, the probability density of each target sub-gray histogram in the set of target sub-histograms is corrected to obtain a weighted gray histogram; then, the source gray histogram and the weighted gray histogram are fused to obtain a target gray histogram, and further, the gray mapping curve of the target gray histogram is determined, and the infrared image to be processed is gray-mapped based on the gray mapping curve to obtain a contrast-enhanced image of the infrared image to be processed, realizing the contrast enhancement of the infrared image. Since the distribution feature information of the source gray histogram is utilized during the segmentation of the source gray histogram, that is, the original gray distribution characteristics of the infrared image are considered during the segmentation, the gray range within each target sub-gray histogram segmented can belong to the same type of object. Furthermore, by correcting with the segmented target sub-gray histogram as a unit, the information loss in the infrared image can be effectively reduced, and the contrast enhancement effect of the infrared image is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0050] Figure 1 is a schematic flowchart of the infrared image enhancement method provided by the embodiment of the present invention;

[0051] Figure 2 is a schematic flowchart of the method for iteratively segmenting the source gray histogram based on the distribution feature information of the source gray histogram in the embodiment of the present invention;

[0052] Figure 3 is a schematic diagram of the segmentation effect of segmenting the source gray histogram with the average value as the segmentation point in the prior art;

[0053] Figure 4 is a schematic diagram of the segmentation effect of segmenting the source gray histogram with the segmentation point determined based on the average value, standard deviation and skewness in the embodiment of the present invention;

[0054] Figure 5 is a schematic structural diagram of the infrared image enhancement device provided by the embodiment of the present invention;

[0055] Figure 6 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0056] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without making creative efforts shall fall within the protection scope of the present invention.

[0057] It should be noted that the serial numbers assigned to the objects described in the present invention itself, such as "first", "second", etc., are only used to distinguish the described objects and do not have any sequential or technical meanings.

[0058] The following combines Figures 1 - 4 to describe the infrared image enhancement method of the present invention. The infrared image enhancement method can be applied to electronic devices such as thermal infrared monitoring devices, terminal devices or servers. The terminal devices and servers can be communicatively connected to the thermal infrared monitoring devices. Among them, the terminal devices can include mobile phones, computers, vehicle-mounted devices, tablet computers, wearable devices, etc.; the servers can include stand-alone servers, cluster servers or cloud servers, etc. The infrared image enhancement method can also be applied to an infrared image enhancement device provided in an electronic device such as a thermal infrared monitoring device, a terminal device or a server. The infrared image enhancement device can be implemented by software, hardware or a combination of both.

[0059] Figure 1 Exemplarily shows a schematic flowchart of the infrared image enhancement method provided by an embodiment of the present invention. Referring to Figure 1 as shown, the infrared image enhancement method may include the following steps 110 to 140.

[0060] Step 110: Obtain a source gray-level histogram of the infrared image to be processed, and perform iterative segmentation on the source gray-level histogram based on the distribution feature information of the source gray-level histogram to obtain a set of target sub-histograms.

[0061] After obtaining the infrared image to be processed, the gray levels of the infrared image to be processed can be statistically analyzed to obtain the source gray-level histogram of the infrared image to be processed. Alternatively, the gray levels of the infrared image to be processed can be statistically analyzed first, and then gray-level filtering based on a gray-level threshold is performed on the gray-level histogram obtained by the gray-level statistics to obtain the source gray-level histogram of the infrared image to be processed. The gray-level threshold can be a preset gray-level threshold or can be adaptively determined according to the gray-level histogram obtained by the gray-level statistics.

[0062] Specifically, in an exemplary embodiment, obtaining the source gray-scale histogram of the infrared image to be processed may include: performing gray-scale statistics on the infrared image to be processed to obtain a first gray-scale histogram; sorting the statistical values of the first gray-scale histogram in descending order to obtain a second gray-scale histogram, and determining the cumulative distribution of the second gray-scale histogram; locating the target gray-scale value whose first cumulative distribution ratio is greater than or equal to a preset ratio threshold in the cumulative distribution, and determining the statistical value corresponding to the target gray-scale value in the second gray-scale histogram as the target gray-scale threshold; performing gray-scale level filtering on the second gray-scale histogram based on the target gray-scale threshold to obtain the source gray-scale histogram.

[0063] For example, gray-scale statistics may be performed on the infrared image to be processed to obtain a first gray-scale histogram H s ={h s (0), h s (1), …, h s (i), …, h s (L)}. Wherein, h s (i) represents the number of pixels with a gray-scale value equal to i; L is the maximum gray-scale value that can be represented in the gray-scale histogram. Assuming that the bit depth of the image data is n bits, then L = 2 n -1.

[0064] Next, the statistical values of the first gray-scale histogram H s may be sorted in descending order to obtain a second gray-scale histogram DH s , and then the cumulative distribution DF s of the second gray-scale histogram DH s may be determined using the following formula (1):

[0065]

[0066] Where k represents the gray-scale sequence number of the gray-scale histogram.

[0067] For each cumulative distribution value in the cumulative distribution DF s (k), such as the i-th cumulative distribution value DF s (i), the corresponding cumulative distribution ratio may be determined. Based on the respective cumulative distribution ratios, the gray-scale sequence number k s of the first cumulative distribution ratio greater than or equal to the preset ratio threshold P preset can be located in the cumulative distribution DF τ , that is, the target gray-scale value. Specifically, it can be expressed as the following formula (2):

[0068]

[0069] Where the preset ratio threshold P presetAn empirical value can be taken, such as 0.99.

[0070] Furthermore, the gray level sequence number k τ The corresponding statistical value can be determined as H s The target gray threshold τ, and this target gray threshold τ can be used as the threshold for filtering valid gray levels. Specifically, τ can be expressed by the following expression (3):

[0071] τ = DH s (k τ ) (3)

[0072] After obtaining the target gray threshold τ, based on this target gray threshold τ, the first gray histogram H s Can be filtered by gray levels using the following formula (4) to obtain the source gray histogram H v ={h v (0), h v (1), …, h v (L)}. Formula (4) can be expressed as:

[0073]

[0074] Among them, h s (k) represents the number of pixels with a gray value equal to k in the first gray histogram H s , and h v (k) represents the number of pixels with a gray value equal to k in the source gray histogram H v .

[0075] In this way, by further performing gray level filtering based on the target gray threshold on the first gray histogram obtained by gray level statistics of the infrared image to be processed, outliers can be filtered out, and the accuracy of the gray histogram can be improved. Moreover, the target gray threshold can be adaptively calculated and determined according to the first gray histogram, without involving the setting of the initial gray threshold, improving the accuracy of the target gray threshold, with strong adaptability, and the time complexity of the adaptive gray level filtering is only O(L·logL), with high time efficiency.

[0076] In an exemplary embodiment, before performing gray level statistics on the infrared image to be processed, the infrared image to be processed can be preprocessed first, such as at least one of non-uniform correction, bad pixel correction, and stripe noise correction, etc., to improve the quality of the image.

[0077] Exemplarily, the distribution feature information may include the average value of grayscale, or the distribution feature information may include the average value of grayscale, standard deviation, and skewness. After obtaining the source grayscale histogram, the grayscale segmentation point of the source grayscale histogram can be determined using the distribution feature information, and then the source grayscale histogram can be iteratively segmented using the grayscale segmentation point to obtain a set of target sub-histograms, and the segmented histogram segments are in the set of target sub-histograms. Since the original distribution characteristics of the source grayscale histogram are considered when determining the grayscale segmentation point, the grayscale range within each segmented histogram segment can belong to the same type of object.

[0078] Step 120: Perform probability density correction on each target sub-grayscale histogram in the set of target sub-histograms to obtain a weighted grayscale histogram.

[0079] Specifically, in one exemplary embodiment, step 120 may include: for each target sub-grayscale histogram in the set of target sub-histograms, determine the sum of probability densities of the target sub-grayscale histogram; perform weighted processing on the target sub-grayscale histogram based on the sum of probability densities to obtain a weighted grayscale sub-histogram corresponding to the target sub-grayscale histogram; and determine the weighted grayscale sub-histograms as the weighted grayscale histogram.

[0080] Exemplarily, for each target sub-grayscale histogram, after obtaining the corresponding weighted grayscale sub-histogram, the weighted grayscale sub-histogram can be normalized, and then the normalized weighted grayscale sub-histograms are determined as the weighted grayscale histogram.

[0081] Among them, performing weighted processing on the target sub-grayscale histogram based on the sum of probability densities to obtain a weighted grayscale sub-histogram corresponding to the target sub-grayscale histogram may include: for each grayscale value in the target sub-grayscale histogram, determine the weighted probability density of the grayscale value based on the number of pixels of the grayscale value, the maximum probability density, the minimum probability density, and the sum of probability densities; and perform normalization processing on the weighted probability densities of the grayscale values respectively to obtain a weighted grayscale sub-histogram corresponding to the target sub-grayscale histogram.

[0082] Specifically, for each grayscale value in the target sub-grayscale histogram, the first difference between the number of pixels of the grayscale value and the minimum probability density can be determined, and the second difference between the maximum probability density and the minimum probability density can be determined; obtain the ratio of the first difference to the second difference, and perform exponential weighting on the ratio using the sum of probability densities; and determine the product of the exponential weighting result and the maximum probability density as the weighted probability density corresponding to the grayscale value.

[0083] For example, for the i-th target sub-grayscale histogram H i , assume that the grayscale range of H i is [l min ,l max, then its probability density and β i can be expressed as the following formula (5)

[0084]

[0085] where h v (k) represents the number of pixels with gray value k in the target sub - gray - level histogram H i .

[0086] For the gray value k in the target sub - gray - level histogram H i , its weighted probability density h w (k) can be expressed as the following formula (6):

[0087]

[0088] where h vmin represents the minimum probability density, h vmax represents the maximum probability density, h v (k) represents the number of pixels with gray value k in the target sub - gray - level histogram H i .

[0089] After obtaining the weighted probability density h w (k), the following formula (7) can be used to normalize h w (k):

[0090]

[0091] Based on formula (7), after normalizing the weighted probability densities corresponding to each gray value in the target sub - gray - level histogram H i , the weighted gray - level histogram H w = {h w (0), h w (1), …, h w (L)} can be obtained.

[0092] Step 130: Fuse the source gray - level histogram and the weighted gray - level histogram to obtain the target gray - level histogram.

[0093] Exemplarily, the cumulative distribution of the source gray - level histogram can be used to fuse the source gray - level histogram and the weighted gray - level histogram, for example, an adaptive linear combination of the two can be performed. Specifically, step 130 may include: determining the cumulative distribution of the source gray - level histogram; fusing the source gray - level histogram and the weighted gray - level histogram based on the cumulative distribution to obtain the target gray - level histogram.

[0094] Exemplarily, for each gray value in the source gray - level histogram, the cumulative distribution probability of this gray value can be determined based on the following formula (8):

[0095]

[0096] Among them, c(k) represents the cumulative distribution probability corresponding to the gray value k in the source gray histogram, and h v (i) represents the number of pixels with the gray value i in the source gray histogram. After calculating the cumulative distribution probability of each gray value in the source gray histogram according to formula (8), the overall cumulative distribution of the source gray histogram can be obtained.

[0097] Furthermore, each gray value in the source gray histogram and the weighted gray histogram can be fused based on the following formula (9):

[0098]

[0099] Among them, h d (k) represents the number of pixels after fusing the gray value k, h v (k) represents the number of pixels with the gray value k in the source gray histogram H v in, h w (k) represents the number of pixels with the gray value k in the weighted gray histogram H w in.

[0100] After performing the fusion process on each gray value in the source gray histogram and the weighted gray histogram according to formula (9) as described above, the target gray histogram H d ={h d (0), h d (1), …, h d (L)} can be obtained.

[0101] Step 140: Determine the gray mapping curve of the target gray histogram, and perform gray mapping on the infrared image to be processed based on the gray mapping curve to obtain the contrast-enhanced image of the infrared image to be processed.

[0102] After obtaining the target gray histogram, the gray mapping curve can be constructed based on the cumulative distribution of the target gray histogram, and the gray mapping of the infrared image to be processed can be completed using this gray mapping curve, thereby realizing the contrast enhancement of the infrared image to be processed.

[0103] Specifically, the cumulative distribution of the target gray histogram can be determined according to the following formula (10):

[0104]

[0105] Among them, c d (k) represents the cumulative distribution probability of the gray value k in the target gray histogram, h d(i) represents the number of pixels with gray value i in the target gray histogram.

[0106] After determining the cumulative distribution probability of each gray value in the target gray histogram according to formula (10), the cumulative distribution F of the target gray histogram can be obtained. d , which can be expressed as F d = {c d (0), c d (1), …, c d (L)}.

[0107] After obtaining the cumulative distribution F of the target gray histogram d , the gray mapping curve can be constructed according to the following formula (11):

[0108]

[0109] where Curve(k) represents the gray mapping output of gray value k, c d (k) represents the cumulative distribution probability of gray value k, and L represents the maximum gray value that can be represented in the gray histogram.

[0110] The infrared image enhancement method provided by the embodiments of the present invention first obtains the source gray histogram of the infrared image to be processed, and iteratively segments the source gray histogram based on the distribution feature information of the source gray histogram to obtain a set of target sub-histograms; then performs probability density correction on each target sub-gray histogram in the set of target sub-histograms to obtain a weighted gray histogram; then fuses the source gray histogram and the weighted gray histogram to obtain a target gray histogram, and further determines the gray mapping curve of the target gray histogram, and performs gray mapping on the infrared image to be processed based on the gray mapping curve to obtain a contrast-enhanced image of the infrared image to be processed, realizing the contrast enhancement of the infrared image. Since the distribution feature information of the source gray histogram is utilized during the segmentation of the source gray histogram, that is, the original gray distribution characteristics of the infrared image are considered during the segmentation, the gray range within each target sub-gray histogram segmented can belong to the same type of object. Therefore, by correcting with the segmented target sub-gray histogram as a unit, the information loss in the infrared image can be effectively reduced, and the contrast enhancement effect of the infrared image is improved.

[0111] Based on Figure 1 the infrared image enhancement method of the corresponding embodiment, in an exemplary embodiment, Figure 2 an exemplary flow diagram of the method for iteratively segmenting the source gray histogram based on the distribution feature information of the source gray histogram is shown. This method can include the following steps 111 to 119.

[0112] Step 111: Determine the initial set of sub-histograms to be processed and the initial set of result sub-histograms corresponding to the current iteration number.

[0113] After obtaining the source gray-level histogram of the infrared image to be processed, the iteration number can be initialized to 0, and then the current iteration starts. In each iteration process, first determine the initial set of sub-histograms to be processed and the initial set of result sub-histograms corresponding to the current iteration number. Use the initial set of sub-histograms to be processed to save the sub-histograms to be segmented and processed in the current iteration, and use the initial set of result sub-histograms to save the sub-histograms that no longer need to be segmented.

[0114] Specifically, the initial value of the current iteration number is 0. When the current iteration number is 0, determine that the initial set of sub-histograms to be processed is the source gray-level histogram, and determine that the initial set of result sub-histograms is an empty set. When the current iteration number is greater than 0, update the initial set of sub-histograms to be processed to the target set of sub-histograms to be processed obtained after the previous iteration of the current iteration number, and update the initial set of result sub-histograms to the target set of result sub-histograms obtained after the previous iteration. In this way, after entering each round of iteration, the initial set of sub-histograms to be processed that needs to be processed and the initial set of result sub-histograms that do not need to be processed corresponding to the current iteration number can be determined.

[0115] For example, recur can be used to represent the current iteration number, and initialize the current iteration number recur = 0. denote the initial set of sub-histograms to be processed. denote the initial set of result sub-histograms. Then, when the current iteration number recur = 0, the initial set of sub-histograms to be processed corresponding to the current iteration number is The initial set of result sub-histograms corresponding to the current iteration number is where H v represents the source gray-level histogram. When the current iteration number recur > 0, the initial set of sub-histograms to be processed corresponding to the current iteration number is the target set of sub-histograms to be processed obtained after the (recur - 1)th iteration, and the initial set of result sub-histograms corresponding to the current iteration number is the target set of result sub-histograms obtained after the (recur - 1)th iteration.

[0116] Step 112: For each initial sub-histogram to be processed in the initial set of sub-histograms to be processed, determine whether the initial sub-histogram to be processed needs to be segmented.

[0117] In each iteration, after determining the initial set of sub-histograms to be processed, for each initial sub-histogram to be processed in the initial set of sub-histograms to be processed, it can be determined whether the initial sub-histogram to be processed needs to be split according to the joint discrimination condition of the current iteration number and the skewed distribution. In the case where it is determined that the initial sub-histogram to be processed does not need to be split, step 113 is executed; in the case where it is determined that the initial sub-histogram to be processed needs to be split, step 114 is executed.

[0118] Specifically, determining whether the initial sub-histogram to be processed needs to be split includes:

[0119] Determining whether the initial sub-histogram to be processed meets the joint discrimination condition of the current iteration number and the skewed distribution; in the case where the initial sub-histogram to be processed meets the joint discrimination condition of the current iteration number and the skewed distribution, it is determined that the initial sub-histogram to be processed needs to be split; in the case where the initial sub-histogram to be processed does not meet the joint discrimination condition of the current iteration number and the skewed distribution, it is determined that the initial sub-histogram to be processed does not need to be split.

[0120] Among them, the joint discrimination condition of the current iteration number and the skewed distribution includes an iteration number discrimination condition and a skewed distribution discrimination condition.

[0121] Exemplarily, for the skewed distribution discrimination condition, the skewed distribution can be determined based on the skewness. Specifically, the skewed distribution discrimination condition includes: when the absolute value of the skewness of the initial sub-histogram to be processed is greater than the preset skewness threshold, it is determined that the initial sub-histogram to be processed is a skewed distribution, otherwise it is a symmetric distribution.

[0122] Example, the iteration number discrimination condition can be designed based on the iteration number constraint interval composed of the preset minimum iteration number and the preset maximum iteration number. For example, the iteration number discrimination condition can include: when the current iteration number is less than the preset minimum iteration number, it is determined that splitting is required; when the current iteration number is greater than or equal to the preset minimum iteration number and less than the preset maximum iteration number, it is determined that conditional splitting is required; when the current iteration number is greater than or equal to the preset maximum iteration number, it is determined that splitting is not required.

[0123] Based on this, determining whether the initial sub-histogram to be processed satisfies the joint discrimination condition of the current iteration number and the skewed distribution may include: when it is determined based on the current iteration number that segmentation is required, or when it is determined based on the current iteration number that conditional segmentation is required and it is determined based on the skewed distribution discrimination condition that the distribution is skewed, determining that the initial sub-histogram to be processed satisfies the joint discrimination condition of the current iteration number and the skewed distribution; when it is determined based on the current iteration number that segmentation is not required, or when it is determined based on the current iteration number that conditional segmentation is required and it is determined based on the skewed distribution discrimination condition that the distribution is symmetric, determining that the initial sub-histogram to be processed does not satisfy the joint discrimination condition of the current iteration number and the skewed distribution.

[0124] Exemplarily, the skewness of the initial sub-histogram to be processed can be determined based on the mean and standard deviation of the initial sub-histogram to be processed. Specifically, for each initial sub-histogram H sub , the skewness of the initial sub-histogram H sub can be determined according to the following formula (12):

[0125]

[0126] where skew represents skewness, l max represents the maximum gray value of the sub-histogram to be processed, l min represents the minimum gray value of the sub-histogram to be processed, h sub (i) represents the number of pixels with gray value i in the sub-histogram to be processed, σ represents the standard deviation of the sub-histogram to be processed, and μ represents the mean of the sub-histogram to be processed.

[0127] Among them, the standard deviation σ can be determined according to the following formula (13):

[0128]

[0129] The mean μ can be determined according to the following formula (14):

[0130]

[0131] Step 113: Move the initial sub-histogram to be processed into the first set of result sub-histograms.

[0132] Among them, the initial state of the first set of result sub-histograms is the initial set of result sub-histograms, that is, after entering the current iteration, the first set of result sub-histograms can be initialized as the initial set of result sub-histograms determined in Step 111. The first set of result sub-histograms can store the sub-histograms that do not need to be segmented in this round of iteration.

[0133] Step 114: Move the initial sub-histogram to be processed into the first set of sub-histograms to be processed.

[0134] In the current iteration, the first set of sub-histograms to be processed can be initialized as an empty set. During the process of processing each initial sub-histogram to be processed in the initial set of sub-histograms to be processed, when it is determined that an initial sub-histogram to be processed needs to be segmented, the initial sub-histogram can be moved into the first set of sub-histograms to be processed, that is, the first set of sub-histograms to be processed stores the sub-histograms that still need to be further segmented.

[0135] Exemplarily, in combination with steps 112 to 114, it can be understood that in the current iteration, after determining the initial set of sub-histograms to be processed and the initial set of result sub-histograms, the first set of result sub-histograms and the first set of sub-histograms to be processed can be obtained based on the initial set of sub-histograms to be processed and the initial set of result sub-histograms. Specifically, it can include:

[0136] When the iteration number discrimination condition determines that segmentation is required, all sub-histograms in the initial set of sub-histograms to be processed are moved into the first set of sub-histograms to be processed;

[0137] When the iteration number discrimination condition determines that conditional segmentation is required, a skewness distribution condition discrimination is performed on each initial sub-histogram in the initial set of sub-histograms to be processed; if it is determined to be a skewed distribution, segmentation is required and it is moved into the first set of sub-histograms to be processed; if it is determined to be a symmetric distribution, segmentation is not required and it is moved into the first set of result sub-histograms;

[0138] When the iteration number discrimination condition is that segmentation is not required, the first set of sub-histograms to be processed is set as an empty set, and at the same time, all initial sub-histograms in the initial set of sub-histograms to be processed are moved into the first set of result sub-histograms.

[0139] For example, assume that the variable recur represents the current iteration number, represents the initial set of sub-histograms to be processed, represents the initial set of result sub-histograms, S′ proc represents the first set of sub-histograms to be processed, S′ res represents the first set of result sub-histograms, recur min represents the preset minimum iteration number, recur max represents the preset maximum iteration number, skew represents the skewness, τ skew represents the preset skewness threshold, and recur can be initialized to 0. In each round of iteration, it can be initialized Initialization Then there is:

[0140] If recur < recur min, move all sub-histograms in the initial sub-histogram set to be processed into the first sub-histogram set S' to be processed proc , that is

[0141] If recur min ≤recur < recur max , then for each initial sub-histogram H to be processed sub , that is, for it is possible to determine whether H sub needs to be split based on the skewness skew of H sub . Specifically, if |skew|≥τ skew , then it is considered that the initial sub-histogram H sub needs to be further split, and then H sub is moved into the first sub-histogram set S' to be processed proc , that is, there is S' proc = S' proc + {H sub}; otherwise, it is considered that H sub does not need to be split, and H sub is moved into the first result sub-histogram set S' res , that is, there is S' res = S' res + {H sub}.

[0142] If recur≥recur max , then the initial sub-histogram to be processed stops further splitting and is directly moved into the first result sub-histogram set S' res , that is, there is

[0143] Exemplarily, the preset minimum number of iterations, the preset maximum number of iterations, and the preset skewness threshold can be determined according to experience or experiments. For example, the preset minimum number of iterations can be 2, the preset maximum number of iterations can be 5, and the preset skewness threshold can be 0.5. In this way, limiting the number of iterative splits to at least 2 and at most 5 can avoid the premature end of iterative splitting when the overall grayscale histogram is symmetric left and right but the left and right parts are severely asymmetric locally, and at the same time can avoid continuous splitting within a small grayscale range.

[0144] Step 115: For each first sub-histogram in the first sub-histogram set to be processed, split the first sub-histogram based on the distribution feature information of the first sub-histogram, and move the split result into the second sub-histogram set.

[0145] For each first sub-histogram to be processed in the first set of sub-histograms to be processed, a grayscale segmentation point can be determined based on the distribution feature information of the first sub-histogram to be processed, and the first sub-histogram to be processed can be segmented using this grayscale segmentation point.

[0146] Exemplarily, the distribution feature information can include the mean, standard deviation, and skewness. Correspondingly, segmenting the first sub-histogram to be processed based on the distribution feature information of the first sub-histogram to be processed can include:

[0147] Based on the mean, standard deviation, and skewness of the first sub-histogram to be processed, determine the grayscale segmentation point of the first sub-histogram to be processed; segment the first sub-histogram to be processed using the grayscale segmentation point.

[0148] Exemplarily, the mean, standard deviation, and skewness of the first sub-histogram to be processed can be determined according to the above formulas (12) to (14), and then the grayscale segmentation point of the first sub-histogram to be processed can be determined according to the following formula (15):

[0149]

[0150] where, l seg represents the grayscale segmentation point, skew represents the skewness, σ represents the standard deviation, and μ represents the mean.

[0151] Assume that the grayscale interval of the first sub-histogram H sub is [l min , l max . After segmenting the first sub-histogram H seg using the grayscale segmentation point l sub , the segmentation intervals [l min , l seg and [l seg + 1, l max can be obtained, corresponding to the segmented sub-histograms H sub1 and H sub2 respectively. At this time, the segmented H sub1 and H sub2 can be moved into the second set of sub-histograms to be processed S″ proc , that is, S″ proc = S″ proc + {H sub1 , H sub2}.

[0152] Step 116: After traversing the initial set of sub-histograms to be processed, update the target set of sub-histograms to be processed to the second set of sub-histograms to be processed finally obtained in this round of iteration, update the target set of result sub-histograms to the first set of result sub-histograms finally obtained in this round of iteration, and increment the current iteration count by 1.

[0153] After traversing the set of initial sub-histograms to be processed, the set of target sub-histograms to be processed can be updated. It is the second set of sub-histograms to be processed S″ proc , update the set of target result sub-histograms It is the first set of result sub-histograms S′ res , update the current iteration count, that is: recur = recur + 1.

[0154] Among them, the set of target sub-histograms to be processed can store the sub-histograms that need to be further segmented after processing the set of initial sub-histograms to be processed, and can be used as the set of initial sub-histograms to be processed in the next iteration. The set of target result sub-histograms can store the sub-histograms that do not need to be further segmented after processing the set of initial sub-histograms to be processed, and can be used as the set of initial result sub-histograms in the next iteration.

[0155] Step 117: Determine whether the iteration ends.

[0156] Exemplarily, in the case where the set of target sub-histograms to be processed is an empty set, it is determined that the iteration ends. Or, in the case where the current iteration count is greater than the preset iteration count threshold, it is determined that the iteration ends.

[0157] In the case where the iteration ends, step 118 is executed; otherwise, step 119 is executed.

[0158] Step 118: Determine the finally obtained set of target result sub-histograms as the set of target sub-histograms.

[0159] In the case where the iteration ends, the finally obtained set of target result sub-histograms is determined as the set of target sub-histograms, and the set of target sub-histograms is output.

[0160] Step 119: Enter the next iteration.

[0161] In the case where the iteration does not end, enter the next iteration. The set of target sub-histograms to be processed obtained in this iteration can be used to update the set of initial sub-histograms to be processed in the next iteration The set of target result sub-histograms obtained in this iteration can be used to update the set of initial result sub-histograms in the next iteration That is Repeat steps 111 to 119 until the iteration ends, and the set of target sub-histograms can be obtained.

[0162] In an exemplary embodiment, after obtaining the source gray histogram of the infrared image to be processed, the source gray histogram may be first normalized to obtain the normalized source gray histogram, and then the normalized source gray histogram is iteratively segmented based on the distribution feature information of the normalized source gray histogram. That is, the above-mentioned H v may be the normalized source gray histogram.

[0163] For example, the source gray histogram can be converted into a probability density function according to the following formula (16) to realize the normalization processing of the source gray histogram. Formula (16) can be expressed as:

[0164]

[0165] where h v (i) represents the number of pixels corresponding to the gray value i in the source gray histogram; h v (k) on the right side of the formula represents the number of pixels corresponding to the gray value k in the source gray histogram; h v (k) on the left side of the formula represents the probability density of the gray value k, that is, the normalization result of h v (i).

[0166] The following combines Figure 3 and Figure 4 to further illustrate the infrared image enhancement method provided by the embodiments of the present invention. Taking the infrared image as a small target object in a large background as an example, Figure 3 exemplarily shows a schematic diagram of the segmentation effect of segmenting the source gray histogram with the average value as the segmentation point, Figure 4 exemplarily shows a schematic diagram of the segmentation effect of segmenting the source gray histogram with the segmentation point determined based on the average value, standard deviation and skewness. Referring to Figure 3 and Figure 4 , the source gray histogram corresponding to the infrared image shows a right-skewed distribution. Taking the number of iterations as 2 as an example, a complete source gray histogram can be divided into 4 segments. Among them, L11 is the gray segmentation point of the first segmentation histogram, and L21 and L22 are the gray segmentation points of the second segmentation histogram. It can be seen that the gray of the histogram is mainly concentrated in two regions, a large part is concentrated in the low-gray region, and a small part is concentrated in the high-gray region. The two regions can represent the background and the target object respectively.

[0167] According to Figure 3 's segmentation method, it has strong adaptability to the relatively symmetrical gray distribution on the left and right, but for such as Figure 3For the high-skewness distribution, the gray-scale segmentation point L11 calculated in the first iteration is located inside the low-gray-scale distribution region, which will divide the gray-scale belonging to one object into the gray-scale interval of another object, resulting in inaccurate segmentation results. Compared with Figure 3 Using the method of average value segmentation, according to Figure 4 , after correcting the average value using the standard deviation and skewness and then determining the gray-scale segmentation point for segmentation, the gray-scale segmentation point in the first iteration segmentation can accurately separate the low-gray-scale distribution region and the high-gray-scale distribution region, correcting the problem of poor adaptation to high-skewness distribution when using only the average value for segmentation, and further improving the accuracy of gray-scale histogram segmentation.

[0168] The infrared image enhancement method provided by the embodiments of the present invention can determine the gray-scale segmentation point based on the average value, standard deviation, and skewness of the source gray-scale histogram, and perform iterative segmentation on the source gray-scale histogram based on this gray-scale segmentation point. It can use the standard deviation and skewness to correct the average value, and has strong adaptability to both the gray-scale histogram with relatively symmetric left and right and the gray-scale histogram with high skewness. It can accurately perform gray-scale segmentation on the gray-scale histogram with high skewness, improving the accuracy of gray-scale histogram segmentation. Moreover, whether to further segment the sub-gray-scale histogram can be automatically ended through conditional judgment. When the skewness of the segmented sub-gray-scale histogram is less than the preset skewness threshold, it can be determined that the sub-gray-scale histogram is a gray-scale histogram with relatively symmetric left and right. At this time, it is considered that the gray-scale range within the sub-gray-scale histogram belongs to the same type of object and no further segmentation is performed. The number of iterations does not need to be set manually, but the sub-histogram to be processed that needs to be further segmented is adaptively determined based on the current iteration number and the skewness of the sub-gray-scale histogram, and the iterative segmentation ends when there is no sub-histogram to be processed for further segmentation, improving the self-adaptability of the iterative segmentation.

[0169] The infrared image enhancement device provided by the present invention will be described below. The infrared image enhancement device described below can be correspondingly referred to the infrared image enhancement method described above.

[0170] Figure 5 Exemplarily shows the structural schematic diagram of the infrared image enhancement device provided by the embodiments of the present invention. Refer to Figure 5As shown, the infrared image enhancement device may include: an acquisition module 510, configured to acquire the source gray histogram of the infrared image to be processed; a segmentation module 520, configured to perform iterative segmentation on the source gray histogram based on the distribution feature information of the source gray histogram to obtain a set of target sub-histograms; a correction module 530, configured to perform probability density correction on each target sub-gray histogram in the set of target sub-histograms to obtain a weighted gray histogram; a fusion module 540, configured to fuse the source gray histogram and the weighted gray histogram to obtain a target gray histogram; and a mapping module 550, configured to determine the gray mapping curve of the target gray histogram and perform gray mapping on the infrared image to be processed based on the gray mapping curve to obtain a contrast-enhanced image of the infrared image to be processed.

[0171] In an exemplary embodiment, the segmentation module 520 includes:

[0172] A first update unit, configured to, when the current iteration number is 0, determine that the initial set of sub-histograms to be processed is the source gray histogram and determine that the initial set of result sub-histograms is an empty set; the initial value of the current iteration number is 0; when the current iteration number is greater than 0, update the initial set of sub-histograms to be processed to the set of target sub-histograms to be processed obtained after the previous iteration of the current iteration number, and update the initial set of result sub-histograms to the set of target result sub-histograms obtained after the previous iteration.

[0173] A segmentation judgment unit, configured to determine, for each initial sub-histogram to be processed in the initial set of sub-histograms to be processed, whether the initial sub-histogram to be processed needs to be segmented.

[0174] A first segmentation processing unit, configured to, when the initial sub-histogram to be processed needs to be segmented, move the initial sub-histogram to be processed into the first set of sub-histograms to be processed.

[0175] A second segmentation processing unit, configured to, when the initial sub-histogram to be processed does not need to be segmented, move the initial sub-histogram to be processed into the first set of result sub-histograms, and the initial state of the first set of result sub-histograms is the initial set of result sub-histograms.

[0176] A segmentation unit, configured to, for each first sub-histogram to be processed in the first set of sub-histograms to be processed, perform segmentation on the first sub-histogram to be processed based on the distribution feature information of the first sub-histogram to be processed and move the segmentation result into the second set of sub-histograms to be processed.

[0177] A second update unit, after traversing the set of initial sub-histograms to be processed, updates the set of target sub-histograms to be processed to the set of second sub-histograms to be processed finally obtained in the current iteration, updates the set of target result sub-histograms to the set of first result sub-histograms finally obtained in the current iteration, and increments the current iteration count by 1;

[0178] An iterative processing unit is configured to determine whether the iteration ends, and in the case where the iteration ends, determine the set of target result sub-histograms finally obtained as the set of target sub-histograms; in the case where the iteration does not end, enter the next iteration.

[0179] In an exemplary embodiment, the segmentation determination unit is specifically configured to: determine whether the initial sub-histogram to be processed satisfies the joint discrimination condition of the current iteration count and the skewed distribution; in the case where the initial sub-histogram to be processed satisfies the joint discrimination condition of the current iteration count and the skewed distribution, determine that the initial sub-histogram to be processed needs to be segmented; in the case where the initial sub-histogram to be processed does not satisfy the joint discrimination condition of the current iteration count and the skewed distribution, determine that the initial sub-histogram to be processed does not need to be segmented.

[0180] In an exemplary embodiment, the distribution feature information includes an average value, a standard deviation, and a skewness; correspondingly, the segmentation unit may be specifically configured to: determine a gray-level segmentation point of the first sub-histogram to be processed based on the average value, the standard deviation, and the skewness of the first sub-histogram to be processed; segment the first sub-histogram to be processed using the gray-level segmentation point.

[0181] In an exemplary embodiment, the segmentation module 520 further includes an iteration end determination module, configured to determine that the iteration ends when the set of initial sub-histograms to be processed is empty.

[0182] In an exemplary embodiment, the acquisition module 510 includes: a statistics unit, configured to perform gray-level statistics on the infrared image to be processed to obtain a first gray-level histogram; a sorting unit, configured to sort the statistical values of the first gray-level histogram in descending order to obtain a second gray-level histogram, and determine the cumulative distribution of the second gray-level histogram; a first determination unit, configured to locate a target gray-level value in the cumulative distribution whose cumulative distribution ratio is greater than or equal to a preset ratio threshold, and determine the statistical value corresponding to the target gray-level value in the second gray-level histogram as the target gray-level threshold; a filtering unit, configured to perform gray-level filtering on the second gray-level histogram based on the target gray-level threshold to obtain a source gray-level histogram.

[0183] In an exemplary embodiment, the correction module 530 includes: a second determination unit configured to determine, for each target sub-gray histogram in the target sub-histogram set, the sum of probability densities of the target sub-gray histogram; a weighting unit configured to perform a weighting process on the target sub-gray histogram based on the sum of probability densities to obtain a weighted gray sub-histogram corresponding to the target sub-gray histogram; and a third determination unit configured to determine each weighted gray sub-histogram as a weighted gray histogram.

[0184] In an exemplary embodiment, the fusion module 540 includes: a fourth determination unit configured to determine the cumulative distribution of the source gray histogram; and a fusion unit configured to fuse the source gray histogram and the weighted gray histogram based on the cumulative distribution to obtain a target gray histogram.

[0185] Figure 6 FIG. illustrates a schematic structural diagram of an electronic device, as Figure 6 shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630, and a communication bus 640. Among them, the processor 610, the communication interface 620, and the memory 630 complete mutual communication through the communication bus 640. The processor 610 may call logical instructions in the memory 630 to execute the infrared image enhancement method provided in any of the above method embodiments.

[0186] In addition, when the logical instructions in the above-mentioned memory 630 are implemented in the form of a software functional unit and sold or used as an independent product, they may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc that can store program codes.

[0187] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the infrared image enhancement method provided in each of the above method embodiments.

[0188] In another aspect, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is configured to execute the infrared image enhancement method provided in any of the above method embodiments.

[0189] Exemplarily, the computer-readable storage medium includes a non-transitory computer-readable storage medium.

[0190] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative labor.

[0191] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disc, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0192] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An infrared image enhancement method, characterized in that, Including: Obtain the source gray histogram of the infrared image to be processed, and perform iterative segmentation on the source gray histogram based on the distribution feature information of the source gray histogram to obtain a set of target sub-histograms; Perform probability density correction on each target sub-gray histogram in the set of target sub-histograms to obtain a weighted gray histogram; Fuse the source gray histogram and the weighted gray histogram to obtain a target gray histogram; Determine the gray mapping curve of the target gray histogram, and perform gray mapping on the infrared image to be processed based on the gray mapping curve to obtain the contrast-enhanced image of the infrared image to be processed.

2. The infrared image enhancement method according to claim 1, characterized in that, The iterative segmentation of the source gray histogram based on the distribution feature information of the source gray histogram to obtain a set of target sub-histograms includes: When the current iteration number is 0, determine that the initial sub-histogram set to be processed is the source gray histogram, and determine that the initial result sub-histogram set is an empty set; the initial value of the current iteration number is 0; When the current iteration number is greater than 0, update the initial sub-histogram set to be processed to the target sub-histogram set to be processed obtained after the previous iteration of the current iteration number, and update the initial result sub-histogram set to the target result sub-histogram set obtained after the previous iteration; For each initial sub-histogram to be processed in the initial sub-histogram set to be processed, determine whether the initial sub-histogram to be processed needs to be segmented; When the initial sub-histogram to be processed needs to be segmented, move the initial sub-histogram to be processed into the first sub-histogram set to be processed; When the initial sub-histogram to be processed does not need to be segmented, move the initial sub-histogram to be processed into the first result sub-histogram set, and the initial state of the first result sub-histogram set is the initial result sub-histogram set; For each first sub-histogram to be processed in the first sub-histogram set to be processed, segment the first sub-histogram to be processed based on the distribution feature information of the first sub-histogram to be processed, and move the segmentation result into the second sub-histogram set to be processed; After traversing the initial sub-histogram set to be processed, update the target sub-histogram set to be processed to the second sub-histogram set to be processed finally obtained in this round of iteration, update the target result sub-histogram set to the first result sub-histogram set finally obtained in this round of iteration, and increment the current iteration number by 1; Judge whether the iteration ends, and when the iteration ends, determine the finally obtained target result sub-histogram set as the set of target sub-histograms; when the iteration does not end, enter the next round of iteration.

3. The infrared image enhancement method according to claim 2, characterized in that, The determination of whether the initial sub-histogram to be processed needs to be segmented includes: Determine whether the initial sub-histogram to be processed satisfies the joint discrimination condition of the current iteration number and the skewed distribution; When the initial sub-histogram to be processed satisfies the joint discrimination condition of the current iteration number and the skewed distribution, determine that the initial sub-histogram to be processed needs to be segmented; In the case that the initial sub-histogram to be processed does not satisfy the joint discrimination condition of the current iteration number and the skewed distribution, it is determined that the initial sub-histogram to be processed does not need to be segmented.

4. The infrared image enhancement method according to claim 2, characterized in that, The distribution feature information includes the mean, standard deviation, and skewness; the segmenting the first sub-histogram to be processed based on the distribution feature information of the first sub-histogram to be processed includes: Based on the mean, the standard deviation, and the skewness of the first sub-histogram to be processed, determining a gray-level segmentation point of the first sub-histogram to be processed; Using the gray-level segmentation point to segment the first sub-histogram to be processed.

5. The infrared image enhancement method according to any one of claims 1 to 4, characterized in that, The obtaining the source gray-level histogram of the infrared image to be processed includes: Performing gray-level statistics on the infrared image to be processed to obtain a first gray-level histogram; Sorting the statistical values of the first gray-level histogram in descending order to obtain a second gray-level histogram, and determining the cumulative distribution of the second gray-level histogram; Locating a target gray-level value in the cumulative distribution whose cumulative distribution ratio is greater than or equal to a preset ratio threshold, and determining the statistical value corresponding to the target gray-level value in the second gray-level histogram as the target gray-level threshold; Based on the target gray-level threshold, performing gray-level filtering on the second gray-level histogram to obtain the source gray-level histogram.

6. The infrared image enhancement method according to any one of claims 1 to 4, characterized in that, The performing probability density correction on each target sub-gray-level histogram in the set of target sub-histograms to obtain a weighted gray-level histogram includes: For each target sub-gray-level histogram in the set of target sub-histograms, determining the sum of the probability densities of the target sub-gray-level histogram; Based on the sum of the probability densities, performing weighted processing on the target sub-gray-level histogram to obtain a weighted sub-gray-level histogram corresponding to the target sub-gray-level histogram; Determining each of the weighted sub-gray-level histograms as the weighted gray-level histogram.

7. The infrared image enhancement method according to any one of claims 1 to 4, characterized in that, The fusing the source gray-level histogram and the weighted gray-level histogram to obtain a target gray-level histogram includes: Determining the cumulative distribution of the source gray-level histogram; Based on the cumulative distribution, fusing the source gray-level histogram and the weighted gray-level histogram to obtain a target gray-level histogram.

8. An infrared image enhancement device, characterized in that, including: An obtaining module, configured to obtain a source gray-level histogram of an infrared image to be processed; A segmentation module, configured to iteratively segment the source gray-level histogram based on the distribution feature information of the source gray-level histogram to obtain a set of target sub-histograms; A correction module, configured to perform probability density correction on each target sub-gray-level histogram in the set of target sub-histograms to obtain a weighted gray-level histogram; A fusion module, configured to fuse the source gray-level histogram and the weighted gray-level histogram to obtain a target gray-level histogram; A mapping module, configured to determine a gray-level mapping curve of the target gray-level histogram, and perform gray-level mapping on the infrared image to be processed based on the gray-level mapping curve to obtain a contrast-enhanced image of the infrared image to be processed.

9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the infrared image enhancement method according to any one of claims 1 to 7.

10. A computer-readable storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by a processor, it implements the infrared image enhancement method according to any one of claims 1 to 7.