Image processing method and electronic device

By adaptively selecting blur quality adjustment parameters, the problem of high computational complexity in Gaussian blurring is solved, achieving efficient and flexible image blurring processing and improving the user experience of electronic devices.

CN119624817BActive Publication Date: 2025-12-19HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410964756.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2025-12-19
Estimated Expiration
2044-07-17

AI Technical Summary

Technical Problem

When existing electronic devices perform image blurring, the highly complex calculation process of Gaussian blurring leads to high performance requirements and is prone to problems such as frame drops, frame skipping, stuttering, and device overheating, which affect the user experience.

Method used

By adaptively selecting fuzz quality adjustment parameters, including the number of iteration rounds and the number of sampling times per iteration, the fuzz quality and performance can be flexibly adjusted, reducing the complexity of fuzz processing.

Benefits of technology

While acquiring high-quality blurred images, it reduces the computational complexity of blur processing, improves user experience, and avoids device performance bottlenecks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119624817B_ABST
    Figure CN119624817B_ABST
Patent Text Reader

Abstract

The application provides an image processing method and an electronic device, and relates to the technical field of terminals. The application can adaptively select a blur quality adjustment parameter, obtain a display image with high blur quality, and reduce the calculation complexity of the blur processing process. The method comprises the following steps: in response to a first blur processing event, a first image and a first blur quality adjustment parameter corresponding to the first blur processing event are obtained, the first blur quality adjustment parameter comprises a first iteration round number and a first single-round iteration sampling number. A second image is obtained according to the first blur quality adjustment parameter and the first image.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of terminals, and in particular to an image processing method and an electronic device. BACKGROUND

[0002] With the development of terminal technology, users have higher and higher requirements for the display effect of electronic devices. The electronic device can blur the background content of the display interface through an image blurring processing method, so that the user focuses on the key content and provides better display effect.

[0003] At present, the electronic device usually performs real-time blurring processing on the image based on Gaussian blurring. The Gaussian blurring can output a display image with better visual effect. However, the high complexity of the calculation process of Gaussian blurring requires high performance of the electronic device, which leads to problems such as frame dropping, frame skipping, lagging, and device overheating in the process of blurring processing of the image by mobile electronic devices such as mobile phones and tablets, thereby affecting the user experience. SUMMARY

[0004] To solve the above technical problems, the present application provides an image processing method and an electronic device. The technical scheme provided by the present application can adaptively select a blurring quality adjustment parameter, reduce the calculation complexity of the blurring processing process while obtaining a display image with high blurring quality.

[0005] To achieve the above technical purposes, the present application provides the following technical scheme:

[0006] In a first aspect, an image processing method is provided, applied to an electronic device, and the method comprises: in response to a first blurring processing event, obtaining a first image and a first blurring quality adjustment parameter corresponding to the first blurring processing event, the first blurring quality adjustment parameter comprising a first iteration round number and a first single-round iteration sampling number; and obtaining a second image according to the first blurring quality adjustment parameter and the first image.

[0007] In this way, the electronic device processes the first image based on the adaptively selected blurring quality adjustment parameter, which can flexibly and efficiently adjust the blurring quality and achieve the effect of balancing the blurring quality and the blurring performance. The complexity of the blurring processing process is independent of the blurring degree parameter. Therefore, compared with Gaussian blurring, the complexity of the blurring processing can be effectively reduced to achieve better blurring performance.

[0008] According to the first aspect, in response to the first blurring processing event, the first image and the first blurring quality adjustment parameter corresponding to the first blurring processing event are obtained, comprising: in response to the first blurring processing event, the first blurring quality adjustment parameter is obtained according to one or more of the following contents corresponding to the first blurring processing event: blurring processing scene, blurring level, load information, and resource occupancy rate.

[0009] In this way, the electronic device can flexibly match appropriate blur quality adjustment parameters according to various factors at the time of the current blur processing event, and better balance the blur quality and performance.

[0010] According to the first aspect, or any one of the implementations of the first aspect, in response to the first blur processing event, the first image and the first blur quality adjustment parameter corresponding to the first blur processing event are obtained, including: in response to the first blur processing event, a blur processing scene corresponding to the first blur processing event is obtained. In the plurality of preset groups of blur quality adjustment parameters, the first blur quality adjustment parameter corresponding to the blur processing scene is obtained.

[0011] Optionally, the blur processing scene is, for example, a scene in which the image to be displayed needs to be blurred. Optionally, the blur processing scene includes, for example, a pull-down notification menu bar scene, a pull-down setting menu bar scene, a desktop folder opening and exiting scene, a lock screen scene, a press volume key scene, a display desktop icon scene, and the like.

[0012] In this way, the electronic device can obtain the required blur quality adjustment parameter based on the current blur processing scene, effectively improving the efficiency of obtaining the blur quality adjustment parameter.

[0013] According to the first aspect, or any one of the implementations of the first aspect, in response to the first blur processing event, the first image and the first blur quality adjustment parameter corresponding to the first blur processing event are obtained, including: receiving a first operation of a user, and determining a blur level. In response to the first blur processing event, in the plurality of preset groups of blur quality adjustment parameters, the first blur quality adjustment parameter corresponding to the blur level is obtained.

[0014] In this way, the blur quality adjustment parameters corresponding to different blur levels are configured, which can meet the needs of different blur qualities and also meet the personalized needs of the user. In addition, the selection of the blur level is convenient for the user to understand and reduces the operation difficulty of the user.

[0015] According to the first aspect, or any one of the implementations of the first aspect, in response to the first blur processing event, the first image and the first blur quality adjustment parameter corresponding to the first blur processing event are obtained, including: in response to the first blur processing event, load information is obtained. In a case where the load information indicates that the load of the electronic device is greater than or equal to a first threshold, a preset second blur quality adjustment parameter is taken as the first blur quality adjustment parameter. In a case where the load information indicates that the load of the electronic device is less than the first threshold, a preset third blur quality adjustment parameter is taken as the first blur quality adjustment parameter, and a first blur quality corresponding to the third blur quality adjustment parameter is higher than a second blur quality corresponding to the second blur quality adjustment parameter.

[0016] In this way, the electronic device can adaptively select the blur quality adjustment parameter according to the device load, when the load is high, the requirement for the blur quality can be reduced, so as to avoid the influence of the blur processing on the running of other functions of the device. When the load is low, better blur quality can be provided for the user.

[0017] According to the first aspect, or any one of the implementations of the first aspect, in response to the first blur processing event, the first image and the first blur quality adjustment parameter corresponding to the first blur processing event are obtained, including: in response to the first blur processing event, the first resource occupation rate and the second resource occupation rate are obtained. When the first resource occupation rate is greater than or equal to the second threshold value, and the second resource occupation rate is less than the third threshold value, the first iteration number is the first quantity, and the first single-iteration sampling number is the second quantity. When the first resource occupation rate is less than the second threshold value, and the second resource occupation rate is greater than or equal to the third threshold value, the first iteration number is the third quantity, and the first single-iteration sampling number is the fourth quantity. Wherein, the first quantity is greater than the third quantity, and the second quantity is less than the fourth quantity.

[0018] Optionally, the first resource occupation rate is, for example, a high-speed storage space occupation rate, and the second resource occupation rate is, for example, a computing unit occupation rate.

[0019] In this way, based on the resource occupation rates of at least two dimensions, the blur quality adjustment parameter is selected, so as to avoid the influence of the image blur processing on the running of other functions of the electronic device. And, the different blur quality adjustment parameters are decoupled, so as to realize more flexible blur quality adjustment in the future.

[0020] According to the first aspect, or any one of the implementations of the first aspect, before the first image and the first blur quality adjustment parameter corresponding to the first blur processing event are obtained in response to the first blur processing event, the method further includes: detecting a second operation of the user indicating adaptive adjustment of the blur quality.

[0021] In this way, the electronic device selects whether the blur quality needs to be adaptively adjusted according to the user operation, so as to meet the personalized needs of the user.

[0022] According to the first aspect, or any one of the implementations of the first aspect, the second image is obtained according to the first blur quality adjustment parameter and the first image, including: a first blur algorithm corresponding to the first blur quality adjustment parameter is obtained. The second image is obtained according to the first blur algorithm and the first image.

[0023] Optionally, the electronic device pre-stores a blur algorithm corresponding to the blur quality adjustment parameter, and the blur algorithm indicates the sampling point coordinates in each iteration update process. In this way, the electronic device can directly match the blur algorithm according to the blur quality adjustment parameter, reduce the difficulty of obtaining the blur algorithm, and improve the blur processing efficiency.

[0024] According to the first aspect or any one of the implementations of the first aspect, before the second image is acquired according to the first blur quality adjustment parameter and the first image, the method further includes: acquiring the blur degree parameter in response to the first blur processing event. The second image is acquired according to the first blur quality adjustment parameter and the first image, including: acquiring the second image according to the first blur quality adjustment parameter, the blur degree parameter and the first image.

[0025] Optionally, the implementation process of the image processing method is integrated in a pre-stored API interface. The input parameters of the API interface include the first blur quality adjustment parameter, the blur degree parameter and the first image, and the second image can be output, so that the blur quality and performance can be flexibly, efficiently and non-abruptly adjusted.

[0026] According to the first aspect or any one of the implementations of the first aspect, the second image is acquired according to the first blur quality adjustment parameter, the blur degree parameter and the first image, including: acquiring a blur algorithm template corresponding to the first blur quality adjustment parameter, and the blur algorithm template includes a plurality of blur algorithms. The second blur algorithm corresponding to the blur degree parameter in the blur algorithm template is acquired. The second image is acquired according to the second blur algorithm and the first image.

[0027] In this way, the electronic device can acquire the required blur algorithm according to the blur degree parameter.

[0028] According to the first aspect or any one of the implementations of the first aspect, the difference between the third blur quality of the second image and the target blur quality is less than the fourth threshold value, and the target blur quality is the blur quality of an image output after the first image is processed based on the blur degree parameter by Gaussian blur.

[0029] In this way, the blur quality of the pre-stored blur algorithm in the electronic device can reach the blur quality achieved by Gaussian blur, so that better blur quality can be obtained after subsequent blur processing of the to-be-processed image based on the blur algorithm, and the user's use experience is improved.

[0030] According to the first aspect or any one of the implementations of the first aspect, in response to the first blur processing event, the first image and the first blur quality adjustment parameter corresponding to the first blur processing event are acquired, including: in response to the first blur processing event, part or all of the full-screen image is intercepted as the first image.

[0031] In this way, the electronic device can obtain the image that needs to be processed.

