Image enhancement method and related products

By constructing target templates and nonlinear mappings, combining global and local contrast enhancement processing, the problem of image quality in the prior art is solved, and a higher quality image processing effect is achieved.

CN112330546BActive Publication Date: 2025-04-18CHONGQING GANGYU HI-TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011045831.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-28
Publication Date
2025-04-18
Estimated Expiration
2040-09-28

AI Technical Summary

Technical Problem

The prior art is difficult to effectively improve image quality, especially in video image processing, which leads to unstable image quality and affects user experience.

Method used

By acquiring the n-th frame image, the target template is constructed for the first filtering, non-linear mapping is performed based on the target parameter statistics of the previous frame image, global and local contrast enhancement processing is performed, and finally filtering is performed to improve image quality.

Benefits of technology

This method can effectively improve image quality, ensure the continuity between video images, and better enhancement effect for the human eye.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112330546B_ABST
    Figure CN112330546B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses an image enhancement method and related products, wherein the method comprises: obtaining the nth frame image, where n is an integer greater than 1; constructing a target template with the unprocessed pixel points in the nth frame image as the center, and performing a first filtering based on the target template to obtain a first filtered image; performing nonlinear mapping on the first filtered image based on the target parameter statistical information of the n-1th frame image to obtain a mapped image, where the n-1th frame image is the previous frame image of the n-1th frame image; performing global contrast enhancement processing on the mapped image using the histogram statistical information after the nonlinear mapping of the n-1th frame image to obtain an enhanced image; performing filtering processing on the enhanced image to obtain a second filtered image; performing local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image. The embodiment of the present application can improve image quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image enhancement method and related products. Background Art

[0002] With the rapid development of electronic technology, taking pictures has become a standard technology for electronic devices (such as mobile phones, tablets, etc.). When taking pictures, users have higher and higher requirements for image quality. The quality of the image also affects users' evaluation of electronic devices to a certain extent. Therefore, the problem of how to improve image quality needs to be solved urgently. Summary of the invention

[0003] The embodiments of the present application provide an image enhancement method and related products, which can improve image quality.

[0004] In a first aspect, an embodiment of the present application provides an image enhancement method, the method comprising:

[0005] Get the nth frame image, where n is an integer greater than 1;

[0006] Taking the unprocessed pixel points in the n-th frame image as the center, constructing a target template, and performing a first filtering based on the target template to obtain a first filtered image;

[0007] Performing nonlinear mapping on the first filtered image based on target parameter statistical information of the n-1th frame image to obtain a mapped image, wherein the n-1th frame image is a previous frame image of the nth frame image;

[0008] Performing global contrast enhancement processing on the mapped image using the histogram statistical information after nonlinear mapping of the n-1th frame image to obtain an enhanced image;

[0009] Performing filtering on the enhanced image to obtain a second filtered image;

[0010] Based on the enhanced image, local contrast enhancement processing is performed on the second filtered image to obtain an output image.

[0011] In a second aspect, an embodiment of the present application provides an image enhancement device, the device comprising: an acquisition unit, a first filtering unit, a mapping unit, a global enhancement unit, a second filtering unit and a local enhancement unit, wherein:

[0012] The acquisition unit is used to acquire the nth frame image, where n is an integer greater than 1;

[0013] The first filtering unit is used to construct a target template with the unprocessed pixel points in the n-th frame image as the center, and perform a first filtering based on the target template to obtain a first filtered image;

[0014] The mapping unit is used to perform nonlinear mapping on the first filtered image based on target parameter statistical information of the n-1th frame image to obtain a mapped image, wherein the n-1th frame image is a previous frame image of the nth frame image;

[0015] The global enhancement unit is used to perform global contrast enhancement processing on the mapped image using the histogram statistical information after the nonlinear mapping of the n-1th frame image to obtain an enhanced image;

[0016] The second filtering unit is used to filter the enhanced image to obtain a second filtered image;

[0017] The local enhancement unit is used to perform local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image.

[0018] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps of any method in the first aspect of the embodiment of the present application.

[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in any method of the first aspect of the embodiment of the present application.

[0020] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in any method of the first aspect of the embodiment of the present application. The computer program product may be a software installation package.

[0021] The embodiments of the present application have the following beneficial effects:

[0022] It can be seen that the image enhancement method and related products described in the embodiments of the present application obtain the nth frame image, where n is an integer greater than 1, construct a target template with the unprocessed pixel points in the nth frame image as the center, and perform a first filtering based on the target template to obtain a first filtered image, perform nonlinear mapping on the first filtered image based on the target parameter statistical information of the n-1th frame image to obtain a mapped image, the n-1th frame image is the previous frame image of the n-1th frame image, and use the histogram statistical information after the nonlinear mapping of the n-1th frame image to perform global contrast enhancement processing on the mapped image to obtain an enhanced image, filter the enhanced image to obtain a second filtered image, and perform local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image. In this way, the current frame image can be filtered, and the current frame can be mapped, globally contrast enhanced, filtered, and locally contrast enhanced based on the statistical information of the previous frame image, which helps to improve image quality and ensure the continuity between video images, and the enhancement effect is better for the human eye. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0024] Figure 1A It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0025] Figure 1B is a flowchart of an image enhancement method provided in an embodiment of the present application;

[0026] Figure 1C It is a schematic diagram demonstrating the S curve provided in the embodiment of the present application;

[0027] Figure 1D It is a schematic diagram demonstrating the parameter statistical information calculation provided in the embodiment of the present application;

[0028] Figure 1E is a flow chart of another image enhancement method provided in an embodiment of the present application;

[0029] Figure 2 is a flow chart of another image enhancement method provided in an embodiment of the present application;

[0030] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0031] Figure 4It is a block diagram of the functional units of an image enhancement device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0033] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. 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 includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0034] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0035] The electronic devices involved in the embodiments of the present application may be electronic devices with communication capabilities or electronic devices without communication capabilities. The electronic devices may include various handheld devices with wireless communication functions (such as mobile phones, tablet computers, etc.), vehicle-mounted devices, wearable devices (smart glasses, smart bracelets, smart watches, etc.), smart cameras, smart cameras, computing devices or other processing devices connected to wireless modems, as well as various forms of user equipment (UE), mobile stations (MS), terminal devices, etc.

