Panoramic video editing method and device, and computer equipment

By selecting a starting frame and generating a sliding trajectory in the panoramic video editing interface, combined with spherical projection and optimization processing, the problem of insufficient path flexibility in traditional panoramic video editing technology is solved, enabling user-friendly complex perspective changes and efficient creation.

CN121056705APending Publication Date: 2025-12-02LABPANO TECHNOLOGY (CHANGZHOU) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511286622.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-10
Publication Date
2025-12-02

AI Technical Summary

Technical Problem

Traditional keyframe editing techniques cannot flexibly adjust transition effects in panoramic videos, resulting in a single way of perspective transitions, making it difficult to meet diverse creative needs, and also resulting in high operational complexity and low production efficiency.

Method used

This paper provides a panoramic video editing method. By selecting a starting frame in the editing interface and responding to the sliding operation, a sliding trajectory is generated. The motion trajectory is mapped to a planar space by combining the spherical projection rule. Users can freely design the animation path. The trajectory is optimized by Gaussian filtering and Bézier curve interpolation, and intuitive hand-drawing operation is achieved.

Benefits of technology

Users can quickly define animation paths without professional knowledge, achieve complex perspective changes, avoid homogenization of animation effects, and improve creation efficiency and intuitive operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121056705A_ABST
    Figure CN121056705A_ABST
Patent Text Reader

Abstract

The invention relates to a panoramic video editing method and device and computer equipment. The method comprises the following steps: determining a panoramic video to be edited, and importing the panoramic video to be edited into an editing interface; selecting and generating a start frame on a time axis of the to-be-edited interface; in response to the detected sliding operation for the display view angle of the panoramic video after the starting frame, generating and displaying a sliding track in the panoramic video after the starting frame according to the sliding operation; an end frame is selected and generated on the time axis of the to-be-edited interface, a target video is generated based on the starting frame and the end frame according to the sliding track, and the change of the display visual angle between the first frame and the last frame in the target video corresponds to the sliding track. By adopting the method, the transition effect can be flexibly adjusted, so that the transition mode between the key frames is more flexible and changeable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of panoramic video editing technology, and in particular to a panoramic video editing method, apparatus, computer equipment, and storage medium. Background Technology

[0002] With the development of panoramic video, panoramic cameras are increasingly being used to capture panoramic videos of various motion scenes. In the post-production of panoramic videos and photographs, keyframe editing technology is a core method for achieving dynamic perspective switching and animation effects, widely used in film and television creation, virtual reality content development, and advertising production. However, as users' demands for the visual expressiveness of panoramic content increase, the limitations of traditional keyframe editing technology in terms of flexibility, intuitiveness, and efficiency in producing special animations are becoming increasingly apparent, making it difficult to meet diverse creative needs.

[0003] Currently, traditional keyframe editing techniques for transition animations in panoramic videos and photos generally employ an automatic calculation mode based on the "shortest path from point to point": users only need to set the start and end keyframes, and the system will automatically generate a transition animation path in the form of a straight line or the shortest curve based on the coordinates of the two points. While this mode offers a certain degree of ease of operation, it lacks flexibility in adjusting transition effects in practical applications, resulting in a relatively limited range of transition methods between keyframes in panoramic videos. Summary of the Invention

[0004] Therefore, it is necessary to provide a panoramic video editing method, apparatus, computer equipment, and storage medium to address the aforementioned technical problems.

[0005] Firstly, this disclosure provides a panoramic video editing method. The method includes:

[0006] Select the panoramic video to be edited and import it into the editing interface;

[0007] Select and generate a start frame on the timeline of the interface to be edited;

[0008] In response to detecting a sliding operation for the display viewpoint of the panoramic video after the starting frame, a sliding trajectory is generated and displayed in the panoramic video after the starting frame according to the sliding operation;

[0009] Select and generate an end frame on the timeline of the interface to be edited. Based on the start frame and the end frame, generate a target video according to the sliding trajectory. The change in display perspective between the first frame and the last frame in the target video corresponds to the sliding trajectory.

[0010] In one embodiment, the panoramic video to be edited is a spherical panoramic video, and the step of generating and displaying a sliding trajectory in the panoramic video after the starting frame according to the sliding operation includes:

[0011] Determine the sliding direction and sliding coordinates indicated by the sliding operation;

[0012] Based on the sliding direction and sliding coordinates, adjust the spherical panoramic video to determine the motion trajectory of the spherical panoramic video;

[0013] Based on the spherical projection rule, the motion trajectory is mapped onto a planar space to generate and display the sliding trajectory.

[0014] In one embodiment, the step of mapping the motion trajectory onto a planar space based on spherical projection rules to generate and display the sliding trajectory includes:

[0015] Determine the sliding speed indicated by the sliding operation;

[0016] Based on the sliding speed, a trajectory pattern is determined, the trajectory pattern including: trajectory thickness and / or trajectory line style;

[0017] Based on the spherical projection rules, the motion trajectory is mapped onto a planar space, and a sliding trajectory is generated and displayed based on the trajectory pattern.

[0018] In one embodiment, generating and displaying the sliding trajectory includes:

[0019] The sliding trajectory is optimized by sequentially applying Gaussian filtering for noise reduction and Bezier curve interpolation.

[0020] The feature consistency verification is performed between the optimized sliding trajectory and the unoptimized sliding trajectory.

[0021] In response to the successful verification of the feature consistency, the optimized sliding trajectory is generated and displayed.

[0022] In one embodiment, the feature consistency verification includes one or more of the following: direction and number of rotations verification, core shape verification, and smoothness verification; the feature consistency verification between the optimized sliding trajectory and the unoptimized sliding trajectory includes:

[0023] Determine the first pixel coordinate sequence of the sliding trajectory obtained after the optimization process, and determine the second pixel coordinate sequence of the sliding trajectory without optimization process;

[0024] Based on the first pixel coordinate sequence, a first direction and a first number of revolutions are determined; based on the second pixel coordinate sequence, a second direction and a second number of revolutions are determined.

[0025] Perform direction and number of revolutions verification based on the first direction and the first number of revolutions, as well as the second direction and the second number of revolutions;

[0026] Determine feature calculation points at multiple identical positions in the sliding trajectory obtained after optimization and the sliding trajectory without optimization. Based on the feature calculation points at multiple identical positions, calculate multiple first radii of curvature of the sliding trajectory obtained after optimization and multiple second radii of curvature of the sliding trajectory without optimization.

[0027] The variance of the first radius of curvature is calculated based on the plurality of first radii of curvature, and the variance of the second radius of curvature is calculated based on the plurality of second radii of curvature.

[0028] Core morphology verification is performed using the first radius of curvature variance and the second radius of curvature variance;

[0029] Smoothness verification is performed based on the first radius of curvature variance.

[0030] In one embodiment, after generating and displaying the sliding trajectory, the method further includes:

[0031] If no sliding operation is detected for the display view of the panoramic video after the starting frame after a preset time period, the displayed sliding trajectory will be hidden.

[0032] In one embodiment, after selecting and generating the end frame on the timeline of the interface to be edited, the method further includes:

[0033] In response to detecting the deletion of the end frame, the displayed sliding trajectory is deleted, and the display perspective of the panoramic video in the editing interface is adjusted to the display perspective of the start frame.

[0034] In one embodiment, when the panoramic video to be edited is imported into the editing interface, the panoramic video to be edited is in a paused state, and the method further includes:

[0035] In response to the panoramic video to be edited being in playback state, and a sliding operation of the display view of the panoramic video after the starting frame being detected, an end frame is selected and generated on the timeline of the interface to be edited.

