An image enhancement method, an image enhancement device, and a computer-readable storage medium

By statistically stating the image brightness histogram, filtering and adjusting the brightness of pixel points, the problem of the camera being too dark in dark places in high dynamic range scenes is solved, and image quality and detail observability are improved.

CN114219723BActive Publication Date: 2025-07-08ZHEJIANG DAHUA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111410698.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2025-07-08
Estimated Expiration
2041-11-19

AI Technical Summary

Technical Problem

When the camera shoots a high dynamic range scene, the dark areas in the image are too dark, resulting in poor image quality. The existing dynamic range adjustment methods cannot effectively improve the details in the dark, and may introduce noise or overexposure problems.

Method used

By counting the image brightness histogram, determining the brightness threshold, filtering out the pixel points that need to be adjusted, calculating the adjustment coefficient, and adjusting the dynamic range of the image to improve the brightness in the dark and improve image quality.

Benefits of technology

It effectively improves the brightness of dark areas in the image, improves image quality, prevents noise introduction and overexposure, and improves the observability of image details.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114219723B_ABST
    Figure CN114219723B_ABST
Patent Text Reader

Abstract

The present application discloses an image enhancement method, an image enhancement device, and a computer-readable storage medium. The method includes: statistically analyzing the brightness of a first image to be processed to obtain a brightness statistical histogram; determining a brightness threshold based on the brightness statistical histogram; screening all pixel points of the first image to be processed based on the brightness threshold to obtain first pixel points; calculating an adjustment coefficient based on the brightness of the first pixel points and the brightness threshold; and obtaining an adjusted image based on the adjustment coefficient and the first image to be processed, wherein the dynamic range of the adjusted image is smaller than that of the first image to be processed. By the above method, the present application can adjust the dynamic range of an image and improve the image quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and particularly to an image enhancement method, an image enhancement device, and a computer-readable storage medium. Background Art

[0002] In the actual use process of a camera, when facing a high-dynamic-range scene, limited by the conventional metering mode which is average metering, the obtained image often has the problem that dark areas are too dark, resulting in unclear visibility of low-brightness road surfaces, trees, etc., and causing poor image quality. Summary of the Invention

[0003] This application provides an image enhancement method, an image enhancement device, and a computer-readable storage medium, which can adjust the dynamic range of an image and improve the image quality.

[0004] To solve the above technical problems, the technical solution adopted in this application is: providing an image enhancement method, which includes: statistically analyzing the brightness of a first image to be processed to obtain a brightness statistical histogram; determining a brightness threshold based on the brightness statistical histogram; screening all pixel points of the first image to be processed based on the brightness threshold to obtain first pixel points; calculating an adjustment coefficient based on the brightness of the first pixel points and the brightness threshold; and obtaining an adjusted image based on the adjustment coefficient and the first image to be processed, where the dynamic range of the adjusted image is smaller than that of the first image to be processed.

[0005] To solve the above technical problems, another technical solution adopted in this application is: providing an image enhancement device, which includes a memory and a processor connected to each other, where the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the image enhancement method in the above technical solution.

[0006] To solve the above technical problems, another technical solution adopted in this application is: providing a computer-readable storage medium, which is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the image enhancement method in the above technical solution.

[0007] Through the above solution, the beneficial effects of the present application are as follows: First, the brightness of the first image to be processed is statistically analyzed to generate a brightness statistical histogram; then, the brightness threshold is determined using the brightness statistical histogram; next, the first pixel points are screened out from all the pixel points of the first image to be processed using the brightness threshold; then, the adjustment coefficient of the first pixel point is calculated using the brightness of the first pixel point and the brightness threshold; then, the pixel value of the first pixel point is adjusted using the adjustment coefficient to generate an adjusted image, and the dynamic range of the adjusted image is smaller than that of the first image to be processed; after the pixel value is adjusted, the dynamic range of the generated image becomes smaller, so that the brightness of the darker area in the image is enhanced, improving the quality of the image and facilitating the user to observe the details of the darker area. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings. Among them:

[0009] Figure 1 is a schematic flowchart of an embodiment of the image enhancement method provided by the present application;

[0010] Figure 2 is a schematic diagram of the pixels of the first image to be processed provided by the present application;

[0011] Figure 3 is a schematic diagram of the brightness statistical histogram provided by the present application;