[0036] See also Figure 1A , Figure 1A1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device includes a processor, a memory, a signal processor, a transceiver, a display screen, a speaker, a microphone, a random access memory (RAM), a camera, a sensor, and a communication module, etc. Among them, the memory, the signal processor, the display screen, the speaker, the microphone, the RAM, the camera, the sensor, and the communication module are connected to the processor, and the transceiver is connected to the signal processor.

[0037] The display screen may be a liquid crystal display (LCD), an organic or inorganic light-emitting diode (OLED), an active matrix organic light-emitting diode panel (AMOLED), etc.

[0038] The camera may be a common camera or an infrared camera, which is not limited here. The camera may be a front camera or a rear camera, which is not limited here.

[0039] Among them, the sensor includes at least one of the following: a light sensor, a gyroscope, an infrared proximity sensor, a fingerprint sensor, a pressure sensor, and the like. Among them, the light sensor, also known as an ambient light sensor, is used to detect the brightness of ambient light. The light sensor may include a photosensitive element and an analog-to-digital converter. Among them, the photosensitive element is used to convert the collected light signal into an electrical signal, and the analog-to-digital converter is used to convert the above electrical signal into a digital signal. Optionally, the light sensor may also include a signal amplifier, which may amplify the electrical signal converted by the photosensitive element and output it to the analog-to-digital converter. The above-mentioned photosensitive element may include at least one of a photodiode, a phototransistor, a photoresistor, and a silicon photocell.

[0040] Among them, the processor is the control center of the electronic device, which uses various interfaces and lines to connect the various parts of the entire electronic device, and performs various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory, and calling data stored in the memory, thereby monitoring the electronic device as a whole.

[0041] The processor may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor, wherein the processor may be at least one of the following: ISP, CPU, GPU, NPU, etc., which are not limited here.

[0042] The memory is used to store software programs and / or modules, and the processor executes various functional applications and data processing of the electronic device by running the software programs and / or modules stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a software program required for at least one function, etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0043] Among them, the communication module can be used to realize the communication function, and the communication module can be at least one of the following: infrared module, Bluetooth module, mobile communication module, NFC module, Wi-Fi module, etc., which is not limited here.

[0044] The following is a detailed description of the embodiments of the present application.

[0045] See also Figure 1B , Figure 1B The present application provides a flowchart of an image enhancement method, which is applied to Figure 1A The electronic device shown in the figure, as shown in the figure, the image enhancement method includes the following operations.

[0046] 101. Obtain the nth frame image, where n is an integer greater than 1.

[0047] The nth frame image is a frame image in the video to be processed, and n is an integer greater than 1, that is, the nth frame image is not the first frame image.

[0048] In a specific implementation, the nth frame image may be a grayscale image or a color image. For example, when the nth frame image is a color image, it may be converted into a grayscale image before executing step 102, which may be implemented by the following formula:

[0049] Y=0.299R+0.587G+0.114B

[0050] Among them, Y represents a grayscale image (brightness image), R, G, and B are three color components of the nth frame image, R is the component corresponding to the red channel, G is the component corresponding to the green channel, and B is the component corresponding to the blue channel.

[0051] In a possible example, the following steps may be further included between step 101 and step 102:

[0052] A1, performing multi-scale feature decomposition on the n-th frame image to obtain low-frequency feature components and high-frequency feature components;

[0053] A2, dividing the low-frequency characteristic component into multiple regions;

[0054] A3. Determine the information entropy corresponding to each of the multiple regions to obtain multiple information entropies;

[0055] A4. Determine an average information entropy and a target mean square error according to the multiple information entropies;

[0056] A5. Determine a target adjustment coefficient corresponding to the target mean square error;

[0057] A6. Adjust the average information entropy according to the target adjustment coefficient to obtain target information entropy;

[0058] A7. Determine a first evaluation value corresponding to the target information entropy according to a preset mapping relationship between information entropy and evaluation value;

[0059] A8, obtaining the target shooting parameters corresponding to the n-th frame image;

[0060] A9. Determine a target low-frequency weight corresponding to the target shooting parameter according to a preset mapping relationship between the shooting parameter and the low-frequency weight, and determine a target high-frequency weight according to the target low-frequency weight;

[0061] A10, determining the distribution density of target feature points according to the high-frequency feature components;

[0062] A11. Determine a second evaluation value corresponding to the target feature point distribution density according to a preset mapping relationship between the feature point distribution density and the evaluation value;

[0063] A12, performing a weighted operation according to the first evaluation value, the second evaluation value, the target low-frequency weight, and the target high-frequency weight to obtain a target image quality evaluation value of the nth frame image;

[0064] A13. When the target image quality evaluation value is less than a preset image quality evaluation threshold, execute step 102; otherwise, do not execute step 102.

[0065] In a specific implementation, the preset image quality threshold can be pre-set by the user or by the system default, and it can be pre-stored in the electronic device. The electronic device can use a multi-scale decomposition algorithm to perform multi-scale feature decomposition on the n-th frame image to obtain low-frequency feature components and high-frequency feature components. The multi-scale decomposition algorithm can be at least one of the following: pyramid transform algorithm, wavelet transform, contourlet transform, shearlet transform, etc., which are not limited here. Furthermore, the low-frequency feature component can be divided into multiple regions, and the area size of each region is the same or different. The low-frequency feature component reflects the main features of the image, and the high-frequency feature component reflects the detailed information of the image.

[0066] Furthermore, the electronic device can determine the information entropy corresponding to each of the multiple regions, obtain multiple information entropies, and determine the average information entropy and the target mean square error based on the multiple information entropies. The information entropy reflects the amount of image information to a certain extent, and the mean square error can reflect the stability of the image information. The electronic device can pre-store a mapping relationship between a preset mean square error and an adjustment coefficient, and then determine the target adjustment coefficient corresponding to the target mean square error based on the mapping relationship. In the embodiment of the present application, the value range of the pre-stored adjustment coefficient can be set by the user or the system, for example, the value range can be -0.175 to 0.175.

[0067] Furthermore, the electronic device may adjust the average information entropy according to the target adjustment coefficient to obtain the target information entropy, where target information entropy = (1 + target adjustment coefficient) * average information entropy. The electronic device may pre-store a mapping relationship between a preset information entropy and an evaluation value, and further, may determine a first evaluation value corresponding to the target information entropy according to the mapping relationship between the preset information entropy and the evaluation value.