[0036] In response to the panoramic video to be edited being in a playback state at the start time, and after detecting a sliding operation of the display view of the panoramic video after the start frame, when the panoramic video to be edited is adjusted to a paused state, a sliding trajectory is generated and displayed in the panoramic video after the start frame according to the sliding operation.

[0037] A keyframe transition video is generated based on the start frame and the end frame, and the change in display perspective between the first frame and the last frame in the keyframe transition video is the shortest path between the start frame and the end frame.

[0038] Secondly, this disclosure also provides a panoramic video editing device. The device includes:

[0039] The video import module is used to identify the panoramic video to be edited and import the panoramic video to be edited into the editing interface.

[0040] The start frame generation module is used to select and generate a start frame on the timeline of the interface to be edited.

[0041] A sliding trajectory display module is used to generate and display a sliding trajectory in the panoramic video after the starting frame in response to detecting a sliding operation of the display viewpoint of the panoramic video after the starting frame.

[0042] The video generation module is used to select and generate an end frame on the timeline of the interface to be edited, and generate a target video based on the start frame and the end frame and according to the sliding trajectory. The change in display perspective between the first frame and the last frame in the target video corresponds to the sliding trajectory.

[0043] Thirdly, this disclosure also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps in any of the above method embodiments.

[0044] Fourthly, this disclosure also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps in any of the above method embodiments.

[0045] Fifthly, this disclosure also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.

[0046] In the above embodiments, the sliding trajectory is displayed in real time, transforming the traditional abstract parameter adjustment of keyframes into intuitive hand-drawn operations. This allows users to define animation paths simply by sliding a single finger, without needing professional knowledge. Furthermore, the trajectory shape can be seen in real time during the sliding process, avoiding "blind operation followed by preview and rework." Even non-professional creators can quickly get started. Traditional keyframes can only generate the shortest straight line / curve animation between the "start frame and end frame," failing to meet creative needs such as "multiple rotations," "spiral pitch," and "long path turns." This disclosure, by "recording the user's actual sliding trajectory," allows users to freely design path shapes—for example, when creating complex animations like "360°×3 rotation + upward pitch," it can be achieved simply through a combination of multiple rotations and vertical sliding, without the need for densely adding keyframes or manually adjusting path parameters. This makes the perspective changes in panoramic videos more aligned with the user's creative vision, avoiding homogenized animation effects. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0048] Figure 1 This is a flowchart illustrating a panoramic video editing method in one embodiment;

[0049] Figure 2 This is a schematic diagram of the sliding trajectory generated in the editing interface in one embodiment;

[0050] Figure 3 This is a flowchart illustrating step S106 in one embodiment;

[0051] Figure 4 This is a flowchart illustrating step S206 in one embodiment;

[0052] Figure 5 This is a flowchart illustrating the generation and display of a sliding trajectory in one embodiment;

[0053] Figure 6 This is a flowchart illustrating step S404 in one embodiment;

[0054] Figure 7 This is a schematic diagram of the process for generating keyframe transition video in one embodiment;

[0055] Figure 8 This is a structural block diagram of a panoramic video editing device in one embodiment;

[0056] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this disclosure.

[0058] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings herein are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0059] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0060] As described in the background section, traditional keyframe transition methods lack path flexibility and cannot meet the needs of personalized creation. Limited by the "shortest path" calculation logic, traditional technology can only generate transition trajectories with the shortest distance between two points, failing to support users in customizing longer and more complex paths (such as spiral trajectories, multi-rotation trajectories, etc.) according to their creative design needs. This results in highly homogenized animation effects for panoramic content, making it difficult to highlight creative uniqueness. Furthermore, the animation path lacks intuitiveness, giving users limited control over the creative process. Under the traditional technology framework, after setting keyframes, users can only judge whether the path meets expectations by previewing the final animation effect, unable to view the transition path's direction in real time during operation. This "set first, preview later" mode requires users to repeatedly adjust keyframe positions to correct path deviations, increasing operational costs and reducing creative efficiency. Special animation production is inefficient and highly complex. For special effects commonly found in panoramic videos, such as multi-rotation animations, multi-flip animations, and spiral pitch animations, traditional keyframe technology requires densely adding keyframes and manually adjusting the parameters of each path segment. For example, when creating a three-rotation animation, users need to insert keyframes multiple times on the rotation trajectory to divide the path, and then adjust the angle and speed parameters between each keyframe one by one. The operation process is cumbersome and prone to problems such as path breakage and uneven speed, which seriously affects production efficiency and animation quality.

[0061] Therefore, in one embodiment, to address the aforementioned technical problems, such as Figure 1 As shown, a panoramic video editing method is provided. Taking the application of this method to a terminal device as an example, the method includes the following steps:

[0062] S102, Determine the panoramic video to be edited, and import the panoramic video to be edited into the editing interface.

[0063] The panoramic video to be edited typically refers to video footage with a "360° full-view" feature that requires keyframe editing (such as custom path transitions and viewpoint animation). Its content is constructed based on a 3D spherical space model—users can view the scene in any direction (front, back, left, right, up, down, sky, and ground) through interactive operations (such as swiping and rotating), rather than the fixed perspective of traditional videos. Common sources include immersive videos shot with VR cameras, landscape videos recorded in drone panoramic mode, and virtual panoramic videos generated by 3D modeling. Formats typically support MP4, MOV, MKV, etc., and must include "panoramic projection information" (such as equirectangular rectangular projection formats to ensure accurate viewpoint mapping during editing). The editing interface typically refers to a visual operation window used for "material management, keyframe manipulation, trajectory editing, and effect preview" of the panoramic video.

[0064] Specifically, the panoramic video to be edited can be determined from multiple captured panoramic video clips. After determining the panoramic video to be edited, it can be imported into the editing interface for editing. After importing the panoramic video, the preview area of ​​the editing interface can display the "direct front view" by default (corresponding to the 0° horizontal angle and 0° vertical angle of the 3D sphere). Users can temporarily adjust the view by "single-finger swipe in the preview area" (at this time, the trajectory is not recorded, only used to view the video content). When swiping, the preview area screen will synchronously follow the view change (e.g., swiping to the left displays the scene on the left side of the video). A timeline can also be displayed at the bottom of the panoramic video in the preview area. In addition, the system displays the time scale of the panoramic video on the timeline with "frame-level precision" (e.g., 30 frame markers per second, adapted to a 30fps frame rate). Users can drag the "timeline pointer" to position to any frame, and the panoramic preview area will synchronously display the corresponding frame after positioning. A "keyframe operation bar" can also be automatically displayed next to the timeline, providing "add keyframe", "delete keyframe", and "edit keyframe" buttons.

[0065] S104, Select and generate a starting frame on the timeline of the interface to be edited.

[0066] The linear time control component in the editing interface, used for "locating video time nodes, managing editing intervals, and associating keyframes," is the core component for starting frame selection. For panoramic video editing, in addition to the traditional timeline functions of "time scale display, pointer dragging, and interval selection," it also needs to support "keyframe marking and association"—clearly displaying added keyframes (such as starting frame A and ending frame B) and marking the animation intervals between keyframes. Simultaneously, it should link with the panoramic preview area (when the timeline pointer is dragged, the preview area synchronously displays the panoramic view at the corresponding time point), ensuring that the starting frame accurately matches the target viewpoint. The starting frame typically refers to the specific video frame that serves as the starting point for video editing in panoramic video keyframe editing.