[0012] Figure 4 is a schematic flowchart of another embodiment of the image enhancement method provided by the present application;

[0013] Figure 5 is a schematic diagram of the pixels of the third image to be processed provided by the present application;

[0014] Figure 6 is a schematic diagram of the second image to be processed provided by the present application;

[0015] Figure 7 is Figure 6 a schematic diagram of the corresponding brightness statistical histogram;

[0016] Figure 8 is Figure 6 a schematic diagram of the corresponding adjusted image;

[0017] Figure 9 is Figure 8 a schematic diagram of the corresponding brightness statistical histogram;

[0018] Figure 10 It is a schematic structural diagram of an embodiment of the image enhancement device provided by the present application;

[0019] Figure 11 It is a schematic structural diagram of an embodiment of the computer-readable storage medium provided by the present application. Specific embodiments

[0020] The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are only used to illustrate the present application, but do not limit the scope of the present application. Similarly, the following embodiments are only partial embodiments of the present application rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present application.

[0021] Referring to "embodiment" in the present application means that specific features, structures or characteristics described in connection with the embodiment may be included in at least one embodiment of the present application. The phrase appears in various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0022] It should be noted that the terms "first", "second", and "third" in the present application are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first", "second", and "third" may explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "a plurality" is at least two, such as two, three, etc., unless otherwise specifically defined. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or devices.

[0023] In the actual operation of the camera, in the face of a high-contrast scene, the method for adjusting the dynamic range is as follows:

[0024] 1) Adjust the dynamic range by adjusting the contrast module or the gamma module.

[0025] The problem with this method is that through the Image Signal Processing (ISP) module, the contrast is forcibly stretched. To ensure that the picture is not skewed or noise is not pulled out from the dark part, it is impossible to guarantee an ideal state every time.

[0026] 2) By adjusting the light meter, reducing the weight of the high-brightness area and increasing the weight of the low-brightness area, the target brightness is adjusted.

[0027] The problem with this method is that due to the increase in the weight of the low-brightness area, the average brightness of the entire picture becomes very bright, resulting in overexposure in the high-brightness area.

[0028] 3) By enabling true wide dynamic range, the dynamic range is adjusted.

[0029] The problem with this method is that since the principle of true wide dynamic range is to synthesize two or more frames of data, the effect of the entire picture may be different from that of the picture under linear conditions, and it is not natural.

[0030] To solve the drawbacks of the dynamic range adjustment methods used in related technologies, the present application provides a method for implementing the adjustment of the dynamic range of a camera. The solution provided by the present application will be described in detail below.

[0031] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of an embodiment of the image enhancement method provided by the present application. The method includes:

[0032] S11: Statistically analyze the brightness of the first image to be processed to obtain a brightness statistical histogram.

[0033] The first image to be processed can be obtained from an image database or captured by a camera to generate the first image to be processed. The first image to be processed is the image that needs to be processed. The color space of the first image to be processed can be the HSV space. The HSV space is a common color space, where H represents hue (degree), S represents saturation, and V represents brightness.

[0034] After obtaining the first image to be processed, the brightness of each pixel point in the first image to be processed can be statistically analyzed to obtain a brightness statistical histogram. The brightness statistical histogram includes the brightness of each pixel point in the first image to be processed and the corresponding quantity; for example, as Figures 2 to 3As shown, assume that the size of the first image to be processed is 4×4, and its pixel points are denoted as I11 to I44 respectively. Each pixel point includes three values: chrominance, luminance, and saturation. The luminance of all pixel points is statistically analyzed. Assume that the luminance of this image is divided into 4 luminance intervals: A0 to A1, A1 to A2, A2 to A3, and A3 to A4. The corresponding quantities for each luminance interval are: Q1, Q2, Q3, and Q4, and we get Figure 3 the luminance statistical histogram shown, where the vertical axis represents the number of pixels and the horizontal axis represents luminance, and Q1 + Q2 + Q3 + Q4 = 16.

[0035] S12: Based on the luminance statistical histogram, determine the luminance threshold.

