Image multi-region blurring method and apparatus, electronic device, and medium
Patent Information
- Application Number
- CN202210693218.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-17
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2042-06-17
AI Technical Summary
[0004]然而,现有的图像模糊技术,主要是对整幅图像进行全局模糊,难以实现图像中多个局部区域的独立模糊,无法满足多区域的模糊需求
[0073] Compared with the prior art, the technical solution provided by this disclosure has the following advantages: by responding to the blurring request of the image, at least two local regions in the image are obtained; based on the relative position information between the at least two local regions, the original data in each local region is superimposed and blurred to obtain a blur layer corresponding to the at least two local regions; a target region corresponding to the at least two local regions is established in the buffer layer; and based on the target region, the blur layer and the buffer layer are fused to obtain the blur result of the at least two local regions. Thus, multiple regions in the whole image can be blurred, solving the problem that the existing global processing of the whole image is difficult to meet the local blurring requirements.
Smart Images

Figure CN117291822B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and in particular to a method, apparatus, electronic device, and medium for blurring multiple regions of an image. Background Technology
[0002] Image blurring technology can blur the entire image, making it easier to extract objects of interest. For example, blurring technology can be used to filter out small or low-brightness objects in an image, effectively extracting the parts of interest.
[0003] In related technologies, image blurring is mainly achieved by setting a certain blur radius to blur the entire image. The blur radius can change the sharpness of the original image. The smaller the blur radius, the less the original image is lost in sharpness; the larger the blur radius, the greater the loss in sharpness, that is, the more blurred the image becomes.
[0004] However, existing image blurring techniques mainly blur the entire image globally, making it difficult to blur multiple local areas independently within an image, thus failing to meet the need for blurring in multiple regions. Summary of the Invention
[0005] To address the aforementioned technical problems, this disclosure provides a method, apparatus, electronic device, and medium for blurring multiple regions of an image.
[0006] In a first aspect, this disclosure provides a method for blurring multiple regions of an image, including:
[0007] In response to a blurring request for an image, the blurring request includes at least two local regions in the image;
[0008] Based on the relative position information between at least two local regions, the original data in each local region is superimposed and blurred to obtain a blurred layer corresponding to the at least two local regions.
[0009] Based on the relative position information between at least two local regions, a target region is established in a buffer layer, which includes empty data;
[0010] Based on the target region, the blur layer and the buffer layer are fused to obtain the blur results of the at least two local regions.
[0011] Optionally, before performing superimposed blurring processing on the original data in each local region based on the relative position information between at least two local regions to obtain the blurred layers corresponding to the at least two local regions, the method further includes:
[0012] Obtain at least one fuzzy radius, the number of which corresponds to the number of local regions;
[0013] The process of performing overlay blurring on the original data in each local region based on the relative position information between at least two local regions to obtain a blurred layer corresponding to the at least two local regions includes:
[0014] Based on the relative position information between at least two local regions, the original data in each local region is overlaid to obtain an intermediate layer;
[0015] Determine whether at least two local regions overlap;
[0016] Based on the blur radius and the determination result, the intermediate layer is subjected to blur overlay processing to obtain blur layers corresponding to the at least two local regions.
[0017] Optionally, when the number of fuzzy radii is one, and the fuzzy radius is a first radius;
[0018] The process of performing blur overlay processing on the intermediate layer based on the blur radius and the determination result to obtain blurred layers corresponding to the at least two local regions includes:
[0019] If there is no overlap between at least two local regions, the intermediate layer is blurred and overlaid according to the first radius to obtain a blurred layer corresponding to the at least two local regions.
[0020] Optionally, the step of performing blur overlay processing on the intermediate layer based on the blur radius and the determination result to obtain blurred layers corresponding to the at least two local regions includes:
[0021] If at least two local regions overlap, obtain the merged region of the at least two overlapping local regions from the intermediate layer;
[0022] The merged region is divided into units to obtain at least two region units;
[0023] Based on the first radius, the superimposed data in each region unit is blurred and layered to obtain blurred layers corresponding to the at least two local regions.
[0024] Optionally, when the number of fuzzy radii is at least two, and the fuzzy radii include at least two second radii;
[0025] The process of performing blur overlay processing on the intermediate layer based on the blur radius and the determination result to obtain blurred layers corresponding to the at least two local regions includes:
[0026] If there is no overlap between at least two local regions, determine the second radius corresponding to each local region;
[0027] Based on the second radius corresponding to each local region, the intermediate layer is blurred and layered to obtain blurred layers corresponding to the at least two local regions.
[0028] Optionally, the step of performing blur overlay processing on the intermediate layer based on the blur radius and the determination result to obtain blurred layers corresponding to the at least two local regions includes:
[0029] If at least two local regions overlap, obtain the merged region of the at least two overlapping local regions from the intermediate layer;
[0030] The merged region is divided into units to obtain at least two region units;
[0031] Determine the second radius corresponding to each region unit;
[0032] Based on the second radius corresponding to each region unit, the superimposed data in each region unit is blurred and layered to obtain the blurred layers corresponding to the at least two local regions.
[0033] Optionally, the type of the local region includes: a rectangular region and / or a rounded corner region;
[0034] The process of fusing the blur layer and the buffer layer based on the target region to obtain the blur results of the at least two local regions includes:
[0035] Adjust the target region in the buffer layer according to the types of at least two of the local regions;
[0036] Based on the adjusted target area, the blurred layer and the buffer layer are merged to obtain the blurred results of the at least two local areas.
[0037] Secondly, this disclosure provides a multi-region blurring device for an image, comprising:
[0038] A response module is configured to respond to a blurring request for an image, the blurring request including at least two local regions in the image;
[0039] The processing module is used to perform superimposed blurring processing on the original data in each local region based on the relative position information between at least two local regions, so as to obtain a blur layer corresponding to the at least two local regions.
[0040] A module is established to create a target region in a buffer layer based on the relative position information between at least two local regions, the buffer layer including empty data;
[0041] The fusion module is used to fuse the blur layer and the buffer layer based on the target region to obtain the blur results of the at least two local regions.
[0042] Optionally, it may also include: an acquisition module;
[0043] The acquisition module is used to acquire at least one fuzzy radius, the number of which corresponds to the number of local regions;
[0044] The processing module includes: a superposition unit, a determination unit, and a processing unit;
[0045] An overlay unit is used to overlay the original data in each local region based on the relative position information between at least two local regions to obtain an intermediate layer;
[0046] A defining unit is used to determine whether at least two local regions overlap.
[0047] The processing unit is used to perform blur overlay processing on the intermediate layer based on the blur radius and the determination result to obtain blur layers corresponding to the at least two local regions.
[0048] Optionally, when the number of fuzzy radii is one, and the fuzzy radius is a first radius;
[0049] The processing unit is specifically used for:
[0050] If there is no overlap between at least two local regions, the intermediate layer is blurred and overlaid according to the first radius to obtain a blurred layer corresponding to the at least two local regions.
[0051] Optional, processing unit, specifically used for:
[0052] If at least two local regions overlap, obtain the merged region of the at least two overlapping local regions from the intermediate layer;
[0053] The merged region is divided into units to obtain at least two region units;
[0054] Based on the first radius, the superimposed data in each region unit is blurred and layered to obtain blurred layers corresponding to the at least two local regions.
[0055] Optionally, when the number of fuzzy radii is at least two, and the fuzzy radii include at least two second radii;
[0056] The processing unit is specifically used for:
[0057] If there is no overlap between at least two local regions, determine the second radius corresponding to each local region;
[0058] Based on the second radius corresponding to each local region, the intermediate layer is blurred and layered to obtain blurred layers corresponding to the at least two local regions.
[0059] Optional, processing unit, specifically used for:
[0060] If at least two local regions overlap, obtain the merged region of the at least two overlapping local regions from the intermediate layer;
[0061] The merged region is divided into units to obtain at least two region units;
[0062] Determine the second radius corresponding to each region unit;
[0063] Based on the second radius corresponding to each region unit, the superimposed data in each region unit is blurred and layered to obtain the blurred layers corresponding to the at least two local regions.
[0064] Optionally, the type of the local region includes: a rectangular region and / or a rounded corner region;
[0065] The fusion module is specifically used for:
[0066] Adjust the target region in the buffer layer according to the types of at least two of the local regions;
[0067] Based on the adjusted target area, the blurred layer and the buffer layer are merged to obtain the blurred results of the at least two local areas.
[0068] Thirdly, this disclosure also provides an electronic device, including:
[0069] One or more processors;
[0070] Storage device for storing one or more programs.
[0071] When the one or more programs are executed by the one or more processors, the one or more processors implement any of the image multi-region blurring methods described in the embodiments of the present invention.
[0072] Fourthly, this disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the image multi-region blurring methods described in the embodiments of the present invention.
[0073] Compared with the prior art, the technical solution provided by this disclosure has the following advantages: by responding to the blurring request of the image, at least two local regions in the image are obtained; based on the relative position information between the at least two local regions, the original data in each local region is superimposed and blurred to obtain a blur layer corresponding to the at least two local regions; a target region corresponding to the at least two local regions is established in the buffer layer; and based on the target region, the blur layer and the buffer layer are fused to obtain the blur result of the at least two local regions. Thus, multiple regions in the whole image can be blurred, solving the problem that the existing global processing of the whole image is difficult to meet the local blurring requirements. Attached Figure Description
[0074] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0075] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0076] Figure 1 This is a flowchart illustrating a method for blurring multiple regions of an image provided in an embodiment of this disclosure;
[0077] Figure 2 This is a flowchart illustrating another method for blurring multiple regions of an image provided in this embodiment of the present disclosure;
[0078] Figure 3 This is a schematic diagram of a multi-layer overlay processing procedure provided in an embodiment of the present disclosure;
[0079] Figure 4 This is a schematic diagram of the structure of an image multi-region blurring device provided in an embodiment of this disclosure;
[0080] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0081] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0082] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0083] This embodiment can be applied to image blurring.
[0084] For example, an image may include multiple regions (such as the rounded rectangle / rectangular region corresponding to the application icon in the application display interface). When blurring is required, a blur radius can be set based on the image, and all regions included in the image can be blurred using the same blur radius, thereby changing the visibility of the image.
[0085] However, the above-mentioned methods of image blurring mainly involve global blurring of the entire image, which has a high degree of limitation on the blurred area and makes it difficult to effectively blur a specific rounded corner area in the image.
[0086] For example, this disclosure provides a method, apparatus, electronic device, and medium for blurring multiple regions of an image. By responding to a blurring request of an image, at least two local regions in the image are obtained. Based on the relative position information between the at least two local regions, the original data in each local region is superimposed and blurred to obtain a blur layer corresponding to the at least two local regions. A target region corresponding to the at least two local regions is established in a buffer layer. Based on the target region, the blur layer and the buffer layer are fused to obtain the blur result of the at least two local regions. Thus, multiple regions in the entire image can be blurred, solving the problem that existing global processing of the entire image is difficult to meet the local blurring requirements.
[0087] See details Figure 1 As shown in the example.
[0088] Figure 1 This is a schematic flowchart illustrating a multi-region blurring method for an image provided in this embodiment. The method in this embodiment can be executed by a multi-region blurring device, which can be implemented in hardware / software and configured in an electronic device. The multi-region blurring method for images described in any embodiment of this application can be implemented. Figure 1 As shown, the method specifically includes the following:
[0089] S110, in response to a blurring request for an image, the blurring request including at least two local regions in the image.
[0090] Users can trigger operations on rounded corner / rectangular areas in the image to determine at least two local areas selected by the application layer, thereby facilitating the selection of the area to be blurred.
[0091] It should be noted that the triggering operations mentioned above may include, but are not limited to, single-click, double-click, and swipe operations.
[0092] The at least two local regions may include: at least one rectangular region and at least one rounded corner region, or at least two rectangular regions, or at least two rounded corner regions.
[0093] S120. Based on the relative position information between at least two local regions, perform overlay blurring on the original data in each local region to obtain blur layers corresponding to at least two local regions.
[0094] The relative position information between at least two local regions refers to the relative position information of at least two local regions in the aforementioned image.
[0095] For example, at least two local regions include: rectangular region 1 and rectangular region 2 in the image. The relative position information between rectangular region 1 and rectangular region 2 can be the relative relationship between rectangular region 1 and rectangular region 2 in the image, such as adjacent sides / intersecting sides / side distance, etc.
[0096] The specific operations corresponding to overlay blur can include overlaying multiple layers and data blurring.
[0097] It should be noted that the blurred layer also has the aforementioned at least two local regions. The blurred layer corresponding to the at least two local regions has the same size as the image. That is, the relative position information of the at least two local regions in the image is the same as the relative position information of the at least two local regions in the blurred layer.
[0098] S130. Based on the relative position information between at least two local regions, establish the target region in the buffer layer.
[0099] The buffer layer includes empty data.
[0100] The buffer layer can be used for data fusion / layer overlay, and it can be a transparent background of empty data.
[0101] It should be noted that the target area can be used to store each of at least two local areas.
[0102] Based on the above examples, the target area can be the combined rectangular area enclosed by rectangular area 1 and rectangular area 2.
[0103] S140. Based on the target area, merge the blur layer and the buffer layer to obtain the blur results of at least two local areas.
[0104] The target area can be used as the fusion standard for the buffer layer and the blur layer. That is, based on the position of the target area in the buffer layer and the positions of at least two local areas in the blur layer, the blur layer and the buffer layer are fused to obtain the blur result of at least two local areas.
[0105] In this embodiment, the optional types of local regions include: rectangular regions and / or rounded corner regions;
[0106] Based on the target region, the blur layer and the buffer layer are merged to obtain blur results for at least two local regions, including:
[0107] Adjust the target region in the buffer layer based on the types of at least two local regions;
[0108] Based on the adjusted target area, the blur layer and the buffer layer are merged to obtain blur results for at least two local areas.
[0109] The target area can be an irregular shape, and all the corners of the target area are right angles.
[0110] Based on the above examples, when at least two local areas include rectangular area 1 and rounded corner area 3, an appropriate rounded corner radius can be selected based on the corner radius of rounded corner area 3, and the rounded corners of the area corresponding to rounded corner area 3 in the target area can be adjusted so that the adjusted target area can better fit rectangular area 1 and rounded corner area 3.
[0111] This allows for the accurate rendering of blurred data from at least two local regions within the blurred layer to the target region, further improving the efficiency of blur processing across multiple regions of the image.
[0112] The multi-region blurring method for images provided in this embodiment obtains at least two local regions in an image in response to a blurring request. Based on the relative position information between the at least two local regions, the original data in each local region is superimposed and blurred to obtain a blur layer corresponding to the at least two local regions. A target region corresponding to the at least two local regions is established in a buffer layer. Based on the target region, the blur layer and the buffer layer are fused to obtain the blurring result of the at least two local regions. Thus, it is possible to blur multiple regions in the entire image, solving the problem that existing global processing of the entire image is difficult to meet the local blurring requirements.
[0113] Figure 2 This is a flowchart illustrating another image multi-region blurring method provided in this embodiment. Based on the above embodiments, this embodiment further includes, before S120, the method of this embodiment may include:
[0114] S111, Obtain at least one fuzzy radius.
[0115] The number of fuzzy radii corresponds to the number of local regions.
[0116] For rectangular regions of different sizes, the application layer may have different blurring requirements for each rectangular region. In this case, the same blur radius can be set for all rectangular regions, or an independent blur radius can be set for each rectangular region.
[0117] One possible implementation of S120 is as follows:
[0118] S1201. Based on the relative position information between at least two local regions, the original data in each local region is overlaid to obtain an intermediate layer.
[0119] Among them, the intermediate layer can be as follows Figure 3 The layer corresponding to Layer3 shown in the example.
[0120] Based on the relative position information between at least two local regions, the original data in each local region is overlaid to obtain an intermediate layer. This may include: based on the relative position information between at least two local regions, the original data in each local region is sequentially concatenated and the first and second layers are overlaid to obtain a third layer (the intermediate layer mentioned above).
[0121] The first layer can be as follows: Figure 3 The layer corresponding to Layer1 in the example is shown below. The second layer can be as follows: Figure 3 The layer corresponding to Layer2 shown in the example.
[0122] It should be noted that the first layer, the second layer, and the middle layer have the same size, and at least two local areas have the same relative position information in the first layer, the second layer, and the third layer.
[0123] Among them, 1.1mix can be used to describe the fusion process between the layer corresponding to Layer1 and the layer corresponding to Layer2, 2.1mix can be used to describe the fusion process between the layer corresponding to Layer2 and the layer corresponding to Layer3, and 3.1blur / mix can be used to describe the blurring and fusion process between the layer corresponding to Layer3 and the layer corresponding to Layer4.
[0124] 4.0blit and 4.1blit can be used to describe transferring two small rectangular regions corresponding to a FrameBuffer to a large rectangular region corresponding to a FrameBuffer.
[0125] S1202. Determine whether at least two local regions overlap.
[0126] Among them, it can be determined whether at least two local regions overlap based on the relative position information between at least two local regions.
[0127] S1203. Based on the blur radius and the determined result, perform blur overlay processing on the intermediate layer to obtain blur layers corresponding to at least two local areas.
[0128] Among them, based on the fourth layer, the intermediate layer can be blurred and overlaid according to the blur radius and the determination result to obtain blur layers corresponding to at least two local areas.
[0129] Among them, the blurred layer can be as follows Figure 3 The layer corresponding to Layer4 shown in the example.
[0130] Therefore, by determining whether there is regional overlap between at least two local regions, the fuzzy process of at least two local regions can be divided, further improving the fuzzy accuracy of multiple regions under different overlap results.
[0131] In this embodiment, optionally, the number of fuzzy radii is one, and the fuzzy radius is the first radius;
[0132] Based on the blur radius and the determined results, the intermediate layer is blurred and overlaid to obtain blurred layers corresponding to at least two local regions, including:
[0133] If there is no overlap between at least two local regions, the intermediate layer is blurred and overlaid according to the first radius to obtain blurred layers corresponding to at least two local regions.
[0134] Based on the above examples, at least two local regions include rectangular region 1 and rectangular region 2. When only one blur radius is determined and it is the first radius, the blurring process and layer overlay operation of rectangular region 1 and rectangular region 2 in the intermediate layer can be performed based on the first radius, thereby improving the blurring rate of multiple regions.
[0135] In this embodiment, optionally, based on the blur radius and the determination result, the intermediate layer is subjected to blur overlay processing to obtain blur layers corresponding to at least two local regions, including:
[0136] If at least two local regions overlap, obtain the merged region of the at least two overlapping local regions from the intermediate layer;
[0137] The merged region is divided into units to obtain at least two regional units;
[0138] Based on the first radius, blurring and layer overlay are performed on the superimposed data in each region unit to obtain at least two blurred layers corresponding to local regions.
[0139] In order to avoid the problem of the overlapping areas being difficult to blur effectively when there is overlap between at least two local areas, the merged area of at least two local areas can be divided into units, and each unit of the division can be processed accordingly, thereby further improving the accuracy of multi-region blurring.
[0140] In this embodiment, optionally, the number of fuzzy radii is at least two, and the fuzzy radii include at least two second radii;
[0141] Based on the blur radius and the determined results, the intermediate layer is blurred and overlaid to obtain blurred layers corresponding to at least two local regions, including:
[0142] If there is no overlap between at least two local regions, determine the second radius corresponding to each local region;
[0143] Based on the second radius corresponding to each local region, the intermediate layer is blurred and layered to obtain blurred layers corresponding to at least two local regions.
[0144] Based on the above example, at least two local regions include rectangular region 1 and rectangular region 2. The second radius corresponding to rectangular region 1 is radius A, and the second radius corresponding to rectangular region 2 is radius B. Then, rectangular region 1 can be blurred based on radius A, and rectangular region 2 can be blurred based on radius B.
[0145] Therefore, by dividing different local areas with different blur radii, the different local areas included in the determined blur layer can be more clearly distinguished, while effectively meeting the blur requirements of the application layer.
[0146] In this embodiment, optionally, based on the blur radius and the determination result, the intermediate layer is subjected to blur overlay processing to obtain blur layers corresponding to at least two local regions, including:
[0147] If at least two local regions overlap, obtain the merged region of the at least two overlapping local regions from the intermediate layer;
[0148] The merged region is divided into units to obtain at least two regional units;
[0149] Determine the second radius corresponding to each region unit;
[0150] Based on the second radius corresponding to each region unit, the superimposed data in each region unit is blurred and layers are overlaid to obtain blurred layers corresponding to at least two local regions.
[0151] The overlay data in each region unit can be the data at the corresponding unit position in the intermediate layer.
[0152] When blurring overlapping regional units, the blur radius of any local region can be selected as the blur radius of the overlapping regional unit, or the weighted value of the blur radii of multiple local regions can be used as the blur radius of the overlapping regional unit.
[0153] Based on the above examples, at least two local regions include rectangular region 1 and rectangular region 2. The second radius corresponding to rectangular region 1 is radius A, and the second radius corresponding to rectangular region 2 is radius B. The overlapping area of rectangular region 1 and rectangular region 2 is rectangular region 4. Then, the fuzzy radius corresponding to rectangular region 4 can be radius A, radius B, or a weighted value of radius A and radius B.
[0154] Therefore, when there is overlap between at least two local regions and they correspond to different blur radii, the regional units corresponding to each local region can be processed separately to obtain a more accurate multi-region blur effect.
[0155] Figure 4 This is a schematic diagram of the structure of an image multi-region blurring device provided in an embodiment of this disclosure; the device is configured in an electronic device and can implement the image multi-region blurring method described in any embodiment of this application. The device specifically includes the following:
[0156] The response module 410 is configured to respond to a blurring request for an image, the blurring request including at least two local regions in the image;
[0157] Processing module 420 is used to perform superimposed blurring processing on the original data in each local region based on the relative position information between at least two local regions, so as to obtain a blurred layer corresponding to the at least two local regions.
[0158] A module 430 is configured to establish a target region in a buffer layer based on the relative position information between at least two local regions, wherein the buffer layer includes empty data.
[0159] The fusion module 440 is used to fuse the blur layer and the buffer layer based on the target area to obtain the blur results of the at least two local areas.
[0160] In this embodiment, optionally, the device further includes: an acquisition module;
[0161] The acquisition module is used to acquire at least one fuzzy radius, the number of which corresponds to the number of local regions;
[0162] Processing module 420 includes: a superposition unit, a determination unit, and a processing unit;
[0163] An overlay unit is used to overlay the original data in each local region based on the relative position information between at least two local regions to obtain an intermediate layer;
[0164] A defining unit is used to determine whether at least two local regions overlap.
[0165] The processing unit is used to perform blur overlay processing on the intermediate layer based on the blur radius and the determination result to obtain blur layers corresponding to the at least two local regions.
[0166] In this embodiment, optionally, when the number of fuzzy radii is one, and the fuzzy radius is a first radius;
[0167] The processing unit is specifically used for:
[0168] If there is no overlap between at least two local regions, the intermediate layer is blurred and overlaid according to the first radius to obtain a blurred layer corresponding to the at least two local regions.
[0169] In this embodiment, optionally, the processing unit is specifically used for:
[0170] If at least two local regions overlap, obtain the merged region of the at least two overlapping local regions from the intermediate layer;
[0171] The merged region is divided into units to obtain at least two region units;
[0172] Based on the first radius, the superimposed data in each region unit is blurred and layered to obtain blurred layers corresponding to the at least two local regions.
[0173] In this embodiment, optionally, when the number of fuzzy radii is at least two, and the fuzzy radii include at least two second radii;
[0174] The processing unit is specifically used for:
[0175] If there is no overlap between at least two local regions, determine the second radius corresponding to each local region;
[0176] Based on the second radius corresponding to each local region, the intermediate layer is blurred and layered to obtain blurred layers corresponding to the at least two local regions.
[0177] In this embodiment, optionally, the processing unit is specifically used for:
[0178] If at least two local regions overlap, obtain the merged region of the at least two overlapping local regions from the intermediate layer;
[0179] The merged region is divided into units to obtain at least two region units;
[0180] Determine the second radius corresponding to each region unit;
[0181] Based on the second radius corresponding to each region unit, the superimposed data in each region unit is blurred and layered to obtain the blurred layers corresponding to the at least two local regions.
[0182] In this embodiment, optionally, the type of the local region includes: a rectangular region and / or a rounded corner region;
[0183] Fusion module 440 is specifically used for:
[0184] Adjust the target region in the buffer layer according to the types of at least two of the local regions;
[0185] Based on the adjusted target area, the blurred layer and the buffer layer are merged to obtain the blurred results of the at least two local areas.
[0186] The image multi-region blurring device of this invention obtains at least two local regions in an image in response to an image blurring request. Based on the relative position information between the at least two local regions, it performs superimposed blurring processing on the original data in each local region to obtain a blur layer corresponding to the at least two local regions. It also establishes a target region corresponding to the at least two local regions in a buffer layer. Based on the target region, it fuses the blur layer and the buffer layer to obtain the blurring result of the at least two local regions. Thus, it can perform blurring processing on multiple regions in the whole image, solving the problem that existing global processing of the whole image is difficult to meet the local blurring requirements.
[0187] The image multi-region blurring device provided in the embodiments of the present invention can execute the image multi-region blurring method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method.
[0188] This disclosure also provides an electronic device, including: a processor, the processor being configured to execute a computer program stored in a memory, the computer program being executed by the processor to implement the steps of the above method embodiments.
[0189] Figure 5 This is a schematic diagram of the structure of an electronic device provided in this disclosure. Figure 5 A block diagram is shown that is suitable for implementing embodiments of the present invention. Figure 5 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0190] like Figure 5 As shown, the electronic device 12 is represented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processor 16).
[0191] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0192] Electronic device 12 typically includes a variety of computer system readable media. These media can be any media that can be accessed by electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0193] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (commonly referred to as "hard disk drives"). Disk drives for reading and writing to removable non-volatile disks (e.g., "floppy disks") and optical disk drives for reading and writing to removable non-volatile optical disks (e.g., CD-ROMs, DVD-ROMs, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.
[0194] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of this invention.
[0195] The processor 16 performs various functional applications and information processing by running at least one of a plurality of programs stored in the system memory 28, such as implementing the method embodiments provided in the embodiments of the present invention.
[0196] This disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method embodiments.
[0197] Any combination of one or more computer-readable media may be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
[0198] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0199] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0200] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or wide area network (WAN) domain—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0201] This disclosure also provides a computer program product that, when run on a computer, causes the computer to perform the steps of the above-described method embodiments.
[0202] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0203] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for blurring multiple regions of an image, characterized in that, include: In response to a blurring request for an image, the blurring request includes at least two local regions in the image; Based on the relative position information between at least two local regions, the original data in each local region is superimposed and blurred to obtain a blurred layer corresponding to the at least two local regions. Based on the relative position information between at least two local regions, a target region is established in a buffer layer, which includes empty data; Based on the target region, the blur layer and the buffer layer are fused to obtain the blur results of the at least two local regions.
2. The method according to claim 1, characterized in that, Before performing superimposed blurring processing on the original data in each local region based on the relative position information between at least two local regions to obtain the blurred layer corresponding to the at least two local regions, the method further includes: Obtain at least one blur radius, with one blur radius corresponding to each local region; The process of performing overlay blurring on the original data in each local region based on the relative position information between at least two local regions to obtain a blurred layer corresponding to the at least two local regions includes: Based on the relative position information between at least two local regions, the original data in each local region is overlaid to obtain an intermediate layer; Determine whether at least two local regions overlap; Based on the blur radius and the determination result, the intermediate layer is subjected to blur overlay processing to obtain blur layers corresponding to the at least two local regions.
3. The method according to claim 2, characterized in that, When the number of fuzzy radii is one, and the fuzzy radius is a first radius; The process of performing blur overlay processing on the intermediate layer based on the blur radius and the determination result to obtain blurred layers corresponding to the at least two local regions includes: If there is no overlap between at least two local regions, the intermediate layer is blurred and overlaid according to the first radius to obtain a blurred layer corresponding to the at least two local regions.
4. The method according to claim 3, characterized in that, The process of performing blur overlay processing on the intermediate layer based on the blur radius and the determination result to obtain blurred layers corresponding to the at least two local regions includes: If at least two local regions overlap, obtain the merged region of the at least two overlapping local regions from the intermediate layer; The merged region is divided into units to obtain at least two region units; Based on the first radius, the superimposed data in each region unit is blurred and layered to obtain blurred layers corresponding to the at least two local regions.
5. The method according to claim 2, characterized in that, When the number of fuzzy radii is at least two, and the fuzzy radii include at least two second radii; The process of performing blur overlay processing on the intermediate layer based on the blur radius and the determination result to obtain blurred layers corresponding to the at least two local regions includes: If there is no overlap between at least two local regions, determine the second radius corresponding to each local region; Based on the second radius corresponding to each local region, the intermediate layer is blurred and layered to obtain blurred layers corresponding to the at least two local regions.
6. The method according to claim 5, characterized in that, The process of performing blur overlay processing on the intermediate layer based on the blur radius and the determination result to obtain blurred layers corresponding to the at least two local regions includes: If at least two local regions overlap, obtain the merged region of the at least two overlapping local regions from the intermediate layer; The merged region is divided into units to obtain at least two region units; Determine the second radius corresponding to each region unit; Based on the second radius corresponding to each region unit, the superimposed data in each region unit is blurred and layered to obtain the blurred layers corresponding to the at least two local regions.
7. The method according to any one of claims 1-6, characterized in that, The types of the local regions include: rectangular regions and / or rounded corner regions; The process of fusing the blur layer and the buffer layer based on the target region to obtain the blur results of the at least two local regions includes: Adjust the target region in the buffer layer according to the types of at least two of the local regions; Based on the adjusted target area, the blurred layer and the buffer layer are merged to obtain the blurred results of the at least two local areas.
8. A blurring device for multiple regions of an image, characterized in that, include: A response module is configured to respond to a blurring request for an image, the blurring request including at least two local regions in the image; The processing module is used to perform superimposed blurring processing on the original data in each local region based on the relative position information between at least two local regions, so as to obtain a blur layer corresponding to the at least two local regions. A module is established to create a target region in a buffer layer based on the relative position information between at least two local regions, the buffer layer including empty data; The fusion module is used to fuse the blur layer and the buffer layer based on the target region to obtain the blur results of the at least two local regions.
9. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the image multi-region blurring method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the image multi-region blurring method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
An image processing method and image processing device
CN101150645A
Local fuzzy interpolation blind detection method based on images
CN101859385A