Image processing device and method, electronic equipment and related product
By acquiring and processing the high-frequency and low-frequency components of images from electronic devices, performing contrast coefficient suppression and enhancement operations, and synthesizing images, the problem of improving image quality is solved, and image details are highlighted and quality is improved.
Patent Information
- Application Number
- CN202510790653.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-28
- Publication Date
- 2025-11-11
AI Technical Summary
How to improve the quality of images taken by electronic devices to meet users' demand for high-quality images.
By acquiring the high-frequency and low-frequency component images of the image to be processed, the contrast coefficient of the high-frequency component is determined and suppressed to obtain the second contrast coefficient. Image enhancement processing is performed based on the second contrast coefficient, and finally the high-frequency and low-frequency component images are synthesized to form the target image.
It improves the detail in the image and enhances the image quality.
Smart Images

Figure CN120931498A_ABST
Abstract
Description
[0001] This application is a divisional application of Chinese Patent Application No. 202011043846.5, filed with the Chinese Patent Office on September 28, 2020, entitled "Image Processing Method and Related Apparatus", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of image processing technology, specifically to an image processing apparatus, method, electronic device, and related products. Background Technology
[0003] With the rapid development of electronic technology, photography has become an increasingly standard feature of electronic devices (such as mobile phones and tablets). As a result, users have higher and higher requirements for image quality, and 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 urgently needs to be solved. Summary of the Invention
[0004] This application provides an image processing apparatus, method, electronic device, and related product that can improve image quality.
[0005] In a first aspect, embodiments of this application provide an image processing method, the method comprising:
[0006] Obtain the image to be processed;
[0007] Determine the high-frequency component image and low-frequency component image of the image to be processed;
[0008] Determine the first contrast coefficient corresponding to the high-frequency component image;
[0009] The first contrast coefficient is suppressed to obtain the second contrast coefficient;
[0010] Based on the second contrast coefficient, the high-frequency component image is subjected to image enhancement processing to obtain the target high-frequency component image;
[0011] The target image is obtained by combining the high-frequency component image and the low-frequency component image.
[0012] Secondly, embodiments of this application provide an image processing apparatus, the apparatus comprising: an acquisition unit, a determination unit, a suppression unit, an image enhancement unit, and a synthesis unit, wherein...
[0013] The acquisition unit is used to acquire the image to be processed;
[0014] The determining unit is used to determine the high-frequency component image and the low-frequency component image of the image to be processed;
[0015] The determining unit is further configured to determine the first contrast coefficient corresponding to the high-frequency component image;
[0016] The suppression unit is used to suppress the first contrast coefficient to obtain the second contrast coefficient;
[0017] The image enhancement unit is used to perform image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain the target high-frequency component image;
[0018] The synthesis unit is used to synthesize the target high-frequency component image and the low-frequency component image to obtain the target image.
[0019] Thirdly, embodiments of this application provide an electronic device, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing steps in any method of the first aspect of this application.
[0020] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in any method of the first aspect of this application.
[0021] Fifthly, embodiments of this application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in any method of the first aspect of this application. The computer program product may be a software installation package.
[0022] The embodiments of this application have the following beneficial effects:
[0023] As can be seen, the image processing apparatus, method, electronic device, and related products described in the embodiments of this application are applied to electronic devices to acquire an 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, perform a suppression 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, and synthesize the target high-frequency component image with 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 image quality and highlight image details. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1A This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0026] Figure 1B This is a schematic flowchart of an image processing method provided in an embodiment of this application;
[0027] Figure 2 This is a schematic flowchart of another image processing method provided in an embodiment of this application;
[0028] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0029] Figure 4 This is a block diagram of the functional units of an image processing device provided in an embodiment of this application. Detailed Implementation
[0030] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0031] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0032] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0033] The electronic devices involved in the embodiments of this application can be electronic devices with communication capabilities or electronic devices without communication capabilities. The electronic devices can include various handheld devices with wireless communication functions (such as mobile phones, tablets, etc.), vehicle-mounted devices, wearable devices (smart glasses, smart bracelets, smartwatches, etc.), smart cameras, smart webcams, computing devices or other processing devices connected to wireless modems, as well as various forms of user equipment (UE), mobile station (MS), terminal device, etc.
[0034] Please see Figure 1A , Figure 1A This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device includes a processor, a memory, a signal processor, a transceiver, a display screen, a speaker, a microphone, random access memory (RAM), a camera, a sensor, and a communication module, etc. The memory, signal processor, display screen, speaker, microphone, RAM, camera, sensor, and communication module are connected to the processor, and the transceiver is connected to the signal processor.
[0035] The display screen can be a liquid crystal display (LCD), an organic or inorganic light-emitting diode (OLED), an active matrix organic light-emitting diode (AMOLED), etc.
[0036] The camera can be a regular camera or an infrared camera; there is no limitation on this. The camera can be a front-facing camera or a rear-facing camera; there is no limitation on this.
[0037] The sensor includes at least one of the following: a light sensor, a gyroscope, an infrared proximity sensor, a fingerprint sensor, a pressure sensor, etc. The light sensor, also known as an ambient light sensor, is used to detect ambient light intensity. The light sensor may include a photosensitive element and an analog-to-digital converter (ADC). The photosensitive element converts the collected light signal into an electrical signal, and the ADC converts the electrical signal into a digital signal. Optionally, the light sensor may also include a signal amplifier, which amplifies the electrical signal converted by the photosensitive element and outputs it to the ADC. The photosensitive element may include at least one of a photodiode, a phototransistor, a photoresistor, and a silicon photovoltaic cell.
[0038] The processor is the control center of the electronic device. It connects various parts of the electronic device through various interfaces and lines. By running or executing software programs and / or modules stored in the memory, and calling data stored in the memory, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole.
[0039] The processor can integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor. The processor can be at least one of the following: ISP, CPU, GPU, NPU, etc., without limitation.
[0040] The memory stores 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. 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 high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0041] The communication module can be used to implement communication functions. The communication module can be at least one of the following: infrared module, Bluetooth module, mobile communication module, NFC module, Wi-Fi module, etc., without limitation.
[0042] The embodiments of this application will be described in detail below.
[0043] Please see Figure 1B , Figure 1B This application provides a flowchart illustrating an image processing method, applicable to, for example... Figure 1AThe electronic device shown in the figure includes the following operations in this image processing method.
[0044] 101. Obtain the image to be processed.
[0045] The image to be processed can be any frame from the video, and it can be a dark vision image or an overexposed image.
[0046] In one possible example, step 101 above, obtaining the image to be processed, may include the following steps:
[0047] 11. Obtain target environment parameters;
[0048] 12. Determine the target shooting parameters corresponding to the target environmental parameters according to the preset mapping relationship between environmental parameters and shooting parameters;
[0049] 13. Take a picture according to the target shooting parameters to obtain the image to be processed.
[0050] The target environmental parameters include external and internal environmental parameters. External environmental parameters may include at least one of the following: ambient temperature, shake parameters, weather, humidity, atmospheric pressure, altitude, season, ambient light intensity, magnetic field interference intensity, etc., without limitation. Shake parameters can be used to describe the state of the user's hand tremors. 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., without limitation. Shooting parameters may include at least one of the following: ISO sensitivity, exposure time, image stabilization parameters, shooting mode, camera identification number, etc., without limitation. The camera identification number is used to select the camera. For example, when the electronic device includes multiple cameras, the corresponding camera can be selected by the camera identification number to complete the shooting.
[0051] In practice, the electronic device can acquire target environmental parameters. The electronic device can also pre-store the mapping relationship between preset environmental parameters and shooting parameters. Then, according to the preset mapping relationship between environmental parameters and shooting parameters, the target shooting parameters corresponding to the target environmental parameters can be determined, and the image to be processed can be captured based on the target shooting parameters. In this way, an image suitable for the environment can be obtained.
[0052] Furthermore, in a possible example, the target environmental parameters include target external environmental parameters and target internal environmental parameters. Step 12 above, determining the target shooting parameters corresponding to the target environmental parameters according to the preset mapping relationship between environmental parameters and shooting parameters, may include the following steps:
[0053] 121. Determine the first shooting parameter corresponding to the target's external environment parameters according to the preset mapping relationship between external environment parameters and shooting parameters;
[0054] 122. Determine the target optimization coefficients corresponding to the target internal environment parameters according to the preset mapping relationship between internal environment parameters and optimization coefficients;
[0055] 123. Optimize the first shooting parameters according to the target optimization coefficient to obtain the target shooting parameters.
[0056] In a specific implementation, the electronic device can pre-store the mapping relationship between preset external environment parameters and shooting parameters, as well as the mapping relationship between preset internal environment parameters and optimization coefficients. The value range of the optimization coefficients can be between -0.15 and 0.15, which is equivalent to fine-tuning the first shooting parameters.
[0057] Specifically, the electronic device can determine the first shooting parameter corresponding to the target external environment parameter according to the preset mapping relationship between external environment parameters and shooting parameters, and can determine the target optimization coefficient corresponding to the target internal environment parameter according to the preset mapping relationship between internal environment parameters and optimization coefficient. Then, the first shooting parameter is optimized according to the target optimization coefficient to obtain the target shooting parameter, that is, target shooting parameter = (1 + target optimization coefficient) * first shooting parameter. In this way, the initial shooting parameter can be obtained through external environment parameters, and the accurate shooting parameter can be obtained by optimizing it through internal environment parameters.
[0058] 102. Determine the high-frequency component image and low-frequency component image of the image to be processed.
[0059] In practical implementation, electronic devices can use a multi-scale decomposition algorithm to decompose the image to be processed into high-frequency component images and low-frequency component images. The multi-scale decomposition algorithm can be at least one of the following: wavelet transform, contourlet transform, non-subsampled contourlet transform, ridge transform, shearing transform, etc., without limitation. Among them, the high-frequency component image can include the detailed information of the image, and the low-frequency component image can include the main energy information of the image.
[0060] 103. Determine the first contrast coefficient corresponding to the high-frequency component image.
[0061] In practice, electronic devices can determine the first contrast coefficient corresponding to the high-frequency component image through the contrast calculation formula.
[0062] For example, Y GC (i,j) represents the high-frequency component image, where i and j represent pixel coordinates.
[0063]
[0064] In the formula, ε is a small positive number to avoid division by zero in the denominator, B GC (i,j) represents Y GC (i,j) is the pixel value after being filtered by the specified filter. The specified filter can be at least one of the following: guided filter, curvature filter, WLS filter, domain transform RF filter, LEP filter, etc., without limitation.
[0065] 104. Perform a suppression operation on the first contrast coefficient to obtain the second contrast coefficient.
[0066] In practice, the electronic device can suppress the first contrast coefficient by adjusting parameters to obtain a second contrast coefficient. The adjustment parameter can be between 0 and 1.5, and the second contrast coefficient = adjustment coefficient * first contrast coefficient.
[0067] Alternatively, electronic devices can also suppress image noise by attenuating the detail coefficient cof (first contrast coefficient), as follows:
[0068]
[0069] Wherein, the slope and offset for noise suppression are slope and offset, respectively; cof min The calculation is as follows:
[0070]
[0071] The detail coefficient value after suppression is:
[0072]
[0073] cof min Cof is the first contrast ratio. out (i,j) is the second contrast coefficient, cof temp (i,j) represents the intermediate result coefficients.
[0074] In one possible example, step 104 above, which involves suppressing the first contrast coefficient to obtain a second contrast coefficient, may include the following steps:
[0075] 41. Divide the high-frequency component image into multiple regions;
[0076] 42. Determine the contrast ratio corresponding to each of the multiple regions to obtain multiple contrast ratios;
[0077] 43. Perform mean square error calculation based on the multiple contrast ratios to obtain the target mean square error;
[0078] 44. Determine the target suppression parameter of the first contrast coefficient according to the preset mapping relationship between high-frequency contrast and suppression parameters;
[0079] 45. Determine the target adjustment factor corresponding to the target mean square error according to the preset mapping relationship between the mean square error and the adjustment factor;
[0080] 46. Adjust the target inhibition parameter according to the target adjustment factor to obtain the adjusted inhibition parameter;
[0081] 47. Perform a suppression operation on the first contrast coefficient according to the adjustment suppression parameter to obtain the second contrast coefficient.
[0082] The electronic device can divide a high-frequency component image into multiple regions, each region of which may be the same or different in size. Then, it can determine the contrast of each region in the multiple regions according to the contrast calculation formula, thus obtaining multiple contrasts. The mean square error is calculated based on the multiple contrasts to obtain the target mean square error. The electronic device can also pre-store a mapping relationship between preset high-frequency contrast and suppression parameters. Then, according to the preset mapping relationship between high-frequency contrast and suppression parameters, the target suppression parameter of the first contrast coefficient can be determined. The suppression parameter can reduce the contrast to a certain extent.
[0083] Furthermore, the electronic device can pre-store a preset mapping relationship between mean squared error and adjustment factor. Then, according to the preset mapping relationship, the target adjustment factor corresponding to the target mean squared error can be determined, and the target suppression parameter can be adjusted based on the target adjustment factor to obtain the adjustment suppression parameter, as detailed below:
[0084] Regulation inhibition parameter = (1 + target regulation factor) * target inhibition parameter
[0085] The target adjustment factor has a value range of -1 to 1, for example, it can be -0.081 to 0.081.
[0086] Furthermore, the electronic device can suppress the first contrast coefficient according to the adjustment and suppression parameters to obtain the second contrast coefficient.
[0087] In one possible example, the steps between steps 103 and 104 above may also include the following steps:
[0088] A1. Determine the third contrast coefficient corresponding to the low-frequency component image;
[0089] A2. Determine the ratio between the first contrast coefficient and the third contrast coefficient;
[0090] A3. When the ratio is within a preset range, perform the step of suppressing the first contrast coefficient to obtain the second contrast coefficient.
[0091] The aforementioned preset range can be set by the user or by the system default. In 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. If the ratio is within the preset range, step 104 is executed; otherwise, step 104 is not executed.
[0092] 105. Perform image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain the target high-frequency component image.
[0093] In practice, the electronic device can perform image enhancement processing on part or all of the high-frequency component image based on the second contrast coefficient to obtain the target high-frequency component image.
[0094] For example, image enhancement can be performed using the following formula:
[0095] Y out (i,j)=cof out (i,j)×Y GC (i,j)+K2×(cof out (i,j)-1)×Y(i,j)
[0096] Where 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.
[0097] Of course, the contrast intensity of the input image can also be limited:
[0098]
[0099] Where Mulmax is the contrast enhancement factor, Y out (i,j) represents the high-frequency component image of the target.
[0100] In one possible example, step 105 above, which involves performing image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain the target high-frequency component image, may include the following steps:
[0101] 51. According to the preset mapping relationship between contrast coefficient and image enhancement area ratio, determine the target image enhancement area ratio corresponding to the second contrast coefficient, wherein the target image enhancement area ratio is represented by S, S = a / b, and the value range of S is 0 to 1.
[0102] 52. Divide the high-frequency component image into P regions according to the target image enhancement area ratio, where P = a + b;
[0103] 53. Determine the number of feature points in each of the P regions to obtain the total number of feature points (P).
[0104] 54. Select the smaller number of feature points (a) from the P feature point counts, and obtain the regions corresponding to the number of feature points (a) to obtain a regions to be enhanced;
[0105] 55. Perform image enhancement processing on the a regions to be enhanced to obtain the target high-frequency component image.
[0106] In a specific implementation, the electronic device can pre-store a mapping relationship between a preset contrast coefficient and an image enhancement area ratio. Then, according to the preset mapping relationship between the contrast coefficient and the image enhancement area ratio, the target image enhancement area ratio corresponding to the second contrast coefficient can be determined. The target image enhancement area ratio is represented by S, where S = a / b and the value of S ranges from 0 to 1. The high-frequency component image can be divided into P regions based on the target image enhancement area ratio, where P = a + b and a and b are both positive integers.
[0107] Furthermore, the electronic device can determine the number of feature points in each of the P regions, obtain the number of P feature points, select the smaller number of feature points a from the P feature point counts, and obtain the region corresponding to the number of feature points a, thus obtaining a regions to be enhanced. That is, image enhancement processing is only performed on the a regions to be enhanced to obtain the target high-frequency component image. In this way, local contrast enhancement can be achieved, improving the contrast of areas with less detail, which helps to improve image quality and image enhancement efficiency.
[0108] 106. Combine the target high-frequency component image with the low-frequency component image to obtain the target image.
[0109] In specific implementation, electronic devices can synthesize the target high-frequency component image and low-frequency component image by inverse transformation with 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 by non-subsampled contour wave transform, it can also synthesize the target high-frequency component image and low-frequency component image by inverse transformation of non-subsampled contour wave transform to obtain the target image.
[0110] As can be seen, the image processing method described in this application embodiment is applied to an electronic device. It acquires 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, 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 with 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.
[0111] With the above Figure 1B The embodiments shown are consistent; please refer to [link / reference]. Figure 2 , Figure 2 This is a schematic flowchart of an image processing method provided in an embodiment of this application, applied to an electronic device. As shown in the figure, the image processing method includes the following steps:
[0112] 201. Obtain the image to be processed.
[0113] 202. Determine the high-frequency component image and low-frequency component image of the image to be processed.
[0114] 203. Determine the first contrast coefficient corresponding to the high-frequency component image.
[0115] 204. Determine the third contrast coefficient corresponding to the low-frequency component image.
[0116] 205. Determine the ratio between the first contrast coefficient and the third contrast coefficient.
[0117] 206. When the ratio is within a preset range, the first contrast coefficient is suppressed to obtain the second contrast coefficient.
[0118] 207. Perform image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain the target high-frequency component image.
[0119] 208. Combine the target high-frequency component image with the low-frequency component image to obtain the target image.
[0120] For a detailed description of steps 201-208 above, please refer to the above. Figure 1B The corresponding steps of the image processing method described herein will not be repeated here.
[0121] As can be seen, the image processing method described in this application embodiment is applied to an electronic device. It acquires 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 a suppression operation on the first contrast coefficient to obtain a second contrast coefficient. Based on the second contrast coefficient, it performs image enhancement processing on the high-frequency component image to obtain a target high-frequency component image. The target high-frequency component image is then synthesized with the low-frequency component image to obtain the 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, enabling image enhancement targeting the image details, which helps improve image quality and highlight image details.
[0122] With the above Figure 1B , Figure 2 The embodiments shown are consistent; please refer to [link / reference]. Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device 300 provided in 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. The one or more programs 321 are stored in the memory 320 and configured to be executed by the processor 310. The one or more programs 321 include instructions for performing the following steps:
[0123] Obtain the image to be processed;
[0124] Determine the high-frequency component image and low-frequency component image of the image to be processed;
[0125] Determine the first contrast coefficient corresponding to the high-frequency component image;
[0126] The first contrast coefficient is suppressed to obtain the second contrast coefficient;
[0127] Based on the second contrast coefficient, the high-frequency component image is subjected to image enhancement processing to obtain the target high-frequency component image;
[0128] The target image is obtained by combining the high-frequency component image and the low-frequency component image.
[0129] As can be seen, the electronic device described in this application acquires 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, 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 with 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.
[0130] In one possible example, in relation to the suppression operation on the first contrast coefficient to obtain the second contrast coefficient, the one or more procedures 321 include:
[0131] The high-frequency component image is divided into multiple regions;
[0132] Determine the contrast corresponding to each of the multiple regions to obtain multiple contrast ratios;
[0133] The target mean square error is obtained by performing mean square error calculation based on the multiple contrast ratios.
[0134] The target suppression parameter of the first contrast coefficient is determined according to the preset mapping relationship between high-frequency contrast and suppression parameter;
[0135] The target adjustment factor corresponding to the target mean square error is determined according to the preset mapping relationship between the mean square error and the adjustment factor.
[0136] The target inhibition parameter is adjusted according to the target adjustment factor to obtain the adjusted inhibition parameter;
[0137] The first contrast coefficient is suppressed according to the adjustment and suppression parameters to obtain the second contrast coefficient.
[0138] In one possible example, regarding the image enhancement processing of the high-frequency component image based on the second contrast coefficient to obtain the target high-frequency component image, the one or more procedures 321 include:
[0139] According to the preset mapping relationship between contrast coefficient and image enhancement area ratio, the target image enhancement area ratio corresponding to the second contrast coefficient is determined, wherein the target image enhancement area ratio is represented by S, S = a / b, and the value range of S is 0 to 1.
[0140] The high-frequency component image is divided into P regions based on the target image enhancement area ratio, where P = a + b;
[0141] Determine the number of feature points in each of the P regions to obtain the total number of P feature points;
[0142] Select the smaller number of feature points (a) from the P feature point counts, and obtain the regions corresponding to the number of feature points (a) to obtain a regions to be enhanced.
[0143] Image enhancement processing is performed on the a regions to be enhanced to obtain the high-frequency component image of the target.
[0144] In one possible example, the one or more procedures 321 further include:
[0145] Determine the third contrast coefficient corresponding to the low-frequency component image;
[0146] Determine the ratio between the first contrast coefficient and the third contrast coefficient;
[0147] When the ratio is within a preset range, the step of suppressing the first contrast coefficient to obtain the second contrast coefficient is performed.
[0148] In one possible example, regarding the acquisition of the image to be processed, the one or more procedures 321 include:
[0149] Obtain target environment parameters;
[0150] Based on the preset mapping relationship between environmental parameters and shooting parameters, the target shooting parameters corresponding to the target environmental parameters are determined;
[0151] The image to be processed is obtained by taking a picture according to the target shooting parameters.
[0152] The above primarily describes the solutions of the embodiments of this application from the perspective of the method execution process. It is understood that, in order to achieve the above functions, the electronic device includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments provided herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0153] This application embodiment can divide the electronic device into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0154] Figure 4 This is a functional unit block diagram of the image processing apparatus 400 involved in the embodiments of this application. The image processing apparatus 400 is applied to an electronic device, and the apparatus 400 includes: an acquisition unit 401, a determination unit 402, a suppression unit 403, an image enhancement unit 404, and a synthesis unit 405, wherein...
[0155] The acquisition unit 401 is used to acquire the image to be processed;
[0156] The determining unit 402 is used to determine the high-frequency component image and the low-frequency component image of the image to be processed;
[0157] The determining unit 402 is further configured to determine the first contrast coefficient corresponding to the high-frequency component image;
[0158] The suppression unit 403 is used to suppress the first contrast coefficient to obtain a second contrast coefficient.
[0159] The image enhancement unit 404 is used to perform image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain the target high-frequency component image.
[0160] The synthesis unit 405 is used to synthesize the target high-frequency component image and the low-frequency component image to obtain the target image.
[0161] As can be seen, the image processing apparatus described in this application embodiment is applied to an electronic device, acquires 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, 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 with 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.
[0162] In one possible example, in the process of suppressing the first contrast coefficient to obtain the second contrast coefficient, the suppression unit 403 is specifically used for:
[0163] The high-frequency component image is divided into multiple regions;
[0164] Determine the contrast corresponding to each of the multiple regions to obtain multiple contrast ratios;
[0165] The target mean square error is obtained by performing mean square error calculation based on the multiple contrast ratios.
[0166] The target suppression parameter of the first contrast coefficient is determined according to the preset mapping relationship between high-frequency contrast and suppression parameter;
[0167] The target adjustment factor corresponding to the target mean square error is determined according to the preset mapping relationship between the mean square error and the adjustment factor.
[0168] The target inhibition parameter is adjusted according to the target adjustment factor to obtain the adjusted inhibition parameter;
[0169] The first contrast coefficient is suppressed according to the adjustment and suppression parameters to obtain the second contrast coefficient.
[0170] In one possible example, regarding the image enhancement processing of the high-frequency component image based on the second contrast coefficient to obtain the target high-frequency component image, the image enhancement unit 404 is specifically used for:
[0171] According to the preset mapping relationship between contrast coefficient and image enhancement area ratio, the target image enhancement area ratio corresponding to the second contrast coefficient is determined, wherein the target image enhancement area ratio is represented by S, S = a / b, and the value range of S is 0 to 1.
[0172] The high-frequency component image is divided into P regions based on the target image enhancement area ratio, where P = a + b;
[0173] Determine the number of feature points in each of the P regions to obtain the total number of P feature points;
[0174] Select the smaller number of feature points (a) from the P feature point counts, and obtain the regions corresponding to the number of feature points (a) to obtain a regions to be enhanced.
[0175] Image enhancement processing is performed on the a regions to be enhanced to obtain the high-frequency component image of the target.
[0176] In one possible example, the device 400 can also be used to perform the following operations:
[0177] The determining unit 402 is used to determine the third contrast coefficient corresponding to the low-frequency component image; and to determine the ratio between the first contrast coefficient and the third contrast coefficient.
[0178] When the ratio is within a preset range, the suppression unit 403 performs the step of suppressing the first contrast coefficient to obtain the second contrast coefficient.
[0179] In one possible example, regarding the acquisition of the image to be processed, the acquisition unit 401 is further specifically used for:
[0180] Obtain target environment parameters;
[0181] Based on the preset mapping relationship between environmental parameters and shooting parameters, the target shooting parameters corresponding to the target environmental parameters are determined;
[0182] The image to be processed is obtained by taking a picture according to the target shooting parameters.
[0183] This application also provides a computer storage medium storing a computer program for electronic data interchange, which causes a computer to perform some or all of the steps of any of the methods described in the above method embodiments, wherein the computer includes an electronic device.
[0184] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the computer may include an electronic device.
[0185] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0186] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0187] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0188] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0189] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0190] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this 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. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0191] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0192] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An image processing apparatus, characterized in that, The image processing device includes: an acquisition unit, a determination unit, a suppression unit, an image enhancement unit, and a synthesis unit, wherein, The acquisition unit is used to acquire the image to be processed; The determining unit is used to determine the high-frequency component image and the low-frequency component image of the image to be processed; The determining unit is further configured to determine the first contrast coefficient corresponding to the high-frequency component image; The suppression unit is used to suppress the first contrast coefficient to obtain the second contrast coefficient; The image enhancement unit is used to perform image enhancement processing on the high-frequency component image based on the second contrast coefficient to obtain the target high-frequency component image; The synthesis unit is used to synthesize the target high-frequency component image and the low-frequency component image to obtain the target image.
2. The image processing apparatus according to claim 1, characterized in that, In the process of suppressing the first contrast coefficient to obtain the second contrast coefficient, the suppression unit is specifically used for: The high-frequency component image is divided into multiple regions; Determine the contrast corresponding to each of the multiple regions to obtain multiple contrast ratios; The target mean square error is obtained by performing mean square error calculation based on the multiple contrast ratios. The target suppression parameter of the first contrast coefficient is determined according to the preset mapping relationship between high-frequency contrast and suppression parameter; The target adjustment factor corresponding to the target mean square error is determined according to the preset mapping relationship between the mean square error and the adjustment factor. The target inhibition parameter is adjusted according to the target adjustment factor to obtain the adjusted inhibition parameter; The first contrast coefficient is suppressed according to the adjustment and suppression parameters to obtain the second contrast coefficient.
3. The image processing apparatus according to claim 1 or 2, characterized in that, In the aspect 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 is specifically used for: According to the preset mapping relationship between contrast coefficient and image enhancement area ratio, the target image enhancement area ratio corresponding to the second contrast coefficient is determined, wherein 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 is divided into P regions based on the target image enhancement area ratio, where P = a + b; Determine the number of feature points in each of the P regions to obtain the total number of P feature points; Select the smaller number of feature points (a) from the P feature point counts, and obtain the regions corresponding to the number of feature points (a) to obtain a regions to be enhanced. Image enhancement processing is performed on the a regions to be enhanced to obtain the high-frequency component image of the target.
4. The image processing apparatus according to any one of claims 1-3, characterized in that, The image processing device is also specifically used for: 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, the step of suppressing the first contrast coefficient to obtain the second contrast coefficient is performed.
5. The image processing apparatus according to any one of claims 1-4, characterized in that, In acquiring the image to be processed, the acquisition unit is specifically used for: Obtain target environment parameters; Based on the preset mapping relationship between environmental parameters and shooting parameters, the target shooting parameters corresponding to the target environmental parameters are determined; The image to be processed is obtained by taking a picture according to the target shooting parameters.
6. An image processing method, characterized in that, The method includes: Obtain the image to be processed; Determine the high-frequency component image and low-frequency component image of the image to be processed; Determine the first contrast coefficient corresponding to the high-frequency component image; The first contrast coefficient is suppressed to obtain the second contrast coefficient; Based on the second contrast coefficient, the high-frequency component image is subjected to image enhancement processing to obtain the target high-frequency component image; The target image is obtained by combining the high-frequency component image and the low-frequency component image.
7. The image processing method according to claim 6, characterized in that, The step of suppressing the first contrast coefficient to obtain the second contrast coefficient includes: The high-frequency component image is divided into multiple regions; Determine the contrast corresponding to each of the multiple regions to obtain multiple contrast ratios; The target mean square error is obtained by performing mean square error calculation based on the multiple contrast ratios. The target suppression parameter of the first contrast coefficient is determined according to the preset mapping relationship between high-frequency contrast and suppression parameter; The target adjustment factor corresponding to the target mean square error is determined according to the preset mapping relationship between the mean square error and the adjustment factor. The target inhibition parameter is adjusted according to the target adjustment factor to obtain the adjusted inhibition parameter; The first contrast coefficient is suppressed according to the adjustment and suppression parameters to obtain the second contrast coefficient.
8. An electronic device, characterized in that, It includes a processor, a memory, a communication interface, and one or more programs, said one or more programs being stored in the memory and configured to be executed by the processor, said programs including instructions for performing the steps of the method as claimed in claim 6 or 7.
9. A computer-readable storage medium, characterized in that, A computer program for electronic data interchange is stored, wherein the computer program causes a computer to perform the method as described in claim 6 or 7.
10. A computer program product, characterized in that, It includes a computer program stored in a computer-readable storage medium; when the processor of the electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the electronic device to perform the method of any one of claims 6 or 7.