Image enhancement method based on histogram equalization

Through the image enhancement method based on histogram equalization, the grayscale information of haze images is processed, and the problems of poor clarity improvement effect and high computing power occupancy in the prior art are solved, and the efficient and real-time fog-transmissive processing of the image is achieved. Maintain image detail and brightness stability.

CN119205519APending Publication Date: 2024-12-27TIANJIN TIANDY DIGITAL TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411370220.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The prior art has poor clarity improvement effect when processing haze images, and consumes high computing power in embedded devices, which cannot meet real-time requirements.

Method used

The image enhancement method based on histogram equalization is adopted to improve the contrast and clarity of the image and maintain detailed information by generating grayscale histograms, segmentation processing, peak cutting, normalization, generating gamma mapping curves and performing mapping processing.

Benefits of technology

It effectively improves the contrast and clarity of the image, retains image details, makes the image after fog more realistic and natural, and realizes real-time processing on embedded devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119205519A_ABST
    Figure CN119205519A_ABST
Patent Text Reader

Abstract

The invention relates to an image enhancement method based on histogram equalization. The method comprises the following steps: step 1, generating a gray histogram of an original haze image; step 2, carrying out segmentation processing on the grey level histogram of the haze image generated in the step 1; step 3, carrying out peak clipping processing on the segmented gray level histogram to obtain a reconstructed gray level histogram; step 4, performing normalization processing on the reconstructed gray level histogram to obtain probability histograms of a bright area and a dark area; step 5, generating a gamma mapping curve based on the probability histograms of the areas and the dark areas obtained in the step 4; and step 6, if the image meets the foggy condition, performing mapping processing on the original haze image by using the fused gamma mapping curve obtained in the step 5 to obtain a clear haze image. Otherwise, normal gamma in the equipment is used for processing. According to the invention, the image fog penetration effect can be improved, and the definition of image details is kept.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image processing and relates to an image enhancement method, in particular to an image enhancement method based on histogram equalization. Background Art

[0002] In the natural environment, foggy weather will have a serious impact on the images captured by the camera, resulting in unclear images and unclear details. The technical means to solve this problem mainly include fog penetration algorithms and image enhancement algorithms.

[0003] At present, most fog-penetrating algorithms on the market are based on a single image, and mainly use methods such as color correction and contrast enhancement to improve the clarity of the image. However, these methods often have poor effects on extracting image details, resulting in the loss of a lot of important information in the fog-penetrating process. In addition, due to the constraints of computing power and memory in embedded devices, algorithms that consume a lot of computing power and occupy a lot of memory cannot meet the real-time requirements of monitoring scenes.

[0004] Therefore, the present invention proposes an image enhancement method based on histogram equalization.

[0005] After searching, no public documents of the prior art identical or similar to the present invention were found. Summary of the invention

[0006] The purpose of the present invention is to overcome the shortcomings of the prior art and propose an image enhancement method based on histogram equalization to improve the image fog penetration effect and maintain the clarity of image details.

[0007] The present invention solves the practical problem by adopting the following technical solutions:

[0008] An image enhancement method based on histogram equalization comprises the following steps:

[0009] Step 1, generating a grayscale histogram of the original haze image;

[0010] Step 2: Segment the grayscale histogram of the haze image generated in step 1;

[0011] Step 3, performing peak clipping on the segmented grayscale histogram to obtain a reconstructed grayscale histogram;

[0012] Step 4: normalize the reconstructed grayscale histogram to obtain probability histograms of bright and dark areas;

[0013] Step 5: Generate a gamma mapping curve based on the probability histogram of the area and the dark area obtained in step 4;

[0014] Step 6: If the image meets the foggy condition, the original haze image is mapped using the fused gamma mapping curve obtained in step 5 to obtain a clear haze image. Otherwise, the normal gamma processing in the device is used.

[0015] Moreover, the specific method of step 1 is:

[0016] Read the original haze yuv image, and use the y component in the original haze yuv image to calculate and generate the grayscale histogram of the haze image.

[0017] Moreover, the specific method of step 2 is:

[0018] The grayscale histogram of the haze image generated in step 1 is segmented using the average brightness of the image as the segmentation point Dx;

[0019] The calculation formula of Dx is:

[0020] Lum_all=i*hist(i), pix_all=hist(1)+hist(2)+...hist(256), Dx=Lum_all / pix_all.

[0021] Where Lum_all is the total brightness, pix_all is the total number of pixels, hist is the histogram distribution function, and Dx is the segmentation point position.