[0032] According to the first aspect, or any one of the implementations of the first aspect, in response to the first blur processing event, the first image and the first blur quality adjustment parameter corresponding to the first blur processing event are obtained, including: in response to the first blur processing event, a third image is obtained. A scaling factor is obtained. The first image is obtained according to the scaling factor and the third image.

[0033] In some examples, the third image is, for example, part or all of the full-screen image intercepted by the electronic device. Alternatively, the third image can also be a preset image obtained by the electronic device or an image obtained from a server, or an image from other sources. In this way, the electronic device first performs scaling processing on the obtained third image, and then performs blur processing on the scaled image, thereby improving the blur processing performance.

[0034] According to the first aspect, or any one of the implementations of the first aspect, the second image is obtained according to the first blur quality adjustment parameter and the first image, including: the fourth image is obtained according to the first blur quality adjustment parameter and the first image. The second image is obtained according to the scaling factor and the fourth image, and the size of the second image is the same as the size of the first image.

[0035] In this way, the electronic device reduces the power consumption of the blur processing process through the scaling factor, and can obtain a blurred image that meets the display size requirement.

[0036] According to the first aspect, or any one of the implementations of the first aspect, the method further includes: in response to the second blur processing event, the fourth image and the fourth blur quality adjustment parameter corresponding to the second blur processing event are obtained, the fourth blur quality adjustment parameter is different from the first blur quality adjustment parameter, and the fourth blur quality adjustment parameter includes a second number of iteration rounds and a second number of samples per iteration round. The fifth image is obtained according to the fourth blur quality adjustment parameter and the fourth image.

[0037] In this way, the electronic device can obtain appropriate blur quality adjustment parameters according to different blur processing events.

[0038] In a second aspect, an electronic device is provided. The electronic device includes a processor and a memory coupled to the processor, the memory configured to store computer program code comprising computer instructions that, when read by the processor from the memory, cause the electronic device to perform: in response to a first blur processing event, obtaining a first image and a first blur quality adjustment parameter corresponding to the first blur processing event, the first blur quality adjustment parameter comprising a first iteration round number and a first single-round iteration sampling number; and obtaining a second image according to the first blur quality adjustment parameter and the first image.

[0039] According to the second aspect, in response to the first blur processing event, obtaining the first image and the first blur quality adjustment parameter corresponding to the first blur processing event comprises: in response to the first blur processing event, obtaining the first blur quality adjustment parameter according to one or more of the following: a blur processing scenario, a blur level, load information, resource occupancy rate corresponding to the first blur processing event.

[0040] According to the second aspect, or any one of the implementations of the second aspect, in response to the first blur processing event, obtaining the first image and the first blur quality adjustment parameter corresponding to the first blur processing event comprises: in response to the first blur processing event, obtaining a blur processing scenario corresponding to the first blur processing event. In a plurality of preset groups of blur quality adjustment parameters, obtaining the first blur quality adjustment parameter corresponding to the blur processing scenario.

[0041] According to the second aspect, or any one of the implementations of the second aspect, in response to the first blur processing event, obtaining the first image and the first blur quality adjustment parameter corresponding to the first blur processing event comprises: receiving a first operation of a user, and determining a blur level. In response to the first blur processing event, in a plurality of preset groups of blur quality adjustment parameters, obtaining the first blur quality adjustment parameter corresponding to the blur level.

[0042] According to the second aspect, or any one of the implementations of the second aspect, in response to the first blur processing event, obtaining the first image and the first blur quality adjustment parameter corresponding to the first blur processing event comprises: in response to the first blur processing event, obtaining load information. In a case where the load information indicates that a load of the electronic device is greater than or equal to a first threshold, presetting a second blur quality adjustment parameter as the first blur quality adjustment parameter. In a case where the load information indicates that the load of the electronic device is less than the first threshold, presetting a third blur quality adjustment parameter as the first blur quality adjustment parameter, the first blur quality corresponding to the third blur quality adjustment parameter being higher than a second blur quality corresponding to the second blur quality adjustment parameter.

[0043] According to a second aspect, or any possible implementation mode of the second aspect, in response to the first blur processing event, the first image and the first blur quality adjustment parameter corresponding to the first blur processing event are acquired, including: in response to the first blur processing event, the first resource occupation rate and the second resource occupation rate are acquired. In a case where the first resource occupation rate is greater than or equal to the second threshold value and the second resource occupation rate is less than the third threshold value, the first iteration round number is the first quantity, and the first single-round iteration sampling number is the second quantity. In a case where the first resource occupation rate is less than the second threshold value and the second resource occupation rate is greater than or equal to the third threshold value, the first iteration round number is the third quantity, and the first single-round iteration sampling number is the fourth quantity. The first quantity is greater than the third quantity, and the second quantity is less than the fourth quantity.

[0044] According to the second aspect, or any possible implementation mode of the second aspect, when the processor reads the computer instructions from the memory, the electronic device further performs: detecting a second operation indicating that the user adjusts the blur quality adaptively.

[0045] According to the second aspect, or any possible implementation mode of the second aspect, the second image is acquired according to the first blur quality adjustment parameter and the first image, including: a first blur algorithm corresponding to the first blur quality adjustment parameter is acquired. The second image is acquired according to the first blur algorithm and the first image.

[0046] According to the second aspect, or any possible implementation mode of the second aspect, when the processor reads the computer instructions from the memory, the electronic device further performs: in response to the first blur processing event, a blur degree parameter is acquired. The second image is acquired according to the first blur quality adjustment parameter and the first image, including: the second image is acquired according to the first blur quality adjustment parameter, the blur degree parameter and the first image.

[0047] According to the second aspect, or any possible implementation mode of the second aspect, the second image is acquired according to the first blur quality adjustment parameter, the blur degree parameter and the first image, including: a blur algorithm template corresponding to the first blur quality adjustment parameter is acquired, and the blur algorithm template includes a plurality of blur algorithms. A second blur algorithm corresponding to the blur degree parameter in the blur algorithm template is acquired. The second image is acquired according to the second blur algorithm and the first image.

[0048] According to the second aspect, or any possible implementation mode of the second aspect, a difference between a third blur quality of the second image and a target blur quality is less than a fourth threshold value, and the target blur quality is a blur quality of an image output by processing the first image based on the blur degree parameter through Gaussian blur.

[0049] According to a second aspect, or any possible implementation mode of the second aspect, in response to the first blur processing event, the first image and the first blur quality adjustment parameter corresponding to the first blur processing event are acquired, including: in response to the first blur processing event, part or all of the full-screen image is intercepted as the first image.

[0050] According to a second aspect, or any possible implementation mode of the second aspect, in response to the first blur processing event, the first image and the first blur quality adjustment parameter corresponding to the first blur processing event are acquired, including: in response to the first blur processing event, the third image is acquired. The scaling factor is acquired. The first image is acquired according to the scaling factor and the third image.

[0051] According to a second aspect, or any possible implementation mode of the second aspect, the second image is acquired according to the first blur quality adjustment parameter and the first image, including: the fourth image is acquired according to the first blur quality adjustment parameter and the first image. The second image is acquired according to the scaling factor and the fourth image, and the size of the second image is the same as that of the first image.

[0052] According to a second aspect, or any possible implementation mode of the second aspect, when the processor reads the computer instructions from the memory, the electronic device is further caused to perform: in response to the second blur processing event, the fourth image and the fourth blur quality adjustment parameter corresponding to the second blur processing event are acquired, the fourth blur quality adjustment parameter is different from the first blur quality adjustment parameter, and the fourth blur quality adjustment parameter includes a second iteration round number and a second single-round iteration sampling number. The fifth image is acquired according to the fourth blur quality adjustment parameter and the fourth image.

[0053] A third aspect provides an electronic device having a function of implementing the image processing method in the first aspect and any possible implementation mode thereof. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0054] A fourth aspect provides a computer readable storage medium. The computer readable storage medium stores a computer program (also referred to as instructions or code), which, when executed by an electronic device, causes the electronic device to perform the method of the first aspect or any implementation mode of the first aspect.

[0055] A fifth aspect provides a computer program product, which, when executed on an electronic device, causes the electronic device to perform the method of the first aspect or any implementation mode of the first aspect.

[0056] In a sixth aspect, there is provided a circuitry comprising a processing circuitry configured to perform the method of the first aspect or any one of the embodiments of the first aspect.

[0057] In a seventh aspect, there is provided a chip system comprising at least one processor and at least one interface circuitry configured to perform a transceiving function and send an instruction to the at least one processor, and when the at least one processor executes the instruction, the at least one processor performs the method of the first aspect or any one of the embodiments of the first aspect.

[0058] The technical effects of the foregoing aspects can be referred to each other, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0059] Figure 1 A blur processing scenario provided by an embodiment of the present application;

[0060] Figure 2 An iterative update process of Kawase blur provided by an embodiment of the present application;

[0061] Figure 3 A blur processing process of a hybrid resolution acceleration technology provided by an embodiment of the present application;

[0062] Figure 4 A hardware structure of an electronic device provided by an embodiment of the present application;

[0063] Figure 5 A software structure block diagram of an electronic device provided by an embodiment of the present application;

[0064] Figure 6 An image processing method flow provided by an embodiment of the present application Figure 1 ;

[0065] Figure 7 An image processing method flow provided by an embodiment of the present application Figure 2 ;

[0066] Figure 8 An image processing method flow provided by an embodiment of the present application Figure 3 ;

[0067] Figure 9 A blur quality setting scenario provided by an embodiment of the present application;

[0068] Figure 10 An image processing method flow provided by an embodiment of the present application Figure 4 ;

[0069] Figure 11 An image processing method flow provided by an embodiment of the present applicationFigure 5 ;

[0070] Figure 12 A structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0071] Figure 13 A schematic diagram of a possible product form of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0072] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing the specific embodiments and are not intended to be limiting on the present application. As used in the specification and the appended claims of the present application, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that “at least one” and “one or more” as used in the following embodiments refer to one or two or more (including two).

[0073] In the present specification, the reference to “one embodiment” or “some embodiments” etc. means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases “in one embodiment”, “in some embodiments”, “in other embodiments”, “in additional embodiments” etc. in various places in the specification are not necessarily all referring to the same embodiment, but can refer to one or more but not all embodiments, unless otherwise specifically stated. The terms “comprising,” “including,” “having” and their variants, mean “including but not limited to,” unless otherwise specifically indicated. The term “connected” includes both direct connections and indirect connections through one or more intervening devices, unless otherwise specifically indicated. “First”, “second”, etc. are used only for descriptive purposes and should not be construed as implying or suggesting relative importance or an indicated number of technical features.

[0074] In the embodiments of the present application, the words “exemplary” or “for example” are used to mean serving as an example, instance, or illustration. Any embodiment or design described as “exemplary” or “for example” in the embodiments of the present application is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of the words “exemplary” or “for example” is intended to present concepts in a concrete manner.