[0036] After obtaining the luminance statistical histogram of the first image to be processed, the luminance statistical histogram can be analyzed to obtain the luminance threshold, and then the luminance threshold can be used to screen out the pixel points (i.e., the first pixel points) that need to be pixel-adjusted from the first image to be processed. Specifically, the luminance with a relatively large quantity in the luminance statistical histogram can be used as the luminance threshold. For example, the luminance with the third largest quantity in the luminance histogram can be used as the luminance threshold; or, a preset value can be used as the luminance threshold; or, two values can be preset, and the average value of these two values can be used as the luminance threshold.

[0037] S13: Based on the luminance threshold, screen all pixel points of the first image to be processed to obtain the first pixel points.

[0038] After obtaining the luminance threshold, the first image to be processed can be processed using the luminance threshold to screen out the first pixel points from all pixel points of the first image to be processed. Specifically, a luminance threshold can be set to determine whether the luminance of each pixel point in the first image to be processed is less than the luminance threshold. If the luminance of the pixel point is less than the luminance threshold, it indicates that the luminance of this pixel point is relatively small and its luminance needs to be increased; or determine whether the luminance of each pixel point in the first image to be processed is greater than the luminance threshold. If the luminance of the pixel point is greater than the luminance threshold, it indicates that the luminance of this pixel point is relatively large and its luminance needs to be decreased; or two luminance thresholds can also be set: the first set threshold and the second set threshold, where the first set threshold is less than the second set threshold, and determine whether the luminance of each pixel point in the first image to be processed is less than the first set threshold or greater than the second set threshold, and screen out the pixel points with luminance less than the first set threshold or luminance greater than the second set threshold from all pixel points of the first image to be processed and use them as the first pixel points. It can be understood that the method of obtaining the first pixel points can be set according to specific application requirements, and this embodiment does not make any restrictions.

[0039] S14: Based on the luminance of the first pixel points and the luminance threshold, calculate the adjustment coefficient.

[0040] The adjustment coefficient is related to the brightness of the first pixel and the brightness threshold. After obtaining the brightness threshold and the first pixel, the brightness threshold can be divided by the brightness of the first pixel to obtain the adjustment coefficient.

[0041] S15: Obtain an adjusted image based on the adjustment coefficient and the first image to be processed.

[0042] After obtaining the adjustment coefficient corresponding to the first pixel, the adjustment coefficient can be multiplied by the pixel value corresponding to the first pixel to obtain an adjusted pixel value (i.e., the pixel value of the corresponding pixel in the adjusted image). The dynamic range of the adjusted image is less than or equal to the dynamic range of the first image to be processed. Therefore, after the above pixel value adjustment, the dynamic range of the image becomes smaller, so that the brightness of the darker area in the adjusted image is improved, the quality of the image is improved, and it is convenient for the user to observe the details of the darker area; moreover, the solution provided in this embodiment can be applied to video surveillance, which helps to improve the display quality.

[0043] Please refer to Figure 4 , Figure 4 which is a schematic flowchart of another embodiment of the image enhancement method provided by this application. The method includes:

[0044] S401: Obtain a second image to be processed, and perform format conversion processing on the second image to be processed to obtain a first image to be processed.

[0045] The color space of the second image to be processed can be the RGB space or the YUV space. For example, taking the color space of the second image to be processed as the RGB space as an example, the second image to be processed in the RGB space is converted into a first image to be processed in the HSV space, and the size of the first image to be processed is the same as that of the second image to be processed.

[0046] S402: Statistically analyze the brightness of the first image to be processed to obtain a brightness statistical histogram.

[0047] The purpose of obtaining the brightness statistical histogram based on the brightness of the pixel points of the first image to be processed is to obtain the contrast distribution of the current picture; S402 is the same as S11 in the above embodiment and will not be elaborated here.

[0048] S403: Select a first brightness and a second brightness from the brightness statistical histogram, and calculate the absolute value of the difference between the first brightness and the second brightness to obtain a brightness difference.

[0049] Find the brightness values corresponding to the top two histograms with the largest number of pixels in the brightness statistical histogram, and denote them as the first brightness and the second brightness. The first brightness is less than the second brightness, that is, the first brightness is the brightness corresponding to the maximum number in the brightness statistical histogram, and the second brightness is the brightness corresponding to the maximum number except the number corresponding to the first brightness in the brightness statistical histogram.

[0050] In a specific embodiment, the data bit width of the second image to be processed is 8 bits, and the upper limit of all data in this embodiment is 255. The following formula can be used to obtain the brightness difference:

[0051] δV = |V1 - V2| (1)

[0052] Where, in formula (1), δV is the brightness difference, V1 is the first brightness, and V2 is the second brightness.

[0053] S404: Determine whether the brightness difference is greater than the first preset threshold.

[0054] Determine whether the brightness difference is greater than the first preset threshold. If the brightness difference is greater than the first preset threshold, then execute S405; if the brightness difference is less than or equal to the first preset threshold, then execute S406.

[0055] Furthermore, the purpose of determining whether the brightness difference is greater than the first preset threshold is to qualitatively determine whether the brightness statistical histogram belongs to a bimodal distribution type; the specific value of the first preset threshold can be adjusted according to actual needs, and it is related to the data bit width used in the calculation. The first preset threshold is less than 2 N , for example: the first preset threshold is 1 / 3 of (2 N ) or 1 / 2 of (2 N ), N is the data bit width. For example, considering the data bit width of 8 bits in this embodiment, the first preset threshold can be set to 100.

[0056] S405: If the brightness difference is greater than the first preset threshold, then select the brightness threshold from the brightness statistical histogram.

[0057] In the brightness statistical histogram, find the brightness corresponding to a number slightly smaller than the number of pixels corresponding to the first brightness, and use it as the brightness threshold, that is, the brightness threshold is the brightness corresponding to the maximum number except the number corresponding to the first brightness and the number corresponding to the second brightness in the brightness statistical histogram. At this time, the brightness threshold is the brightness corresponding to the number ranked third in the entire brightness statistical histogram in terms of the number of pixels.

[0058] S406: If the brightness difference is less than or equal to the first preset threshold, then determine the brightness threshold based on the brightness difference and the second preset threshold.

[0059] Determine whether the second brightness is less than the second preset threshold; if the second brightness is less than the second preset threshold, the brightness threshold is the second preset threshold; if the second brightness is greater than or equal to the second preset threshold, determine the brightness threshold based on the first brightness and the third preset threshold. Specifically, determine whether the first brightness is greater than the third preset threshold; if the first brightness is greater than the third preset threshold, it indicates that there is no need to process the second image to be processed, and at this time, the entire operation process ends, and information indicating that the second image to be processed meets the requirements can be generated and displayed; if the first brightness is less than or equal to the third preset threshold, the average value of the second preset threshold and the third preset threshold is determined as the brightness threshold, that is, the brightness threshold is calculated using the following formula:

[0060] A = β + (γ - β) / 2 (2)

[0061] Wherein, in formula (2), A is the brightness threshold, β is the second preset threshold, and γ is the third preset threshold.

[0062] Furthermore, the purpose of determining whether the second brightness is less than the second preset threshold and determining whether the first brightness is greater than the third preset threshold is: qualitatively determine whether the brightness statistical histogram is concentrated in the first half or the second half of the brightness interval; the specific values of the second preset threshold and the third preset threshold can be set according to the specific application scenario. For example, the second preset threshold is 50 and the third preset threshold is 150.

[0063] The purpose of performing the above S403 - S406 is to determine the shape of the brightness statistical histogram and, at the same time, obtain the brightness threshold of the pixel points that need to be adjusted next according to different situations.

[0064] S407: Select pixel points that meet the preset screening conditions from the first image to be processed to obtain the third pixel points.

[0065] After calculating the brightness threshold, the H component value (i.e., chromaticity) of each pixel point in the first image to be processed in the HSV space can be extracted, and it is determined whether the chromaticity of each pixel point in the first image to be processed falls within the preset chromaticity range; if the chromaticity of the pixel point falls within the preset chromaticity range, it is determined that the pixel point meets the preset screening conditions, and the pixel point is the third pixel point.

[0066] Further, the preset chromaticity range includes three chromaticity ranges: the first chromaticity range, the second chromaticity range, and the third chromaticity range. The first chromaticity range corresponds to red, the second chromaticity range corresponds to green, and the third chromaticity range corresponds to blue. For example, the first chromaticity range is 0 to 10, the second chromaticity range is 110 to 130, and the third chromaticity range is 230 to 250. Pixel points with H component values falling within 0 to 10, 110 to 130, and 230 to 250 are respectively extracted. The reason for selecting these three numerical ranges is as follows: in the HSV color space, "H component value of 0" represents red, "H component value of 120" represents green, and "H component value of 240" represents blue. Considering that red, green, and blue are common primary colors in a camera, these three numerical ranges are selected in this embodiment and a certain design margin is given.

