Video processing method, apparatus, device, and storage medium
By determining the motion information and blur parameters of the displayed object during video compression, performing motion blurring, synthesizing the image, and generating a second video, the problem of poor smoothness after video compression is solved, achieving efficient video compression and improved smoothness.
Patent Information
- Application Number
- CN202310157128.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-22
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2043-02-22
AI Technical Summary
The video is not smooth after compression, which affects the user's viewing experience.
By determining the position of the displayed object in the video between two adjacent frames, motion information and motion blur parameters are obtained, motion blurring is performed, images are synthesized, and a second video is generated to simulate the inter-frame motion process of the displayed object.
It improves video smoothness by compressing the video by combining two frames into one, supplementing the motion information between frames, and thus improving the smoothness of video playback.
Smart Images

Figure CN116156079B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of video processing, and particularly relates to a video processing method, device, equipment and storage medium. BACKGROUND
[0002] Video compression technology is a common video processing technology, which usually compresses a video by reducing the frame rate to solve the problems of space occupation and traffic consumption caused by the large volume of the video.
[0003] In the related art, after the video is compressed by using the above video compression technology, the compressed video becomes jerky due to the reduction of the frame rate, and the fluency is not high, which affects the video watching experience of the user. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide a video processing method, device, equipment and storage medium, which can solve the problem of low fluency after video compression.
[0005] In a first aspect, the embodiments of the present application provide a video processing method, which comprises:
[0006] In the case where M1 frames of images of a first video are obtained, the positions of a display object in the first video between adjacent two frames of images of the M1 frames of images are determined to obtain N pieces of motion information, N < M1;
[0007] N motion blur parameters associated with the N pieces of motion information are obtained;
[0008] Based on the N motion blur parameters, N frames of second images are obtained by performing motion blurring processing on N frames of synthesized images respectively, wherein the synthesized images are obtained by synthesizing adjacent two frames of images;
[0009] Based on the N frames of second images, a second video is generated.
[0010] In a second aspect, the embodiments of the present application provide a video processing device, which comprises:
[0011] A determination module is configured to, in the case where M1 frames of images of a first video are obtained, determine the positions of a display object in the first video between adjacent two frames of images of the M1 frames of images to obtain N pieces of motion information, N < M1;
[0012] An obtaining module is configured to obtain N motion blur parameters associated with the N pieces of motion information;
[0013] A blurring processing module is configured to, based on the N motion blur parameters, perform motion blurring processing on N frames of synthesized images respectively to obtain N frames of second images, wherein the synthesized images are obtained by synthesizing adjacent two frames of images;
[0014] The generating module is configured to generate a second video based on the N frames of second images.
[0015] In a third aspect, an electronic device is provided. The electronic device includes a processor, a memory, the memory storing a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the video processing method of the first aspect.
[0016] In a fourth aspect, a readable storage medium is provided. The readable storage medium stores a program or instructions, and the program or instructions, when executed by a processor, implement the steps of the video processing method of the first aspect.
[0017] In a fifth aspect, a chip is provided. The chip includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is configured to run a program or instructions to implement the steps of the video processing method of the first aspect.
[0018] In a sixth aspect, a computer program product is provided. The computer program product is stored in a storage medium, and the computer program product is executed by at least one processor to implement the steps of the video processing method of the first aspect.
[0019] In the embodiments of the present application, in the case of compressing the first video, after M1 frames of images of the first video are acquired, a display object in the first video is determined, positions between adjacent two frames of images of the M1 frames of images are obtained, and N pieces of motion information capable of reflecting inter-frame changes of the display object in each adjacent two frames are obtained. On this basis, N pieces of motion blur parameters associated with the N pieces of motion information are acquired. After adjacent two frames of images are synthesized to obtain N frames of synthesized images, the N frames of synthesized images are respectively subjected to motion blurring processing based on the N pieces of motion blur parameters, and N frames of second images are obtained. In this way, a second video is generated based on the N frames of second images, the frame rate of the first video can be reduced by combining two frames into one frame to realize compression of the first video, and the motion blurring processing can add motion blurring effects to the synthesized images to simulate the motion process of the display object between frames and supplement the inter-frame motion information of the display object missing in the first video, thereby improving the fluency of the second video. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 is a flowchart of a video processing method provided by an embodiment of the present application;
[0021] Figure 2 is a flowchart of a video processing method provided by another embodiment of the present application;
[0022] Figure 3is a flowchart of a video processing method provided by another embodiment of the present application;
[0023] Figure 4 is a flowchart of a video processing method provided by another embodiment of the present application;
[0024] Figure 5 is a schematic diagram of an example of a second image provided by an embodiment of the present application;
[0025] Figure 6 is a structural schematic diagram of a video processing apparatus provided by an embodiment of the present application;
[0026] Figure 7 is a structural schematic diagram of an electronic device provided by an embodiment of the present application;
[0027] Figure 8 is a hardware structural schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art belong to the scope of protection of the present application.
[0029] The terms "first", "second", and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually a category and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the front and rear associated objects are in an "or" relationship.
[0030] Video compression technology is a common video processing technology, which usually compresses video by reducing frame rate to solve the problems of space occupation and traffic consumption caused by large video volume. In related technologies, after the video is compressed by using the above video compression technology, the compressed video will become laggy due to the reduction of frame rate, and the fluency is not high, which affects the video watching experience of users.
[0031] To solve the problems in the prior art, the embodiment of the present application provides a video processing method. In the case of compressing a first video, after obtaining M1 frame images of the first video, a display object in the first video is determined, and N pieces of motion information capable of reflecting the inter-frame change of the display object in each adjacent two frames are obtained at the positions between adjacent two frame images of the M1 frame images. On this basis, N pieces of motion blur parameters associated with the N pieces of motion information are obtained. After synthesizing the adjacent two frame images to obtain N frame synthesized images, the N frame synthesized images are subjected to motion blurring processing based on the N pieces of motion blur parameters, and N frame second images are obtained. In this way, a second video is generated based on the N frame second images, the frame rate of the first video can be reduced by combining two frames into one frame to realize compression of the first video, and the motion blurring processing can superimpose a motion blurring effect on the synthesized images to simulate the motion process of the display object between frames in the synthesized images, thereby ensuring the smoothness of the second video and solving the problem of low smoothness of the compressed video in the prior art.
[0032] The video processing method provided by the embodiment of the present application will be described in detail below in combination with the drawings, specific embodiments and application scenarios.
[0033] Figure 1 FIG. 1 is a flowchart of a video processing method provided by an embodiment of the present application. The execution subject of the video processing method can be an electronic device. It should be noted that the above execution subject does not constitute a limitation on the present application.
[0034] As shown in FIG. 1, the video processing method provided by the embodiment of the present application can include steps 110 to 140. Figure 1
[0035] In the case of obtaining M1 frame images of a first video, the positions of a display object in the first video between adjacent multiple frame images are determined to obtain N pieces of motion information.
[0036] The first video is a video to be compressed, and there can be at least one display object in the first video. The display objects in different image frames can be the same or different, which is not limited in the present application. The number of image frames in the first video can be greater than or equal to M1, and N < M1.
[0037] The adjacent two frame images each include at least one display object, so the generated motion information can include the motion change information of the at least one display object, that is, each piece of motion information can reflect the inter-frame motion change of the at least one display object.
[0038] In some embodiments, the electronic device can determine the positions of the display object between adjacent multiple frame images to obtain N pieces of motion information in the case of obtaining M1 frame images of the first video.
[0039] Specifically, in the adjacent multi-frame images, the display object has different positions between every two frames of images respectively, and the display object can generate a position change between every two frames of images. Therefore, after determining the positions of the display object between the adjacent multi-frame images, the position change of the display object between the adjacent multi-frame images can be obtained by obtaining the position change of the display object between the adjacent two frames of images.
[0040] For example, M1 is 9, and the electronic device needs to determine the position change of the display object between the adjacent 3 frames. After obtaining 9 frames of images, the electronic device can first determine the position change of the display object between every two frames of images, for example, the position change of the display object between the 1st frame and the 2nd frame, the 2nd frame and the 3rd frame, so as to obtain the position change of the display object between the 1st frame and the 3rd frame, and finally obtain the position change between the 1st frame and the 3rd frame, the 4th frame and the 6th frame, and the 7th frame and the 9th frame.
[0041] In some embodiments, every two adjacent frames of images can constitute a group of images, so that M1 frames of images correspond to M1 / 2 groups of images, and each group of images corresponds to one motion information, so that N=M1 / 2 motion information can be obtained.
[0042] For example, M1 is 60, and the position change of the display object between the adjacent two frames of images can be determined, for example, the 1st frame and the 2nd frame, the 3rd frame and the 4th frame, the 5th frame and the 6th frame... Based on the position change of the display object between each group of images, one motion information can be obtained, and 60 frames of images correspond to 30 groups of images, so that N=30 motion information can be obtained.
[0043] Step 120, obtaining N motion blur parameters associated with the N motion information.
[0044] Step 130, based on the N motion blur parameters, respectively performing motion blurring processing on N frames of synthesized images to obtain N frames of second images, wherein the synthesized images are obtained by synthesizing the adjacent two frames of images.
[0045] Specifically, the electronic device can perform synthesis processing on the adjacent two frames of images in the M1 frames of images, and each group of adjacent two frames of images can generate one frame of synthesized image, so that N=M1 / 2 frames of synthesized images are obtained. Based on the corresponding relationship between each group of adjacent two frames of images and the motion information and the motion blur parameter, and the corresponding relationship between each group of adjacent two frames of images and the synthesized image, the motion blur parameter also has a one-to-one corresponding relationship with the synthesized image. The electronic device can perform motion blurring processing on the corresponding adjacent two frames of images based on each motion blur parameter. Through the motion blurring processing, the motion process of the display object between the frames can be simulated in the synthesized image, and the motion blurring effect is added to the synthesized image.
[0046] In step 140, a second video is generated based on the N frames of second images.
[0047] The second video is a compressed video of the first video, and the frame number of the second video is significantly reduced compared to the first video.
[0048] The video processing method provided in the embodiments of the present application, in the scenario of compressing the first video, after obtaining M1 frames of images of the first video, determines a display object in the first video, and obtains N pieces of motion information reflecting the inter-frame change of the display object in each adjacent two frames between M1 frames of images. On this basis, N pieces of motion blur parameters associated with the N pieces of motion information are obtained, and after synthesizing the adjacent two frames of images to obtain N frames of synthesized images, the N frames of synthesized images are respectively subjected to motion blurring processing based on the N pieces of motion blur parameters to obtain N frames of second images. In this way, the second video is generated based on the N frames of second images, the frame rate of the first video can be reduced by combining two frames into one frame to realize compression of the first video, and the motion blurring processing can add motion blurring effects to the synthesized images to simulate the motion process of the display object between frames and supplement the inter-frame motion information of the display object missing in the first video, thereby improving the smoothness of the second video.
[0049] The above steps 110 to 140 will be described in detail below in combination with specific embodiments.
[0050] In step 110, in the case of obtaining M1 frames of images of the first video, a display object in the first video is determined, and N pieces of motion information are obtained at the positions between adjacent two frames of M1 frames of images.
[0051] In some embodiments of the present application, before step 110, the method can further specifically include: performing interval sampling on the original image frames of the first video according to a preset sampling interval to obtain M1 frames of images.
[0052] The original frame number of the first video is M2, and the preset sampling interval can be set according to specific requirements, for example, set to 1 frame, 2 frames or other values, which is not limited in the present application.
[0053] For example, the number M2 of original image frames of the first video is 120, if the preset sampling interval is 1, the electronic device can obtain the 1st frame, the 3rd frame, the 5th frame, and finally obtain M1=60 frames of images after sampling; if the preset sampling interval is 2, the electronic device can obtain the 1st frame, the 4th frame, the 7th frame, and finally obtain M1=40 frames of images after sampling.
[0054] In the embodiment of the present application, after sampling the first video according to the preset sampling interval, the number of image frames can be reduced. In this way, by synthesizing the adjacent two image frames of the sampled image frames and generating the second video based on the synthesized image frames, the number of image frames in the second video can be effectively reduced, the frame rate of the first video can be reduced, the effective compression of the first video can be realized, and the occupied memory space and traffic consumption of the first video can be reduced.
[0055] In some embodiments of the present application, before step 110, the method can further specifically include: inserting a transition frame in the M2 frame images of the first video to obtain M1 frame images.
[0056] Specifically, the electronic device can insert a transition frame in the M2 frame images of the first video based on a preset frame insertion interval, which can be set according to specific requirements, for example, one transition frame is inserted every 1 frame, every two frames, or every other number of frames, which is not limited in the present application.
[0057] For example, the original number of frames of the first video is 120, and the electronic device can insert a transition frame between the adjacent two frames based on the frame insertion technology, finally insert 119 transition frames in the 120 frame images, and finally obtain M2=239 frame images.
[0058] In the embodiment of the present application, by inserting a transition frame in the M2 frame images, the difference between the adjacent two frame images can be reduced, and the displacement change amount of the display object between the adjacent two frame images can be reduced, and the motion information of the display object between the adjacent two frame images of the M2 frame images can be supplemented. Therefore, based on the M1 frame images after inserting the transition frame, the synthesis processing and the motion blurring processing can be further improved. The smoothness of the second video.
[0059] In some embodiments of the present application, the adjacent two frame images can include a first frame image and a second frame image, Figure 2 is a flowchart of a video processing method provided by another embodiment of the present application, and step 110 can include Figure 2 as shown in steps 210 and 220.
[0060] Step 210, based on an image recognition algorithm, obtaining a first pixel point coordinate of a display object in a first frame image and a second pixel point coordinate of the display object in a second frame image.
[0061] Wherein, the first pixel point coordinate is the pixel point coordinate value of the display object in the first frame image, and the second pixel point coordinate is the pixel point coordinate value of the display object in the second frame image.
[0062] It should be noted that the type of image recognition algorithm is not specifically limited in the present application. For example, the image recognition algorithm of the present application can include but is not limited to: depth-first search algorithm, breadth-first search algorithm, Dijkstra algorithm, Bellman-Ford, Floyd-Warshall, Prim, Kruskal algorithm.
[0063] In step 220, the displacement distance and the displacement angle of the display object between the adjacent two frames of images are determined based on the first pixel point coordinates and the second pixel point coordinates, and the motion information is obtained.
[0064] The first pixel point coordinates correspond to the starting position of the display object in the inter-frame change, and the second pixel point coordinates correspond to the ending position of the display object in the inter-frame change. The displacement distance of the display object can be obtained based on the starting position and the ending position. The displacement angle can be the rotation angle of the display object in the inter-frame motion process.
[0065] In the embodiments of the present application, by obtaining the pixel point coordinates of the display object in the adjacent two frames of images, the displacement distance and the displacement angle of the display object between the adjacent two frames of images can be determined through the change of the pixel point coordinates, so that the motion information of the display object between the adjacent two frames of images can be quickly and accurately obtained.
[0066] Involving step 120, N motion blur parameters associated with N motion information are obtained.
[0067] The motion blur parameter is used to represent the blur degree, and the blur degree is positively correlated with the displacement distance and the displacement angle. That is, the greater the displacement distance of the display object between the adjacent two frames of images, the higher the blur degree represented by the associated motion blur parameter, and the greater the displacement angle of the display object between the adjacent two frames of images, the higher the blur degree represented by the associated motion blur parameter.
[0068] In step 130, N frames of second images are obtained by performing motion blurring processing on N frames of synthesized images based on N motion blur parameters, wherein the synthesized images are obtained by synthesizing the adjacent two frames of images.
[0069] In some embodiments of the present application, step 130 can specifically include: performing motion blurring processing on the display object in the synthesized image based on the motion blur parameter associated with the displacement distance and the displacement angle.
[0070] The motion blur parameter is used to represent the blur degree, and the blur degree is positively correlated with the displacement distance and the displacement angle.
[0071] In this embodiment, the blurring parameters during motion blurring are related to the displacement distance and angle of the displayed object between frames. Thus, based on these blurring parameters, a corresponding motion blurring effect can be superimposed on the synthesized image, making the motion blurring effect more adaptable to the movement of the displayed object. For example, if the displayed object moves quickly and its displacement distance between adjacent frames is large, a more blurred effect can be superimposed on the fast-moving displayed object in the synthesized image, making the blurring effect more adaptable to the movement of the displayed object.
[0072] Optionally, the motion blurring process applied to different display objects in the same frame can be different. Different motion blur effects can be applied to the display objects based on their motion parameters.
[0073] In some embodiments of this application, step 130 may specifically include at least one of the following:
[0074] When the generated displacement angle is less than the preset angle threshold, a linear blur effect is superimposed on the display object and its motion trajectory in the direction of the display object's motion based on the motion blur parameter associated with the displacement distance.
[0075] When the displacement angle is greater than the preset angle threshold, based on the motion blur parameters associated with the displacement distance and displacement angle, a ring-shaped dynamic blur effect is superimposed on the display object and its motion trajectory, with the focus in the synthesized image as the center.
[0076] When the size of the displayed object changes between two adjacent frames, a radiation blur effect is superimposed on the displayed object, with the degree of blur increasing the distance from the radiation center point, where the radiation center point is the center position of the composite image.
[0077] The preset angle threshold can be set according to specific needs, such as any value between 0 and 10 degrees. If the displacement angle is less than the preset angle threshold, the motion trajectory of the displayed object between two adjacent frames can be considered as a linear motion trajectory, and no displacement angle is generated. Therefore, a linear blur effect can be superimposed on the displayed object and its motion trajectory.
[0078] In one example, the preset angle threshold is 5 degrees, such as Figure 3 As shown, after the first frame image 301 and the second frame image 302 are combined, a composite image 303 can be obtained. Since the displacement angle of the displayed object "ball" between 301 and 302 is 0, that is, its motion trajectory is a linear motion trajectory, a linear blurring effect can be superimposed on the "ball" and its motion trajectory in the motion direction of the "ball", direction 1, to obtain the second image 304.
[0079] In another example, the preset angle threshold is 5 degrees, such as Figure 4 As shown, after the first frame image 401 and the second frame image 402 are combined, a composite image 403 is obtained. Since the displacement angle of the displayed object "ball" between 401 and 402 is greater than 5 degrees, that is, its motion trajectory is a non-linear motion trajectory, it can be as follows: Figure 5 As shown, the second image 501 is obtained by superimposing a circular dynamic blur effect on the "ball" and its motion trajectory.
[0080] In another example, if the size of the displayed object changes between two adjacent frames, i.e., the displayed object is scaled, the electronic device can use the center of the composite image as the radiation center point to overlay a radiation blur effect on the displayed object, with the degree of blur increasing the distance from the radiation center point.
[0081] In this embodiment, based on the different motion patterns of the displayed object between two adjacent frames, the electronic device can superimpose different motion blur effects. Specifically, if the motion trajectory of the displayed object between two adjacent frames is a linear motion trajectory, a linear blur effect can be superimposed on the displayed object and its motion trajectory to simulate the linear motion process of the displayed object in the composite image; if the angle of the displayed object changes during its motion between two adjacent frames, a circular dynamic blur effect can be superimposed on the displayed object and its motion trajectory to simulate the non-linear motion process of the displayed object in the composite image; if the displayed object scales between two adjacent frames, the electronic device can superimpose a radiation blur effect on the displayed object, with a higher degree of blurring the farther away from the radiation center point, to simulate the scaling process of the displayed object in the composite image. Thus, the electronic device can superimpose motion blur effects with higher adaptability to the motion process of the displayed object in the composite image, better restoring the motion process of the displayed object in the second image, making the motion process of the displayed object in the second video smoother and more fluid.
[0082] Step 140: Generate a second video based on N frames of the second image.
[0083] In some embodiments, the electronic device may assemble N frames of the second image to generate a second video.
[0084] It should be noted that the video processing method provided in this application embodiment can be executed by a video processing device or a control module within that video processing device for executing the video processing method. This application embodiment uses the execution of the video processing method by a video processing device as an example to illustrate the video processing device provided in this application embodiment. The video processing device will now be described in detail.
[0085] Figure 6is a structural schematic diagram of a video processing device provided in the present application.
[0086] As shown in Figure 6 The present application provides a video processing device 600, which comprises a determination module 610, an acquisition module 620, a motion blurring processing module 630 and a generation module 640.
[0087] The determination module 610 is configured to, in the case that M1 frames of images of a first video are acquired, determine the position of a display object in the first video between two adjacent frames of images of the M1 frames of images, to obtain N pieces of motion information, N < M1.
[0088] The acquisition module 620 is configured to acquire N pieces of motion blurring parameters associated with the N pieces of motion information.
[0089] The blurring processing module 630 is configured to perform motion blurring processing on N frames of synthesized images based on the N pieces of motion blurring parameters, to obtain N frames of second images, wherein the synthesized images are obtained by synthesizing the two adjacent frames of images.
[0090] The generation module 640 is configured to generate a second video based on the N frames of second images.
[0091] The video processing device provided in the present application, in the case of compressing a first video, after M1 frames of images of the first video are acquired, determines the position of a display object in the first video between two adjacent frames of images of the M1 frames of images, to obtain N pieces of motion information that can reflect the inter-frame change of the display object in each two adjacent frames. On this basis, N pieces of motion blurring parameters associated with the N pieces of motion information are acquired, after the two adjacent frames of images are synthesized to obtain N frames of synthesized images, motion blurring processing is performed on the N frames of synthesized images based on the N pieces of motion blurring parameters, to obtain N frames of second images. In this way, a second video is generated based on the N frames of second images, the frame rate of the first video can be reduced by combining two frames into one frame to realize the compression of the first video, and the motion blurring processing can add motion blurring effects to the synthesized images to simulate the motion process of the display object between frames in the synthesized images, to supplement the inter-frame motion information of the display object missing in the first video, thereby improving the fluency of the second video.
[0092] In some embodiments of the present application, the two adjacent frames of images comprise a first frame of image and a second frame of image, and the determination module 610 comprises: an acquisition unit configured to acquire a first pixel point coordinate of the display object in the first frame of image and a second pixel point coordinate of the display object in the second frame of image based on an image recognition algorithm; and a determination unit configured to determine a displacement distance and a displacement angle of the display object between the two adjacent frames of images based on the first pixel point coordinate and the second pixel point coordinate, to obtain the motion information. In some embodiments of the present application, the two adjacent frames of images comprise a first frame of image and a second frame of image, and the determination module 610 comprises: an acquisition unit configured to acquire a first pixel point coordinate of the display object in the first frame of image and a second pixel point coordinate of the display object in the second frame of image based on an image recognition algorithm; and a determination unit configured to determine a displacement distance and a displacement angle of the display object between the two adjacent frames of images based on the first pixel point coordinate and the second pixel point coordinate, to obtain the motion information.
[0093] In some embodiments of the present application, the blurring processing module 630 is specifically configured to perform motion blurring processing on the display object in the synthesized image based on a motion blurring parameter associated with the displacement distance and the displacement angle, wherein the motion blurring parameter is used to represent the blurring degree, and the blurring degree is positively correlated with the displacement distance and the displacement angle.
[0094] In some embodiments of the present application, the blurring processing module 630 is specifically configured to perform at least one of the following: in a case where the generated displacement angle is less than a preset angle threshold, based on a motion blurring parameter associated with the displacement distance, superimposing a linear blurring effect on the display object and the motion trail of the display object in the motion direction of the display object; in a case where the displacement angle is greater than the preset angle threshold, based on a motion blurring parameter associated with the displacement distance and the displacement angle, superimposing a ring-shaped dynamic blurring effect on the display object and the motion trail of the display object with the focus in the synthesized image as the center; in a case where the size of the display object changes in the adjacent two frames of images, superimposing a radiation blurring effect on the display object, wherein the farther the radiation center point is from the display object, the higher the blurring degree is, and the radiation center point is the center position of the synthesized image.
[0095] In some embodiments of the present application, the device further comprises a sampling module configured to sample the M2 frames of images of the first video at a preset sampling interval to obtain the M1 frames of images.
[0096] In some embodiments of the present application, the device further comprises an inserted frame processing module configured to insert a transition frame into the M2 frames of images of the first video to obtain the M1 frames of images.
[0097] The video processing device provided by the embodiments of the present application can realize the method Figures 1-5 The processes realized by the electronic device in the method embodiments are not repeated here to avoid repetition.
[0098] The video processing apparatus in the embodiments of the present application can be an electronic device, or a component, an integrated circuit, or a chip in an electronic device. The electronic device can be a terminal, or other devices than the terminal. For example, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The electronic device can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a cash register, or a self-service machine, etc. The embodiments of the present application are not limited in this regard.
[0099] The video processing apparatus in the embodiments of the present application can be a device with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, and the embodiments of the present application are not limited in this regard.
[0100] Optionally, as shown in Figure 7 The embodiments of the present application also provide an electronic device 700, which includes a processor 701 and a memory 702. The memory 702 has a program or instructions stored thereon, which can be run on the processor 701. The program or instructions are executed by the processor 701 to implement each process of the video processing method or the video processing apparatus method embodiments, and achieve the same technical effects. To avoid repetition, details are not described herein.
[0101] It should be noted that the electronic device in the embodiments of the present application includes the mobile electronic device and the non-mobile electronic device.
[0102] Figure 8 The electronic device in the embodiments of the present application is a hardware structure diagram.
[0103] The electronic device 800 includes, but is not limited to, a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810, etc.
[0104] Those skilled in the art can understand that the electronic device 800 can also include a power supply (such as a battery) for supplying power to each component, and the power supply can be logically connected to the processor 810 through a power management system, so that the power management system can realize management of charging, discharging, and power consumption management. Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device can include more or fewer components than the figure, or combine certain components, or different component arrangements, which are not described here.
[0105] The processor 810 is configured to, in a case where M1 frames of images of the first video are acquired, determine a position of a display object in the first video between two adjacent frames of images of the M1 frames of images, to obtain N pieces of motion information, N < M1; the processor 810 is further configured to acquire N motion blur parameters associated with the N pieces of motion information; the processor 810 is further configured to perform motion blurring processing on N frames of synthesized images respectively based on the N motion blur parameters, to obtain N frames of second images, wherein the synthesized images are obtained by synthesizing the two adjacent frames of images; and the processor 810 is further configured to generate a second video based on the N frames of second images.
[0106] In some embodiments of the present application, the two adjacent frames of images include a first frame of image and a second frame of image, and the processor 810 is further configured to: acquire a first pixel point coordinate of the display object in the first frame of image and a second pixel point coordinate of the display object in the second frame of image based on an image recognition algorithm; and determine a displacement distance and a displacement angle of the display object between the two adjacent frames of images based on the first pixel point coordinate and the second pixel point coordinate, to obtain the motion information.
[0107] In some embodiments of the present application, the processor 810 is specifically configured to perform motion blurring processing on the display object in the synthesized images based on the motion blur parameters associated with the displacement distance and the displacement angle; and the motion blur parameter is used to represent a blur degree, and the blur degree is positively correlated with the displacement distance and the displacement angle.
[0108] In some embodiments of the present application, the processor 810 is specifically configured to perform at least one of the following: in a case where the generated displacement angle is less than a preset angle threshold, based on a motion blur parameter associated with the displacement distance, superimposing a linear blur effect on the display object and its motion trajectory in the motion direction of the display object; in a case where the displacement angle is greater than the preset angle threshold, based on a motion blur parameter associated with the displacement distance and the displacement angle, superimposing a circular dynamic blur effect on the display object and its motion trajectory with the focus in the composite image as the center; in a case where the size of the display object changes between the adjacent two frames of images, superimposing a radiation blur effect on the display object, the farther the distance from the radiation center point, the higher the blur degree, wherein the radiation center point is the center position of the composite image.
[0109] In some embodiments of the present application, the processor 810 is further configured to: according to a preset sampling interval, interval sampling the M2 frames of images of the first video to obtain the M1 frames of images.
[0110] In some embodiments of the present application, the processor 810 is further configured to: insert a transition frame in the M2 frames of images of the first video to obtain the M1 frames of images.
[0111] In the embodiments of the present application, in the scene of compressing the first video, after obtaining the M1 frames of images of the first video, a display object in the first video is determined, and N motion information capable of reflecting the interframe change of the display object in each adjacent two frames is obtained at the position between the adjacent two frames of images of the M1 frames of images. On this basis, N motion blur parameters associated with the N motion information are obtained, and after synthesizing the adjacent two frames of images to obtain N frames of composite images, the N frames of composite images are respectively subjected to motion blurring processing based on the N motion blur parameters to obtain N frames of second images. In this way, the second video is generated based on the N frames of second images, the frame rate of the first video can be reduced by combining two frames into one frame to realize the compression of the first video, and the motion blurring processing can superimpose a motion blurring effect on the composite image to simulate the motion process of the display object between frames in the composite image, supplement the interframe motion information of the display object missing in the first video, and thus improve the fluency of the second video.
[0112] It should be understood that in the embodiments of the present application, the input unit 804 can include a graphics processing unit (GPU) 8041 and a microphone 8042. The graphics processing unit 8041 processes image data of a still picture or a video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 806 can include a display panel 8061, which can be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 807 includes at least one of a touch panel 8071 and other input devices 8072. The touch panel 8071 is also referred to as a touch screen. The touch panel 8071 can include two parts of a touch detection device and a touch controller. The other input devices 8072 can include, but are not limited to, a physical keyboard, a key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like, which are not described here again.
[0113] The memory 809 can be used to store software programs and various data. The memory 809 can mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area can store an operating system, N required application programs or instructions (such as sound playing, image playing, etc.), etc. In addition, the memory 809 can include a volatile memory or a non-volatile memory, or the memory 809 can include both volatile and non-volatile memories. The non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchlink dynamic random access memory (SLDRAM), and a direct memory bus random access memory (Direct Rambus RAM, DRRAM). The memory 809 in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.
[0114] The processor 810 can include one or more processing units; optionally, the processor 810 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and an application program, and the modem processor mainly processes a wireless communication signal, such as a baseband processor. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 810.
[0115] The embodiment of the present application further provides a readable storage medium, and the readable storage medium stores a program or an instruction. The program or the instruction is executed by a processor to realize each process of the above-mentioned video processing method or the video processing device method embodiment, and can achieve the same technical effect. To avoid repetition, details are not described herein.
[0116] The processor is a processor in the electronic device in the above-mentioned embodiment. The readable storage medium includes a computer readable storage medium, and examples of the computer readable storage medium include a non-transitory computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like.
[0117] The embodiment of the present application further provides a chip, and the chip includes a processor and a communication interface. The communication interface is coupled with the processor. The processor is configured to execute a program or an instruction to realize each process of the above-mentioned video processing method or the video processing device method embodiment, and can achieve the same technical effect. To avoid repetition, details are not described herein.
[0118] It should be understood that the chip mentioned in the embodiment of the present application can also be referred to as a system level chip, a system chip, a chip system, or a system on chip, and the like.
[0119] The embodiment of the present application provides a computer program product stored in a storage medium. The computer program product is executed by at least one processor to realize each process of the above-mentioned video processing method or the video processing device method embodiment, and can achieve the same technical effect. To avoid repetition, details are not described herein.
[0120] It should be noted that, in the present document, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element. Furthermore, it is to be understood that the method and apparatus of the present application can be carried out by more than one process, method, article, or apparatus either simultaneously, concurrently or in an alternate or staggered manner. It is expected to be evident to one of ordinary skill in the art that the features described with respect to some examples can be combined with features described with respect to other examples.
[0121] From the above description of the embodiments, it is apparent that the method of the above embodiments can be realized by means of software plus necessary universal hardware platforms, of course, can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of computer software products in essence or in the form of the part of the contribution to the prior art, which are stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a plurality of instructions for making a terminal (which can be a mobile phone, computer, server, or network equipment, etc.) execute the method described in each embodiment of the present application.
[0122] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above specific embodiments, and the above specific embodiments are only illustrative, but not restrictive, and those of ordinary skill in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the scope protected by the claims.
Claims
1. A method of video processing, the method comprising: The method comprises: In the case of obtaining M1 frame images of the first video, the position of the display object in the first video between the adjacent two frame images of the M1 frame images is determined, and N motion information is obtained, N Obtain N motion blur parameters associated with the N motion information; Based on the N motion blur parameters, the display object in the N frame synthesized image is motion blurred, and N frame second images are obtained, wherein the synthesized image is obtained by synthesizing the adjacent two frame images. Generate a second video based on the N frame second images. Wherein, the motion blurred processing of the display object in the synthesized image comprises: In the case that the displacement angle of the display object between the adjacent two frame images is less than a preset angle threshold, based on the motion blur parameter associated with the displacement distance of the display object between the adjacent two frame images, a linear blur effect is added to the display object and its motion trajectory in the motion direction of the display object, wherein the preset angle threshold is any value between 0 and 10 degrees.
2. The method of claim 1, wherein, The adjacent two frame images include the first frame image and the second frame image, and the determination of the position of the display object in the first video between the adjacent two frame images of the M1 frame images comprises: Based on image recognition algorithm, the first pixel point coordinates of the display object in the first frame image and the second pixel point coordinates of the display object in the second frame image are obtained; Based on the first pixel point coordinates and the second pixel point coordinates, the displacement distance and the displacement angle of the display object between the adjacent two frame images are determined, and the motion information is obtained.
3. The method of claim 2, wherein, The motion blurred processing of the display object in the N frame synthesized image based on the N motion blur parameters comprises: Based on the motion blur parameter associated with the displacement distance and the displacement angle, the motion blurred processing of the display object in the synthesized image is performed; Wherein, the motion blur parameter is used to represent the blur degree, and the blur degree is positively correlated with the displacement distance and the displacement angle.
4. The method of claim 3, wherein, The motion blurred processing of the display object in the synthesized image comprises at least one of the following: In the case that the displacement angle is greater than a preset angle threshold, based on the motion blur parameter associated with the displacement distance and the displacement angle, a circular dynamic blur effect is added to the display object and its motion trajectory with the focus in the synthesized image as the center. In the case that the size of the display object changes between the adjacent two frame images, the display object is added with a radiation blur effect, the farther the radiation center point is, the higher the blur degree is, wherein the radiation center point is the center position of the synthesized image.
5. The method of claim 1, wherein, The method further comprises: According to a preset sampling interval, M2 frame images of the first video are sampled at intervals to obtain the M1 frame images.
6. The method of claim 1, wherein, The method further comprises: Insert a transition frame in the M2 frame images of the first video to obtain the M1 frame images.
7. A video processing apparatus, comprising: The device comprises: determining, when the M1 frame image of the first video is acquired, a position of a display object in the first video between two adjacent frame images of the M1 frame image, to obtain N pieces of motion information, N acquiring, N pieces of motion blur parameters associated with the N pieces of motion information; performing, based on the N pieces of motion blur parameters, motion blurring processing on the display object in N frame synthesized images respectively, to obtain N frame second images, wherein the synthesized images are obtained by synthesizing the two adjacent frame images; generating, based on the N frame second images, a second video. The blurring processing module is specifically configured to: when a displacement angle of the display object between the two adjacent frame images is less than a preset angle threshold, based on a motion blur parameter associated with a displacement distance of the display object between the two adjacent frame images, superimposing a linear blurring effect on the display object and a motion track of the display object in a motion direction of the display object, wherein the preset angle threshold is any value between 0 and 10 degrees.
8. The apparatus of claim 7, wherein, The two adjacent frame images include a first frame image and a second frame image, and the determining module includes: an acquiring unit configured to acquire, based on an image recognition algorithm, a first pixel point coordinate of the display object in the first frame image and a second pixel point coordinate of the display object in the second frame image; a determining unit configured to determine, based on the first pixel point coordinate and the second pixel point coordinate, a displacement distance and a displacement angle of the display object between the two adjacent frame images, to obtain the motion information.
9. An electronic device, comprising: The electronic device includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and the program or instructions are executed by the processor to implement the steps of the video processing method according to any one of claims 1-6.
10. A readable storage medium, characterized by, The readable storage medium stores a program or instructions, and the program or instructions are executed by the processor to implement the steps of the video processing method according to any one of claims 1-6.
Citation Information
Patent Citations
Motion blur simulation
CN111557016A