[0075] In some embodiments, in the blur processing scenario, the electronic device generally processes the image to be displayed through a blur algorithm to obtain an image with a blur display effect, enriches the display scenario, and meets the user's demand for the display effect. Optionally, the blur processing scenario includes, for example, a pull-down notification menu bar scenario, a pull-down setting menu bar scenario, a desktop folder opening and exiting scenario, a lock screen scenario, a press volume key scenario, and the like. Optionally, the blur algorithm includes, for example, Gaussian blur, Kawase blur, hybrid resolution acceleration technology, and the like.

[0076] Exemplarily, as shown in (a) of FIG. 1, Figure 1 In the process of displaying the desktop, the electronic device detects the user's operation of sliding downward along the upper edge of the display screen, displays the notification menu bar as shown in (b) of FIG. 1. Figure 1 In the process of triggering the display of the notification menu bar, the electronic device performs blur processing on the main interface image displayed on the desktop, so that the subsequently displayed notification menu bar covers the blur-processed main interface, enriches the display effect, and avoids the display content on the main interface interfering with the display of the notification menu bar.

[0077] In some examples, in the blur processing scenario, the electronic device realizes real-time blur display effect through Gaussian blur. Exemplarily, the electronic device obtains a to-be-processed image, which is a picture material to be subjected to blur processing. The electronic device obtains a blur degree parameter σ and calculates a Gaussian convolution kernel G σ according to the blur degree parameter σ. For example, The Gaussian convolution kernel can also be described as a weight. Then, the electronic device can perform convolution operation on each pixel point in the to-be-processed image according to the Gaussian convolution kernel to output an image, that is, to obtain an image with a blur display effect, and realize blur display. In the convolution operation process, in some example scenarios, the meaning of the electronic device performing convolution operation on a certain pixel point A is that the electronic device selects a circle of pixel points around the pixel point A, calculates the weight according to Formula One, where (x, y) is the distance vector of a certain pixel point in the selected circle of pixel points from the pixel point A. Then, the electronic device performs weighted average on the pixel values of the selected circle of pixel points to obtain the pixel value of the blurred pixel point A. Generally, the selected circle of pixel points refers to all pixel points in a square range with a center of the pixel point A and a length and width of 6σ, so the theoretical calculation complexity of Gaussian blur is proportional to the square area (i.e., 36σ 2 ). In other example scenarios, the electronic device splits the above-mentioned 2D convolution operation process into two 1D convolution operation processes after selecting a circle of pixel points in the above-mentioned example scenario. For example, the electronic device first performs horizontal direction convolution operation and then performs vertical direction convolution operation. The theoretical calculation complexity of the two 1D convolution operation processes is proportional to the length of the square side (i.e., 6σ).

[0078] It can be seen that the theoretical calculation complexity of Gaussian blur is proportional to the blur degree parameter. Wherein, the output image is clearer when the blur degree parameter is small, and the output image is blurrier when the blur degree parameter is large. Although the blur quality of Gaussian blur is high, it can output a blurred image with natural detail transition and good visual effect, but the calculation complexity of Gaussian blur is high, which leads to high performance requirements for electronic devices. For example, electronic devices with general performance or poor performance may have problems such as frame drop, frame jump, lag, and device overheating when processing images in real time through Gaussian blur, which affects the user experience.

[0079] In some other examples, in the blur processing scene, the electronic device realizes real-time blur display effect through Kawase blur. Illustratively, the electronic device obtains a to-be-processed image, which is a picture material to be processed for blur. Then, the electronic device performs multiple rounds of iterative updates on the to-be-processed image until the output image approaches the preset blur degree. In each round of iterative update, for a certain pixel point A in the to-be-processed image, the electronic device selects N sampling points B1, B2, …, B N according to a preset rule, averages the pixel values of the N sampling points, and obtains the pixel value of the blurred pixel point A. Wherein, the preset rule and the number of rounds of iterative updates are fixed contents determined according to engineering experience, which are used to make the output image closer to the preset blur degree. Illustratively, the number of rounds of iteration is fixed to 4, and the number of sampling points N = 4 in each round, as shown in (a)-(d) in Figure 2

[0080] It can be seen that the Kawase blur has the advantage that the theoretical calculation complexity is independent of the blur degree parameter, and the performance is better than that of Gaussian blur under the same conditions. However, since the iterative update process of Kawase blur is completely determined according to a single preset rule, the blur degree of the output image is uncontrollable and cannot be accurately measured, and the blur quality is poor.

[0081] In some other examples, in the blur processing scene, the electronic device realizes real-time blur display effect through a hybrid resolution acceleration technology. Illustratively, the electronic device obtains a to-be-processed image, which is a picture material to be processed for blur. Then, as shown in Figure 3 , the electronic device selects a scaling factor and scales down the to-be-processed image according to the scaling factor (such as step 1). Wherein, the scaling factor β is an integer value such as 1, 2, 3, etc. The scaling method is, for example, to scale down the pixel points in the to-be-processed image by every 2 β ​-1 pixel point selects one pixel point, and the length and width of the image to be processed are reduced to 1 / 2 of the original size. Then, the electronic device performs blur processing on the reduced image to obtain a reduced blurred image (such as step 2). The electronic device can select any blur algorithm to perform the blur processing. Then, the electronic device enlarges the reduced blurred image to obtain a blurred image of the same size as the original image to be processed (such as step 3). The enlargement method is, for example, to enlarge the reduced blurred image to a blurred image of the same size as the original image to be processed by interpolation operation. β The electronic device performs blur processing on the reduced image to obtain a reduced blurred image (such as step 2). The electronic device can select any blur algorithm to perform the blur processing. Then, the electronic device enlarges the reduced blurred image to obtain a blurred image of the same size as the original image to be processed (such as step 3). The enlargement method is, for example, to enlarge the reduced blurred image to a blurred image of the same size as the original image to be processed by interpolation operation.

[0082] It can be seen that the mixed resolution acceleration technology improves the blur performance through the scaling factor. For example, the larger the scaling factor, the better the blur performance. However, as the scaling factor increases, the blur quality will decrease. For example, in the image scaling process, a large amount of pixel information is lost during the scaling process, affecting the blur quality. Moreover, the blur result of the real-time blur processing scene is prone to mutation or jitter, which makes it difficult to flexibly adjust the blur quality and performance by adjusting the scaling factor.

[0083] Therefore, the present application provides an image processing method, which can adaptively select a blur algorithm, perform blur processing on an image to be processed through multiple rounds of iterative blur algorithms, obtain a display image with high blur quality, reduce the computational complexity of the blur processing process, and flexibly adjust the blur quality and performance.

[0084] Optionally, the image processing method provided by the embodiments of the present application can be applied to an electronic device 100. Optionally, the electronic device 100 can be, for example, a terminal device such as a mobile phone, a tablet computer, a personal computer (PC), a digital broadcast terminal, a vehicle-mounted intelligent screen, a medical device, a fitness device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), an artificial intelligence (AI) device, and the like. The operating system installed on the electronic device 100 includes but is not limited to or other operating systems. The specific type of the electronic device 100 and the operating system installed thereon are not limited in the present application.

[0085] For example, Figure 4 A structural schematic diagram of the electronic device 100 is shown.

[0086] The electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, and the like.

[0087] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than illustrated, or combine certain components, or split certain components, or different arrangement of components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.

[0088] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), and the like. Among them, different processing units can be independent devices, or can be integrated in one or more processors.

[0089] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0090] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194, the camera 193, etc. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to implement the photographing function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.

[0091] The electronic device 100 implements the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, which is connected with the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.

[0092] The display screen 194 is configured to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can be manufactured by using a liquid crystal display (LCD), for example, an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini-led, a Micro-led, a Micro-oled, a quantum dot light-emitting diode (QLED), or the like. In some embodiments, the electronic device 100 can include one or N display screens 194, where N is a positive integer greater than 1.

[0093] The sensor module 180 can include a pressure sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0094] The touch sensor, also referred to as a “touch device”. The touch sensor can be disposed on the display screen 194, and the touch sensor and the display screen 194 form a touch screen, also referred to as a “touch screen”. The touch sensor is configured to detect a touch operation acting on or near the touch sensor. The touch sensor can transmit the detected touch operation to the application processor to determine the touch event type. The visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor can also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0095] In some embodiments, the user can detect the user’s touch operation on the display screen through the touch sensor to obtain a blur processing event. In response to the blur processing event, the electronic device 100 obtains a to-be-processed image and performs blur processing on the to-be-processed image through the processor 110 to obtain a to-be-displayed blurred image. Then, the electronic device 100 can display the to-be-displayed blurred image through the display screen 194.

[0096] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiments of the present application take an Android system with a layered architecture as an example to exemplarily illustrate the software structure of the electronic device 100.

[0097] Figure 5 This is a software structure block diagram of the electronic device 100 according to an embodiment of this application.

[0098] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the system service layer, and the kernel layer.

[0099] The application layer can include a series of application packages.

[0100] like Figure 5 As shown, the application package can include applications such as desktop, contacts, notes, camera, music, gallery, maps, calls, and video.

[0101] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The application framework layer includes some predefined functions.

[0102] like Figure 5 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0103] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0104] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0105] A view system includes visual controls, such as controls that display text and controls that display images.

[0106] The system service layer includes an acquisition module, an adjustment module, a core processing module, and an output module.

[0107] The acquisition module is used to acquire the image to be processed and a blur level parameter. Optionally, the blur level parameter represents the degree of blur of the target relative to the image to be processed, such as a blur level parameter of 2, 3, etc. Optionally, the blur level parameter required in different blur processing scenarios may be the same or different. For example, in response to a blur processing event, the application acquires the blur processing scenario corresponding to the blur processing event and acquires the preset blur level parameter corresponding to the blur processing scenario. Then, the application can send the blur level parameter to the acquisition module.

[0108] The adjusting module is configured to obtain a blur quality adjusting parameter. The blur quality adjusting parameter can affect the blur quality of the output image. Optionally, the electronic device 100 performs the blur processing on the to-be-processed image in a manner of multiple rounds of iterative updating. The blur quality adjusting parameter includes, for example, the number of iteration rounds of the multiple rounds of iterative updating and the number of sampling times of a single round of iteration. In some examples, the operating system provides an application programming interface (API) for implementing the image real-time blur function at the application framework layer for external application developers. The application developers implement the real-time blur effect on the third-party application by invoking the API interface. For example, the application developers write the blur quality adjusting parameter by invoking the API interface. Optionally, in response to the blur processing event, the adjusting module can obtain the blur quality adjusting parameter through the API interface.

