Image fuzzy processing method and electronic equipment
By avoiding redundant operations in the image blurring of electronic devices, directly downsampling and upsampling to a picture board that is consistent with the display screen size, the duration and power consumption problems caused by redundant operations in the prior art are solved, and more efficient image processing.
Patent Information
- Application Number
- CN202310782388.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-28
- Publication Date
- 2025-01-07
AI Technical Summary
Existing electronic devices have redundant operations during image blur processing, resulting in increased duration and increased power consumption, especially during downsampling and upsampling, requiring multiple artboard size changes, increasing processing time and energy consumption.
By directly downsampling the image information to the first artboard without changing the pictureboard during the image drawing and downsampling process, the image information is directly downsampled to the display screen without going through the pictureboard changes, and the additional artboard transition is avoided during the upsampling process. A second artboard with the same size, reducing redundant operations.
The time of image blur processing is shortened, the power consumption of electronic devices is saved, and the processing efficiency and energy efficiency are improved.
Smart Images

Figure CN119273533A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of electronic devices, and in particular to an image blur processing method and an electronic device. Background Art
[0002] The electronic device can perform blur processing on the image to obtain a blurred image, and display the image. Among them, the blur processing of the image can be understood as blurring the image. Specifically, it can be: the electronic device draws the initial image on the drawing board, and then downsamples the drawing board according to the blur degree of the image to obtain a compressed image. The electronic device uses a blur algorithm to blur the compressed image to obtain a blurred image. The electronic device upsamples the blurred image to obtain a final image, and the final image is consistent with the size of the initial image. It can be seen that the electronic device draws the image on the drawing board and then downsamples it. There are repeated operations in pixel drawing. During the image upsampling process, the drawing board size needs to be changed once, and there are redundant operations, which increases the duration of the image blurring process and increases the power consumption of the electronic device. Summary of the invention
[0003] The image blur processing method and electronic device provided in the embodiments of the present application can reduce redundant operations, shorten the duration of image blur processing, and save power consumption of the electronic device.
[0004] In order to achieve the above-mentioned purpose, the embodiment of the present application adopts the following technical solution.
[0005] In a first aspect, the present application provides a method for blurring an image, wherein the execution subject of the method may be an electronic device or a component located in the electronic device (e.g., a chip, a chip system or a processor, etc.), and the following description is made by taking the execution subject being an electronic device as an example. The method may include: in response to receiving a first operation, the electronic device obtains image information and a first canvas of the image to be blurred. During the process of image drawing and downsampling, the electronic device downsamples the image information to the first canvas without changing the canvas to obtain a first image. The electronic device blurs the first image. The electronic device upsamples the blurred first image to a second canvas to obtain a second image, wherein the second canvas is different from the first canvas, and the size of the second canvas is consistent with the size of the display screen of the electronic device.
[0006] The image to be blurred may be the main interface of the electronic device or the interface of an application program.
[0007] The first operation may be understood as an operation on the electronic device. The operation may include an operation on the main interface of the electronic device, such as a pull-down operation on the main interface, a swipe-up operation on the main interface, etc. The operation may also include an operation on an application on the electronic device, such as a press operation on the interface of the application, a pull-down or swipe-up operation on the interface of the application, etc.
[0008] The first drawing board can be understood as a virtual drawing board, or the first drawing board can be understood as a set of data. The number of pixels corresponding to the drawing board is less than the number of pixels contained in the image information. The number of pixels of the first drawing board is an integer power of 3. The first drawing board can be determined according to the image information. The first drawing board can be predefined or dynamically adjusted according to the image information.
[0009] The blur processing may be performed by using a blur algorithm, which may include a Gaussian blur algorithm, a block blur algorithm, a double blur algorithm and a directional blur algorithm, or other blur algorithms capable of blurring may be used.
[0010] The upsampling process may be mirror-symmetrical to the downsampling process, or may not be mirror-symmetrical.
[0011] In this way, during the downsampling process, the image information can be directly downsampled to the first drawing board. During this process, the first drawing board does not change, thereby avoiding redundant operations, shortening the duration of image blurring processing, and saving power consumption.
[0012] In one design solution, the electronic device obtains the first drawing board, which may specifically be: the electronic device obtains image information of the image to be blurred. The electronic device determines the first drawing board according to the image information; the number of pixels corresponding to the first drawing board is less than the number of pixels included in the image.
[0013] In one design scheme, the electronic device upsamples the blurred first image to a second canvas to obtain a second image. Specifically, the electronic device upsamples the blurred first image to a second canvas to obtain the second image without changing the canvas during the image drawing upsampling process.
[0014] In this way, during the downsampling process, the image information can be directly downsampled to the first canvas, and the first canvas does not change during this process, thus avoiding redundant operations. In addition, during the upsampling process, the blurred first image can be directly upsampled to the second canvas, and during this process, the first canvas undergoes a change process from the first canvas to the second canvas, and there is no transition process from other canvases, thus avoiding redundant operations, further shortening the duration of image blurring, and saving power consumption.
[0015] In one design solution, the electronic device upsamples the blurred first image onto a second drawing board to obtain a second image, including:
[0016] The electronic device samples the blurred first image to a third drawing board through a drawing board change during image drawing upsampling to obtain a third image. The electronic device displays the third image on the second drawing board to obtain the second image.
[0017] In this way, although the upsampling process experiences a change process from the first canvas to the second canvas, the downsampling process can directly downsample the image information to the first canvas. During this process, the first canvas does not change, thus avoiding redundant operations, still shortening the image blurring processing time and saving power consumption.
[0018] In one design solution, the image information includes position information of each pixel; the electronic device downsamples the image information to the first drawing board to obtain the first image, which may be specifically: the electronic device determines the mapping relationship between each pixel in the image information and each pixel corresponding to the first drawing board according to the position information of each pixel and the position information of each pixel in the first drawing board. The electronic device draws the image information on the first drawing board according to the mapping relationship to obtain the first image.
[0019] In one design solution, the number of pixels corresponding to the first drawing board is less than the number of pixels included in the image and is an integer power of 2.
[0020] In one design scheme, the first operation includes a sliding operation input at the top of the screen; the second image is a blurred main interface; after obtaining the second image, it also includes: the electronic device displays the first interface, and the blurred main interface is presented in the first interface.
[0021] That is, in the taskbar scenario, when the user pulls down the main interface of the electronic device, the main interface of the electronic device gradually blurs. When the user stops pulling and stops contacting the main interface, the electronic device displays the taskbar information to clearly display the taskbar information.
[0022] In one design scheme, the first operation also includes a swipe up operation; the second image is a blurred interface of at least one application; after obtaining the second image, it also includes: the electronic device displays a second interface, and the second interface presents the blurred interface of at least one application.
[0023] That is, in a multitasking scenario, when the user swipes up the main interface of the electronic device, the interface of at least one application running on the electronic device is displayed in the multitasking interface of the electronic device, and one or several interfaces of at least one application are displayed in a blurred manner to protect the information on the application.
[0024] In a second aspect, the present application provides an electronic device, comprising: an acquisition module, a downsampling module, a blur processing module and an upsampling module. Among them, the acquisition module is used to obtain image information and a first canvas of an image to be blurred in response to receiving a first operation. The downsampling module is used to downsample the image information to the first canvas without changing the canvas during the image drawing downsampling process to obtain a first image. The blur processing module is used to blur the first image. The upsampling module is used to upsample the blurred first image to a second canvas to obtain a second image, the second canvas is different from the first canvas, and the size of the second canvas is consistent with the size of the display screen of the electronic device.
[0025] The image to be blurred may be the main interface of the electronic device or the interface of an application program.
[0026] The first operation may be understood as an operation on the electronic device. The operation may include an operation on the main interface of the electronic device, such as a pull-down operation on the main interface, a swipe-up operation on the main interface, etc. The operation may also include an operation on an application on the electronic device, such as a press operation on the interface of the application, a pull-down or swipe-up operation on the interface of the application, etc.
[0027] The first drawing board can be understood as a virtual drawing board, or the first drawing board can be understood as a set of data. The number of pixels corresponding to the drawing board is less than the number of pixels contained in the image information. The number of pixels of the first drawing board is an integer power of 3. The first drawing board can be determined according to the image information. The first drawing board can be predefined or dynamically adjusted according to the image information.
[0028] The blur processing may be performed by using a blur algorithm, which may include a Gaussian blur algorithm, a block blur algorithm, a double blur algorithm and a directional blur algorithm, or other blur algorithms capable of blurring may be used.
[0029] The upsampling process may be mirror-symmetrical to the downsampling process, or may not be mirror-symmetrical.
[0030] In this way, during the downsampling process, the image information can be directly downsampled to the first drawing board. During this process, the first drawing board does not change, thereby avoiding redundant operations, shortening the duration of image blurring processing, and saving power consumption.
[0031] In one design solution, the acquisition module is used to: determine the first drawing board according to the image information; the number of pixels corresponding to the first drawing board is smaller than the number of pixels included in the image.
[0032] In one design solution, the upsampling module is used to: during the image rendering upsampling process, upsample the blurred first image to a second drawing board without changing the drawing board to obtain the second image.
[0033] In this way, during the downsampling process, the image information can be directly downsampled to the first canvas, and the first canvas does not change during this process, thus avoiding redundant operations. In addition, during the upsampling process, the blurred first image can be directly upsampled to the second canvas, and during this process, the first canvas undergoes a change process from the first canvas to the second canvas, and there is no transition process from other canvases, thus avoiding redundant operations, further shortening the duration of image blurring, and saving power consumption.
[0034] In one design scheme, the upsampling module is used to: during the image drawing upsampling process, by changing the canvas, upsample the first image to a third canvas to obtain a third image; and display the third image on the second canvas to obtain the second image.
[0035] In this way, although the upsampling process experiences a change process from the first canvas to the second canvas, the downsampling process can directly downsample the image information to the first canvas. During this process, the first canvas does not change, thus avoiding redundant operations, still shortening the image blurring processing time and saving power consumption.
[0036] In one design scheme, the image information includes position information of each pixel; the downsampling module is used to: determine the mapping relationship between each pixel in the image information and each pixel corresponding to the first canvas according to the position information of each pixel and the position information of each pixel in the first canvas; and draw the image information on the first canvas according to the mapping relationship to obtain the first image.
[0037] In one design solution, the number of pixels corresponding to the first drawing board is less than the number of pixels included in the image and is an integer power of 2.
[0038] In one design scheme, the first operation includes a sliding operation input at the top of the screen; the second image is the blurred main interface; after obtaining the second image, it also includes: a display module for displaying the first interface, and the blurred main interface is presented in the first interface.
[0039] That is, in the taskbar scenario, when the user pulls down the main interface of the electronic device, the main interface of the electronic device gradually blurs. When the user stops pulling and stops contacting the main interface, the electronic device displays the taskbar information to clearly display the taskbar information.
[0040] In one design scheme, the first operation also includes a swipe up operation; the second image is a blurred interface of at least one application; after obtaining the second image, it also includes: a display module for displaying a second interface, in which the blurred interface of at least one application is presented.
[0041] That is, in a multitasking scenario, when the user swipes up the main interface of the electronic device, the interface of at least one application running on the electronic device is displayed in the multitasking interface of the electronic device, and one or several interfaces of at least one application are displayed in a blurred manner to protect the information on the application.
[0042] In a third aspect, the present application provides an electronic device, comprising: one or more processors; and a memory, wherein the memory stores a code; when the code is executed by the processor, the electronic device executes the method described in the first aspect.
[0043] In a fourth aspect, the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect.
[0044] Among them, the specific implementation methods and corresponding technical effects of each of the second to fourth aspects mentioned above can refer to the specific implementation methods and technical effects of the first aspect mentioned above. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flowchart of the current image blur processing method;
[0046] Figure 2 A schematic diagram of a flow chart of an image blur processing method provided in an embodiment of the present application;
[0047] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0048] Figure 4 A schematic diagram of the software architecture of the display system of the electronic device in the embodiment of the present application;
[0049] Figure 5 A schematic diagram of the software architecture of the display system of the electronic device in the embodiment of the present application;
[0050] Figure 6A schematic diagram of a flow chart of a blur processing method for an image provided in an embodiment of the present application;
[0051] Figure 7 is a schematic diagram of mapping each pixel in the image information to each pixel in the first drawing board;
[0052] Figure 8 is a schematic diagram of the blur processing process of 9 pixels in the first image;
[0053] Fig. 9 A schematic diagram of an interface of an electronic device in a status bar scenario provided by an embodiment of the present application;
[0054] Fig.10 A schematic diagram of another interface of an electronic device in a status bar scenario provided by an embodiment of the present application;
[0055] Fig.11 A schematic diagram of an interface of an electronic device in a multi-tasking scenario provided by an embodiment of the present application;
[0056] Fig.12 A schematic diagram of another interface of an electronic device in a multi-tasking scenario provided by an embodiment of the present application;
[0057] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The electronic device may blur the image to obtain a blurred image and display the image. In one case, in order to protect user privacy, the electronic device may blur the interface of an application running in the background. Specifically, Figure 1 This is a flow chart of the current image blur processing method. Figure 1 As shown, when the application is running in the background, the electronic device obtains the interface of the application, and the size of the interface can be 960*1440 pixels. In order to prevent the image from being distorted, the electronic device draws a small-sized image on a large-sized drawing board, such as the electronic device draws the interface of 960*1440 pixels on a 1024*1536 pixel drawing board. Afterwards, the electronic device downsamples the image on the drawing board according to the degree of blur to obtain an image of a 512*1024 pixel drawing board. The electronic device uses a blur algorithm to blur the image of the 512*1024 pixel drawing board to obtain a blurred image. The electronic device upsamples the blurred image to obtain an image of a 1024*1536 pixel drawing board. The electronic device displays the image of the 1024*1536 pixel drawing board on the 960*1440 pixel display screen of the electronic device.
[0059] It can be seen that in the process of blurring the image, the interface needs to be drawn on a 1024*1536 pixel canvas first, and then the canvas size is changed to 512*1024 pixels during the downsampling process, resulting in more pixels to be drawn. In addition, in the upsampling process, the canvas size is changed to 1024*1536 pixels, which is a redundant operation, prolonging the image blurring process time and increasing the power consumption of the electronic device.
[0060] In order to solve the above technical problems, an embodiment of the present application provides a method for blurring an image, which can be applied to an electronic device. The method includes: in response to receiving a first operation, the electronic device obtains image information of the image to be blurred. The image information may include pixels of the interface of the application. The electronic device determines a first drawing board according to the image information. In the process of image drawing downsampling, the electronic device does not undergo the action of changing the drawing board, and downsamples the image information to the first drawing board to obtain the first image. In this way, the electronic device can directly downsample the image information to the first drawing board, and the first drawing board does not change during this process, thereby avoiding redundant operations. In addition, the electronic device blurs the first image. In the process of image drawing upsampling, the electronic device does not undergo the action of changing the drawing board, and upsamples the blurred first image to the second drawing board to obtain the second image, the second drawing board is different from the first drawing board, and the size of the second drawing board is consistent with the size of the display screen of the electronic device. The electronic device displays the second image. In this way, the electronic device can directly upsample the second image to the second drawing board, and in this process, the change process from the first drawing board to the second drawing board is experienced, and there is no transition process of other drawing boards, thereby avoiding redundant operations, shortening the duration of image blurring, and saving power consumption of the electronic device.
[0061] For example, Figure 2 The following is a flow chart of the image blur processing method provided in the embodiment of the present application. Figure 2As shown, when the application is running in the background, the electronic device obtains the interface of the application, and the size of the interface can be 960*1440 pixels. The electronic device can determine the first canvas corresponding to the image information based on the image information of the interface. For example, the image information includes 960*1440 pixels. Then, the electronic device can determine that the size of the first canvas can be an integer power of 2, such as 512*1024 pixels. In this way, the electronic device directly downsamples the image information to a canvas of 512*1024 pixels (i.e., the first canvas). The electronic device uses a blur algorithm to blur the image of the 512*1024 pixel canvas to obtain a blurred image. The electronic device can upsample the blurred image information to a display screen of 960*1440 pixels (i.e., the second canvas). In this way, the electronic device does not need to change the first canvas during the downsampling process, and undergoes the change process from the first canvas to the second canvas during the upsampling process without a transition process to other canvases (such as a 1024*1536 pixel canvas), thereby avoiding redundant operations, shortening the image blurring processing time, and saving power consumption of the electronic device.
[0062] Figure 3 A structural block diagram of an electronic device provided in an embodiment of the present application.
[0063] like Figure 3 As shown, the electronic device 100 may include a processor 210, a sensor module 220, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, a memory 250, an antenna 1, a wireless communication module 260, and a display screen 270, etc. The sensor module 220 may include a pressure sensor 220A, a touch sensor 220B, etc.
[0064] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0065] The processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (AP), a modem processor, a graphics processor (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), etc. Different processing units may be independent devices or integrated into one or more processors.
[0066] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0067] The processor 210 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may store instructions or data that the processor 210 has just used or cyclically used. If the processor 210 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.
[0068] In some embodiments, the display screen 270 receives a first operation and sends operation information of the operation to the processor 210. The processor 210 obtains image information of the image to be blurred. The image information may include pixels of the interface of the application. The processor 210 determines the first drawing board according to the image information. In the process of image drawing downsampling, the processor 210 downsamples the image information to the first drawing board without changing the drawing board to obtain the first image. The processor 210 blurs the first image. In the process of image drawing upsampling, the processor 210 upsamples the blurred first image to the second drawing board without changing the drawing board to obtain the second image, the second drawing board is different from the first drawing board, and the size of the second drawing board is consistent with the size of the display screen of the electronic device. The processor 210 sends the second image to the display screen 270 for display.
[0069] The charging management module 240 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 240 may receive charging input from a wired charger through the USB interface 230. In some wireless charging embodiments, the charging management module 240 may receive wireless charging input through a wireless charging coil of the electronic device. While the charging management module 240 is charging the battery 242, it may also power the electronic device through the power management module 241.
[0070] The power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the display screen 270, and the wireless communication module 260. The power management module 241 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 241 can also be set in the processor 210. In other embodiments, the power management module 241 and the charging management module 240 can also be set in the same device.
[0071] The wireless communication function of the electronic device can be implemented through the antenna 1, the wireless communication module 260, the modem processor and the baseband processor.
[0072] Antenna 1 is used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antenna. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0073] The wireless communication module 260 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to electronic devices. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 1, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 210. The wireless communication module 260 can also receive the signal to be sent from the processor 210, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, the wireless communication module 260 receives application information sent by the server.
[0074] The electronic device implements the display function through a GPU, a display screen 270, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 270 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs that execute program instructions to generate or change display information.
[0075] The display screen 270 is used to display images, videos, etc. The display screen 270 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 270, where N is a positive integer greater than 1.
[0076] The memory 250 can be used to store computer executable program codes, which include instructions. The memory 250 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the memory 250 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 210 executes various functional applications and data processing of the electronic device by running instructions stored in the memory 250 and / or instructions stored in a memory provided in the processor.
[0077] The pressure sensor 220A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 220A can be set on the display screen 270. There are many types of pressure sensors 220A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 220A, the capacitance between the electrodes changes. The electronic device determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 270, the electronic device detects the touch operation intensity according to the pressure sensor 220A. The electronic device can also calculate the touch position according to the detection signal of the pressure sensor 220A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0078] The touch sensor 220B is also called a "touch control device". The touch sensor 220B can be set on the display screen 270. The touch sensor 220B and the display screen 270 form a touch screen, also called a "touch control screen". The touch sensor 220B is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 270. In other embodiments, the touch sensor 220B can also be set on the surface of the electronic device, which is different from the position of the display screen 270.
[0079] Of course, the electronic device may also include other functional units, which are not limited in the embodiments of the present application.
[0080] In addition, the actions, terms, etc. involved in the various embodiments of the present application can refer to each other without limitation. The names of the messages or parameter names in the messages in the embodiments of the present application are only examples, and other names can also be used in the specific implementation without limitation.
[0081] See also Figure 4 and Figure 5 , Figure 4 and Figure 5 It is a software structure block diagram of the display system of the electronic device provided in the embodiment of the present application.
[0082] like Figure 4 and Figure 5 As shown, exemplarily, after the electronic device receives the first operation, ① the image drawing module of the application of the electronic device draws the user interface of the application. ② The image drawing module sends the image information of the user interface to the image rendering module, and the image rendering module performs rendering to obtain the image information, which may include information such as the color value of each pixel, the number of pixels, and the position coordinates of each pixel. ③ The image rendering module sends the image information to the drawing board determination unit of the image blur processing module, and the drawing board determination unit determines the first drawing board according to the number of pixels in the image information. The number of pixels included in the first drawing board is the number of pixels in the image information after downsampling by n times. ④ After the drawing board determination unit determines the first drawing board, the downsampling unit downsamples the image information and draws it on the first drawing board to obtain the first image. ⑤ The downsampling unit sends the first image to the blurring unit, and the blurring unit performs blurring on the first image. ⑥ The blurring unit sends the blurred first image to the upsampling unit, and the upsampling unit upsamples the blurred first image to the second drawing board to obtain the second image, and the number of pixels corresponding to the second drawing board is consistent with the pixels contained in the display screen. ⑦ The up-sampling unit sends the second image to the hardware composition abstraction layer (hwcomposer, HWC). ⑧ The HWC sends the second image to the display screen for display.
[0083] Among them, the above-mentioned electronic device can be a mobile phone, a tablet computer, a laptop, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device and the like. The specific form of the electronic device is not particularly limited in the embodiments of the present application.
[0084] Figure 6A flowchart of a method for blurring an image provided by an embodiment of the present application is shown in FIG. Figure 6 As shown, the method can be applied to an electronic device, and the method may include: S600, S601, S602, S603, S604 and S605. Among them, S600, S601, S602, S603, S604 and S605 may specifically be:
[0085] S600: The electronic device receives a first operation.
[0086] The application can be understood as an application with image blur processing requirements. That is, the application can customize the user interface that needs to be blurred in a specified scenario. The application can be customized during the R&D stage.
[0087] For example, in order to protect the interface information of the application, when the application is running in the background, the application can define: when displaying the interface of the application running in the background, the interface needs to be blurred. For example, in order to facilitate smooth interface switching, the main interface of the electronic device switches to the interface of the status bar, the application can define: in the process of switching from the main interface to the interface of the status bar, the main interface needs to be blurred.
[0088] This operation is used to trigger the blurring of the interface of the application. This operation may include a sliding operation, a pressing operation, a clicking operation, etc., which are not specifically limited in the embodiments of this application. This operation can be set according to different scenarios, for example:
[0089] In one example, in a status bar scenario, such as Fig. 9 The figure shows an interface diagram of an electronic device provided by an embodiment of the present application. Fig. 9 The first arrow direction shown The pull-down operation is also used to indicate the switching interface. When the user moves along the direction of the first arrow Fig. 9 When the interface 101 shown performs a pull-down operation, the electronic device 100 receives the user's pull-down operation.
[0090] In another example, in a multitasking scenario, such as Fig.11 Another interface diagram of an electronic device provided by an embodiment of the present application is shown. Fig.11 The second arrow direction shown The swipe up operation is also used to display the application running in the background. The electronic device starts application A. After that, application A runs in the background. At this time, when the user moves along the direction of the second arrow Fig.11 When the interface 103 shown is swiped up, the electronic device 100 receives the swiping up operation from the user.
[0091] S601: In response to receiving a first operation, the electronic device obtains image information of an image to be blurred and a first drawing board.
[0092] The image information may include pixel information, and the pixel information may include the position of the pixel, the color value of the pixel, the number of pixels, etc. This is not specifically limited in the embodiments of the present application. The specific implementation needs to be determined according to actual needs.
[0093] The first drawing board can be understood as a group of data, that is, the first drawing board can be a virtual image of a specified shape composed of a group of pixels.
[0094] In a specific implementation, the electronic device may determine the first drawing board according to the image information of the image to be blurred. Specifically, S601 may include: S6011 and S6012. S6011 and S6012 may specifically be:
[0095] S6011. In response to receiving the first operation, the electronic device obtains image information of the image to be blurred.
[0096] For details, please refer to S6011 Figure 5 The steps ① and ② shown in the figure will not be repeated here.
[0097] Exemplarily, in the status bar scenario, when the user clicks along the direction of the first arrow Fig. 9 When the interface shown in the figure is pulled down, the electronic device receives the user's pull-down operation. At this time, in response to the operation, the electronic device identifies the main interface of the electronic device and obtains the image information of the interface. The image information may include the color value of each pixel, the position of each pixel, and the number of pixels.
[0098] Exemplarily, in a multitasking scenario, when the user moves along the direction of the second arrow Fig.11 When the interface shown is swiped up, the electronic device receives the user's swiping up operation. At this time, in response to the operation, the electronic device identifies the multitasking interface, which is used to represent that the electronic device displays the icons of one or more applications that are running (including background running and foreground running) in the multitasking interface according to the priority order of the applications. The electronic device obtains image information of the multitasking interface. The image information may include the color value of each pixel, the position of each pixel, and the number of pixels.
[0099] S6012. The electronic device determines a first canvas according to the image information. Specifically, the electronic device may determine the first canvas according to the number of pixels. The number of pixels of the first canvas is half of the target canvas that can hold the image information. The number of pixels of the first canvas and the target canvas is usually an integer power of 2. For example, if the image information includes 960*1440 pixels, the number of pixels of the first canvas is half of the target canvas that can hold 960*1440 pixels, such as the number of pixels of the target canvas is 1024*1536, and the number of pixels of the first canvas is 512*1024.
[0100] For details, please refer to S6012 Figure 5 Step ③ shown in the figure will not be repeated here.
[0101] S602: The electronic device downsamples the image information to a first drawing board without changing the drawing board during the image drawing downsampling process to obtain a first image.
[0102] The action of not changing the canvas during the image drawing downsampling process can be understood as: during the image drawing downsampling process, the image information is directly downsampled to the first canvas, and does not go through other canvases for transition. Exemplarily, the image information includes 960*1440 pixels, and the first canvas includes 512*1024 pixels, then the electronic device directly maps the 960*1440 pixels of the image information to the 512*1024 pixels of the first canvas.
[0103] For details, see S602. Figure 5 Step ④ shown in the figure will not be repeated here.
[0104] In a specific implementation manner, S602 may include: S6021 and S6022. S6021 and S6022 may specifically be:
[0105] S6021: The electronic device may establish a mapping relationship between each pixel of the image information and each pixel of the first drawing board.
[0106] Specifically, the electronic device determines the mapping relationship between each pixel in the image information and each pixel in the first drawing board according to the position information of each pixel and the position information of each pixel in the first drawing board.
[0107] For example, Figure 7 is a schematic diagram of mapping each pixel in the image information to each pixel in the first drawing board. Figure 7As shown, the 960*1440 pixels in the image information may include: a pixel, b pixel, c pixel, d pixel, e pixel, f pixel, etc. The 512*1024 pixels in the first drawing board may include: A pixel, B pixel and C pixel. Assume that: the coordinate range of the 960*1440 pixels in the image information is 00-11. The coordinate range of the 512*1024 pixels on the first drawing board is 00-11. Among them, the coordinates of pixel a are (0.001, 0.001), the coordinates of pixel b are (0.002, 0.002), the coordinates of pixel c are (0.003, 0.003), the coordinates of pixel d are (0.010, 0.010), the coordinates of pixel e are (0.011, 0.011), the coordinates of pixel f are (0.200, 0.200), the coordinates of pixel A are (0, 0), the coordinates of pixel B are (0.01, 0.01), and the coordinates of pixel C are (0.2, 0.2).
[0108] Then, the electronic device can obtain the following mapping relationship: if the position coordinates of pixel a, pixel b and pixel c are the same or close to pixel A, then pixel a, pixel b and pixel c are mapped to pixel A. Among them, the close coordinates of two pixels can be understood as the two pixel coordinates satisfying a preset condition, which can be a user-defined condition, such as the difference between the two pixel coordinates satisfying a threshold. Similarly, if the position coordinates of pixel d and pixel e are the same or close to pixel B, then pixel d and pixel e are mapped to pixel B. If the position coordinates of pixel f and pixel C are the same, then pixel f is mapped to pixel C.
[0109] S6022: The electronic device assigns the color value of each pixel in the image information to the corresponding pixel of the first drawing board according to the mapping relationship, thereby obtaining a first image.
[0110] In a specific implementation, the electronic device determines that multiple pixels in the image information correspond to a pixel in the first canvas according to the mapping relationship. At this time, the electronic device can determine the average value of the color values of the multiple pixels and assign the average value to the corresponding pixel on the first canvas. Continuing with the above example, the electronic device obtains the average value of the color values of pixel a, pixel b, and pixel c. The electronic device assigns the average value to pixel A. Similarly, the electronic device assigns the average value of the color values of pixel d and pixel e to pixel B.
[0111] In another specific implementation, the electronic device determines that a pixel in the image information corresponds to a pixel in the first canvas according to the mapping relationship. At this time, the electronic device can determine the color value of the pixel and assign the color value to the corresponding pixel on the first canvas. Continuing with the above example, the electronic device obtains the color value of the f pixel and assigns the color value to the C pixel.
[0112] By analogy, the electronic device can obtain the color value of each pixel in the first drawing board, and thus obtain the first image. Of course, the mapping method between each pixel in the image information and each pixel in the first drawing board is not limited to the above examples, and the embodiments of the present application do not make specific limitations.
[0113] Considering that the subsequent blur processing of the drawn image also needs to be down-sampled, therefore, in an embodiment of the present application, when starting to draw the image, the small-sized image can be drawn directly on a smaller-sized drawing board instead of drawing the small-sized image on a large-sized drawing board. In other words, the electronic device can directly down-sample the small-sized image information to a smaller-sized first drawing board. On the one hand, directly down-sampling the image information to the first drawing board does not affect the subsequent blur processing (because the subsequent blur processing also needs to be down-sampled, which is equivalent to down-sampling in advance). On the other hand, the first drawing board does not change during this process, which avoids redundant operations, shortens the duration of the image blur processing, and saves power consumption. It can be seen that this method will not affect the effect of the blur processing, but can also effectively improve the efficiency of the blur processing.
[0114] S603: The electronic device performs blur processing on the first image.
[0115] The blur processing may be understood as blurring the first image. Alternatively, the blur processing may refer to grayscale processing of each pixel of the first image.
[0116] The blurring process can be implemented by using at least one of the following blurring algorithms: Gaussian blurring algorithm, block blurring algorithm, double blurring algorithm and directional blurring algorithm, or other blurring algorithms capable of blurring can be used, which are not limited in the embodiments of the present application. In the embodiments of the present application, the electronic device uses a Gaussian blurring algorithm to blur the first image to obtain a second image.
[0117] For details, see S603. Figure 5 Step ⑤ shown in will not be repeated here.
[0118] In a specific implementation, S603 can be specifically implemented as follows: the electronic device uses a Gaussian blur algorithm to calculate the blur weight of each pixel in the first image. The electronic device determines the final gray value of each pixel in the first image according to the initial gray value and blur weight of each pixel in the first image, which is the second image.
[0119] For example, Figure 8FIG. 1 is a schematic diagram of the blur processing process of 9 pixels in the first image. Assume that the initial grayscale values of these 9 pixels are 14, 15, 16, 24, 25, 26, 34, 35 and 36. The electronic device uses the Gaussian blur algorithm to calculate the blur weights of these 9 pixels, and the blur weights of the pixels are 0.0947416, 0.118318, 0.0947416, 0.118318, 0.147761, 0.118315, 0.0947416, 0.118318 and 0.0947416. The electronic device obtains the final grayscale values of the nine pixels according to the initial grayscale values and fuzzy weights of the nine pixels, which are 1.32638, 1.77477, 1.51587, 2.83963, 3.69403, 3.07627, 3.22121, 4.14113 and 3.4107. Similarly, the electronic device can obtain the final grayscale value of each pixel in the first image, and thus obtain the second image.
[0120] S604: The electronic device upsamples the blurred first image to a second drawing board to obtain a second image. The second drawing board is different from the first drawing board, and the size of the second drawing board is consistent with the size of the display screen of the electronic device.
[0121] For details, see S604. Figure 5 Step ⑥ shown in will not be repeated here.
[0122] Among them, S604 can be specifically implemented in the following manner:
[0123] In a specific implementation, S604 may specifically be: the electronic device samples the blurred first image onto the second canvas through the action of changing the canvas during the image drawing upsampling process to obtain the second image. That is, during the image drawing upsampling process, the electronic device samples the blurred first image onto the third canvas to obtain the third image. Afterwards, the electronic device samples the third image onto the second canvas to obtain the second image. The third canvas is the transition canvas between the first canvas and the second canvas. For example, assuming that the first canvas includes 512*1024 pixels, the second canvas includes 960*1440 pixels, and the third canvas includes 1024*1536 pixels. Then, the electronic device samples the blurred first image drawn on the first canvas onto the third canvas. That is, the electronic device maps 512*1024 pixels on 1024*1536 pixels, and then maps 1024*1536 pixels on 960*1440 pixels, so as to display the corresponding image on a display screen of 960*1440 pixels.
[0124] In the embodiment of the present application, although the upsampling process undergoes a change process from the first canvas to the second canvas, the image information can be directly downsampled to the first canvas during the downsampling process. During this process, the first canvas does not change, thereby avoiding redundant operations, still shortening the duration of the image blurring process, and saving power consumption.
[0125] In another specific implementation, S604 may specifically be: the electronic device does not change the canvas during the image drawing upsampling process, and samples the blurred first image onto the second canvas to obtain the second image. The action of not changing the canvas during the image drawing upsampling process may be understood as: during the image drawing upsampling process, the image information is directly upsampled onto the second canvas, and does not go through other canvases for transition. Exemplarily, the blurred first image includes 512*1024 pixels, and the second canvas includes 960*1440 pixels, then the electronic device directly maps the 512*1024 pixels of the blurred first image onto the 960*1440 pixels of the second canvas.
[0126] In a specific implementation manner, S604 may specifically be:
[0127] S6041: The electronic device may establish a mapping relationship between each pixel of the blurred first image and each pixel of the second drawing board.
[0128] For the specific implementation of S6041, please refer to the relevant description in the above S6021, which will not be repeated here.
[0129] S6042: The electronic device assigns the color value of each pixel in the blurred first image to the corresponding pixel of the second drawing board according to the mapping relationship, thereby obtaining a second image.
[0130] In a specific implementation, the electronic device determines that a pixel in the blurred first image corresponds to multiple pixels in the second drawing board according to the mapping relationship. At this time, the electronic device can determine the color value of the pixel and assign the color value to the corresponding multiple pixels on the second drawing board.
[0131] In another specific implementation, the electronic device determines that a pixel in the blurred first image corresponds to a pixel in the first drawing board according to the mapping relationship. At this time, the electronic device can determine the color value of the pixel and assign the color value to the corresponding pixel on the first drawing board.
[0132] In the embodiment of the present application, the electronic device can directly downsample the image information to the first drawing board during the downsampling process, and the first drawing board does not change during this process, thus avoiding redundant operations. In addition, during the upsampling process, the blurred first image can be directly upsampled to the second drawing board, and during this process, the first drawing board undergoes a change process from the first drawing board to the second drawing board, and there is no transition process of other drawing boards, thus avoiding redundant operations, further shortening the duration of image blurring, and saving power consumption.
[0133] S605: The electronic device displays a second image.
[0134] That is, the second image obtained by the electronic device can be directly displayed on the display screen of the electronic device.
[0135] For details, please refer to S605 Figure 5 Steps ⑦ and ⑧ shown in the figure will not be repeated here.
[0136] The following describes the image blurring method provided by the embodiment of the present application for different application scenarios, as follows:
[0137] Scene 1, status bar scene.
[0138] When the user follows Fig. 9 The first arrow direction on the main interface of the electronic device shown When the pull-down operation is performed, the electronic device receives the operation. At the same time, in response to the operation, the electronic device obtains the image information of the main interface. The electronic device determines the first canvas based on the image information. For example, if the image information includes 960*1440 pixels, the electronic device can determine the first canvas containing 512*1024 pixels. In the process of image drawing downsampling, the electronic device downsamples the image information to the first canvas without changing the canvas to obtain the first image. The e-book device blurs the first image. Afterwards, in the process of image drawing upsampling, the electronic device upsamples the blurred first image to the second canvas to obtain the second image without changing the canvas. For example, if the blurred first image includes 512*1024 pixels, the electronic device can upsample the blurred first image to the second canvas containing 960*1440 pixels. That is, the process of upsampling the blurred first image and displaying it on the screen. In this way, after the electronic device performs image blurring, the electronic device displays Fig.10 The interface 102 shown is the second image, and the interface is the blurred image. Optionally, the electronic device can also overlay other information on the blurred main interface, such as the current system time, notification messages received by the mobile phone, etc.
[0139] Scenario 2: Multi-tasking scenario.
[0140] Similarly, when the user follows Fig.11 The second arrow direction on the main interface of the electronic device shown When a swipe-up operation is performed, the electronic device receives the operation. At the same time, in response to the operation, the electronic device obtains the image information of the image to be blurred running in the background. The electronic device determines the first canvas based on the image information. For example, if the image information includes 960*1440 pixels, the electronic device can determine the first canvas containing 512*1024 pixels. In the process of image drawing downsampling, the electronic device downsamples the image information to the first canvas without changing the canvas to obtain the first image. The e-book device blurs the first image. Afterwards, in the process of image drawing upsampling, the electronic device upsamples the blurred first image to the second canvas to obtain the second image without changing the canvas. For example, if the blurred first image includes 512*1024 pixels, the electronic device can upsample the blurred first image to the second canvas containing 960*1440 pixels. That is, the process of upsampling the blurred first image and displaying it on the screen. In this way, after the electronic device performs image blurring, the electronic device displays Fig.12 The interface 104 shown is the second image, and is the blurred image.
[0141] In the above scenario 1 and scenario 2, the time taken for each stage in obtaining the second image by using the current image blur processing method and the image blur processing method provided by the embodiment of the present application respectively is shown in Table 1:
[0142] Table 1
[0143]
[0144] As can be seen from Table 1, the image blur processing method provided by the embodiment of the present application saves 0.25ms of time in the drawing and downsampling stages compared to the current image blur processing method, and the time saving rate is 19.26%. The time saved in the upsampling and screen-on stage is 0.21ms, and the time saving rate is 47.69%. The time saved in the entire blur processing stage is 0.46ms. The time saving rate is 18.12%. Therefore, the image blur processing method provided by the embodiment of the present application can reduce redundant operations in the downsampling and upsampling stages, thereby saving time, thereby saving the power consumption of the electronic device.
[0145] In practical applications, for example, in the process of blurring an image using the image blurring method provided by the present application, the time used in each stage can be: the time used in the image loading and preparation stage can be: 5.60ms+2.37ms; the time used in the image downsampling (i.e. drawing and downsampling) stage can be: 1.03ms; the time used in the image horizontal blurring stage can be: 399.61μs; the time used in the image vertical blurring stage can be: 400.87μs; the time used in the image upsampling (i.e. upsampling and screen) stage can be: 234.59μs. It can be seen that in the process of blurring an image, reducing redundant operations in the downsampling and upsampling stages significantly saves time, thereby saving power consumption of electronic devices.
[0146] Unless otherwise specified or there is no logical conflict, the terms and / or descriptions between the various embodiments of the present application are consistent and can be referenced to each other. The technical features in different embodiments can be combined to form new embodiments according to their internal logical relationships.
[0147] The present application also provides an electronic device for implementing any of the above methods. For example, an electronic device is provided that includes a unit (or means) for implementing each step performed by the electronic device in the above method S601-S605. Fig.13 , which is a schematic diagram of an electronic device provided in an embodiment of the present application, the electronic device 1300 may include: an acquisition module 1301, a downsampling module 1302, a fuzzy processing module 1303 and an upsampling module 1304. Among them,
[0148] The acquisition module 1301 is used to obtain the image information and the first drawing board of the image to be blurred in response to receiving the first operation. Exemplarily, the acquisition module 1301 may execute the above step S601. The acquisition module 1301 may be Figure 3 The processor 210 shown in .
[0149] The downsampling module 1302 is used to downsample the image information to the first drawing board without changing the drawing board during the image drawing downsampling process to obtain the first image. Exemplarily, the downsampling module 1302 can execute the above step S602. The downsampling module 1302 can be Figure 3 The processor 210 shown in .
[0150] The blur processing module 1303 is used to perform blur processing on the first image. Exemplarily, the blur processing module 1303 can execute the above step S603. The blur processing module 1303 can be Figure 3 The processor 210 shown in .
[0151] The upsampling module 1304 is used to upsample the blurred first image to a second drawing board to obtain a second image. The second drawing board is different from the first drawing board, and the size of the second drawing board is consistent with the size of the display screen of the electronic device. Exemplarily, the upsampling module 1304 can perform the above step S604. The upsampling module 1304 can be Figure 3 The processor 210 shown in .
[0152] In one embodiment, the acquisition module 1301 is used to: determine a first artboard according to the image information; the number of pixels corresponding to the first artboard is less than the number of pixels included in the image. Exemplarily, the acquisition module 1301 may perform the above steps S6011-S6012.
[0153] In one embodiment, the upsampling module 1304 is used to: during the upsampling process of image rendering, upsample the blurred first image to the second drawing board without changing the drawing board to obtain the second image.
[0154] In one embodiment, the upsampling module 1304 is used to: during the image drawing upsampling process, upsample the first image to a third drawing board through the action of changing the drawing board to obtain a third image; and display the third image on the second drawing board to obtain a second image.
[0155] In one embodiment, the image information includes position information of each pixel; the downsampling module 1302 is used to: determine the mapping relationship between each pixel in the image information and each pixel corresponding to the first drawing board according to the position information of each pixel and the position information of each pixel in the first drawing board; and draw the image information on the first drawing board according to the mapping relationship to obtain the first image. Exemplarily, the downsampling module 1302 can perform the above steps S6021-S6022.
[0156] In one embodiment, the number of pixels corresponding to the first drawing board is less than the number of pixels included in the image and is an integer power of 2.
[0157] In one embodiment, the first operation includes a sliding operation input at the top of the screen; the second image is the blurred main interface; after obtaining the second image, it also includes: a display module 1305, which is used to display the first interface, and the blurred main interface is presented in the first interface.
[0158] In one embodiment, the first operation also includes a swipe up operation; the second image is a blurred interface of at least one application; after obtaining the second image, it also includes: a display module 1305, which is used to display a second interface, and the blurred interface of at least one application is presented in the second interface.
[0159] In an embodiment of the present application, an electronic device receives a first operation, and in response to the first operation, obtains image information of an image to be blurred. The image information may include pixels of an interface of an application. The electronic device determines a first drawing board according to the image information. In the process of image drawing downsampling, the electronic device does not undergo a drawing board change action, and downsamples the image information to the first drawing board to obtain a first image. In this way, the electronic device can directly downsample the image information to the first drawing board, and the first drawing board does not change during this process, thereby avoiding redundant operations. In addition, the electronic device performs blur processing on the first image to obtain a second image. In the process of image drawing upsampling, the electronic device does not undergo a drawing board change action, and upsamples the second image to the second drawing board to obtain a third image, the second drawing board is different from the first drawing board, and the size of the second drawing board is consistent with the size of the display screen of the electronic device. The electronic device displays the third image. In this way, the electronic device can directly upsample the second image to the second drawing board, and in this process, the change process from the first drawing board to the second drawing board is experienced, and there is no transition process of other drawing boards, thereby avoiding redundant operations, shortening the duration of image blur processing, and saving power consumption of the electronic device.
[0160] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0161] An embodiment of the present application also provides a computer-readable storage medium, including instructions, which, when executed on a computer, enable the computer to execute any of the above methods.
[0162] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute any of the above methods.
[0163] An embodiment of the present application also provides a chip, which includes a processor and an interface circuit, the interface circuit is coupled to the processor, the processor is used to run a computer program or instruction to implement the above method, and the interface circuit is used to communicate with other modules outside the chip.
[0164] All or part of any features or steps of the embodiments of the present application can be freely combined, and the combined technical solutions are also within the scope of the present application.
[0165] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different.
[0166] In the description of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0167] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0168] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0169] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0170] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0171] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0172] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for blurring an image, characterized in that: The method comprises: In response to receiving the first operation, acquiring image information of the image to be blurred and a first drawing board; In the process of image drawing and downsampling, the image information is downsampled to the first drawing board without changing the drawing board to obtain a first image; Performing blur processing on the first image; The blurred first image is upsampled to a second drawing board to obtain a second image. The second drawing board is different from the first drawing board, and the size of the second drawing board is consistent with the size of the display screen of the electronic device.
2. The method according to claim 1, characterized in that Get the first artboard, including: The first artboard is determined according to the image information; the number of pixels corresponding to the first artboard is smaller than the number of pixels included in the image.
3. The method according to claim 1 or 2, characterized in that: Upsampling the blurred first image onto a second drawing board to obtain a second image includes: In the process of image rendering upsampling, the blurred first image is upsampled to the second drawing board without changing the drawing board to obtain the second image.
4. The method according to any one of claims 1 to 3, characterized in that Upsampling the blurred first image onto a second drawing board to obtain a second image includes: In the process of upsampling the image drawing, the first image is upsampled to a third drawing board through a drawing board change action to obtain a third image; The third image is displayed on the second drawing board to obtain the second image.
5. The method according to any one of claims 1 to 4, characterized in that The image information includes position information of each pixel; Downsampling the image information onto the first drawing board to obtain a first image includes: Determine, according to the position information of each pixel and the position information of each pixel in the first drawing board, a mapping relationship between each pixel in the image information and each pixel corresponding to the first drawing board; According to the mapping relationship, the image information is drawn on the first drawing board to obtain the first image.
6. The method according to any one of claims 1 to 5, characterized in that The number of pixels corresponding to the first drawing board is less than the number of pixels included in the image and is an integer power of 2.
7. The method according to any one of claims 1 to 6, characterized in that The first operation includes a sliding operation input at the top of the screen; the second image is a blurred main interface; After obtaining the second image, the method further includes: A first interface is displayed, wherein the blurred main interface is presented in the first interface.
8. The method according to any one of claims 1 to 6, characterized in that The first operation further includes a sliding operation; the second image is a blurred interface of at least one application; After obtaining the second image, the method further includes: A second interface is displayed, in which a blurred interface of at least one application is presented.
9. An electronic device, characterized in that: The electronic device comprises: An acquisition module, configured to acquire image information of an image to be blurred and a first drawing board in response to receiving a first operation; A downsampling module, configured to downsample the image information to the first drawing board without changing the drawing board during the downsampling process of image drawing, so as to obtain a first image; A blur processing module, used for blurring the first image; The upsampling module is used to upsample the blurred first image to a second drawing board to obtain a second image. The second drawing board is different from the first drawing board, and the size of the second drawing board is consistent with the size of the display screen of the electronic device.
10. The electronic device according to claim 9, characterized in that: The acquisition module is used for: The first artboard is determined according to the image information; the number of pixels corresponding to the first artboard is smaller than the number of pixels included in the image.
11. The electronic device according to claim 9 or 10, characterized in that: The up-sampling module is used for: In the process of image rendering upsampling, the blurred first image is upsampled to the second drawing board without changing the drawing board to obtain the second image.
12. The electronic device according to any one of claims 9 to 11, characterized in that: The up-sampling module is used for: In the process of upsampling the image drawing, the first image is upsampled to a third drawing board through a drawing board change action to obtain a third image; The third image is displayed on the second drawing board to obtain the second image.
13. The electronic device according to any one of claims 9 to 12, characterized in that: The image information includes position information of each pixel; the downsampling module is used for: Determine, according to the position information of each pixel and the position information of each pixel in the first drawing board, a mapping relationship between each pixel in the image information and each pixel corresponding to the first drawing board; According to the mapping relationship, the image information is drawn on the first drawing board to obtain the first image.
14. The electronic device according to any one of claims 9 to 13, characterized in that: The number of pixels corresponding to the first drawing board is less than the number of pixels included in the image and is an integer power of 2.
15. The electronic device according to any one of claims 9 to 14, characterized in that: The first operation includes a sliding operation input at the top of the screen; the second image is a blurred main interface; After obtaining the second image, the method further includes: The display module is used to display a first interface, in which the blurred main interface is presented.
16. The electronic device according to any one of claims 9 to 14, characterized in that: The first operation further includes a sliding operation; the second image is a blurred interface of at least one application; After obtaining the second image, the method further includes: The display module is used to display a second interface, in which the interface of at least one application is blurred.
17. An electronic device, characterized in that: The electronic device comprises: one or more processors; and a memory, wherein codes are stored in the memory; when the codes are executed by the processor, the electronic device executes the method according to any one of claims 1 to 8.
18. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 8.