A progressive image blurring processing method, system, terminal and storage medium

CN122820486APending Publication Date: 2026-09-25SHENZHEN COOCAA NETWORK TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611228640.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-13
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0009]本发明的主要目的在于提供一种渐进式图像模糊处理方法、系统、终端及计算机可读存储介质,旨在解决现有渐进式模糊处理方法在方向表达、模糊尺度的自适应性、计算效率、设备适配以及参数灵活性方面均存在明显不足的问题

Benefits of technology

[0020]本发明中,获取待处理图像和二维控制线,对所述待处理图像中任一像素点,计算任一像素点在所述二维控制线方向上的投影进度;对所述投影进度进行区间限制和曲线映射,得到模糊强度图,根据所述模糊强度图确定有效模糊区域,并将所述有效模糊区域扩展为安全区域;选择执行后端,在所述安全区域内生成多层模糊图,根据层索引和权重在所述有效模糊区域内混合相邻模糊层,输出渐进式模糊图像。本发明通过二维控制线投影生成模糊强度图,实现了任意方向、任意控制点位置的渐进式模糊表达,同时基于强度图自动划定有效模糊区域并安全扩展,大幅减少整图逐层模糊的计算浪费,最大模糊半径由控制线长度动态确定,保证了不同尺寸图像下的视觉一致性,结合异构后端自适应选择,可根据设备能力和计算规模在CPU、CUDA、MPS等后端间灵活切换,兼顾了开发便利、部署效率和硬件兼容性,显著提升了图像处理的质量、性能和适用范围。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122820486A_ABST
    Figure CN122820486A_ABST
Patent Text Reader

Abstract

The application discloses a kind of progressive image blur processing method, system, terminal and storage medium, the method includes: obtaining image to be processed and two-dimensional control line, to any pixel point in the image to be processed, the projection progress of any pixel point in the direction of two-dimensional control line is calculated;Interval limit and curve mapping are carried out to the projection progress, obtain blur intensity map, determine effective blur area according to the blur intensity map, and expand the effective blur area into safety area;Select execution back end, generate multiple blur maps in the safety area, mix adjacent blur layers in the effective blur area according to layer index and weight, and output progressive blur image.The application generates blur intensity map by two-dimensional control line projection, realizes the progressive blur expression of any direction, any control point position, simultaneously based on intensity map automatically demarcates effective blur area and safely expands, greatly reduces the calculation waste of whole image layer by layer blur.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a progressive image blurring method, system, terminal, and computer-readable storage medium. Background Technology

[0002] Progressive blur is a commonly used and important visual effect in image editing, poster making, video cover generation, and various design tools. It can effectively guide the visual focus, simulate depth of field, or create an artistic atmosphere through a continuous transition from a clear area to a blurred area. It is widely used in scenarios such as blurring the background of portraits, highlighting the focus of product posters, and dynamic rendering of video covers.

[0003] Currently, the main engineering implementation methods for progressive blurring fall into the following categories: First, based on a fixed-direction mask, each pixel is blurred with a corresponding radius according to the mask weight; second, the user specifies control lines or control points, and the entire image is subjected to one or more Gaussian blurs with different radii, then the blurred result is weighted and mixed with the original image using a mask; third, an image pyramid is constructed for multi-scale decomposition and fusion to achieve a larger radius blurring effect. However, the above solutions still have the following shortcomings in practical implementation: (1) Insufficient directional expression capability. Most existing implementations limit the gradient direction to horizontal, vertical, or a few preset angles, making it difficult for users to define the transition direction between clear and blurred areas at arbitrary angles. When the endpoints of the control lines are outside the effective area of ​​the image, existing algorithms lack reasonable boundary processing strategies, often directly truncating or producing unpredictable transition effects, thus limiting the flexibility of creation.

[0004] (2) Lack of adaptability in blur scale. Existing implementations typically set the maximum blur radius to a fixed pixel value or simply determine it as a certain proportion of the image width. This approach ignores the influence of the actual length of the control line on the blur transition span—a longer control line should allow for a larger blur gradient space, while a shorter one should be appropriately compressed. Due to the lack of consideration for the linkage between image size and the geometric features of the control line, the visual effect of the same parameter varies significantly on different images, often requiring designers to repeatedly adjust the parameter.