[0109] Optionally, the adjusting module is further configured to obtain, according to the blur quality adjusting parameter, a blur algorithm template corresponding to the blur quality adjusting parameter. Optionally, the blur algorithm template includes at least one preconfigured blur algorithm.

[0110] The core processing module is configured to perform the blur processing on the to-be-processed image according to the blur algorithm template, and obtain a to-be-displayed blurred image.

[0111] The output module is configured to output the to-be-displayed blurred image. For example, the output module sends the to-be-displayed blurred image to a display driver in the kernel layer, so as to trigger the display driver to instruct the display screen to display the to-be-displayed blurred image.

[0112] Optionally, the system service layer can further include a surface manager, a three-dimensional graphics processing library (for example, OpenGL ES), a two-dimensional graphics engine (for example, SGL), and the like.

[0113] The surface manager is configured to manage the display subsystem, and provide the fusion of 2D and 3D layers for multiple applications.

[0114] The three-dimensional graphics processing library is configured to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing, and the like.

[0115] The two-dimensional graphics engine is a drawing engine for 2D drawing.

[0116] The kernel layer is a layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.

[0117] The image processing method provided by the embodiments of the present application is described in detail below.

[0118] Figure 6 A flowchart of an image processing method provided by an embodiment of the present application is shown in FIG. 1. It should be noted that the method is not limited to the specific order described below, and it should be understood that in other embodiments, the order of some steps of the method can be exchanged with each other according to actual needs, or some steps can be omitted or deleted. The method includes the following steps: Figure 6

[0119] S601, the electronic device 100 acquires a blur degree parameter and a to-be-processed image.

[0120] The blur degree parameter represents the blur degree of the target to the to-be-processed image, such as a blur degree parameter of 2, 3, etc. For example, the application program of the electronic device 100 has preset blur degree parameters required by different blur processing scenes, and the blur degree parameters corresponding to different blur processing scenes are the same or different. Optionally, the blur processing scenes include, for example, a pull-down notification menu bar scene, a pull-down setting menu bar scene, a desktop folder opening and exiting scene, a lock screen scene, a press volume key scene, a display desktop icon scene, etc.

[0121] In some embodiments, in response to a blur processing event, the electronic device 100 acquires a blur degree parameter corresponding to the current blur processing event. Optionally, in response to the blur processing event, the electronic device 100 judges the current blur processing scene, and can acquire a preset blur degree parameter corresponding to the current blur processing scene.

[0122] For example, as shown in the scene of FIG. 2, the electronic device 100 detects a user's downward sliding operation along the top edge of the display screen, triggering a blur processing event. The electronic device 100 acquires the current blur processing scene as the pull-down notification menu bar scene, and can acquire a blur degree parameter 1 corresponding to the pull-down notification menu bar scene. Figure 1

[0123] For another example, the electronic device 100 displays an application interface, and in response to a user's operation of returning to the desktop, triggers a blur processing event. The electronic device 100 acquires the current blur processing scene as the display desktop icon scene, and can acquire a blur degree parameter 2 corresponding to the display desktop icon scene through the desktop. In a possible implementation, the blur degree parameter 2 can be different from the blur degree parameter 1, or can be the same as the blur degree parameter 2.

[0124] ​​In some embodiments, in response to the blur processing event, the electronic device 100 acquires the image to be processed. Optionally, the image to be processed is an image to be processed by the blur processing. The image to be processed can be part or all of a full-screen image. It should be understood that the full-screen image is an image to be displayed full-screen, or an image of a certain layer in the image to be displayed full-screen. For example, in the scenario of a pull-down notification menu bar, the full-screen image is an image to be displayed full-screen before the pull-down menu bar is displayed, which is a lower layer of the subsequently displayed pull-down menu bar. Alternatively, the image to be processed can also be a preset image in the electronic device 100, a downloaded image from a server, or an image from other sources, and the embodiments of the present application do not limit this.

[0125] For example, in the scenario of a pull-down notification menu bar, in response to the blur processing event, the electronic device 100 intercepts a full-screen image, and takes the full-screen image as the image to be processed to obtain a subsequent full-screen blur display effect.

[0126] For another example, in the scenario of displaying a desktop icon, in response to the blur processing event, the electronic device 100 intercepts an image of a region around the application icon to be displayed as the image to be processed to obtain a subsequent blur display effect of the region around the application icon.

[0127] Optionally, as shown in FIG. 6, step S601 can include step S6011a and step S6012a. It should be understood that the embodiments of the present application do not limit the execution order of step S6011a and step S6012a. Figure 7

[0128] S6011a, in response to the blur processing event, the electronic device 100 acquires the blur degree parameter.

[0129] S6012a, the electronic device 100 intercepts part or all of the full-screen image as the image to be processed.

[0130] In some embodiments, in response to the blur processing event, as shown in FIG. 6, the acquisition module acquires the blur degree parameter, and acquires the image to be processed by intercepting the image. Figure 5

[0131] Optionally, the specific implementation of step S6011a and step S6012a can refer to the related content described above.

[0132] Optionally, as shown in FIG. 6, step S601 can also include step S6011b- step S6013b. It should be understood that the embodiments of the present application do not limit the execution order between step S6011b and step S6012b- step S6013b. Figure 8

[0133] ​​​S6011b, in response to the blur processing event, the electronic device 100 acquires a blur degree parameter.

[0134] In some embodiments, in response to the blur processing event, the acquiring module acquires the blur degree parameter. Figure 5

[0135] S6012b, the electronic device 100 intercepts part or all of the full-screen image.

[0136] S6013b, the electronic device 100 acquires a scaling factor, scales the intercepted image, and acquires a to-be-processed image.

[0137] In some embodiments, in response to the blur processing event, the acquiring module intercepts the image. Then, the acquiring module can select a scaling factor to scale the intercepted image to acquire a to-be-processed image that needs to be processed later. Alternatively, the electronic device 100 is preconfigured with the scaling factor. Alternatively, the scaling factors corresponding to different blur processing scenarios are the same or different. Figure 5

[0138] For example, the acquiring module acquires a scaling factor β, and the size of the intercepted image is W*H. Then, the acquiring module scales the intercepted image by the scaling factor β to acquire a to-be-processed image with a size of where ceil represents the rounding function. Alternatively, the acquiring module can realize scaling of the intercepted image by standard GPU downsampling.

[0139] In this way, the electronic device 100 improves the blur performance in combination with the mixed resolution acceleration technology.

[0140] In this way, the electronic device 100 acquires the blur degree parameter and the to-be-processed image, which facilitates subsequent blur processing of the to-be-processed image by the electronic device 100 based on the blur degree parameter.

[0141] S602, the electronic device 100 acquires a blur quality adjustment parameter.

[0142] The blur quality adjustment parameter is used to affect the blur quality of the output image. Alternatively, the electronic device 100 performs blur processing on the to-be-processed image by multiple rounds of iterative updates. The blur quality adjustment parameter includes, for example, the number of iteration rounds and the number of sampling times per iteration round of multiple rounds of iterative updates, or other parameters that can affect the blur quality. Alternatively, blur processing of the to-be-processed image based on the blur quality adjustment parameter can achieve flexible, efficient, and non-abrupt adjustment of the blur quality and performance.

[0143] ​​For example, the iteration rounds are 3 rounds, 5 rounds, 6 rounds, etc. The single round iteration sampling times are 3 times, 5 times, 6 times, etc. Optionally, the more the iteration rounds and / or the single round iteration sampling times are, the better the blur quality is.

[0144] In some embodiments, the electronic device 100 is preconfigured with the blur quality adjustment parameters corresponding to different blur processing scenes. For example, the developer writes the possible blur processing scenes of the current application and the blur quality adjustment parameters corresponding to different blur processing scenes in the application during the application development process. Subsequently, after the electronic device 100 installs the application, the application can write the blur quality adjustment parameters into the electronic device 100 through the pre-set API interface. Then, in response to the blur processing event, the adjustment module shown in the figure can obtain the blur quality adjustment parameters corresponding to the blur processing scene indicated by the current blur processing event through the pre-set API interface. Figure 5

[0145] For example, the blur quality adjustment parameters corresponding to the pull-down notification menu bar scene preconfigured in the electronic device 100 include 3 rounds of iteration rounds and 5 times of single round iteration sampling times. The blur quality adjustment parameters corresponding to the desktop folder opening and exiting scene preconfigured in the electronic device 100 include 5 rounds of iteration rounds and 6 times of single round iteration sampling times. In this way, subsequently, in the blur processing process, the electronic device 100 can directly obtain the blur quality adjustment parameters corresponding to the current blur processing scene according to the current blur processing scene. For example, in the blur processing process, after the electronic device 100 obtains the current blur scene as the pull-down notification menu bar scene, the blur quality adjustment parameters corresponding to the pull-down notification menu bar scene can be obtained, such as 3 rounds of iteration rounds and 5 times of single round iteration sampling times.

[0146] In other embodiments, the electronic device 100 is preconfigured with different blur quality adjustment parameters, and according to the user operation, the electronic device 100 can select the blur quality adjustment parameters required for this blur processing process. In this way, the participation of the user is increased, and the individualized needs of the user are met. For example, the electronic device 100 is preconfigured with the blur quality adjustment parameters corresponding to different levels, or is preconfigured with the blur quality adjustment parameters corresponding to different levels in different blur processing scenes. Optionally, the levels include poor, relatively poor, medium, relatively high, and high, which can help the user to clearly see the blur quality and have actual description significance.

[0147] For example, as shown in the figure, the electronic device 100 is preconfigured with the blur quality adjustment parameters corresponding to different levels in different blur processing scenes. Figure 9 ​As shown in (a), the blur quality adjustment parameter includes the iteration round number K of the multi-round iteration update and the sampling number N of the single-round iteration. The electronic device 100 is preconfigured with five levels of blur quality, i.e., poor, worse, medium, higher, and high. Each level of blur quality corresponds to different iteration round number K and sampling number N of the single-round iteration. In this way, the electronic device 100 can obtain the corresponding iteration round number K and sampling number N of the single-round iteration according to the level selected by the user.

[0148] Optionally, the blur quality adjustment parameters corresponding to different levels are also written through the pre-set API interface.

[0149] For example, the electronic device 100 is preconfigured with the blur quality adjustment parameter including the iteration round number 3 and the sampling number 3 of the single-round iteration corresponding to the poor level, the iteration round number 3 and the sampling number 5 of the single-round iteration corresponding to the worse level, the iteration round number 5 and the sampling number 5 of the single-round iteration corresponding to the medium level, the iteration round number 5 and the sampling number 6 of the single-round iteration corresponding to the higher level, and the iteration round number 6 and the sampling number 6 of the single-round iteration corresponding to the high level. In this way, the electronic device 100 can match the corresponding iteration round number and sampling number of the single-round iteration in response to the operation of selecting the level by the user. Subsequently, in the image blur processing process, the electronic device 100 can obtain the matched iteration round number and sampling number of the single-round iteration.

