Image fuzzy processing method and device, equipment and storage medium
By responding to user touch signals, determining the center position and area range of the fuzzy, combined with Gaussian fuzzy calculation function in parallel, the real-time Gaussian fuzzy performance problem during wallpaper rendering is solved, real-time rendering and perfect fusion effect of sliding wallpaper is achieved, and the user experience is improved .
Patent Information
- Application Number
- CN202411207468.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-20
AI Technical Summary
The existing technology cannot meet the real-time Gaussian blur performance requirements when rendering wallpapers, resulting in the inability to achieve the perfect fusion effect when sliding wallpapers.
By responding to the user's touch signal, the center position of the blur effect and the corresponding blur area range are determined, and each pixel point of the image texture is calculated in parallel using the Gaussian blur calculation function, combined with the preset Gaussian kernel for weighted accumulation, and the blur is dynamically adjusted to achieve Efficient dynamic Gaussian blur effect.
It realizes real-time rendering of Gaussian blur effect during sliding, significantly improving user experience and visual fluency, and meeting the requirements of wallpaper rendering performance.
Smart Images

Figure CN119169150A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image blur processing method, device, equipment and storage medium. Background Art
[0002] With the continuous development of mobile operating systems, users have an increasing demand for personalized and beautiful interfaces. Rendering wallpapers can enhance the aesthetics of the user interface and provide a more immersive visual experience.
[0003] When sliding the wallpaper, it is necessary to perform Gaussian blur processing on the wallpaper image in some areas, and it is necessary to ensure that the pattern after real-time Gaussian blur can be perfectly integrated with the wallpaper. However, the current Gaussian blur has a performance bottleneck and cannot meet the real-time rendering requirements.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide an image blur processing method, device, equipment and storage medium, aiming to solve the technical problem of high requirements for wallpaper rendering performance.
[0006] To achieve the above object, the present application proposes a method for blurring an image, the method comprising:
[0007] Respond to user's touch signal;
[0008] determining a center position of a blur effect based on the touch signal;
[0009] Determine the corresponding blur area range based on the center position of the blur effect;
[0010] Gaussian blur is performed on the image to be processed based on the blurred area range to obtain a target image.
[0011] In one embodiment, the step of determining the center position of the blur effect based on the touch signal comprises:
[0012] Acquire screen resolution, image resolution and screen coordinates of touch points based on the touch signal;
[0013] The center position of the blur effect is determined based on the screen resolution, the image resolution and the screen coordinates of the touch point.
[0014] In one embodiment, the step of determining the corresponding blurred area range based on the center position of the blur effect includes:
[0015] Obtaining a blur radius, and determining a blur region boundary based on the blur radius and a center position of the blur effect;
[0016] The corresponding fuzzy area range is determined based on the fuzzy area boundary, so as to crop the portion exceeding the fuzzy area range.
[0017] In one embodiment, the step of performing Gaussian blur on the image to be processed based on the blurred area range to obtain the target image includes:
[0018] Acquire the image texture of the image to be processed;
[0019] The blurred area range, image texture and preset Gaussian kernel weight are input into a Gaussian blur calculation function to obtain a target image.
[0020] In one embodiment, the step of inputting the blurred area range, image texture and preset Gaussian kernel weight into a Gaussian blur calculation function to obtain a target image further includes:
[0021] Calculate each pixel point of the image texture in parallel by using a Gaussian blur calculation function;
[0022] Performing weighted accumulation on the pixel points through the preset Gaussian kernel to obtain a fuzzy color value;
[0023] The blurred color value is outputted through a shader to obtain a target image.
[0024] In one embodiment, the step of inputting the blurred area range, image texture and preset Gaussian kernel weight into a Gaussian blur calculation function to obtain a target image further includes:
[0025] Get the blurriness;
[0026] The blur processing speed of the Gaussian blur calculation function is adjusted based on the blur degree.
[0027] In one embodiment, after the step of obtaining the target image, the method further includes:
[0028] The target image is updated to the wallpaper display area, and the target image is displayed in real time.
[0029] In addition, to achieve the above-mentioned purpose, the present application also proposes a blur processing device for an image, the device comprising:
[0030] A signal acquisition module, used to respond to a touch signal from a user;
[0031] A signal analysis module, configured to determine a center position of a blur effect based on the touch signal;
[0032] A processing module, used for determining a corresponding blur area range based on a center position of the blur effect;
[0033] The Gaussian blur module is used to perform Gaussian blur on the image to be processed based on the blurred area range to obtain a target image.
[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a blur processing device for an image, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the blur processing method for an image as described above.
[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the image blur processing method described above are implemented.
[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the image blur processing method described above are implemented.
[0037] One or more technical solutions proposed in this application have at least the following technical effects:
[0038] Respond to a user's touch signal; determine the center position of the blur effect based on the touch signal; determine the corresponding blur area range based on the center position of the blur effect; perform Gaussian blur on the image to be processed based on the blur area range to obtain a target image, thereby achieving an efficient dynamic Gaussian blur effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0041] Figure 1 A schematic diagram of a process flow provided for the first embodiment of the image blur processing method of the present application;
[0042] Figure 2 A flowchart of the first embodiment of the image blur processing method of the present application;
[0043] Figure 3 A schematic diagram of a flow chart provided for the second embodiment of the image blur processing method of the present application;
[0044] Figure 4 A flowchart diagram of the third embodiment of the image blur processing method of the present application;
[0045] Figure 5 This is a schematic diagram of the module structure of the image blur processing device according to the embodiment of the present application;
[0046] Figure 6 Schematic diagram of the device structure of the hardware operating environment involved in the image blur processing method in the embodiment of the present application.
[0047] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0048] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0049] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0050] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, an image blur processing device, etc. The following takes the image blur processing device as an example to illustrate this embodiment and the following embodiments.
[0051] Based on this, the present application embodiment provides a method for blurring an image. Figure 1 , Figure 1 This is a flow chart of the first embodiment of the image blur processing method of the present application.
[0052] In this embodiment, the image blur processing method includes steps S10 to S30:
[0053] Step S10, responding to a touch signal from a user;
[0054] It should be noted that the user touching the screen is the starting point of the entire process, and the system will capture the touch event, that is, the touch signal, including the position and touch type (for example, sliding or clicking).
[0055] like Figure 2As shown, the current Gaussian blur implementation is concentrated on the CPU, which has performance bottlenecks and cannot meet the needs of real-time rendering. When receiving user touch input, this application obtains the touch position through the Android UI and sends it to the NDK layer, and then updates the blur center and radius to the Android UI through the NDK layer; calls the OpenGL rendering function to the NDK layer through the Android UI, applies Gaussian blur to the processed image of the Android UI, and updates the wallpaper display after the blur is completed.
[0056] It should be noted that Android UI is the user interface, which can manage resources and user interaction; the NDK (Native Development Kit) layer is part of the Android platform, which allows developers to write code in C or C++ in their applications to improve performance or use underlying system functions to process images; OpenGL (Open Graphics Library) is a cross-language, cross-platform graphics API for rendering 2D and 3D vector graphics.
[0057] Step S20, determining the center position of the blur effect based on the touch signal;
[0058] It should be noted that the center position of a blur effect (such as Gaussian blur or radial blur) refers to the center point of the image where the blur effect is applied. This center point usually determines the range and intensity of the blur.
[0059] Step S30, determining the corresponding blur area range based on the center position of the blur effect;
[0060] It should be noted that the blurred area range refers to the affected area range when the blur effect is applied. These areas can be part of an image or scene or a specific area.
[0061] Step S40, performing Gaussian blur on the image to be processed based on the blurred area range to obtain a target image.
[0062] It should be noted that the target image is the image after Gaussian blur; Gaussian blur is to process the image and apply the Gaussian blur effect according to the blur center in the OpenGL fragment shader.
[0063] Furthermore, after step S40, the method further includes:
[0064] The target image is updated to the wallpaper display area, and the target image is displayed in real time.
[0065] In the specific implementation, after the rendering is completed, the processed image is updated to the wallpaper display area, and the user can see the real-time update effect. At this time, the system completes the update of the wallpaper and is ready to accept the next user input.
[0066] The present embodiment provides a method for blurring an image, which responds to a user's touch signal; determines the center position of the blur effect based on the touch signal; determines the corresponding blur area range based on the center position of the blur effect; performs Gaussian blur on the image to be processed based on the blur area range to obtain a target image, thereby achieving an efficient dynamic Gaussian blur effect, being able to render in real time during the sliding process, and significantly improving the user experience of the application, ensuring a smooth visual effect.
[0067] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , step S20 and step S30, the image blur processing method further includes steps S201 to S204:
[0068] Step S201, obtaining screen resolution, image resolution and screen coordinates of the touch point based on the touch signal;
[0069] It should be noted that after capturing the touch event and passing the information to the NDK layer, the system uses this information to determine the specific parameters of the blur effect. The conversion of touch coordinates to the image coordinate system is based on the ratio of the screen to the image resolution.
[0070] It should be understood that screen resolution refers to the number of pixels that can be displayed on a display device (such as a mobile phone, tablet computer, monitor, etc.), expressed as horizontal pixels × vertical pixels, for example, 1920 × 1080 (i.e., Full HD).
[0071] Image resolution refers to the size of the image, that is, the number of pixels in the width and height of the image.
[0072] When a user performs a touch operation on the touch screen, the system detects the coordinates of the touch point. The upper left corner of the screen is the origin (0,0), the horizontal right is the positive direction of the x-axis, and the vertical downward is the positive direction of the y-axis.
[0073] Step S202: determining the center position of the blur effect based on the screen resolution, the image resolution and the screen coordinates of the touch point.
[0074] It should be noted that, assuming that the screen resolution is Wscreen×Hscreen, the image resolution is Wimage×Himage, and the screen coordinates of the touch point are (xtouch, ytouch), then the image coordinates of the blur center are (xcenter, ycenter), where Wscreen is the width of the screen, indicating the number of pixels in the horizontal direction of the screen; Hscreen is the height of the screen, indicating the number of pixels in the vertical direction of the screen. When Wscreen×Hscreen, it indicates the total number of pixels on the screen, that is, the total number of pixels that the screen can display. This product is often used to calculate the resolution of the screen. The higher the resolution, the clearer the image on the screen.
[0075] Wimage is the width of the image, which refers to the number of pixels in the horizontal direction of the image. Himage is the height of the image, which refers to the number of pixels in the vertical direction of the image. Wimage×Himage represents the product of the width and height of the image.
[0076] xtouch is the position of the touch point on the horizontal screen (x-axis), and its value starts from 0 at the leftmost side of the screen and increases as the position moves to the right. ytouch is the position of the touch point on the vertical screen (y-axis), and its value starts from 0 at the top of the screen and increases as the position moves downward.
[0077] xcenter is the position of the image coordinates of the blur center on the horizontal direction (x-axis) of the screen, and ycenter is the position of the image coordinates of the blur center on the vertical direction (y-axis) of the screen.
[0078] It can be calculated by the following formula:
[0079] xcenter=xtouch*Wimage / Wscreen,ycenter=ytouch*Himage / Hscreen.
[0080] Step S203, obtaining a blur radius, and determining a blur region boundary based on the blur radius and a center position of the blur effect;
[0081] It should be noted that after determining the center position of the blur effect, the next step is to calculate the range of the blurred area centered on the center. This calculation needs to be determined not only based on the size of the blur radius, but also based on the actual size of the image and the actual needs of the user.
[0082] It should be understood that the blur radius determines the blur range from the center point outward. With the blur center (xcenter, ycenter)(xcenter, ycenter) as the center, the boundary of the blur area can be calculated in combination with the blur radius rblurrblur.
[0083] Step S204, determining the corresponding fuzzy area range based on the fuzzy area boundary, so as to crop the portion exceeding the fuzzy area range.
[0084] It should be noted that the fuzzy area can be a circular area with a radius of rblurrblur, or a square area with a side length of 2rblur2rblur. The specific shape depends on the fuzzy algorithm and design intention.
[0085] It should be understood that near the edge of the image, the blurred area may exceed the image boundary; in this case, the excess part needs to be cropped or specially processed to avoid calculation errors.
[0086] In the specific implementation, the distance between the current fragment coordinates and the blur center (expressed in dx and dy respectively) is checked to decide whether to apply the blur effect. This ensures that only pixels within the area defined by the blur radius are blurred, while the rest of the pixels remain as they are.
[0087] The present embodiment provides a method for blurring an image, which obtains the screen resolution, the image resolution and the screen coordinates of the touch point based on the touch signal to determine the center position of the blur effect, and then determines the blur area boundary based on the blur radius and the center position of the blur effect, and further determines the corresponding blur area range based on the blur area boundary, and processes the image outside the blur area range, which can adapt to different display devices and resolutions to ensure that the image can maintain good visual effects on different devices.
[0088] Based on the first and second embodiments of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be described in detail later. Figure 4 , step S30, including steps S401-S402:
[0089] Step S401, obtaining the image texture of the image to be processed;
[0090] It should be noted that image texture is an important feature that describes the color and light intensity distribution of small areas in the image, reflecting the properties of the object itself.
[0091] Step S402, inputting the blurred area range, image texture and preset Gaussian kernel weight into a Gaussian blur calculation function to obtain a target image.
[0092] It should be noted that the Gaussian blur calculation function is the gaussianBlur function, which convolves the image according to the Gaussian function to achieve a blurring effect. This blurring technique can reduce the noise of the image while achieving a smooth transition while maintaining edge information.
[0093] Furthermore, the step S402 includes:
[0094] The Gaussian blur calculation function is used to parallelly calculate each pixel of the image texture;
[0095] The pixel points are weighted and accumulated by the preset Gaussian kernel to obtain the fuzzy color value;
[0096] The blurred color value is output through the shader to obtain the target image.
[0097] It should be noted that, according to the required blur radius and standard deviation, a Gaussian kernel matrix with an odd size is created, and it is ensured that most of the Gaussian distribution is included. The Gaussian kernel weights each pixel in the image, and its weight is determined by the Gaussian function; for each pixel in the target image, it is weighted and accumulated using the Gaussian kernel. This means that the blurred color value of each pixel is the result of the weighted average of its neighboring pixels; since the calculation of each pixel can be performed independently, parallel computing technology (such as GPU acceleration) can be used to accelerate this process. On the GPU, a thread can be assigned to each pixel, and the blurred values of multiple pixels can be calculated at the same time; the blurred color values of the pixels are processed using shaders, which are programs running on the GPU and can perform various processing on the image; after Gaussian blur processing, the calculated blurred color values are output to the corresponding pixels of the target image, so that each pixel of the original image is replaced by its blurred color value, thereby achieving an overall blur effect.
[0098] In the specific implementation, at the shader level of OpenGL, the expected effect is achieved by dynamically adjusting and applying the Gaussian blur algorithm. Here, GLSL is used to write the fragment shader code, which mainly includes defining variables such as input image texture, blur center coordinates and blur radius, and implementing the gaussianBlur function to perform Gaussian blur.
[0099] Furthermore, the fuzziness is obtained;
[0100] Adjusts the blurring speed of the Gaussian blur calculation function based on the blurriness.
[0101] It should be noted that the blur degree (or blur strength) determines the speed at which the blur effect gradually changes from the center to the edge.
[0102] It should be understood that this strategy can dynamically adjust and calculate blur parameters, such as blur radius, based on the user's touch actions, which is the key to achieving high-quality dynamic blur effects. The blur radius can be adjusted in real time according to the characteristics of the user's operation (for example, sliding speed and distance).
[0103] This embodiment provides a method for blurring an image. This strategy uses a shader to calculate the final blurred pixel color based on the input texture coordinates and blur parameters. To achieve better performance, this process fully utilizes the parallel processing capabilities of the GPU. This method can ensure real-time rendering of blur effects on images of various sizes, thereby significantly improving the user experience.
[0104] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the image blur processing method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0105] This application also provides an image blur processing device, please refer to Figure 5 , the image blur processing device comprises:
[0106] A signal acquisition module 10, used to respond to a touch signal from a user;
[0107] A signal analysis module 20, configured to determine a center position of a blur effect based on a touch signal;
[0108] A processing module 30, configured to determine a corresponding blur region range based on a center position of a blur effect;
[0109] The Gaussian blur module 40 is used to perform Gaussian blur on the image to be processed based on the blurred area range to obtain a target image.
[0110] The image blur processing device provided by the present application adopts the image blur processing method in the above embodiment, which can solve the technical problem of high requirements for wallpaper rendering performance. Compared with the prior art, the beneficial effects of the image blur processing device provided by the present application are the same as the beneficial effects of the image blur processing method provided by the above embodiment, and other technical features in the image blur processing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0111] The present application provides an image blur processing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image blur processing method in the above-mentioned embodiment 1.
[0112] Reference below Figure 6, which shows a schematic diagram of the structure of a blur processing device for images suitable for implementing the embodiments of the present application. The blur processing device for images in the embodiments of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The image blur processing device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0113] like Figure 6 As shown, the image blur processing device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the image blur processing device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the image blurring device to communicate with other devices wirelessly or by wire to exchange data. Although the image blurring device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0114] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0115] The image blur processing device provided by the present application adopts the image blur processing method in the above embodiment, which can solve the technical problem of high requirements for wallpaper rendering performance. Compared with the prior art, the beneficial effects of the image blur processing device provided by the present application are the same as the beneficial effects of the image blur processing method provided by the above embodiment, and other technical features in the image blur processing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0116] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0117] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0118] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the image blur processing method in the above-mentioned embodiment.
[0119] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0120] The computer-readable storage medium may be included in the image blur processing device; or may exist independently without being assembled into the image blur processing device.
[0121] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the image blur processing device, the image blur processing device: responds to the user's touch signal; determines the center position of the blur effect based on the touch signal; determines the corresponding blur area range based on the center position of the blur effect; and performs Gaussian blur on the image to be processed based on the blur area range to obtain the target image.
[0122] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0123] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0124] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0125] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned image blur processing method, and can solve the technical problem of high requirements for wallpaper rendering performance. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the image blur processing method provided in the above-mentioned embodiment, and will not be elaborated here.
[0126] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned image blur processing method when executed by a processor.
[0127] The computer program product provided by this application can solve the technical problem of high requirements for wallpaper rendering performance. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the image blur processing method provided by the above embodiment, which will not be repeated here.
[0128] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for blurring an image, characterized in that: The image blur processing method comprises: Respond to user's touch signal; determining a center position of a blur effect based on the touch signal; Determine the corresponding blur area range based on the center position of the blur effect; Gaussian blur is performed on the image to be processed based on the blurred area range to obtain a target image.
2. The image blur processing method according to claim 1, characterized in that: The step of determining the center position of the blur effect based on the touch signal comprises: Acquire screen resolution, image resolution and screen coordinates of touch points based on the touch signal; The center position of the blur effect is determined based on the screen resolution, the image resolution and the screen coordinates of the touch point.
3. The image blur processing method according to claim 1, characterized in that: The step of determining the corresponding blur area range based on the center position of the blur effect comprises: Obtaining a blur radius, and determining a blur region boundary based on the blur radius and a center position of the blur effect; The corresponding fuzzy area range is determined based on the fuzzy area boundary, so as to crop the portion exceeding the fuzzy area range.
4. The image blur processing method according to claim 1, characterized in that: The step of performing Gaussian blurring on the image to be processed based on the blurred area range to obtain a target image comprises: Acquire the image texture of the image to be processed; The blurred area range, image texture and preset Gaussian kernel weight are input into a Gaussian blur calculation function to obtain a target image.
5. The image blur processing method according to claim 4, characterized in that: The step of inputting the blurred area range, image texture and preset Gaussian kernel weight into a Gaussian blur calculation function to obtain a target image also includes: Calculate each pixel point of the image texture in parallel by using a Gaussian blur calculation function; Performing weighted accumulation on the pixel points through the preset Gaussian kernel to obtain a fuzzy color value; The blurred color value is outputted through a shader to obtain a target image.
6. The image blur processing method according to claim 4, characterized in that: The step of inputting the blurred area range, image texture and preset Gaussian kernel weight into a Gaussian blur calculation function to obtain a target image also includes: Get the blurriness; The blur processing speed of the Gaussian blur calculation function is adjusted based on the blur degree.
7. The image blur processing method according to claim 1, characterized in that: After the step of obtaining the target image, the method further includes: The target image is updated to the wallpaper display area, and the target image is displayed in real time.
8. A device for blurring an image, characterized in that: The device comprises: A signal acquisition module, used to respond to a touch signal from a user; A signal analysis module, configured to determine a center position of a blur effect based on the touch signal; A processing module, used for determining a corresponding blur area range based on a center position of the blur effect; The Gaussian blur module is used to perform Gaussian blur on the image to be processed based on the blurred area range to obtain a target image.
9. A device for blurring an image, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the image blur processing method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the image blur processing method according to any one of claims 1 to 7 are implemented.