[0067] S408: Determine whether the brightness of the third pixel point is less than the brightness threshold.

[0068] Perform secondary filtering on the extracted pixel points that meet the preset screening conditions, find the pixel points with brightness less than the brightness threshold among them, and obtain the first pixel points.

[0069] S409: If the brightness of the third pixel point is less than the brightness threshold, then the third pixel point is the first pixel point, and calculate the ratio of the brightness threshold to the brightness of the first pixel point to obtain the adjustment coefficient.

[0070] If the brightness of the third pixel point is less than the brightness threshold, it indicates that the third pixel point is a qualified pixel point, and determine it as the first pixel point; then, based on its own brightness, each first pixel point calculates the corresponding adjustment coefficient using the following formula:

[0071] θ = A / V (3)

[0072] Wherein, in formula (3), θ is the adjustment coefficient, A is the brightness threshold, and V is the brightness of the first pixel point.

[0073] S410: Based on the adjustment coefficient, adjust the pixel values of the second pixel points in the second image to be processed to obtain an adjusted image.

[0074] Use the adjustment coefficient to adjust the second pixel points in the second image to be processed to generate an adjusted image. The dynamic range of the adjusted image is less than or equal to the dynamic range of the second image to be processed. The second pixel points are the pixel points corresponding to the first pixel points, and the coordinates of the second pixel points and the first pixel points in the corresponding images are the same.

[0075] In a specific embodiment, the following method is used to generate the adjusted image:

[0076] 1) Multiply the pixel value of the second pixel point by the adjustment coefficient to obtain a third image to be processed.

[0077] The pixel value of the second pixel point includes a first pixel value (i.e., the value of the R channel), a second pixel value (the value of the G channel), and a third pixel value (i.e., the value of the B channel). Multiply the first pixel value, the second pixel value, and the third pixel value by the adjustment coefficient respectively to obtain the pixel value of the fourth pixel point in the third image to be processed. The fourth pixel point is the pixel point corresponding to the second pixel point; assign the pixel values of the pixel points in the second image to be processed other than the second pixel point to the corresponding pixel points in the third image to be processed.

[0078] 2) Smooth the third image to be processed to obtain an adjusted image.

[0079] For the pixel points that have undergone the multiplication operation (i.e., multiplication by the adjustment coefficient), peripheral neighborhood smoothing is also required; specifically, it can be determined whether each pixel point in the third image to be processed is a fourth pixel point; if the pixel point is a fourth pixel point, based on the fourth pixel point, smooth the other pixel points in the third image to be processed to obtain an adjusted image.

[0080] Further, determine whether the neighborhood pixel points around the fourth pixel point are another fourth pixel point; if the neighborhood pixel points around the fourth pixel point are another fourth pixel point, there is no need to process the neighborhood pixel points; if the neighborhood pixel points around the fourth pixel point are not another fourth pixel point, multiply the pixel value of the neighborhood pixel point by the adjustment coefficient to obtain the pixel value of the corresponding pixel point in the adjusted image.

[0081] In a specific embodiment, the eight-neighborhood method can be used to implement peripheral neighborhood smoothing, such as Figure 5 shown. Taking the pixel points in the sliding window W as an example, F33 is the fourth pixel point. Among the eight neighborhoods where F33 is located, F22, F24, F32, F34, F43, and F44 are pixel points that have not been multiplied by the adjustment coefficient (i.e., they are not fourth pixel points), and F23 and F42 are fourth pixel points. It is necessary to smooth F22, F24, F32, F34, F43, and F44. The smoothing method is: multiply the pixel values of F22, F24, F32, F34, F43, and F44 by the adjustment coefficient of F33 respectively; through smoothing processing, a smooth transition can be achieved between the multiplied pixel points and the non-multiplied pixel points in the image, avoiding the problem of boundary mutation.