[0150] For example, the electronic device 100 preconfigures different blur quality adjustment parameters for different blur processing scenarios. For example, the electronic device 100 preconfigures the blur quality adjustment parameters for the pull-down notification menu bar scenario, including the iteration round number K and the single round iteration sampling number N for different levels. For example, the iteration round number K is 3 rounds and the single round iteration sampling number N is 3 for the poor level; the iteration round number K is 3 rounds and the single round iteration sampling number N is 5 for the worse level; the iteration round number K is 5 rounds and the single round iteration sampling number N is 5 for the medium level; the iteration round number K is 5 rounds and the single round iteration sampling number N is 6 for the better level; and the iteration round number K is 6 rounds and the single round iteration sampling number N is 6 for the high level. In this way, in the image blur processing process, the electronic device 100 can match the corresponding iteration round number K and the single round iteration sampling number N according to the current blur processing scenario, which is the pull-down notification menu bar scenario, and the level selected by the user. For another example, the electronic device 100 preconfigures the blur quality adjustment parameters for the desktop folder opening and exiting scenario, including the iteration round number K and the single round iteration sampling number N for different levels. For example, the iteration round number K is 4 rounds and the single round iteration sampling number N is 5 for the poor level; the iteration round number K is 5 rounds and the single round iteration sampling number N is 5 for the worse level; the iteration round number K is 5 rounds and the single round iteration sampling number N is 6 for the medium level; the iteration round number K is 5 rounds and the single round iteration sampling number N is 7 for the better level; and the iteration round number K is 6 rounds and the single round iteration sampling number N is 7 for the high level. In this way, in the image blur processing process, the electronic device 100 can match the corresponding iteration round number K and the single round iteration sampling number N according to the current blur processing scenario, which is the desktop folder opening and exiting scenario, and the level selected by the user.

[0151] In some embodiments, the electronic device 100 preconfigures different blur quality adjustment parameters and parameter selection rules. Optionally, the parameter selection rules indicate that the default blur quality adjustment parameters are used, or that the appropriate blur quality adjustment parameters are adaptively selected according to the current device load. Optionally, the electronic device 100 can obtain the corresponding parameter selection rules according to the user operation.

[0152] Optionally, the device load includes, for example, the high-speed storage space load, the computing unit load, and the like. Optionally, the high-speed storage space load includes, for example, the occupancy rate of the memory or the cache, and the like. The computing unit load includes, for example, the occupancy rate of the CPU or the GPU.

[0153] For example, the blur quality adjustment parameters include the iteration round number K and the single round iteration sampling number N of the multi-round iteration update. For example, the iteration round number K is 3 rounds and the single round iteration sampling number N is 3 for the poor level; the iteration round number K is 3 rounds and the single round iteration sampling number N is 5 for the worse level; the iteration round number K is 5 rounds and the single round iteration sampling number N is 5 for the medium level; the iteration round number K is 5 rounds and the single round iteration sampling number N is 6 for the better level; and the iteration round number K is 6 rounds and the single round iteration sampling number N is 6 for the high level. Figure 9As shown in (b), according to the operation of turning on the blur quality adaptive adjustment, the electronic device 100 can obtain the default iteration round number K and the single-round iteration sampling number N in the subsequent process of obtaining the blur quality adjustment parameter. Alternatively, according to the operation of turning on the blur quality adaptive adjustment, the electronic device 100 can obtain the current load condition of the device in the subsequent process of obtaining the iteration round number K and the single-round iteration sampling number N. Then, the electronic device 100 matches the corresponding iteration round number K and the single-round iteration sampling number N according to the current load condition of the device. For example, if the current device load is high, the electronic device 100 can select a set of iteration round number K and single-round iteration sampling number N corresponding to a poor blur quality; if the current device load is low, the electronic device 100 can select a set of iteration round number K and single-round iteration sampling number N corresponding to a good blur quality.

[0154] Alternatively, the different blur quality adjustment parameters and preset rules are also written through the pre-set API interface.

[0155] In this way, the device load is adjusted to adjust the blur quality, so as to avoid that the blur processing process affects the device operation when the load is high. In addition, the user selection difficulty is reduced while meeting the user's personalized adjustment of the blur quality.

[0156] In some embodiments, the electronic device 100 can decouple different blur quality adjustment parameters, and adjust the blur quality by adjusting part or all of the blur quality adjustment parameters. For example, the blur quality adjustment parameters include the iteration round number K and the single-round iteration sampling number N for multi-round iteration update, and the electronic device 100 can decouple the iteration round number K and the single-round iteration sampling number N, and adjust the iteration round number K or the single-round iteration sampling number N to achieve more flexible blur quality adjustment.

[0157] Alternatively, the electronic device 100 is pre-configured with different blur quality adjustment parameters and parameter selection rules. In response to the operation of turning on the blur quality adaptive adjustment selected by the user, the electronic device 100 obtains the iteration round number K and the single-round iteration sampling number N for multi-round iteration update according to at least two dimensions of device load parameters.

[0158] For example, the device load parameter includes a high-speed storage space occupancy rate and a computing unit occupancy rate. If the current high-speed storage space occupancy rate is higher than threshold 1 and the computing unit occupancy rate is lower than threshold 2, the electronic device 100 adaptively selects a higher iteration round number K and a default single-iteration sampling number N, or the electronic device 100 adaptively selects a default iteration round number K and a lower single-iteration sampling number N, so as to reduce the memory pressure of the high-speed storage space while ensuring the blur quality. If the current high-speed storage space occupancy rate is lower than threshold 1 and the computing unit occupancy rate is higher than threshold 2, the electronic device 100 adaptively selects a lower iteration round number K and a default single-iteration sampling number N, or the electronic device 100 adaptively selects a default iteration round number K and a higher single-iteration sampling number N, so as to reduce the computing load of the computing unit while ensuring the blur quality and increasing the frame rate.

[0159] In this way, the electronic device 100 decouples different blur quality adjustment parameters, and realizes more flexible subsequent blur quality adjustment.

[0160] Optionally, in a possible implementation, the order of steps S601 and S602 is not limited, step S601 can be performed before step S602, or after step S602, or simultaneously with step S602. In another possible implementation, steps S601 and S602 can be the same step, for example, in response to a blur processing event, the electronic device 100 acquires the blur degree parameter, the image to be processed, and the blur quality adjustment parameter.

[0161] S603, the electronic device 100 acquires a blur algorithm template according to the blur quality adjustment parameter.

[0162] The blur algorithm template includes at least one blur algorithm. The blur algorithm indicates an algorithm for performing multiple rounds of iterative updates on the image in the blur processing of the image. For example, K rounds of iterative updates are performed on the image, and the input of the kth round of iterative update is the output of the (k-1)th round of iterative update. The iterative update operation of each round is, for example, obtaining N sampling points around a certain pixel point A in the image The N sampling points are, for example, pixel points around the pixel point A. Then, the pixel values of the N sampling points are averaged, and the obtained average pixel value is taken as the pixel value of the pixel point A output by the current round of iterative update. Then, a blur algorithm is used to indicate K rounds of iterative updates on the image, and the blur algorithm includes K*N sampling points.

[0163] Optionally, one blur algorithm template is embodied as an array composed of a large number of sampling points in program implementation. Optionally, a plurality of blur algorithm templates are preconfigured in the electronic device 100, wherein each blur algorithm template includes a blur algorithm indicating the same K and N. Then, after the electronic device 100 obtains the iteration round number K and the sampling number N of single round iteration included in the blur quality adjustment parameter, the electronic device 100 can be matched to the corresponding blur algorithm template.

[0164] As shown in the figure, Figure 5 the electronic device 100 obtains the blur algorithm template through the core processing module.

[0165] Optionally, as shown in the figure, Figure 6 the present embodiment does not limit the execution order of the steps S601 and the steps S602-S603. That is, the electronic device 100 can first obtain the to-be-processed image and the blur degree parameter, and then obtain the blur quality adjustment parameter and the blur algorithm template. Alternatively, the electronic device 100 can first obtain the blur quality adjustment parameter and the blur algorithm template, and then obtain the to-be-processed image and the blur degree parameter. Alternatively, the electronic device 100 can first obtain the blur quality adjustment parameter, and then obtain the to-be-processed image and the blur degree parameter, and then obtain the blur algorithm template.

[0166] S604, the electronic device 100 obtains the blur algorithm according to the blur degree parameter and the blur algorithm template.

[0167] In some embodiments, as described in the above step S603, each blur algorithm template includes at least one blur algorithm. Optionally, the offset of the coordinates of the K*N sampling points relative to the coordinates of the pixel point A determines the effect of the multi-round iteration update. When the blur degree parameter changes, the coordinates of the K*N sampling points change accordingly. Then, each blur algorithm template preconfigured in the electronic device 100 includes the blur algorithm corresponding to different blur degree parameters, and the sampling point coordinates included in different blur algorithms are different.

[0168] Optionally, after the electronic device 100 obtains the blur algorithm template, the electronic device 100 can match the corresponding blur algorithm in the blur algorithm template according to the blur degree parameter obtained in the above step S601.

[0169] As shown in the figure, Figure 5 the electronic device 100 obtains the blur algorithm through the core processing module.

[0170] In some embodiments, the developer can obtain the blur algorithm template through manual tuning or automatic tuning and the like. Then, the blur algorithm template is preconfigured in the electronic device 100, and the electronic device 100 can obtain the preconfigured blur algorithm template in the subsequent blur processing process.

[0171] Optionally, as shown in Figure 10 The obtaining process of the blur algorithm template can include step S1001 and step S1002.

[0172] S1001, obtain the sampling point coordinates corresponding to the preset blur degree parameter.

[0173] In some embodiments, based on the preset blur degree parameter, the preset image is blurred by Gaussian blur, and the blur processing result is taken as the target value. Then, a set of iteration rounds K and single-round iteration sampling times N are obtained, and the preset image is blurred by iterative update blur processing. In the blur processing process, the coordinates of the N sampling points are manually adjusted, or automatic tuning is performed by using gradient descent method and other optimization methods such as cross-entropy loss function, so that the blur quality of the output image is close to the target value corresponding to Gaussian blur after K rounds of iterative update, and a set of sampling point coordinates corresponding to the preset blur degree parameter can be obtained. It should be understood that the set of sampling point coordinates is, for example, a blur algorithm.