[0067] Specifically, a starting frame can be selected and generated on the timeline in the editing interface. In some exemplary embodiments, at the pause frame located on the timeline, the "Add Keyframe" button (usually a diamond shape, gray by default, turning yellow after clicking to indicate that a keyframe has been added) in the "Keyframe Operation Bar" next to the timeline can be clicked; after receiving the instruction, the system automatically generates a "keyframe" at the current timeline pointer position (displayed as a yellow circle on the timeline), and the currently confirmed "viewpoint parameters (α, β)" and "time parameters (current time point)" are bound to the keyframe and stored in the "keyframe database"; after the keyframe is generated, a "frame information label" (containing the time point and viewpoint parameters, such as "00:02:38|α=45°|β=0°") will be automatically displayed next to the keyframe on the timeline, and the user can hover over the label to view details for easy subsequent identification. It is understood that the above is only for illustrative purposes.

[0068] S106, in response to detecting a sliding operation for the display viewpoint of the panoramic video after the starting frame, a sliding trajectory is generated and displayed in the panoramic video after the starting frame according to the sliding operation.

[0069] The sliding operation for adjusting the display perspective of the panoramic video after the starting frame typically refers to the user's interactive action of adjusting the "viewpoint of the panoramic video after the starting frame" by sliding a single finger in the panoramic preview area of ​​the editing interface, provided that "the starting frame has been generated and the panoramic video is paused." The sliding trajectory usually refers to the visual lines and data sequence generated in the panoramic video based on the user's sliding operation, reflecting the "path of perspective change." It usually has two meanings: 1. At the visualization level: 2D lines displayed in real time in the panoramic preview area with a "drawing effect," intuitively showing the direction and number of circles of the user's sliding (e.g., displaying multiple continuous lines when sliding multiple circles); 2. At the data level: a continuous sequence of lens rotation parameters (horizontal rotation angle α, vertical pitch angle β) in 3D spherical space, which is the core data foundation for the subsequent generation of the target video and needs to be optimized to ensure smoothness and continuity.

[0070] Specifically, once the preconditions (selection and generation of a start frame) are met, user actions in the panoramic preview area can be captured. Typically, in some embodiments of this disclosure, the terminal device is a touch device; therefore, the complete event sequence of "(finger press) → (finger slide) → (finger lift)" can be monitored on the touch device, recording the real-time coordinate changes (X, Y) of the finger in the preview area. To eliminate accidental touches caused by slight finger tremors, a "slide distance threshold" (e.g., ≥5 pixels) can be set. Only when the user's slide distance exceeds the threshold is it considered a "valid slide operation," triggering subsequent trajectory data acquisition and avoiding the generation of "fragmented invalid trajectories." After a valid slide operation is triggered, the "core data of the slide path" (e.g., direction, number of rotations, coordinate sequence) is collected in real time and associated with the 3D spherical space parameters of the panoramic video. The slide trajectory is then displayed in real time in the panoramic preview area, allowing the user to intuitively control the path shape.

[0071] In some exemplary embodiments, the generated sliding trajectory can be as follows: Figure 2 As shown, Figure 2 The black line in the middle represents the generated sliding trajectory. The frame generated at 02:38 could be the end frame.

[0072] S108, select and generate an end frame on the timeline of the interface to be edited, generate a target video based on the start frame and the end frame, and according to the sliding trajectory, wherein the change in display perspective between the first frame and the last frame in the target video corresponds to the sliding trajectory. For example, the change in display perspective between the first frame and the last frame can be switched at a constant speed according to the sliding trajectory.

[0073] In panoramic video keyframe editing, the ending frame typically refers to a specific video frame paired with the starting frame, serving as the "end point of the custom path animation." Its core function is to lock the "end point time position" and "end point view" of the animation. Temporally, the ending frame must be located within the timeline interval following the starting frame; in terms of view, the ending frame can have a different viewpoint than the starting frame (determined by the end point viewpoint of the sliding trajectory). The target video typically refers to a transition animation generated according to the user's sliding trajectory (an optimized, smooth trajectory) within the "start frame - ending frame" animation interval. The target video is usually a planar video with a fixed viewpoint that cannot be adjusted.

[0074] Specifically, if the user does not adjust the viewing angle, the "end view of the sliding trajectory" can be used as the default view of the ending frame, that is, the 3D spherical parameters (α_end, β_end) corresponding to the last moment of the sliding operation, ensuring that the animation naturally transitions from the starting frame view to this view along the trajectory. When generating the target video, the duration between the starting frame and the ending frame can be determined first, the sliding trajectory can be converted into 3D trajectory data, and then the 3D trajectory data (a total of N angle data points) can be mapped to 150 frames according to the "uniform time distribution" principle: the angle change corresponding to each frame = (total angle change) / F, ensuring that the animation plays at a uniform speed within the AB interval; for example: if the sliding trajectory corresponds to angle α changing from 30° to 180° (total change of 150°), and T = 5 seconds (150 frames), then angle α increases by 1° (150° / 150 frames) in each frame, achieving uniform rotation.

[0075] In the aforementioned panoramic video editing method, the real-time display of the sliding trajectory transforms the abstract parameter adjustments of traditional keyframes into intuitive hand-drawn operations. This allows users to define animation paths simply by sliding a single finger, without needing professional knowledge. Furthermore, the trajectory shape can be seen in real-time during the sliding process, avoiding "blind operation followed by preview and rework." Even non-professional creators can quickly get started. Traditional keyframes can only generate the shortest straight line / curve animation between the "start frame and end frame," failing to meet creative needs such as "multiple rotations," "spiral pitch," and "long path turns." This disclosure, however, allows users to freely design path shapes by "recording the user's actual sliding trajectory"—for example, when creating complex animations like "360°×3 rotation + upward pitch," it can be achieved simply through a combination of multiple rotations and vertical sliding, without the need for densely adding keyframes or manually adjusting path parameters. This makes the perspective changes in panoramic videos more aligned with the user's creative vision, avoiding homogenized animation effects.

[0076] In one embodiment, such as Figure 3 As shown, the panoramic video to be edited is a spherical panoramic video. The step of generating and displaying a sliding trajectory in the panoramic video after the starting frame based on the sliding operation includes:

[0077] S202, determine the sliding direction and sliding coordinates indicated by the sliding operation.

[0078] S204, adjust the spherical panoramic video according to the sliding direction and sliding coordinates, and determine the motion trajectory of the spherical panoramic video.

[0079] S206, Based on the spherical projection rule, the motion trajectory is mapped onto a planar space to generate and display the sliding trajectory.

[0080] The sliding direction refers to the directional trend of the finger movement when the user performs a single-finger swipe in the panoramic preview area (2D plane) of the editing interface, such as horizontal to the right, vertical down, clockwise around the center, or diagonally at 45°, etc. It is the core basis for determining the rotation direction of the spherical panoramic video lens. The sliding coordinates usually refer to the real-time position data of the finger in the pixel coordinate system of the 2D preview area during the sliding process, presented in the form of "(X, Y)" (usually with the upper left corner of the preview area as the origin, the X-axis to the right as positive, and the Y-axis downward as positive). It includes information such as the starting point coordinates, the process coordinate sequence, and the ending point coordinates, and is the basic data for calculating the lens rotation angle and generating the motion trajectory. Spherical panoramic video is usually a panoramic video built based on a 3D spherical space model. Its content covers a 360° horizontal view and ±90° vertical view. Users can view the scene in any direction by adjusting the rotation angle of the lens on the spherical surface (horizontal rotation angle α, vertical pitch angle β). The motion trajectory of a spherical panoramic video typically refers to the continuous rotational path of the camera within the 3D spherical space of the video, generated by the user's sliding operation, in the form of "(α1,β1,T1), (α2,β2,T2)...(α...T1)". n ,β n ,T n The parameter sequence (α is the horizontal rotation angle, β is the vertical pitch angle, and T is the timestamp) directly determines the path shape of the panoramic video's viewpoint change and is the raw data for subsequent mapping to a planar sliding trajectory. Spherical projection rules are usually mapping rules that transform the 3D spherical space data (such as lens motion trajectory and scene images) of spherical panoramic video into 2D planar space displayable content, such as a rectangular projection.