[0068] In addition, the electronic device can obtain the target shooting parameters corresponding to the nth frame image, and the target shooting parameters can be at least one of the following: sensitivity ISO, exposure time, area of ​​the region of interest, white balance parameters, focus parameters, etc., which are not limited here. The electronic device can also pre-store the mapping relationship between the preset shooting parameters and the low-frequency weights, and then, according to the mapping relationship between the preset shooting parameters and the low-frequency weights, the target low-frequency weights corresponding to the target shooting parameters can be determined, and the target high-frequency weights can be determined based on the target low-frequency weights, and the target low-frequency weights + target high-frequency weights = 1.

[0069] Furthermore, the electronic device can determine the target feature point distribution density based on the high-frequency feature component, and the target feature point distribution density = the total number of feature points of the high-frequency feature component / region area. The electronic device can also pre-store a mapping relationship between a preset feature point distribution density and an evaluation value, and then, according to the mapping relationship between the preset feature point distribution density and the evaluation value, determine the second evaluation value corresponding to the target feature point distribution density. Finally, a weighted operation is performed based on the first evaluation value, the second evaluation value, the target low-frequency weight, and the target high-frequency weight to obtain the target image quality evaluation value of the nth frame image, as follows:

[0070] Target image quality evaluation value = first evaluation value * target low frequency weight + second evaluation value * target high frequency weight

[0071] In this way, image quality evaluation can be performed based on the two dimensions of low-frequency components and high-frequency components of the image, and evaluation parameters suitable for the shooting environment, that is, the target image quality evaluation value, can be accurately obtained. When the target image quality evaluation value is less than the preset image quality evaluation threshold, step 102 is executed. Otherwise, step 102 is not executed. That is, when the image quality is not good, subsequent image enhancement can be performed. Otherwise, it can be considered that the image quality is good and there is no need to deliberately perform image enhancement.

[0072] 102. Construct a target template with the unprocessed pixel points in the nth frame image as the center, and perform a first filtering based on the target template to obtain a first filtered image.

[0073] In a specific implementation, the image boundary can be mirrored and extended based on the template window sliding to process the image boundary. Then, the image Y(i,j) can be filtered to obtain a filtered image c, i.e., a first filtered image. The electronic device can construct a target template with one or more unprocessed pixels in the nth frame image as the center. The template can be an m*n template, where m and n can be positive integers. The nth frame image can be subjected to sliding filtering based on the template to obtain a first filtered image.

[0074] In a specific implementation, the electronic device can use at least one filter to perform a first filtering process on the target template to obtain a first filtered image, wherein the filter can be at least one of the following: a guided filter, a curvature filter, a WLS filter, a domain transformation RF filter, a LEP filter, etc., which are not limited here.

[0075] 103. Perform nonlinear mapping on the first filtered image based on target parameter statistical information of the n-1th frame image to obtain a mapped image, wherein the n-1th frame image is a previous frame image of the nth frame image.

[0076] In the embodiment of the present application, the target parameter statistical information of the n-1 frame image may be at least one of the following: the direction of the S curve, the intensity coefficient C of low gray enhancement / suppression, the intensity coefficient D of high gray enhancement / suppression, the center of gravity G of the image, etc., which are not limited here. The nonlinear mapping may be a mapping function, such as tone mapping or other mappings, which are not limited here.

[0077] In the present application embodiment, Figure 1C As shown, there are two directions of the S curve, namely: low grayscale enhancement and high grayscale suppression (curve 1, referred to as LA curve) and low grayscale suppression and high grayscale enhancement (curve 2, referred to as LA_inv curve).

[0078] In specific implementation, the S-curve direction judgment can be achieved in the following ways:

[0079] ①. Image preprocessing: convert image grayscale value to 6 bits.

[0080] ②. Statistical histogram of 6-bit image:

[0081] p(s k )=n k k=0,1,…,L-1

[0082] Among them, k is the grayscale, L is the highest grayscale of the image (the default value is 64), s k is the kth gray level, n k The gray level in the image is s k The image histogram is normalized, then p(s k )for:

[0083]

[0084] Where n is the total number of image pixels.

[0085] ③ Statistical image histogram low gray level accumulation and CL

[0086]

[0087] Among them, k is the gray level, s k is the kth gray level, p(s k ) is the density function value of the kth level, Sn is the empirical value.

[0088] ④ Statistical image histogram high gray level accumulation and CH

[0089]

[0090] Among them, k is the gray level, s k is the kth gray level, p(s k ) is the density function value of the kth level.

[0091] ⑤、The S-curve direction opt_alg is as follows:

[0092]

[0093] Among them, Thr1 is the experience value.

[0094] In the specific implementation, Figure 1D As shown in the video processing, if the local contrast enhancement LCE processing is performed on the nth frame image, the parameters required by the tone mapping module are respectively the image center G Rev , image low gray enhancement coefficient value C Rev and the image high gray enhancement coefficient value D Rev, these three parameters are obtained based on the statistics of the entire image. In order to enable the algorithm to process in real time, the parameter values ​​are calculated using the image information of the n-1th frame (the previous frame) to replace the parameters required for the current nth frame. The calculation of the parameters is as follows:

[0095] 1) Calculate the image center of gravity G Rev (G):

[0096] In order to stabilize the video image, the image center of gravity G is recursively filtered:

[0097]

[0098] Where n represents the number of frames of the video image; G Rev (n) is the recursive value of the center of gravity of the current frame image; G Rev (n-1) is the recursive value of the center of gravity of the previous frame image; G last is the statistical value (usually replaced by the centroid value of the previous frame image); G step The adjustment step for recursive filtering of the image centroid value.

[0099] 2) Image low gray enhancement coefficient value C Rev (C):

[0100] ①. Calculate the average brightness of the low grayscale of the image, that is, calculate the average brightness of the grayscale value in the image that is less than the center of gravity G value.

[0101] ②. The low gray enhancement coefficient C can be calculated according to the following formula:

[0102] When the curve direction of the image is judged to be LA, the parameter C model can be:

[0103] C=9.863×ln(im L )+18.52

[0104] Among them, L The average brightness value at the low end of the image.

[0105] When the curve direction of the image is judged to be LA_inv, the model of parameter C can be:

[0106]

[0107] Among them, L The average brightness value at the low end of the image.

[0108] ③. C recursive filtering (video)

[0109] In order to stabilize the video image, C is recursively filtered:

[0110]