[0174] S1002, obtain the blur algorithm template according to the sampling point coordinates corresponding to the preset plurality of blur degree parameters.

[0175] In some embodiments, the above step S1001 can be repeated to obtain a plurality of sets of sampling point coordinates (for example, blur algorithms) corresponding to a plurality of blur degree parameters. Then, the plurality of sets of sampling point coordinates can be combined to obtain the corresponding blur algorithm template.

[0176] The blur algorithm template corresponds to the set of iteration rounds K and single-round iteration sampling times N used in step S1001. Then, steps S1001-S1002 can be repeated to obtain the blur algorithm templates corresponding to different sets of iteration rounds K and single-round iteration sampling times N.

[0177] In this way, the blur quality of the blur algorithm preset in the electronic device 100 can reach the blur quality achieved by Gaussian blur, so that better blur quality can be obtained after subsequent blur processing of the to-be-processed image based on the blur algorithm, thereby improving the user's experience.

[0178] In some embodiments, the blur algorithm template preset in the electronic device 100 includes blur algorithms corresponding to a limited number of blur degree parameters, thereby reducing the storage space occupancy of the blur algorithm template for the electronic device 100, and reducing the difficulty of the processing process of the above steps S1001 and S1002.

[0179] In some examples, the electronic device 100 can directly match the corresponding blur algorithm in the blur algorithm template according to the blur degree parameter.

[0180] In some examples, the electronic device 100 cannot directly match the corresponding blur algorithm in the blur algorithm template according to the blur degree parameter. Then, the electronic device 100 can obtain the required blur algorithm through interpolation operation.

[0181] For example, the blur degree parameters are σ1< σ0< σ2. The electronic device 100 cannot directly match the corresponding blur algorithm in the blur algorithm template corresponding to the iteration round number i and the single round iteration sampling number j according to the blur degree parameter σ0. Then, the electronic device 100 can obtain the blur degree parameters σ1 and σ2 adjacent to the blur degree parameter σ0, and obtain the sampling point coordinates corresponding to the blur degree parameter σ1 and the sampling point coordinates corresponding to the blur degree parameter σ2 Then, the electronic device 100 can obtain the sampling point coordinates corresponding to the blur degree parameter σ0 through interpolation operation.

[0182] In this way, the electronic device 100 can also obtain the sampling point coordinates corresponding to the current required blur degree parameter in the limited set of sampling point coordinates through interpolation operation, thereby increasing the applicability of the scheme.

[0183] S605, the electronic device 100 performs blur processing on the to-be-processed image according to the blur algorithm to obtain a to-be-displayed blurred image.

[0184] In some embodiments, after obtaining the blur algorithm, the electronic device 100 can perform K rounds of iteration update processing on the to-be-processed image obtained in the above step S601 according to the iteration round number K, the single round iteration sampling number N, and the sampling point coordinates indicated by the blur algorithm, thereby obtaining the to-be-displayed blurred image.

[0185] In another example, in the above step S6013b, the electronic device 100 performs scaling processing on the intercepted image in the process of obtaining the to-be-processed image. Then, the electronic device 100 needs to perform reverse scaling processing on the obtained blurred image according to the scaling factor used in step S6013b after performing K rounds of iteration update processing on the to-be-processed image, to obtain the to-be-displayed blurred image. For example, in step S6013b, the electronic device 100 performs scaling down processing on the intercepted image according to the scaling factor. Then, in the blur processing process, the electronic device 100 can perform scaling up processing on the iteration updated blurred image according to the scaling factor, to obtain the to-be-displayed blurred image with the same size as the intercepted image. Alternatively, the blurred image scaling up process can be realized through interpolation operation.

[0186] For example, as Figure 5As shown, the electronic device 100 performs blurring processing on the image to be processed through the core processing module to obtain a blurred image to be displayed.

[0187] In some embodiments, after acquiring a blurred image to be displayed, the electronic device 100 may output the blurred image. For example, the electronic device 100 may display the blurred image on a display screen. Alternatively, the electronic device 100 may perform layer composite processing on the blurred image to be displayed with other images to be displayed to obtain a composite image. The electronic device 100 may then display the composite image on a display screen.

[0188] For example, such as Figure 5 As shown, the electronic device 100 calls the display driver through the output module, triggering the display screen to display the blurred image or composite image to be displayed.

[0189] Thus, based on the blur quality adjustment parameters, the electronic device 100 performs blur processing on the image to be processed through a multi-round iterative update of the blur algorithm. This enables flexible, efficient, and seamless adjustment of blur quality, achieving a balance between blur quality and blur performance. For example, in scenarios with heavy third-party application loads or where visual effects are not critical, the electronic device 100 can lower the blur quality to gain benefits in blur performance, ensuring smooth display. Conversely, in scenarios with higher visual effect requirements, the electronic device 100 can increase the blur quality to achieve a blur effect close to Gaussian blur.

[0190] The complexity of this fuzzing process is independent of the fuzziness level parameter. Therefore, compared to Gaussian fuzzing, it can effectively reduce the complexity of fuzzing and achieve better fuzzing performance.

[0191] Furthermore, the pre-configured blur algorithm in the electronic device 100 is one that can achieve blur quality close to Gaussian blur. Therefore, it can obtain better blur quality compared to Kawase blur. Moreover, the target value for blur quality optimization in the electronic device 100 is Gaussian blur. Therefore, for different iteration rounds K and single-round sampling times N, the blur quality will not change abruptly, achieving controllable blur quality.

[0192] Furthermore, the electronic device 100 can achieve blurring without scaling the captured image. Therefore, compared to hybrid resolution acceleration technology, it can achieve higher performance while maintaining blur quality.

[0193] Figure 11 This is a schematic flowchart illustrating another image processing method provided in an embodiment of this application. It should be noted that this method does not rely on... Figure 11and the specific order of the steps described below is not to be construed as a limitation, it is understood that, in other embodiments, the order of steps can be changed, or some steps can be omitted or deleted, depending on the actual need. The method includes the following steps:

[0194] S1101, in response to the first blur processing event, the electronic device 100 acquires a first image and a first blur quality adjustment parameter corresponding to the first blur processing event.

[0195] The first blur quality adjustment parameter includes a first iteration round number and a first single-round iteration sampling number. Optionally, the first blur quality adjustment parameter can affect the blur processing effect on the first image, such as affecting the blur quality of a second image output after subsequent blur processing of the first image.

[0196] Optionally, the electronic device 100 performs blur processing on the first image through a multi-round iteration update manner. The first iteration round number indicates the number of iteration updates required in the blur processing process, and the first single-round iteration sampling number indicates the number of samples in each iteration update process. For example, the first iteration round number is, for example, 3 rounds, 5 rounds, 6 rounds, etc. The first single-round iteration sampling number is, for example, 3 times, 5 times, 6 times, etc. Optionally, the more the first iteration round number and / or the first single-round iteration sampling number, the better the blur quality of the acquired second image.

[0197] In some embodiments, the electronic device 100 matches the appropriate first blur quality adjustment parameter according to one or more of the blur processing scene, the blur level, the device load, and the resource occupancy rate.

[0198] In this way, the electronic device can flexibly match the appropriate blur quality adjustment parameter according to various factors at the time of the current blur processing event, and better balance the blur quality and performance.

[0199] In some examples, in response to the first blur processing event, the electronic device 100 acquires a blur processing scene corresponding to the first blur processing event. Then, the electronic device 100 acquires the first blur quality adjustment parameter corresponding to the blur processing scene from a plurality of preset groups of blur quality adjustment parameters.

[0200] For example, the electronic device 100 has preset blur quality adjustment parameters corresponding to different blur processing scenes. Then, in response to the first blur processing event, the electronic device 100 can determine the current blur processing scene, and then acquire the corresponding first blur quality adjustment parameter based on the blur processing scene.

[0201] Optionally, the blurring scenario is, for example, a scenario where the image to be displayed needs to be blurred. Optionally, the blurring scenario includes, for example, a pull-down notification menu, a pull-down settings menu, a desktop folder open / exit scenario, a lock screen scenario, a volume button press scenario, and a desktop icon display scenario.

[0202] In this way, the electronic device 100 can obtain the required fuzzy quality adjustment parameters based on the current fuzzy processing scenario, effectively improving the efficiency of obtaining fuzzy quality adjustment parameters.

[0203] In other examples, electronic device 100 receives a first operation from the user and determines the fuzziness level. In response to the first fuzzing event, electronic device 100 obtains a first fuzziness quality adjustment parameter corresponding to the fuzziness level from a set of preset fuzziness quality adjustment parameters.

[0204] Optionally, in response to a user's operation in the settings application, the blur level is obtained. Then, upon detecting a blur processing event, the electronic device 100 can obtain the currently set blur level and, based on that blur level, obtain blur quality adjustment parameters. Optionally, in response to a blur processing event, the electronic device 100 prompts the user to select a blur level via a pop-up window or other notification method. Afterward, the electronic device 100 obtains the blur quality adjustment parameters based on the blur level selected by the user.

[0205] For example, such as Figure 9 As shown in (a), the electronic device 100 is pre-configured with five levels of fuzzy quality: poor, relatively poor, medium, relatively high, and high. Each level of fuzzy quality corresponds to a different number of first iteration rounds K and the number of samplings N in the first single iteration round. Thus, the electronic device 100 can obtain the corresponding number of first iteration rounds K and the number of samplings N in the first single iteration round according to the level selected by the user.

[0206] In this way, configuring fuzz quality adjustment parameters corresponding to different fuzziness levels can meet the needs of different fuzziness qualities while also satisfying users' personalized requirements. Furthermore, the selection of fuzziness levels is easy for users to understand, reducing the difficulty of operation.

[0207] In other examples, the electronic device 100 is pre-configured with blur quality adjustment parameters corresponding to different blur levels in different blur processing scenarios. For example, the electronic device 100 receives a first operation from the user and determines the blur level. In response to the first blur processing event, the electronic device 100 determines the current blur processing scenario and obtains multiple blur quality adjustment parameters corresponding to that scenario. Then, based on the blur level, the electronic device 100 selects the first blur quality adjustment parameter corresponding to that blur level from among the multiple blur quality adjustment parameters.

[0208] In this way, the blur quality adjustment parameter is configured in combination with the blur processing scene and the blur level to obtain better image blur quality.

[0209] In some examples, in response to the first blur processing event, the electronic device 100 obtains load information. The electronic device 100 obtains the preset second blur quality adjustment parameter as the first blur quality adjustment parameter in a case where the load information indicates that the load of the electronic device 100 is greater than or equal to a first threshold value, and obtains the preset third blur quality adjustment parameter as the first blur quality adjustment parameter in a case where the load information indicates that the load of the electronic device 100 is less than the first threshold value. The second blur quality corresponding to the third blur quality adjustment parameter is higher than the second blur quality corresponding to the second blur quality adjustment parameter.