[0081] Specifically, the sliding coordinates of the sliding operation in the editing interface of the terminal device can be captured in real time. The sliding direction is calculated based on the sliding coordinates, for example, through vector analysis. Based on the analyzed sliding direction and coordinates, the motion trajectory of the spherical panoramic video lens is calculated using spherical projection rules. For example, the "equirectangular projection inverse mapping" rule can be used to establish the correspondence between the sliding coordinates (X,Y) and the spherical lens angles (α,β), as follows:

[0082] Calculation of horizontal rotation angle α: The horizontal pixel width of the preview area is W, and the horizontal viewing angle range corresponding to the sliding X coordinate is 0°~360°, then α=(X / W)×360°; For example, the width of the preview area W=1920 pixels, and the sliding X coordinate is from 480→1440, then ΔX=960, Δα=(960 / 1920)×360°=180°, that is, the lens rotates 180° horizontally clockwise;

[0083] Vertical tilt angle β calculation: The vertical pixel height of the preview area is H. The vertical viewing angle range corresponding to the sliding Y-coordinate is -90° to +90° (up to -90°, down to +90°). Therefore, β = [(Y / H) × 180°] - 90°. For example, if the preview area height H = 1080 pixels, and the Y-coordinate slides from 270 to 810, then ΔY = 540, and Δβ = [(540 / 1080) × 180°] - 90° = 0° - (-45°) = 45°, meaning the lens is tilted vertically downwards by 45 degrees. ° .

[0084] Based on the timestamp T of the sliding coordinate sequence, each (X) i ,Y i The above algorithm transforms it into the corresponding (α) i ,β i ), forming “(α0,β0,T0), (α1,β1,T1)…(α n ,β n ,T n )" 3D angle sequence.

[0085] Based on the rule of "equirectangular projection forward mapping", the 3D motion trajectory (α) i ,β i ) Reconstructed into 2D planar coordinates (X' i ,Y' i ), ensuring that the planar trajectory and the 3D motion trajectory are consistent:

[0086] X' i =(α i ( / 360°)×W; for example, α i =90°, W=1920 pixels, then X' i =(90 / 360)×1920=480 pixels;

[0087] Y' i =[(βᵢ+90°) / 180°]×H; for example, β i =-45°, H=1080 pixels, then Y' i =[(-45+90) / 180]×1080=270 pixels.

