A shipborne video dehazing method based on dual histogram equalization
By defogging the ship-based video based on dual histogram equalization, the problem of excessive enhancement of bright areas and insufficient enhancement of dark areas in the existing technology is solved, and better defogging effect and fidelity are achieved.
Patent Information
- Application Number
- CN202111517989.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2041-12-13
AI Technical Summary
In the prior art, the high-speed fog removal method is excessively enhanced in the bright area and insufficiently enhanced in the dark area, resulting in poor defog removal effect.
The histogram is processed by a ship-based video defogging method based on dual histogram equalization. The histogram is processed by means normalization processing, gamma correction and setting the over-enhanced threshold T, and the histogram is divided into two sub-histograms based on the median pixels, and calculated and mapped respectively to obtain the video image after defogging.
It effectively avoids the situation where the bright area and the dark area are enhanced at the same time, enhances the distinction of the dark area, highlights the ship's target objects, and is suitable for ship-based platforms with large bright areas, and significantly improves the fog removal effect.
Smart Images

Figure CN114359121B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image defogging, and more specifically, relates to a shipborne video defogging method based on dual histogram equalization. Background Art
[0002] In recent years, the information construction of my country's navy has been accelerated, and higher requirements have been put forward for shipborne video transmission and processing technology. The air humidity on the sea surface is high, and fog is easily generated, which causes serious degradation of the video images collected by monitoring equipment, making the crew's visual navigation information inaccurate, and directly restricting and affecting the identification and tracking of outdoor targets and military reconnaissance. In order to improve the safety of ship navigation and enhance the visual information of the crew, there is an urgent need for theoretical and practical research on real-time defogging of shipborne video images.
[0003] According to the knowledge known in this field, there are three methods and architectures for shipborne video dehazing research at home and abroad:
[0004] The first is the contrast enhancement algorithm architecture, including histogram equalization, wavelet transform, curvelet transform, etc. Histogram equalization is the most classic image contrast enhancement algorithm, and many improved algorithms have been derived, such as local histogram equalization, double histogram equalization BBHE, etc. The algorithm is simple, the calculation amount is not large, and it is easy to meet real-time requirements.
[0005] The second is an enhancement algorithm based on Retinex theory, which is a model that describes color constancy and has the characteristics of dynamic range compression and color invariance, but its parameters are difficult to adjust and the amount of calculation is huge.
[0006] The third is the dark channel prior method, which restores the image by finding dark channel pixels in fog-free areas and calculating the refractive index based on the dark channel pixels. This method tends to make the restored image brighter overall and is not suitable for shipborne videos.
[0007] Therefore, it is extremely necessary to propose an image dehazing method suitable for the characteristics of heavy fog and high brightness in shipborne videos. Summary of the invention
[0008] In view of the defects of the prior art, the purpose of the present invention is to provide a shipborne video defogging method based on dual histogram equalization, aiming to solve the problem that the high-speed defogging method in the prior art has poor defogging effect due to excessive enhancement of bright areas and insufficient enhancement of dark areas.
[0009] The present invention provides a shipborne video defogging method based on dual histogram equalization, comprising the following steps:
[0010] S1: Perform mean normalization on the histogram of the input image;
[0011] S2: Perform gamma correction on the part of the normalized histogram that is less than 1, and limit the larger histogram data by setting the over-enhancement threshold T to reduce the influence of the largest number of pixels in the histogram and prevent over-enhancement;
[0012] Among them, the gamma value is less than 1, and T is greater than 1;
[0013] S3: Calculate the median pixel of the input image histogram, and divide the original histogram into left and right sub-histograms according to the median pixel;
[0014] S4: Calculate the grayscale distribution probability histograms of the left and right sub-histograms respectively;
[0015] S5: Calculate the cumulative distribution histogram of the left and right sub-histograms;
[0016] S6: The left and right mapping tables are combined to obtain a final mapping table, and the original image is mapped according to the mapping table to obtain a defogged shipborne video image.
[0017] Furthermore, in step S1, according to the formula Perform mean normalization on the histogram of the input image; where i is an integer representing the grayscale level, h(i) is the histogram of the original input image, L is an integer representing the total number of grayscale levels, N is the total number of pixels, and h m (i) is the histogram after mean normalization.
[0018] Furthermore, in step S2, according to the formula Gamma correction is performed on the part of the normalized histogram that is less than 1; where h g (i) is the histogram after gamma correction.
[0019] Furthermore, in step S2, according to the formula Limits larger histogram data.
[0020] Furthermore, in step S4, according to the formula and Calculate the grayscale distribution probability histogram p of the left and right subhistograms respectively L (i) and p R(i) ; Among them, N L and N R Respectively represent the total number of pixels of the left and right sub-histograms, L represents the total number of gray levels of the image, G median is the median pixel.
[0021] Furthermore, in step S5, according to the formula and Calculate the cumulative distribution histograms cdf of the left and right sub-histograms L(i) and cdf L(i) .
[0022] Furthermore, in step S6, according to the formula tab L (i) = round(G median ×cdf L (i)), 0 ≤ i ≤ G medin and tab R (i) = round(G median +1+(L - G meadian -2)×cdf R (i)), G medin < i ≤ L - 1 calculate the left and right mapping tables tab L (i) and tab R (i), and according to the formula tab = tab L ∪tab R to merge the left and right mapping tables to obtain the final mapping table; where, round represents rounding to the nearest integer.
[0023] The shipborne video dehazing method based on double histogram equalization of the present invention, compared with the traditional double histogram equalization algorithm, first performs gamma correction on the part less than 1 in the normalized histogram, and limits the larger histogram data by setting the over-enhancement threshold T, reducing the influence of the pixels with the largest number in the histogram, facilitating the accuracy of further histogram segmentation. Secondly, by dividing the original histogram into left and right sub-histograms according to the median pixel, the ship target in the shipborne video is尽可能分在左直方图,也就是暗区,海面及天空等高亮目标尽可能分在右直方图,也就是亮区,能够更好的分割直方图,分别增强图像的亮区和暗区,限制过亮区域的增强,避免过度增强的问题,更多增强暗区,使得视频暗区与亮区区分度更大,更加突出舰船目标物,更适用于视频高亮区域大的舰载平台。 Brief Description of the Drawings
[0024] Figure 1 is the implementation flowchart of the shipborne video dehazing method based on double histogram equalization provided by the embodiment of the present invention. Detailed Embodiments
[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0026] It should be noted that there is an unclear expression in the original text: "舰船目标物尽可能的分在左直方图,也就是暗区,海面及天空等高亮目标尽可能分在右直方图,也就是亮区". I have tried my best to translate it according to the context, but it may need to be adjusted according to the accurate meaning.The invention provides an image defogging method suitable for shipborne videos with heavy fog and high brightness. The method has the characteristics of strong defogging ability and high fidelity and is suitable for shipborne videos to defog.
[0027] like Figure 1 As shown, the shipborne video defogging method based on dual histogram equalization proposed in the present invention includes the following steps:
[0028] S1: Perform mean normalization on the histogram of the input image;
[0029] S2: Perform gamma correction on the part of the normalized histogram that is less than 1, and limit the larger histogram data by setting the over-enhancement threshold T to reduce the influence of the largest number of pixels in the histogram and prevent over-enhancement;
[0030] Among them, the gamma value is less than 1, and T is greater than 1;
[0031] S3: Calculate the median pixel of the input image histogram, and divide the original histogram into left and right sub-histograms according to the median pixel;
[0032] S4: Calculate the grayscale distribution probability histograms of the left and right sub-histograms respectively;
[0033] S5: Calculate the cumulative distribution histogram of the left and right sub-histograms;
[0034] S6: The left and right mapping tables are combined to obtain a final mapping table, and the original image is mapped according to the mapping table to obtain a defogged shipborne video image.
[0035] The present invention firstly performs gamma correction on the part less than 1 in the normalized histogram, and sets an over-enhancement threshold T to limit the larger histogram data, thereby reducing the influence of the largest number of pixels in the histogram, and facilitating the accuracy of further segmenting the histogram. Secondly, the original histogram is divided into two sub-histograms, left and right, according to the median pixel, so that the ship target in the shipborne video is divided into the left histogram as much as possible, that is, the dark area, and the high-brightness targets such as the sea surface and the sky are divided into the right histogram as much as possible, that is, the bright area. The present invention avoids the situation where the bright area and the dark area are enhanced at the same time and in the same proportion, which will result in insufficient enhancement of the dark area of the video and excessive enhancement of the bright area. Thereby, the fidelity is enhanced, the dark area is highlighted, and a better enhancement effect is achieved.
[0036] In step S1, the histogram of the input image is normalized by the mean, that is, the histogram is divided by the total number of pixels N and then multiplied by the grayscale level of the image. The mean normalization formula is as follows, where h iis the histogram of the original input image, L is the number of gray levels, N is the total number of pixels, i is the specific gray level, h m (i) is the histogram after mean normalization:
[0037] In step S2, gamma correction is performed on the part of the normalized histogram that is less than 1. The gamma value is a number less than 1. The smaller the value, the better the protection of details. The formula for gamma correction is as follows: g (i) is the histogram after gamma correction:
[0038]
[0039] And limit the larger histogram data, set the over-enhancement threshold T, T is greater than 1, mainly to reduce the influence of the largest number of pixels in the histogram and prevent over-enhancement. The formula is as follows:
[0040]
[0041] In the histogram calculation process, the present invention aims at the characteristic that a large number of regional pixels of shipborne video are the same. After histogram normalization and gamma correction, the larger histogram data is restricted, T takes a number greater than 1, and the influence of the largest number of pixels in the histogram is reduced to prevent over-enhancement.
[0042] In step S3, the median pixel G of the input image histogram is calculated median There are L pixel values in the histogram. Arrange the L pixel values from small to large and take the median, which is recorded as the median pixel G. median , then according to the median pixel G median The original histogram is divided into two sub-histograms, left and right, with pixel values greater than or equal to 0 and less than or equal to the median pixel G. median In the left subhistogram, the pixel value is greater than the median pixel G median In the right subhistogram.
[0043] After the present invention restricts the histogram data, because the shipborne image histogram is usually concentrated in certain segments, the median pixel of the input image histogram is calculated, and the original histogram is divided into two left and right sub-histograms according to the median pixel to retain more details.
[0044] In step S4, the grayscale distribution probability histograms p of the left and right sub-histograms are calculated respectively. L(i) and p R(i) , N L and N R Respectively represent the total number of pixels of the left and right sub-histograms, L represents the total number of gray levels of the image, and the specific calculation formula is as follows:
[0045] In step S5, the cumulative distribution histogram cdf of the left and right subhistograms is calculated L(i) and cdf L(i) , the specific calculation formula is:
[0046]
[0047]
[0048] In step S6, the left and right mapping tables tab are calculated L (i) and tab R (i) After merging, the final mapping table tab is obtained, where round represents rounding. The specific formula is:
[0049] tab L (i) = round (G median ×cdf L (i)),i∈[0,G meadian ]……(7)
[0050] tab R (i) = round (G median +1+(LG meadian -2)×cdf R (i)),i∈[0,G meadian ]……(8)
[0051] tab=tab L ∪tab R ……(9)
[0052] And the original image is mapped according to the mapping table to obtain the dehazed image.
[0053] Compared with the traditional dual histogram equalization algorithm, the shipborne video defogging method based on dual histogram equalization provided by the present invention can better segment the histogram, enhance the bright and dark areas of the image respectively, limit the enhancement of the over-bright area, avoid the problem of over-enhancement, and is more suitable for shipborne platforms with large video highlight areas.
[0054] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A shipborne video defogging method based on dual histogram equalization, characterized in that: The steps include: S1: Perform mean normalization on the histogram of the input image; S2: Perform gamma correction on the part of the normalized histogram that is less than 1, and limit the larger histogram data by setting the over-enhancement threshold T to reduce the influence of the largest number of pixels in the histogram and prevent over-enhancement; Among them, the gamma value is less than 1, and T is greater than 1; S3: Calculate the median pixel of the input image histogram, and divide the original histogram into left and right sub-histograms according to the median pixel; S4: Calculate the grayscale distribution probability histograms of the left and right sub-histograms respectively according to the gamma-corrected histogram and the total number of pixels of the left and right sub-histograms; S5: Calculate the cumulative distribution histograms of the left and right sub-histograms according to the grayscale distribution probability histograms of the left and right sub-histograms; S6: Calculate the left and right mapping tables according to the cumulative distribution histograms of the left and right sub-histograms, merge the left and right mapping tables to obtain a final mapping table, and map the original image according to the mapping table to obtain a defogged shipborne video image.
2. The shipborne video defogging method according to claim 1, characterized in that: In step S1, according to the formula Perform mean normalization on the histogram of the input image; Where i is an integer representing the grayscale level, h(i) is the histogram of the original input image, L is an integer representing the total number of grayscale levels, N is the total number of pixels, and h m (i) is the histogram after mean normalization.
3. The shipborne video defogging method according to claim 1, characterized in that: In step S2, according to the formula Perform gamma correction on the part of the normalized histogram that is less than 1; Among them, h g (i) is the histogram after gamma correction.
4. The shipborne video defogging method according to any one of claims 1 to 3, characterized in that: In step S2, according to the formula Limits the size of the larger histogram data.
5. The shipborne video defogging method according to claim 4, characterized in that: In step S4, according to the formula and Calculate the grayscale distribution probability histogram p of the left and right subhistograms respectively L (i) and p R(i) ; Among them, N L and N R Respectively represent the total number of pixels of the left and right sub-histograms, L represents the total number of gray levels of the image, G median is the median pixel.
6. The shipborne video defogging method according to claim 5, characterized in that: In step S5, according to the formula and Calculate the cumulative distribution histogram cdf of the left and right subhistograms L(i) and cdf L(i) .
7. The shipborne video defogging method according to claim 6, characterized in that: In step S6, according to the formula tab L (i) = round(G median ×cdf L (i)), 0 ≤ i ≤ G medin and tab R (i) = round(G median +1+(L - G meadian -2)×cdf R (i)), G medin < i ≤ L - 1, calculate the left and right mapping tables tab L (i) and tab R (i), and according to the formula tab = tab L ∪tab R to merge the left and right mapping tables to obtain the final mapping table; Among them, round means rounding to the nearest integer.
Citation Information
Patent Citations
Adaptive histogram reinforced defogging method based on dark channel
CN105225210A
An adaptive dynamic double histogram equalization method
CN109035182A