[0111] Where n represents the number of frames of the video image; C Rev (n) is the recursive value of the low grayscale enhancement coefficient of the current frame image, C Rev (n-1) is the recursive value of the low grayscale enhancement coefficient of the previous frame image; C last is a statistical value (usually replaced by the low gray enhancement coefficient C of the previous frame image); C step is the adjustment step of C recursive filter.

[0112] 3) Image high grayscale enhancement coefficient value D(D Rev ):

[0113] ①. Calculate the average brightness of high grayscale images

[0114] The average brightness of the image whose grayscale value is greater than the center of gravity G value.

[0115] ② Calculate the high gray enhancement coefficient D

[0116] When the curve direction of the image is judged to be LA, the model of parameter D can be:

[0117]

[0118] Among them, H It is the average brightness value of the high end of the image.

[0119] When the curve direction of the image is judged to be LA_inv, the model of parameter D can be:

[0120] D=9.18×ln(im H )+19.92

[0121] Among them, H It is the average brightness value of the high end of the image.

[0122] ③. D recursive filtering (video)

[0123] In order to stabilize the video image, D is recursively filtered:

[0124]

[0125] Where n represents the number of frames of the video image; D Rev (n) is the recursive value of the low grayscale enhancement coefficient of the current frame image, D Rev (n-1) is the recursive value of the low grayscale enhancement coefficient of the previous frame image; D last is a statistical value (usually replaced by the high grayscale enhancement coefficient D of the previous frame image); D step is the adjustment step of D recursive filtering.

[0126] Optionally, in order to make the video picture stable, the nth frame image may be recursively filtered as follows:

[0127] The mapping rule map(i) of the histogram is:

[0128]

[0129]

[0130] Where n represents the number of frames of the video image; MAP Rev (n) is the recursive value of the tone mapping image of the current frame, MAP Rev (n-1) is the recursive value of the tone mapping image of the previous frame; MAP last is a statistical value (usually replaced by the tone mapping image MAP of the previous frame); MAP step It is the adjustment step of MAP recursive filtering.

[0131] In a possible example, the above step 102, performing nonlinear mapping on the first filtered image based on the target parameter statistical information of the n-1th frame image to obtain a mapped image, may include the following steps:

[0132] 21. Determine the target nonlinear mapping configuration parameter corresponding to the target parameter statistical information according to the preset mapping relationship between the parameter statistical information and the nonlinear mapping configuration parameter;

[0133] 22. Perform nonlinear mapping on the first filtered image according to the target nonlinear mapping configuration parameters to obtain the mapped image.

[0134] In a specific implementation, the electronic device can pre-store the mapping relationship between preset parameter statistical information and nonlinear mapping configuration parameters. Then, based on the mapping relationship between the preset parameter statistical information and the nonlinear mapping configuration parameters, the target nonlinear mapping configuration parameters corresponding to the target parameter statistical information can be determined, and the first filtered image can be nonlinearly mapped according to the target nonlinear mapping configuration parameters to obtain a mapped image.

[0135] To illustrate with an example, the nonlinear mapping can be as follows: A theory of nonlinearly adjusting the overall brightness distribution of an image is proposed below. The idea is to simulate the light adjustment processing of the human eye retina system in darker and extremely bright environments, which not only maintains the integrity of the overall pixel information of the image, but also improves the contrast of the image.

[0136] When the model is curve LA, the calculation formula can be:

[0137]

[0138] When the model is the curve LA_inv, the calculation formula can be:

[0139]

[0140] Among them, Y represents the image brightness value, Y sym Indicates the brightness value of the processed image. low and H high Represents the adaptive adjustment factor, T represents the threshold of low grayscale and high grayscale of the image. If the brightness value of a pixel in the image is less than T, the pixel is enhanced / suppressed; if the brightness value of a pixel in the image is greater than T, the pixel is suppressed / enhanced.

[0141] The key parameters are T and H. low and H high The calculation method can be as follows:

[0142] 1) Calculate the threshold T

[0143]

[0144] Among them, G represents the centroid value of the image, Y filter represents the filtered brightness image, A represents the amplitude of the T model, and B represents the bias of the T model.

[0145] 2) Calculate H low :

[0146] H low (i,j)=Y filter (i,j)+C×Y mlow

[0147] Among them, Y filter represents the brightness image after JND filtering; C represents the intensity coefficient of low grayscale enhancement / suppression of the image; Y mlow Indicates that the pixel value in the image is less than the mean of the corresponding T value:

[0148]

[0149] Y mlow =Thr2,Y mlow <Thr2 or ∑Y(i,j)=0

[0150] Among them, ∑Y(i,j) represents the accumulated value of pixels that satisfy the condition Y(i,j)<T(i,j), ∑(Y(i,j)<T(i,j)) represents the number of pixels that satisfy the condition Y(i,j)<T(i,j), and Thr2 represents Y mlow The lower threshold of .

[0151] 3) Calculate H high :

[0152] H high (i,j)=D×Y filter (i,j)×(1-Y mhigh )

[0153] Among them, Y filter represents the brightness image after filtering; D represents the intensity coefficient of high gray level suppression / enhancement of the image; Y mhigh Represents the average value of all brightness greater than T in the image:

[0154]

[0155] Y mhigh =1-Thr2,Y mhigh >1-Thr2 or ∑Y(i,j)=0

[0156] Among them, ∑Y(i,j) represents the accumulated value of pixels that satisfy the condition Y(i,j)>T(i,j), ∑(Y(i,j)>T(i,j)) represents the number of pixels that satisfy the condition Y(i,j)>T(i,j), and 1-Thr2 represents Y mhigh The upper threshold of

[0157] 104. Perform global contrast enhancement processing on the mapped image using the histogram statistical information after the nonlinear mapping of the (n-1)th frame image to obtain an enhanced image.

[0158] Among them, global contrast enhancement can be achieved based on histogram technology, including platform histogram, dual platform histogram, CLAHE, ACE algorithm, etc., all for improving the global contrast of the image.

[0159] For example, the histogram mapping rule MAP is:

[0160]

[0161] Among them, Bin represents the grayscale level of the image, and the default value is 255 (for 8bi images, it is 1023 for 10bit images).

[0162] Image processing result Y clahe for:

[0163] Y clahe (i,y)=MAP(Y sym (i,j)+1)

[0164] Among them, Y sym (i, j) represents the pixel to be processed, Y clahe (i, j) represents the pixel after enhancement processing.