[0088] In the order of timestamps, in the planar coordinate sequence (X'0, Y'0) → (X'1, Y'1) → … → (X' n ,Y' nLines are drawn segment by segment between the lines, with the line color intensity gradually increasing from 0 (transparent) to 100% (opaque) to avoid the trajectory being "instantly generated". In addition, if the motion trajectory includes multiple rotations (such as α from 0° to 720°), the planar trajectory will appear as a "multi-turn spiral". The number of rotations can also be marked by "line transparency differentiation" (100% transparency for the first rotation, 80% for the second rotation) to allow users to clearly identify the trajectory shape.

[0089] In this embodiment, the camera movement trajectory (3D angle sequence) of the spherical panoramic video is abstract data that users cannot directly perceive. It is mapped to a 2D plane sliding trajectory using "spherical projection rules," allowing users to see the "path shape of the camera movement" in real time during the sliding process. For example, if a user draws a "spiral trajectory," the spiral lines are simultaneously displayed on the plane, allowing for an intuitive judgment of whether the trajectory meets the creative requirements of a "spiral pitch animation." If the trajectory deviates (e.g., intending to draw two circles but only displaying 1.5 circles), the sliding operation can be adjusted immediately, avoiding "blind operation followed by preview rework," significantly reducing reliance on "3D spatial imagination," and allowing even non-professional users to easily control the direction of the panoramic camera. The entire process is based on "spherical projection rules" (such as rectangular projection) for data transformation. Whether it's adjusting "2D coordinates → 3D angles" or mapping "3D trajectory → 2D lines," it strictly adheres to the spatial model characteristics of spherical panoramas. For example, the "360° horizontal view" of the sphere is accurately mapped to the "horizontal pixel range" of the 2D preview area, avoiding "image stretching" (such as a spherical circular scene being displayed as an ellipse on a plane) or "viewpoint loss" (such as sliding to the boundary but not being able to display the complete spherical scene) caused by mismatched projection rules. The final generated sliding trajectory is completely synchronized with the spherical camera movement, ensuring that subsequent panoramic animations (such as rotation and tilt) based on the trajectory have a natural perspective and are free of distortion.

[0090] In one embodiment, such as Figure 4 As shown, the process of mapping the motion trajectory onto a planar space based on spherical projection rules to generate and display the sliding trajectory includes:

[0091] S302, determine the sliding speed indicated by the sliding operation.

[0092] S304, Based on the sliding speed, determine the trajectory pattern, which includes: trajectory thickness and / or trajectory line style.

[0093] S306, based on the spherical projection rule, the motion trajectory is mapped onto a planar space, and a sliding trajectory is generated and displayed based on the trajectory pattern.

[0094] The trajectory style typically refers to the visual morphological attribute of the sliding trajectory when displayed on a 2D plane. Its core function is to convey sliding speed information through visual feedback, while simultaneously enhancing trajectory recognition. Trajectory thickness typically refers to the width of the trajectory lines (unit: pixels), such as 1px, 3px, 5px, which usually changes dynamically with sliding speed (e.g., the faster the speed, the thinner the line; the slower the speed, the thicker the line). Trajectory line style typically refers to the texture and shape of the trajectory lines, such as solid lines, dashed lines, brush-textured gradient lines, and grainy lines. Different styles can be matched to different speed ranges (e.g., brush-textured gradient lines for slow speeds, and slightly grainy solid lines for fast speeds). User-defined default styles are also supported. The trajectory line style can vary depending on the application scenario; however, some embodiments disclosed herein do not impose restrictions on the trajectory line style.

[0095] Specifically, during editing, users often have different needs. For example, they may not want a uniform transition between two keyframes using a sliding trajectory. Therefore, the trajectory style can be adjusted according to different transition speeds when generating the sliding trajectory. After determining the sliding direction and coordinates, the sliding speed can be calculated based on the coordinates and duration. Once the sliding speed is calculated, the trajectory style can be determined accordingly. For example, if the sliding speed is less than 0.1px / ms, the trajectory thickness can be set to 4-6px, and the line style can be set to a brush gradient (the line thickness transitions from 6px to 4px from the start to the end, with a color intensity of 90%). If the sliding speed is between 0.1px / ms and 0.3px / ms, the trajectory thickness can be set to 2-4px, and the line style can be set to a solid color line (color intensity 80%, default color black, adjustable). For scrolling speeds greater than 0.3px / ms, the trajectory thickness can be set to 1-2px, and the trajectory line style can be set to a slightly grainy solid line (70% color intensity, grain density increasing with speed). It's important to understand that the above is only for illustrative purposes. After determining the trajectory style, a 3D motion trajectory (α) of the spherical panorama can be generated according to a spherical projection trajectory (e.g., a rectangular projection forward mapping). i ,β i The coordinates are converted into pixel coordinates (X'_i, Y'_i) in the 2D preview area to ensure that the planar trajectory is completely consistent with the 3D camera movement, and the planar trajectory is adjusted according to the trajectory style.

[0096] Accordingly, after selecting and generating the end frame on the timeline of the interface to be edited, the transition speed between the start frame and the end frame can be adjusted according to the speed matching the sliding trajectory. For example, the corresponding speed can be determined based on the sliding trajectory, and the speed corresponding to the sliding trajectory can be mapped to the start frame and the end frame according to the time ratio. The perspective between the start frame and the end frame can be adjusted according to the speed to generate the target video.

[0097] In this embodiment, the sliding speed is a key indicator of the user's operational intent (e.g., slow sliding may indicate fine-tuning of the viewing angle, while fast sliding may indicate switching between large-scale scenes). By binding the sliding speed to the trajectory style, users can intuitively judge whether their operation intensity meets expectations through the trajectory displayed on the screen—for example, the trajectory becomes thicker during fast sliding and thinner during slow sliding. This eliminates the need to repeatedly review the timeline, allowing for immediate confirmation of operational precision and reducing the probability of rework due to misoperations. In complex panoramic video editing (e.g., when multiple viewing trajectories need to be adjusted within the same time period), different trajectory styles (thickness / line style) help users quickly distinguish the trajectories corresponding to different operations. For example, using a "thick solid line" for a large-scale viewing trajectory during fast sliding and a "thin dashed line" for a fine-tuned viewing trajectory during slow sliding allows users to quickly locate the target trajectory through visual differences without needing to check the operation record frame by frame, improving editing efficiency.

[0098] In one embodiment, such as Figure 5 As shown, the generation and display of the sliding trajectory includes:

[0099] S402, the sliding trajectory is optimized by sequentially applying Gaussian filtering for noise reduction and Bezier curve interpolation.

[0100] Gaussian filtering noise reduction is typically a smoothing technique based on the Gaussian function. It calculates the weighted average of each point on the trajectory and its neighbors (closer points have higher weights, conforming to a Gaussian distribution), weakening or eliminating abrupt noise points in the trajectory (such as sudden coordinate shifts caused by finger tremors), making the overall trajectory smoother while preserving the main morphological features of the original trajectory. Bézier curve interpolation is a trajectory completion technique based on the mathematical model of Bézier curves. It calculates and generates smooth transition curves between key trajectory points after noise reduction, filling the gaps between adjacent points and forming a continuous, smooth curve from discrete trajectory points. By setting control points (anchor points and handle points), the curvature and direction of the Bézier curve can be precisely controlled, making it suitable for reproducing the natural arc of user sliding operations.

[0101] Specifically, the sliding trajectory can first be processed using Gaussian filtering to eliminate noise. However, adjacent points are still connected by straight lines, which may result in a "broken line" appearance (especially at low sampling frequencies). After noise reduction, Bézier curve interpolation is used again. Bézier curve interpolation fills the gaps between points by generating smooth curves, making the trajectory closer to the natural smoothness of user operation. Through these two optimization steps, noise in the original sliding trajectory is effectively eliminated, and discrete points are connected into a continuous and smooth curve. This ensures the realism of the trajectory (fitting user operation) and improves the smoothness and professionalism of subsequent panoramic video perspective changes.

[0102] S404 performs feature consistency verification between the optimized sliding trajectory and the unoptimized sliding trajectory.

[0103] S406, in response to the successful feature consistency check, the optimized sliding trajectory is generated and displayed.

[0104] S408, in response to the failure of the feature consistency check, return to step S402 and perform optimization processing again until the feature consistency check passes.

[0105] Among them, feature consistency verification usually refers to verifying the degree of matching between the "optimized trajectory" and the "original trajectory" in terms of core operational intent features through quantitative calculation and morphological comparison, ensuring that the optimization process only eliminates noise and fills gaps, without changing the user's core intent such as the "overall direction, key position, rhythm trend" of swiping.

[0106] Specifically, the optimized sliding trajectory can be compared with the unoptimized sliding trajectory to determine the rationality of the optimization process. If the feature consistency check fails, it indicates that the optimization process using Gaussian filtering for noise reduction and Bézier curve interpolation is unqualified, and the optimization process should be repeated. If the feature consistency check passes, the optimized sliding trajectory can be used as the final generated and displayed sliding trajectory.

[0107] In this embodiment, the core function of Gaussian filtering noise reduction is to filter out unintentional interference during user swiping (such as slight finger tremors, signal errors of the touch device, etc.). The unoptimized original trajectory may exhibit an irregular shape with "jagged" or "discontinuous" patterns due to this noise, while the optimized trajectory will be smoother and more coherent, meeting the user's intuitive expectation of "smooth swiping". Bezier curve interpolation can generate a continuous and smooth curve based on the key sampling points of the original trajectory (such as discrete coordinate points recorded by the touch device when the user swipes), filling the "discontinuous gaps" in the original trajectory caused by the sampling interval. For example, when the user quickly swipes the screen, the original trajectory may be a sparse "string of points", while after optimization, it becomes a complete and smooth "line", which is more visually natural. If only optimization processing is performed, "oversmoothing" or "interpolation deviation" may occur (for example, optimizing a "broken line" deliberately drawn by the user into a "curve", or stretching the "short trajectory" of the user's swipe into a "long trajectory"). The "feature consistency check" compares the core features of the trajectory before and after optimization (such as the starting / ending position, overall direction, key inflection points, trajectory length range, etc.) to ensure that the optimized trajectory does not tamper with the user's original operation logic. For example, if the user originally wanted to slide "from the top left corner of the screen to the bottom right corner", the check can prevent the optimized trajectory from becoming "from the top left corner to the middle", thus ensuring the accuracy of the operation.

[0108] In one embodiment, the feature consistency verification includes one or more of the following: direction and circle count verification, core shape verification, and smoothness verification. Specifically, direction verification focuses on the "overall motion trend" and "local turning" of the trajectory to determine whether they are consistent before and after optimization. For example, if the user's original trajectory is "sliding from the upper left corner of the screen to the lower right corner" (overall direction "lower right"), or if the trajectory contains local turnings such as "first up, then left, and finally down," the verification will compare the overall direction and local turning sequence of the optimized trajectory with the original trajectory to avoid deviations from the intended operation, such as "originally right, optimized left" or "original turning sequence reversed."

[0109] Loop Count Verification: This only applies to trajectories involving "circling actions" (such as users drawing "circles" or "spirals," or operations in trajectory passwords involving "circling around a point"). It compares the number of loops around a specified center point before and after optimization to ensure consistency. For example, if the user's original trajectory is "drawing a spiral around the screen center twice," the verification will count the number of loops in the optimized trajectory to prevent optimization from reducing "2 loops to 1 loop" or "2 loops to 3 loops," ensuring that operational logic involving "loop counts" (such as specific loop count triggering functions or loop count-related password features) is not disrupted.

[0110] Core shape verification focuses on the "signature structural features" of the sliding trajectory, comparing whether the core shape of the trajectory before and after optimization is consistent, avoiding over-optimization that could lead to the "loss of key shape information" of the user's original operation. Smoothness verification compares the "smoothness difference" of the sliding trajectory before and after optimization, ensuring that the smoothness of the optimized trajectory meets expectations and that excessive smoothing does not cause "distortion of core features".

[0111] like Figure 6 As shown, the step of verifying the feature consistency between the optimized sliding trajectory and the unoptimized sliding trajectory includes:

[0112] S502, determine the first pixel coordinate sequence of the sliding trajectory obtained after the optimization process, and determine the second pixel coordinate sequence of the sliding trajectory without optimization process.

