Image enhancement device and method and related equipment
By acquiring images in electronic devices and determining the neighborhood pixel mean of the central pixel point, targeted image enhancement processing is performed, the problem of low image quality is solved and the image quality is improved.
Patent Information
- Application Number
- CN202510302782.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-28
- Publication Date
- 2025-06-27
AI Technical Summary
How to improve image quality, especially in images taken in electronic devices, the prior art is difficult to effectively solve the problem of low image quality.
By acquiring the image to be processed, the center pixel point and its neighboring pixel mean in the image are determined, and the first and second image enhancement processing are performed according to the comparison of pixel values to improve image quality.
Image enhancement processing based on central pixel points is realized, image quality is improved, and is suitable for images taken in various electronic devices.
Smart Images

Figure CN120219266A_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 202011043862.4 and application name “Image enhancement method, device and storage medium”, all contents of which are incorporated by reference in this application. Technical Field
[0002] The present application relates to the field of image processing technology, and in particular to an image enhancement device, method and related equipment. Background Art
[0003] 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
[0004] The embodiments of the present application provide an image enhancement apparatus, method and related equipment, which 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 image to be processed;
[0007] Determine a central pixel point in the image to be processed, where the central pixel point is at least one pixel point in the image to be processed;
[0008] Determine the mean value of the neighborhood pixels of the central pixel;
[0009] When the pixel value of the central pixel point is greater than the neighborhood pixel mean value, performing a first image enhancement process on the central pixel point;
[0010] When the pixel value of the central pixel point is less than or equal to the neighborhood pixel mean value, a second image enhancement process is performed on the central pixel point.
[0011] In a second aspect, an embodiment of the present application provides an image enhancement device, the device comprising: an acquisition unit, a first determination unit, a second determination unit and an image enhancement unit, wherein:
[0012] The acquisition unit is used to acquire the image to be processed;
[0013] The first determining unit is used to determine a central pixel point in the image to be processed, where the central pixel point is at least one pixel point in the image to be processed;
[0014] The second determination unit is configured to determine the neighborhood pixel mean of the central pixel point;
[0015] The image enhancement unit is configured to perform a first image enhancement process on the central pixel point when the pixel value of the central pixel point is greater than the neighborhood pixel mean;
[0016] The image enhancement unit is further configured to perform a second image enhancement process on the central pixel point when the pixel value of the central pixel point is less than or equal to the neighborhood pixel mean.
[0017] In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, wherein the above one or more programs are stored in the above memory and are configured to be executed by the above processor, and the above programs include instructions for executing the steps in any method of the first aspect of the embodiments of the present application.
[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the above computer-readable storage medium stores a computer program for electronic data exchange, and wherein the above computer program causes 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.
[0019] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the above computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the above 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.
[0020] By adopting the embodiments of the present application, the following beneficial effects are achieved:
[0021] It can be seen that the image enhancement device, method, and related equipment described in the embodiments of the present application are applied to an electronic device, obtain an image to be processed, determine a central pixel point in the image to be processed, the central pixel point is at least one pixel point in the image to be processed, determine the neighborhood pixel mean of the central pixel point, perform a first image enhancement process on the central pixel point when the pixel value of the central pixel point is greater than the neighborhood pixel mean, and perform a second image enhancement process on the central pixel point when the pixel value of the central pixel point is less than or equal to the neighborhood pixel mean, and can implement image enhancement processing based on the central pixel point, which helps to improve the image quality. Description of the Drawings
[0022] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0023] Figure 1A is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
[0024] Figure 1B is a schematic flowchart of an image enhancement method provided by an embodiment of the present application;
[0025] Figure 1C is a schematic flowchart of another image enhancement method provided by an embodiment of the present application;
[0026] Figure 2 is a schematic flowchart of another image enhancement method provided by an embodiment of the present application;
[0027] Figure 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
[0028] Figure 4 is a block diagram of the functional units of an image enhancement device provided by an embodiment of the present application. Detailed implementation manners
[0029] In order to enable those skilled in the art to better understand the solutions of the present application, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0030] The terms "first", "second", etc. in the specification and claims of the present application and the above drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.
[0031] Reference to "embodiment" in this document means that the specific features, structures, or characteristics described in connection with the embodiment can be included in at least one embodiment of the present application. The phrase appearing at various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0032] The electronic device involved in the embodiments of the present application can be an electronic device with communication capabilities or an electronic device without communication capabilities. The electronic device can 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, intelligent cameras, computing devices, or other processing devices connected to a wireless modem, as well as various forms of user equipment (User Equipment, UE), mobile stations (Mobile Station, MS), terminal devices (terminal device), etc.
[0033] Please refer to Figure 1A , Figure 1A which is a schematic structural diagram of an electronic device provided by 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 (Random Access Memory, RAM), a camera, sensors, and a communication module, etc. Among them, the memory, the signal processor, the display screen, the speaker, the microphone, the RAM, the camera, the sensors, and the communication module are connected to the processor, and the transceiver is connected to the signal processor.
[0034] Among them, the display screen can be a liquid crystal display (Liquid Crystal Display, LCD), an organic or inorganic light-emitting diode (Organic Light-Emitting Diode, OLED), an active matrix organic light-emitting diode panel (ActiveMatrix / Organic Light Emitting Diode, AMOLED), etc.
[0035] Among them, the camera can be an ordinary camera or an infrared camera, which is not limited herein. The camera can be a front camera or a rear camera, which is not limited herein.
[0036] Among them, the sensor includes at least one of the following: light sensor, gyroscope, infrared proximity sensor, fingerprint sensor, pressure sensor, etc. Among them, the light sensor, also known as the ambient light sensor, is used to detect the ambient light brightness. 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 optical 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 further include a signal amplifier, and the signal amplifier can amplify the electrical signal converted by the photosensitive element and then output it to the analog-to-digital converter. The above photosensitive element may include at least one of a photodiode, a phototransistor, a photoresistor, and a silicon photocell.
[0037] Among them, the processor is the control center of the electronic device, connecting various parts of the entire electronic device through various interfaces and circuits, and by running or executing the software programs and / or modules stored in the memory, as well as calling the data stored in the memory, performing various functions of the electronic device and processing data, thereby monitoring the electronic device as a whole.
[0038] Among them, the processor may integrate an application processor and a modulation and demodulation processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modulation and demodulation processor mainly processes wireless communication. It can be understood that the above modulation and demodulation processor may not be integrated into the processor. Among them, the processor may be at least one of the following: ISP, CPU, GPU, NPU, etc., which is not limited here.
[0039] Among them, the memory is used to store software programs and / or modules. 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. Among them, the program storage area may store the operating system, software programs 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 non-volatile solid-state storage devices.
[0040] Among them, the communication module can be used to implement communication functions. The communication module may 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.
[0041] The embodiments of the present application will be introduced in detail below.
[0042] Please refer to Figure 1B , Figure 1B which is a schematic flowchart of an image enhancement method provided by an embodiment of the present application, applied to Figure 1AThe electronic device shown, as shown in the figure, the present image enhancement method includes the following operations.
[0043] 101. Obtain the image to be processed.
[0044] Among them, the image to be processed can be one or more frames of an image in a video to be processed. The image to be processed can be a low-light vision image or an overexposed image, or any randomly captured image.
[0045] 102. Determine the central pixel point in the image to be processed, where the central pixel point is at least one pixel point in the image to be processed.
[0046] Among them, the central pixel point can be understood as the pixel point corresponding to the center of the image to be processed. The central pixel point can be one or more pixel points. For example, in a specific implementation, the electronic device can perform target extraction on the image to be processed to obtain a target, and use the center of the target as the central pixel point.
[0047] In a possible example, in terms of determining the central pixel point in the image to be processed, step 102 above may include the following steps:
[0048] 21. Divide the image to be processed into P regions, where P is an integer greater than 1;
[0049] 22. Determine the image quality evaluation value of each of the P regions to obtain P image quality evaluation values;
[0050] 23. Select the image quality evaluation values less than a preset threshold from the P image quality evaluation values to obtain Q image quality evaluation values, and obtain the target regions corresponding to the Q image quality evaluation values to obtain Q target regions;
[0051] 24. Determine the central pixel point of each of the Q target regions to obtain the central pixel point of the image to be processed.
[0052] In a specific implementation, the above preset threshold can be set by the user or default by the system. The electronic device can divide the image to be processed into P regions, where P is an integer greater than 1, and the area size of each region can be the same or different. Further, the electronic device can also use at least one image quality evaluation index to evaluate the image quality of each of the P regions to obtain P image quality evaluation values. The image quality evaluation index can be at least one of the following: mean square error, average gradient, information entropy, signal-to-noise ratio, etc., which are not limited here.
[0053] Further, the electronic device may select the image quality evaluation values less than a preset threshold from the P image quality evaluation values to obtain Q image quality evaluation values, and acquire the target regions corresponding to the Q image quality evaluation values to obtain Q target regions. Further, the central pixel points of each of the Q target regions can be determined to obtain the central pixel points of the image to be processed. In this way, the regions that need to be image-enhanced can be selected, and the central pixel points of the regions can be determined. Image enhancement processing can be implemented based on the central pixel points, which helps to improve the image quality.
[0054] In a possible example, step 22 above, determining the image quality evaluation value of each of the P regions to obtain P image quality evaluation values, may include the following steps:
[0055] A1. Perform multi-scale feature decomposition on region i to obtain a low-frequency feature component and a high-frequency feature component, where region i is any one of the P regions;
[0056] A2. Divide the low-frequency feature component into multiple regions;
[0057] A3. Determine the signal-to-noise ratio corresponding to each of the multiple regions to obtain multiple signal-to-noise ratios;
[0058] A4. Determine the average signal-to-noise ratio and the first mean square error based on the multiple signal-to-noise ratios;
[0059] A5. Determine the target adjustment coefficient corresponding to the first mean square error;
[0060] A6. Adjust the average signal-to-noise ratio based on the target adjustment coefficient to obtain the target signal-to-noise ratio;
[0061] A7. Determine the first evaluation value corresponding to the target signal-to-noise ratio according to the mapping relationship between the preset signal-to-noise ratio and the evaluation value;
[0062] A8. Acquire the target shooting parameters corresponding to the image to be processed;
[0063] A9. Determine the target low-frequency weight corresponding to the target shooting parameters according to the mapping relationship between the preset shooting parameters and the low-frequency weight, and determine the target high-frequency weight based on the target low-frequency weight;
[0064] A10. Determine the target feature point distribution density based on the high-frequency feature component;
[0065] A11. Determine the second evaluation value corresponding to the target feature point distribution density according to the mapping relationship between the preset feature point distribution density and the evaluation value;
[0066] 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 the image quality evaluation value of region i.
[0067] In a specific implementation, the electronic device can use a multi-scale decomposition algorithm to perform multi-scale feature decomposition on region i to obtain a low-frequency feature component and a high-frequency feature component. The multi-scale decomposition algorithm can be at least one of the following: pyramid transform algorithm, wavelet transform, contourlet transform, non-subsampled contourlet transform, shearlet transform, etc., which are not limited here. Further, the low-frequency feature component can be divided into multiple regions, and the area size of each region can be 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.
[0068] Further, the electronic device can determine the signal-to-noise ratio corresponding to each region in the multiple regions to obtain multiple signal-to-noise ratios, and determine the average signal-to-noise ratio and the first mean square error based on the multiple signal-to-noise ratios. The signal-to-noise ratio reflects the amount of image information to a certain extent, and the mean square error can reflect the stability of the image information. The mapping relationship between the preset mean square error and the adjustment coefficient can be pre-stored in the electronic device. Furthermore, the target adjustment coefficient corresponding to the first mean square error can be determined according to this mapping relationship. In the embodiments 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.115 to 0.115.
[0069] Further, the electronic device can adjust the average signal-to-noise ratio according to the target adjustment coefficient to obtain the target signal-to-noise ratio. The target signal-to-noise ratio = (1 + target adjustment coefficient) * average signal-to-noise ratio. The mapping relationship between the preset signal-to-noise ratio and the evaluation value can be pre-stored in the electronic device. Furthermore, the first evaluation value corresponding to the target signal-to-noise ratio can be determined according to the mapping relationship between the preset signal-to-noise ratio and the evaluation value.
[0070] In addition, the electronic device can obtain the target shooting parameters corresponding to the image to be processed. The target shooting parameters can be at least one of the following: ISO, area of the region of interest, exposure time, white balance parameter, focus parameter, etc., which are not limited here. The mapping relationship between the preset shooting parameters and the low-frequency weight can also be pre-stored in the electronic device. Furthermore, the target low-frequency weight corresponding to the target shooting parameters can be determined according to the mapping relationship between the preset shooting parameters and the low-frequency weight, and the target high-frequency weight can be determined based on the target low-frequency weight. The target low-frequency weight + target high-frequency weight = 1.
[0071] Further, the electronic device may determine the target feature point distribution density based on the high-frequency feature components, where the target feature point distribution density = the total number of feature points of the high-frequency feature components / the area of the region. A mapping relationship between a preset feature point distribution density and an evaluation value may be pre-stored in the electronic device. Furthermore, the second evaluation value corresponding to the target feature point distribution density may be determined according to the mapping relationship between the preset feature point distribution density and the evaluation value. 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 region i, which is specifically as follows:
[0072] The image quality evaluation value of region i = the first evaluation value * the target low-frequency weight + the second evaluation value * the target high-frequency weight
[0073] In this way, the image quality can be evaluated based on two dimensions, namely the low-frequency component and the high-frequency component of the image, and an evaluation value suitable for the shooting environment can be accurately obtained.
[0074] 103. Determine the neighborhood pixel mean of the central pixel point.
[0075] The image to be processed may be one or more frames of images in the video to be processed. In a specific implementation, the electronic device may take the pixel points within a preset range as neighborhood pixel points with the central pixel point as the center. The preset range may be set by the user or default by the system. The preset range may be K*K, where K is a positive integer. For example, K is 5, 7, 8, 13, etc., which is not limited herein. Furthermore, the pixel values corresponding to the neighborhood pixel points may be averaged to obtain the neighborhood pixel mean.
[0076] 104. When the pixel value of the central pixel point is greater than the neighborhood pixel mean, perform first image enhancement processing on the central pixel point.
[0077] The image to be processed may be one or more frames of images in the video to be processed. In a specific implementation, the electronic device may perform first image enhancement processing on the central pixel point when the pixel value of the central pixel point is greater than the neighborhood pixel mean.
[0078] In a possible example, for step 104 above, performing first image enhancement processing on the central pixel point may include the following steps:
[0079] 41. Determine the target difference between the pixel value of the central pixel point and the neighborhood pixel mean;
[0080] 42. Determine the first image enhancement processing parameter corresponding to the target difference according to the mapping relationship between the preset difference and the image enhancement processing parameter;
[0081] 43. Determine the target mean square error between the pixel value of the central pixel point and the pixel values of its neighboring pixel points;
[0082] 44. Determine the target optimization coefficient corresponding to the target mean square error according to the mapping relationship between the preset mean square error and the optimization coefficient;
[0083] 45. Optimize the first image enhancement processing parameter according to the target optimization coefficient to obtain a second image enhancement processing parameter;
[0084] 46. Perform image enhancement processing on the central pixel point according to the second image enhancement processing parameter.
[0085] In a specific implementation, the electronic device may pre-store the mapping relationship between the preset difference and the image enhancement processing parameter. Among them, the image enhancement processing parameter may include an image enhancement processing algorithm and corresponding control parameters. Among them, the image enhancement processing algorithm may be at least one of the following: gray scale stretching, wavelet transform, pyramid transform, neural network algorithm, histogram equalization, etc., which are not limited here. The control parameter can be understood as the adjustment parameter of the image enhancement processing algorithm, which can control the enhancement degree of the image enhancement processing algorithm. Different image enhancement processing algorithms may correspond to different control parameters. The electronic device may determine the target difference between the pixel value of the central pixel point and the neighborhood pixel mean value, and determine the first image enhancement processing parameter corresponding to the target difference according to the mapping relationship between the preset difference and the image enhancement processing parameter.
[0086] Furthermore, the electronic device also determines the target mean square error between the pixel value of the central pixel point and the pixel values of its neighboring pixel points. The electronic device may pre-store the mapping relationship between the preset mean square error and the optimization coefficient. Furthermore, the target optimization coefficient corresponding to the target mean square error can be determined according to the mapping relationship between the preset mean square error and the optimization coefficient, and the first image enhancement processing parameter is optimized according to the target optimization coefficient to obtain a second image enhancement processing parameter. The target optimization parameter mainly optimizes the control parameter of the first image enhancement processing parameter, for example, as follows:
[0087] The control parameter of the second image enhancement processing parameter = (1 + target optimization coefficient) * the control parameter of the first image enhancement processing parameter
[0088] Among them, in the embodiments of the present application, the specific value range of the optimization coefficient may be -1 to 1, for example, -0.15 to 0.15.
[0089] Further, the electronic device may perform image enhancement processing on the central pixel according to the second image enhancement processing parameter. Specifically, image enhancement processing may be performed on the pixels within a specified range centered on the central pixel. The specified range may be set by the user or defaulted by the system. For example, the specified range may be the entire image to be processed, or a region centered on the central pixel.
[0090] 105. When the pixel value of the central pixel is less than or equal to the neighborhood pixel mean, perform second image enhancement processing on the central pixel.
[0091] In specific implementation, the image enhancement algorithms corresponding to the first image enhancement processing and the second image enhancement processing may be the same or different.
[0092] In specific implementation, as Figure 1C shown, the electronic device may determine the region to be enhanced centered on the central pixel, determine the enhancement coefficient of this region, attenuate it to suppress noise, and perform contrast enhancement processing as follows:
[0093] 1. Calculate the local contrast enhancement coefficient through the following formula:
[0094]
[0095] where Y GC (i, j) represents the region to be enhanced, B GC (i, j) represents the image of Y GC (i, j) after being filtered by the first filter. C is a constant representing the contrast intensity of the high-gray-level image. The first filter may be at least one of the following: guided filter, curvature filter, WLS filter, domain transform RF filter, LEP filter, etc., which is not limited here.
[0096] 2. Suppress the enhancement coefficient through the following formula:
[0097] Suppress the noise of the image by attenuating the low-segment value of the beta curve as follows:
[0098]
[0099] where K0, K1, and K3 represent the contrast enhancement intensity; T1 is the noise suppression level; T2 is the over-threshold value to prevent abnormal gray-level points from appearing in the image; T3 is the bias.
[0100] 3. Perform local contrast enhancement through the following formula:
[0101] The normalized luminance mapping function of the local contrast is as follows:
[0102]
[0103] Among them, Y GC (i, j) represents the area to be enhanced, B GC (i, j) represents Y GC The pixel of Y(i, j) after LEP filtering out (i, j) represents the pixel value after contrast enhancement.
[0104] In a possible example, in step 105 above, performing a second image enhancement process on the central pixel point may include the following steps:
[0105] 51. Determine the energy value of the central pixel point to obtain a first energy value;
[0106] 52. Determine the energy values of the neighboring pixel points of the central pixel point to obtain a plurality of second energy values;
[0107] 53. Determine the energy ratio between the first energy value and the plurality of second energy values to obtain a plurality of energy ratios;
[0108] 54. Sort the plurality of energy ratios, and project the sorted plurality of energy ratios onto a coordinate system;
[0109] 55. Fit the plurality of energy ratios based on the coordinate system to obtain a fitted line;
[0110] 56. Determine the target slope of the fitted line;
[0111] 57. According to the mapping relationship between the preset slope and the image enhancement processing parameters, determine the target image enhancement processing parameters corresponding to the target slope;
[0112] 58. Perform a second image enhancement process on the central pixel point according to the target image enhancement processing parameters.
[0113] In specific implementation, the electronic device can determine the energy value of the central pixel point to obtain a first energy value, and can also determine the energy values of the neighboring pixel points of the central pixel point to obtain a plurality of second energy values. Furthermore, the energy ratio between the first energy value and the plurality of second energy values can be determined to obtain a plurality of energy ratios. The plurality of energy ratios are sorted, and the sorted plurality of energy ratios are projected onto a coordinate system. Specifically, the plurality of energy ratios can be numbered, for example, 1, 2, 3, etc. Furthermore, the horizontal axis of the coordinate system is the sequential position, and the vertical axis is the energy ratio. Further, the plurality of energy ratios can be fitted based on the coordinate system to obtain a fitted line.
[0114] Furthermore, the electronic device can determine the target slope of the fitted straight line. A mapping relationship between the slope and the image enhancement processing parameters can be pre-stored in the electronic device. Herein, the image enhancement processing parameters can include the image enhancement processing algorithm and the corresponding control parameters. The image enhancement processing algorithm can be at least one of the following: gray stretching, wavelet transform, pyramid transform, neural network algorithm, histogram equalization, etc., which is not limited herein. The control parameter can be understood as the adjustment parameter of the image enhancement processing algorithm, which can control the enhancement degree of the image enhancement processing algorithm. Different image enhancement processing algorithms can correspond to different control parameters. Furthermore, the target image enhancement processing parameters corresponding to the target slope can be determined according to the pre-set mapping relationship between the slope and the image enhancement processing parameters, and the second image enhancement processing is performed on the central pixel point according to the target image enhancement processing parameters. Specifically, the image enhancement processing can be performed on the pixel points within a specified range centered on the central pixel point. The specified range can be set by the user or defaulted by the system. For example, the specified range can be the entire image to be processed, or a region centered on the central pixel point.
[0115] In a possible exemplary example, between step 101 and step 102 above, the following steps can further be included:
[0116] B1. Perform image segmentation on the image to be processed to obtain a target region image and a background region image;
[0117] B2. Determine the first feature point distribution density corresponding to the target region image;
[0118] B3. Determine the second feature point distribution density of the background region image;
[0119] B4. When the ratio between the first feature point distribution density and the second feature point distribution density is within a preset ratio range, execute the step of determining the central pixel point in the image to be processed.
[0120] Herein, the preset ratio range can be set by the user or defaulted by the system. The preset ratio range can indicate that the contrast difference between the background and the target is relatively large, and then the image enhancement processing can be implemented.
[0121] In a specific implementation, the electronic device can perform image segmentation on the image to be processed to obtain a target region image and a background region image, and can determine the first feature point distribution density corresponding to the target region image. Specifically, the target region image can be subjected to feature extraction to obtain a feature point set, and the area of the target region image can also be determined. The first feature point distribution density = the number of feature points in the feature point set / the area of the target region image. Similarly, the electronic device can also determine the second feature point distribution density of the background region image. Furthermore, when the ratio between the first feature point distribution density and the second feature point distribution density is within a preset ratio range, the electronic device can execute step 102; otherwise, it can skip the subsequent steps.
[0122] It can be seen that the image enhancement method described in the embodiments of the present application is applied to an electronic device to obtain an image to be processed, determine the central pixel point in the image to be processed, where the central pixel point is at least one pixel point in the image to be processed, determine the neighborhood pixel mean of the central pixel point, perform a first image enhancement process on the central pixel point when the pixel value of the central pixel point is greater than the neighborhood pixel mean, and perform a second image enhancement process on the central pixel point when the pixel value of the central pixel point is less than or equal to the neighborhood pixel mean. It can perform image enhancement processing based on the central pixel point, which helps to improve the image quality.
[0123] Consistent with the above Figure 1B shown embodiment, please refer to Figure 2 , Figure 2 is a flowchart of an image enhancement method provided by an embodiment of the present application, which is applied to an electronic device. As shown in the figure, this image enhancement method includes the following steps.
[0124] 201. Obtain an image to be processed.
[0125] 202. Perform image segmentation on the image to be processed to obtain a target region image and a background region image.
[0126] 203. Determine the first feature point distribution density corresponding to the target region image.
[0127] 204. Determine the second feature point distribution density of the background region image.
[0128] 205. When the ratio between the first feature point distribution density and the second feature point distribution density is within a preset ratio range, determine the central pixel point in the image to be processed, where the central pixel point is at least one pixel point in the image to be processed.
[0129] 206. Determine the neighborhood pixel mean of the central pixel point.
[0130] 207. When the pixel value of the central pixel point is greater than the neighborhood pixel mean value, perform a first image enhancement process on the central pixel point.
[0131] 208. When the pixel value of the central pixel point is less than or equal to the neighborhood pixel mean value, perform a second image enhancement process on the central pixel point.
[0132] Among them, for the specific descriptions of the above steps 201 - 208, reference can be made to the corresponding steps of the image enhancement method described above. Figure 1B They will not be elaborated here.
[0133] It can be seen that the image enhancement method described in the embodiments of this application can perform image enhancement processing based on the central pixel point when the contrast difference between the target and the background is large, which helps to improve the image quality.
[0134] Consistent with the above Figure 1B 、 Figure 2 shown embodiment, please refer to Figure 3 , Figure 3 FIG. is a schematic structural diagram of an electronic device 300 provided by an embodiment of this 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. Among them, the one or more programs 321 are stored in the above memory 320 and are configured to be executed by the above processor 310. The one or more programs 321 include instructions for executing any step in the above method embodiment:
[0135] Obtain the image to be processed;
[0136] Determine the central pixel point in the image to be processed, where the central pixel point is at least one pixel point in the image to be processed;
[0137] Determine the neighborhood pixel mean value of the central pixel point;
[0138] When the pixel value of the central pixel point is greater than the neighborhood pixel mean value, perform a first image enhancement process on the central pixel point;
[0139] It can be seen that the electronic device described in the embodiments of this application obtains the image to be processed, determines the central pixel point in the image to be processed, where the central pixel point is at least one pixel point in the image to be processed, determines the neighborhood pixel mean value of the central pixel point, performs a first image enhancement process on the central pixel point when the pixel value of the central pixel point is greater than the neighborhood pixel mean value, and performs a second image enhancement process on the central pixel point when the pixel value of the central pixel point is less than or equal to the neighborhood pixel mean value. It can perform image enhancement processing based on the central pixel point, which helps to improve the image quality.
[0140] When the pixel value of the central pixel point is less than or equal to the neighborhood pixel mean value, perform second image enhancement processing on the central pixel point.
[0141] In a possible example, in determining the central pixel point in the image to be processed, the one or more programs 321 are configured to:
[0142] Divide the image to be processed into P regions, where P is an integer greater than 1;
[0143] Determine the image quality evaluation value of each of the P regions to obtain P image quality evaluation values;
[0144] Select the image quality evaluation values less than a preset threshold from the P image quality evaluation values to obtain Q image quality evaluation values, and obtain the target regions corresponding to the Q image quality evaluation values to obtain Q target regions;
[0145] Determine the central pixel point of each of the Q target regions to obtain the central pixel point of the image to be processed.
[0146] In a possible example, in performing first image enhancement processing on the central pixel point, the one or more programs 321 are configured to:
[0147] Determine the target difference between the pixel value of the central pixel point and the neighborhood pixel mean value;
[0148] According to the mapping relationship between the preset difference and the image enhancement processing parameters, determine the first image enhancement processing parameter corresponding to the target difference;
[0149] Determine the target mean square error between the pixel value of the central pixel point and the pixel values of its neighborhood pixel points;
[0150] According to the mapping relationship between the preset mean square error and the optimization coefficient, determine the target optimization coefficient corresponding to the target mean square error;
[0151] Optimize the first image enhancement processing parameter according to the target optimization coefficient to obtain the second image enhancement processing parameter;
[0152] Perform image enhancement processing on the central pixel point according to the second image enhancement processing parameter.
[0153] In a possible example, in performing second image enhancement processing on the central pixel point, the one or more programs 321 are configured to:
[0154] Determine the energy value of the central pixel point to obtain the first energy value;
[0155] Determine the energy values of the neighborhood pixels of the central pixel point to obtain multiple second energy values;
[0156] Determine the energy ratios between the first energy value and the multiple second energy values to obtain multiple energy ratios;
[0157] Sort the multiple energy ratios and project the sorted multiple energy ratios onto a coordinate system;
[0158] Fit the multiple energy ratios based on the coordinate system to obtain a fitted line;
[0159] Determine the target slope of the fitted line;
[0160] According to the mapping relationship between the slope and the image enhancement processing parameters preset, determine the target image enhancement processing parameters corresponding to the target slope;
[0161] Perform a second image enhancement process on the central pixel point according to the target image enhancement processing parameters.
[0162] In a possible example, the one or more programs 321 are further configured to:
[0163] Perform image segmentation on the image to be processed to obtain a target region image and a background region image;
[0164] Determine the first feature point distribution density corresponding to the target region image;
[0165] Determine the second feature point distribution density of the background region image;
[0166] When the ratio between the first feature point distribution density and the second feature point distribution density is within a preset ratio range, execute the step of determining the central pixel point in the image to be processed.
[0167] The above mainly introduces the solution of the embodiment of the present application from the perspective of the execution process on the method side. It can be understood that in order for an electronic device to implement the above functions, it includes the corresponding hardware structure and / or software module for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments provided in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0168] Embodiments of the present application can divide functional units of an electronic device according to the above method examples. For example, each functional unit can be divided corresponding 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 a software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, merely a logical functional division, and there may be other division methods in actual implementation.
[0169] Figure 4 It is a block diagram of the functional unit composition of the image enhancement device 400 involved in the embodiments of the present application. The image enhancement device 400 is applied to an electronic device. The device 400 includes: an acquisition unit 401, a first determination unit 402, a second determination unit 403, and an image enhancement unit 404, where,
[0170] The acquisition unit 401 is configured to acquire an image to be processed;
[0171] The first determination unit 402 is configured to determine a central pixel point in the image to be processed, and the central pixel point is at least one pixel point in the image to be processed;
[0172] The second determination unit 403 is configured to determine the neighborhood pixel mean value of the central pixel point;
[0173] The image enhancement unit 404 is configured to perform a first image enhancement process on the central pixel point when the pixel value of the central pixel point is greater than the neighborhood pixel mean value;
[0174] The image enhancement unit 404 is further configured to perform a second image enhancement process on the central pixel point when the pixel value of the central pixel point is less than or equal to the neighborhood pixel mean value.
[0175] It can be seen that the image enhancement device described in the embodiments of the present application is applied to an electronic device, acquires an image to be processed, determines a central pixel point in the image to be processed, the central pixel point is at least one pixel point in the image to be processed, determines the neighborhood pixel mean value of the central pixel point, performs a first image enhancement process on the central pixel point when the pixel value of the central pixel point is greater than the neighborhood pixel mean value, and performs a second image enhancement process on the central pixel point when the pixel value of the central pixel point is less than or equal to the neighborhood pixel mean value, and can implement image enhancement processing based on the central pixel point, which helps to improve the image quality.
[0176] In a possible example, in terms of determining the central pixel point in the image to be processed, the first determination unit 402 is specifically configured to:
[0177] Divide the image to be processed into P regions, where P is an integer greater than 1;
[0178] Determine the image quality evaluation value of each of the P regions to obtain P image quality evaluation values;
[0179] Select the image quality evaluation values less than a preset threshold from the P image quality evaluation values to obtain Q image quality evaluation values, and obtain the target regions corresponding to the Q image quality evaluation values to obtain Q target regions;
[0180] Determine the central pixel point of each of the Q target regions to obtain the central pixel point of the image to be processed.
[0181] In a possible example, in terms of performing the first image enhancement process on the central pixel point, the image enhancement unit 404 is specifically configured to:
[0182] Determine the target difference between the pixel value of the central pixel point and the neighborhood pixel mean value;
[0183] Determine the first image enhancement processing parameter corresponding to the target difference according to the mapping relationship between the preset difference and the image enhancement processing parameter;
[0184] Determine the target mean square error between the pixel value of the central pixel point and the pixel values of its neighborhood pixel points;
[0185] Determine the target optimization coefficient corresponding to the target mean square error according to the mapping relationship between the preset mean square error and the optimization coefficient;
[0186] Optimize the first image enhancement processing parameter according to the target optimization coefficient to obtain a second image enhancement processing parameter;
[0187] Perform image enhancement processing on the central pixel point according to the second image enhancement processing parameter.
[0188] In a possible example, in terms of performing the second image enhancement process on the central pixel point, the image enhancement unit 404 is specifically configured to:
[0189] Determine the energy value of the central pixel point to obtain a first energy value;
[0190] Determine the energy values of the neighborhood pixel points of the central pixel point to obtain a plurality of second energy values;
[0191] Determine the energy ratio between the first energy value and the plurality of second energy values to obtain a plurality of energy ratios;
[0192] Sort the multiple energy ratios, and project the sorted multiple energy ratios onto a coordinate system;
[0193] Fit the multiple energy ratios based on the coordinate system to obtain a fitted line;
[0194] Determine the target slope of the fitted line;
[0195] According to the mapping relationship between the preset slope and the image enhancement processing parameters, determine the target image enhancement processing parameters corresponding to the target slope;
[0196] Perform a second image enhancement process on the central pixel point according to the target image enhancement processing parameters.
[0197] In a possible example, the apparatus 400 is further specifically configured to:
[0198] Perform image segmentation on the image to be processed to obtain a target region image and a background region image;
[0199] Determine the first feature point distribution density corresponding to the target region image;
[0200] Determine the second feature point distribution density of the background region image;
[0201] When the ratio between the first feature point distribution density and the second feature point distribution density is within a preset ratio range, perform the step of determining the central pixel point in the image to be processed.
[0202] An embodiment of the present application further 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 recorded in the above method embodiments. The above computer includes an electronic device.
[0203] An embodiment of the present application further provides a computer program product. The above computer program product includes a non-transitory computer-readable storage medium storing a computer program. The above computer program is operable to enable a computer to execute part or all of the steps of any method recorded in the above method embodiments. The computer program product can be a software installation package, and the above computer includes an electronic device.
[0204] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0205] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0206] In the several embodiments provided by this application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the device or unit can be in electrical or other forms.
[0207] The units described as separate components above may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0208] In addition, in each embodiment of this application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0209] When the above 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 such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the above methods in various embodiments of this application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs.
[0210] Those of ordinary skill 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 relevant hardware through a program. This program can be stored in a computer-readable memory, and the memory can include: flash drives, read-only memories (abbreviation in English: Read-Only Memory, referred to as: ROM), random access memories (abbreviation in English: Random Access Memory, referred to as: RAM), magnetic disks, or optical discs, etc.
[0211] The above has introduced the embodiments of this application in detail. Specific examples are used in this article to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to this application.
Claims
1. An image enhancement device, characterized in that, The device includes: an acquisition unit, a first determination unit, a second determination unit, and an image enhancement unit, where the acquisition unit is configured to acquire an image to be processed; the first determination unit is configured to determine a central pixel point in the image to be processed, and the central pixel point is at least one pixel point in the image to be processed; the second determination unit is configured to determine the neighborhood pixel mean value of the central pixel point; the image enhancement unit is configured to perform a first image enhancement process on the central pixel point when the pixel value of the central pixel point is greater than the neighborhood pixel mean value; the image enhancement unit is further configured to perform a second image enhancement process on the central pixel point when the pixel value of the central pixel point is less than or equal to the neighborhood pixel mean value.
2. The device according to claim 1, characterized in that, In terms of determining the central pixel point in the image to be processed, the first determination unit specifically is configured to: divide the image to be processed into P regions, where P is an integer greater than 1; determine the image quality evaluation value of each of the P regions to obtain P image quality evaluation values; select the image quality evaluation values less than a preset threshold from the P image quality evaluation values to obtain Q image quality evaluation values, and acquire the target regions corresponding to the Q image quality evaluation values to obtain Q target regions; determine the central pixel point of each of the Q target regions to obtain the central pixel point of the image to be processed.
3. The device according to claim 1 or 2, characterized in that, In terms of performing the first image enhancement process on the central pixel point, the image enhancement unit specifically is configured to: determine the target difference between the pixel value of the central pixel point and the neighborhood pixel mean value; determine the first image enhancement processing parameter corresponding to the target difference according to the mapping relationship between the difference and the image enhancement processing parameter preset; determine the target mean square error between the pixel value of the central pixel point and the pixel values of its neighborhood pixel points; determine the target optimization coefficient corresponding to the target mean square error according to the mapping relationship between the mean square error and the optimization coefficient preset; optimize the first image enhancement processing parameter according to the target optimization coefficient to obtain a second image enhancement processing parameter; perform an image enhancement process on the central pixel point according to the second image enhancement processing parameter.
4. The device according to claim 1 or 2, characterized in that, In terms of performing the second image enhancement process on the central pixel point, the image enhancement unit specifically is configured to: determine the energy value of the central pixel point to obtain a first energy value; determine the energy values of the neighborhood pixel points of the central pixel point to obtain multiple second energy values; determine the energy ratio between the first energy value and the multiple second energy values to obtain multiple energy ratios; sort the multiple energy ratios, and project the sorted multiple energy ratios onto a coordinate system; fit the multiple energy ratios based on the coordinate system to obtain a fitting line; determine the target slope of the fitting line; determine the target image enhancement processing parameter corresponding to the target slope according to the mapping relationship between the slope and the image enhancement processing parameter preset; perform a second image enhancement process on the central pixel point according to the target image enhancement processing parameter.
5. The device according to claim 1 or 2, characterized in that, The device is further specifically configured to: perform image segmentation on the to-be-processed image to obtain a target region image and a background region image; determine a first feature point distribution density corresponding to the target region image; determine a second feature point distribution density of the background region image; when a ratio between the first feature point distribution density and the second feature point distribution density is within a preset ratio range, perform the step of determining a central pixel point in the to-be-processed image.
6. An image enhancement method, characterized in that, The method includes: obtain a to-be-processed image; determine a central pixel point in the to-be-processed image, where the central pixel point is at least one pixel point in the to-be-processed image; determine a neighborhood pixel mean value of the central pixel point; when a pixel value of the central pixel point is greater than the neighborhood pixel mean value, perform a first image enhancement process on the central pixel point; when the pixel value of the central pixel point is less than or equal to the neighborhood pixel mean value, perform a second image enhancement process on the central pixel point.
7. The method according to claim 6, wherein The determining the central pixel point in the to-be-processed image includes: divide the to-be-processed image into P regions, where P is an integer greater than 1; determine an image quality evaluation value of each of the P regions to obtain P image quality evaluation values; select image quality evaluation values less than a preset threshold from the P image quality evaluation values to obtain Q image quality evaluation values, and obtain target regions corresponding to the Q image quality evaluation values to obtain Q target regions; determine a central pixel point of each of the Q target regions to obtain the central pixel point of the to-be-processed image.
8. An electronic device, characterized in that, It includes a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and are configured to be executed by the processor, and the programs include instructions for performing the steps in the method as claimed in claim 6 or 7.
9. A computer-readable storage medium, characterized in that, Store a computer program for electronic data exchange, where the computer program causes a computer to execute the method as claimed in claim 6 or 7.
10. A computer program product, characterized in that, It includes a computer program, where the computer program is 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, causing the electronic device to execute any one of the methods as claimed in claim 6 or 7.