[0022] Moreover, the specific method of step 3 is:

[0023] The segmented histogram is subjected to peak clipping, and the contrast changes of dark and bright areas can be limited respectively after peak clipping; given a threshold th = pix_all / Dx / 2; peak clipping is:

[0024]

[0025] Then the reconstructed grayscale histogram hist_new is obtained.

[0026] Moreover, the specific method of step 4 is:

[0027] The reconstructed grayscale histogram hist_new is normalized to obtain the probability histograms of the bright and dark areas:

[0028] pdf(z)=hist_new(i) / piX_all

[0029] Among them, Hist_new is the reconstructed histogram, pix_all is the total number of pixels in the reconstructed histogram, and pdf is the probability histogram of the reconstructed histogram.

[0030] Moreover, the specific steps of step 5 include:

[0031] (1) Based on the probability histograms of bright and dark areas obtained in step 4, generate the cdf of the cumulative probability histogram;

[0032]

[0033] (2) The cdf curve is fused with the gamma function to obtain a fused gamma mapping curve.

[0034] Advantages and beneficial effects of the present invention:

[0035] 1. The present invention proposes an image enhancement method based on histogram equalization, which effectively improves the contrast and clarity of the image by equalizing the grayscale information of the image. Compared with the traditional fog penetration algorithm, the present invention can better retain the detailed information of the image, making the image after fog penetration more real and natural.

[0036] 2. When performing fog penetration processing, the present invention does not want the brightness of the picture to change significantly, so the present invention introduces the average brightness of the picture as a segmentation point, and divides the histogram into a dark area histogram and a bright area histogram for separate processing, which is beneficial to ensure the stability of the brightness of the picture.

[0037] 3. In the process of fog penetration, the present invention does not want to brighten the bright area of ​​the picture and suppress the dark area too dark. Therefore, the present invention restricts the change of the curve by clipping the peak of the histogram and reconstructing it to ensure the stability of the picture brightness.

[0038] 4. The present invention fuses the final mapping curve with the gamma curve used in the device, which can adjust the contrast of the picture in real time according to the scene and reduce the loss of picture details. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 is a process flow chart of the present invention;

[0040] Figure 2 It is a schematic diagram of the segmentation points of the present invention;

[0041] Figure 3 is a schematic diagram of the fused gamma mapping curve of the present invention;

[0042] Figure 4 1 is the verification result diagram of the outdoor foggy scene of the present invention (I);

[0043] Figure 5 This is the verification result diagram (2) of the outdoor foggy scene of the present invention. DETAILED DESCRIPTION

[0044] The embodiments of the present invention are further described in detail below with reference to the accompanying drawings:

[0045] An image enhancement method based on histogram equalization, such as Figure 1 As shown, the following steps are included:

[0046] Step 1, generating a grayscale histogram of the original haze image;

[0047] The specific method of step 1 is:

[0048] Read the original haze yuv image, and use the y component in the original haze yuv image to calculate and generate the grayscale histogram of the haze image.

[0049] Step 2: Segment the grayscale histogram of the haze image generated in step 1;

[0050] The specific method of step 2 is:

[0051] The grayscale histogram of the haze image generated in step 1 is segmented using the average brightness of the image as the segmentation point Dx;

[0052] The calculation formula of Dx is:

[0053] Lum_all=i*hist(i), pix_all=hist(1)+hist(2)+...hist(256), Dx=Lum_all / pix_all.

[0054] Where Lum_all is the total brightness, pix_all is the total number of pixels, hist is the histogram distribution function, and Dx is the segmentation point position.

[0055] Step 3, performing peak clipping on the segmented grayscale histogram to obtain a reconstructed grayscale histogram;

[0056] The specific method of step 3 is:

[0057] like Figure 2 As shown, the segmented histogram is subjected to peak clipping, and after peak clipping, the contrast changes of dark and bright areas can be limited respectively; a threshold th=pix_all / Dx / 2 is given; peak clipping is:

[0058]

[0059] Then the reconstructed grayscale histogram hist_new is obtained.

[0060] Step 4: normalize the reconstructed grayscale histogram to obtain probability histograms of bright and dark areas;

[0061] The specific method of step 4 is:

[0062] The reconstructed grayscale histogram hist_new is normalized to obtain the probability histograms of the bright and dark areas:

[0063] pdf(z)=hist_new(i) / piX_all

[0064] Among them, Hist_new is the reconstructed histogram, pix_all is the total number of pixels in the reconstructed histogram, and pdf is the probability histogram of the reconstructed histogram.