[0113] S504, based on the first pixel coordinate sequence, determine the first direction and the first number of revolutions, and based on the second pixel coordinate sequence, determine the second direction and the second number of revolutions.

[0114] S506, perform direction and number of revolutions verification based on the first direction and the first number of revolutions, as well as the second direction and the second number of revolutions.

[0115] Here, the first pixel coordinate sequence refers to the optimized, continuous, high-density set of 2D pixel coordinates, in the format "(X1',Y1'), (X2',Y2')...(X...m ',Y m The sequence is presented in the form of "(X1,Y1), (X2,Y2)...(X...)". This sequence eliminates noise points and discrete gaps in the original trajectory, and the coordinate points are arranged continuously in temporal or spatial order. The second pixel coordinate sequence is the set of original 2D pixel coordinates directly collected by the system when the user performs a sliding operation, in the form of "(X1,Y1), (X2,Y2)...(X...)". n ,Y n Presented in the form of "(n is the number of original sampling points, T is the timestamp)".

[0116] Specifically, for the first sequence (optimized), the first direction and first number of rotations of the optimized sliding trajectory are determined based on the pixel coordinate set in the first sequence. Similarly, the second direction and second number of rotations of the optimized sliding trajectory are determined based on the pixel coordinate set in the second sequence (original). The first and second sequences are divided into multiple time periods. For the first and second directions in multiple time periods, the similarity between the first and second directions is calculated. The average of the calculated similarity scores is used to determine whether the first and second directions are the same. This is used to verify the direction and number of rotations.

[0117] S508, determine the feature calculation points at multiple identical positions in the sliding trajectory obtained after optimization and the sliding trajectory without optimization, and calculate multiple first radii of curvature of the sliding trajectory obtained after optimization and multiple second radii of curvature of the sliding trajectory without optimization based on the feature calculation points at multiple identical positions.

[0118] S510, the variance of the first radius of curvature is calculated based on the plurality of first radii of curvature, and the variance of the second radius of curvature is calculated based on the plurality of second radii of curvature.

[0119] S512, perform core shape verification using the first radius of curvature variance and the second radius of curvature variance.

[0120] The first radius of curvature is typically an index of trajectory curvature calculated using a curvature formula based on feature points of the optimized trajectory. A smaller radius of curvature indicates greater curvature at that point (e.g., a small radius of curvature at an acute inflection point); a larger radius of curvature indicates the trajectory is closer to a straight line (e.g., a large radius of curvature at a gentle curve). The second radius of curvature is typically an index of curvature calculated using the same method based on feature points of the original trajectory, serving as a benchmark for comparison with the first radius of curvature.

[0121] Specifically, the optimized trajectory and the original trajectory can be aligned first to unify them into the same coordinate system. Reference points are selected on the original trajectory at fixed intervals (e.g., every 50 pixels). Then, points on the optimized trajectory that match these reference points, such as those closest in space (usually ≤10 pixels), are used as a pair of feature calculation points. Ensure a sufficient number of feature calculation points are selected (generally no less than 10) to cover the core locations of the trajectory, such as the start point, end point, and key inflection points. For each feature calculation point, using the coordinates of its preceding and following points, the first radius of curvature of the optimized trajectory and the second radius of curvature of the original trajectory are calculated using the curvature calculation formula. Curvature calculation can be based on the principle of determining a circle by three points: a circle is constructed using the feature point and its preceding and following points; the radius of this circle is the radius of curvature at that feature point. All first radii of curvature are collected, and their variance (variance of the first radius of curvature) is calculated to reflect the overall change in the curvature of the optimized trajectory. The variance of the second radius of curvature of the original trajectory is calculated using the same method as a quantitative indicator of the original morphological features. Compare the variances of the first and second radii of curvature and calculate their ratio or difference. If the difference is within a preset threshold range (e.g., the ratio is between 0.8 and 1.2), it indicates that the curvature trend of the optimized trajectory is consistent with the original trajectory, and the core shape verification is passed; if the difference exceeds the threshold, it is determined that the core shape is inconsistent, and the optimization parameters need to be adjusted and reprocessed.

[0122] S514, perform smoothness verification based on the first radius of curvature variance.

[0123] Specifically, depending on the application scenario of the sliding trajectory, a reasonable "first radius of curvature variance threshold range" can be preset: the upper threshold is used to limit the maximum curvature fluctuation of the trajectory (to avoid obvious stuttering or inflection points after optimization), and the lower threshold is used to avoid over-smoothing (to prevent the loss of necessary slight curvature features of the trajectory after optimization, leading to shape distortion). The calculated "first radius of curvature variance" is compared with the preset threshold range: if the variance falls within the threshold range, it means that the curvature change of the optimized trajectory is smooth and there are no abnormal fluctuations, the smoothness check is passed, and the optimized trajectory meets the smoothness requirements; if the variance exceeds the threshold range (too large or too small), the smoothness check is determined to be unsuccessful, and the optimization parameters (such as the standard deviation of the Gaussian filter, the number of control points of the Bézier curve) need to be readjusted, and the original trajectory is optimized again until the smoothness meets the standard.

[0124] In this embodiment, direction and number of rotations verification can prevent deviations in key information such as direction reversal and increase / decrease in the number of rotations after optimization. Core shape verification ensures that the overall curvature trend and key shape of the trajectory are not destroyed by comparing the curvature radius variance. In addition, smoothness verification based on the first curvature radius variance verifies whether the optimization process effectively reduces trajectory fluctuations and improves smoothness, and avoids shape distortion caused by excessive smoothing by setting a preset threshold. Finally, an optimized trajectory that is both smooth and faithful is obtained.

[0125] In one embodiment, after generating and displaying the sliding trajectory, the method further includes:

[0126] If no sliding operation is detected for the display view of the panoramic video after the starting frame after a preset time period, the displayed sliding trajectory will be hidden.

[0127] Specifically, a fixed duration (e.g., 1 second, 2 seconds) can be preset as the duration threshold for the sliding trajectory. This duration can be adjusted according to user operating habits or scenario requirements (e.g., longer observation time is needed for fine-tuning operations) and is stored by default in the system parameter configuration module. When a user completes a sliding operation and generates a sliding trajectory, the system immediately starts a timer and continuously monitors the editing interface for new sliding operations. If the timer reaches the preset time period and no new sliding operation is detected during this period, the system triggers the trajectory hiding logic—by adjusting the display attributes of the sliding trajectory (e.g., setting the transparency to 0, removing the trajectory rendering layer), the displayed sliding trajectory disappears from the preview interface; if a new sliding operation is detected before the timer ends, the timer is reset and restarted to ensure that the trajectory remains displayed while the user continues to operate.

[0128] In one embodiment, after selecting and generating the end frame on the timeline of the interface to be edited, the method further includes:

[0129] In response to detecting the deletion of the end frame, the displayed sliding trajectory is deleted, and the display perspective of the panoramic video in the editing interface is adjusted to the display perspective of the start frame.

[0130] Specifically, on the timeline of the editing interface, continuous monitoring is performed for deletion operations on the end frame (such as the user right-clicking the end frame and selecting "Delete", pressing a shortcut key to delete the end frame, or clicking the delete button on the interface). When a deletion command that matches the preset rules is detected, subsequent processing logic is triggered. The sliding trajectory currently displayed on the editing interface is immediately located, and the sliding trajectory is completely removed from the interface by removing the rendering data corresponding to the trajectory and clearing the trajectory display cache, so as to avoid residual visual elements interfering with the operation. Preset reference viewpoint parameters are read (such as the initial default viewpoint of the panoramic image, the frontal viewpoint of 0° horizontal and 0° vertical, or the default viewpoint previously customized and saved by the user), and the panoramic video image in the editing interface is driven to quickly switch to the display viewpoint of the aforementioned start frame, ensuring that the image display is stable and without offset after the viewpoint is adjusted. After the sliding trajectory is deleted, the displayed viewpoint is the viewpoint set by the previous keyframe (start frame).

