Image Processing Method and Related Device
By separating and enhancing the high-frequency components of the electronic device images, the problem of improving image quality is solved, and the image details are highlighted and quality improvement is achieved.
Patent Information
- Application Number
- CN202011043846.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-28
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2040-09-28
AI Technical Summary
How to improve the quality of the photographed images of electronic devices to meet users' needs for high-quality images.
By acquiring the high-frequency component and low-frequency component images of the image to be processed, the contrast coefficient of the high-frequency component is determined and the suppression operation is performed, the second contrast coefficient is obtained, and the image enhancement process is performed based on the second contrast coefficient, and finally synthesized with the low-frequency component image to obtain the target image.
Improves the detailed performance of the image and improves the image quality.
Smart Images

Figure CN112330577B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image processing method and related devices. Background Art
[0002] With the rapid development of electronic technology, taking pictures has become a standard technology for electronic devices (such as mobile phones, tablets, etc.). When taking pictures, users have higher and higher requirements for image quality. The quality of the image also affects users' evaluation of electronic devices to a certain extent. Therefore, the problem of how to improve image quality needs to be solved urgently. Summary of the invention
[0003] The embodiments of the present application provide an image processing method and related devices, which can improve image quality.
[0004] In a first aspect, an embodiment of the present application provides an image processing method, the method comprising:
[0005] Get the image to be processed;
[0006] Determining a high-frequency component image and a low-frequency component image of the image to be processed;
[0007] Determining a first contrast coefficient corresponding to the high-frequency component image;
[0008] performing a suppression operation on the first contrast coefficient to obtain a second contrast coefficient;
[0009] Performing image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image;
[0010] The target high-frequency component image and the low-frequency component image are synthesized to obtain a target image.
[0011] In a second aspect, an embodiment of the present application provides an image processing device, the device comprising: an acquisition unit, a determination unit, a suppression unit, an image enhancement unit and a synthesis unit, wherein:
[0012] The acquisition unit is used to acquire the image to be processed;
[0013] The determining unit is used to determine the high-frequency component image and the low-frequency component image of the image to be processed;
[0014] The determining unit is further used to determine a first contrast coefficient corresponding to the high-frequency component image;
[0015] The suppression unit is used to perform a suppression operation on the first contrast coefficient to obtain a second contrast coefficient;
[0016] The image enhancement unit is configured to perform image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image;
[0017] The synthesis unit is configured to synthesize the target high-frequency component image and the low-frequency component image to obtain a target image.
[0018] 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, where the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing the steps in any method of the first aspect of the embodiments of the present application.
[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, and the 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.
[0020] In a fifth aspect, an embodiment of the present application provides a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in any method of the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
[0021] Adopting the embodiments of the present application has the following beneficial effects:
[0022] It can be seen that for the image processing method and related device described in the embodiments of the present application, when applied to an electronic device, an image to be processed is obtained, the high-frequency component image and the low-frequency component image of the image to be processed are determined, the first contrast coefficient corresponding to the high-frequency component image is determined, an inhibition operation is performed on the first contrast coefficient to obtain a second contrast coefficient, image enhancement processing is performed on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image, and the target high-frequency component image and the low-frequency component image are synthesized to obtain a target image. In this way, the high-frequency components can be separated from the image. The high-frequency components contain the main details of the image, and image enhancement can be achieved for the details of the image, which helps to improve the image quality and highlight the image details. Description of the Drawings
[0023] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying 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 accompanying drawings can also be obtained based on these drawings.
[0024] Figure 1A is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
[0025] Figure 1B is a schematic flowchart of an image processing method provided by an embodiment of the present application;
[0026] Figure 2 is a schematic flowchart of another image processing 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 processing 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 in conjunction with the accompanying 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 accompanying 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] References to "embodiments" in this specification mean that a particular feature, structure, or characteristic described in connection with the embodiments can be included in at least one embodiment of the present application. The phrase appears in various places in the specification and 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), and so on.
[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, a communication module, and so on. 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 lines, 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, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole.
[0038] Among them, the processor may integrate an application processor and a modulation / demodulation processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modulation / demodulation processor mainly processes wireless communication. It can be understood that the above modulation / 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 following will introduce the embodiments of the present application in detail.
[0042] Please refer to Figure 1B , Figure 1B which is a schematic flowchart of an image processing method provided by an embodiment of the present application, applied to such as Figure 1AThe electronic device shown, as shown in the figure, the present image processing method includes the following operations.
[0043] 101. Obtain the image to be processed.
[0044] Among them, the image to be processed can be any frame image in the video, and the image to be processed can be a dark vision image or an exposure image.
[0045] In a possible example, the above step 101, obtaining the image to be processed, may include the following steps:
[0046] 11. Obtain the target environmental parameters;
[0047] 12. According to the mapping relationship between the preset environmental parameters and the shooting parameters, determine the target shooting parameters corresponding to the target environmental parameters;
[0048] 13. Shoot according to the target shooting parameters to obtain the image to be processed.
[0049] Among them, the target environmental parameters include external environmental parameters and internal environmental parameters; the external environmental parameters may include at least one of the following: environmental temperature, jitter parameter, weather, humidity, atmospheric pressure, altitude, season, environmental light brightness, magnetic field interference intensity, etc., which are not limited here. The jitter parameter can be used to describe the state of the user's hand jitter. The internal environmental parameters may include at least one of the following: CPU memory, GPU memory, CPU processing speed, GPU processing speed, CPU temperature, GPU temperature, etc., which are not limited here. The shooting parameters may be at least one of the following: sensitivity ISO, exposure duration, anti-shake parameter, shooting mode, camera label, etc., which are not limited here. Among them, the camera label is used to select the camera. For example, when the electronic device includes multiple cameras, the corresponding camera can be selected through the camera label to complete the shooting.
[0050] In specific implementation, the electronic device can obtain the target environmental parameters, and the mapping relationship between the preset environmental parameters and the shooting parameters can also be pre-stored in the electronic device. Furthermore, according to the mapping relationship between the preset environmental parameters and the shooting parameters, the target shooting parameters corresponding to the target environmental parameters can be determined, and shooting is performed according to the target shooting parameters to obtain the image to be processed. In this way, an image suitable for the environment can be obtained.
[0051] Furthermore, in a possible example, the target environmental parameters include target external environmental parameters and target internal environmental parameters. The above step 12, according to the mapping relationship between the preset environmental parameters and the shooting parameters, determining the target shooting parameters corresponding to the target environmental parameters may include the following steps:
[0052] 121. Determine the first shooting parameter corresponding to the target external environment parameter according to the mapping relationship between the preset external environment parameter and the shooting parameter;
[0053] 122. Determine the target optimization coefficient corresponding to the target internal environment parameter according to the mapping relationship between the preset internal environment parameter and the optimization coefficient;
[0054] 123. Optimize the first shooting parameter according to the target optimization coefficient to obtain the target shooting parameter.
[0055] Among them, in specific implementation, the mapping relationship between the preset external environment parameter and the shooting parameter, and the mapping relationship between the preset internal environment parameter and the optimization coefficient can be pre-stored in the electronic device. The value range of the optimization coefficient can be between -0.15 and 0.15, which is equivalent to fine-tuning the first shooting parameter.
[0056] Specifically, the electronic device can determine the first shooting parameter corresponding to the target external environment parameter according to the mapping relationship between the preset external environment parameter and the shooting parameter, and can determine the target optimization coefficient corresponding to the target internal environment parameter according to the mapping relationship between the preset internal environment parameter and the optimization coefficient. Furthermore, optimize the first shooting parameter according to the target optimization coefficient to obtain the target shooting parameter, that is, the target shooting parameter = (1 + target optimization coefficient) * first shooting parameter. In this way, the initial shooting parameter can be obtained through the external environment parameter, and it can be optimized through the internal environment parameter, so that the accurate shooting parameter can be obtained.
[0057] 102. Determine the high-frequency component image and the low-frequency component image of the image to be processed.
[0058] In specific implementation, the electronic device can perform multi-scale decomposition on the image to be processed through a multi-scale decomposition algorithm to obtain the high-frequency component image and the low-frequency component image. The multi-scale decomposition algorithm can be at least one of the following: wavelet transform, contourlet transform, non-subsampled contourlet transform, ridgelet transform, shearlet transform, etc., which are not limited here. Among them, the high-frequency component image can include the detail information of the image, and the low-frequency component image can include the main energy information of the image.
[0059] 103. Determine the first contrast coefficient corresponding to the high-frequency component image.
[0060] In specific implementation, the electronic device can determine the first contrast coefficient corresponding to the high-frequency component image through a contrast calculation formula.
[0061] For example, GC Y(i,j) represents the high-frequency component image, and i, j represent the pixel coordinate positions.
[0062]
[0063] where ε is a small positive number to avoid division by zero of the denominator, and B GC (i, j) represents Y GC The pixel value of (i, j) after being filtered by a specified filter, and the specified filter can be at least one of the following: guided filter, curvature filter, WLS filter, domain transform RF filter, LEP filter, etc., which is not limited herein.
[0064] 104. Perform an inhibition operation on the first contrast coefficient to obtain a second contrast coefficient.
[0065] In a specific implementation, the electronic device can perform an inhibition operation on the first contrast coefficient by adjusting a parameter to obtain a second contrast coefficient. The adjustment parameter can take a value between 0 and 1.5, and the second contrast coefficient = adjustment coefficient * first contrast coefficient.
[0066] Optionally, the electronic device can also suppress the noise of the image by attenuating the detail coefficient cof (the first contrast coefficient), as follows:
[0067]
[0068] where the slope and bias for suppressing noise are slope and offset respectively; cof min is calculated as follows:
[0069]
[0070] The value of the suppressed detail coefficient is:
[0071]
[0072] cof min is the first contrast coefficient, cof out (i, j) is the second contrast coefficient, cof temp (i, j) is the intermediate result coefficient.
[0073] In a possible example, step 104 above, performing an inhibition operation on the first contrast coefficient to obtain a second contrast coefficient, may include the following steps:
[0074] 41. Divide the high-frequency component image into multiple regions;
[0075] 42. Determine the contrast corresponding to each of the multiple regions to obtain multiple contrasts;
[0076] 43. Perform a mean square error operation based on the multiple contrasts to obtain a target mean square error;
[0077] 44. Determine the target suppression parameter of the first contrast coefficient according to the mapping relationship between the preset high-frequency contrast and the suppression parameter.
[0078] 45. Determine the target adjustment factor corresponding to the target mean square error according to the mapping relationship between the preset mean square error and the adjustment factor.
[0079] 46. Adjust the target suppression parameter according to the target adjustment factor to obtain an adjusted suppression parameter.
[0080] 47. Perform a suppression operation on the first contrast coefficient according to the adjusted suppression parameter to obtain the second contrast coefficient.
[0081] Among them, the electronic device can divide the high-frequency component image into multiple regions, and the size of each region can be the same or different. Furthermore, the contrast corresponding to each region in the multiple regions can be determined according to the contrast calculation formula to obtain multiple contrasts, and the target mean square error can be obtained by performing a mean square error operation on the multiple contrasts. The mapping relationship between the preset high-frequency contrast and the suppression parameter can also be pre-stored in the electronic device. Furthermore, the target suppression parameter of the first contrast coefficient can be determined according to the mapping relationship between the preset high-frequency contrast and the suppression parameter. The suppression parameter can reduce the contrast to a certain extent.
[0082] Furthermore, the mapping relationship between the preset mean square error and the adjustment factor can also be pre-stored in the electronic device. Furthermore, the target adjustment factor corresponding to the target mean square error can be determined according to the mapping relationship between the preset mean square error and the adjustment factor, and the target suppression parameter can be adjusted according to the target adjustment factor to obtain an adjusted suppression parameter, as follows:
[0083] Adjusted suppression parameter = (1 + target adjustment factor) * target suppression parameter
[0084] Among them, the value range of the target adjustment factor is between -1 and 1. For example, it can be -0.081 to 0.081.
[0085] Furthermore, the electronic device can perform a suppression operation on the first contrast coefficient according to the adjusted suppression parameter to obtain the second contrast coefficient.
[0086] In a possible example, between step 103 and step 104, the following steps can also be included:
[0087] A1. Determine the third contrast coefficient corresponding to the low-frequency component image.
[0088] A2. Determine the ratio between the first contrast coefficient and the third contrast coefficient.
[0089] A3. When the ratio is within a preset range, perform the step of suppressing the first contrast coefficient to obtain a second contrast coefficient.
[0090] Among them, the above preset range can be set by the user or default by the system. In a specific implementation, the electronic device can determine the third contrast coefficient corresponding to the low-frequency component image, and determine the ratio between the first contrast coefficient and the third contrast coefficient. When the ratio is within the preset range, step 104 is executed. Otherwise, step 104 may not be executed.
[0091] 105. Perform image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image.
[0092] In a specific implementation, the electronic device can perform image enhancement processing on part or all of the regions of the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image.
[0093] For example, the image enhancement processing can be performed according to the following formula:
[0094] Y out (i,j) = cof out (i,j) × Y GC (i,j) + K2 × (cof out (i,j) - 1) × Y(i,j)
[0095] Among them, K2 is the contrast enhancement intensity (second contrast coefficient); Y GC (i,j) represents the pixel value after global contrast enhancement processing of the high-frequency component image, and Y(i,j) represents the high-frequency component image.
[0096] Of course, the contrast intensity of the input image can also be restricted:
[0097]
[0098] Among them, Mulmax is the contrast enhancement multiple, and Y out (i,j) is the target high-frequency component image.
[0099] In a possible example, the above step 105, performing image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image, may include the following steps:
[0100] 51. Determine the target image enhancement area ratio corresponding to the second contrast coefficient according to the mapping relationship between the preset contrast coefficient and the image enhancement area ratio, where the target image enhancement area ratio is represented by S, S = a / b, and the value range of S is 0 to 1;
[0101] 52. Divide the high-frequency component image into P regions according to the target image enhancement area ratio, where P = a + b;
[0102] 53. Determine the number of feature points in each of the P regions to obtain P numbers of feature points;
[0103] 54. Select the smaller a numbers of feature points from the P numbers of feature points, and obtain the regions corresponding to the a numbers of feature points to get a regions to be enhanced;
[0104] 55. Perform image enhancement processing on the a regions to be enhanced to obtain the target high-frequency component image.
[0105] In specific implementation, the mapping relationship between the preset contrast coefficient and the image enhancement area ratio can be pre-stored in the electronic device. Furthermore, according to the mapping relationship between the preset contrast coefficient and the image enhancement area ratio, the target image enhancement area ratio corresponding to the second contrast coefficient can be determined. Among them, the target image enhancement area ratio is represented by S, S = a / b, and the value range of S is 0 to 1. The high-frequency component image can be divided into P regions according to the target image enhancement area ratio, where P = a + b, and both a and b are positive integers.
[0106] Furthermore, the electronic device can determine the number of feature points in each of the P regions to obtain P numbers of feature points, select the smaller a numbers of feature points from the P numbers of feature points, and obtain the regions corresponding to the a numbers of feature points to get a regions to be enhanced, that is, only perform image enhancement processing on the a regions to be enhanced to obtain the target high-frequency component image. In this way, local contrast enhancement can be achieved, the contrast of the regions with fewer details originally is improved, which helps to improve the image quality and also improves the image enhancement efficiency.
[0107] 106. Synthesize the target high-frequency component image and the low-frequency component image to obtain the target image.
[0108] In specific implementation, the electronic device can synthesize the target high-frequency component image and the low-frequency component image through the inverse transformation of the above multi-scale decomposition algorithm. For example, if the electronic device divides the image to be processed into a high-frequency component image and a low-frequency component image through the non-subsampled contourlet transform, then the target high-frequency component image and the low-frequency component image can also be synthesized through the inverse transformation of the non-subsampled contourlet transform to obtain the target image.
[0109] It can be seen that the image processing method described in the embodiments of the present application is applied to an electronic device, which acquires an image to be processed, determines a high-frequency component image and a low-frequency component image of the image to be processed, determines a first contrast coefficient corresponding to the high-frequency component image, performs an inhibition operation on the first contrast coefficient to obtain a second contrast coefficient, performs image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image, and synthesizes the target high-frequency component image and the low-frequency component image to obtain a target image. In this way, the high-frequency components can be separated from the image. The high-frequency components contain the main details of the image, and image enhancement can be achieved for the details of the image, which helps to improve the image quality and highlight the image details.
[0110] Consistent with the above Figure 1B shown embodiment, please refer to Figure 2 , Figure 2 is a schematic flowchart of an image processing method provided by an embodiment of the present application, which is applied to an electronic device. As shown in the figure, the image processing method includes the following steps:
[0111] 201. Acquire an image to be processed.
[0112] 202. Determine a high-frequency component image and a low-frequency component image of the image to be processed.
[0113] 203. Determine a first contrast coefficient corresponding to the high-frequency component image.
[0114] 204. Determine a third contrast coefficient corresponding to the low-frequency component image.
[0115] 205. Determine the ratio between the first contrast coefficient and the third contrast coefficient.
[0116] 206. When the ratio is within a preset range, perform an inhibition operation on the first contrast coefficient to obtain a second contrast coefficient.
[0117] 207. Perform image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image.
[0118] 208. Synthesize the target high-frequency component image and the low-frequency component image to obtain a target image.
[0119] Among them, the specific descriptions of the above steps 201-208 can refer to the corresponding steps of the image processing method described above Figure 1B and will not be elaborated here.
[0120] It can be seen that the image processing method described in the embodiments of the present application is applied to an electronic device, which obtains an image to be processed, determines the high-frequency component image and the low-frequency component image of the image to be processed, determines the first contrast coefficient corresponding to the high-frequency component image, determines the third contrast coefficient corresponding to the low-frequency component image, determines the ratio between the first contrast coefficient and the third contrast coefficient, and when the ratio is within a preset range, performs an inhibition operation on the first contrast coefficient to obtain a second contrast coefficient, performs image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image, and synthesizes the target high-frequency component image and the low-frequency component image to obtain a target image. In this way, the high-frequency components can be separated from the image. The high-frequency components contain the main details of the image, and image enhancement can be achieved for the details of the image, which helps to improve the image quality and highlight the image details.
[0121] Consistent with the above Figure 1B 、 Figure 2 shown embodiments, please refer to Figure 3 , Figure 3 FIG. is a schematic structural diagram of an electronic device 300 provided by 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. Among them, the one or more programs 321 are stored in the above-mentioned memory 320 and are configured to be executed by the above-mentioned processor 310. The one or more programs 321 include instructions for performing the following steps:
[0122] Obtain an image to be processed;
[0123] Determine the high-frequency component image and the low-frequency component image of the image to be processed;
[0124] Determine the first contrast coefficient corresponding to the high-frequency component image;
[0125] Perform an inhibition operation on the first contrast coefficient to obtain a second contrast coefficient;
[0126] Perform image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image;
[0127] Synthesize the target high-frequency component image and the low-frequency component image to obtain a target image.
[0128] It can be seen that the electronic device described in the embodiments of the present application acquires a to-be-processed image, determines a high-frequency component image and a low-frequency component image of the to-be-processed image, determines a first contrast coefficient corresponding to the high-frequency component image, performs an inhibition operation on the first contrast coefficient to obtain a second contrast coefficient, performs image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image, and synthesizes the target high-frequency component image and the low-frequency component image to obtain a target image. In this way, the high-frequency components can be separated from the image. The high-frequency components contain the main details of the image, and image enhancement can be achieved for the details of the image, which helps to improve the image quality and highlight the image details.
[0129] In a possible example, in terms of performing the inhibition operation on the first contrast coefficient to obtain the second contrast coefficient, the one or more programs 321 include:
[0130] Dividing the high-frequency component image into a plurality of regions;
[0131] Determining the contrast corresponding to each region in the plurality of regions to obtain a plurality of contrasts;
[0132] Performing a mean square error operation based on the plurality of contrasts to obtain a target mean square error;
[0133] Determining a target inhibition parameter of the first contrast coefficient according to a mapping relationship between a preset high-frequency contrast and an inhibition parameter;
[0134] Determining a target adjustment factor corresponding to the target mean square error according to a mapping relationship between a preset mean square error and an adjustment factor;
[0135] Adjusting the target inhibition parameter according to the target adjustment factor to obtain an adjusted inhibition parameter;
[0136] Performing an inhibition operation on the first contrast coefficient according to the adjusted inhibition parameter to obtain the second contrast coefficient.
[0137] In a possible example, in terms of performing image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image, the one or more programs 321 include for:
[0138] Determining a target image enhancement area ratio corresponding to the second contrast coefficient according to a mapping relationship between a preset contrast coefficient and an image enhancement area ratio, where the target image enhancement area ratio is represented by S, S = a / b, and the value range of S is 0 to 1;
[0139] Dividing the high-frequency component image into P regions according to the target image enhancement area ratio, where P = a + b;
[0140] Determine the number of feature points in each of the P regions to obtain P numbers of feature points;
[0141] Select the smaller a numbers of feature points from the P numbers of feature points, and obtain the regions corresponding to the a numbers of feature points to obtain a regions to be enhanced;
[0142] Perform image enhancement processing on the a regions to be enhanced to obtain the target high-frequency component image.
[0143] In a possible example, the one or more programs 321 further include:
[0144] Determine the third contrast coefficient corresponding to the low-frequency component image;
[0145] Determine the ratio between the first contrast coefficient and the third contrast coefficient;
[0146] When the ratio is within a preset range, perform the step of suppressing the first contrast coefficient to obtain the second contrast coefficient.
[0147] In a possible example, in terms of obtaining the image to be processed, the one or more programs 321 include:
[0148] Obtain target environmental parameters;
[0149] According to the mapping relationship between the preset environmental parameters and shooting parameters, determine the target shooting parameters corresponding to the target environmental parameters;
[0150] Perform shooting according to the target shooting parameters to obtain the image to be processed.
[0151] 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 the 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.
[0152] 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, only a logical function division, and there may be other division methods in actual implementation.
[0153] Figure 4 It is a block diagram of the functional unit composition of the image processing device 400 involved in the embodiments of the present application. The image processing device 400 is applied to an electronic device. The device 400 includes: an acquisition unit 401, a determination unit 402, a suppression unit 403, an image enhancement unit 404, and a synthesis unit 405, where
[0154] the acquisition unit 401 is configured to acquire an image to be processed;
[0155] the determination unit 402 is configured to determine a high-frequency component image and a low-frequency component image of the image to be processed;
[0156] the determination unit 402 is further configured to determine a first contrast coefficient corresponding to the high-frequency component image;
[0157] the suppression unit 403 is configured to perform a suppression operation on the first contrast coefficient to obtain a second contrast coefficient;
[0158] the image enhancement unit 404 is configured to perform image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image;
[0159] the synthesis unit 405 is configured to synthesize the target high-frequency component image and the low-frequency component image to obtain a target image.
[0160] It can be seen that the image processing device described in the embodiments of the present application is applied to an electronic device, acquires an image to be processed, determines a high-frequency component image and a low-frequency component image of the image to be processed, determines a first contrast coefficient corresponding to the high-frequency component image, performs a suppression operation on the first contrast coefficient to obtain a second contrast coefficient, performs image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image, and synthesizes the target high-frequency component image and the low-frequency component image to obtain a target image. In this way, the high-frequency component can be separated from the image. The high-frequency component contains the main details of the image, and image enhancement can be achieved for the details of the image, which helps to improve the image quality and highlight the image details.
[0161] In a possible example, in terms of performing an inhibition operation on the first contrast coefficient to obtain a second contrast coefficient, the inhibition unit 403 is specifically configured to:
[0162] Divide the high-frequency component image into multiple regions;
[0163] Determine the contrast corresponding to each of the multiple regions to obtain multiple contrasts;
[0164] Perform a mean square error operation based on the multiple contrasts to obtain a target mean square error;
[0165] Determine a target inhibition parameter for the first contrast coefficient according to a mapping relationship between a preset high-frequency contrast and an inhibition parameter;
[0166] Determine a target adjustment factor corresponding to the target mean square error according to a mapping relationship between a preset mean square error and an adjustment factor;
[0167] Adjust the target inhibition parameter according to the target adjustment factor to obtain an adjusted inhibition parameter;
[0168] Perform an inhibition operation on the first contrast coefficient according to the adjusted inhibition parameter to obtain the second contrast coefficient.
[0169] In a possible example, in terms of performing image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image, the image enhancement unit 404 is specifically configured to:
[0170] Determine a target image enhancement area ratio corresponding to the second contrast coefficient according to a mapping relationship between a preset contrast coefficient and an image enhancement area ratio, where the target image enhancement area ratio is represented by S, S = a / b, and the value range of S is 0 to 1;
[0171] Divide the high-frequency component image into P regions according to the target image enhancement area ratio, where P = a + b;
[0172] Determine the number of feature points in each of the P regions to obtain P numbers of feature points;
[0173] Select the smaller a numbers of feature points from the P numbers of feature points and obtain the regions corresponding to the a numbers of feature points to obtain a regions to be enhanced;
[0174] Perform image enhancement processing on the a regions to be enhanced to obtain the target high-frequency component image.
[0175] In a possible example, the apparatus 400 may also be used to perform the following operations, specifically as follows:
[0176] The determining unit 402 is configured to determine a third contrast coefficient corresponding to the low-frequency component image; and determine a ratio between the first contrast coefficient and the third contrast coefficient.
[0177] When the ratio is within a preset range, the suppression unit 403 performs the step of suppressing the first contrast coefficient to obtain a second contrast coefficient.
[0178] In a possible example, in terms of obtaining the image to be processed, the obtaining unit 401 is further specifically configured to:
[0179] Obtain target environmental parameters;
[0180] According to a mapping relationship between preset environmental parameters and shooting parameters, determine target shooting parameters corresponding to the target environmental parameters;
[0181] Perform shooting according to the target shooting parameters to obtain the image to be processed.
[0182] 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 some or all of the steps of any method described in the foregoing method embodiments, and the foregoing computer includes an electronic device.
[0183] An embodiment of the present application further provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute some or all of the steps of any method described in the foregoing method embodiments. The computer program product may be a software installation package, and the foregoing computer includes an electronic device.
[0184] 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 the present application is not limited by the described action sequence, because according to the present application, certain steps may 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 the present application.
[0185] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0186] In several embodiments provided by the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of devices or units can be in an electrical or other form.
[0187] The units described above as separate components 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 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.
[0188] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0189] If 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 the present application, in essence, 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. The 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 the present application. The aforementioned memory includes: USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical disks, etc., which can store program codes.
[0190] 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. The program can be stored in a computer-readable memory. The memory can include: flash drives, read-only memories (abbreviation: ROM), random access memories (abbreviation: RAM), magnetic disks, or optical disks, etc.
[0191] The above has introduced the embodiments of the present application in detail. Specific examples are used in this text to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present 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 the present application.
Claims
1. An image processing method, characterized in that, The method includes: Obtain the image to be processed; Determine the high-frequency component image and the low-frequency component image of the image to be processed; Determine the first contrast coefficient corresponding to the high-frequency component image. Specifically, determine the first contrast coefficient corresponding to the high-frequency component image through a contrast calculation formula, and the contrast calculation formula is as follows: where ε represents a positive number; B GC (i, j) represents Y GC (i, j) is the pixel value after filtering by a specified filter; Y GC (i, j) represents the pixel value at the pixel coordinate position (i, j) in the high-frequency component image; cof(i, j) represents the first contrast coefficient corresponding to (i, j); Perform an inhibition operation on the first contrast coefficient to obtain a second contrast coefficient; Perform image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image; Synthesize the target high-frequency component image and the low-frequency component image to obtain a target image; Among them, the step of performing an inhibition operation on the first contrast coefficient to obtain a second contrast coefficient includes: Divide the high-frequency component image into multiple regions; Determine the contrast corresponding to each region in the multiple regions to obtain multiple contrasts; Perform a mean square error operation based on the multiple contrasts to obtain a target mean square error; Determine the target inhibition parameter of the first contrast coefficient according to the mapping relationship between the preset high-frequency contrast and the inhibition parameter; Determine the target adjustment factor corresponding to the target mean square error according to the mapping relationship between the preset mean square error and the adjustment factor; Adjust the target inhibition parameter according to the target adjustment factor to obtain an adjusted inhibition parameter; Perform an inhibition operation on the first contrast coefficient according to the adjusted inhibition parameter to obtain the second contrast coefficient.
2. The method according to claim 1, characterized in that, The step of performing image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image includes: Determine the target image enhancement area ratio corresponding to the second contrast coefficient according to the mapping relationship between the preset contrast coefficient and the image enhancement area ratio. Among them, the target image enhancement area ratio is represented by S, S = a / b, and the value range of S is 0 to 1; Divide the high-frequency component image into P regions according to the target image enhancement area ratio, where P = a + b; Determine the number of feature points in each of the P regions to obtain P numbers of feature points; Select a numbers of feature points from the P numbers of feature points and obtain the regions corresponding to the a numbers of feature points to obtain a regions to be enhanced; a < b; Perform image enhancement processing on the a regions to be enhanced to obtain the target high-frequency component image.
3. The method according to claim 1 or 2, wherein The method further includes: Determine the third contrast coefficient corresponding to the low-frequency component image; Determine the ratio between the first contrast coefficient and the third contrast coefficient; When the ratio is within a preset range, execute the step of performing an inhibition operation on the first contrast coefficient to obtain a second contrast coefficient.
4. The method according to claim 1 or 2, characterized in that, The step of obtaining the image to be processed includes: Obtain target environmental parameters; Determine the target shooting parameters corresponding to the target environmental parameters according to the mapping relationship between the preset environmental parameters and the shooting parameters; Perform shooting according to the target shooting parameters to obtain the image to be processed.
5. An image processing apparatus, characterized in that, The device includes: an acquisition unit, a determination unit, an inhibition unit, an image enhancement unit, and a synthesis unit. Among them, the acquisition unit is used to obtain the image to be processed; The determining unit is configured to determine a high-frequency component image and a low-frequency component image of the image to be processed; The determining unit is further configured to determine a first contrast coefficient corresponding to the high-frequency component image, specifically: determining the first contrast coefficient corresponding to the high-frequency component image through a contrast calculation formula, and the contrast calculation formula is as follows: where ε represents a positive number; B GC (i, j) represents Y GC the pixel value of (i, j) after being filtered by a specified filter; Y GC (i, j) represents the pixel value at the pixel coordinate position (i, j) in the high-frequency component image; cof(i, j) represents the first contrast coefficient corresponding to (i, j); The suppressing unit is configured to perform a suppressing operation on the first contrast coefficient to obtain a second contrast coefficient; The image enhancement unit is configured to perform image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image; The synthesizing unit is configured to synthesize the target high-frequency component image and the low-frequency component image to obtain a target image; Wherein, in terms of performing a suppressing operation on the first contrast coefficient to obtain a second contrast coefficient, the suppressing unit specifically is configured to: Divide the high-frequency component image into multiple regions; Determine the contrast corresponding to each of the multiple regions to obtain multiple contrasts; Perform a mean square error operation based on the multiple contrasts to obtain a target mean square error; Determine a target suppression parameter of the first contrast coefficient according to a mapping relationship between a high-frequency contrast and a suppression parameter; Determine a target adjustment factor corresponding to the target mean square error according to a mapping relationship between the mean square error and an adjustment factor; Adjust the target suppression parameter according to the target adjustment factor to obtain an adjusted suppression parameter; Perform a suppressing operation on the first contrast coefficient according to the adjusted suppression parameter to obtain the second contrast coefficient.
6. The device according to claim 5, characterized in that In terms of performing image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain a target high-frequency component image, the image enhancement unit specifically is configured to: Determine a target image enhancement area ratio corresponding to the second contrast coefficient according to a mapping relationship between a contrast coefficient and an image enhancement area ratio, wherein the target image enhancement area ratio is represented by S, S = a / b, and the value range of S is 0 to 1; Divide the high-frequency component image into P regions according to the target image enhancement area ratio, where P = a + b; Determine the number of feature points in each of the P regions to obtain P numbers of feature points; Select a numbers of feature points from the P numbers of feature points, and obtain the regions corresponding to the a numbers of feature points to obtain a regions to be enhanced; a < b; Perform image enhancement processing on the a regions to be enhanced to obtain the target high-frequency component image.
7. An electronic device, characterized in that, Comprising a processor, a memory, a communication interface, and one or more programs, 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 according to any one of claims 1-4.
8. A computer-readable storage medium, characterized in that, A computer program stored for electronic data exchange, wherein the computer program causes a computer to execute the method according to any one of claims 1-4.
Citation Information
Patent Citations
Image processing method and image processing system
CN106169181A
Optimized East Pakistan ancient book image enhancing method
CN107784638A