Image enhancement apparatus, related method, electronic device, medium, and program product
By filtering, nonlinear mapping and global local contrast enhancement processing on the images of electronic devices, the problem of improving image quality is solved and better visual effects and video image continuity is achieved.
Patent Information
- Application Number
- CN202510342243.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-28
- Publication Date
- 2025-08-15
AI Technical Summary
How to improve the quality of electronic equipment photography images to improve users' evaluation of the equipment.
By acquiring the n-th frame image, the target template is constructed for filtering, and nonlinear mapping and global local contrast enhancement processing are performed based on the target parameter statistics of the previous frame image, including nonlinear mapping, global contrast enhancement and local contrast enhancement.
Improve image quality, ensure continuity between video images, and enhance the visual effect of the image.
Smart Images

Figure CN120495152A_ABST
Abstract
Description
[0001] This application is a divisional application of the Chinese patent application filed with the China Patent Office on September 28, 2020, with application number 202011045831.2 and application name “Image Enhancement Method and Related Products”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of image processing technology, and in particular to an image enhancement device, related methods, electronic equipment, media, and program products. Background Art
[0003] With the rapid development of electronic technology, taking photos has become an increasingly standard technology for electronic devices (such as mobile phones, tablets, etc.). When taking photos, users have increasingly 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
[0004] The embodiments of the present application provide an image enhancement device, related methods, electronic equipment, media, and program products that can improve image quality.
[0005] In a first aspect, an embodiment of the present application provides an image enhancement method, the method comprising:
[0006] Get the nth frame image, where n is an integer greater than 1;
[0007] Constructing a target template with an unprocessed pixel in the n-th frame image as the center, and performing a first filtering based on the target template to obtain a first filtered image;
[0008] 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 frame image previous to the nth frame image;
[0009] Performing global contrast enhancement processing on the mapped image using histogram statistical information after nonlinear mapping of the (n-1)th frame image to obtain an enhanced image;
[0010] performing filtering processing on the enhanced image to obtain a second filtered image;
[0011] Performing local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image.
[0012] In a second aspect, an embodiment of the present application provides an image enhancement 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:
[0013] The acquisition unit is used to acquire the n-th frame image, where n is an integer greater than 1;
[0014] The first filtering unit is configured to construct a target template with an unprocessed pixel 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;
[0015] The mapping unit is configured 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 frame image previous to the nth frame image;
[0016] The global enhancement unit is configured to perform global contrast enhancement processing on the mapped image using the histogram statistical information after nonlinear mapping of the (n-1)th frame image to obtain an enhanced image;
[0017] The second filtering unit is configured to perform filtering on the enhanced image to obtain a second filtered image;
[0018] The local enhancement unit is configured to perform local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image.
[0019] 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 comprises instructions for executing the steps of any method of the first aspect of the embodiment of the present application.
[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the above-mentioned computer-readable storage medium stores a computer program for electronic data exchange, wherein the above-mentioned 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.
[0021] In a fifth aspect, embodiments of the present application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, wherein 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 embodiments of the present application. The computer program product may be a software installation package.
[0022] The embodiments of the present application have the following beneficial effects:
[0023] It can be seen that the image enhancement device, related method, electronic device, medium and program product described in the embodiments of the present application obtain an n-th frame image, where n is an integer greater than 1, 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 first filtered image is nonlinearly mapped based on the target parameter statistical information of the n-1-th frame image to obtain a mapped image. The n-1-th frame image is the previous frame image of the n-1-th frame image. The mapped image is globally contrast enhanced using the histogram statistical information after the nonlinear mapping of the n-1-th frame image to obtain an enhanced image. The enhanced image is filtered to obtain a second filtered image. The second filtered image is locally contrast enhanced 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. The enhancement effect is better and more suitable for the human eye. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. 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 any creative work.
[0025] Figure 1A This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0026] Figure 1B This is a flow chart of an image enhancement method provided in an embodiment of the present application;
[0027] Figure 1C This is a schematic diagram illustrating an S-curve provided in an embodiment of the present application;
[0028] Figure 1D This is a schematic diagram illustrating the operation of parameter statistics information provided by an embodiment of the present application;
[0029] Figure 1E is a flow chart of another image enhancement method provided in an embodiment of the present application;
[0030] Figure 2 is a flow chart of another image enhancement method provided in an embodiment of the present application;
[0031] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0032] Figure 4 This is a block diagram of the functional units of an image enhancement device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0034] The terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.
[0035] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0036] 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, tablets, 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.
[0037] See Figure 1A , Figure 1AThis 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, memory, a signal processor, a transceiver, a display, a speaker, a microphone, a random access memory (RAM), a camera, a sensor, and a communication module. The memory, signal processor, display, speaker, microphone, RAM, camera, sensor, and communication module are connected to the processor, and the transceiver is connected to the signal processor.
[0038] 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 (AMOLED), or the like.
[0039] The camera may be a normal 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.
[0040] 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. 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. 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 electrical signal into a digital signal. Optionally, the light sensor may further 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 photosensitive element may include at least one of a photodiode, a phototransistor, a photoresistor, and a silicon photocell.
[0041] 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. By running or executing software programs and / or modules stored in the memory and calling data stored in the memory, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole.
[0042] The processor may integrate an application processor and a modem processor. The application processor primarily processes the operating system, user interface, and application programs, while the modem processor primarily processes wireless communications. It is understood that the modem processor may not be integrated into the processor. The processor may be at least one of the following: an ISP, a CPU, a GPU, an NPU, and the like, without limitation.
[0043] The memory is used to store software programs and / or modules. The processor executes the 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. The program storage area may store the operating system, at least one software program required for a function, etc.; the data storage area may store data created based on the use of the electronic device, etc. In addition, the memory may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0044] The communication module may be used to implement a communication function, and the communication module may be at least one of the following: an infrared module, a Bluetooth module, a mobile communication module, an NFC module, a Wi-Fi module, etc., which are not limited here.
[0045] The following is a detailed introduction to the embodiments of the present application.
[0046] See also Figure 1B , Figure 1B The present invention provides a flow chart 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.
[0047] 101. Obtain the nth frame image, where n is an integer greater than 1.
[0048] The n-th frame image is a frame image in the video to be processed, and n is an integer greater than 1, that is, the n-th frame image is not the first frame image.
[0049] In a specific implementation, the nth frame image can be a grayscale image or a color image. For example, when the nth frame image is a color image, it can be converted into a grayscale image before executing step 102. This can be achieved by the following formula:
[0050] Y=0.299R+0.587G+0.114B
[0051] Among them, Y represents a grayscale image (brightness image), R, G, and B are the three color components of the n-th 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.
[0052] In a possible example, the following steps may be further included between step 101 and step 102:
[0053] A1. performing multi-scale feature decomposition on the n-th frame image to obtain low-frequency feature components and high-frequency feature components;
[0054] A2. Dividing the low-frequency characteristic component into multiple regions;
[0055] A3. Determine the information entropy corresponding to each of the multiple regions to obtain multiple information entropies;
[0056] A4. Determine an average information entropy and a target mean square error based on the multiple information entropies;
[0057] A5. Determine a target adjustment coefficient corresponding to the target mean square error;
[0058] A6. Adjust the average information entropy according to the target adjustment coefficient to obtain a target information entropy;
[0059] A7. Determine a first evaluation value corresponding to the target information entropy according to a preset mapping relationship between information entropy and evaluation value;
[0060] A8. Obtain target shooting parameters corresponding to the n-th frame image;
[0061] 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 based on the target low-frequency weight;
[0062] A10, determining the distribution density of target feature points based on the high-frequency feature components;
[0063] 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;
[0064] A12. Perform a weighted operation based on 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 n-th frame image;
[0065] A13. When the target image quality evaluation value is less than the preset image quality evaluation threshold, execute step 102; otherwise, do not execute step 102.
[0066] 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.
[0067] Furthermore, the electronic device can determine the information entropy corresponding to each of the multiple regions, obtaining multiple information entropies, and determine the average information entropy and target mean square error based on the multiple information entropies. The information entropy reflects the amount of image information to a certain extent, while the mean square error reflects 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, based on this mapping relationship, a target adjustment coefficient corresponding to the target mean square error can be determined. 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.
[0068] Furthermore, the electronic device can 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 can pre-store a preset mapping relationship between information entropy and evaluation values, and then, according to the preset mapping relationship between information entropy and evaluation values, determine the first evaluation value corresponding to the target information entropy.
[0069] In addition, the electronic device can obtain the target shooting parameters corresponding to the nth frame image. The target shooting parameters can be at least one of the following: ISO sensitivity, 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 a mapping relationship between preset shooting parameters and low-frequency weights. Then, according to the mapping relationship between the preset shooting parameters and low-frequency weights, the target low-frequency weight corresponding to the target shooting parameter can be determined, and the target high-frequency weight can be determined based on the target low-frequency weight, where the target low-frequency weight + the target high-frequency weight = 1.
[0070] Furthermore, the electronic device can determine the target feature point distribution density based on the high-frequency feature component, where target feature point distribution density = total number of feature points of the high-frequency feature component / area of the region. The electronic device can also pre-store a preset mapping relationship between feature point distribution density and evaluation value. Then, according to the preset mapping relationship between feature point distribution density and evaluation value, a second evaluation value corresponding to the target feature point distribution density can be determined. 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:
[0071] Target image quality evaluation value = first evaluation value * target low frequency weight + second evaluation value * target high frequency weight
[0072] 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.
[0073] 102. Construct a target template with the unprocessed pixel 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.
[0074] In a specific implementation, the image boundary can be mirrored and extended based on the sliding of the template window to process the image boundary. Furthermore, 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 centered on one or more unprocessed pixels in the nth frame image. The template can be an m*n template, where m and n can be positive integers. Based on this template, the nth frame image can be subjected to sliding filtering to obtain the first filtered image.
[0075] 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.
[0076] 103. Perform nonlinear mapping on the first filtered image based on target parameter statistical information of the (n-1)th frame image to obtain a mapped image, where the (n-1)th frame image is a frame image previous to the (n)th frame image.
[0077] In the embodiment of the present application, the target parameter statistical information of the (n-1)th frame image can be at least one of the following: the direction of the S-curve, the intensity coefficient C of low-grayscale enhancement / suppression, the intensity coefficient D of high-grayscale enhancement / suppression, the center of gravity G of the image, etc., which are not limited here. The nonlinear mapping can be a mapping function, such as tone mapping or other mapping, which are not limited here.
[0078] In the embodiment of this application, 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).
[0079] In specific implementation, the S-curve direction judgment can be achieved in the following ways:
[0080] ①. Image preprocessing, convert image grayscale value to 6bit.
[0081] ②. Statistical histogram of 6-bit image:
[0082] p(s k )=n k k=0,1,…,L-1
[0083] 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:
[0084]
[0085] Where n is the total number of image pixels.
[0086] ③ Statistical image histogram low gray level accumulation and CL
[0087]
[0088] 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, and Sn is the empirical value.
[0089] ④ Statistical image histogram high gray level accumulation and CH
[0090]
[0091] 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.
[0092] ⑤、The S-curve direction opt_alg is as follows:
[0093]
[0094] Among them, Thr1 is the experience value.
[0095] In specific implementation, such as Figure 1D As shown in the video processing, if the local contrast enhancement LCE processing is performed on the n-th frame image, the parameters required by the tone mapping module are the image center G Rev , image low gray enhancement coefficient value C Rev and the image high grayscale enhancement coefficient value D Rev, these three parameters are calculated 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 parameters are calculated as follows:
[0096] 1) Calculate the image center of gravity G Rev (G):
[0097] In order to stabilize the video image, the image center of gravity G is recursively filtered:
[0098]
[0099] 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.
[0100] 2) Image low grayscale enhancement coefficient value C Rev (C):
[0101] ①. 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.
[0102] ②. The low gray enhancement coefficient C can be calculated according to the following formula:
[0103] When the curve direction of the image is judged to be LA, the parameter C model can be:
[0104] C=9.863×ln(im L )+18.52
[0105] Among them, im L is the average brightness value at the low end of the image.
[0106] When the curve direction of the image is judged to be LA_inv, the model of parameter C can be:
[0107]
[0108] Among them, im L is the average brightness value at the low end of the image.
[0109] ③. C recursive filtering (video)
[0110] In order to stabilize the video image, C is recursively filtered:
[0111]
[0112] 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 the statistical value (usually replaced by the low grayscale enhancement coefficient C of the previous frame image); C step is the adjustment step of C recursive filter.
[0113] 3) Image high grayscale enhancement coefficient value D(D Rev ):
[0114] ①. Calculate the average brightness of high grayscale images
[0115] The average brightness of the image whose grayscale value is greater than the center of gravity G value.
[0116] ② Calculate the high grayscale enhancement coefficient D
[0117] When the curve direction of the image is judged to be LA, the model of parameter D can be:
[0118]
[0119] Among them, im H The average brightness value of the high end of the image.
[0120] When the curve direction of the image is judged to be LA_inv, the model of parameter D can be:
[0121] D=9.18×ln(im H )+19.92
[0122] Among them, im H The average brightness value of the high end of the image.
[0123] ③. D recursive filtering (video)
[0124] In order to stabilize the video image, D is recursively filtered:
[0125]
[0126] 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 the 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.
[0127] Optionally, in order to make the video picture smooth, the nth frame image can be recursively filtered as follows:
[0128] The mapping rule map(i) of the histogram is:
[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 previous frame tone mapping image MAP); 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-1)th frame image to obtain a mapped image, may include the following steps:
[0132] 21. Determine the target nonlinear mapping configuration parameters corresponding to the target parameter statistical information according to the preset mapping relationship between the parameter statistical information and the nonlinear mapping configuration parameters;
[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 the preset parameter statistical information and the 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, 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's retinal system in dark 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, its 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 value 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 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 center of gravity 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 value 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, which defaults to 255 (for 8bi images, 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, performing global contrast enhancement processing on the mapped image using the histogram statistical information after nonlinear mapping of the (n-1)th frame image to obtain an enhanced image, may include the following steps:
[0166] 41. Determine a target global contrast enhancement control parameter based on the histogram statistical information of the (n-1)th frame image after nonlinear mapping;
[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 parameters 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: a platform histogram, a dual-platform histogram, a CLAHE algorithm, and an ACE algorithm, which are 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. 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 according to the mapping relationship. The mapped image can be globally contrast enhanced based on 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 is not limited here.
[0172] In a possible example, the above step 105 of filtering the enhanced image to obtain the 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 consider the feature points within 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 a 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] In a specific implementation, in an 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 feature point extraction algorithm can be at least one of the following: a Harris corner detection algorithm, a 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 P. Then, 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 to obtain Q circles, take 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 within the image area. The electronic device can pre-store the 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: filter type, filter control parameters, wherein the filter control parameters are 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 the 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 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 multiple 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] The 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 regions, each of which can be of equal or unequal size. Furthermore, the mean square error of each of the multiple independent regions can be determined to obtain multiple mean square errors. A mean square error greater than a preset value can be selected from the multiple mean square errors to obtain at least one target mean square error. The region corresponding to the at least one mean square error can be obtained to obtain at least one target region. Contrast enhancement processing can be performed on the at least one target region to obtain an output image. In this way, local contrast enhancement can be performed on regions with large differences within the region.
[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 output color image C 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. ε = 0.01 prevents the denominator from dividing by zero when I(i, j) = 0. This linear operation ensures that the proportions of the R, G, and B components of each pixel remain unchanged when color restoration is performed on the enhanced luminance image. This effectively preserves the image's color information and prevents the generation of new or inconsistent colors. This step is not performed if the input image is grayscale.
[0193] In specific implementation, such as Figure 1E As shown, a template can be created and filtered with the unprocessed pixel of the input image (the nth frame) as the center to obtain a first filtered image. Next, the first filtered image is nonlinearly mapped using the parameter statistics of the previous frame (the n-1th frame) to obtain a mapped image. The mapped image is then globally contrast enhanced to obtain an enhanced image. The enhanced image is then filtered based on the filter to obtain a second filtered image. The second filtered image is then locally contrast enhanced to output the image. Similarly, the above processing can be performed by sliding the template over all pixels in the image 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, 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.
[0195] With the above Figure 1B For details on the embodiment shown, please refer to Figure 2 , Figure 2 This 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 n-th image frame.
[0198] 203. When the target image quality evaluation value is less than a preset image quality evaluation threshold, 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.
[0199] 204. Perform nonlinear mapping on the first filtered image based on target parameter statistical information of the (n-1)th frame image to obtain a mapped image, where the (n-1)th frame image is a frame image previous to the (n)th 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 are not 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 embodiment shown, please refer to Figure 3 , Figure 3 3 is a schematic structural diagram 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. The one or more programs 321 are stored in the memory 320 and are configured to be executed by the processor 310. The one or more programs 321 include instructions for executing any step in the above method embodiment:
[0206] Get the nth frame image, where n is an integer greater than 1;
[0207] Constructing a target template with an unprocessed pixel in the n-th frame image as the center, 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 frame image previous to the nth frame image;
[0209] Performing global contrast enhancement processing on the mapped image using histogram statistical information after nonlinear mapping of the (n-1)th frame image to obtain an enhanced image;
[0210] performing filtering processing on the enhanced image to obtain a second filtered image;
[0211] Performing local contrast enhancement processing on the second filtered image based on the enhanced 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, 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 performing nonlinear mapping on the first filtered image based on target parameter statistics of the (n-1)th frame image to obtain a mapped image, the one or more programs 321 include programs for executing:
[0214] Determining the target nonlinear mapping configuration parameters corresponding to the target parameter statistical information according to a preset mapping relationship between the parameter statistical information and the nonlinear mapping configuration parameters;
[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 one possible example, in performing global contrast enhancement processing on the mapped image using the histogram statistical information after nonlinear mapping of the (n-1)th frame image to obtain an enhanced image, the one or more programs 321 include executing:
[0217] Determining a target global contrast enhancement control parameter based on the histogram statistical information of the (n-1)th frame image after nonlinear mapping;
[0218] Performing global contrast enhancement processing on the mapped image 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 a center and drawing a circle within a second preset radius to obtain Q circles, and taking the feature points within 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] Determining the target filtering parameters corresponding to the energy mean square error according to a preset mapping relationship between the mean square error and the filtering parameters;
[0227] The enhanced image is filtered according to the target filtering parameters to obtain the second filtered image.
[0228] In one possible example, in performing local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image, the one or more programs 321 include executing:
[0229] dividing the enhanced image into a plurality of independent regions;
[0230] determining a 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 an area corresponding to the at least one mean square error to obtain at least one target area;
[0232] Performing contrast enhancement processing on the at least one target area to obtain the output image.
[0233] The above mainly introduces the solution of the embodiment of the present application from the perspective of the execution process of 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. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment 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 a hardware or computer software driven hardware manner 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 this application.
[0234] The embodiment of the present application can divide the functional units of the electronic device 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 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 configured to acquire an n-th frame of image, where n is an integer greater than 1;
[0237] The first filtering unit 402 is configured to construct a target template with an unprocessed pixel 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 configured to perform nonlinear mapping on the first filtered image based on target parameter statistics of the n-1th frame image to obtain a mapped image, where the n-1th frame image is a frame image preceding the nth frame image;
[0239] The global enhancement unit 404 is configured to 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;
[0240] The second filtering unit 405 is configured to perform filtering on the enhanced image to obtain a second filtered image;
[0241] The local enhancement unit 406 is configured 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. The first filtered image is nonlinearly mapped 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. The mapped image is globally contrast enhanced using the histogram statistical information after the nonlinear mapping of the n-1th frame image to obtain an enhanced image. The enhanced image is filtered to obtain a second filtered image. The second filtered image is locally contrast enhanced 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. The enhancement effect is better and more suitable for the human eye.
[0243] In a possible example, in performing nonlinear mapping on the first filtered image based on target parameter statistical information of the (n-1)th frame image to obtain a mapped image, the mapping unit 403 is specifically configured to:
[0244] Determining the target nonlinear mapping configuration parameters corresponding to the target parameter statistical information according to a preset mapping relationship between the parameter statistical information and the nonlinear mapping configuration parameters;
[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 performing 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 the enhanced image, the global enhancement unit 404 is specifically configured to:
[0247] Determining a target global contrast enhancement control parameter based on the histogram statistical information of the (n-1)th frame image after nonlinear mapping;
[0248] Performing global contrast enhancement processing on the mapped image according to the target global contrast enhancement control parameter to obtain an enhanced image.
[0249] In a possible example, in the filtering process on the enhanced image to obtain the second filtered image, the second filtering unit 405 is specifically configured to:
[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 a center and drawing a circle within a second preset radius to obtain Q circles, and taking the feature points within 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] Determining the target filtering parameters corresponding to the energy mean square error according to a preset mapping relationship between the mean square error and the filtering parameters;
[0257] The enhanced image is filtered according to the target filtering parameters to obtain the second filtered image.
[0258] In a possible example, in 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 configured to:
[0259] dividing the enhanced image into a plurality of independent regions;
[0260] determining a 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 an area corresponding to the at least one mean square error to obtain at least one target area;
[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, and 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 present application also provides a computer program product comprising a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the computer may comprise 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 this application is not limited by the order of the actions described, because according to this 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 this application.
[0267] In the above embodiments, the description of each embodiment has its own focus. 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 this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, 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 separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0270] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or 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, 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, which is stored in a memory and includes a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the above-mentioned methods of each embodiment of the present application. The aforementioned memory includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0272] Those skilled in the art will appreciate 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. The program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0273] The above is a detailed introduction to the embodiments of the present application. Specific examples are used herein 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 those skilled in the art, according to the idea of the present application, there may be changes in the specific implementation methods 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 device, characterized in that: The device includes: 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 the n-th frame image, where n is an integer greater than 1; The first filtering unit is configured to construct a target template with an unprocessed pixel 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 configured 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 frame image previous to the nth frame image; The global enhancement unit is configured to perform global contrast enhancement processing on the mapped image using the histogram statistical information after nonlinear mapping of the (n-1)th frame image to obtain an enhanced image; The second filtering unit is configured to perform filtering on the enhanced image to obtain a second filtered image; The local enhancement unit is configured to perform local contrast enhancement processing on the second filtered image based on the enhanced image to obtain an output image.
2. The device according to claim 1, 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-1)th frame image to obtain the mapped image, the mapping unit is specifically configured to: Determining the target nonlinear mapping configuration parameters corresponding to the target parameter statistical information according to a preset mapping relationship between the parameter statistical information and the nonlinear mapping configuration parameters; Nonlinear mapping is performed on the first filtered image according to the target nonlinear mapping configuration parameters to obtain the mapped image.
3. The device according to claim 1 or 2, characterized in that In the aspect of performing 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 the enhanced image, the global enhancement unit is specifically configured to: Determining a target global contrast enhancement control parameter based on the histogram statistical information of the (n-1)th frame image after nonlinear mapping; Performing global contrast enhancement processing on the mapped image according to the target global contrast enhancement control parameter to obtain an enhanced image.
4. The device according to claim 1 or 2, characterized in that In the aspect of filtering the enhanced image to obtain the second filtered image, the second filtering unit is specifically configured to: 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 a center and drawing a circle within a second preset radius to obtain Q circles, and taking the feature points within 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; Determining the target filtering parameters corresponding to the energy mean square error according to a preset mapping relationship between the mean square error and the filtering parameters; The enhanced image is filtered according to the target filtering parameters to obtain the second filtered image.
5. The device according to claim 1 or 2, characterized in that 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 is specifically configured to: dividing the enhanced image into a plurality of independent regions; determining a 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 an area corresponding to the at least one mean square error to obtain at least one target area; Performing contrast enhancement processing on the at least one target area to obtain the output image.
6. An image enhancement method, characterized in that: The method comprises: Get the nth frame image, where n is an integer greater than 1; Constructing a target template with an unprocessed pixel in the n-th 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 target parameter statistical information of the n-1th frame image to obtain a mapped image, wherein the n-1th frame image is a frame image previous to the nth frame image; Performing global contrast enhancement processing on the mapped image using histogram statistical information after nonlinear mapping of the (n-1)th 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.
7. The method according to claim 6, characterized in that The performing nonlinear mapping on the first filtered image based on the target parameter statistical information of the (n-1)th frame image to obtain a mapped image includes: Determining the target nonlinear mapping configuration parameters corresponding to the target parameter statistical information according to a preset mapping relationship between the parameter statistical information and the nonlinear mapping configuration parameters; Nonlinear mapping is performed on the first filtered image according to the target nonlinear mapping configuration parameters to obtain the mapped 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 claim 6 or 7.
9. A computer-readable storage medium, characterized in that A computer program for electronic data exchange is stored, wherein the computer program causes a computer to execute the method according to claim 6 or 7.
10. A computer program product, characterized in that The method comprises a computer program stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device executes any one of the methods described in claim 6 or 7.