[0131] In this embodiment, the sliding trajectory is removed simultaneously after deleting the end frame, which avoids invalid trajectory residue on the editing interface and prevents it from overlapping with elements such as the panoramic video frame and timeline, reducing visual clutter. After deleting the end frame, the panoramic video view is automatically adjusted to the display view of the starting frame, eliminating the need for manual adjustment by the user and saving the step of repeatedly dragging the view. Especially in scenarios where the end frame is modified multiple times, this can significantly reduce operation time and improve the smoothness of the editing process.

[0132] In one embodiment, such as Figure 7 As shown, when the panoramic video to be edited is imported into the editing interface, the panoramic video to be edited is in a paused state. The method further includes:

[0133] S602, in response to the panoramic video to be edited being in playback state and detecting a sliding operation of the display view of the panoramic video after the starting frame, an end frame is selected and generated on the timeline of the interface to be edited.

[0134] In this context, "playback status" usually refers to the situation where, in the panoramic video editing interface, the user triggers the "play" command (such as clicking the play button or pressing the play shortcut key), and the panoramic video to be edited is dynamically playing in the preview area at a normal frame rate (such as 24fps or 30fps), with the image updating in real time along the timeline, rather than remaining statically at a certain frame.

[0135] Specifically, the system monitors the status of the panoramic video to be edited in real time. When playback is detected, it simultaneously starts listening for "viewpoint sliding operations" in the preview area, focusing on capturing sliding interactions after the corresponding time point of the starting frame (filtering out invalid operations before the starting frame). When a sliding operation that meets the conditions (the user adjusts the viewpoint after the starting frame during playback) is detected, the system automatically locks the current progress position on the timeline—using the "time point in video playback when the sliding operation is detected" as the time coordinate of the end frame, and simultaneously recording the panoramic viewpoint adjusted by the sliding at that moment as the viewpoint coordinate of the end frame. An end frame marker (such as a node of a special color) is generated on the timeline at the corresponding time point to intuitively indicate the end frame position to the user. At the same time, the time and viewpoint data of the end frame are stored in the project file and associated with the starting frame to prepare data for subsequent generation of viewpoint change animations.

[0136] S604, in response to the panoramic video to be edited being in a playback state at the start time and a sliding operation for the display view of the panoramic video after the start frame being detected, when the panoramic video to be edited is adjusted to a paused state, a sliding trajectory is generated and displayed in the panoramic video after the start frame according to the sliding operation.

[0137] Specifically, the system monitors whether the panoramic video to be edited is in playback mode and enables listening for sliding operations in the preview area, focusing on viewpoint adjustment operations after the starting frame. When a matching sliding operation is detected, the panoramic video will not pause playback. When the panoramic video to be edited finishes sliding and is switched from playback to pause, the viewpoint change path can be calculated based on the sliding operation data, generating and displaying the sliding trajectory to provide intuitive feedback on the user's viewpoint adjustment effect. However, since the viewpoint adjustment is performed during playback, the user may be adjusting the viewpoint aimlessly. Therefore, although the sliding trajectory is generated and displayed, it is not necessary to generate the target video based on the sliding trajectory at this point.

[0138] S606, Generate a keyframe transition video based on the start frame and the end frame, wherein the change in display perspective between the first frame and the last frame in the keyframe transition video is the shortest path between the start frame and the end frame.

[0139] Specifically, the viewpoint coordinates (e.g., horizontal and vertical angles) and time information are obtained from the start and end frames to determine the start, end, and total duration of the viewpoint change. Based on a spherical geometry algorithm, the shortest path from the start to the end viewpoint is calculated, identifying key viewpoint nodes along the path (e.g., intermediate viewpoints segmented by time intervals). Based on the viewpoint nodes on the shortest path, the corresponding viewpoint is applied to each frame of the keyframe transition video, ensuring a smooth transition of viewpoint change from the first to the last frame along the shortest path. All frame sequences with adjusted viewpoints along the shortest path are then synthesized into a complete keyframe transition video, ensuring a natural and smooth viewpoint change that conforms to the trajectory characteristics of the shortest path. The keyframe transition video can also typically be a planar video.

[0140] In this embodiment, the sliding operation of the viewing angle during video playback can prevent the user's aimless behavior of repeatedly rotating and browsing the screen during playback from being recorded as keyframe animation paths, thus ensuring the transition between the final two keyframes.

[0141] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0142] Based on the same inventive concept, this disclosure also provides a panoramic video editing apparatus for implementing the panoramic video editing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more panoramic video editing apparatus embodiments provided below can be found in the limitations of the panoramic video editing method described above, and will not be repeated here.

[0143] In one embodiment, such as Figure 8 As shown, a panoramic video editing device 700 is provided, including: a video import module 702, a start frame generation module 704, a sliding trajectory display module 706, and a video generation module 708, wherein:

[0144] The video import module 702 is used to determine the panoramic video to be edited and import the panoramic video to be edited into the editing interface.

[0145] The start frame generation module 704 is used to select and generate a start frame on the timeline of the interface to be edited.

[0146] The sliding trajectory display module 706 is configured to generate and display a sliding trajectory in the panoramic video after the starting frame in response to detecting a sliding operation of the display viewpoint of the panoramic video after the starting frame.

[0147] The video generation module 708 is used to select and generate an end frame on the timeline of the interface to be edited, and generate a target video based on the start frame and the end frame and according to the sliding trajectory. The change in display perspective between the first frame and the last frame in the target video corresponds to the sliding trajectory.

[0148] In one embodiment of the device, the panoramic video to be edited is a spherical panoramic video, and the sliding trajectory display module 706 includes:

[0149] A sliding information determination module is used to determine the sliding direction and sliding coordinates indicated by the sliding operation;

[0150] The video adjustment module is used to adjust the spherical panoramic video according to the sliding direction and sliding coordinates, and to determine the motion trajectory of the spherical panoramic video;

[0151] The trajectory generation and display module is used to map the motion trajectory onto a planar space based on spherical projection rules, and generate and display the sliding trajectory.

[0152] In one embodiment of the device, the trajectory generation and display module is further configured to determine the sliding speed indicated by the sliding operation; determine a trajectory style based on the sliding speed, the trajectory style including: trajectory thickness and / or trajectory line style; map the motion trajectory to a planar space based on spherical projection rules, and generate and display the sliding trajectory based on the trajectory style.

[0153] In one embodiment of the device, the trajectory generation and display module includes:

[0154] The optimization processing module is used to optimize the sliding trajectory by sequentially applying Gaussian filtering for noise reduction and Bezier curve interpolation.

[0155] The feature verification module is used to verify the feature consistency between the optimized sliding trajectory and the unoptimized sliding trajectory; in response to the successful feature consistency verification, the optimized sliding trajectory is generated and displayed.