[0082] In a specific embodiment, as Figures 6 to 9 shown, Figure 6 is the second image to be processed, and its size is 2560×1456. Figure 7 is Figure 6The corresponding brightness statistical histogram Figure 8 is Figure 6 the corresponding adjusted image Figure 9 is Figure 8 the corresponding brightness statistical histogram. Comparing Figure 6 with Figure 8 it can be found that the details of the area where the trees are located are clearer after the pixel value adjustment; comparing Figure 7 with Figure 9 it can be found that the number corresponding to the lower brightness value (for example: the number of pixels in the range of 0-50) decreases. Therefore, the brightness of the darker area is improved by the processing of the solution provided in this embodiment, preventing the image details of the darker area from being unclear.

[0083] In the actual working conditions of the camera, there may be a phenomenon that the dark part is too dark due to the high dynamic range of the monitored scene. Traditional processing algorithms may introduce noise or cause local overexposure, etc.; based on this, this embodiment proposes a method for adjusting the dynamic range of the camera, calculating the color information of the picture, taking the HSV space as the operation object, statistically obtaining the histogram based on brightness, then evaluating the corresponding histogram distribution, obtaining the corresponding brightness threshold, then selecting the pixel points of the corresponding picture according to the range of the H component value, using the brightness threshold to perform a secondary screening on the obtained pixel points, and multiplying the pixel values of the finally obtained pixel points by the adjustment coefficient, which can adaptively improve the brightness of the darker area and realize improving the dynamic range of the picture.

[0084] Please refer to Figure 10 , Figure 10 which is a schematic structural diagram of an embodiment of an image enhancement device provided by this application. The image enhancement device 100 includes a memory 101 and a processor 102 connected to each other. The memory 101 is used to store a computer program, and when the computer program is executed by the processor 102, it is used to implement the image enhancement method in the above embodiment.

[0085] The solution adopted in this embodiment processes from the perspective of color science, aiming at two aspects of chromaticity and brightness, calculates the corresponding adjustment coefficient, and finally superimposes it on the RGB three channels. By changing the values of the RGB channels of the pixel points that meet the conditions, the target picture is obtained, and the quality of the picture can be improved by adjusting the brightness of the darker area.

[0086] Please refer to Figure 11 , Figure 11 which is a schematic structural diagram of an embodiment of a computer-readable storage medium provided by this application. The computer-readable storage medium 110 is used to store a computer program 111, and when the computer program 111 is executed by the processor, it is used to implement the image enhancement method in the above embodiment.

[0087] The computer-readable storage medium 110 may be a server, a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc., which are various media that can store program codes.

[0088] In several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0089] 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 can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0090] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0091] The above are only the embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structural or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.

Claims

1. An image enhancement method, characterized in that, Including: Statistically analyze the brightness of the first image to be processed to obtain a brightness statistical histogram; Based on the brightness statistical histogram, determine a brightness threshold, which is determined by judging whether the brightness difference is greater than a first preset threshold. If the brightness difference is greater than the first preset threshold, the brightness threshold is the brightness corresponding to the maximum value of the quantities other than the quantity corresponding to the first brightness and the quantity corresponding to the second brightness in the brightness statistical histogram. If the brightness difference is not greater than the first preset threshold, the brightness threshold is calculated based on the brightness difference and a second preset threshold. Wherein, the brightness difference is the absolute value of the difference between the first brightness and the second brightness, the first brightness is the brightness corresponding to the maximum value of the quantities in the brightness statistical histogram, and the second brightness is the brightness corresponding to the maximum value of the quantities other than the quantity corresponding to the first brightness in the brightness statistical histogram; Based on the brightness threshold, screen all pixel points of the first image to be processed to obtain first pixel points; Calculate an adjustment coefficient based on the brightness of the first pixel points and the brightness threshold; Based on the adjustment coefficient and the first image to be processed, obtain an adjusted image, and the dynamic range of the adjusted image is smaller than the dynamic range of the first image to be processed.

2. The image enhancement method according to claim 1, wherein Before the step of statistically analyzing the brightness of the first image to be processed to obtain a brightness statistical histogram, it includes: Obtain a second image to be processed, and perform format conversion processing on the second image to be processed to obtain the first image to be processed; The step of obtaining the adjusted image based on the adjustment coefficient and the first image to be processed includes: Based on the adjustment coefficient, adjust the pixel values of the second pixel points in the second image to be processed to obtain the adjusted image. The second pixel points are the pixel points corresponding to the first pixel points, and the dynamic range of the adjusted image is smaller than the dynamic range of the second image to be processed.