[0065] Step 5: Generate a gamma mapping curve based on the probability histogram of the area and the dark area obtained in step 4;

[0066] The specific steps of step 5 include:

[0067] (2) Based on the probability histograms of the bright and dark areas obtained in step 4, generate the cdf of the cumulative probability histogram;

[0068]

[0069] (2) The cdf curve is combined with the gamma function to obtain a line such as Figure 3 The fused gamma mapping curve is shown:

[0070] The fused gamma mapping curve can enhance the contrast and clarity of the image and reduce the degree of fog in the image.

[0071] Step 6: If the image meets the foggy condition, the original haze image is mapped using the fused gamma mapping curve obtained in step 5 to obtain a clear haze image. Otherwise, the normal gamma processing in the device is used.

[0072] The present invention obtains an enhanced image by performing histogram equalization processing on the original haze image.

[0073] The inverse transformation function in step 5 can be adaptively adjusted according to the balance of the cumulative probability histogram to maintain the clarity of the image details.

[0074] Figure 4 and Figure 5 They are algorithm verifications for outdoor foggy scenes. The left side shows the normal effect, and the right side shows the effect after the algorithm takes effect. It can be seen that in foggy scenes, the picture details and contrast are better after the algorithm takes effect.

[0075] The device of the present invention comprises a sensor module, a processor module and a display module, wherein the processor module integrates the histogram equalization and inverse transformation function generation algorithms, and can realize the histogram equalization processing of the haze image.

[0076] The present invention only processes the brightness histogram, and the processing speed of the algorithm on an embedded device with a dual-core ARM Cortex A55@1000MHz processor is about 20ms, which meets the real-time requirements.

[0077] It should be emphasized that the embodiments of the present invention are illustrative rather than restrictive. Therefore, the present invention includes but is not limited to the embodiments described in the specific implementation modes. Any other implementation modes derived by those skilled in the art based on the technical solutions of the present invention also fall within the scope of protection of the present invention.

Claims

1. An image enhancement method based on histogram equalization, characterized in that: The following steps are involved: Step 1, generating a grayscale histogram of the original haze image; Step 2: Segment the grayscale histogram of the haze image generated in step 1; Step 3, performing peak clipping on the segmented grayscale histogram to obtain a reconstructed grayscale histogram; Step 4: normalize the reconstructed grayscale histogram to obtain probability histograms of bright and dark areas; Step 5: Generate a gamma mapping curve based on the probability histogram of the area and the dark area obtained in step 4; Step 6: If the image meets the foggy condition, the original haze image is mapped using the fused gamma mapping curve obtained in step 5 to obtain a clear haze image. Otherwise, the normal gamma processing in the device is used.

2. The image enhancement method based on histogram equalization according to claim 1, characterized in that: The specific method of step 1 is: Read the original haze yuv image, and use the y component in the original haze yuv image to calculate and generate the grayscale histogram of the haze image.

3. The image enhancement method based on histogram equalization according to claim 1, characterized in that: The specific method of step 2 is: The grayscale histogram of the haze image generated in step 1 is segmented using the average brightness of the image as the segmentation point Dx; The calculation formula of Dx is: Lum_all=i*hist(i), pix_all=hist(1)+hist(2)+...hist(256), Dx=Lum_all / pix_all. Where Lum_all is the total brightness, pix_all is the total number of pixels, hist is the histogram distribution function, and Dx is the segmentation point position.

4. The image enhancement method based on histogram equalization according to claim 1, characterized in that: The specific method of step 3 is: The segmented histogram is subjected to peak clipping, and the contrast changes of dark and bright areas can be limited respectively after peak clipping; given a threshold th = pix_all / Dx / 2; peak clipping is: Then the reconstructed grayscale histogram hist_new is obtained.

5. The image enhancement method based on histogram equalization according to claim 1, characterized in that: The specific method of step 4 is: The reconstructed grayscale histogram hist_new is normalized to obtain the probability histograms of the bright and dark areas: pdf(i)=hist_neu(i) / piaX_all Among them, Hist_new is the reconstructed histogram, pix_all is the total number of pixels in the reconstructed histogram, and pdf is the probability histogram of the reconstructed histogram.

6. The image enhancement method based on histogram equalization according to claim 1, characterized in that: The specific steps of step 5 include: (1) Based on the probability histograms of bright and dark areas obtained in step 4, generate the cdf of the cumulative probability histogram; (2) The cdf curve is fused with the gamma function to obtain a fused gamma mapping curve.