[0210] Optionally, the blur quality can be compared by using an error function. For example, the error function is used to obtain the difference between the pixel values of two blurred images, and the blurred image with higher pixel value is taken as the image with higher blur quality, and the blurred image with lower pixel value is taken as the image with lower blur quality.

[0211] Optionally, the electronic device 100 selects whether to adaptively select the blur quality adjustment parameter according to the load information according to a user operation. For example, the electronic device 100 detects a second operation indicating adaptive adjustment of the blur quality by the user, and then obtains the blur quality adjustment parameter according to the load information; otherwise, the electronic device 100 directly obtains the default blur quality adjustment parameter in response to the blur processing event. In this way, the user's participation is increased, and the difficulty of the user operation is reduced.

[0212] In this way, the electronic device 100 can adaptively select the blur quality adjustment parameter according to the device load. When the load is high, the requirement for the blur quality can be reduced, so that the influence of the blur processing process on the running of other functions of the device is avoided. When the load is low, better blur quality can be provided for the user.

[0213] In some examples, in response to the first blur processing event, the electronic device 100 obtains a first resource occupation rate and a second resource occupation rate. The electronic device 100 sets the first iteration number to a first number and the first single-iteration sampling number to a second number in a case where the first resource occupation rate is greater than or equal to a second threshold value and the second resource occupation rate is less than a third threshold value, and sets the first iteration number to a third number and the first single-iteration sampling number to a fourth number in a case where the first resource occupation rate is less than the second threshold value and the second resource occupation rate is greater than or equal to the third threshold value. The first number is greater than the third number, and the second number is less than the fourth number.

[0214] Optionally, the first resource occupation rate is, for example, a high-speed storage space occupation rate, and the second resource occupation rate is, for example, a computing unit occupation rate.

[0215] For example, in the case of high occupancy of the high-speed storage space, if more single-iteration sampling times generate more calculation data, which can further increase the load of the high-speed storage space. Then, the electronic device 100 can select a lower single-iteration sampling time, and can select a higher or default iteration round number.

[0216] For another example, in the case of high occupancy of the calculation unit, if more iteration round numbers can generate greater burden on the calculation unit. Then, the electronic device can select a lower iteration round number, and select a higher or default single-iteration sampling time.

[0217] In this way, based on the resource occupancy of at least two dimensions, the blur quality adjustment parameter is selected to avoid the influence of the image blur processing process on the operation of other functions of the electronic device. Moreover, the different blur quality adjustment parameters are decoupled to achieve more flexible blur quality adjustment in the future.

[0218] Optionally, the electronic device 100 selects whether to need to select the blur quality adjustment parameter adaptively according to the first resource occupancy and the second resource occupancy according to the user operation. For example, the electronic device 100 detects a second operation indicating adaptive adjustment of the blur quality by the user, and then acquires the blur quality adjustment parameter according to the first resource occupancy and the second resource occupancy; otherwise, the electronic device 100 directly acquires a default blur quality adjustment parameter in response to the blur processing event. In this way, the participation of the user is increased, and the difficulty of the user operation is reduced.

[0219] Optionally, the electronic device 100 can acquire a suitable first blur quality adjustment parameter according to any one or a combination of the blur processing scene, the blur level, the device load, and the resource occupancy. For example, the electronic device 100 is preconfigured with different blur quality adjustment parameters corresponding to different blur processing scenes. Subsequently, in the blur processing process, the electronic device 100 can first acquire the blur quality adjustment parameter according to the current blur processing scene, and then select the blur quality adjustment parameter corresponding to the load information from the already acquired blur quality adjustment parameters according to the current device load information, so that the acquired blur quality adjustment parameter can meet the requirements of the blur processing scene and the load information, to balance the blur quality and the device performance. For this, the embodiments of the present application will not be exemplified one by one.

[0220] In some embodiments, the first image is an image to be subjected to blur processing. Optionally, the first image is an image acquired by the electronic device 100 intercepting a full-screen image, or the first image can also be a preconfigured image in the electronic device 100 or an image downloaded by the electronic device 100 from a server.

[0221] In some examples, in response to the first blur processing event, the electronic device 100 intercepts part or all of the full-screen image as the first image.

[0222] In some other examples, in response to the first blur processing event, the electronic device 100 acquires a third image. The electronic device 100 acquires a scaling factor. Then, the electronic device 100 acquires the first image according to the scaling factor and the third image. Optionally, the third image is, for example, part or all of the full-screen image intercepted by the electronic device 100. Alternatively, the third image can also be a preset image acquired by the electronic device 100 or an image acquired from a server, or an image from other sources. In this way, the electronic device 100 first performs scaling processing on the acquired third image, and then performs blur processing on the scaled image, thereby improving the blur processing performance.

[0223] In this way, the electronic device 100 can acquire an image that needs to be blurred.

[0224] S1102, the electronic device 100 acquires a second image according to the first blur quality adjustment parameter and the first image.

[0225] In some embodiments, after acquiring the first blur quality adjustment parameter, the electronic device 100 can perform iterative update blur processing on the first image by using the first blur quality adjustment parameter to acquire the second image. The second image is a blurred image that meets the blur degree parameter requirement.

[0226] In this way, the electronic device 100 performs blur processing in an iterative update manner, reduces the computing power consumption, and thus reduces the requirement on the performance of the device corresponding to the blur processing.

[0227] In some embodiments, the electronic device 100 acquires a first blur algorithm corresponding to the first blur quality adjustment parameter. The electronic device 100 acquires the second image according to the first blur algorithm and the first image.

[0228] Optionally, the electronic device 100 has preset blur algorithms corresponding to different blur quality adjustment parameters, and the blur algorithm indicates the sampling point coordinates in each iteration update process. In this way, the electronic device 100 can directly match the blur algorithm according to the blur quality adjustment parameter, reduce the difficulty of acquiring the blur algorithm, and improve the blur processing efficiency.

[0229] In some embodiments, in response to the first blur processing event, the electronic device 100 acquires a blur degree parameter. Then, the electronic device 100 acquires the second image according to the first blur quality adjustment parameter and the first image, including: the electronic device 100 acquires the second image according to the first blur quality adjustment parameter, the blur degree parameter, and the first image.

[0230] Optionally, the implementation process of the image processing method provided in the embodiments of the present application is integrated in a preset API interface, an input parameter of the API interface includes the first blur quality adjustment parameter, the blur degree parameter and the first image, and the API interface can output the second image, so that the blur quality and performance are flexibly, efficiently and non-abruptly adjusted.

[0231] In some examples, the electronic device 100 acquires a blur algorithm template corresponding to the first blur quality adjustment parameter. The blur algorithm template includes a plurality of blur algorithms. Then, the electronic device 100 acquires a second blur algorithm in the blur algorithm template corresponding to the blur degree parameter. Then, the electronic device 100 can acquire the second image according to the second blur algorithm and the first image.

[0232] Optionally, a difference between the third blur quality of the second image and a target blur quality is less than a fourth threshold value, and the target blur quality is a blur quality of an image output by processing the first image based on the blur degree parameter through Gaussian blur.

[0233] Optionally, the fourth threshold value indicates that the third blur quality of the second image is close to the target blur quality.

[0234] Optionally, the blur algorithm template corresponding to the first blur quality adjustment parameter includes blur algorithms corresponding to different blur degree parameters, and the blur algorithms can enable the electronic device 100 to acquire a blur quality close to Gaussian blur corresponding to the same blur degree parameter.

[0235] In this way, the electronic device 100 can flexibly, efficiently and non-abruptly adjust the blur quality by performing blur processing on the first image through multiple rounds of iterative update based on the blur quality adjustment parameter, so as to balance the blur quality and the blur performance.

[0236] In some embodiments, the electronic device 100 acquires a first image of a corresponding size through a scaling factor in the process of acquiring the first image. Then, the electronic device 100 acquires a fourth image according to the first blur quality adjustment parameter and the first image. Then, the electronic device 100 acquires the second image according to the scaling factor and the fourth image. The size of the second image is the same as that of the first image.

[0237] For example, the electronic device 100 first reduces the size of the intercepted image to reduce the power consumption of the blur processing, and then enlarges the blurred image after the blur processing is completed to obtain the final output blurred image, so that the size of the output blurred image meets the display size requirement.

[0238] In some embodiments, the electronic device 100 displays the second image after acquiring the second image.

[0239] Thus, the electronic device 100 acquires a blurred image that meets the display requirements.

[0240] In some embodiments, in response to a second blur processing event, the electronic device 100 acquires a fourth image and a fourth blur quality adjustment parameter corresponding to the second blur processing event. The fourth blur quality adjustment parameter differs from the first blur quality adjustment parameter and includes a second iteration round number and a second single-round iteration sampling number. Subsequently, the electronic device 100 acquires a fifth image based on the fourth blur quality adjustment parameter and the fourth image.

[0241] Optionally, the fourth fuzzy quality adjustment parameter may differ from the first fuzzy quality adjustment parameter, for example, by the fourth fuzzy quality adjustment parameter being completely different from the first fuzzy quality adjustment parameter, or by the fourth fuzzy quality adjustment parameter being partially different from the first fuzzy quality adjustment parameter. For instance, the fourth fuzzy quality adjustment parameter differing from the first fuzzy quality adjustment parameter may include any of the following situations: the number of the second iteration rounds is different from the number of the first iteration rounds, and the number of samples in the second single iteration round is different from the number of samples in the first single iteration round; the number of the second iteration rounds is different from the number of the first iteration rounds, and the number of samples in the second single iteration round is the same as the number of samples in the first single iteration round; the number of the second iteration rounds is the same as the number of the first iteration rounds, and the number of samples in the second single iteration round is different from the number of samples in the first single iteration round.

[0242] In this way, the electronic device 100 can obtain appropriate fuzzy quality adjustment parameters according to different fuzzy processing events.

[0243] The above combination Figure 6- Figure 11 The image processing method provided in the embodiments of this application is described in detail below. Figure 12 This application provides a detailed description of the electronic device provided in its embodiments.

[0244] In one possible design, Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 12 As shown, the electronic device 1200 may include a processing unit 1201. The electronic device 1200 can be used to implement the functions of the electronic device 100 involved in the above method embodiments.

[0245] Optionally, the processing unit 1201 is used to support the electronic device 1200 in performing operations. Figure 6 S601-S605; and / or, for supporting the electronic device 1200 to perform Figure 7 S6011a and S6012a; and / or, for supporting the electronic device 1200 to perform Figure 8 S6011b-S6013b; and / or, for supporting electronic device 1200 to perform Figure 11 S1101 and S1102 in the example.