3. The image enhancement method according to claim 2, wherein The brightness statistical histogram includes the brightness of each pixel point in the first image to be processed and the quantity corresponding to the brightness. The step of determining the brightness threshold based on the brightness statistical histogram includes: Select a first brightness and a second brightness from the brightness statistical histogram, the first brightness is less than the second brightness, the first brightness is the brightness corresponding to the maximum value of the quantities in the brightness statistical histogram, and the second brightness is the brightness corresponding to the maximum value of the quantities other than the quantity corresponding to the first brightness in the brightness statistical histogram; Calculate the absolute value of the difference between the first brightness and the second brightness to obtain a brightness difference; Judge whether the brightness difference is greater than a first preset threshold; If so, select the brightness threshold from the brightness statistical histogram, and the brightness threshold is the brightness corresponding to the maximum value of the quantities other than the quantity corresponding to the first brightness and the quantity corresponding to the second brightness in the brightness statistical histogram; If not, determine the brightness threshold based on the brightness difference and a second preset threshold.

4. The image enhancement method according to claim 3, wherein The step of determining the brightness threshold based on the brightness difference and a second preset threshold includes: Determine whether the second brightness is less than the second preset threshold; If so, the brightness threshold is the second preset threshold; If not, determine the brightness threshold based on the first brightness and the third preset threshold.

5. The image enhancement method according to claim 4, wherein The step of determining the brightness threshold based on the first brightness and the third preset threshold includes: Determine whether the first brightness is greater than the third preset threshold; If not, determine the average value of the second preset threshold and the third preset threshold as the brightness threshold, where the second preset threshold is less than the third preset threshold.

6. The image enhancement method according to claim 2, wherein The step of screening all pixel points of the first image to be processed based on the brightness threshold to obtain the first pixel points includes: Select pixel points that meet the preset screening conditions from the first image to be processed to obtain third pixel points; Determine whether the brightness of the third pixel points is less than the brightness threshold; If so, the third pixel points are the first pixel points.

7. The image enhancement method according to claim 6, wherein The step of selecting pixel points that meet the preset screening conditions from the first image to be processed to obtain third pixel points includes: Determine whether the chromaticity of each pixel point of the first image to be processed falls within a preset chromaticity range; If so, determine that the pixel point meets the preset screening conditions, and the pixel point is the third pixel point.

8. The image enhancement method according to claim 6, wherein The method further includes: Calculate the ratio of the brightness threshold to the brightness of the first pixel points to obtain the adjustment coefficient; Multiply the pixel values of the second pixel points by the adjustment coefficient to obtain a third image to be processed; Perform smoothing processing on the third image to be processed to obtain the adjusted image.

9. The image enhancement method according to claim 8, wherein The pixel values of the second pixel points include a first pixel value, a second pixel value, and a third pixel value. The step of multiplying the pixel values of the second pixel points by the adjustment coefficient to obtain a third image to be processed includes: Multiply the first pixel value, the second pixel value, and the third pixel value by the adjustment coefficient respectively to obtain the pixel values of the fourth pixel points in the third image to be processed, where the fourth pixel points are the pixel points corresponding to the second pixel points.

10. The image enhancement method according to claim 9, wherein The step of performing smoothing processing on the third image to be processed to obtain the adjusted image includes: Determine whether each pixel point in the third image to be processed is the fourth pixel point; If so, based on the fourth pixel points, perform smoothing processing on other pixel points in the third image to be processed to obtain the adjusted image.

11. The image enhancement method according to claim 10, characterized in that, The step of performing smoothing processing on other pixel points in the third image to be processed based on the fourth pixel points to obtain the adjusted image includes: Determine whether the neighboring pixel points around the fourth pixel points are another fourth pixel point; If not, multiply the pixel values of the neighboring pixel points by the adjustment coefficient to obtain the pixel values of the corresponding pixel points in the adjusted image.

12. An image enhancement device, characterized in that, It includes a memory and a processor connected to each other. Among them, the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the image enhancement method according to any one of claims 1-11.

13. A computer-readable storage medium for storing a computer program, characterized in that, When executed by a processor, the computer program is used to implement the image enhancement method according to any one of claims 1-11.

Citation Information

Patent Citations

  • Framing method for license plate in RGB format

    CN103268493A

  • Image display method and device

    CN108806638A

  • Image processing method and device and electronic equipment

    CN111565261A