Animation generation method, device and system for sports tactical demonstration
By obtaining the multi-objective moving trajectory specified by the user, keyframe capture and data synchronization, the problem of low freedom of trajectory paths in the existing technology is solved, and more complex and smooth tactical demonstration animation generation is achieved.
Patent Information
- Application Number
- CN202411798146.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-09
AI Technical Summary
In the generation of sports tactical demonstration animations, the trajectory path freedom is low, and it is impossible to effectively support complex tactical demonstration animation generation, resulting in low sense of realism and smoothness of the movement.
By obtaining the multi-objective movement trajectory specified by the user, keyframe capture is used using preset pixel intervals, data synchronization is used to synchronize the keyframe coordinates, update the pixel position, and animation rendering is performed to generate motion tactics demonstration animation.
It improves the freedom of the trajectory path, supports more complex tactical demonstration needs, enhances the smoothness and realism of the trajectory, and improves the display effect of tactical teaching.
Smart Images

Figure CN119784901A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of sports technology and digital demonstration, and in particular to an animation generation method, device, animation generation system, electronic equipment and computer storage medium for sports tactical demonstration. Background Art
[0002] In sports teaching and tactical training, traditional tactical presentation methods usually rely on paper icons, whiteboard drawings, gesture demonstrations, and game replays. Especially in football tactical presentations, coaches usually draw the static positions of players and balls on the tactical board, and manually draw the players' movement routes to show tactical intentions and help players understand the process of tactical execution. However, this traditional method cannot dynamically display the real-time movement trajectory of players and balls, making it difficult to accurately understand tactical ideas and action details. At the same time, it is also impossible to adjust tactics in real time according to actual scenarios and needs, resulting in low efficiency of tactical presentations.
[0003] Based on this, the existing technology designs a graphical teaching tactical board, allowing the coach to set the starting and ending positions of the player or the ball in the graphical interface and generate a corresponding straight line path. By opening the Bezier curve control points in the path, the coach can fine-tune the route. When the coach completes the trajectory setting, the system will generate a movement animation of the player or the ball according to the set path, thereby dynamically adjusting the tactical function according to the actual scenario and needs.
[0004] However, due to improper setting of the key frame correspondence between animation generation and path, it is easy to cause the animation generation to not conform to the laws of physics, or to appear stuck, incoherent, etc., thus affecting the realism and smoothness of the motion in the demonstration animation. Therefore, in order to ensure the realism of the motion in the demonstration animation, the prior art usually only provides a small number of Bezier curve points for users to adjust the path. Accordingly, the prior art has the problem of low freedom of trajectory path when generating sports tactical demonstration animation, and cannot effectively support the generation of complex tactical demonstration animation. Summary of the invention
[0005] Based on this, the purpose of the present invention is to provide an animation generation method for sports tactics demonstration.
[0006] A method for generating an animation for sports tactical demonstrations comprises the following steps:
[0007] S1: Obtain the movement trajectories of several targets specified by the user;
[0008] S2: According to a preset pixel interval, key frame capture is performed on the moving trajectories of a plurality of targets to obtain key frame coordinates of a plurality of targets;
[0009] S3: using a synchronization mechanism to synchronize data of a plurality of target key frame coordinates, and obtaining synchronized coordinates of a plurality of target key frames;
[0010] S4: updating pixel positions according to the synchronized coordinates of several target key frames to obtain several groups of target pixel coordinates;
[0011] S5: Perform animation rendering according to the pixel coordinate groups of the plurality of targets to obtain a motion tactical demonstration animation.
[0012] Compared with the prior art, the animation generation method for sports tactical demonstration described in the present invention realizes animation generation of multi-target moving trajectories specified by the user by synchronizing the data of the target key frame coordinates after key frame capture, thereby improving the freedom of the trajectory path and effectively supporting the user's needs for more complex tactical demonstrations.
[0013] Furthermore, the acquisition of the moving trajectory of the target is expressed as follows:
[0014]
[0015] Where P is the path trajectory of the target; {P start ,P end} represents the coordinates of the starting point and end point of the straight line trajectory; {(x i ,u j )|i∈[1,n]} represents the set of trajectory coordinates generated when the user drags or moves the target;
[0016] Wherein, Point represents the number of user-specified coordinates obtained. When Point=2, it means that the path of the current target is a straight line; when Point>2, it means that the path of the current target is a non-straight line.
[0017] The specific calculation of the key frame capture is as follows:
[0018]
[0019] Where P frame is the key frame coordinate corresponding to the current target; P k represents the kth key frame coordinate in the straight line trajectory; (x k ,y k ) represents the kth key frame coordinate of the non-linear trajectory; (x last ,y last ) is the latest key frame coordinate traversed; d is the preset pixel interval; n represents the total number of key frame coordinates of the current target.
[0020] Accordingly, the present invention generates diversified paths through the number of coordinates specified by the user, thereby significantly improving the freedom of the motion trajectory, allowing the user to design a more complex trajectory path that better meets tactical requirements according to actual needs. At the same time, the present invention uses a uniform preset pixel interval for key frame capture to ensure that the speed transition during the target movement is smooth and natural, thereby improving the fluency of the subsequent generation of demonstration animation.
[0021] Furthermore, the data synchronization is specifically expressed as follows:
[0022] SyncFrame target
[0023] = {P ease-in}∪{P i |i∈[k ease +1,N target -k ease -1]}∪{P ease-out}∪{P sync}
[0024] Where, SyncFrame target N is the coordinate of the target key frame for synchronization; max is the maximum number of key frames among the target key frame coordinates; N target is the number of key frames corresponding to the current target; k ease The number of target key frame coordinates corresponding to the easing area of the current target; P ease-in The starting point of the current target is the easing key frame set; ease-ont The endpoint easing keyframe set of the current target; sync A collection of key frames for synchronization completion.
[0025] The present invention uses the target with the largest trajectory as a benchmark to ensure that the motion paths of other targets are synchronized with the target with the longest path, thereby eliminating the timing misalignment problem caused by the inconsistent number of key frames. In addition, the present invention introduces easing key frames at the starting and ending points of other targets to control the acceleration and deceleration of the targets at the beginning and end of the movement, making the target movement more natural and smooth. Accordingly, the present invention effectively ensures the coordination of multi-target animations through a synchronization mechanism, and significantly improves the quality and fluency of tactical demonstration animations.
[0026] Furthermore, the number of target key frame coordinates k corresponding to the easing area ease The specific calculation is as follows:
[0027]
[0028] In the formula, w min is the minimum weight coefficient of the easing area;
[0029] The starting point easing key frame set P of the current target ease-in The specific calculation is as follows:
[0030]
[0031] Where P i,k Indicates the current target key frame coordinate to the previous target key frame coordinate P i-1 A collection of easing interpolation keyframes between ; is the coordinates of the previous target key frame P i-1 The direction vector pointing to the current target keyframe coordinates; is the easing interpolation interval of the ease-in, and the specific calculation is as follows:
[0032]
[0033] Where, d min is the initial minimum pixel interval of the ease-in area, and the specific calculation is expressed as:
[0034]
[0035] d is the preset pixel interval; The total number of eased interpolation keyframes that are eased in from the previous target keyframe coordinates to the current target keyframe coordinates. The specific calculation is expressed as:
[0036]
[0037] In the formula, is the weight coefficient of ease-in, and the specific calculation is as follows:
[0038]
[0039] W is the sum of the weight coefficients; M is the total number of easing interpolation key frames, and the specific calculation is as follows:
[0040]
[0041] In the formula, is a constraint;
[0042] The endpoint easing key frame set P of the current target ease-out The specific calculation is as follows:
[0043]
[0044] In the formula, is the easing interpolation interval of the slow-out, which is used to gradually reduce the interval, thereby representing the change of the current target's motion speed from uniform to slow. The specific calculation is as follows:
[0045]
[0046] In the formula, The total number of eased interpolation key frames from the previous target key frame coordinates to the current target key frame coordinates. The specific calculation is expressed as:
[0047]
[0048] In the formula, is the weight coefficient of the slow-out, and the specific calculation is as follows:
[0049]
[0050] The synchronously completed key frame set P sync The specific calculation is as follows:
[0051]
[0052] Where N sync The total number of keyframes to complete for synchronization.
[0053] The present invention adjusts w min The weight coefficient is used to ensure that the length of the easing area of the current target and the number of key frames of the current target do not exceed the number of target key frames of the maximum path. i,k The speed of the current target can be adjusted to ensure the smooth transition and authenticity of the target during movement, which significantly improves the fluency and realism of the generated animation, avoids abrupt changes in the target during movement, and improves the visual performance of the overall animation effect.
[0054] An animation generation device for sports tactics demonstration, characterized in that it includes a target path trajectory acquisition unit, a key frame capture unit, a data synchronization unit, a pixel coordinate update unit and an animation rendering unit;
[0055] The target path trajectory acquisition unit is used to acquire the movement trajectories of several targets specified by the user;
[0056] The key frame capturing unit is used to perform key frame capturing on the moving trajectories of a plurality of targets according to a preset pixel interval to obtain key frame coordinates of a plurality of targets;
[0057] The data synchronization unit is used to synchronize the data of a plurality of target key frame coordinates by using a synchronization mechanism to obtain synchronized coordinates of a plurality of target key frames;
[0058] The pixel coordinate updating unit is used to update the pixel position according to the synchronized coordinates of several target key frames to obtain several groups of target pixel coordinates;
[0059] The animation rendering unit is used to perform animation rendering according to pixel coordinate groups of a plurality of targets to obtain a sports tactical demonstration animation.
[0060] Furthermore, the acquisition of the moving trajectory of the target is expressed as follows:
[0061]
[0062] Where P is the path trajectory of the target; {P start ,P end} represents the coordinates of the starting point and end point of the straight line trajectory; {(x i ,y j )|i∈[1,n]} represents the set of trajectory coordinates generated when the user drags or moves the target;
[0063] Wherein, Point represents the number of user-specified coordinates obtained. When Point=2, it means that the path of the current target is a straight line; when Point>2, it means that the path of the current target is a non-straight line.
[0064] The specific calculation of the key frame capture is as follows:
[0065]
[0066] Where P frame is the key frame coordinate corresponding to the current target; P k represents the kth key frame coordinate in the straight line trajectory; (x k ,y k ) represents the kth key frame coordinate of the non-linear trajectory; (x last ,y last ) is the latest key frame coordinate traversed; d is the preset pixel interval; n represents the total number of key frame coordinates of the current target.
[0067] Furthermore, the data synchronization is specifically expressed as follows:
[0068] SyncFrame target
[0069] = {P ease-in}∪{P i |i∈[k ease +1,N target -k ease -1]}∪{P ease-out}∪{P sync}
[0070] Where, SyncFrame target N is the coordinate of the target key frame for synchronization; max is the maximum number of key frames among the target key frame coordinates; N target is the number of key frames corresponding to the current target; k ease The number of target keyframe coordinates corresponding to the easing area of the current target. The specific calculation is as follows:
[0071]
[0072] In the formula, w min is the minimum weight coefficient of the easing area;
[0073] P ease-in It is the starting point easing key frame set of the current target. The specific calculation is as follows:
[0074]
[0075] Where P i,k Indicates the current target key frame coordinate to the previous target key frame coordinate P i-1 A collection of easing interpolation keyframes between ; is the coordinates of the previous target key frame P i-1 The direction vector pointing to the current target keyframe coordinates; is the easing interpolation interval of the ease-in, and the specific calculation is as follows:
[0076]
[0077] Where, d min is the initial minimum pixel interval of the ease-in area, and the specific calculation is expressed as:
[0078]
[0079] d is the preset pixel interval; The total number of eased interpolation keyframes that are eased in from the previous target keyframe coordinates to the current target keyframe coordinates. The specific calculation is expressed as:
[0080]
[0081] In the formula, is the weight coefficient of ease-in, and the specific calculation is as follows:
[0082]
[0083] W is the sum of the weight coefficients; M is the total number of easing interpolation key frames, and the specific calculation is as follows:
[0084]
[0085] In the formula, is a constraint;
[0086] P ease-out It is the set of easing key frames at the end point of the current target. The specific calculation is as follows:
[0087]
[0088] In the formula, is the easing interpolation interval of the slow-out, which is used to gradually reduce the interval, thereby representing the change of the current target's motion speed from uniform to slow. The specific calculation is as follows:
[0089]
[0090] In the formula, The total number of eased interpolation key frames from the previous target key frame coordinates to the current target key frame coordinates. The specific calculation is expressed as:
[0091]
[0092] In the formula, is the weight coefficient of the slow-out, and the specific calculation is as follows:
[0093]
[0094] P sync For a set of key frames that are synchronized and completed, the specific calculation is as follows:
[0095]
[0096] Where N sync The total number of keyframes to complete for synchronization.
[0097] An animation generation system for sports tactical demonstrations, comprising a client, an animation generation device and a server;
[0098] The client is used to display a plurality of targets and provide an interactive interface, so that the user can operate the targets through the interactive interface, generate movement trajectories of the plurality of targets specified by the user, and send the movement trajectories to the animation generation device; the client also includes a display animation for the user to watch;
[0099] The animation generation device is used to receive the movement trajectories of several targets specified by the user, and sequentially perform key frame capture, data synchronization, pixel position update and animation rendering to obtain the sports tactical demonstration animation and transmit it to the server;
[0100] The server is used to store and manage the sports tactics demonstration animation, and transmit the sports tactics demonstration animation to the client for playback according to the playback request of the client;
[0101] Wherein, the animation generating device is the animation generating device for sports tactics demonstration mentioned above.
[0102] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0103] Figure 1 It is a simplified structural schematic diagram of the animation generation device for sports tactics demonstration according to the present invention;
[0104] Figure 2 A simplified flow chart of the method for generating an animation for sports tactics demonstration according to the present invention;
[0105] Figure 3 This is a schematic diagram of a simplified example of the easing interpolation described in the present invention. DETAILED DESCRIPTION
[0106] In order to solve the problem that the existing technology has low freedom of trajectory path when generating sports tactical demonstration animation, and cannot effectively support the generation of complex tactical demonstration animation, the present invention obtains the path trajectory of several targets specified by the user, and according to a preset pixel interval, the path trajectory of several targets is keyframe captured, and several target keyframe coordinates are obtained, and a synchronization mechanism is used to synchronize the data of several target keyframe coordinates to obtain synchronized several target keyframe coordinates; according to the synchronized several target keyframe coordinates, the pixel position is continued to be updated to obtain several groups of target pixel coordinates, and animation rendering is performed to obtain sports tactical demonstration animation. Accordingly, the present invention improves the freedom of trajectory path by refining keyframes and capturing according to the user's trajectory to support different trajectory paths. At the same time, through the data synchronization mechanism, the fluency and realism of the target movement are improved, thereby effectively improving the display effect of tactical teaching.
[0107] Based on the above design, the present invention proposes a method for generating an animation of a sports tactical demonstration, and based on the method, proposes a device for generating an animation of a sports tactical demonstration.
[0108] Please also see Figure 1 and Figure 2 , Figure 1 This is a simplified structural diagram of the animation generation device for sports tactics demonstration according to the present invention. Figure 2 The present invention is a simplified flowchart of the method for generating animations for sports tactics demonstrations.
[0109] The animation generation device for sports tactics demonstration comprises a target path trajectory acquisition unit 1, a key frame capture unit 2, a data synchronization unit 3, a pixel coordinate update unit 4 and an animation rendering unit 5.
[0110] The target path trajectory acquisition unit 1 is used to execute step S1: acquiring the moving trajectories of several targets specified by the user.
[0111] Specifically, the acquisition of the moving trajectory of the target is expressed as follows:
[0112]
[0113] Where P is the path trajectory of the target, which is represented by a set of coordinate points corresponding to the player, ball or prop object, and is used to describe the moving trajectory of the target specified by the user; {P start ,P end} represents the coordinates of the starting point and the end point of the straight line trajectory. It is used when the path of the target specified by the user only contains the two coordinates of the starting point and the end point; {(x i ,y j )|i∈[1,n]} represents the set of trajectory coordinates generated when the user drags or moves the target, where (x1, y1) and (x n ,y n ) correspond to the starting point and the end point of the trajectory respectively;
[0114] Wherein, Point represents the number of user-specified coordinates obtained. If the user only specifies one coordinate, it is considered that the user uses his target (objects such as players, balls or props) as a fixed position and does not involve any motion trajectory. Therefore, no further keyframe capture, synchronization or position update is required; and the target can be selected as a map or dynamic image according to user needs, and the present invention does not specifically limit the selection of its target.
[0115] Based on this, users can choose simple straight-line trajectories or complex drag trajectories according to different needs to meet the tactical demonstration requirements of different scenarios.
[0116] The key frame capturing unit 2 is used to execute step S2: performing key frame capturing on the moving trajectories of a plurality of targets according to a preset pixel interval to obtain key frame coordinates of a plurality of targets.
[0117] Specifically, the specific calculation of the key frame capture is expressed as follows:
[0118]
[0119] Where P frameis the key frame coordinate corresponding to the current target, indicating the relative position coordinate of the target in the current time frame, which is used for subsequent animation generation to ensure that the position of the target in each frame is correctly updated to ensure the smoothness and accuracy of the motion trajectory; P k represents the kth key frame coordinate in the straight line trajectory; (x k ,y k ) represents the kth key frame coordinate of the non-linear trajectory, which is determined by comparing the kth coordinate of the current trajectory with the latest key frame coordinate (x last ,y last ) is greater than or equal to the preset pixel interval d, the initial value of last is 1, that is, the starting point coordinate of the trajectory; d is the preset pixel interval, which is used to control the density of key frame sampling and is dynamically set according to the user's specific hardware configuration; n represents the total number of key frame coordinates of the current target, which is calculated by the path length of the trajectory and the preset pixel interval d.
[0120] When Point = 2, it means that the path of the current target is a straight line, then the key frame coordinates P are uniformly inserted according to the preset pixel interval d at the starting point and the end point. k ;
[0121] When Point>2, it means that the path of the current target is not a straight line, then the trajectory coordinates (x k ,y k ) and the latest or most recent keyframe coordinates (x last ,y last ) is greater than or equal to d: If so, record the trajectory coordinates of the current target as the new key frame coordinates (x last ,y last ); if not, continue to determine the next trajectory coordinate (x k+1 ,y k+q ).
[0122] Accordingly, the present invention performs keyframe capture of the target at a fixed pixel interval to ensure that the obtained keyframe coordinates can smoothly display the target's motion trajectory and reduce the phenomenon of stuttering or incoherence caused by too few or too many keyframes, thereby improving the smoothness and continuity of the target's motion trajectory, and further better supporting diverse motion paths and complex tactical scenarios.
[0123] The data synchronization unit 3 is used to execute step S3: using a synchronization mechanism to perform data synchronization on a plurality of target key frame coordinates to obtain a plurality of synchronized target key frame coordinates.
[0124] Specifically, the synchronization mechanism target key frame coordinates are specifically expressed as follows for data synchronization:
[0125] SyncFrametarget = {P i |i∈[1,N target ]}∪{P sync}
[0126] Where, SyncFrame target is the set of target keyframe coordinates for synchronization; i is the set of key frame coordinates corresponding to the current target P frame The i-th target key frame coordinates in P sync It is a set of synchronously completed key frames used to indicate that the target stops moving. The specific calculation is as follows:
[0127]
[0128] Where N sync is the total number of key frames to be completed synchronously, and the specific calculation is expressed as: N sync =N max -N target ; Among them, N max is the maximum number of key frames among several target key frame coordinates; N target The number of key frames corresponding to the current target.
[0129] In another embodiment, the synchronization mechanism target key frame coordinates are specifically expressed as follows for data synchronization:
[0130] Get the maximum number of key frames among several target key frame coordinates as the benchmark data volume N max ;
[0131] Get the number of key frames N corresponding to the current target target ;
[0132] Synchronize the data of the current target key frame coordinates to obtain the synchronized target key frame coordinates SyncFrame target , and its specific calculation is expressed as follows:
[0133] SyncFrame target
[0134] = {P ease-in}∪{P i "i∈[k ease +1,N target -k ease -1]}∪{P ease-out}∪{P sync}
[0135] Where P i is the set of key frame coordinates corresponding to the current target P frameThe i-th target key frame coordinates in P ease-in It is the starting point easing keyframe set of the current target, which is used to represent the motion trajectory of the current target for easing in. The specific calculation is as follows:
[0136]
[0137] Where P i,k Indicates the current target key frame coordinate to the previous target key frame coordinate P i-1 The set of easing interpolation key frames between P i,0 =P i-1 , is the coordinates of the previous target key frame P i-1 Point to the current target keyframe coordinate P i The direction vector is used to calculate the direction of the easing interpolation keyframe. The specific calculation is as follows:
[0138]
[0139] Said It is the easing interpolation interval of the ease-in, which is used to gradually increase the interval, thereby representing the change of the current target's movement speed from slow to uniform. For specific effects, please refer to Figure 3 , Figure 3 This is a simplified example schematic diagram of the easing interpolation described in the present invention, and the specific calculation is expressed as follows:
[0140]
[0141] Where, d min is the initial minimum pixel interval of the ease-in area, used to represent the slowest starting speed. The specific calculation is expressed as d is the preset pixel interval, used to indicate normal speed; The total number of eased interpolation keyframes for easing from the previous target keyframe coordinates to the current target keyframe coordinates. This is used to dynamically control the interpolation density of each easing interval to ensure that the motion transitions from slow to even. The specific calculation is expressed as:
[0142]
[0143] In the formula, is the weight coefficient of the ease-in, which gradually decreases according to the progress of the easing and is used to control the density of the interpolation of each ease-in interval. The specific calculation is as follows:
[0144]
[0145] W is the sum of the weight coefficients, and the specific calculation is expressed as: M is the total number of easing interpolation key frames, which is used to limit the maximum number of interpolations in the easing area to avoid exceeding the maximum number of frames. The specific calculation is as follows:
[0146]
[0147] In the formula, It is a constraint item to ensure 2M+N target <N max , to avoid exceeding the maximum number of keyframes;
[0148] k ease Indicates the number of target keyframe coordinates corresponding to the easing area of the current target, which is used to determine the interpolation density and size of the target in the easing area. The specific calculation is as follows:
[0149]
[0150] In the formula, w min The minimum weight coefficient of the easing area, which defaults to 10%, is used to ensure that the easing area occupies at least w of the target keyframe coordinates. min Proportion.
[0151] P ease-out It represents the end point easing keyframe set of the current target, which is used to represent the motion trajectory of the current target for easing out. The specific calculation is as follows:
[0152]
[0153] In the formula, is the easing interpolation interval of the slow-out, which is used to gradually reduce the interval, thereby representing the change of the current target's motion speed from uniform to slow. The specific calculation is as follows:
[0154]
[0155] In the formula, The total number of eased interpolation key frames from the previous target key frame coordinates to the current target key frame coordinates. The specific calculation is expressed as:
[0156]
[0157] In the formula, is the weight coefficient of the ease-out, which gradually increases according to the progress of the easing and is used to control the density of the interpolation of each ease-out interval. The specific calculation is as follows:
[0158]
[0159] P syncIt is a set of synchronously completed key frames used to indicate that the target stops moving. The specific calculation is as follows:
[0160]
[0161] Where N sync is the total number of key frames to be completed synchronously, and the specific calculation is expressed as: N sync =N max -N target -2×M.
[0162] Accordingly, the present invention uses the maximum number of key frames as the standardized core benchmark data volume to ensure that the key frames of all targets are calculated uniformly in a multi-target scenario, so that each target can follow the same standard when synchronized, to ensure that the key frame coordinates of all targets are aligned on the time axis, so that each target has position data in the same time frame, thereby avoiding the synchronization inconsistency problem caused by the difference in the number of target key frame coordinates.
[0163] At the same time, the present invention introduces a key frame density adjustment mechanism of the easing interpolation algorithm, dynamically calculates the number of interpolations in the easing area, and combines the gradually increasing acceleration and gradually decreasing deceleration process to accurately simulate the target's slow-in and slow-out motion states, so as to ensure that the target's transition in a complex motion trajectory is natural and smooth, avoiding the common phenomenon of sudden or uneven motion speed, thereby effectively improving the authenticity and continuity of the target's motion and keeping the target in a natural and realistic motion trajectory, thereby improving the animation realism and visual fluency in complex tactical demonstrations and multi-target animations.
[0164] The pixel coordinate updating unit 4 is used to execute step S4: updating the pixel position according to the synchronized coordinates of several target key frames to obtain pixel coordinate groups of several targets.
[0165] Specifically, the synchronized key frame coordinates of several targets are mapped onto a designated canvas according to a preset time frame to obtain pixel coordinate groups of several targets.
[0166] The drawing board is the background of the video display, which is a top view of the sports venue or other related background images by default, and serves as a coordinate reference system when the target is rendered.
[0167] Since the reference system of the key frame coordinates is usually inconsistent with the reference system of the canvas coordinates, the key frame coordinates are usually obtained based on the user's screen as the reference system. Therefore, it is necessary to dynamically map the key frame coordinates to the canvas coordinates through the time frame mapping and coordinate conversion mechanism to ensure that the position of the target in each time frame can be correctly updated and the motion trajectory can be accurately presented to ensure the alignment of the target with the scene.
[0168] Since coordinate mapping is a conventional technical means of graphics rendering technology, and specific calculation parameters, such as canvas size, vary according to different requirements, the present invention does not specifically limit the implementation method of coordinate mapping.
[0169] The animation rendering unit 5 is used to execute step S5: performing animation rendering according to pixel coordinate groups of a plurality of targets to obtain a sports tactical demonstration animation.
[0170] Specifically, the geometric centers of several targets are matched with corresponding pixel coordinate groups to obtain rendering coordinates, and all targets are rendered onto the canvas frame by frame according to the rendering coordinates to obtain a demonstration animation of the motion tactics.
[0171] The geometric center of the target represents the position reference of the target, and is the center point of the target image and dynamic image by default.
[0172] The frame-by-frame rendering means that in each frame, the image or dynamic image of the target will be drawn to the specified position of the canvas according to the corresponding pixel coordinates (i.e. the position of the target in the current frame) to ensure that the position and trajectory of the target are consistent during the movement, forming a smooth and continuous movement effect.
[0173] Compared with the prior art, the present invention introduces a multi-target path synchronization and slow motion interpolation mechanism, which further enhances the coordination between targets on the basis of ensuring the freedom of the multi-target motion trajectory, so that the motion trajectories of multiple targets can be smoothly connected in complex tactical scenes. Especially when multiple targets are involved and the lengths of the motion trajectories vary greatly, it can ensure that the movement of each target conforms to the predetermined rhythm, enhancing the naturalness and authenticity of the animation.
[0174] In addition, the present invention adopts a preset pixel interval combined with a dynamic easing interpolation mechanism, and performs easing interpolation calculations in the easing area of the shorter path target, thereby achieving a smooth connection between the shorter path target at the starting point and the end point, avoiding abrupt motion changes, and thus improving the fluency of the animation. Accordingly, the present invention ensures the performance of the animation in terms of visual effects and realism through the combination of user-specified target trajectories, key frame capture and synchronization mechanisms, thereby meeting the needs of high-precision and highly interactive tactical demonstrations.
[0175] Based on the same inventive concept, the present application also provides an electronic device, which may be a terminal device such as a server, a desktop computing device or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). The device includes one or more processors and a memory, wherein the processor is used to execute a program to implement the animation generation method for sports tactical demonstration of an embodiment of the present invention; and the memory is used to store a computer program executable by the processor.
[0176] Based on the same inventive concept, the present application also provides a computer-readable storage medium, corresponding to the embodiment of the aforementioned method for generating an animation of a sports tactical demonstration, wherein the computer-readable storage medium stores a computer program thereon, and when the program is executed by a processor, the steps of the method for generating an animation of a sports tactical demonstration recorded in any of the aforementioned embodiments are implemented.
[0177] The present application may take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-usable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0178] The above-mentioned embodiments only express several implementation methods of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, and the present invention is also intended to include these modifications and modifications.
Claims
1. A method for generating an animation for sports tactical demonstration, characterized in that: The following steps are involved: S1. Obtain the moving trajectories of several targets specified by the user; S2. According to a preset pixel interval, key frame capture is performed on the moving trajectories of a plurality of targets to obtain key frame coordinates of a plurality of targets; S3, using a synchronization mechanism to synchronize the data of several target key frame coordinates to obtain several synchronized target key frame coordinates; S4, updating pixel positions according to the synchronized coordinates of several target key frames to obtain several groups of target pixel coordinates; S5. Perform animation rendering according to the pixel coordinate groups of the multiple targets to obtain a motion tactical demonstration animation.
2. The method for generating an animation of a sports tactical demonstration according to claim 1, characterized in that: The acquisition of the moving trajectory of the target is expressed as follows: Where P is the path trajectory of the target; {P start ,P end } represents the coordinates of the starting point and end point of the straight line trajectory; {(x i ,y j )|i∈[1,n]} represents the set of trajectory coordinates generated when the user drags or moves the target; Wherein, Point represents the number of user-specified coordinates obtained. When Point=2, it means that the path of the current target is a straight line; when Point>2, it means that the path of the current target is a non-straight line. The specific calculation of the key frame capture is as follows: Where P frame is the key frame coordinate corresponding to the current target; P k represents the kth key frame coordinate in the straight line trajectory; (x k ,y k ) represents the kth key frame coordinate of the non-linear trajectory; (x last ,y last ) is the latest key frame coordinate traversed; d is the preset pixel interval; n represents the total number of key frame coordinates of the current target.
3. The method for generating an animation of sports tactics demonstration according to claim 2, characterized in that: The specific representation of the data synchronization is as follows: SyncFrame target ={P ease-in }∪{P i |i∈[k ease +1,N target -k ease -1]}∪{P ease-out }∪{P sync } Where, SyncFrame target N is the coordinate of the target key frame for synchronization; max is the maximum number of key frames among the target key frame coordinates; N target is the number of key frames corresponding to the current target; k ease The number of target key frame coordinates corresponding to the easing area of the current target; P ease-in The starting point of the current target is the easing key frame set; ease-out The endpoint easing keyframe set of the current target; sync A collection of key frames for synchronization completion.
4. The method for generating an animation of a sports tactical demonstration according to claim 3, characterized in that: The target key frame coordinate number k corresponding to the easing area ease The specific calculation is as follows: In the formula, w min is the minimum weight coefficient of the easing area; The starting point easing key frame set P of the current target ease-in The specific calculation is as follows: Where P i,k Indicates the current target key frame coordinate to the previous target key frame coordinate P i-1 A collection of easing interpolation keyframes between ; is the coordinates of the previous target key frame P i-1 The direction vector pointing to the current target keyframe coordinates; is the easing interpolation interval of the ease-in, and the specific calculation is as follows: Where, d min is the initial minimum pixel interval of the ease-in area, and the specific calculation is expressed as: d is the preset pixel interval; The total number of eased interpolation keyframes from the previous target keyframe coordinates to the current target keyframe coordinates. The specific calculation is expressed as: In the formula, is the weight coefficient of ease-in, and the specific calculation is as follows: W is the sum of the weight coefficients; M is the total number of easing interpolation key frames, and the specific calculation is as follows: In the formula, is a constraint; The endpoint easing key frame set P of the current target ease-out The specific calculation is as follows: In the formula, is the easing interpolation interval of the slow-out, which is used to gradually reduce the interval, thereby representing the change of the current target's motion speed from uniform to slow. The specific calculation is as follows: In the formula, The total number of eased interpolation key frames from the previous target key frame coordinates to the current target key frame coordinates. The specific calculation is expressed as: In the formula, is the weight coefficient of the slow-out, and the specific calculation is as follows: The synchronously completed key frame set P sync The specific calculation is as follows: Where N sync The total number of keyframes to complete for synchronization.
5. An animation generation device for sports tactics demonstration, characterized in that: It includes a target path trajectory acquisition unit, a key frame capture unit, a data synchronization unit, a pixel coordinate update unit and an animation rendering unit; The target path trajectory acquisition unit is used to acquire the movement trajectories of several targets specified by the user; The key frame capturing unit is used to perform key frame capturing on the moving trajectories of a plurality of targets according to a preset pixel interval to obtain key frame coordinates of a plurality of targets; The data synchronization unit is used to synchronize the data of a plurality of target key frame coordinates by using a synchronization mechanism to obtain synchronized coordinates of a plurality of target key frames; The pixel coordinate updating unit is used to update the pixel position according to the synchronized coordinates of several target key frames to obtain several groups of target pixel coordinates; The animation rendering unit is used to perform animation rendering according to pixel coordinate groups of a plurality of targets to obtain a sports tactical demonstration animation.
6. The animation generation device for sports tactics demonstration according to claim 5, characterized in that: The acquisition of the moving trajectory of the target is expressed as follows: Where P is the path trajectory of the target; {P start ,P end } represents the coordinates of the starting point and end point of the straight line trajectory; {(x i ,y j )|i∈[1,n]} represents the set of trajectory coordinates generated when the user drags or moves the target; Wherein, Point represents the number of user-specified coordinates obtained. When Point=2, it means that the path of the current target is a straight line; when Point>2, it means that the path of the current target is a non-straight line. The specific calculation of the key frame capture is as follows: Where P frame is the key frame coordinate corresponding to the current target; P k represents the kth key frame coordinate in the straight line trajectory; (x k ,y k ) represents the kth key frame coordinate of the non-linear trajectory; (x last ,y last ) is the latest key frame coordinate traversed; d is the preset pixel interval; n represents the total number of key frame coordinates of the current target.
7. The animation generation device for sports tactics demonstration according to claim 6, characterized in that: The specific representation of the data synchronization is as follows: SyncFrame target ={P ease-in }∪{P i |i∈[k ease +1,N target -k ease -1]}∪{P ease-out }∪{P sync } Where, SyncFrame target N is the coordinate of the target key frame for synchronization; max is the maximum number of key frames among the target key frame coordinates; N target is the number of key frames corresponding to the current target; k ease The number of target keyframe coordinates corresponding to the easing area of the current target. The specific calculation is as follows: In the formula, w min is the minimum weight coefficient of the easing area; P ease-in It is the starting point easing key frame set of the current target. The specific calculation is as follows: Where P i,k Indicates the current target key frame coordinate to the previous target key frame coordinate P i-1 A collection of easing interpolation keyframes between ; is the coordinates of the previous target key frame P i-1 The direction vector pointing to the current target keyframe coordinates; is the easing interpolation interval of the ease-in, and the specific calculation is as follows: Where, d min is the initial minimum pixel interval of the ease-in area, and the specific calculation is expressed as: d is the preset pixel interval; The total number of eased interpolation keyframes that are eased in from the previous target keyframe coordinates to the current target keyframe coordinates. The specific calculation is expressed as: In the formula, is the weight coefficient of ease-in, and the specific calculation is as follows: W is the sum of the weight coefficients; M is the total number of easing interpolation key frames, and the specific calculation is as follows: In the formula, is a constraint; P ease-out It is the set of easing key frames at the end point of the current target. The specific calculation is as follows: In the formula, is the easing interpolation interval of the slow-out, which is used to gradually reduce the interval, thereby representing the change of the current target's motion speed from uniform to slow. The specific calculation is as follows: In the formula, The total number of eased interpolation key frames from the previous target key frame coordinates to the current target key frame coordinates. The specific calculation is expressed as: In the formula, is the weight coefficient of the slow-out, and the specific calculation is as follows: P sync For a set of key frames that are synchronized and completed, the specific calculation is as follows: Where N sync The total number of keyframes to complete for synchronization.
8. An animation generation system for sports tactics demonstration, characterized in that: It includes a client, an animation generating device and a server; The client is used to display a plurality of targets and provide an interactive interface, so that the user can operate the targets through the interactive interface, generate movement trajectories of the plurality of targets specified by the user, and send the movement trajectories to the animation generation device; the client also includes a display animation for the user to watch; The animation generation device is used to receive the movement trajectories of several targets specified by the user, and sequentially perform key frame capture, data synchronization, pixel position update and animation rendering to obtain the sports tactical demonstration animation and transmit it to the server; The server is used to store and manage the sports tactics demonstration animation, and transmit the sports tactics demonstration animation to the client for playback according to the playback request of the client; Wherein, the animation generating device is an animation generating device for sports tactics demonstration as described in any one of claims 5-7.
9. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for generating an animation for a sports tactical demonstration as described in any one of claims 1 to 4 is implemented.
10. A computer-readable storage medium storing computer-executable instructions, characterized in that: When the computer executable instructions are executed by a processor, the animation generation method for sports tactical demonstration as described in any one of claims 1-4 is implemented.
Citation Information
Patent Citations
Ball tactical demonstration method and device
CN106611517A
Systems and methods for authoring cross-browser HTML 5 motion path animation
CN110235181A
Animation implementation method and device, electronic equipment and storage medium
CN111260762A
Animation playing method and device, equipment and medium
CN115496842A
Football match comprehensive sports performance evaluation method and system
CN118552088A