[0165] In a possible example, the above step 104, using the histogram statistical information after the nonlinear mapping of the n-1th frame image to perform global contrast enhancement processing on the mapped image to obtain an enhanced image, may include the following steps:

[0166] 41. Determine a target global contrast enhancement control parameter according to the histogram statistical information after nonlinear mapping of the n-1th frame image;

[0167] 42. Perform global contrast enhancement processing on the mapped image according to the target global contrast enhancement control parameter to obtain an enhanced image.

[0168] In a specific implementation, the global contrast enhancement control parameter may include a global contrast enhancement algorithm and its corresponding control parameters. The global contrast enhancement algorithm may include at least one of the following: platform histogram, dual platform histogram, CLAHE, ACE algorithm, which is not limited here. Each global contrast enhancement algorithm corresponds to a corresponding control parameter, and the control parameter is used to adjust the global contrast enhancement effect.

[0169] In a specific implementation, a mapping relationship between histogram statistical information and global contrast enhancement control parameters can be pre-set in the electronic device, and then the target global contrast enhancement control parameters can be determined based on the histogram statistical information after nonlinear mapping of the n-1th frame image of the mapping relationship, and the mapped image can be globally contrast enhanced according to the target global contrast enhancement control parameters to obtain an enhanced image. In this way, the global enhancement effect can be improved based on the statistical information.

[0170] 105. Perform filtering processing on the enhanced image to obtain a second filtered image.

[0171] Among them, the electronic device can use at least one filter to filter the enhanced image to obtain a second filtered image, wherein the filter can be at least one of the following: a guided filter, a curvature filter, a WLS filter, a domain transformation RF filter, a LEP filter, etc., which are not limited here.

[0172] In a possible example, the above step 105, filtering the enhanced image to obtain a second filtered image, may include the following steps:

[0173] 51. Extract feature points from the enhanced image to obtain P feature points, where P is an integer greater than 1;

[0174] 52. Determine the centers of the P feature points;

[0175] 53. Select feature points within a first preset radius with the center as the circle center to obtain Q feature points, where Q is a positive integer less than P;

[0176] 54. Draw a circle with each of the Q feature points as the center and within a second preset radius to obtain Q circles, and take the feature points in each circle as a cluster to obtain Q clusters;

[0177] 55. Determine the energy value corresponding to each of the Q clusters to obtain Q energy values;

[0178] 56. Determine the mean square error of the Q energy values ​​to obtain the energy mean square error;

[0179] 57. Determine the target filtering parameter corresponding to the energy mean square error according to the preset mapping relationship between the mean square error and the filtering parameter;

[0180] 58. Perform filtering processing on the enhanced image according to the target filtering parameters to obtain the second filtered image.

[0181] Among them, in the specific implementation, in the embodiment of the present application, the first preset radius and the second preset radius can be set by the user or by the system default. The electronic device can extract feature points from the enhanced image to obtain P feature points, where P is an integer greater than 1. The specific extraction algorithm of the feature points can be at least one of the following: Harris corner point detection algorithm, scale-invariant feature extraction algorithm, etc. The center of the P feature points can also be determined, and feature points within the first preset radius with the center as the center of the circle can be selected to obtain Q feature points, where Q is a positive integer less than the P. Next, the electronic device can use each of the Q feature points as the center of the circle and draw a circle within a second preset radius range to obtain Q circles, use the feature points in each circle as a cluster to obtain Q clusters, determine the energy value corresponding to each cluster in the Q clusters to obtain Q energy values, and determine the mean square error of the Q energy values ​​to obtain the energy mean square error. The energy mean square error reflects the differences in the area of ​​the image. The electronic device can pre-store a mapping relationship between the preset mean square error and the filtering parameters. Then, the electronic device can determine the target filtering parameters corresponding to the energy mean square error according to the mapping relationship between the preset mean square error and the filtering parameters. In the embodiment of the present application, the filtering parameters can be at least one of the following: a filter type, a control parameter of the filter, wherein the control parameter of the filter is used to control the degree of filtering. Then, the electronic device can filter the enhanced image according to the target filtering parameters to obtain a second filtered image. In this way, targeted filtering can be achieved based on the differences in neighboring areas of the image, thereby improving the quality of the image after filtering.

[0182] 106. Perform local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image.

[0183] In a specific implementation, the electronic device may divide the enhanced image into multiple regions, determine the mean square error of each region, and then determine the regions where the mean square error is greater than a preset value, and perform contrast enhancement processing on these regions to obtain an output image.

[0184] In a possible example, the above step 106, performing local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image, may include the following steps:

[0185] 61. Divide the enhanced image into a plurality of independent regions;

[0186] 62. Determine the mean square error of each of the multiple independent regions to obtain multiple mean square errors;

[0187] 63. Select a mean square error greater than a preset value from the multiple mean square errors to obtain at least one target mean square error, and obtain a region corresponding to the at least one mean square error to obtain at least one target region;

[0188] 64. Perform contrast enhancement processing on the at least one target area to obtain the output image.

[0189] Among them, the above preset value can be set by the user or by the system default. In a specific implementation, the electronic device can divide the enhanced image into multiple independent areas, and the area size of each independent area can be equal or unequal. Furthermore, the mean square error of each area in the multiple independent areas can be determined to obtain multiple mean square errors, and a mean square error greater than the preset value can be selected from the multiple mean square errors to obtain at least one target mean square error, and the area corresponding to the at least one mean square error can be obtained to obtain at least one target area, and contrast enhancement processing is performed on the at least one target area to obtain an output image. In this way, local contrast enhancement can be performed on areas with large differences within the area.

[0190] Furthermore, when the output image is a grayscale image, the color of the output image can be restored. Specifically, the output image can be restored to a color image, that is, the color image C output for display is:

[0191]

[0192] Among them, R(i,j) is the red component of the input image, R out (i, j) is the red component of the processed image; G(i, j) is the red component of the input image, G out (i, j) is the red component of the processed image; B(i, j) is the red component of the input image, B out (i, j) is the red component of the processed image; that is, R out(i,j),G out (i,j) and B out The three channels (i, j) form a color image, and ε = 0.01 prevents the denominator from being divided by 0 when I(i, j) = 0. The linear operation ensures that the proportional relationship of the three components of R, G, and B of each pixel point remains unchanged when the enhanced brightness image is restored to color, so that the image color information can be effectively maintained without causing new colors or inconsistent colors. If the input image is a grayscale image, this step is not performed.