[0246] Optionally, the electronic device 1200 may further include a transceiver unit 1202. The transceiver unit 1202 is used to support the electronic device 1200 in receiving user operations.

[0247] The transceiver unit may include a receiving unit and a transmitting unit, and may be implemented by a transceiver or transceiver-related circuit components, and may be a transceiver or transceiver module. The operation and / or function of each unit in the electronic device 1200 are respectively to implement the corresponding flow of the image processing method described in the above method embodiments. All relevant content of each step involved in the above method embodiments can be referred to the functional description of the corresponding functional unit, and for the sake of brevity, it will not be repeated here.

[0248] Optionally, Figure 12 The illustrated electronic device 1200 may also include a storage unit ( Figure 12 (not shown in the image), this storage unit stores a program or instruction. When the processing unit 1201 and the transceiver unit 1202 execute the program or instruction, it causes... Figure 12 The electronic device 1200 shown can perform the image processing method described in the above method embodiments.

[0249] Figure 12 The technical effects of the electronic device 1200 shown can be referred to the technical effects of the image processing method described in the above method embodiments, and will not be repeated here.

[0250] In addition to being in the form of electronic device 1200, the technical solution provided in this application can also be a functional unit or chip in an electronic device, or a device used in conjunction with an electronic device.

[0251] Figure 13 This is a schematic diagram illustrating the possible product form of the electronic device 100 provided in the embodiments of this application.

[0252] As one possible product form, the electronic device 100 described in this application embodiment can be a communication device.

[0253] The communication device includes a processor 1301. Optionally, the communication device further includes a transceiver 1302, a memory 1303, and a bus. The processor 1301 is used to execute... Figure 6 S601-S605 in the example; and / or, used to perform Figure 7 S6011a and S6012a in the example; and / or, used to perform Figure 8 S6011b-S6013b; and / or, for supporting electronic device 1200 to perform Figure 11 S1101 and S1102 in the above, and / or other processing operations that the electronic device 100 needs to perform in the embodiments of this application.

[0254] As another possible product form, the electronic device 100 described in the embodiments of the present application can also be implemented by a general-purpose processor or a special-purpose processor, that is, a chip.

[0255] The chip includes a processing circuit 1301. Optionally, the communication device further includes a transceiver pin 1302. The processing circuit 1301 is configured to perform S601-S605 in Figure 6 ; and / or, configured to perform S6011a and S6012a in Figure 7 ; and / or, configured to perform S6011b-S6013b in Figure 8 ; and / or, configured to support the electronic device 1200 to perform S1101 and S1102 in Figure 11 , and / or other processing operations that the electronic device 100 needs to perform in the embodiments of the present application.

[0256] The embodiments of the present application also provide a chip system, including: a processor, the processor is coupled with a memory, the memory is used to store programs or instructions, when the programs or instructions are executed by the processor, the chip system realizes the method in any one of the above method embodiments.

[0257] Optionally, the processor in the chip system can be one or more. The processor can be implemented by hardware or software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor, which realizes by reading software codes stored in the memory.

[0258] Optionally, the memory in the chip system can also be one or more. The memory can be integrated with the processor, or can be separately arranged from the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory can be a non-transient processor, for example, a read-only memory (ROM), which can be integrated on the same chip with the processor, or can be separately arranged on different chips. The embodiments of the present application do not make specific limitations on the type of the memory and the arrangement manner of the memory and the processor.

[0259] Exemplarily, the chip system can be a field programmable gate array (FPGA), can be an application specific integrated circuit (ASIC), can also be a system on chip (SoC), can also be a central processing unit (CPU), can also be a network processor (NP), can also be a digital signal processor (DSP), can also be a micro controller unit (MCU), can also be a programmable logic device (PLD) or other integrated chip.

[0260] It should be understood that each step in the above method embodiments can be completed by integrated logic circuits of hardware in the processor or instructions in the form of software. The method steps disclosed in combination with the embodiments of the present application can be directly embodied as hardware processor execution, or executed by a combination of hardware and software modules in the processor.

[0261] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program. When the computer program is run on a computer, the computer is caused to execute the above related steps to realize the image processing method in the above embodiments.

[0262] The embodiments of the present application also provide a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above related steps to realize the image processing method in the above embodiments.

[0263] In addition, the embodiments of the present application also provide a device. The device can be specifically a component or a module, and the device can include one or more processors and memories connected thereto. The memory is used to store a computer program. When the computer program is executed by the one or more processors, the device executes the image processing method in the above method embodiments.

[0264] Among them, the device, computer readable storage medium, computer program product or chip provided by the embodiments of the present application are used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved are referred to the beneficial effects in the corresponding method provided above, which will not be repeated here.

[0265] The steps of methods or algorithms described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in RAM, flash memory, ROM, EPROM, EEPROM, registers, hard disk, a removable media, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium can be integral to the processor. The processor and the storage medium can reside in an ASIC.

[0266] Those skilled in the art can clearly understand the method provided by the above embodiments, for the convenience and brevity, only the above functional modules are taken as examples. In actual application, the above functions can be completed by different functional modules according to the needs; that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.

[0267] In several embodiments provided in the present application, it should be understood that the disclosed method can be implemented in other ways. The above-described device embodiments are only schematic. For example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner; for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, module or unit, which can be electrical, mechanical or other forms.

[0268] In addition, each functional unit in each embodiment of the present application can be integrated into a 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 realized in the form of hardware or in the form of a software functional unit.

[0269] The computer readable storage medium includes, but is not limited to, any one of the following: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media capable of storing program codes.

[0270] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any change or replacement within the technical scope disclosed by the present application should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. An image processing method, characterized by, The method is applied to an electronic device, and the method comprises: in response to a first blur processing event, obtaining a first image and a first blur quality adjustment parameter corresponding to the first blur processing event according to one or more contents corresponding to the first blur processing event, the one or more contents being a blur processing scene, a blur level, load information, and resource occupation rate; obtaining a second image according to the first blur quality adjustment parameter and the first image.

2. The method of claim 1, wherein, The method further comprises: in response to the first blur processing event, obtaining the first blur quality adjustment parameter corresponding to the first blur processing event comprises: in response to the first blur processing event, obtaining a blur processing scene corresponding to the first blur processing event; 3. The method according to claim 1 or 2, characterized in that, in a plurality of preset groups of blur quality adjustment parameters, obtaining the first blur quality adjustment parameter corresponding to the blur processing scene. The method further comprises: receiving a first operation of a user to determine a blur level; 4. The method according to claim 1 or 2, characterized in that, in response to the first blur processing event, in a plurality of preset groups of blur quality adjustment parameters, obtaining the first blur quality adjustment parameter corresponding to the blur level. The method further comprises: in response to the first blur processing event, obtaining load information; in a case where the load information indicates that a load of the electronic device is greater than or equal to a first threshold, presetting a second blur quality adjustment parameter as the first blur quality adjustment parameter; 5. The method according to claim 1 or 2, characterized in that, in a case where the load information indicates that the load of the electronic device is less than the first threshold, presetting a third blur quality adjustment parameter as the first blur quality adjustment parameter, the first blur quality corresponding to the third blur quality adjustment parameter being higher than a second blur quality corresponding to the second blur quality adjustment parameter. The method further comprises: in response to the first blur processing event, obtaining a first resource occupation rate and a second resource occupation rate; in a case where the first resource occupation rate is greater than or equal to a second threshold and the second resource occupation rate is less than a third threshold, the first iteration round number is a first quantity and the first single-round iteration sampling number is a second quantity; in a case where the first resource occupation rate is less than the second threshold and the second resource occupation rate is greater than or equal to the third threshold, the first iteration round number is a third quantity and the first single-round iteration sampling number is a fourth quantity; 6. The method of claim 4, wherein, wherein the first quantity is greater than the third quantity, and the second quantity is less than the fourth quantity. The method further comprises: detecting a second operation of a user indicating adaptive adjustment of blur quality.

7. The method according to claim 1 or 2, characterized in that, The method further comprises: obtaining a first blur algorithm corresponding to the first blur quality adjustment parameter; obtaining the second image according to the first blur algorithm and the first image.

8. The method of claim 1 or 2, wherein, The method further comprises: obtaining a blur degree parameter in response to the first blur processing event; The method further comprises: obtaining the second image according to the first blur quality adjustment parameter, the blur degree parameter and the first image.

9. The method of claim 8, wherein, The method further comprises: obtaining a blur algorithm template corresponding to the first blur quality adjustment parameter, the blur algorithm template comprising a plurality of blur algorithms; obtaining a second blur algorithm corresponding to the blur degree parameter in the blur algorithm template; obtaining the second image according to the second blur algorithm and the first image.

10. The method of claim 8, wherein, The difference between the third blur quality of the second image and a target blur quality is less than a fourth threshold value, the target blur quality being the blur quality of an image output by processing the first image based on the blur degree parameter through Gaussian blur.

11. The method of claim 1 or 2, wherein, The method further comprises: obtaining a part or all of a full-screen image as the first image in response to the first blur processing event.

12. The method of claim 1 or 2, wherein, The method further comprises: obtaining a third image in response to the first blur processing event; obtaining a scaling factor; obtaining the first image according to the scaling factor and the third image.

13. The method of claim 12, wherein, The method further comprises: obtaining a fourth image according to the first blur quality adjustment parameter and the first image; obtaining the second image according to the scaling factor and the fourth image, the size of the second image being the same as that of the first image.

14. The method of claim 1 or 2, wherein, The method further comprises: obtaining a fourth image and a fourth blur quality adjustment parameter corresponding to a second blur processing event in response to the second blur processing event, the fourth blur quality adjustment parameter being different from the first blur quality adjustment parameter, the fourth blur quality adjustment parameter comprising a second iteration number and a second sampling number of a single iteration; obtaining a fifth image according to the fourth blur quality adjustment parameter and the fourth image.

15. An electronic device, comprising: The electronic device comprises: a processor and a memory coupled to the processor, the memory being configured to store computer program codes, the computer program codes comprising computer instructions, when the processor reads the computer instructions from the memory, the electronic device is enabled to perform the method according to any one of claims 1-14.

16. A computer-readable storage medium, characterized in that, The computer readable storage medium includes a computer program which, when running on an electronic device, causes the electronic device to perform the method according to any one of claims 1-14.

17. A computer program product, characterised in that, The computer program product, when running on a computer, causes the computer to perform the method according to any one of claims 1-14.

Citation Information

Patent Citations

  • Image fuzzy processing method and device, equipment and storage medium

    CN118172274A