[0156] In one embodiment of the device, the feature consistency verification includes one or more of the following: direction and rotation number verification, core shape verification, and smoothness verification; the feature verification module is further configured to determine a first pixel coordinate sequence of the sliding trajectory obtained after optimization processing, and a second pixel coordinate sequence of the sliding trajectory after unoptimized processing; determine a first direction and a first rotation number based on the first pixel coordinate sequence, and determine a second direction and a second rotation number based on the second pixel coordinate sequence; perform direction and rotation number verification based on the first direction and the first rotation number, and the second direction and the second rotation number; determine feature calculation points at multiple identical positions in the sliding trajectory obtained after optimization processing and the sliding trajectory after unoptimized processing, and calculate multiple first radii of curvature of the sliding trajectory obtained after optimization processing and multiple second radii of curvature of the sliding trajectory after unoptimized processing based on the multiple feature calculation points at the multiple identical positions; calculate a first radius of curvature variance based on the multiple first radii of curvature, and calculate a second radius of curvature variance based on the multiple second radii of curvature; perform core shape verification using the first radius of curvature variance and the second radius of curvature variance; and perform smoothness verification based on the first radius of curvature variance.

[0157] In one embodiment of the device, the device further includes a trajectory hiding module, configured to hide the displayed sliding trajectory in response to the absence of a sliding operation on the display viewpoint of the panoramic video after the starting frame after a preset time period.

[0158] In one embodiment of the device, the device further includes: a perspective adjustment module, configured to delete the displayed sliding trajectory in response to detecting the deletion of the end frame, and adjust the display perspective of the panoramic video in the editing interface to the display perspective of the start frame.

[0159] In one embodiment of the device, the device further includes:

[0160] A keyframe transition video generation module is configured to: select and generate an end frame on the timeline of the interface to be edited in response to the panoramic video to be edited being in playback mode and a sliding operation of the display perspective of the panoramic video after the start frame being detected; when the panoramic video to be edited is in playback mode at the start time and a sliding operation of the display perspective of the panoramic video after the start frame is detected, and the panoramic video to be edited is adjusted to a paused state, generate and display a sliding trajectory in the panoramic video after the start frame according to the sliding operation; generate a keyframe transition video based on the start frame and the end frame, wherein the change of display perspective between the first frame and the last frame in the keyframe transition video is the shortest path between the start frame and the end frame.

[0161] Each module in the aforementioned panoramic video editing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0162] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a panoramic video editing method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0163] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present disclosure and does not constitute a limitation on the computer device to which the present disclosure is applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0164] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0165] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0166] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0167] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this disclosure can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this disclosure may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this disclosure may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0168] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0169] The embodiments described above are merely illustrative of several implementations of this disclosure, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent disclosure. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this disclosure, and these all fall within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the appended claims.

Claims

1. A panoramic video editing method, characterized in that, The method includes: Select the panoramic video to be edited and import it into the editing interface; Select and generate a start frame on the timeline of the interface to be edited; In response to detecting a sliding operation for the display viewpoint of the panoramic video after the starting frame, a sliding trajectory is generated and displayed in the panoramic video after the starting frame according to the sliding operation; Select and generate an end frame on the timeline of the interface to be edited. Based on the start frame and the end frame, generate a target video according to the sliding trajectory. The change in display perspective between the first frame and the last frame in the target video corresponds to the sliding trajectory.

2. The method according to claim 1, characterized in that, The panoramic video to be edited is a spherical panoramic video. The step of generating and displaying a sliding trajectory in the panoramic video after the starting frame based on the sliding operation includes: Determine the sliding direction and sliding coordinates indicated by the sliding operation; Based on the sliding direction and sliding coordinates, adjust the spherical panoramic video to determine the motion trajectory of the spherical panoramic video; Based on the spherical projection rule, the motion trajectory is mapped onto a planar space to generate and display the sliding trajectory.

3. The method according to claim 2, characterized in that, The process of mapping the motion trajectory onto a planar space based on spherical projection rules to generate and display the sliding trajectory includes: Determine the sliding speed indicated by the sliding operation; Based on the sliding speed, a trajectory pattern is determined, the trajectory pattern including: trajectory thickness and / or trajectory line style; Based on the spherical projection rules, the motion trajectory is mapped onto a planar space, and a sliding trajectory is generated and displayed based on the trajectory pattern.

4. The method according to claim 1 or 2, characterized in that, The generation and display of the sliding trajectory includes: The sliding trajectory is optimized by sequentially applying Gaussian filtering for noise reduction and Bezier curve interpolation. The feature consistency verification is performed between the optimized sliding trajectory and the unoptimized sliding trajectory. In response to the successful verification of the feature consistency, the optimized sliding trajectory is generated and displayed.

5. The method according to claim 4, characterized in that, The feature consistency verification includes one or more of the following: direction and number of rotations verification, core shape verification, and smoothness verification; the feature consistency verification between the optimized sliding trajectory and the unoptimized sliding trajectory includes: Determine the first pixel coordinate sequence of the sliding trajectory obtained after the optimization process, and determine the second pixel coordinate sequence of the sliding trajectory without optimization process; Based on the first pixel coordinate sequence, a first direction and a first number of revolutions are determined; based on the second pixel coordinate sequence, a second direction and a second number of revolutions are determined. Perform direction and number of revolutions verification based on the first direction and the first number of revolutions, as well as the second direction and the second number of revolutions; Determine feature calculation points at multiple identical positions in the sliding trajectory obtained after optimization and the sliding trajectory without optimization. Based on the feature calculation points at multiple identical positions, calculate multiple first radii of curvature of the sliding trajectory obtained after optimization and multiple second radii of curvature of the sliding trajectory without optimization. The variance of the first radius of curvature is calculated based on the plurality of first radii of curvature, and the variance of the second radius of curvature is calculated based on the plurality of second radii of curvature. Core morphology verification is performed using the first radius of curvature variance and the second radius of curvature variance; Smoothness verification is performed based on the first radius of curvature variance.

6. The method according to any one of claims 1 to 3, characterized in that, After generating and displaying the sliding trajectory, the method further includes: If no sliding operation is detected for the display view of the panoramic video after the starting frame after a preset time period, the displayed sliding trajectory will be hidden.

7. The method according to claim 1, characterized in that, After selecting and generating the end frame on the timeline of the interface to be edited, the method further includes: In response to detecting the deletion of the end frame, the displayed sliding trajectory is deleted, and the display perspective of the panoramic video in the editing interface is adjusted to the display perspective of the start frame.

8. The method according to any one of claims 1 to 3, characterized in that, When importing the panoramic video to be edited into the editing interface, the panoramic video to be edited is in a paused state. The method further includes: In response to the panoramic video to be edited being in playback state, and a sliding operation of the display view of the panoramic video after the starting frame being detected, an end frame is selected and generated on the timeline of the interface to be edited. In response to the panoramic video to be edited being in a playback state at the start time, and after detecting a sliding operation of the display view of the panoramic video after the start frame, when the panoramic video to be edited is adjusted to a paused state, a sliding trajectory is generated and displayed in the panoramic video after the start frame according to the sliding operation. A keyframe transition video is generated based on the start frame and the end frame, and the change in display perspective between the first frame and the last frame in the keyframe transition video is the shortest path between the start frame and the end frame.

9. A panoramic video editing device, characterized in that, The device includes: The video import module is used to identify the panoramic video to be edited and import the panoramic video to be edited into the editing interface. The start frame generation module is used to select and generate a start frame on the timeline of the interface to be edited. A sliding trajectory display module is used to generate and display a sliding trajectory in the panoramic video after the starting frame in response to detecting a sliding operation of the display viewpoint of the panoramic video after the starting frame. The video generation module is used to select and generate an end frame on the timeline of the interface to be edited, and generate a target video based on the start frame and the end frame and according to the sliding trajectory. The change in display perspective between the first frame and the last frame in the target video corresponds to the sliding trajectory.

10. 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, it implements the steps of the method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Method and device for intelligently repairing oral error in video, storage medium and program product

    CN121908089A