[0005] (3) Significant computational waste. Existing solutions mostly employ layer-by-layer Gaussian blurring of the entire image, performing convolution operations on the entire image regardless of whether the region needs blurring. For design scenarios where large areas remain sharp and only local blurring occurs, a large amount of computational resources are wasted on areas that do not require processing. As image resolution continues to increase, this performance bottleneck becomes increasingly prominent.

[0006] (4) Insufficient device compatibility. Different hardware devices have significantly different computing characteristics - CPUs are suitable for logic control and serial computing, NVIDIA GPUs rely on CUDA acceleration, and Apple Silicon chips leverage their advantages through MPS (Metal Performance Shaders). Existing solutions typically only support a single computing backend, making it difficult to meet the needs of various deployment scenarios such as local development and debugging, server deployment, and environments without dedicated graphics cards.

[0007] (5) The problem of fixed core parameters. In the existing implementation, parameters such as the number of Gaussian pyramid layers, boundary fill factor, blur radius sampling step size, and CPU / GPU switching threshold are mostly written in the code as constants. This approach is not conducive to adapting to the content features of different images, and it is also easy to result in the technical solution having too narrow a protection scope, allowing competitors to circumvent it by adjusting only a few parameters.

[0008] Therefore, existing technologies still need to be improved and developed. Summary of the Invention

[0009] The main objective of this invention is to provide a progressive image blurring method, system, terminal, and computer-readable storage medium, aiming to solve the problems of existing progressive blurring methods in terms of directional expression, adaptability of blur scale, computational efficiency, device compatibility, and parameter flexibility.

[0010] To achieve the above objectives, the present invention provides a progressive image blurring method, which includes the following steps: Obtain the image to be processed and the two-dimensional control line. For any pixel in the image to be processed, calculate the projection progress of any pixel in the direction of the two-dimensional control line. The projection progress is subjected to interval restriction and curve mapping to obtain a fuzzy intensity map. The effective fuzzy region is determined based on the fuzzy intensity map and the effective fuzzy region is expanded into a safe region. Select the execution backend, generate a multi-layered blur map within the safe area, and blend adjacent blur layers within the effective blur area according to the layer index and weight to output a progressively blurred image.