[0193] In the specific implementation, Figure 1E As shown, a template can be established and filtered with the unprocessed pixel of the input image (nth frame image) as the center to obtain a first filtered image. Then, the first filtered image can be nonlinearly mapped through the parameter statistics of the previous frame (n-1th frame image) to obtain a mapped image. The mapped image can be globally contrast enhanced to obtain an enhanced image. The enhanced image can be filtered based on the filter to obtain a second filtered image. The second filtered image can be locally contrast enhanced to output an image. Similarly, the above processing can be performed on all pixel templates in the image in a sliding traversal manner to output the processed image.

[0194] It can be seen that the image enhancement method described in the embodiment of the present application obtains the nth frame image, where n is an integer greater than 1, constructs a target template with the unprocessed pixel points in the nth frame image as the center, and performs a first filtering based on the target template to obtain a first filtered image, performs nonlinear mapping on the first filtered image based on the target parameter statistical information of the n-1th frame image to obtain a mapped image, the n-1th frame image is the previous frame image of the n-1th frame image, and uses the histogram statistical information after the nonlinear mapping of the n-1th frame image to perform global contrast enhancement processing on the mapped image to obtain an enhanced image, performs filtering processing on the enhanced image to obtain a second filtered image, and performs local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image. In this way, the current frame image can be filtered, and the current frame can be mapped, globally contrast enhanced, filtered, and locally contrast enhanced based on the statistical information of the previous frame image, which helps to improve image quality and ensure the continuity between video images, and the enhancement effect is better for the human eye.

[0195] With the above Figure 1B For details on the embodiments shown in the drawings, please refer to Figure 2 , Figure 2 It is a flow chart of an image enhancement method provided in an embodiment of the present application, which is applied to an electronic device. As shown in the figure, the image enhancement method includes the following steps.

[0196] 201. Obtain the nth frame image, where n is an integer greater than 1.

[0197] 202. Determine a target image quality evaluation value of the nth image frame.

[0198] 203. When the target image quality evaluation value is less than a preset image quality evaluation threshold, a target template is constructed with the unprocessed pixel points in the nth frame image as the center, and a first filtering is performed based on the target template to obtain a first filtered image.

[0199] 204. Perform nonlinear mapping on the first filtered image based on target parameter statistical information of the n-1th frame image to obtain a mapped image, wherein the n-1th frame image is a previous frame image of the nth frame image.

[0200] 205. Perform global contrast enhancement processing on the mapped image using the histogram statistical information after the nonlinear mapping of the (n-1)th frame image to obtain an enhanced image.

[0201] 206. Perform filtering processing on the enhanced image to obtain a second filtered image.

[0202] 207. Perform local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image.

[0203] The detailed description of the above steps 201 to 207 can be found in the above Figure 1B The corresponding steps of the described image enhancement method will not be repeated here.

[0204] It can be seen that the image enhancement method described in the embodiment of the present application can filter the current frame image, and map, globally enhance the contrast, filter, and locally enhance the contrast of the current frame based on the statistical information of the previous frame image, which helps to improve the image quality and ensure the continuity between video images. The enhancement effect is better for the human eye.

[0205] With the above Figure 1B , Figure 2 For details on the embodiments shown in the drawings, please refer to Figure 3 , Figure 3 3 is a schematic diagram of the structure of an electronic device 300 provided in an embodiment of the present application. As shown in the figure, the electronic device 300 includes a processor 310, a memory 320, a communication interface 330, and one or more programs 321, wherein the one or more programs 321 are stored in the above-mentioned memory 320 and are configured to be executed by the above-mentioned processor 310, and the one or more programs 321 include instructions for executing any step in the above-mentioned method embodiment:

[0206] Get the nth frame image, where n is an integer greater than 1;

[0207] Taking the unprocessed pixel points in the n-th frame image as the center, constructing a target template, and performing a first filtering based on the target template to obtain a first filtered image;

[0208] Performing nonlinear mapping on the first filtered image based on target parameter statistical information of the n-1th frame image to obtain a mapped image, wherein the n-1th frame image is a previous frame image of the nth frame image;

[0209] Performing global contrast enhancement processing on the mapped image using the histogram statistical information after nonlinear mapping of the n-1th frame image to obtain an enhanced image;

[0210] Performing filtering on the enhanced image to obtain a second filtered image;

[0211] Based on the enhanced image, local contrast enhancement processing is performed on the second filtered image to obtain an output image.

[0212] It can be seen that the electronic device described in the embodiment of the present application obtains the nth frame image, where n is an integer greater than 1, constructs a target template with the unprocessed pixel points in the nth frame image as the center, and performs a first filtering based on the target template to obtain a first filtered image, performs nonlinear mapping on the first filtered image based on the target parameter statistical information of the n-1th frame image to obtain a mapped image, the n-1th frame image is the previous frame image of the n-1th frame image, and uses the histogram statistical information after the nonlinear mapping of the n-1th frame image to perform global contrast enhancement processing on the mapped image to obtain an enhanced image, filters the enhanced image to obtain a second filtered image, and performs local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image. In this way, the current frame image can be filtered, and the current frame can be mapped, globally contrast enhanced, filtered, and locally contrast enhanced based on the statistical information of the previous frame image, which helps to improve image quality and ensure the continuity between video images, and the enhancement effect is better for the human eye.

[0213] In one possible example, in the aspect of performing nonlinear mapping on the first filtered image based on the target parameter statistics information of the n-1th frame image to obtain the mapped image, the one or more programs 321 include programs for executing:

[0214] Determining the target nonlinear mapping configuration parameter corresponding to the target parameter statistical information according to the preset mapping relationship between the parameter statistical information and the nonlinear mapping configuration parameter;

[0215] Nonlinear mapping is performed on the first filtered image according to the target nonlinear mapping configuration parameters to obtain the mapped image.

[0216] In a possible example, in the aspect of performing global contrast enhancement processing on the mapped image by using the histogram statistics information after the nonlinear mapping of the n-1th frame image to obtain the enhanced image, the one or more programs 321 include programs for executing:

[0217] Determining a target global contrast enhancement control parameter according to the histogram statistical information of the n-1th frame image after nonlinear mapping;

[0218] The mapped image is subjected to global contrast enhancement processing according to the target global contrast enhancement control parameter to obtain an enhanced image.

[0219] In one possible example, in the aspect of filtering the enhanced image to obtain the second filtered image, the one or more programs 321 include programs for executing:

[0220] Extracting feature points from the enhanced image to obtain P feature points, where P is an integer greater than 1;

[0221] Determine the centers of the P feature points;

[0222] Selecting feature points within a first preset radius with the center as the circle center to obtain Q feature points, where Q is a positive integer less than P;

[0223] Taking each of the Q feature points as the center of a circle and drawing a circle within a second preset radius to obtain Q circles, taking the feature points in each circle as a cluster to obtain Q clusters;

[0224] Determine the energy value corresponding to each of the Q clusters to obtain Q energy values;

[0225] Determine the mean square error of the Q energy values ​​to obtain an energy mean square error;

[0226] According to a preset mapping relationship between the mean square error and the filtering parameters, a target filtering parameter corresponding to the energy mean square error is determined;

[0227] The enhanced image is filtered according to the target filtering parameters to obtain the second filtered image.

[0228] In a possible example, in the aspect of performing local contrast enhancement processing on the second filtered image based on the enhanced image to obtain the output image, the one or more programs 321 include programs for executing:

[0229] dividing the enhanced image into a plurality of independent regions;

[0230] Determine the mean square error of each of the plurality of independent regions to obtain a plurality of mean square errors;

[0231] Selecting a mean square error greater than a preset value from the multiple mean square errors to obtain at least one target mean square error, and acquiring a region corresponding to the at least one mean square error to obtain at least one target region;

[0232] Performing contrast enhancement processing on the at least one target area to obtain the output image.

[0233] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the execution process on the method side. It is understandable that, in order to realize the above functions, the electronic device includes a hardware structure and / or software module corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0234] The embodiment of the present application can divide the electronic device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0235] Figure 4 4 is a functional unit block diagram of an image enhancement device 400 involved in an embodiment of the present application. The image enhancement device 400 is applied to an electronic device, and the image enhancement device 400 includes an acquisition unit 401, a first filtering unit 402, a mapping unit 403, a global enhancement unit 404, a second filtering unit 405 and a local enhancement unit 406, wherein:

[0236] The acquisition unit 401 is used to acquire the n-th frame image, where n is an integer greater than 1;

[0237] The first filtering unit 402 is used to construct a target template with the unprocessed pixel points in the n-th frame image as the center, and perform a first filtering based on the target template to obtain a first filtered image;

[0238] The mapping unit 403 is used to perform nonlinear mapping on the first filtered image based on the target parameter statistical information of the n-1th frame image to obtain a mapped image, wherein the n-1th frame image is a previous frame image of the nth frame image;

[0239] The global enhancement unit 404 is used to perform global contrast enhancement processing on the mapped image using the histogram statistical information after the nonlinear mapping of the n-1th frame image to obtain an enhanced image;

[0240] The second filtering unit 405 is used to filter the enhanced image to obtain a second filtered image;

[0241] The local enhancement unit 406 is used to perform local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image.

[0242] It can be seen that the image enhancement device described in the embodiment of the present application obtains the nth frame image, where n is an integer greater than 1, constructs a target template with the unprocessed pixel points in the nth frame image as the center, and performs a first filtering based on the target template to obtain a first filtered image, performs nonlinear mapping on the first filtered image based on the target parameter statistical information of the n-1th frame image to obtain a mapped image, the n-1th frame image is the previous frame image of the n-1th frame image, and uses the histogram statistical information after the nonlinear mapping of the n-1th frame image to perform global contrast enhancement processing on the mapped image to obtain an enhanced image, filters the enhanced image to obtain a second filtered image, and performs local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image. In this way, the current frame image can be filtered, and the current frame can be mapped, globally contrast enhanced, filtered, and locally contrast enhanced based on the statistical information of the previous frame image, which helps to improve image quality and ensure the continuity between video images, and the enhancement effect is better for the human eye.

[0243] In a possible example, in performing nonlinear mapping on the first filtered image based on the target parameter statistical information of the n-1th frame image to obtain the mapped image, the mapping unit 403 is specifically used to:

[0244] Determining the target nonlinear mapping configuration parameter corresponding to the target parameter statistical information according to the preset mapping relationship between the parameter statistical information and the nonlinear mapping configuration parameter;

[0245] Nonlinear mapping is performed on the first filtered image according to the target nonlinear mapping configuration parameters to obtain the mapped image.

[0246] In a possible example, in the aspect of performing global contrast enhancement processing on the mapped image by using the histogram statistical information after the nonlinear mapping of the n-1th frame image to obtain the enhanced image, the global enhancement unit 404 is specifically used for:

[0247] Determining a target global contrast enhancement control parameter according to the histogram statistical information of the n-1th frame image after nonlinear mapping;

[0248] The mapped image is subjected to global contrast enhancement processing according to the target global contrast enhancement control parameter to obtain an enhanced image.

[0249] In a possible example, in the aspect of filtering the enhanced image to obtain the second filtered image, the second filtering unit 405 is specifically used for:

[0250] Extracting feature points from the enhanced image to obtain P feature points, where P is an integer greater than 1;

[0251] Determine the centers of the P feature points;

[0252] Selecting feature points within a first preset radius with the center as the circle center to obtain Q feature points, where Q is a positive integer less than P;

[0253] Taking each of the Q feature points as the center of a circle and drawing a circle within a second preset radius to obtain Q circles, taking the feature points in each circle as a cluster to obtain Q clusters;

[0254] Determine the energy value corresponding to each of the Q clusters to obtain Q energy values;

[0255] Determine the mean square error of the Q energy values ​​to obtain an energy mean square error;

[0256] According to a preset mapping relationship between the mean square error and the filtering parameters, a target filtering parameter corresponding to the energy mean square error is determined;

[0257] The enhanced image is filtered according to the target filtering parameters to obtain the second filtered image.

[0258] In a possible example, in the aspect of performing local contrast enhancement processing on the second filtered image based on the enhanced image to obtain the output image, the local enhancement unit 406 is specifically used to:

[0259] dividing the enhanced image into a plurality of independent regions;

[0260] Determine the mean square error of each of the plurality of independent regions to obtain a plurality of mean square errors;

[0261] Selecting a mean square error greater than a preset value from the multiple mean square errors to obtain at least one target mean square error, and acquiring a region corresponding to the at least one mean square error to obtain at least one target region;

[0262] Performing contrast enhancement processing on the at least one target area to obtain the output image.

[0263] The acquisition unit, the first filtering unit, the mapping unit, the global enhancement unit, the second filtering unit and the local enhancement unit may be processors.

