Video processing method and device, electronic equipment and computer readable storage medium
By connecting electronic devices with servers to acquire and blur video based on scene type, the problem of low visual richness after video blurring in existing technologies is solved, thus achieving richer visual effects and enhanced artistry in videos.
Patent Information
- Application Number
- CN202410032592.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-09
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2044-01-09
AI Technical Summary
The visual effects of video blurring in existing technologies are relatively limited.
By communicating with the server through electronic devices, the system obtains the effect parameter configuration information and image information of each frame of the image to be processed. It then performs blurring processing according to the scene type, including Gaussian blur and fusion processing, to generate a video with rich visual effects.
It enhances the visual richness of the video and strengthens its artistic and privacy aspects.
Smart Images

Figure CN117853980B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a video processing method and device, electronic equipment and computer readable storage medium. BACKGROUND
[0002] With the development of technology, a soft and blurred visual effect similar to frosted glass can be created on images in a video. This visual effect is often used in design to give the video artistic and abstract feeling, or to improve the privacy of the video. In the process of realizing this visual effect in the video, Gaussian blur, mean blur and other methods can be used, or random elements can be introduced and transparency can be adjusted to achieve the desired effect.
[0003] In the prior art, the related parameters for blurring the images in the video under different scenes are single, resulting in low richness of the visual effect of the blurred video. SUMMARY
[0004] The purpose of the present application is to provide a video processing method and device, electronic equipment and computer readable storage medium to solve the problem of low richness of the visual effect of the blurred video in the prior art.
[0005] In a first aspect, the present application provides a video processing method applied to an electronic device, wherein the electronic device is in communication connection with a server, the server stores a corresponding relationship between scene types and effect parameter configuration information, and the method comprises:
[0006] obtaining a to-be-processed video, effect parameter configuration information corresponding to each frame of to-be-processed image and image information of each frame of to-be-processed image from the server; the effect parameter configuration information corresponding to each frame of to-be-processed image is determined according to the scene type of the to-be-processed image and the corresponding relationship, and each frame of to-be-processed image is obtained by identifying the to-be-processed video by the server;
[0007] performing blurring processing on each frame of to-be-processed image according to the effect parameter configuration information and image information corresponding to each frame of to-be-processed image, to obtain all visual effect images, so as to obtain a video with visual effect.
[0008] In an optional implementation, the blurring processing on each frame of to-be-processed image according to the effect parameter configuration information and image information corresponding to each frame of to-be-processed image to obtain all visual effect images comprises:
[0009] performing blurring processing on the corresponding to-be-processed image according to the effect parameter configuration information and image information, respectively, to obtain all to-be-fused images;
[0010] According to the image information, the corresponding to-be-fused image and the corresponding to-be-processed image are fused to obtain all the visual effect images.
[0011] In an optional embodiment, the electronic device stores a scaling condition. The blurring of the corresponding to-be-processed image according to the effect parameter configuration information and the image information to obtain all the to-be-fused images includes:
[0012] If the image information meets the scaling condition, the corresponding to-be-processed image is scaled to obtain a corresponding scaled image, the scaled image is Gaussian blurred according to the effect parameter configuration information to obtain a corresponding first Gaussian blurred image, and the first Gaussian blurred image is up-sampled to obtain a corresponding to-be-fused image.
[0013] If the image information does not meet the scaling condition, the corresponding to-be-processed image is Gaussian blurred according to the effect parameter configuration information to obtain a corresponding second Gaussian blurred image, and the second Gaussian blurred image is up-sampled to obtain a corresponding to-be-fused image.
[0014] In an optional embodiment, the image information of each to-be-processed image includes an image resolution. If the image resolution is greater than a preset resolution, it is indicated that the image information meets the scaling condition. If the image resolution is less than the preset resolution, it is indicated that the image information does not meet the scaling condition.
[0015] In an optional embodiment, the preset resolution includes a preset width resolution and a preset height resolution, and the image resolution includes a width image resolution and a height image resolution. The scaling of the corresponding to-be-processed image to obtain a corresponding scaled image includes:
[0016] A width scaling ratio is obtained by calculating a ratio of the width image resolution to the preset width resolution.
[0017] A height scaling ratio is obtained by calculating a ratio of the height image resolution to the preset height resolution.
[0018] The greater of the width scaling ratio and the height scaling ratio is determined as a target scaling ratio.
[0019] The corresponding to-be-processed image is scaled according to the target scaling ratio to obtain a corresponding scaled image.
[0020] In an optional embodiment, the image information includes a to-be-blurred region. The fusion of the corresponding to-be-fused image and the corresponding to-be-processed image according to the image information to obtain all the visual effect images includes:
[0021] fusing the first to-be-fused region and a corresponding second to-be-fused region to obtain all the visual effect images; the first to-be-fused region is a to-be-blurred region of a to-be-fused image, and the second to-be-fused region is a to-be-blurred region of a to-be-processed image.
[0022] In a second aspect, the present application provides a video processing device applied to an electronic device, the electronic device being in communication connection with a server, the server storing a corresponding relationship between scene types and effect parameter configuration information, and the device comprising:
[0023] a video acquisition module, configured to acquire a to-be-processed video, effect parameter configuration information corresponding to each frame of to-be-processed image, and image information of each frame of the to-be-processed image from the server; the effect parameter configuration information corresponding to each frame of the to-be-processed image being determined according to a scene type of the to-be-processed image and the corresponding relationship, and each frame of the to-be-processed image being obtained by identifying the to-be-processed video by the server;
[0024] a blur processing module, configured to perform blur processing on each frame of the to-be-processed image according to the effect parameter configuration information corresponding to each frame of the to-be-processed image and the image information, to obtain all visual effect images, so as to obtain a video with visual effects.
[0025] In an optional implementation, the blur processing module is further configured to perform blur processing on a corresponding to-be-processed image according to the effect parameter configuration information and the image information respectively, to obtain all to-be-fused images; and perform fusion processing on a corresponding to-be-fused image and a corresponding to-be-processed image according to the image information, to obtain all the visual effect images.
[0026] In a third aspect, the present application provides an electronic device comprising a processor and a memory, the memory storing a computer program capable of being executed by the processor, and the computer program executable by the processor realizing the video processing method of any one of the preceding embodiments.
[0027] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the video processing method of any one of the preceding embodiments.
[0028] The video processing method, device, electronic equipment and computer readable storage medium provided by the embodiment of the present application are applied to an electronic equipment, the electronic equipment is in communication connection with a server, the server stores a corresponding relationship between a scene type and effect parameter configuration information, the method comprises the following steps: obtaining a to-be-processed video, effect parameter configuration information corresponding to each frame of to-be-processed image and image information of each frame of to-be-processed image from the server, the effect parameter configuration information corresponding to each frame of to-be-processed image is determined according to the scene type of the to-be-processed image and the corresponding relationship, each frame of to-be-processed image is obtained by identifying the to-be-processed video by the server, each frame of to-be-processed image is processed according to the effect parameter configuration information corresponding to each frame of to-be-processed image and the image information, and all visual effect images are obtained to obtain a video with visual effects. The corresponding to-be-processed image is processed according to the effect parameter configuration information corresponding to the scene type of each frame of to-be-processed image, and images with different visual effects are obtained, so that the richness of the visual effects of the video is improved. BRIEF DESCRIPTION OF DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.
[0030] Figure 1 An application environment schematic diagram of the video processing method provided by the embodiment of the present application is shown;
[0031] Figure 2 A flow schematic diagram of the video processing method provided by the embodiment of the present application is shown;
[0032] Figure 3 Another flow schematic diagram of the video processing method provided by the embodiment of the present application is shown;
[0033] Figure 4 An illustrative diagram of the visual effect image provided by the embodiment of the present application is shown;
[0034] Figure 5 A module block diagram of the video processing device provided by the embodiment of the present application is shown;
[0035] Figure 6 A block schematic diagram of the electronic equipment provided by the embodiment of the present application is shown.
[0036] Icon: 100-electronic equipment; 200-server; 300-video processing device; 310-video acquisition module; 320-fuzzy processing module; 110-memory; 120-processor; 130-communication module. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0038] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0039] It should be noted that 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 process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0040] Please see Figure 1 , Figure 1 This diagram illustrates an application environment for the video processing method provided in this embodiment of the invention. Electronic device 100 and server 200 are located in a network. Electronic device 100 can communicate with server 200 to achieve data interaction between them. Alternatively, the electronic device 100 and server 200 can connect via WIFI, ZigBee, or 2G / 3G / 4G / 5G, and this is not limited to any particular method.
[0041] Please see Figure 2 , Figure 2 This diagram illustrates a flow chart of a video processing method provided by an embodiment of the present invention. This video processing method can be applied to an electronic device. The electronic device is communicatively connected to a server, which stores the correspondence between scene types and effect parameter configuration information. The specific flow of this embodiment is described below using an electronic device as an example. The following section focuses on... Figure 3The flow shown is described in detail, and the video processing method can specifically include the following steps:
[0042] Step S110: Obtain the to-be-processed video, the effect parameter configuration information corresponding to each frame of to-be-processed image, and the image information of each frame of to-be-processed image from the server.
[0043] The to-be-processed image is an image in the to-be-processed video that needs to be processed, and the effect parameter configuration information corresponding to each frame of to-be-processed image is determined according to the scene type of each frame of to-be-processed video and the corresponding relationship. Each frame of to-be-processed image and the scene type of each frame of to-be-processed image are obtained by identifying each frame of image of the to-be-processed video by the server.
[0044] In some embodiments, the server can be connected with a plurality of acquisition devices, the acquisition device end is used for acquiring a video, and the acquired video is sent to the server. The server stores a plurality of videos. The electronic device can receive a visual effect processing instruction and send the visual effect processing instruction to the server. The server determines a to-be-processed video from the plurality of videos according to the visual effect processing instruction. The server identifies each frame of image in the to-be-processed video, obtains a plurality of frames of to-be-processed images, the scene type of each frame of to-be-processed image, and the image information of each frame of to-be-processed image, and determines the effect parameter configuration information corresponding to each frame of to-be-processed image according to the scene type of each frame of to-be-processed video and the corresponding relationship. The server sends the to-be-processed video, the plurality of frames of to-be-processed images, the effect parameter configuration information corresponding to each frame of to-be-processed image, and the image information of each frame of to-be-processed image to the electronic device, so that the electronic device performs blur processing on each frame of to-be-processed image according to the effect parameter configuration information corresponding to each frame of to-be-processed image and the image information. The to-be-processed video can be a live video, an explanation video, a promotional video, a demonstration video, and the like, which is not limited herein.
[0045] For example, the server stores a corresponding relationship between the scene type and the effect parameter configuration information, as shown in Table 1. If the scene type of the to-be-processed image 1 is scene type 1, the effect parameter configuration information corresponding to the to-be-processed image 1 is effect parameter configuration information 1. If the scene type of the to-be-processed image 1 is scene type 2, the effect parameter configuration information corresponding to the to-be-processed image 1 is effect parameter configuration information 2.
[0046] Table 1
[0047]
[0048]
[0049] In some embodiments, the user can configure the effect parameters in the server according to the visual effects exhibited by different scenes in actual application, and the server stores the correspondence between the scene types and the effect parameter configuration information, which can include the blur degree parameter, the blur radius parameter, and the system support parameter, without limitation.
[0050] It should be noted that each frame of the to-be-processed image is an image in the to-be-processed video that needs to be blurred, and thus, if each frame of the to-be-processed video needs to be blurred, the total number of frames of all the to-be-processed images is equal to the total number of frames of the to-be-processed video; if only part of the images in the to-be-processed video need to be blurred, the total number of frames of all the to-be-processed images is less than the total number of frames of the to-be-processed video.
[0051] In some embodiments, the server is provided with a scene recognition system, the server identifies each frame of the to-be-processed image through the scene recognition system, obtains the multiple frames of to-be-processed images, the scene type of each frame of the to-be-processed image, and the image information of each frame of the to-be-processed image, and sends the multiple frames of to-be-processed images, the scene type of each frame of the to-be-processed image, and the image information of each frame of the to-be-processed image to the electronic device.
[0052] Step S120: blurring each frame of the to-be-processed image according to the effect parameter configuration information corresponding to each frame of the to-be-processed image and the image information to obtain all the visual effect images, so as to obtain the video with visual effects.
[0053] In some embodiments, the electronic device can blur each frame of the to-be-processed image according to the effect parameter configuration information corresponding to each frame of the to-be-processed image and the image information sent by the server to obtain all the visual effect images, where the blurring manner of each frame of the to-be-processed image can be Gaussian blurring, mean blurring, or the like without limitation. The visual effect in the visual effect image can be a frosted glass effect, a mosaic effect, or the like without limitation.
[0054] It should be noted that the frosted glass effect is a soft and blurred visual effect on the image similar to frosted glass.
[0055] It can be understood that the effect parameter configuration information corresponding to each frame of the to-be-processed image is determined by the scene type of each frame of the to-be-processed image, and each frame of the visual effect image is blurred according to the effect parameter configuration information corresponding to each frame of the to-be-processed image, and thus the visual effects of the visual effect images of different scene types are different, thereby improving the richness of the visual effects of the video.
[0056] In some embodiments, the video to be processed includes source video images in addition to the image to be processed. After all visual effect images are obtained, the source video images and the visual effect images are sorted according to the time stamps of each frame of image to obtain a video with visual effects.
[0057] In some embodiments, the electronic device is provided with a graphics processing unit (GPU). The electronic device can perform blur processing on each frame of image to be processed according to the effect parameter configuration information corresponding to each frame of image to be processed and the image information, to obtain all visual effect images. The blur processing on the image to be processed is completed in the GPU, and the image to be processed does not need to be sent to the central processing unit (CPU) for blur processing. The CPU obtains a video with visual effects, and sends the video to the GPU for video output and display. In this way, the image to be processed between the CPU and the GPU can be avoided, and the efficiency of video processing can be improved.
[0058] In some embodiments, the effect parameter configuration information corresponding to different scene types can be configured into an application programming interface (API) corresponding to the scene type, and the API corresponding to the scene type of the image to be processed can be directly called when the image to be processed is blurred to obtain a visual effect image. The corresponding API can be modified according to the actual use when the effect of the visual effect image is modified, and the visual effect image with the corresponding effect can be obtained, so as to meet the customized visual experience.
[0059] The video processing method provided by the embodiment of the application obtains a video to be processed, effect parameter configuration information corresponding to each frame of image to be processed, and image information of each frame of image to be processed from a server. The effect parameter configuration information corresponding to each frame of image to be processed is determined according to the scene type of the image to be processed and the corresponding relationship. Each frame of image to be processed is obtained by identifying the video to be processed by the server. Each frame of image to be processed is blurred according to the effect parameter configuration information corresponding to each frame of image to be processed and the image information, to obtain all visual effect images, so as to obtain a video with visual effects. The corresponding image to be processed is blurred according to the effect parameter configuration information corresponding to the scene type of each frame of image to be processed, so that the visual effects of the visual effect images of different scene types are different, thereby improving the richness of the visual effects of the video.
[0060] In some embodiments, referring to Figure 3 , step S120 further includes the following steps:
[0061] Step S121: blur processing is performed on the corresponding to-be-processed image according to the effect parameter configuration information and the image information respectively, to obtain all to-be-fused images.
[0062] In some embodiments, the electronic device can perform blur processing on the to-be-processed image by using a Gaussian blur algorithm. The electronic device can scale the to-be-processed image, and perform Gaussian blur processing on the scaled to-be-processed image, so that the performance consumption of the Gaussian blur algorithm can be reduced.
[0063] In some embodiments, the electronic device stores a scaling condition. If the image information satisfies the scaling condition, scaling processing is performed on the corresponding to-be-processed image to obtain a corresponding scaled image, Gaussian blur processing is performed on the scaled image according to the effect parameter configuration information to obtain a corresponding first Gaussian blur image, and up-sampling is performed on the first Gaussian blur image to obtain a corresponding to-be-fused image. If the image information does not satisfy the scaling condition, Gaussian blur processing is performed on the corresponding to-be-processed image according to the effect parameter configuration information to obtain a corresponding second Gaussian blur image, and up-sampling is performed on the second Gaussian blur image to obtain a corresponding to-be-fused image. It can be understood that the to-be-fused image is obtained by performing blur processing on the to-be-processed image, and thus the to-be-fused image is the to-be-processed image with a blur effect.
[0064] In some embodiments, the electronic device can perform Gaussian blur processing on the to-be-processed image by using a Gaussian blur algorithm. The blur calculation is first performed on the to-be-processed image or the scaled image in the long direction, and then the blur calculation is performed on the to-be-processed image or the scaled image in the wide direction, to obtain the first Gaussian blur image or the second Gaussian blur image.
[0065] In some embodiments, the scaling conditions stored in different electronic devices can be different or the same. The scaling condition stored in the electronic device can be determined according to the performance of the GPU provided in the electronic device.
[0066] In some embodiments, the image information of each to-be-processed image includes an image resolution. If the image resolution is greater than a preset resolution, it is indicated that the image information satisfies the scaling condition. If the image resolution is less than the preset resolution, it is indicated that the image information does not satisfy the scaling condition.
[0067] For example, the preset resolution is 1920*1080. It is assumed that the image resolution of the to-be-processed image 1 is 2560*1440, and the image resolution of the to-be-processed image 1 is greater than the preset resolution. Therefore, the image information of the to-be-processed image 1 satisfies the scaling condition. It is assumed that the image resolution of the to-be-processed image 1 is 1280*720, and the image resolution of the to-be-processed image 1 is less than the preset resolution. Therefore, the image information of the to-be-processed image 1 does not satisfy the scaling condition.
[0068] In some embodiments, the electronic device stores a preset scaling ratio, and if the image information satisfies a scaling condition, the corresponding to-be-processed image is scaled according to the preset scaling ratio to obtain a corresponding scaled image.
[0069] In some embodiments, the preset resolution includes a preset width resolution and a preset height resolution, the image resolution includes a width image resolution and a height image resolution, a ratio of the width image resolution to the preset width resolution is calculated to obtain a width scaling ratio, a ratio of the height image resolution to the preset height resolution is calculated to obtain a height scaling ratio, the greater of the width scaling ratio and the height scaling ratio is determined as a target scaling ratio, and the corresponding to-be-processed image is scaled according to the target scaling ratio to obtain a corresponding scaled image.
[0070] For example, the preset resolution is 1920*1080, the preset width resolution is 1080, the preset height resolution is 1920, the image resolution of the to-be-processed image 1 is 4096*2160, the width image resolution is 2160, and the height image resolution is 4096. A ratio of the width image resolution to the preset width resolution is calculated to obtain a width scaling ratio of 2 (2160 / 1080=2), a ratio of the height image resolution to the preset height resolution is calculated to obtain a height scaling ratio of 2.13 (4096 / 1920=2.13), the height scaling ratio (2.13) is determined as the target scaling ratio, the to-be-processed image 1 is scaled according to the target scaling ratio to obtain a corresponding scaled image, and the resolution of the scaled image is 1920*1014 (1920=4096 / 2.13; 1014=2160 / 2.13).
[0071] In some embodiments, the preset resolution includes a preset width resolution and a preset height resolution, the image resolution includes a width image resolution and a height image resolution, a ratio of the preset width resolution to the width image resolution is calculated to obtain a width scaling ratio, a ratio of the preset height resolution to the height image resolution is calculated to obtain a height scaling ratio, the smaller of the width scaling ratio and the height scaling ratio is determined as a target scaling ratio, and the corresponding to-be-processed image is scaled according to the target scaling ratio to obtain a corresponding scaled image.
[0072] For example, the preset resolution is 1920*1080, the preset width resolution is 1080, the preset height resolution is 1920, the image resolution of the to-be-processed image 1 is 4096*2160, the width image resolution is 2160, and the height image resolution is 4096. A ratio of the preset width resolution and the width image resolution is calculated to obtain a width scaling factor of 0.5 (1080 / 2160=0.5). A ratio of the height image resolution and the preset height resolution is calculated to obtain a height scaling factor of 0.47 (4096 / 1920=0.47). The height scaling factor (0.47) is determined as a target scaling factor. The to-be-processed image 1 is scaled according to the target scaling factor to obtain a corresponding scaled image. The resolution of the scaled image is 1925*1015 (1925=4096*0.47; 1015=2160*0.47).
[0073] Step S122: The corresponding to-be-fused image and the corresponding to-be-processed image are fused according to the image information to obtain the all-visual-effect image.
[0074] In some embodiments, the image information includes a to-be-blurred region. The first to-be-fused region and the corresponding second to-be-fused region are fused to obtain the all-visual-effect image. The first to-be-fused region is a to-be-blurred region of the to-be-fused image, and the second to-be-fused region is a to-be-blurred region of the to-be-processed image.
[0075] In some embodiments, the image information can include an image identifier. The image identifier of the to-be-fused image is the same as that of the corresponding to-be-processed image. The electronic device can determine the to-be-processed image corresponding to the to-be-fused image through the image identifier. For example, the to-be-processed image includes a to-be-processed image 1 and a to-be-processed image 2. The to-be-fused image 1 is an image obtained after processing the to-be-processed image 1. The image identifier of the to-be-fused image 1 is the same as that of the to-be-processed image 1, and the image identifier of the to-be-fused image 1 is not the same as that of the to-be-processed image 2.
[0076] It should be noted that the to-be-fused image is a to-be-processed image with a blur effect, the to-be-processed image does not have a blur effect, the image in the first to-be-fused region has a blur effect, the image in the second to-be-fused region does not have a blur effect, and the position of the first to-be-fused region in the to-be-fused image is the same as that of the corresponding second to-be-fused region in the to-be-processed image. That is, the image of the to-be-blurred region in the to-be-fused image with a blur effect is fused with the image of the to-be-blurred region in the corresponding to-be-processed image to obtain the image of the blurred region in the visual effect image, and then the visual effect image is obtained. The image of the blurred region in the visual effect image has a blur effect, the image of the visual effect image except the blurred region is the image of the to-be-processed image except the to-be-blurred region, and the image of the visual effect image except the blurred region does not have a blur effect.
[0077] For example, as shown in Figure 4 The first to-be-fused region includes to-be-blurred region A1 and to-be-blurred region B1 of the to-be-fused image 21, the images of the to-be-blurred region A1 and the to-be-blurred region B1 have a blur effect, the to-be-fused image 21 is an image obtained by performing a blur process on the to-be-processed image 22, the second to-be-fused region includes to-be-blurred region A2 and to-be-blurred region B2 of the to-be-processed image 22, the images of the to-be-blurred region A2 and the to-be-blurred region B2 have no blur effect, the image of the to-be-blurred region A1 is fused with the image of the to-be-blurred region A2 to obtain an image of a blurred region A3, the image of the to-be-blurred region B1 is fused with the image of the to-be-blurred region B2 to obtain an image of a blurred region B3, and a visual effect image 23 is obtained, the images of the blurred region A3 and the blurred region B3 in the visual effect image 23 have a blur effect, and the images other than the blurred region A3 and the blurred region B3 in the visual effect image 23 are images other than the to-be-blurred region A2 and the to-be-blurred region B2 in the to-be-processed image 22, and the images other than the blurred region A3 and the blurred region B3 in the visual effect image 23 have no blur effect.
[0078] The video processing method provided by the embodiment of the present application can maintain the visual effects of high-resolution images and low-resolution images at all times and can also reduce performance consumption in the Gaussian blur process.
[0079] To perform the corresponding steps in the above embodiments and various possible manners, an implementation manner of a video processing apparatus is given below. Further, please refer to Figure 5 , which is a functional module diagram of a video processing apparatus provided by an embodiment of the present application. It should be noted that the basic principle and the generated technical effects of the video processing apparatus provided by the present embodiment are the same as those of the above embodiments, and for brief description, the part not mentioned in the present embodiment can be referred to the corresponding content in the above embodiments. The video processing apparatus 300 includes a video acquisition module 310 and a blur processing module 320, wherein:
[0080] The video acquisition module 310 is configured to acquire, from a server, a to-be-processed video, effect parameter configuration information corresponding to each frame of to-be-processed image, and image information of each frame of to-be-processed image; the effect parameter configuration information corresponding to each frame of to-be-processed image is determined according to a scene type of the to-be-processed image and a corresponding relationship; and each frame of to-be-processed image is obtained by identifying the to-be-processed video by the server;
[0081] The blur processing module 320 is configured to perform blur processing on each of the to-be-processed images according to the effect parameter configuration information corresponding to the to-be-processed image and the image information, and obtain all visual effect images to obtain a video with visual effects.
[0082] Further, the blur processing module 320 is specifically configured to perform blur processing on the corresponding to-be-processed image according to the effect parameter configuration information and the image information, respectively, to obtain all to-be-fused images; and perform fusion processing on the corresponding to-be-fused image and the corresponding to-be-processed image according to the image information to obtain all visual effect images.
[0083] Further, the electronic device stores a scaling condition, and the blur processing module 320 is specifically configured to, if the image information satisfies the scaling condition, perform scaling processing on the corresponding to-be-processed image to obtain a corresponding scaled image, perform Gaussian blur processing on the scaled image according to the effect parameter configuration information to obtain a corresponding first Gaussian blur image, and perform up-sampling on the first Gaussian blur image to obtain the corresponding to-be-fused image; or if the image information does not satisfy the scaling condition, perform Gaussian blur processing on the corresponding to-be-processed image according to the effect parameter configuration information to obtain a corresponding second Gaussian blur image, and perform up-sampling on the second Gaussian blur image to obtain the corresponding to-be-fused image.
[0084] Further, the preset resolution includes a preset width resolution and a preset height resolution, the image resolution includes a width image resolution and a height image resolution, and the blur processing module 320 is specifically configured to calculate a ratio of the width image resolution to the preset width resolution to obtain a width scaling factor, calculate a ratio of the height image resolution to the preset height resolution to obtain a height scaling factor, determine a target scaling factor as a larger one of the width scaling factor and the height scaling factor, and perform scaling processing on the corresponding to-be-processed image according to the target scaling factor to obtain a corresponding scaled image.
[0085] Further, the image information includes a blur region, and the blur processing module 320 is specifically configured to fuse the first to-be-fused region and the corresponding second to-be-fused region to obtain all visual effect images; the first to-be-fused region is a blur region of the to-be-fused image, and the second to-be-fused region is a blur region of the to-be-processed image.
[0086] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and module can refer to the corresponding process in the foregoing method embodiments, which will not be described herein.
[0087] In several embodiments provided in the present application, the coupling between the modules can be electrical, mechanical or other forms of coupling.
[0088] In addition, each function module in each embodiment of the present application can be integrated in one processing module, or each module can exist physically independently, or two or more modules can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software function module.
[0089] Please refer to Figure 6 is a block schematic diagram of an electronic device 100 provided by an embodiment of the present application. The electronic device 100 includes a memory 110, a processor 120, and a communication module 130. The memory 110, the processor 120, and the communication module 130 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the elements can be electrically connected to each other through one or more communication buses or signal lines.
[0090] The memory 110 is configured to store programs or data. The memory 110 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), and the like.
[0091] The processor 120 is configured to read / write the data or programs stored in the memory and perform corresponding functions. For example, when the computer program stored in the memory 110 is executed by the processor 120, the video processing method disclosed in each embodiment described above can be realized.
[0092] The communication module 130 is configured to establish a communication connection between the electronic device 100 and a server 200 through a network, and to receive and transmit data through the network.
[0093] It should be understood that Figure 6 The structure shown is only a structural schematic diagram of the electronic device, and the electronic device can include more or fewer components than those shown in Figure 6 The components shown in the above can be realized in the form of hardware, software, or a combination thereof. Figure 6
[0094] An embodiment of the present application further provides a computer readable storage medium, and the computer readable medium stores a computer program. The computer program can be executed by the processor to realize the video processing method described in the above method embodiment.
[0095] The computer-readable storage medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or any other suitable medium, for example, flash memory, EEPROM (electrically erasable programmable read-only memory), EPROM (erasable programmable read-only memory), a hard disk, or a ROM. Alternatively, the computer-readable storage medium comprises a non-transitory computer-readable medium. The computer-readable storage medium has storage space for program code that performs any of the method steps described above. The program code can be read from or written to one or more computer program products. The program code can be compressed, for example, in a suitable form.
[0096] In several embodiments provided by the present application, it should be understood that the disclosed apparatus and method can also be implemented in other manners. The described embodiments of the apparatus are merely exemplary, and the implementation of the apparatus, method and computer program product according to the embodiments of the present application can be varied as appropriate. In this regard, each block in the flowchart or block diagram illustrations, and combinations of blocks in the flowchart or block diagrams, can be implemented by a dedicated hardware-based system that carries out the specified functions or actions, or a combination of dedicated hardware and computer instructions. For example, the functions of each block can be implemented by one or more circuits such as a processor. The processor can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic, or a combination of the above.
[0097] If the functions are implemented in the form of software function modules and sold or used as independent products, these function modules can be stored in a computer readable storage medium. Based on such an understanding, the technical solutions of the present application essentially, or part of the technical solutions that make contributions to the prior art, or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in the embodiments of the present application. The foregoing storage medium includes various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0098] The preferred embodiments of the present application have been described above with the intent to enable those skilled in the art to make and use it. Various modifications to these embodiments will remain apparent to those skilled in the art, and the generic principles defined herein can be applied to other embodiments. The scope of the application is defined by the appended claims.
Claims
1. A video processing method, characterized in that, Applied to an electronic device, the electronic device is communicatively connected to a server, the server storing a correspondence between scene types and effect parameter configuration information, the method includes: The server obtains the video to be processed, the effect parameter configuration information corresponding to each frame of the image to be processed, and the image information of each frame of the image to be processed. The effect parameter configuration information corresponding to each frame of the image to be processed is determined according to the scene type of the image to be processed and the corresponding relationship. Each frame of the image to be processed, the scene type of the image to be processed, and the image information of the image to be processed are obtained by the server through scene recognition system to identify the video to be processed. Based on the effect parameter configuration information and the image information, the corresponding images to be processed are blurred to obtain all images to be fused; the effect parameter configuration information includes blur degree parameter, blur radius parameter and system supported parameters; based on the image information, the corresponding images to be fused and the corresponding images to be processed are fused to obtain all visual effect images, so as to obtain a video with visual effects.
2. The method according to claim 1, characterized in that, The electronic device stores scaling conditions. The process of blurring the corresponding images to be processed based on the effect parameter configuration information and the image information to obtain all images to be merged includes: If the image information satisfies the scaling condition, the corresponding image to be processed is scaled to obtain the corresponding scaled image. The scaled image is then Gaussian blurred according to the effect parameter configuration information to obtain the corresponding first Gaussian blurred image. The first Gaussian blurred image is then upsampled to obtain the corresponding image to be fused. If the image information does not meet the scaling conditions, the corresponding image to be processed is subjected to Gaussian blur processing according to the effect parameter configuration information to obtain the corresponding second Gaussian blurred image, and the second Gaussian blurred image is upsampled to obtain the corresponding image to be fused.
3. The method according to claim 2, characterized in that, The image information of each frame of the image to be processed includes the image resolution. If the image resolution is greater than the preset resolution, it indicates that the image information meets the scaling condition. If the image resolution is less than the preset resolution, it indicates that the image information does not meet the scaling condition.
4. The method according to claim 3, characterized in that, The preset resolution includes a preset wide resolution and a preset high resolution, and the image resolution includes a wide image resolution and a high image resolution. The scaling process on the corresponding image to be processed to obtain the corresponding scaled image includes: Calculate the ratio of the wide image resolution to the preset wide resolution to obtain the wide scaling factor; Calculate the ratio of the high image resolution to the preset high resolution to obtain the high scaling factor; The larger of the width scaling factor and the height scaling factor is determined as the target scaling factor; The corresponding image to be processed is scaled according to the target scaling factor to obtain the corresponding scaled image.
5. The method according to claim 1, characterized in that, The image information includes the region to be blurred. The step of fusing the corresponding image to be fused with the corresponding image to be processed, based on the image information, to obtain all the visual effect images includes: The first region to be merged is merged with the corresponding second region to be merged to obtain the entire visual effect image; the first region to be merged is the region to be blurred in the image to be merged, and the second region to be merged is the region to be blurred in the image to be processed.
6. A video processing apparatus, characterized in that, An electronic device that communicates with a server, the server storing a correspondence between scene types and effect parameter configuration information, the device comprising: The video acquisition module is used to acquire from the server the video to be processed, the effect parameter configuration information corresponding to each frame of the image to be processed, and the image information of each frame of the image to be processed; the effect parameter configuration information corresponding to each frame of the image to be processed is determined according to the scene type of the image to be processed and the correspondence; each frame of the image to be processed, the scene type of the image to be processed, and the image information of the image to be processed are obtained by the server through scene recognition system to identify the video to be processed. The blurring module is used to blur the corresponding images to be processed according to the effect parameter configuration information and the image information respectively, to obtain all images to be fused; the effect parameter configuration information includes blur degree parameter, blur radius parameter and system supported parameters; according to the image information, the corresponding images to be fused and the corresponding images to be processed are fused to obtain all visual effect images, so as to obtain a video with visual effects.
7. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program executable by the processor to implement the video processing method according to any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the video processing method as described in any one of claims 1-5.
Citation Information
Patent Citations
Video processing method and device, computer equipment and storage medium
CN114339049A
Image processing method and device, electronic equipment and medium
CN114596215A
Video coding method, decoding method, electronic equipment and storage medium
CN114979672A
Picture generation method and device, computer equipment and storage medium
CN116597252A