[0011] Optionally, the progressive image blurring method, wherein acquiring the image to be processed and the two-dimensional control lines, and calculating the projection progress of any pixel in the image to be processed along the direction of the two-dimensional control lines, specifically includes: Obtain the image to be processed I, and obtain the starting point S=(sx, sy) and ending point E=(ex, ey) of the two-dimensional control line; Map the coordinates of the starting point S and ending point E of the two-dimensional control line to pixel coordinates to obtain the pixel starting point S' and pixel ending point E', and calculate the control vector V=E'-S' and the control line length L=||V||. For any pixel P=(x, y) in the image I to be processed, calculate the projection progress t(P) of any pixel P=(x, y) in the direction of the two-dimensional control line t(P)=dot(P-S',V) / dot(V,V).

[0012] Optionally, in the progressive image blurring method, the step of limiting the projection progress by an interval and performing curve mapping to obtain a blur intensity map specifically involves: By applying interval constraints and curve mapping to the projection progress t(P), a fuzzy intensity map A(P) is obtained, A(P)=F(1-clip(t(P),0,1)), where F is a configurable monotonic smoothing function, and clip(t(P),0,1) indicates that the projection progress t(P) is restricted to the interval between 0 and 1.

[0013] Optionally, the progressive image blurring method, wherein determining the effective blur region based on the blur intensity map and expanding the effective blur region into a safe region specifically includes: The maximum fuzzy radius sigma_max is determined based on the control line length and the configurable scaling parameter, where sigma_max = L × r, and r is the configurable scaling parameter. A layer index map and an inter-layer mixing weight map are generated based on the fuzziness intensity A(P), the number of fuzziness layers M, and the curve parameters, where M is a configurable positive integer; The effective fuzzy region R_active is determined based on the fuzziness intensity A(P), where R_active = {P | A(P) > epsilon}, and epsilon is a configurable threshold. The outer rectangle of the effective fuzzy region R_active is safely extended based on the extension distance p to obtain the safe region R_safe. The extension distance p is determined by the maximum fuzzy radius sigma_max, the fuzzy kernel support radius, or a combination of the two, p=G(sigma_max), where G is a configurable function.

[0014] Optionally, in the progressive image blurring method, the step of selecting the execution backend specifically includes: Obtain the device capability D and image size C, and determine whether there is an available acceleration backend based on the device capability D and image size C; If no accelerated backend is available, select the CPU backend; If an available acceleration backend exists, calculate the acceleration benefits and switching / transmission costs. When the benefits meet the configuration strategy, select the appropriate acceleration backend.

[0015] Optionally, the progressive image blurring method, wherein generating multi-layer blur maps within the safe area, mixing adjacent blur layers within the effective blur area according to layer indices and weights, and outputting a progressively blurred image, specifically includes: On the selected execution backend, multiple blur layers B_i are generated for the safe region R_safe; Within the effective blur region R_active, interpolation is performed on adjacent blur layers based on the layer index map and the interlayer mixing weight map to generate the corresponding output pixels; The output pixels are combined with the original image pixels outside the effective blur region to obtain a progressively blurred image.

[0016] Optionally, in the progressive image blurring method, each blur layer B_i corresponds to a different blur scale parameter sigma_i, which is calculated from the maximum blur radius sigma_max, the layer index i, and the number of blur layers M.

[0017] Furthermore, to achieve the above objectives, the present invention also provides a progressive image blurring processing system, which is used to implement the progressive image blurring processing method, wherein the progressive image blurring processing system includes: The projection progress calculation module is used to acquire the image to be processed and the two-dimensional control line, and to calculate the projection progress of any pixel in the image to be processed in the direction of the two-dimensional control line. The region expansion module is used to limit the projection progress by interval and perform curve mapping to obtain a fuzzy intensity map, determine the effective fuzzy region based on the fuzzy intensity map, and expand the effective fuzzy region into a safe region. The image generation module is used to select the execution backend, generate a multi-layered blurred image within the safe area, and mix adjacent blurred layers within the effective blurred area according to the layer index and weight to output a progressively blurred image.

[0018] In addition, to achieve the above objectives, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a progressive image blurring processing program stored in the memory and executable on the processor, wherein when the progressive image blurring processing program is executed by the processor, it implements the steps of the progressive image blurring processing method as described above.

[0019] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a progressive image blurring processing program, which, when executed by a processor, implements the steps of the progressive image blurring processing method as described above.

[0020] In this invention, an image to be processed and two-dimensional control lines are acquired. For any pixel in the image to be processed, the projection progress of that pixel along the direction of the two-dimensional control lines is calculated. The projection progress is then subjected to interval restrictions and curve mapping to obtain a blur intensity map. Based on the blur intensity map, an effective blur region is determined and expanded into a safe region. An execution backend is selected, and multiple blur maps are generated within the safe region. Adjacent blur layers are mixed within the effective blur region according to the layer index and weight, resulting in a progressively blurred image. This invention generates a blur intensity map through projection of two-dimensional control lines, achieving progressive blur representation in any direction and at any control point position. Simultaneously, it automatically delineates and safely expands the effective blur region based on the intensity map, significantly reducing the computational waste of layer-by-layer blurring of the entire image. The maximum blur radius is dynamically determined by the control line length, ensuring visual consistency across images of different sizes. Combined with adaptive selection of heterogeneous backends, it allows flexible switching between backends such as CPU, CUDA, and MPS based on device capabilities and computing scale, balancing development convenience, deployment efficiency, and hardware compatibility, and significantly improving the quality, performance, and applicability of image processing. Attached Figure Description

[0021] Figure 1 This is a flowchart of a preferred embodiment of the progressive image blurring method of the present invention; Figure 2 This is a schematic diagram of the overall process of progressive blurring image processing in a preferred embodiment of the progressive image blurring processing method of the present invention; Figure 3 This is a schematic diagram of the safe region calculation and multi-layer mixing process in a preferred embodiment of the progressive image blurring method of the present invention; Figure 4 This is a schematic diagram of the heterogeneous backend adaptive selection process in a preferred embodiment of the progressive image blurring method of the present invention; Figure 5 This is a preferred embodiment of the progressive image blurring method of the present invention, which generates a self-generated grid test image. Figure 6 This is a preferred embodiment of the progressive image blurring method of the present invention, which generates a color grid test image. Figure 7 This is a structural diagram of a preferred embodiment of the progressive image blurring system of the present invention; Figure 8 This is a structural diagram of a preferred embodiment of the terminal of the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0023] The progressive image blurring method described in the preferred embodiment of the present invention, such as... Figure 1 and Figure 2 As shown, the progressive image blurring method includes the following steps: Step S10: Obtain the image to be processed and the two-dimensional control line. For any pixel in the image to be processed, calculate the projection progress of any pixel in the direction of the two-dimensional control line.