[0264] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.

[0265] The embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes an electronic device.

[0266] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0267] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0268] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the above-mentioned units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0269] The units described above 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 on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0270] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0271] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or CD-ROM and other media that can store program codes.

[0272] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk or an optical disk, etc.

[0273] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An image enhancement method, characterized in that: The method comprises: Get the nth frame image, where n is an integer greater than 1; Taking the unprocessed pixel points in the n-th frame image as the center, constructing a target template, and performing a first filtering based on the target template to obtain a first filtered image; Performing nonlinear mapping on the first filtered image based on target parameter statistical information of the n-1th frame image to obtain a mapped image, wherein the n-1th frame image is a previous frame image of the nth frame image; Performing global contrast enhancement processing on the mapped image using the histogram statistical information after nonlinear mapping of the n-1th frame image to obtain an enhanced image; Performing filtering on the enhanced image to obtain a second filtered image; Performing local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image; The filtering of the enhanced image to obtain a second filtered image includes: Extracting feature points from the enhanced image to obtain P feature points, where P is an integer greater than 1; Determine the centers of the P feature points; Selecting feature points within a first preset radius with the center as the circle center to obtain Q feature points, where Q is a positive integer less than P; Taking each of the Q feature points as the center of a circle and drawing a circle within a second preset radius to obtain Q circles, taking the feature points in each circle as a cluster to obtain Q clusters; Determine the energy value corresponding to each of the Q clusters to obtain Q energy values; Determine the mean square error of the Q energy values ​​to obtain an energy mean square error; According to a preset mapping relationship between the mean square error and the filtering parameters, a target filtering parameter corresponding to the energy mean square error is determined; the filtering parameters include at least one of the following: a filter type, a control parameter of the filter; wherein the control parameter of the filter is used to control the degree of filtering; The enhanced image is filtered according to the target filtering parameters to obtain the second filtered image.

2. The method according to claim 1, characterized in that The nonlinear mapping of the first filtered image based on the target parameter statistical information of the n-1th frame image to obtain a mapped image includes: Determining the target nonlinear mapping configuration parameter corresponding to the target parameter statistical information according to the preset mapping relationship between the parameter statistical information and the nonlinear mapping configuration parameter; Nonlinear mapping is performed on the first filtered image according to the target nonlinear mapping configuration parameters to obtain the mapped image.

3. The method according to claim 1 or 2, characterized in that: The step of performing global contrast enhancement processing on the mapped image using the histogram statistical information after nonlinear mapping of the n-1th frame image to obtain an enhanced image comprises: Determining a target global contrast enhancement control parameter according to the histogram statistical information of the n-1th frame image after nonlinear mapping; The mapped image is subjected to global contrast enhancement processing according to the target global contrast enhancement control parameter to obtain an enhanced image.

4. The method according to claim 1 or 2, characterized in that: The performing local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image comprises: dividing the enhanced image into a plurality of independent regions; Determine the mean square error of each of the plurality of independent regions to obtain a plurality of mean square errors; Selecting a mean square error greater than a preset value from the multiple mean square errors to obtain at least one target mean square error, and acquiring a region corresponding to the at least one mean square error to obtain at least one target region; Performing contrast enhancement processing on the at least one target area to obtain the output image.

5. An image enhancement device, characterized in that: The device comprises: an acquisition unit, a first filtering unit, a mapping unit, a global enhancement unit, a second filtering unit and a local enhancement unit, wherein the acquisition unit is used to acquire an n-th frame image, where n is an integer greater than 1; The first filtering unit is used to construct a target template with the unprocessed pixel points in the n-th frame image as the center, and perform a first filtering based on the target template to obtain a first filtered image; The mapping unit is used to perform nonlinear mapping on the first filtered image based on target parameter statistical information of the n-1th frame image to obtain a mapped image, wherein the n-1th frame image is a previous frame image of the nth frame image; The global enhancement unit is used to perform global contrast enhancement processing on the mapped image using the histogram statistical information after the nonlinear mapping of the n-1th frame image to obtain an enhanced image; The second filtering unit is used to filter the enhanced image to obtain a second filtered image; The local enhancement unit is used to perform local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image; The filtering process of the enhanced image to obtain a second filtered image includes: Extracting feature points from the enhanced image to obtain P feature points, where P is an integer greater than 1; Determine the centers of the P feature points; Selecting feature points within a first preset radius with the center as the circle center to obtain Q feature points, where Q is a positive integer less than P; Taking each of the Q feature points as the center of a circle and drawing a circle within a second preset radius to obtain Q circles, taking the feature points in each circle as a cluster to obtain Q clusters; Determine the energy value corresponding to each of the Q clusters to obtain Q energy values; Determine the mean square error of the Q energy values ​​to obtain an energy mean square error; According to a preset mapping relationship between the mean square error and the filtering parameters, a target filtering parameter corresponding to the energy mean square error is determined; the filtering parameters include at least one of the following: a filter type, a control parameter of the filter; wherein the control parameter of the filter is used to control the degree of filtering; The enhanced image is filtered according to the target filtering parameters to obtain the second filtered image.

6. The device according to claim 5, characterized in that In the aspect of performing nonlinear mapping on the first filtered image based on the target parameter statistical information of the n-1th frame image to obtain the mapped image, the mapping unit is specifically used for: Determining the target nonlinear mapping configuration parameter corresponding to the target parameter statistical information according to the preset mapping relationship between the parameter statistical information and the nonlinear mapping configuration parameter; Nonlinear mapping is performed on the first filtered image according to the target nonlinear mapping configuration parameters to obtain the mapped image.

7. The device according to claim 5 or 6, characterized in that In the aspect of performing global contrast enhancement processing on the mapped image by using the histogram statistical information after the nonlinear mapping of the n-1th frame image to obtain the enhanced image, the global enhancement unit is specifically used for: Determining a target global contrast enhancement control parameter according to the histogram statistical information of the n-1th frame image after nonlinear mapping; The mapped image is subjected to global contrast enhancement processing according to the target global contrast enhancement control parameter to obtain an enhanced image.

8. An electronic device, characterized in that: The method comprises a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for executing the steps in the method according to any one of claims 1 to 4.

9. A computer-readable storage medium, characterized in that: A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Video image processing method

    CN101340512A

  • An infrared image basic layer processing method and system based on a filtering layering framework

    CN109741276A