Video processing method, device, computer equipment and storage medium
By calculating the Euler angles of key frames in the panoramic video and the Euler angles of the transition image frames, the smooth transition of the panoramic video is achieved, which solves the problem of unsmooth transition of adjacent key frames in the existing technology and improves editing efficiency and users. experience.
Patent Information
- Application Number
- CN202410742166.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-11
AI Technical Summary
In the existing panoramic video editing method, the transition frame perspective switching between adjacent key frames is not smooth enough, and when the editing object is a 3D spherical video frame, frequent conversion of 3D and 2D data is required, resulting in insufficient smooth processing.
By determining the time period to be edited in the panoramic video, the Euler angle information of the key frame is obtained, and the Euler angle of the transition image frame is calculated based on these angles to achieve a smooth transition. A cubic function of one variable and normalization are used to determine the transition frame. Posture information to automatically complete smooth transitions during editing.
The editing effect of panoramic videos has been improved, making the transition between key frames smoother, making the user's editing operations more efficient and concise, and avoiding the tedious process of manual rotation and frequent data conversion.
Smart Images

Figure CN118317144B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of video editing, and specifically to a video processing method, apparatus, computer equipment, and storage medium. Background Art
[0002] Panoramic video is a video obtained by shooting 360 degrees in all directions with a panoramic camera. Existing panoramic cameras generally contain two or more fisheye lenses, and panoramic video is obtained by stitching multi-channel video data.
[0003] Since panoramic videos have a 360-degree panoramic field of view, users need to edit them to form a flat video that matches their viewing angle when watching them. Existing methods for editing panoramic videos are usually completed through keyframe dotting operations.
[0004] However, the keyframe dotting operation requires the user to manually rotate the spherical screen formed by the panoramic video continuously, which is very cumbersome. The transition conversion of the picture perspective between adjacent keyframes cannot meet the editing requirements of the panoramic video. Moreover, the editing object is a 3D spherical video frame. When it is expanded into a 2D plane video frame, it is necessary to repeatedly convert 3D and 2D data. The existing transition frame technology is not smooth enough. Summary of the invention
[0005] The embodiments of the present application provide a video processing method, apparatus, computer device and storage medium. The technical problem to be solved is that, in view of the defects of the prior art, when performing key frame dotting operations on existing panoramic videos, the perspective switching of transition frames between adjacent key frames is not smooth enough.
[0006] In order to solve the above technical problems, a technical solution adopted by the present application is: to provide a video processing method, apparatus, computer equipment and storage medium, wherein the video processing method comprises:
[0007] Determine the starting time point t of the panorama video to be edited 1 and end time t 2 ;
[0008] Get the starting time point t 1 The corresponding first key frame posture information and the end time point t 2 The posture information of the corresponding second key frame, the posture information of the first key frame is the Euler angle , the posture information of the second key frame is the Euler angle ;
[0009] According to the Euler angle of the first key frame and the Euler angles of the second keyframe Determine the posture information of the transition image frame between the first key frame and the second key frame, wherein the posture information of the transition image frame is the Euler angle ;
[0010] According to the Euler angle of the first key frame , the Euler angle of the second key frame and the Euler angles of the transition image frame , play the planar video content of the time period to be edited.
[0011] In a specific embodiment, is a cubic function of the Euler angles of the transition image frame with respect to the time point t, The curvature of the clipping time period [t 1 ,t 2 ] changes smoothly, and relative to the midpoint t of the time period to be edited 3 The corresponding Euler angle of the transition intermediate image frame symmetry.
[0012] In a specific embodiment, the Euler angles according to the first key frame and the Euler angles of the second keyframe Determining the posture information of the transition image frame between the first key frame and the second key frame includes:
[0013] The Euler angles include a pitch angle component, a roll angle component, and a heading angle component. If any one of the components is set to ;
[0014] The Euler angles of the first keyframe The amount Normalized to 0, that is To 0, the Euler angle of the second key frame The amount Normalized to 1, that is is 1, the Euler angle of the transition intermediate image frame The amount Normalized to 0.5, that is is 0.5;
[0015] set up With fixed value , said For the The normalized processing result of
[0016] Set the is a cubic equation of one variable: , then according to the , , and stated , to obtain the The solution;
[0017] According to the , perform the same normalization and equation calculation on the other two components of the Euler angle, and obtain , , according to the , and stated , perform comprehensive calculation to obtain the normalized Euler angle of the transition image frame ;
[0018] The normalized Euler angle of the transition image frame Perform inverse normalization to obtain the Euler angle of the transition image frame .
[0019] In a specific embodiment, the , , and stated , to obtain the The solution includes:
[0020] according to =0, =1, = 0.5, , establish the The vector representation of the linear equations is:
[0021] ;
[0022] Get the matrix equation: Ax=B;
[0023] When R(A)=R(A,B), the linear equation system has a unique solution, and the solution is obtained by calculation. The solution.
[0024] In a specific embodiment, the Euler angles of the normalized transition image frame are Perform inverse normalization to obtain the Euler angle of the transition image frame ,include:
[0025] .
[0026] In a specific implementation, the setting With fixed value ,include:
[0027] Thec is 0.2, the fixed value is 0.124.
[0028] In a specific embodiment, according to the fixed value is 0.124, and the normalized Euler angle of the transition image frame is calculated. for .
[0029] In a specific implementation, a video processing device is also included, the device comprising:
[0030] The first determining module is used to determine the starting time point t of the time period to be edited of the panoramic video. 1 and end time t 2 ;
[0031] An acquisition module is used to acquire the starting time point t 1 The corresponding first key frame posture information and the end time point t 2 The posture information of the corresponding second key frame, the posture information of the first key frame is the Euler angle , the posture information of the second key frame is the Euler angle ;
[0032] A second determining module is used to determine the Euler angle of the first key frame according to the and the Euler angles of the second keyframe Determine the posture information of the transition image frame between the first key frame and the second key frame, wherein the posture information of the transition image frame is the Euler angle ;
[0033] A playback module, the playback module is used to generate a video according to the Euler angle of the first key frame. , Euler angles of the second keyframe and the Euler angles of the transition image frame , play the planar video content of the time period to be edited.
[0034] In a specific implementation, a computer device is also included, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the video processing method described in any of the above specific implementations when executing the computer program.
[0035] In a specific implementation, it also includes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the video processing method described in any of the above specific implementations are implemented.
[0036] The beneficial effects of the present application are as follows: Different from the prior art, the embodiments of the present application provide a video processing method, apparatus, computer equipment and storage medium, wherein the video processing method includes:
[0037] Determine the starting time point t of the panorama video to be edited 1 and end time t 2 ;
[0038] Get the starting time point t 1 The corresponding first key frame posture information and the end time point t 2 The posture information of the corresponding second key frame, the posture information of the first key frame is the Euler angle , the posture information of the second key frame is the Euler angle ;
[0039] According to the Euler angle of the first key frame and the Euler angles of the second keyframe Determine the posture information of the transition image frame between the first key frame and the second key frame, wherein the posture information of the transition image frame is the Euler angle ;
[0040] According to the Euler angle of the first key frame , the Euler angle of the second key frame and the Euler angles of the transition image frame , play the planar video content of the time period to be edited.
[0041] It can be seen from the above technical solution that the embodiment of the present application has the following advantages: by introducing the Euler angle that characterizes the key frame posture information between two adjacent key frames, and by calculating the Euler angle, the posture information of each transition frame between adjacent key frames can be obtained, and the Euler angle of each transition frame can be determined, thereby obtaining a smooth transition.
[0042] This application improves the editing effect of panoramic videos, so that when editing panoramic videos, the key frames marked by the user can be automatically transitioned smoothly, making the user's entire editing operation more efficient and concise. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the implementation modes of the present application, the drawings required for use in the description of the implementation modes will be briefly introduced below. Obviously, the drawings described below are only some implementation modes of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0044] Figure 1This is a schematic diagram of an implementation flow of a video processing method provided in Example 1 of the present application;
[0045] Figure 2 A video processing method provided in Example 1 of the present application Schematic diagram of function curve;
[0046] Figure 3 It is a schematic diagram of the module composition of a video processing device provided in Embodiment 2 of the present application;
[0047] Figure 4 It is a schematic diagram of the internal structure of a computer device provided in Example 3 of the present application. DETAILED DESCRIPTION
[0048] The present application is further described in detail below in conjunction with the accompanying drawings and implementation methods. It is particularly noted that the following implementation methods are only used to illustrate the present application, but do not limit the scope of the present application. Similarly, the following implementation methods are only some implementation methods of the present application rather than all implementation methods. All other implementation methods obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0049] The terms "including" and "having" and any variations thereof in this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or modules is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other steps or modules inherent to these processes, methods, products or devices.
[0050] The above terms are only for the convenience of description and should not be construed as limitations on the present technical solution.
[0051] Reference to "embodiment" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0052] The specific implementation of this application is described in detail below in conjunction with specific embodiments:
[0053] Embodiment 1:
[0054] Figure 1 The implementation process of a video processing method provided in Example 1 of the present application is shown. For the convenience of explanation, only the part related to the embodiment of the present application is shown, which is described in detail as follows.
[0055] Determine the starting time point t of the panorama video to be edited 1 and end time t 2 .
[0056] It should be noted that the panoramic video can be imported into the panoramic video editing software, and the panoramic video editing software can be deployed on the terminal device. After importing the panoramic video into the panoramic video editing software, the user can click the play button on the panoramic video editing software to play the video. In the process of playing the video, if the user needs to edit a certain period of time on the time progress bar to be edited, a starting point position and an ending point position can be selected on the time progress bar. The starting point position corresponds to the starting time point, and the ending point position corresponds to the ending time point. The time period between the starting time point and the ending time point is used as the time period to be edited, and the starting time point t 1 The corresponding video frame is the first key frame, and the end time point t 2 The corresponding video frame is the second key frame, and the video frame in the time period to be edited between the first key frame and the second key frame is a transition image frame.
[0057] Get the starting time point t 1 The corresponding first key frame posture information and the end time point t 2 The posture information of the corresponding second key frame, the posture information of the first key frame is the Euler angle , the posture information of the second key frame is the Euler angle .
[0058] It should be noted that the panoramic video frame is equivalent to a panoramic spherical screen, and the user adjusting the viewing angle of the panoramic video frame is equivalent to rotating the panoramic spherical screen. Therefore, when the user performs the dot editing operation, it is equivalent to constantly adjusting the posture of the panoramic video frame. By obtaining the posture of the first key frame and the posture of the second key frame, and obtaining the posture information of the transition image frame through fitting calculation, the switching of the transition image frame can be completed, and a smooth transition from the first key frame to the second key frame can be achieved. The posture can be characterized and calculated by Euler angles.
[0059] According to the Euler angle of the first key frame and the Euler angles of the second keyframe Determine the posture information of the transition image frame between the first key frame and the second key frame, wherein the posture information of the transition image frame is the Euler angle .
[0060] One specific implementation method is: is a cubic function of the Euler angles of the transition image frame with respect to the time point t, The curvature of the clipping time period [t 1 ,t 2 ] changes smoothly, and relative to the midpoint t of the time period to be edited 3 The corresponding Euler angle of the transition intermediate image frame symmetry.
[0061] It should be noted that in order to achieve a smooth transition between two adjacent key frames, the following conditions must be met at the same time:
[0062] 1) The corresponding transition posture (i.e. Euler angle ) should be in the first keyframe After the beginning, and quickly approaching the second key frame The time period to be edited [t 1 ,t 2 ]of There is no sudden change in the curvature of ;
[0063] 2) The curvature of the function curve is in the time period to be clipped [t 1 ,t 2 ] is symmetrically distributed, and the inflection point of the curve should be in the time period to be edited [t 1 ,t 2 ], that is, relative to the midpoint t of the time period to be edited 3 The Euler angles of the transition intermediate image frame Symmetry, which is reflected in the function curve, that is, relative point (t 3 , ) is centrally symmetrical.
[0064] One specific implementation method is that the Euler angles according to the first key frame and the Euler angles of the second keyframe Determining the posture information of the transition image frame between the first key frame and the second key frame includes:
[0065] The Euler angles include a pitch angle component, a roll angle component, and a heading angle component. If any one of the components is set to ;
[0066] The Euler angles of the first keyframe The amount Normalized to 0, that is =0; Set the Euler angle of the second key frame to The amount Normalized to 1, that is is 1, the Euler angle of the transition intermediate image frame The amount Normalized to 0.5, that is is 0.5;
[0067] set up With fixed value , said For the The normalized processing result of
[0068] Set the is a cubic equation of one variable: , then according to the , , and stated , to obtain the The solution;
[0069] According to the , perform the same normalization and equation calculation on the other two components of the Euler angle, and obtain , , according to the , and stated , perform comprehensive calculation to obtain the normalized Euler angle of the transition image frame ;
[0070] The normalized Euler angle of the transition image frame Perform inverse normalization to obtain the Euler angle of the transition image frame .
[0071] It should be noted that the Euler angle includes three components: pitch angle component (pitch), roll angle component (roll), and heading angle component (yaw). In the embodiment of the present application, these three components are first processed separately to obtain the value of each component. , and finally perform comprehensive calculation to obtain .
[0072] Furthermore, by transforming the Euler angle The amount After normalization, we get The data calculation process can be simplified and the complexity of data calculation can be reduced by converting the Euler angle of the first key frame into The amount Normalized to 0, that is is 0, and the first coordinate is obtained, that is, the origin coordinate (0, 0); the Euler angle of the second key frame The amount Normalized to 1, that is is 1, and the second coordinate is obtained, that is, the end point coordinate (1, 1); the Euler angle of the transition intermediate image frame is The amount Normalized to 0.5, that is is 0.5, and we get the third coordinate, which is the midpoint coordinate (0.5, 0.5).
[0073] Furthermore, setting the With fixed value , the fixed value reflect The degree of change in the curvature of the curve, that is, the degree of slowness or speed of transition between two adjacent key frames, is used to obtain the fourth coordinate, that is, the fixed point coordinate.
[0074] .
[0075] Set the is a cubic equation of one variable: , through four coordinates, namely, the origin coordinate (0, 0), the end point coordinate (1, 1), the midpoint coordinate (0.5, 0.5), the fixed point coordinate , we can calculate the constants a, b, c, d, and thus get The solution of the equation.
[0076] Further, according to the The solution of the equation is obtained by performing the same normalization processing and corresponding equation calculation on the other two components of the Euler angle. , , according to the , and stated , perform comprehensive calculation to obtain the normalized Euler angle of the transition image frame ; Finally, the Euler angle of the normalized transition image frame Perform inverse normalization to obtain the Euler angle of the transition image frame .
[0077] Finally, the normalized Euler angles of the transition image frame are Perform inverse normalization to obtain the Euler angle of the transition image frame .
[0078] One specific implementation method is that according to the , , and stated , to obtain the The solution includes:
[0079] according to =0, =1, = 0.5, , establish the The vector representation of the linear equations is: ;
[0080] Get the matrix equation: Ax=B;
[0081] When R(A)=R(A,B), the linear equation system has a unique solution, and the solution is obtained by calculation. The solution.
[0082] It should be noted that through four coordinates, namely, the origin coordinate (0, 0), the end point coordinate (1, 1), the midpoint coordinate (0.5, 0.5), and the fixed point coordinate ,get The linear equations are: ;
[0083] Establish The vector representation of is: ;
[0084] And get the matrix equation: Ax=B;
[0085] From the solution of the matrix equation, it can be seen that when the rank of the augmented matrix is equal to the rank of the coefficient matrix, that is, R(A)=R(A,B), the linear equation system has a unique solution. Therefore, the above can be obtained by calculation. The solution.
[0086] One specific implementation method is that the Euler angle of the normalized transition image frame Perform inverse normalization to obtain the Euler angle of the transition image frame ,include: .
[0087] One specific implementation method is that the setting With fixed value , including: the t c is 0.2, the fixed value is 0.124.
[0088] It should be noted that the 0.124 is a fixed value for a smoother transition obtained based on a large amount of actual data and empirical calculations.
[0089] One specific implementation method is to use the fixed value is 0.124, and the normalized Euler angle of the transition image frame is calculated. for ;
[0090] It should be noted that according to According to the anti-normalization: ;
[0091] Get the Euler angle of the transition image frame .
[0092] One specific implementation method is to use the Euler angle of the first key frame. , the Euler angle of the second key frame and the Euler angles of the transition image frame , play the planar video content of the time period to be edited.
[0093] It should be noted that according to The posture information of each of the transition image frames can be obtained, thereby realizing the Euler angle of each of the transition image frames from the first key frame to the second key frame, so as to perform accurate and smooth transition of each frame according to the Euler angle of each of the transition image frames, thereby achieving a smooth transition effect of key frame dotting of the panoramic video.
[0094] Embodiment 2:
[0095] Figure 3 A schematic diagram of the module composition of a video processing device provided in the second embodiment of the present application is shown. For the sake of convenience of explanation, only the parts related to the embodiment of the present application are shown.
[0096] A video processing device according to an embodiment of the present application includes:
[0097] The first determining module is used to determine the starting time point t of the time period to be edited of the panoramic video. 1 and end time t 2 ;
[0098] An acquisition module is used to acquire the starting time point t 1 The corresponding first key frame posture information and the end time point t 2 The posture information of the corresponding second key frame, the posture information of the first key frame is the Euler angle , the posture information of the second key frame is the Euler angle ;
[0099] A second determining module is used to determine the Euler angle of the first key frame according to the and the Euler angles of the second keyframe Determine the posture information of the transition image frame between the first key frame and the second key frame, wherein the posture information of the transition image frame is the Euler angle ;
[0100] A playback module, the playback module is used to generate a video according to the Euler angle of the first key frame. , Euler angles of the second keyframe and the Euler angles of the transition image frame , play the planar video content of the time period to be edited.
[0101] A video processing device according to an embodiment of the present application is used to implement a video processing method provided in any specific implementation manner of the first embodiment of the present application:
[0102] Determine the starting time point t of the panorama video to be edited 1 and end time t 2 ;
[0103] Get the starting time point t 1 The corresponding first key frame posture information and the end time point t 2 The posture information of the corresponding second key frame, the posture information of the first key frame is the Euler angle , the posture information of the second key frame is the Euler angle ;
[0104] According to the Euler angle of the first key frame and the Euler angles of the second keyframe Determine the posture information of the transition image frame between the first key frame and the second key frame, wherein the posture information of the transition image frame is the Euler angle ;
[0105] According to the Euler angle of the first key frame , the Euler angle of the second key frame and the Euler angles of the transition image frame , play the planar video content of the time period to be edited.
[0106] It should be noted that each module in the above video processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0107] It should be noted that for technical details that are not described in detail in this embodiment, reference can be made to the video processing method provided in the above-mentioned embodiment 1, and will not be repeated here.
[0108] Embodiment three:
[0109] In an embodiment of the present application, a computer device is provided. Figure 4 A schematic diagram of the internal structure of a computer device.
[0110] The computer device includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the video processing method in any specific implementation manner provided in Embodiment 1 of the present application, specifically including:
[0111] Determine the starting time point t of the panorama video to be edited 1 and end time t 2 ;
[0112] Get the starting time point t 1 The corresponding first key frame posture information and the end time point t 2 The posture information of the corresponding second key frame, the posture information of the first key frame is the Euler angle , the posture information of the second key frame is the Euler angle ;
[0113] According to the Euler angle of the first key frame and the Euler angles of the second keyframe Determine the posture information of the transition image frame between the first key frame and the second key frame, wherein the posture information of the transition image frame is the Euler angle ;
[0114] According to the Euler angle of the first key frame , the Euler angle of the second key frame and the Euler angles of the transition image frame , play the planar video content of the time period to be edited.
[0115] It should be noted that the computer device may be a terminal, and its internal structure diagram may be as follows: Figure 4As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a video processing method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0116] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0117] It should be noted that for technical details that are not described in detail in this embodiment, reference can be made to the video processing method provided in the above-mentioned embodiment 1, and will not be repeated here.
[0118] Embodiment 4:
[0119] In an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the video processing method in any specific implementation manner provided in the first embodiment of the present application is implemented, specifically including:
[0120] Determine the starting time point t of the panorama video to be edited 1 and end time t 2 ;
[0121] Get the starting time point t 1 The corresponding first key frame posture information and the end time point t 2 The posture information of the corresponding second key frame, the posture information of the first key frame is the Euler angle , the posture information of the second key frame is the Euler angle ;
[0122] According to the Euler angle of the first key frame and the Euler angles of the second keyframe Determine the posture information of the transition image frame between the first key frame and the second key frame, wherein the posture information of the transition image frame is the Euler angle ;
[0123] According to the Euler angle of the first key frame , the Euler angle of the second key frame and the Euler angles of the transition image frame , play the planar video content of the time period to be edited.
[0124] It should be noted that for technical details that are not described in detail in this embodiment, reference can be made to the video processing method provided in the above-mentioned embodiment 1, and will not be repeated here.
[0125] Different from the prior art, the embodiments of the present application provide a video processing method, apparatus, computer device and storage medium, wherein the video processing method includes:
[0126] Determine the starting time point t of the panorama video to be edited 1 and end time t 2 ;
[0127] Get the starting time point t 1 The corresponding first key frame posture information and the end time point t 2 The posture information of the corresponding second key frame, the posture information of the first key frame is the Euler angle , the posture information of the second key frame is the Euler angle ;
[0128] According to the Euler angle of the first key frame and the Euler angles of the second keyframe Determine the posture information of the transition image frame between the first key frame and the second key frame, wherein the posture information of the transition image frame is the Euler angle ;
[0129] According to the Euler angle of the first key frame , the Euler angle of the second key frame and the Euler angles of the transition image frame , play the planar video content of the time period to be edited.
[0130] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0131] By introducing the Euler angles representing the key frame posture information between two adjacent key frames and calculating the Euler angles, the posture information of each transition frame between adjacent key frames can be obtained, and the Euler angles of each transition frame can be determined, thereby obtaining a smooth transition.
[0132] This application improves the editing effect of panoramic videos, so that when editing panoramic videos, the key frames marked by the user can be automatically transitioned smoothly, making the user's entire editing operation more efficient and concise.
[0133] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0134] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0135] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a terminal device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0136] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A video processing method, characterized in that: The video processing method comprises: Determine the starting time point t1 and the ending time point t2 of the time period to be edited of the panoramic video; Acquire the posture information of the first key frame corresponding to the starting time point t1 and the posture information of the second key frame corresponding to the ending time point t2, wherein the posture information of the first key frame is the Euler angle φ(t1), and the posture information of the second key frame is the Euler angle φ(t2); Determining the posture information of the transition image frame between the first key frame and the second key frame according to the Euler angle φ(t1) of the first key frame and the Euler angle φ(t2) of the second key frame, wherein the posture information of the transition image frame is the Euler angle φ(t); Play the planar video content of the time period to be edited according to the Euler angle φ(t1) of the first key frame, the Euler angle φ(t2) of the second key frame, and the Euler angle φ(t) of the transition image frame; φ(t) is a cubic function of the Euler angle of the transition image frame with respect to the time point t, the curvature of φ(t) changes smoothly in the time period to be edited [t1, t2], and is symmetrical with respect to the Euler angle φ(t3) of the transition intermediate image frame corresponding to the midpoint t3 of the time period to be edited; The determining of the posture information of the transition image frame between the first key frame and the second key frame according to the Euler angle φ(t1) of the first key frame and the Euler angle φ(t2) of the second key frame includes: The Euler angle includes a pitch angle component, a roll angle component, and a heading angle component, and any one of the components is set to φ1(t); The component φ1(t1) of the Euler angle φ(t1) of the first key frame is normalized to 0, that is, φ - 1(0) is 0, and the component φ1(t2) of the Euler angle φ(t2) of the second key frame is normalized to 1, that is, φ - 1(1) is 1, then the component φ1(t3) of the Euler angle φ(t3) of the transition intermediate image frame is normalized to 0.5, that is, φ - 1(0.5) is 0.5; Setting φ - 1(t) has a fixed value φ - 1(t c ), the φ - 1(t) is the normalized result of φ1(t); Set the φ - 1(t) is a cubic equation of one variable: φ - 1(t)=a+bt+ct 2 +dt 3 , then according to the φ - 1(0), said φ - 1(1), said φ - 1(0.5) and the φ - 1(t c ), and obtain the φ - The solution of 1(t); According to the - 1(t), perform the same normalization and equation calculation on the other two components of the Euler angle to obtain φ - 2(t),φ - 3(t), according to the φ - 1(t), the φ - 2(t) and the φ - 3(t), perform comprehensive calculation to obtain the normalized Euler angle φ of the transition image frame - (t); The normalized Euler angle φ of the transition image frame - (t) is denormalized to obtain the Euler angle φ(t) of the transition image frame.
2. A video processing method according to claim 1, characterized in that: According to the - 1(0), said φ - 1(1), said φ - 1(0.5) and the φ - 1(t c ), and obtain the φ - The solution of 1(t) includes: According to φ - 1(0)=0, the φ - 1(1)=1, the φ - 1(0.5)=0.5, the φ - 1(t c )=φ - 1(t c ), establish the φ - 1(t)=a+bt+ct 2 +dt 3 The vector representation of the linear equations is: The matrix equation is obtained: Ax = B; When R(A)=R(A,B), the linear equation system has a unique solution, and the φ is obtained by calculation. - The solution of 1(t).
3. A video processing method according to claim 2, characterized in that: The Euler angle φ of the normalized transition image frame - (t) is denormalized to obtain the Euler angle φ(t) of the transition image frame, including: φ(t)=φ - (0)+(φ - (1)-f - (0))×φ - (t)。 4. A video processing method according to any one of claims 1 to 3, characterized in that: The setting of φ - 1(t) has a fixed value φ - 1(t c ),include: The c is 0.2, and the fixed value φ - 1(0.2) is 0.
124.
5. A video processing method according to claim 4, characterized in that: According to the fixed value φ - 1(0.2) is 0.124, and the normalized Euler angle φ of the transition image frame is calculated. - (t) is φ - (t) = 3t 2 -2t 3 .
6. A video processing device, characterized in that: The device comprises: A first determining module, the first determining module is used to determine the starting time point t1 and the ending time point t2 of the time period to be edited of the panoramic video; An acquisition module, the acquisition module is used to acquire the posture information of the first key frame corresponding to the starting time point t1 and the posture information of the second key frame corresponding to the ending time point t2, the posture information of the first key frame is the Euler angle φ(t1), and the posture information of the second key frame is the Euler angle φ(t2); A second determining module, the second determining module is used to determine the posture information of the transition image frame between the first key frame and the second key frame according to the Euler angle φ(t1) of the first key frame and the Euler angle φ(t2) of the second key frame, the posture information of the transition image frame being the Euler angle φ(t); φ(t) is a cubic function of the Euler angle of the transition image frame with respect to the time point t, the curvature of φ(t) changes smoothly in the time period to be edited [t1, t2], and is symmetrical with respect to the Euler angle φ(t3) of the transition intermediate image frame corresponding to the midpoint t3 of the time period to be edited; The determining of the posture information of the transition image frame between the first key frame and the second key frame according to the Euler angle φ(t1) of the first key frame and the Euler angle φ(t2) of the second key frame includes: The Euler angle includes a pitch angle component, a roll angle component, and a heading angle component, and any one of the components is set to φ1(t); The component φ1(t1) of the Euler angle φ(t1) of the first key frame is normalized to 0, that is, φ - 1(0) is 0, and the component φ1(t2) of the Euler angle φ(t2) of the second key frame is normalized to 1, that is, φ - 1(1) is 1, then the component φ1(t3) of the Euler angle φ(t3) of the transition intermediate image frame is normalized to 0.5, that is, φ - 1(0.5) is 0.5; Setting φ - 1(t) has a fixed value φ - 1(t c ), the φ - 1(t) is the normalized result of φ1(t); Set the φ - 1(t) is a cubic equation of one variable: φ - 1(t)=a+bt+ct 2 +dt 3 , then according to the φ - 1(0), said φ - 1(1), said φ - 1(0.5) and the φ - 1(t c ), and obtain the φ - The solution of 1(t); According to the - 1(t), perform the same normalization and equation calculation on the other two components of the Euler angle to obtain φ - 2(t),φ - 3(t), according to the φ - 1(t), the φ - 2(t) and the φ - 3(t), perform comprehensive calculation to obtain the normalized Euler angle φ of the transition image frame - (t); The normalized Euler angle φ of the transition image frame - (t) performing inverse normalization to obtain the Euler angle φ(t) of the transition image frame; A playing module is used to play the planar video content of the time period to be edited according to the Euler angle φ(t1) of the first key frame, the Euler angle φ(t2) of the second key frame and the Euler angle φ(t) of the transition image frame.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the video processing method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the video processing method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Human motion interpolation method based on motion capture data
CN104463788A
Video processing method and device, electronic equipment and storage medium
CN117131225A
Method and apparatus for media capture device position estimate- assisted splicing of media
US20150155009A1