[0024] Specifically, obtain the image to be processed I, with an image size of W×H; and obtain the starting point S=(sx, sy) and ending point E=(ex, ey) of the two-dimensional control line; S and E can be represented by normalized coordinates and are allowed to be located outside the image boundary.

[0025] Among them, the two-dimensional control line is a directed line segment composed of the starting point S and the ending point E in the two-dimensional coordinate system of the image. It is used to define the direction of change of blur intensity and the transition range. The endpoints of the control line can be represented by normalized coordinates or pixel coordinates, or they can be located outside the image boundary.

[0026] Map the coordinates of the starting point S and ending point E of the two-dimensional control line to pixel coordinates to obtain the pixel starting point S' and pixel ending point E', and calculate the control vector V=E'-S' and the control line length L=||V||.

[0027] For any pixel P=(x, y) in the image I to be processed, calculate the projection progress t(P) of any pixel P=(x, y) in the direction of the two-dimensional control line t(P)=dot(P-S',V) / dot(V,V).

[0028] Step S20: Perform interval restriction and curve mapping on the projection progress to obtain a fuzzy intensity map, determine the effective fuzzy region based on the fuzzy intensity map, and expand the effective fuzzy region into a safe region.

[0029] Specifically, the projection progress t(P) is subjected to interval restriction and curve mapping to obtain the blur intensity map A(P), A(P)=F(1-clip(t(P),0,1)), where F is a configurable monotonic smoothing function, and clip(t(P),0,1) means that the projection progress t(P) is restricted to the interval between 0 and 1, taking 0 when it is less than 0, taking 1 when it is greater than 1, and keeping the original value when it is between 0 and 1. This processing is used to limit the intensity value range of pixels outside the two ends of the control line.

[0030] The maximum fuzzy radius sigma_max is determined based on the control line length and the configurable scaling parameter, where sigma_max = L × r, and r is the configurable scaling parameter. For example, Figure 2 The multi-layer blur map generation step uses the maximum blur scale sigma_max to determine the scale range of each blur layer. sigma_max can be determined based on the control line length, image size, user configuration, or a combination thereof, and is not limited to a fixed value or a fixed calculation method.

[0031] like Figure 3 As shown, a layer index map and an inter-layer mixing weight map are generated based on the fuzziness intensity A(P), the number of fuzziness layers M, and the curve parameters, where M is a configurable positive integer and is not limited to a fixed value.

[0032] The effective fuzzy region R_active is determined based on the fuzziness intensity A(P), where R_active = {P | A(P) > epsilon}, and epsilon is a configurable threshold. The outer rectangle of the effective fuzzy region R_active is safely extended based on the extension distance p to obtain the safe region R_safe. The extension distance p is determined by the maximum fuzziness radius sigma_max, the fuzzy kernel support radius, or a combination of the two, where p = G(sigma_max), and G is a configurable function.

[0033] Here, the safe region R_safe is the safe ROI, which equals the actual area to be blurred plus an outward-extending buffer area. The safe ROI is the computational region obtained by extending the effective blur region outwards, used to cover the surrounding image information needed when the blur kernel calculates pixels within the effective blur region. Figure 2 The sequence shown should be as follows: first, determine the effective fuzzy region and expand it to obtain a safe ROI; then, select the execution backend; and subsequently, generate multiple fuzzy layers B_i within the safe ROI. Each fuzzy layer corresponds to the fuzzy scale parameter sigma_i; when using Gaussian fuzzing, sigma_i can represent the Gaussian kernel standard deviation; when using other fuzzing methods, it can also correspond to the corresponding kernel size or fuzziness level parameter.

[0034] like Figure 3As shown, after thresholding based on blur intensity, the effective blur region R_active is obtained, and then it is expanded outward to obtain the safe ROI. Blur calculation is performed within the safe ROI, and inter-layer blending is performed within the effective blur region. Pixels outside the region retain the original image or are processed according to the configuration.

[0035] Step S30: Select the execution backend, generate a multi-layer blur map within the safe area, mix adjacent blur layers within the effective blur area according to the layer index and weight, and output a progressively blurred image.

[0036] Specifically, such as Figure 4 As shown, the device capability D and image size C are obtained. Based on the device capability D and image size C, it is determined whether there is an available acceleration backend. If there is no available acceleration backend, the CPU backend is selected, i.e., CPU or equivalent image processing backend. If there is an available acceleration backend, the acceleration benefits and switching and transmission costs are calculated. When the benefits meet the configuration strategy, the corresponding acceleration backend is selected, i.e., GPU, tensor computing or other acceleration backend.

[0037] This invention does not limit itself to specific software libraries and can detect CUDA, MPS, or other GPU / tensor computing devices during implementation; if a device is unavailable, it falls back to the CPU backend. For available acceleration devices, the determination can be based on ROI size, image size, historical latency, transmission cost, or business configuration. The intelligent backend selection is for speed, choosing a faster and more efficient backend based on computational load and processing cost. For example, CPU is faster for small images, while GPU acceleration is more noticeable for large images. Figure 4 As shown, the selection of a backend aims to improve processing efficiency under different device environments while maintaining consistency in processing logic and output effects. The system first determines the available computing devices, and then estimates the processing cost of different backends based on factors such as the size of the effective computing area or image, the number of blur layers, kernel size, data transmission overhead, and performance configuration. When an accelerated backend has the expected benefits, the corresponding accelerated backend is selected; otherwise, the CPU backend is selected. Specific judgment factors, combinations, and thresholds are all configurable and not limited to fixed values, as shown in Table 1.

[0038] Table 1: Correspondence Table for Adaptive Selection of Heterogeneous Backends

[0039] On the selected execution backend, multiple blur layers B_i are generated for the safe region R_safe. Within the effective blur region R_active, adjacent blur layers are interpolated according to the layer index map and the inter-layer mixing weight map to generate corresponding output pixels. The output pixels are combined with the original image pixels outside the effective blur region to obtain a progressively blurred image. Each blur layer B_i corresponds to a different blur scale parameter sigma_i, which is calculated from the maximum blur radius sigma_max, the layer index i, and the number of blur layers M.

[0040] After determining the safe ROI (R_safe) and selecting the execution backend, multiple blur layers B_i are generated for the safe ROI on the selected execution backend. Subsequently, within the effective blur region R_active, adjacent blur layers are interpolated according to the layer index and inter-layer mixing weights to generate corresponding output pixels. The output pixels are then combined with the original image pixels outside the effective blur region to obtain a progressively blurred image.

[0041] Figure 5 Input via monochrome grid ( Figure 5 In the diagram, (a) represents the input graph and the output graph. Figure 5 (b) in the figure represents a comparison of the output image, illustrating that the grid lines can transition from a strong fuzzy continuity to a clear state along the control direction. Figure 6 Input via colored grid ( Figure 6 In the diagram, (a) represents the input graph and the output graph. Figure 6 (b) in the figure represents the comparison of the output image, which further illustrates that different color channels can synchronously form a progressive blur effect without obvious color misalignment or abnormal color shift.

[0042] The technical effects that this invention can bring are as follows: First, in terms of image expressiveness and visual effects, this invention completely breaks the limitations of traditional fixed-direction gradation (such as only left and right or up and down) through a two-dimensional control line projection mechanism, and can accurately express a progressive blur transition at any angle and any start and end point; at the same time, the start and end points of the control lines can be located outside the image boundary, which can simulate the external control handle in professional design tools, greatly enriching the creative freedom; combined with configurable edge sampling methods such as mirroring, it effectively suppresses the blackening or artifact problem at the edge of the blurred area, making the transition more natural and smooth.

[0043] Secondly, in terms of computational efficiency and resource saving, this invention abandons the coarse processing method of layer-by-layer Gaussian blurring of the entire image. It automatically identifies and delineates the effective blur region through the blur intensity map, and then safely expands the region to retain the context required for kernel calculation. Finally, it generates multi-layer blur maps only within the safe ROI and performs blending within the effective region. This mechanism greatly eliminates redundant pixel calculations that do not need to participate in blurring or blending. Especially in the processing of large-size images, it can significantly reduce memory usage and computation time, and achieve accurate on-demand rendering.

[0044] Third, in terms of parameter adaptation and visual consistency, this invention dynamically correlates the maximum blur radius with factors such as control line length and image size, rather than using a fixed pixel constant, thereby ensuring that the blur scale remains visually stable and consistent under different resolution images or different control line lengths. At the same time, the number of blur layers, inter-layer sigma distribution, intensity mapping function, etc., are all configurable, avoiding parameter solidification and flexibly adapting to diverse design needs and aesthetic preferences, thus improving the algorithm's versatility and robustness.

[0045] Fourth, regarding heterogeneous hardware adaptation and engineering deployment, this invention incorporates an intelligent backend selection module that can dynamically decide whether to call GPU acceleration or fall back to CPU execution based on factors such as current device capabilities (CUDA, MPS, or pure CPU), ROI calculation scale, full map scale, and data transmission costs. This strategy can fully leverage the acceleration potential on high-performance devices to support real-time preview or batch compositing, while also ensuring stable operation in environments without acceleration. It effectively balances performance and compatibility in local development and debugging, formal online deployment, and various hardware environments, thereby lowering the barrier to engineering implementation.

[0046] Furthermore, such as Figure 7 As shown, based on the above-described progressive image blurring method, the present invention also provides a progressive image blurring system, which is used to implement the progressive image blurring method. The progressive image blurring system includes: The projection progress calculation module 51 is used to acquire the image to be processed and the two-dimensional control line, and to calculate the projection progress of any pixel in the image to be processed in the direction of the two-dimensional control line. The region expansion module 52 is used to limit the projection progress by interval and curve mapping to obtain a fuzzy intensity map, determine the effective fuzzy region based on the fuzzy intensity map, and expand the effective fuzzy region into a safe region. Image generation module 53 is used to select an execution backend, generate a multi-layer blurred image within the safe area, and mix adjacent blurred layers within the effective blurred area according to the layer index and weight to output a progressively blurred image.

[0047] Furthermore, such as Figure 8 As shown, based on the above progressive image blurring processing method and system, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 3 Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0048] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory. In other embodiments, the memory 20 may be an external storage device of the terminal, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc. Further, the memory 20 may include both internal and external storage devices. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code installed on the terminal. The memory 20 can also be used to temporarily store data that has been output or will be output. In one embodiment, the memory 20 stores a progressive image blurring process 40, which can be executed by the processor 10 to implement the progressive image blurring method of this application.

[0049] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run program code stored in the memory 20 or process data, such as executing the progressive image blurring method.

[0050] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visual user interface. The terminal's processor 10, memory 20, and display 30 communicate with each other via a system bus.

[0051] In one embodiment, when the processor 10 executes the progressive image blurring process 40 in the memory 20, the following steps are performed: Obtain the image to be processed and the two-dimensional control line. For any pixel in the image to be processed, calculate the projection progress of any pixel in the direction of the two-dimensional control line. The projection progress is subjected to interval restriction and curve mapping to obtain a fuzzy intensity map. The effective fuzzy region is determined based on the fuzzy intensity map and the effective fuzzy region is expanded into a safe region. Select the execution backend, generate a multi-layered blur map within the safe area, and blend adjacent blur layers within the effective blur area according to the layer index and weight to output a progressively blurred image.

[0052] The step of acquiring the image to be processed and the two-dimensional control line, and calculating the projection progress of any pixel in the image to be processed along the direction of the two-dimensional control line, specifically includes: Obtain the image to be processed I, and obtain the starting point S=(sx, sy) and ending point E=(ex, ey) of the two-dimensional control line; Map the coordinates of the starting point S and ending point E of the two-dimensional control line to pixel coordinates to obtain the pixel starting point S' and pixel ending point E', and calculate the control vector V=E'-S' and the control line length L=||V||. For any pixel P=(x, y) in the image I to be processed, calculate the projection progress t(P) of any pixel P=(x, y) in the direction of the two-dimensional control line t(P)=dot(P-S',V) / dot(V,V).

[0053] Specifically, the process of limiting the projection progress by intervals and mapping it to obtain a fuzzy intensity map involves: By applying interval constraints and curve mapping to the projection progress t(P), a fuzzy intensity map A(P) is obtained, A(P)=F(1-clip(t(P),0,1)), where F is a configurable monotonic smoothing function, and clip(t(P),0,1) indicates that the projection progress t(P) is restricted to the interval between 0 and 1.

[0054] Specifically, determining the effective blurred region based on the blurred intensity map and expanding the effective blurred region into a safe region includes: The maximum fuzzy radius sigma_max is determined based on the control line length and the configurable scaling parameter, where sigma_max = L × r, and r is the configurable scaling parameter. A layer index map and an inter-layer mixing weight map are generated based on the fuzziness intensity A(P), the number of fuzziness layers M, and the curve parameters, where M is a configurable positive integer; The effective fuzzy region R_active is determined based on the fuzziness intensity A(P), where R_active = {P | A(P) > epsilon}, and epsilon is a configurable threshold. The outer rectangle of the effective fuzzy region R_active is safely extended based on the extension distance p to obtain the safe region R_safe. The extension distance p is determined by the maximum fuzzy radius sigma_max, the fuzzy kernel support radius, or a combination of the two, p=G(sigma_max), where G is a configurable function.

[0055] Specifically, the selection of the execution backend includes: Obtain the device capability D and image size C, and determine whether there is an available acceleration backend based on the device capability D and image size C; If no accelerated backend is available, select the CPU backend; If an available acceleration backend exists, calculate the acceleration benefits and switching / transmission costs. When the benefits meet the configuration strategy, select the appropriate acceleration backend.

[0056] Specifically, generating a multi-layered blurred image within the safe area, mixing adjacent blurred layers within the effective blurred area according to the layer index and weight, and outputting a progressively blurred image includes: On the selected execution backend, multiple blur layers B_i are generated for the safe region R_safe; Within the effective blur region R_active, interpolation is performed on adjacent blur layers based on the layer index map and the interlayer mixing weight map to generate the corresponding output pixels; The output pixels are combined with the original image pixels outside the effective blur region to obtain a progressively blurred image.

[0057] Each fuzzy layer B_i corresponds to a different fuzzy scale parameter sigma_i, which is calculated from the maximum fuzzy radius sigma_max, the layer index i, and the number of fuzzy layers M.

[0058] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a progressive image blurring program, which, when executed by a processor, implements the steps of the progressive image blurring method as described above.

[0059] In summary, this invention provides a progressive image blurring method, system, terminal, and computer-readable storage medium. The method includes: acquiring an image to be processed and two-dimensional control lines; calculating the projection progress of any pixel in the image to be processed along the direction of the two-dimensional control lines; performing interval restriction and curve mapping on the projection progress to obtain a blur intensity map; determining an effective blur region based on the blur intensity map; expanding the effective blur region into a safe region; selecting an execution backend; generating a multi-layer blur map within the safe region; mixing adjacent blur layers within the effective blur region according to layer index and weight; and outputting a progressively blurred image. This invention generates a fuzzy intensity map through two-dimensional control line projection, achieving progressive fuzzy representation of arbitrary directions and control point positions. Simultaneously, it automatically delineates and safely expands the effective fuzzy region based on the intensity map, significantly reducing computational waste from layer-by-layer fuzzing of the entire image. The maximum fuzzy radius is dynamically determined by the control line length, ensuring visual consistency across images of different sizes. Combined with heterogeneous backend adaptive selection, it allows flexible switching between CPU, CUDA, MPS, and other backends based on device capabilities and computing scale, balancing development convenience, deployment efficiency, and hardware compatibility, significantly improving the quality, performance, and applicability of image processing.

[0060] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal that includes that element.

[0061] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.). The program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The computer-readable storage medium can be a memory, magnetic disk, optical disk, etc.

[0062] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. A progressive image blurring method, characterized in that, The progressive image blurring method includes: Obtain the image to be processed and the two-dimensional control line. For any pixel in the image to be processed, calculate the projection progress of any pixel in the direction of the two-dimensional control line. The projection progress is subjected to interval restriction and curve mapping to obtain a fuzzy intensity map. The effective fuzzy region is determined based on the fuzzy intensity map and the effective fuzzy region is expanded into a safe region. Select the execution backend, generate a multi-layered blur map within the safe area, and blend adjacent blur layers within the effective blur area according to the layer index and weight to output a progressively blurred image.

2. The progressive image blurring method according to claim 1, characterized in that, The step of acquiring the image to be processed and the two-dimensional control line, and calculating the projection progress of any pixel in the image to be processed along the direction of the two-dimensional control line, specifically includes: Obtain the image to be processed I, and obtain the starting point S=(sx, sy) and ending point E=(ex, ey) of the two-dimensional control line; Map the coordinates of the starting point S and ending point E of the two-dimensional control line to pixel coordinates to obtain the pixel starting point S' and pixel ending point E', and calculate the control vector V=E'-S' and the control line length L=||V||. For any pixel P=(x, y) in the image I to be processed, calculate the projection progress t(P) of any pixel P=(x, y) in the direction of the two-dimensional control line t(P)=dot(P-S',V) / dot(V,V).

3. The progressive image blurring method according to claim 2, characterized in that, The process of limiting the projection progress by intervals and mapping it to a curve to obtain a fuzzy intensity map is as follows: By applying interval constraints and curve mapping to the projection progress t(P), a fuzzy intensity map A(P) is obtained, A(P)=F(1-clip(t(P),0,1)), where F is a configurable monotonic smoothing function, and clip(t(P),0,1) indicates that the projection progress t(P) is restricted to the interval between 0 and 1.

4. The progressive image blurring method according to claim 3, characterized in that, The step of determining the effective blurred region based on the blurred intensity map and expanding the effective blurred region into a safe region specifically includes: The maximum fuzzy radius sigma_max is determined based on the control line length and the configurable scaling parameter, where sigma_max = L × r, and r is the configurable scaling parameter. A layer index map and an inter-layer mixing weight map are generated based on the fuzziness intensity A(P), the number of fuzziness layers M, and the curve parameters, where M is a configurable positive integer; The effective fuzzy region R_active is determined based on the fuzziness intensity A(P), where R_active = {P | A(P) > epsilon}, and epsilon is a configurable threshold. The outer rectangle of the effective fuzzy region R_active is safely extended based on the extension distance p to obtain the safe region R_safe. The extension distance p is determined by the maximum fuzzy radius sigma_max, the fuzzy kernel support radius, or a combination of the two, p=G(sigma_max), where G is a configurable function.

5. The progressive image blurring method according to claim 4, characterized in that, The selection of the execution backend specifically includes: Obtain the device capability D and image size C, and determine whether there is an available acceleration backend based on the device capability D and image size C; If no accelerated backend is available, select the CPU backend; If an available acceleration backend exists, calculate the acceleration benefits and switching / transmission costs. When the benefits meet the configuration strategy, select the appropriate acceleration backend.

6. The progressive image blurring method according to claim 5, characterized in that, The process of generating a multi-layered blurred image within the safe area, mixing adjacent blurred layers within the effective blurred area according to the layer index and weight, and outputting a progressively blurred image specifically includes: On the selected execution backend, multiple blur layers B_i are generated for the safe region R_safe; Within the effective blur region R_active, interpolation is performed on adjacent blur layers based on the layer index map and the interlayer mixing weight map to generate the corresponding output pixels; The output pixels are combined with the original image pixels outside the effective blur region to obtain a progressively blurred image.

7. The progressive image blurring method according to claim 6, characterized in that, Each fuzzy layer B_i corresponds to a different fuzzy scale parameter sigma_i, which is calculated from the maximum fuzzy radius sigma_max, the layer index i, and the number of fuzzy layers M.

8. A progressive image blurring processing system, characterized in that, The progressive image blurring system is used to implement the progressive image blurring method according to any one of claims 1-7, wherein the progressive image blurring system comprises: The projection progress calculation module is used to acquire the image to be processed and the two-dimensional control line, and to calculate the projection progress of any pixel in the image to be processed in the direction of the two-dimensional control line. The region expansion module is used to limit the projection progress by interval and curve mapping to obtain a fuzzy intensity map, determine the effective fuzzy region based on the fuzzy intensity map, and expand the effective fuzzy region into a safe region. The image generation module is used to select the execution backend, generate a multi-layered blurred image within the safe area, and mix adjacent blurred layers within the effective blurred area according to the layer index and weight to output a progressively blurred image.

9. A terminal, characterized in that, The terminal includes: a memory, a processor, and a progressive image blurring program stored in the memory and executable on the processor, wherein when the progressive image blurring program is executed by the processor, it implements the steps of the progressive image blurring method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a progressive image blurring program, which, when executed by a processor, implements the steps of the progressive image blurring method as described in any one of claims 1-7.