Image background blurring system, method and equipment and storage medium
By transferring repetitive image processing operations to the main processing module in the image background blur system, the problem of background blur processor resource competition in video conferencing is solved, processing efficiency and resource utilization are improved, and high-resolution and High frame rate video conferencing requirements.
Patent Information
- Application Number
- CN202410710104.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-08-23
AI Technical Summary
Due to the high resolution and high frame rate requirements of existing background blur algorithms in video conferencing, it is difficult for terminal equipment to meet the real-time and picture imaging effects, and due to repeated data processing of multiple image processing models, competition for processor resources results. Inefficient.
In the image background blurring system, repetitive image processing operations in the character processing module are transferred to the main processing module for unified execution, and intermediate images are sent to the character processing module for inference processing to avoid competition for processor resources and improve Data processing efficiency and resource utilization.
It realizes background blur processing at high resolution and high frame rate, saves processing time, and improves the data processing efficiency and processor resource utilization of the image background blur system.
Smart Images

Figure CN118537210A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image background blurring system, method, device and storage medium. Background Art
[0002] Background blur refers to an image processing method that uses a selected target as the foreground, and all objects except the target as the background, and blurs the background. In today's era of virtual office, taking online classes and working from home have gradually become the norm. In order to better protect user privacy and improve user experience, it is necessary to launch a background blur function in video conferencing scenarios, which can better protect user privacy and increase fun while creating a learning and office atmosphere.
[0003] The implementation platform of the background blur algorithm usually includes hard terminals and soft terminals, but for cost control, the computing resources of the terminal equipment generally selected are very limited. The currently commonly used background blur algorithms are often composed of multiple image processing models and image fusion processing algorithms. Based on multiple image processing models, the input images are processed with a variety of different angles, and the images obtained after processing at each angle are fused based on the image fusion processing algorithm to obtain the final background blurred image.
[0004] However, different image processing models consume more processor resources when processing input images, and the higher the resolution of the input image processing model image, the higher the processor resources consumed by the image processing model. Background blur, as an extended application of video conferencing, has high requirements for real-time performance and image imaging effects. It usually needs to be completed at high resolution and high frame rate. Terminal devices with limited computing resources often find it difficult to meet the background blur requirements under the above conditions. Summary of the invention
[0005] The present invention provides an image background blur system, method, device and storage medium, which reorganize and divide the data processing requirements of different image processing models in the background blur processing process, reduce the repeated data processing in the image background blur processing process, and thus avoid the competition with the processor resources corresponding to the repeated data processing, thereby improving the data processing efficiency and processor resource utilization of the image background blur system.
[0006] In a first aspect, an embodiment of the present invention provides an image background blurring system, comprising: a main processing module, a background blurring module, a character processing module and an image fusion module; wherein the character processing module comprises at least one character image processing model;
[0007] The main processing module is used to receive the input image to be processed, process the image to be processed to obtain an intermediate image, send the image to be processed to the background blur module and the image fusion module, and send the intermediate image to the character processing module;
[0008] A background blur module, used for performing background blur processing on the image to be processed and sending the generated background blurred image to the image fusion module;
[0009] A character processing module is used to input the intermediate image into each character image processing model for inference processing, and send the generated character image processing results to the image fusion module;
[0010] The image fusion module is used to generate an output image based on the processing results of the image to be processed, the background blurred image and each character image, and send the output image to the main processing module so that the main processing module can output the output image externally.
[0011] In a second aspect, an embodiment of the present invention further provides an image background blurring method, which is applied to an image background blurring system provided by any embodiment of the present invention, wherein the image background blurring system comprises: a main processing module, a background blurring module, a character processing module and an image fusion module; wherein the character processing module comprises at least one character image processing model; the method comprises:
[0012] The main processing module receives the input image to be processed, processes the image to be processed to obtain an intermediate image, sends the image to be processed to the background blur module and the image fusion module, and sends the intermediate image to the character processing module;
[0013] The background blur module performs background blur processing on the image to be processed, and sends the generated background blurred image to the image fusion module;
[0014] The character processing module inputs the intermediate image into each character image processing model for inference processing, and sends the generated character image processing results to the image fusion module;
[0015] The image fusion module generates an output image based on the processing results of the image to be processed, the background blurred image and each character image, and sends the output image to the main processing module so that the main processing module outputs the output image externally.
[0016] In a third aspect, an embodiment of the present invention further provides an image background blurring device, comprising:
[0017] An image background blurring system as provided by any embodiment of the present invention;
[0018] at least three processors of different types, and a memory communicatively coupled to the at least three processors of different types;
[0019] The first type of processor is used to support the processing of the image to be processed by the main processing module in the image background blur system, the second type of processor is used to support the reasoning processing of the character processing module in the image background blur system, and the other types of processors are used to support other types of data processing in the image background blur system;
[0020] The memory stores a computer program that can be executed by at least three different types of processors. The computer program is executed by at least three different types of processors, so that at least three different types of processors can execute the image background blurring method provided by any embodiment of the present invention.
[0021] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, enables the computer processor to execute the image background blurring method of any embodiment of the present invention.
[0022] An embodiment of the present invention provides an image background blur system, method, device and storage medium, wherein the image background blur system includes: a main processing module, a background blur module, a character processing module and an image fusion module; wherein the character processing module includes at least one character image processing model; the main processing module is used to receive an input image to be processed, and process the image to be processed to obtain an intermediate image, send the image to be processed to the background blur module and the image fusion module, and send the intermediate image to the character processing module; the background blur module is used to perform background blur processing on the image to be processed, and send the generated background blurred image to the image fusion module; the character processing module is used to input the intermediate image to each character image processing model for inference processing, and send the generated character image processing results to the image fusion module; the image fusion module is used to generate an output image according to the image to be processed, the background blurred image and the character image processing results, and send the output image to the main processing module, so that the main processing module can output the output image to the outside. By adopting the above technical scheme, the reasoning input requirements of multiple character image processing models in the character processing module of the image background blurring system are analyzed, and the common, repetitive, and time-consuming image processing operations are transferred to the main processing module for unified execution, and the intermediate image obtained after processing is sent to the character processing module for each character image processing model to perform corresponding reasoning processing, so that the common processing of the image to be processed by different character image processing models is only performed once by the main processing module, so that the processor resources related to the common processing will not be repeatedly occupied, thereby avoiding the competition of different character image processing modules for the processor resources required for the common processing, saving the time required for different character image processing models to process the image to be processed, and improving the data processing efficiency and processor resource utilization of the image background blurring system.
[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 A schematic diagram of the structure of an image background blurring system provided in Embodiment 1 of the present invention;
[0026] Figure 2 A schematic diagram of the structure of an image background blurring system provided in Embodiment 2 of the present invention;
[0027] Figure 3 A schematic diagram of the structure of another image background blurring system provided in Embodiment 2 of the present invention;
[0028] Figure 4 A schematic diagram of the structure of another image background blurring system provided in Embodiment 2 of the present invention;
[0029] Figure 5 A schematic diagram of the structure of another image background blurring system provided in Embodiment 2 of the present invention;
[0030] Figure 6 A flowchart of a method for blurring the background of an image provided by Embodiment 3 of the present invention;
[0031] Figure 7 A schematic diagram of the structure of an image background blurring device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] Embodiment 1
[0035] Figure 1The present invention provides a structural schematic diagram of an image background blurring system provided in the first embodiment of the present invention. The embodiment of the present invention can be applied to the case where image background blurring is performed on video conferences with high resolution (such as 1080P or 4k resolution) and high frame rate (such as 30fps or 60fps, etc.) processing requirements. It can be understood that the image background blurring system provided in the embodiment of the present invention can be applied to image background blurring with ordinary resolution processing requirements in addition to high resolution and high frame rate image background blurring. Since images with high resolution and high frame rate processing requirements have higher requirements when performing image background blurring, the embodiment of the present invention takes the image processing scene with high resolution and high frame rate as an example. The image background blurring system 1 includes: a main processing module 11, a background blurring module 12, a character processing module 13 and an image fusion module 14; wherein the character processing module 13 includes at least one character image processing model.
[0036] The main processing module 11 is used to receive an input image to be processed, process the image to be processed to obtain an intermediate image, send the image to be processed to the background blur module 12 and the image fusion module 14, and send the intermediate image to the character processing module 13;
[0037] A background blur module 12, used for performing background blur processing on the image to be processed and sending the generated background blurred image to the image fusion module 14;
[0038] The character processing module 13 is used to input the intermediate image into each character image processing model for inference processing, and send the generated character image processing results to the image fusion module 14;
[0039] The image fusion module 14 is used to generate an output image according to the processing results of the image to be processed, the background blurred image and each character image, and send the output image to the main processing module 11 so that the main processing module 11 outputs the output image externally.
[0040] In this embodiment, the image background blurring system 1 can be specifically understood as a system for performing background blurring processing on a high-resolution and high-frame-rate image input therein. The main processing module 11 can be specifically understood as a data processing module in the image background blurring system 1 for realizing input data acquisition, pre-processing, distribution and output data return. The background blurring module 12 can be specifically understood as a module in the image background blurring system 1 for blurring the background image of the image input therein. The character processing module 13 can be specifically understood as a data processing module in the image background blurring system 1 for highlighting and extracting information on the characters in the input image. Optionally, the character image processing module includes at least one character image processing model, each character image processing model is a neural network model for highlighting or detecting the characters in a certain direction in the model input image, and each character image processing model in the character processing module 13 mainly retains the reasoning ability in the neural network model. The image fusion module 14 can be specifically understood as a data processing module in the image background blurring system 1 for fusing the images input to the module to obtain an output image with a highlighted character and a blurred background. The image to be processed can be specifically understood as a high-resolution and high-frame-rate image that is input into the image background blurring system 1 and needs to be blurred, and the portrait is prominently retained. The intermediate image can be specifically understood as an image obtained after the common processing requirements of each character image processing model in the character processing module 13 are completed for the image to be processed. Optionally, the intermediate image can be an image after the image to be processed is downsampled and converted to RGB format, and the embodiment of the present invention does not limit this.
[0041] It can be understood that in order to meet the processing requirements of high-resolution and high-frame-rate input images, the maximum running time of the main processing module 11, the background blur module 12, the character processing module 13 and the image fusion module 14 included in the image background blur system 1 in the embodiment of the present invention needs to meet the requirements of the input image to be processed. Exemplarily, if the input image to be processed is an image with a frame rate of 30fps, the running time of the main processing module 11, the background blur module 12, the character processing module 13 and the image fusion module 14 needs to be within 30ms, that is, the maximum running time can be set to 30ms; if the input image to be processed is an image with a frame rate of 60fps, the running time of the main processing module 11, the background blur module 12, the character processing module 13 and the image fusion module 14 needs to be within 16ms, that is, the maximum running time can be set to 16ms. In order to meet the processing requirements of high-resolution and high-frame-rate input images, in the embodiment of the present invention, the data processing steps without computational dependencies are split into different modules for parallel processing, so that the running time of each module can meet the maximum running time limit of the processing requirements.
[0042] Specifically, since a complete character image processing model that can be used to detect or extract character features from an input image can be composed of a pre-processing part including downsampling and image format conversion, a model reasoning part, and a post-processing part including image output, the types of hardware processor resources required by different processing parts are different. For example, the pre-processing part is often executed by a graphics acceleration engine (Raster Graphic Acceleration Unit, RGA), while the model processing part is often executed by an embedded neural network processor (Neural Processing Units, NPU). Since the character image processing models for processing character images often have the same pre-processing requirements, different character image processing models will repeatedly occupy the RGA when performing data processing and use the RGA to perform the same data processing on the same input image, causing competition for computing resources. Therefore, in the embodiment of the present invention, the same pre-processing in different character image processing models is integrated into the main processing module 11, so that the character processing module 13 mainly includes the model reasoning part in at least one character image processing model. That is, when the image to be processed needs to be processed with high resolution and high frame rate for image background blurring, the image to be processed can be input into the main processing module 11 of the image background blurring system 1, and the main processing module 11 performs the following processing on the image to be processed, such as sampling and RGB format conversion, to obtain an intermediate image, and sends the intermediate image to the character processing module 13 that can share the intermediate image for reasoning processing in different directions; at the same time, the main processing module 11 directly distributes the image to be processed to the background blurring module 12 and the image fusion module 14 that need to directly use the image to be processed. After receiving the image to be processed, the background blurring module 12 extracts the background image of the image to be processed and blurs it to obtain a background blurred image that can be used to replace the background part of the image to be processed, and sends the background blurred image to the image fusion module 14. After receiving the intermediate image, the character processing module 13 inputs each intermediate image into each character image processing model contained therein, so that each character image processing model can perform the reasoning processing related to it, and sends the character image processing results related to different character features generated by each character image processing model to the image fusion module 14. The image fusion module 14 can determine the portrait portion to be retained and highlighted in the image to be processed, and the background portion to be blurred based on the received image to be processed, the background blurred image and the processing results of each character image, and fuse the two to obtain the output image, and send the output image to the main processing module 11, which will output the received output image to the outside, thereby realizing the background blur of the image to be processed.
[0043] It can be understood that although the background blur module 12 also needs to adopt operations including downsampling and filter kernel convolution when performing background blur processing on the image to be processed, the background blur processing requirements are inconsistent with the features and image conversion formats required to be extracted for character image processing, and the background blur module 12 occupies the graphics processing unit (GPU) computing resources, which do not conflict with the NPU occupied by the character processing module 13 and the RGA occupied by the main processing module 11 for processing the image to be processed. Therefore, the background blur module 12 does not need to transfer the pre-processing of the image to be processed to the main processing module 11 for execution.
[0044] By adopting the technical solution of this embodiment, the reasoning input requirements of multiple character image processing models in the character processing module of the image background blurring system are analyzed, and the common and repetitive image processing operations therein are transferred to the main processing module for unified execution, and the intermediate image obtained after processing is sent to the character processing module for each character image processing model to perform corresponding reasoning processing, so that the repetitive processing operations of different character image processing models on the image to be processed are only performed once by the main processing module, thereby avoiding the repeated occupation of related processor resources, avoiding the competition between different character image processing modules for the processor resources required for related repetitive processing, saving the time required for different character image processing models to process the image to be processed, and improving the data processing efficiency and processor resource utilization of the image background blurring system.
[0045] Embodiment 2
[0046] Figure 2 This is a structural diagram of an image background blurring system provided in Embodiment 2 of the present invention. The technical solution of the embodiment of the present invention is further optimized on the basis of the above-mentioned optional technical solutions. Figure 2 As shown, the character processing module 13 at least includes a portrait segmentation unit 131, and the character image processing model corresponding to the portrait segmentation unit 131 is a portrait segmentation model.
[0047] The character processing module 13 is specifically used to input the intermediate image to the portrait segmentation unit 131 to extract the portrait, and send the generated mask image to the image fusion module 14;
[0048] Accordingly, the image fusion module 14 is specifically used to fuse the image to be processed, the background blurred image and the mask image to generate an output image, and send the output image to the main processing module 11, so that the main processing module 11 outputs the output image externally.
[0049] In this embodiment, the portrait segmentation unit 131 can be specifically understood as a data processing unit in the character processing module 13 for identifying and highlighting the portrait part contained in the input intermediate image. Optionally, the portrait segmentation unit 131 can be implemented by a portrait segmentation model, that is, it can be a portrait segmentation model in the character image processing model.
[0050] Specifically, when the character processing module 13 only includes the portrait segmentation unit 131, after receiving the input image to be processed and processing the image to be processed to obtain an intermediate image, the main processing module 11 will send the intermediate image to the portrait segmentation unit 131, which will extract the portrait and generate a mask image with the region where the portrait is located as the region of interest, and send the mask image as the character image processing result to the image fusion module 14. The image fusion module 14 will also receive the image to be processed sent by the main processing module 11 and the background blurred image output by the background blur module 12. The image fusion module 14 can fuse the image to be processed with the mask image to obtain the image of the person that needs to be retained in the image to be processed, and then fuse the obtained image of the person with the blurred background image, so that the area except the area where the image of the person is located in the image to be processed can be blurred into the blurred background image. That is, after the image to be processed, the blurred background image and the mask image are fused, the output image can be obtained, and the output image is sent to the main processing module 11, and the main processing module 11 completes the external output of the received output image to realize the background blurring of the image to be processed.
[0051] According to the technical solution of the embodiment of the present invention, when the character processing module only includes a portrait segmentation unit, the image fusion module can directly fuse and determine the output image based on the images obtained by each module and complete the output to the main processing module, thereby improving the processing efficiency.
[0052] Optional, Figure 3 This is a schematic diagram of the structure of another image background blurring system provided in Embodiment 2 of the present invention. The technical solution of the embodiment of the present invention is further optimized on the basis of the above-mentioned optional technical solutions. Figure 3 As shown, the character processing module 13 also includes a head detection unit 132, and the character image processing model corresponding to the head detection unit 132 is a head detection model. The ratio of computing resources occupied by the portrait segmentation unit and the head detection unit is consistent with the ratio of the inference time of the portrait segmentation model and the head detection model.
[0053] The character processing module 13 is specifically used for:
[0054] The intermediate image is input to the portrait segmentation unit 131 for portrait extraction, and the generated mask image is sent to the image fusion module 14;
[0055] The intermediate image is input to the head detection unit 132 for head detection, and the generated head detection result is sent to the image fusion module 14 .
[0056] Accordingly, the image fusion module 14 is specifically used to determine the output image according to the image to be processed, the background blurred image, the mask image and the head detection result, and send the output image to the main processing module 11, so that the main processing module 11 outputs the output image externally.
[0057] In this embodiment, the head detection unit 132 can be specifically understood as a data processing unit in the character processing module 13 for detecting whether the input intermediate image contains a head, so as to determine whether the image to be processed contains a person who needs to be highlighted. Optionally, the head detection unit 132 can be implemented by a head detection model, that is, it can be a head detection model in the character image processing model.
[0058] Specifically, since the inputs of the portrait segmentation unit 131 and the head detection unit 132 are only related to the input data of the main processing module, the portrait segmentation unit 131 and the head detection unit 132 are processed in parallel; further, since the portrait segmentation unit 131 and the head detection unit 132 need to share the same computing resources for processing, which can be NPU or other cloud computing resources, etc., taking the same NPU performing data processing at the same time as an example, since the running time of the portrait segmentation unit 131 and the head detection unit 132 must meet the frame rate requirements of the input image to be processed, in order to make full use of the computing power of the NPU, the NPU can be physically divided. Since the NPU is generally a multi-core processor, it can be divided into two parts according to the ratio of the inference time of the portrait segmentation model to the head detection model, so that the ratio of the computing resource occupancy ratio and the inference time of the portrait segmentation unit 131 and the head detection unit 132 in the NPU is the same.
[0059] When the person processing module 13 includes both the portrait segmentation unit 131 and the head detection unit 132, after receiving the input image to be processed and processing the image to be processed to obtain an intermediate image, the main processing module 11 will send the intermediate image to the portrait segmentation unit 131 and the head detection unit 132 respectively, and the portrait segmentation unit 131 extracts the portrait from the intermediate image and generates a mask image with the region where the portrait is located as the region of interest, and sends the mask image as the person image processing result of the portrait segmentation unit 131 to the image fusion module 14. The head detection unit 132 performs head detection on the intermediate image and generates a head detection result with the presence or absence of a head as the content, and sends the head detection result as the person image processing result of the head detection unit 132 to the image fusion module 14. After receiving the head detection result, the image fusion module 14 can determine whether there is a person image that needs to be retained in the image to be processed based on the head detection result, and after determining that there is a person image that needs to be retained, the image to be processed is fused with the mask image to obtain the person image that needs to be retained in the image to be processed, and then the obtained person image is fused with the background blurred image, and the area in the image to be processed except for the location of the person image can be blurred into the background blurred image, that is, the output image can be obtained after the image to be processed, the background blurred image and the mask image are fused, and the output image is sent to the main processing module 11, and the main processing module 11 completes the external output of the received output image to achieve background blur for the image to be processed.
[0060] It is understandable that the sizes of input images required for reasoning processing by the head detection unit 132 and the portrait segmentation unit 131 may not be the same. The size of the intermediate image can adopt the larger of the two as the size. When the input image size actually required by the head detection unit 132 and the portrait segmentation unit 131 is smaller, the intermediate image can be additionally down-sampled at a small resolution to reach the input size required for reasoning. Since the amount of data calculation required for the downsampling is not large, it does not need to be divided into the main processing module 11 for processing.
[0061] According to the technical solution of the embodiment of the present invention, since the portrait segmentation unit and the head detection unit mainly perform inference processing in the character processing module, the two share the computing resources in the same processor. To ensure that the frame rate requirements of the image to be processed are met during the running time while fully utilizing the resources in the processor, the resource occupancy ratio of the portrait segmentation model and the head detection model is determined based on the inference time of the two, and related tasks are executed in parallel according to the divided computing resources, thereby improving resource utilization and data processing efficiency.
[0062] Optional, Figure 4This is a schematic diagram of the structure of another image background blurring system provided in Embodiment 2 of the present invention. The technical solution of the embodiment of the present invention is further optimized on the basis of the above-mentioned optional technical solutions. Figure 4 Therefore, the character processing module 13 further includes an edge stabilization unit 133, and the character image processing model corresponding to the edge stabilization unit 133 is an edge stabilization model. The computing resources occupied by the edge stabilization unit are pre-allocated CPU computing resources.
[0063] The character processing module 13 is specifically used for:
[0064] The intermediate image is input to the portrait segmentation unit 131 for portrait extraction, and the generated mask image is sent to the edge stabilization unit 133;
[0065] Input the intermediate image to the edge stabilization unit 133, so that the edge stabilization unit 133 performs edge stabilization processing on the mask image according to the intermediate image, and sends the generated stabilized mask image to the image fusion module 14;
[0066] The intermediate image is input to the head detection unit 132 for head detection, and the generated head detection result is sent to the image fusion module 14 .
[0067] Correspondingly, the image fusion module 14 is specifically used to determine the output image according to the image to be processed, the background blurred image, the stable mask image and the head detection result, and send the output image to the main processing module 11, so that the main processing module 11 outputs the output image externally.
[0068] In this embodiment, the edge stabilization unit 133 can be specifically understood as a data processing unit in the character processing module 13 for stabilizing the edge of the mask image output after portrait extraction so as to achieve the resolution required for image fusion. Optionally, the edge stabilization unit 133 can be implemented by an edge stabilization model, that is, an edge stabilization model in the character image processing model.
[0069] Specifically, since the mask image output by the portrait segmentation unit 131 is usually much smaller than the input resolution in order to save computing resources, if it is directly output to the image fusion module 14 for output image generation, the resolution of the output image will be affected. Therefore, the mask image output by the portrait segmentation unit 131 often needs to be upsampled to the resolution size of the image to be processed, and serious jagged edges will be generated in the process. Therefore, in an embodiment of the present invention, an edge stabilization unit 133 is added to smooth the edges of the mask image output by the portrait segmentation unit 131 to reduce the jagged edges in the mask image upsampled to the resolution size of the image to be processed, and the mask image obtained after smoothing is determined as a stable mask image, and the stable mask image is sent to the image fusion module 14.
[0070] After receiving the head detection result, the stable mask image, the blurred background image and the image to be processed, the image fusion module 14 can determine whether there is a person image that needs to be retained in the image to be processed based on the head detection result, and after determining that there is a person image that needs to be retained, the image to be processed is fused with the stable mask image to obtain the person image that needs to be retained in the image to be processed, and then the obtained person image is fused with the blurred background image, and all areas of the image to be processed except the area where the person image is located are blurred into the blurred background image, that is, after the image to be processed, the blurred background image and the stable mask image are fused, the output image is obtained, and the output image is sent to the main processing module 11, and the main processing module 11 completes the external output of the received output image to achieve background blur for the image to be processed.
[0071] Optionally, since the edge stabilization unit 133 mainly occupies CPU resources, and each module and unit in the image background blur system can be executed through threads, in order to prevent other modules and units from affecting the thread corresponding to the edge stabilization unit 133, the CPU core processing can be bound to it in advance to avoid other modules and units from affecting the operation of the edge stabilization unit 133, thereby avoiding the time of switching contexts and greatly ensuring the operation efficiency of the edge stabilization unit 133.
[0072] It is understandable that the edge stabilization unit 133 in the embodiment of the present invention can use any edge stabilization algorithm to implement edge stabilization processing of the mask image. Since the edge stabilization algorithm needs to perform downsampling and image format conversion processing on the original image to be processed in accordance with the portrait segmentation unit 131, the downsampling and image format conversion (RGB format conversion) processing functions can be merged into the main processing module 11 as with the portrait segmentation unit 131, and subsequent processing can be performed directly based on the input intermediate image.
[0073] The technical solution of the embodiment of the present invention improves the edge stability of the mask image obtained by portrait extraction by setting an edge stabilization unit, avoids repeated calculation operations of the edge stabilization model by reusing intermediate images, improves calculation efficiency, and pre-allocates central processing unit computing resources to the edge stabilization unit, thereby ensuring the operating stability and efficiency of the function.
[0074] Optional, Figure 5 This is a schematic diagram of the structure of another image background blurring system provided in Embodiment 2 of the present invention. The technical solution of the embodiment of the present invention is further optimized on the basis of the above-mentioned optional technical solutions. Figure 5 As shown, the image fusion module 14 includes a detection and judgment unit 141 and an output image generation unit 142 .
[0075] The detection judgment unit 141 is used to determine the image processing logic instruction according to the head detection result, and send the image processing logic instruction to the output image generation unit 142; when the head detection result is no head, the image logic processing instruction is an image non-fusion instruction; when the head detection result is a head, the image logic processing instruction is an image fusion instruction.
[0076] The output image generation unit 142 is used to determine the image to be processed as the output image when the image logic processing instruction is an image non-fusion instruction, and send the output image to the main processing module 11; when the image logic processing instruction is an image fusion instruction, fuse the image to be processed, the background blurred image and the stable mask image to generate an output image, and send the output image to the main processing module 11.
[0077] In this embodiment, the detection and judgment unit 141 can be specifically understood as a unit in the image fusion module 14 for performing logical judgment on the head detection result to determine whether subsequent image fusion processing is required. The output image generation unit 142 can be specifically understood as a data processing unit in the image fusion module 14 for outputting the received original image to be processed according to the judgment result of the detection and judgment unit 141, or fusing the received images to generate an output image.
[0078] Specifically, when the image fusion module 14 receives the image to be processed, the background blurred image, the stable mask image and the head detection result respectively sent by the main processing module 11, the background blur module 12 and the character processing module 13, the head detection result will be input into the detection judgment unit 141 for logical judgment. When the head detection result is that there is no head, it can be considered that the image to be processed does not need to be blurred. At this time, an image non-fusion instruction is generated as an image processing logic instruction, and the image processing logic instruction is sent to the output image generation unit 142, so that the output image generation unit 142 can directly use the image to be processed as the output image, and send the output image to the main processing module 11, and the main processing module 11 completes the external output of the received output image. When the detection and judgment unit 141 determines that the head detection result is a head, it can be considered that the image to be processed is an image that needs to have the background blurred. At this time, the detection and judgment unit 141 will generate an image fusion instruction as an image processing logic instruction, and send the image processing logic instruction to the output image generation unit 142, so that the output image generation unit 142 can fuse the received image to be processed, the background blurred image and the stable mask image to obtain the output image, and send the output image to the main processing module 11, and the main processing module 11 will complete the external output of the received output image.
[0079] The technical solution of the embodiment of the present invention, by adding a detection and judgment unit for performing logical judgment on the head detection result in the image fusion module, makes it unnecessary to perform image fusion processing on some images to be processed, reduces the data processing amount of the output image generation unit, and correspondingly reduces the resource occupancy rate of the processor corresponding to the image fusion module. Furthermore, since the head detection unit and the portrait segmentation unit are data calculation units for parallel processing, the image is segmented regardless of whether there is a head in the intermediate image. In order to avoid the segmented image processed when there is no head being misclassified, the embodiment of the present invention adds a head detection unit and a detection and judgment unit, so that the image without the head will not be fused, avoiding the output image error caused by the error of the mask image output by the portrait segmentation.
[0080] Optionally, the background blur module 12, the portrait segmentation unit 131 and the head detection unit 132 in the character processing module 13 are processed in parallel within a first time period; the edge stabilization unit 133 and the image fusion module 14 in the character processing module 13 are processed within a second time period; wherein the first time period is earlier than the second time period.
[0081] Specifically, since the input of the background blur module 12 is only related to the image to be processed distributed by the main processing module 11, and the hardware resources occupied by itself are GPU resources; the input of the portrait segmentation unit 131 and the head detection unit 132 in the character processing module 13 is only related to the intermediate image distributed by the main processing module 11, and the hardware resources occupied by the two are NPU resources allocated in proportion, and no conflict occurs, so the background blur module 12, the portrait segmentation unit 131 and the head detection unit 132 in the character processing module 13 can be processed in parallel at the front side of the image background blur system 1, that is, a first time period located at the front side of the image background blur system 1 can be set, so that the background blur module 12, the portrait segmentation unit 131 and the head detection unit 132 in the character processing module 13 can be processed in parallel within this time period.
[0082] Since the input of the edge stabilization unit 133 in the character processing module 13 is not only related to the image to be processed distributed by the main processing module 11, but also related to the mask image output by the portrait segmentation unit 131, the edge stabilization unit 133 needs to be processed after the portrait segmentation unit 131. The image fusion module 14 needs to obtain the output of all previous modules, but the detection and judgment unit 141 in the image fusion module 14 is only related to the head detection result of the head detection unit 132, and the hardware resources mainly relied on by the image fusion module 14 are GPU resources, which do not conflict with the bound CPU core relied on by the edge stabilization unit 133. Therefore, the processing time of the detection and judgment unit 141 can be the same as that of the edge stabilization unit 133, that is, parallel processing. Further, the fusion operation performed by the output image generation unit 142 of the image fusion module 14 has an extremely short running time, and in order to avoid the factor of delayed frames, the edge stabilization unit 133 and the output image generation unit 142 are serially processed in the second time period; a second time period can be selected after the first time period to be used as the processing time period of the edge stabilization unit 133 and the image fusion module 14.
[0083] Optionally, the image fusion module 14 includes operations such as copying the image to be processed, copying the background blurred image, and pixel-by-pixel fusion. Since each pixel is independent and does not interfere with each other during the fusion process, the pixel-by-pixel fusion operation of the image fusion module 14 can be processed in parallel on the GPU, and further, the image to be processed, the background blurred image, and the stabilized mask image can be zero-copy operated on the GPU. After determining the output image, the zero-copy operation can also be used to send the output image to the main processing module 11, so as to save problems such as high CPU occupancy and slow running time caused by data copying.
[0084] The technical solution of the embodiment of the present invention sets a corresponding execution order for different modules based on the different processor resources required by different modules and the processing logic of input information required by different modules. Without causing resource preemption, the data processing efficiency of the image background blur system is improved and the total running time is reduced.
[0085] Optionally, in order to ensure that each module in the image background blurring system 1 can achieve maximum operating efficiency and ensure the timing effectiveness of each module, queues, mutexes and conditional variables may be used for further processing, which may specifically include the following queue addition situations:
[0086] 1) The main processing module 11 is also used to maintain a queue of images to be processed; wherein the wake-up mechanism of the queue of images to be processed corresponding to the conditional variable is that the main processing module 11 obtains input data or the queue of images to be processed is not empty.
[0087] 2) The module with the longest running time in the first time period is also used to maintain the intermediate image queue; wherein the wake-up mechanism of the conditional variable corresponding to the intermediate image queue is that all modules in the first time period have completed running and the intermediate image queue is not empty.
[0088] 3) The detection and judgment unit 141 is also used to maintain a stable mask queue; wherein the wake-up mechanism of the stable mask queue corresponding to the condition variable is that the edge stabilization unit 133 has completed operation and the stable mask queue is not empty.
[0089] 4) The output image generation unit 142 is also used to maintain the output image queue; wherein the wake-up mechanism of the output image queue corresponding to the condition variable is that the output image generation unit 142 has completed running and the output image queue is not empty.
[0090] It is understandable that mutually exclusive locks are added to the queue of images to be processed, the queue of intermediate images, the queue of stable masks, and the queue of output images, which will not be described in detail in the embodiment of the present invention.
[0091] Specifically, since the main processing module 11 needs to process the image to be processed input therein to obtain an intermediate image and distribute it downward, and the image to be processed is data that needs to be obtained by multiple other modules, in order to ensure the correctness of its operation timing, it is necessary to maintain a queue of images to be processed for storing the images to be processed, and set a condition variable for the queue of images to be processed, so that when the condition variable is not satisfied, the main processing module 11 cannot access the queue of images to be processed to obtain the images to be processed, while the queue of images to be processed can accept images to be processed input from the outside, and the wake-up mechanism of the condition variable can indicate that the main processing module 11 has obtained input data or the queue of images to be processed is not empty. Since the modules in the first time period will not change the same intermediate variable and they need to share the intermediate image provided by the main processing module 11, an intermediate image queue for storing the intermediate image can be set up. In order to ensure that the intermediate image queue is always protected by a module, the module with the longest running time in the first time period can be determined as the module that needs to maintain the intermediate image queue. At the same time, a conditional variable is set for the intermediate image queue, so that when the conditional variable is not satisfied, the modules in the first time period cannot obtain the intermediate image from it, while the main processing module 11 can write the intermediate image into it. The wake-up mechanism of the conditional variable can be that all modules in the first time period have completed running and the intermediate image queue is not empty. Since the edge stabilization unit 133 and the detection and judgment unit 141 will not change the same intermediate variable and are independent of each other, and the edge stabilization unit 141 needs to use its output as the input of the output image generation unit 142, it is necessary to distribute a stable mask queue for the output result of the edge stabilization unit 133, and the detection and judgment unit 141 protects the stable mask queue. At the same time, a conditional variable is set for the stable mask queue, so that when the conditional variable is not satisfied, the output image generation unit 142 cannot obtain a stable mask image from it, while the edge stabilization unit 133 can write a stable mask image into it. The wake-up mechanism of the conditional variable can be that the edge stabilization unit 133 has completed its operation and the stable mask queue is not empty. Since the result of the output image generation unit 142 is the final output after the main processing module 11, the output image generation unit 142 itself needs to maintain an output image queue, and set a condition variable for the output image queue so that when the condition variable is not met, the output image cannot be sent to the main processing module 11, but the output image generation unit 142 can write the output image therein. The wake-up mechanism of the condition variable can be that the output image generation unit 142 has completed its operation and the output image queue is not empty.
[0092] The technical solution of the embodiment of the present invention ensures the timing effectiveness and maximization of the operating efficiency of each functional module in the data processing process by setting queues, mutex locks and conditional variables for different modules. At the same time, since conditional variables suitable for the applicable situation are set for the mutex locks of each queue, the mutex locks of each queue will not be awakened directly, but can only be awakened when the awakening conditions of the conditional variables are met, thereby reducing the consumption of CPU resources.
[0093] Embodiment 3
[0094] Figure 6 The flowchart of a method for blurring the background of an image provided in the third embodiment of the present invention is applicable to the system for blurring the background of an image provided in each of the above-mentioned optional technical solutions. The system for blurring the background of an image includes: a main processing module, a background blur module, a character processing module and an image fusion module; the character processing module includes at least one character image processing model. Figure 6 As shown, a method for blurring the background of an image provided by Embodiment 3 of the present invention specifically includes the following steps:
[0095] S301, the main processing module receives an input image to be processed, processes the image to be processed to obtain an intermediate image, sends the image to be processed to the background blur module and the image fusion module, and sends the intermediate image to the character processing module.
[0096] S302: The background blur module performs background blur processing on the image to be processed, and sends the generated background blurred image to the image fusion module.
[0097] S303: The character processing module inputs the intermediate image into each character image processing model for inference processing, and sends the generated character image processing results to the image fusion module.
[0098] S304, the image fusion module generates an output image according to the processing results of the image to be processed, the background blurred image and each character image, and sends the output image to the main processing module, so that the main processing module outputs the output image externally.
[0099] Optionally, the character processing module at least includes a portrait segmentation unit, and the character image processing model corresponding to the portrait segmentation unit is a portrait segmentation model; accordingly, S303 and S304 can be specifically expanded into the following implementation manner:
[0100] The intermediate image is input to the portrait segmentation unit for portrait extraction, and the generated mask image is sent to the image fusion module;
[0101] The image fusion module fuses the image to be processed, the background blurred image and the mask image to generate an output image, and sends the output image to the main processing module so that the main processing module outputs the output image externally.
[0102] Optionally, the character processing module further includes a head detection unit, and the character image processing model corresponding to the head detection unit is a head detection model; accordingly, S303 and S304 can be specifically implemented as follows:
[0103] The intermediate image is input to the portrait segmentation unit for portrait extraction, and the generated mask image is sent to the image fusion module;
[0104] The intermediate image is input to the head detection unit for head detection, and the generated head detection result is sent to the image fusion module;
[0105] The image fusion module determines the output image according to the image to be processed, the background blurred image, the mask image and the head detection result, and sends the output image to the main processing module, so that the main processing module outputs the output image externally;
[0106] Among them, the ratio of computing resources occupied by the portrait segmentation unit and the head detection unit is consistent with the ratio of the inference time of the portrait segmentation model and the head detection model.
[0107] Optionally, the character image processing model further includes an edge stabilization unit, and the character image processing model corresponding to the edge stabilization unit is an edge stabilization model; accordingly, S303 and S304 can be specifically expanded into the following implementation manner:
[0108] The intermediate image is input to the portrait segmentation unit for portrait extraction, and the generated mask image is sent to the edge stabilization unit;
[0109] Inputting the intermediate image to the edge stabilization unit, so that the edge stabilization unit performs edge stabilization processing on the mask image according to the intermediate image, and sending the generated stabilized mask image to the image fusion module;
[0110] The intermediate image is input to the head detection unit for head detection, and the generated head detection result is sent to the image fusion module;
[0111] The image fusion module determines the output image according to the image to be processed, the background blurred image, the stable mask image and the head detection result, and sends the output image to the main processing module, so that the main processing module outputs the output image externally;
[0112] The computing resources occupied by the edge stabilization unit are pre-allocated central processing unit computing resources.
[0113] Optionally, the image fusion module includes: a detection and judgment unit and an output image generation unit. Accordingly, S304 can be implemented in the following manner:
[0114] The detection judgment unit determines an image processing logic instruction according to the head detection result, and sends the image processing logic instruction to the output image generation unit; wherein, when the head detection result is that there is no head, the image logic processing instruction is an image non-fusion instruction; when the head detection result is that there is a head, the image logic processing instruction is an image fusion instruction;
[0115] When the image logic processing instruction is an image non-fusion instruction, the output image generation unit determines the image to be processed as the output image and sends the output image to the main processing module; when the image logic processing instruction is an image fusion instruction, the image to be processed, the background blurred image and the stable mask image are fused to generate the output image, and the output image is sent to the main processing module.
[0116] Optionally, the background blur module, the portrait segmentation unit in the character processing module and the head detection unit are processed in parallel within a first time period; the edge stabilization unit and the image fusion module in the character processing module are processed within a second time period; wherein the first time period is earlier than the second time period.
[0117] Optionally, the main processing module further maintains a queue of images to be processed; wherein the wake-up mechanism of the queue of images to be processed corresponding to the conditional variable obtains input data for the main processing module or the queue of images to be processed is not empty;
[0118] The module with the longest running time in the first time period also maintains an intermediate image queue; wherein the wake-up mechanism of the condition variable corresponding to the intermediate image queue is that all modules in the first time period have finished running and the intermediate image queue is not empty;
[0119] The detection and judgment unit also maintains a stable mask queue; wherein the wake-up mechanism of the stable mask queue corresponding to the condition variable is that the edge stabilization unit has completed operation and the stable mask queue is not empty;
[0120] The output image generation unit also maintains an output image queue; wherein the wake-up mechanism of the output image queue corresponding to the condition variable is that the output image generation unit has completed running and the output image queue is not empty.
[0121] The technical solution of this embodiment analyzes the inference input requirements of multiple character image processing models in the character processing module of the image background blurring system, transfers the common, repetitive, and time-consuming image processing operations to the main processing module for unified execution, and sends the processed intermediate image to the character processing module for corresponding inference processing by each character image processing model, so that the common processing of the image to be processed by different character image processing models is performed only once by the main processing module, so that the processor resources related to the common processing will not be repeatedly occupied, thereby avoiding the competition among different character image processing modules for the processor resources required for the common processing, saving the time required for different character image processing models to process the image to be processed, and improving the data processing efficiency and processor resource utilization of the image background blurring system.
[0122] Embodiment 4
[0123] Figure 7 A schematic diagram of the structure of an image background blur device provided for Embodiment 4 of the present invention. The image background blur device 40 may be intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The image background blur device 40 may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0124] like Figure 7As shown, the image background blurring device 40 includes the image background blurring system 1 provided by any embodiment of the present invention, at least three different types of processors 41, and a memory connected to the at least three processors 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc. Wherein, the processor 41 may include a graphics acceleration engine (Raster Graphic Acceleration Unit, RGA), an embedded neural network processor (Neural Processing Units, NPU), a graphics processor (Graphics Processing Unit, GPU) and a central processing unit (Central Processing Unit, CPU), etc., and the embodiment of the present invention does not limit this. Wherein, the first type of processor is used to support the processing of the image to be processed by the main processing module in the image background blurring system 1, the second type of processor is used to support the reasoning processing of the character processing module in the image background blurring system 1, and other types of processors are used to support other types of data processing in the image background blurring system 1. The memory stores computer programs that can be executed by at least three different types of processors, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the image background blur device 40 can also be stored. The image background blur system 1, the processor 41, the ROM 42 and the RAM 43 are connected to each other via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0125] A number of components in the image background blurring device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the image background blurring device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0126] The processor 41 may be a variety of general and / or dedicated processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 performs the various methods and processes described above, such as an image background blur method.
[0127] In some embodiments, the image background blurring method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on the image background blurring device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the image background blurring method described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to perform the image background blurring method in any other suitable manner (e.g., by means of firmware).
[0128] Optionally, an embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the image background blurring method provided by any embodiment of the present invention.
[0129] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0130] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0131] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0132] To provide interaction with a user, the systems and techniques described herein may be implemented on an image blur device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) through which a user can provide input to the image blur device. Other types of devices may also be used to provide interaction with a user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0133] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0134] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0135] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0136] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An image background blurring system, characterized in that: include: A main processing module, a background blur module, a character processing module and an image fusion module; wherein the character processing module includes at least one character image processing model; The main processing module is used to receive an input image to be processed, process the image to be processed to obtain an intermediate image, send the image to be processed to the background blur module and the image fusion module, and send the intermediate image to the character processing module; The background blur module is used to perform background blur processing on the image to be processed, and send the generated background blurred image to the image fusion module; The character processing module is used to input the intermediate image into each character image processing model for inference processing, and send the generated character image processing results to the image fusion module; The image fusion module is used to generate an output image based on the image to be processed, the background blurred image and the processing results of each character image, and send the output image to the main processing module so that the main processing module can output the output image externally.
2. The system according to claim 1, characterized in that The character processing module at least includes a portrait segmentation unit, and the character image processing model corresponding to the portrait segmentation unit is a portrait segmentation model; the character processing module is specifically used to: Inputting the intermediate image to the portrait segmentation unit to extract the portrait, and sending the generated mask image to the image fusion module; Correspondingly, the image fusion module is specifically used to fuse the image to be processed, the background blurred image and the mask image to generate an output image, and send the output image to the main processing module so that the main processing module outputs the output image externally.
3. The system according to claim 2, characterized in that The character processing module further includes a head detection unit, and the character image processing model corresponding to the head detection unit is a head detection model; the character processing module is specifically used to: Inputting the intermediate image to the head detection unit for head detection, and sending the generated head detection result to the image fusion module; Accordingly, the image fusion module is specifically used to determine the output image according to the image to be processed, the background blurred image, the mask image and the head detection result, and send the output image to the main processing module, so that the main processing module outputs the output image externally; Among them, the ratio of computing resources occupied by the portrait segmentation unit and the head detection unit is consistent with the ratio of the inference time of the portrait segmentation model and the head detection model.
4. The system according to claim 3, characterized in that The character image processing model further includes an edge stabilization unit, and the character image processing model corresponding to the edge stabilization unit is an edge stabilization model; the character processing module is specifically used for: Inputting the intermediate image to the portrait segmentation unit to extract the portrait, and sending the generated mask image to the edge stabilization unit; Inputting the intermediate image to the edge stabilization unit, so that the edge stabilization unit performs edge stabilization processing on the mask image according to the intermediate image, and sending the generated stabilized mask image to the image fusion module; Correspondingly, the image fusion module is specifically used to determine the output image according to the image to be processed, the background blurred image, the stable mask image and the head detection result, and send the output image to the main processing module, so that the main processing module outputs the output image externally; The computing resources occupied by the edge stabilization unit are pre-allocated central processing unit computing resources.
5. The system according to claim 4, characterized in that The image fusion module includes: a detection and judgment unit and an output image generation unit; The detection judgment unit is used to determine an image processing logic instruction according to the head detection result, and send the image processing logic instruction to the output image generation unit; wherein, when the head detection result is no head, the image logic processing instruction is an image non-fusion instruction; when the head detection result is a head, the image logic processing instruction is an image fusion instruction; The output image generation unit is used to determine the image to be processed as the output image when the image logic processing instruction is an image non-fusion instruction, and send the output image to the main processing module; when the image logic processing instruction is an image fusion instruction, fuse the image to be processed, the background blurred image and the stable mask image to generate an output image, and send the output image to the main processing module.
6. The system according to claim 5, characterized in that The background blur module, the portrait segmentation unit in the character processing module and the head detection unit perform parallel processing in a first time period; The edge stabilization unit and the image fusion module in the character processing module process in a second time period; The first time period is earlier than the second time period.
7. The system according to claim 6, characterized in that The main processing module is further used to maintain a queue of images to be processed; wherein the wake-up mechanism of the conditional variable corresponding to the queue of images to be processed is that the main processing module obtains input data or the queue of images to be processed is not empty; The module with the longest running time in the first time period is also used to maintain the intermediate image queue; wherein the wake-up mechanism of the intermediate image queue corresponding to the condition variable is that all modules in the first time period have finished running and the intermediate image queue is not empty; The detection and judgment unit is further used to maintain a stable mask queue; wherein the wake-up mechanism of the stable mask queue corresponding to the condition variable is that the edge stabilization unit has completed operation and the stable mask queue is not empty; The output image generation unit is further used to maintain an output image queue; wherein the wake-up mechanism of the output image queue corresponding to the conditional variable is that the output image generation unit has completed running and the output image queue is not empty.
8. A method for blurring the background of an image, characterized in that: Applied in the image background blurring system as claimed in any one of claims 1 to 7, the image background blurring system comprises: a main processing module, a background blurring module, a character processing module and an image fusion module; wherein the character processing module comprises at least one character image processing model; the method comprises: The main processing module receives an input image to be processed, processes the image to be processed to obtain an intermediate image, sends the image to be processed to the background blur module and the image fusion module, and sends the intermediate image to the character processing module; The background blur module performs background blur processing on the image to be processed, and sends the generated background blurred image to the image fusion module; The character processing module inputs the intermediate image into each character image processing model for inference processing, and sends the generated character image processing results to the image fusion module; The image fusion module generates an output image according to the processing results of the image to be processed, the background blurred image and each of the character images, and sends the output image to the main processing module so that the main processing module outputs the output image externally.
9. An image background blurring device, characterized in that: include: The image background blurring system as claimed in any one of claims 1 to 7; at least three processors of different types, and a memory communicatively coupled to the at least three processors of different types; The first type of processor is used to support the processing of the image to be processed by the main processing module in the image background blur system, the second type of processor is used to support the reasoning processing of the character processing module in the image background blur system, and other types of processors are used to support other types of data processing in the image background blur system; The memory stores a computer program that can be executed by the at least three different types of processors, and the computer program is executed by the at least three different types of processors so that the at least three different types of processors can support the image background blur system described in any one of claims 1 to 7 to execute the image background blur method described in claim 8.
10. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to perform the image background blurring method as claimed in claim 8 when executed by a computer processor.
