AI-based dance choreography generation method, device and system
By establishing a three-dimensional spatial coordinate system and using AI iterative evolution algorithms to optimize dance choreography, the problem of matching movement combinations with rhythm in dance choreography has been solved, improving fluency and visual appeal.
Patent Information
- Application Number
- CN202511485084.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-10-17
AI Technical Summary
Existing technologies struggle to optimize movement combinations in dance choreography while keeping pace with the beat, resulting in insufficient fluidity and visual appeal.
By establishing a three-dimensional spatial coordinate system for basic motion elements and connecting motion elements, the trajectories and vectors of motion nodes are recorded, and AI is used to generate dance choreography schemes, including iterative evolutionary algorithms to optimize the combination of choreography units, ensuring that the movements match the music beat and are smooth.
It achieves better fluidity and visual appeal under musical beats, and improves the automation and accuracy of dance choreography through data processing and AI optimization.
Smart Images

Figure CN120953452B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to an AI-based dance choreography generation method, device and system. BACKGROUND
[0002] Dance is essentially a series of coherent basic action elements. Experienced dance professionals master various basic action elements and combine them with the rhythm of music to form a dance. Basic action elements can be established based on the coordinate axes of the body, such as establishing the coordinate relationship of the limbs and head based on the waist as the coordinate origin. Basic action elements are dynamic, and there is a sequence of starting and ending trajectories. Experienced dance choreographers plan the connection of basic action elements based on their experience and the rhythm of music, which requires a lot of choreography attempts to get the best dance choreography sequence. It should be noted that each basic action element is closely related to the previous basic action element, because the end of the previous basic action element needs to be connected to the current basic action element, and the best is that the inertial motion direction of the ending action and the initial direction of the current action are consistent. The overall dance choreography needs to consider the type, connection and action speed of the basic action elements to achieve the best fluency and music rhythm correspondence, and the choreography process consumes a lot of time.
[0003] In the prior art, there is a class of technology that uses AI (artificial intelligence) algorithms to match basic action elements with music rhythm, but these technologies have implementation difficulties. First, there are connection actions between basic action elements, such as standing and arms spread at the end of a basic action element, and the other basic action element connected to it is kneeling on one leg and stretching the other leg with arms around the waist, that is, there are connection actions between basic action elements. Second, simply considering the splicing of basic action elements to form a dance does not take into account the fluency, that is, the end of the previous basic action element needs to be connected to the current basic action element. Third, the speed of basic action elements and connection actions is not fixed, otherwise the number of possible dance solutions will be greatly reduced and the aesthetic value of the dance will be reduced. SUMMARY
[0004] (1) Technical problem to be solved
[0005] The purpose of the present application is to provide an AI-based dance choreography generation method, device and system to optimize more possible action combinations and have better fluency when the dance action is in line with the rhythm.
[0006] (2) Technical solution
[0007] To achieve the above purpose, on the one hand, the present application provides an AI-based dance choreography generation method, which comprises:
[0008] establishing a basic action element library, establishing a three-dimensional coordinate system with the waist as a coordinate origin, setting limbs joints as motion nodes, and recording the spatial coordinate motion trajectory of each motion node in each basic action element relative to the coordinate origin; obtaining the starting coordinates and starting motion vectors of each motion node of each basic action element at a starting moment, and the ending coordinates and ending motion vectors of each motion node at an ending moment through the spatial coordinate motion trajectory;
[0009] establishing a connection action element library, generating a connection action element through the straight line motion trajectory of each motion node between the ending coordinates of the first basic action element and the starting coordinates of the second basic action element, and recording the spatial motion trajectory and connection duration of the connection action element; obtaining a beat time sequence of preselected music, and taking the beat time sequence as a time reference point for action element transformation;
[0010] generating an initial population of dance choreography schemes, the initial population including multiple individuals, each individual representing a dance choreography scheme, each dance choreography scheme being composed of multiple arrangement units in chronological order, each arrangement unit including a unit type, a unit selection state, a unit starting time and a unit speed adjustment coefficient, wherein the unit type is used to mark the basic action element corresponding to the arrangement unit, the unit selection state takes a value of 0 or 1, the unit starting time represents a starting time point of the arrangement unit in the dance choreography, and the unit speed adjustment coefficient represents a proportion of the arrangement unit relative to a standard speed;
[0011] iteratively evolving the initial population to obtain a final dance choreography scheme, and outputting, in order of the unit starting time, the spatial coordinate motion trajectory of the basic action element or the connection action element corresponding to the arrangement unit and the unit speed adjustment coefficient of each arrangement unit with the unit selection state being 1 in the final dance choreography scheme, to generate a complete dance choreography output sequence.
[0012] Further, the method of establishing a three-dimensional coordinate system with the waist as a coordinate origin, setting limbs joints as motion nodes, and recording the spatial coordinate motion trajectory of each motion node in each basic action element relative to the coordinate origin; obtaining the starting coordinates and starting motion vectors of each motion node of each basic action element at a starting moment, and the ending coordinates and ending motion vectors of each motion node at an ending moment through the spatial coordinate motion trajectory includes:
[0013] obtaining the motion duration of the i-th basic action element sampling each motion node of the i-th basic action element at equal time intervals within the motion duration dividing the motion duration a sampling time point, wherein is a preset total number of sampling time points; the first sampling time point is the start time point, and the last sampling time point is the end time point a sampling time point is calculated in the following manner:
[0014] ;
[0015] wherein is an integer variable with a value from 1 to ; the spatial coordinates of the first motion node of the first base action element at the first sampling time point are recorded by the motion capture device , wherein is an integer variable with a value from 1 to , and is the total number of motion nodes ;
[0016] The starting coordinates of the first motion node of the first base action element at the start time point are the spatial coordinates corresponding to the first sampling time point , and the ending coordinates of the first motion node of the first base action element at the end time point are the spatial coordinates corresponding to the sampling time point ;
[0017] The starting motion vector of the first motion node of the first base action element at the start time point is calculated by the ratio of the coordinate difference of the first two sampling time points to the time interval and is ;
[0018] ;
[0019] The ending motion vector of the first motion node of the first base action element at the end time point is calculated by the ratio of the coordinate difference of the last two sampling time points to the time interval and is ;
[0020] .
[0021] Further, the method for generating a connecting action element through the straight-line motion trajectory of each motion node between the ending coordinates of the first base action element and the starting coordinates of the second base action element, and recording the spatial motion trajectory and the connecting duration of the connecting action element comprises:
[0022] acquiring the starting coordinates of the first motion node of the first base action element end coordinates of the motion node at the end time and the motion node of the basic action element at the start time ;
[0023] calculating a straight line motion distance of the motion node between the basic action element and the basic action element is:
[0024] ;
[0025] determining a maximum straight line motion distance from the straight line motion distances of all motion nodes is:
[0026] ;
[0027] calculating a transition duration from the basic action element to the basic action element by a ratio of the maximum straight line motion distance and a preset motion speed :
[0028] ;
[0029] recording a transition spatial motion track from the basic action element to the basic action element, a spatial coordinate of the transition spatial motion track of the motion node at a motion progress parameter is:
[0030] ;
[0031] wherein the motion progress parameter is 0 or 1, represents the end coordinates of the basic action element, represents the start coordinates of the basic action element.
[0032] Further, the method for obtaining the final dance choreography scheme by iteratively evolving the initial population comprises:
[0033] The iterative evolution steps include calculating the fitness value of each dance choreography scheme. The fitness value is calculated based on the time deviation between the start time of the choreography unit and the time of the pre-selected music beat, the vector angle between the closing motion vector of the previous choreography unit and the starting motion vector of the next choreography unit, and the connection duration of the connecting motion elements between adjacent choreography units.
[0034] The dance choreography schemes are sorted according to the fitness values, and a preset number of winning individuals are selected by roulette wheel selection. The winning individuals are then cross-crossed and mutated to obtain offspring individuals. The initial population is replaced with the offspring individuals, and the iterative evolution process is repeated until the improvement in the fitness values of the offspring individuals and the parent individuals is lower than the set convergence threshold. The optimal individual after the iterative evolution is taken as the final dance choreography scheme.
[0035] Furthermore, the method for calculating the fitness value of each dance choreography scheme includes:
[0036] Get the The dance choreography scheme, the first The dance choreography plan includes The arrangement unit; calculate the first... The average beat deviation of each dance choreography scheme is compared with a preset beat deviation threshold to determine the... Does the dance choreography scheme meet the beat fit constraint?
[0037] When the When a dance choreography scheme satisfies the beat fit constraint, calculate the smoothness value of the h-th dance choreography scheme, and use the smoothness value as the h-th dance choreography scheme. The fitness value of a dance choreography scheme;
[0038] When the first When a dance choreography scheme does not meet the aforementioned beat-matching constraint, the first... The fitness value of each dance choreography scheme is set to zero.
[0039] Furthermore, the calculation of the first The average beat deviation of each dance choreography scheme is compared with a preset beat deviation threshold to determine the... Methods for determining whether a dance choreography scheme meets the beat fit constraint include:
[0040] Get the The first dance choreography scheme Unit selection status of each arrangement unit and the start time of the unit ,in is an integer variable with a value ranging from 1 to ;
[0041] For the unit selection state of the arrangement unit with a value of 1, the time difference absolute value between the unit start time and the th beat time in the preselected sequence of music beat times is calculated, and the minimum value among all time difference absolute values is selected as the time deviation of the th arrangement unit in the th dance arrangement scheme. The time deviation of the th arrangement unit in the th dance arrangement scheme is:
[0042] ;
[0043] wherein is an integer variable with a value ranging from 1 to , is the total number of beat times;
[0044] The number of arrangement units with a unit selection state of 1 in the th dance arrangement scheme is calculated , and the average value of the time deviations of all arrangement units with a unit selection state of 1 is obtained as the average beat deviation of the th dance arrangement scheme. The average beat deviation of the th dance arrangement scheme is:
[0045] ;
[0046] The average beat deviation is compared with a preset beat deviation threshold value to determine whether the th dance arrangement scheme satisfies the beat fit constraint condition.
[0047] Further, the method for calculating the fluency value of the th dance arrangement scheme comprises:
[0048] For the adjacent th arrangement unit and the th arrangement unit in the th dance arrangement scheme, when the unit selection state of the th arrangement unit and the unit selection state of the th arrangement unit are both 1, the ending motion vector of the th motion node of the basic motion element corresponding to the th arrangement unit is obtained. and the first movement vector of the first movement node of the basic action element corresponding to the first , wherein is an integer variable with a value from 1 to ;
[0049] the vector angle between the start movement vector and the end movement vector of the jth movement node is calculated as:
[0050] ;
[0051] the average vector angle between the first arrangement unit and the first arrangement unit of the jth dance arrangement scheme is calculated as the average vector angle of all movement nodes:
[0052] ;
[0053] the transition duration between the first arrangement unit and the first arrangement unit of the jth dance arrangement scheme is obtained from the transition action element library according to the basic action element index corresponding to the first arrangement unit and the basic action element index corresponding to the first arrangement unit; ;
[0054] the smoothness value of the jth dance arrangement scheme is calculated as:
[0055] .
[0056] Based on the same inventive concept, in a second aspect, the present application also provides an AI-based dance arrangement generation device, which comprises:
[0057] a first library establishment unit, which is configured to establish a basic action element library, establish a three-dimensional coordinate system with the waist as the coordinate origin, set the joints of the limbs as movement nodes, and record the spatial coordinate movement trajectories of each movement node relative to the coordinate origin in each basic action element; and obtain the start coordinates and start movement vectors of each movement node at the start time and the end coordinates and end movement vectors of each movement node at the end time of each basic action element through the spatial coordinate movement trajectories;
[0058] The second library establishing unit is configured to establish a connection action element library, generate a connection action element through a straight line motion track of each motion node between an ending coordinate of the first basic action element and a starting coordinate of the second basic action element, record a spatial motion track and a connection duration of the connection action element, and obtain a beat time sequence of preselected music, and use the beat time sequence as a time reference point for action element transformation.
[0059] The AI algorithm unit is configured to generate an initial population of dance choreography schemes, the initial population including a plurality of individuals, each individual representing a dance choreography scheme, each dance choreography scheme being composed of a plurality of choreography units in chronological order, each choreography unit including an element type, an element selection state, an element starting time, and an element speed adjustment coefficient, wherein the element type is used to mark a basic action element corresponding to the choreography unit, the element selection state takes a value of 0 or 1, the element starting time represents a starting time point of the choreography unit in the dance choreography, and the element speed adjustment coefficient represents a proportion of the choreography unit relative to a standard speed; iteratively evolve the initial population to obtain a final dance choreography scheme, and output, in order of the element starting time, the spatial coordinate motion track of the basic action element or the connection action element corresponding to the choreography unit and the element speed adjustment coefficient of the choreography unit whose element selection state is 1 in the final dance choreography scheme, to generate a complete dance choreography output sequence.
[0060] Based on the same inventive concept, in a third aspect, the present application also provides an AI-based dance choreography generation system, including an action capture device for collecting basic action elements, one or more processors, a memory, and one or more programs, wherein the action capture device includes an acceleration sensor and a gyroscope, the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include a program for executing the AI-based dance choreography generation method.
[0061] (3) Advantageous effects
[0062] Compared with the prior art, the present application has better fluency in the case of matching basic action elements and music beats by digitizing dance basic action elements and iteratively optimizing and analyzing the combination of basic action elements through AI data. BRIEF DESCRIPTION OF DRAWINGS
[0063] Figure 1 The flowchart of the AI-based dance choreography generation method of embodiment 1 of the present application is shown in FIG. 1.
[0064] Figure 2 The unit block diagram of the AI-based dance choreography generation device of embodiment 2 of the present application is shown in FIG. 2. DETAILED DESCRIPTION
[0065] With reference to the accompanying drawings, the technical solutions in the embodiments of the present application will be clearly and completely described below, obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work belong to the protection scope of the present application.
[0066] Before examples are given, the application scenarios of the inventive concept need to be described. The fluency and watchability of choreography are subjective, but the physical meaning behind the fluency and watchability of the choreography needs to be analyzed by extracting the essence. After a certain choreography music is preselected, the beat thereof is extracted. It can be understood that the transformation of the basic action element is best near the time of the beat, so that the transformation of the choreography has a sense of rhythm. Secondly, the transformation of the basic action element of the choreography cannot be at will, but the difference between the ending limb movement direction of a certain basic action element (the movement of the head relative to the waist is single and small in amplitude, which is ignored in this example, but the principle is the same as that of the limbs) and the starting limb movement direction of the next action is the smallest. Furthermore, all the basic action elements and transition actions can have action speed differences, but need to be within a certain range, and the overall coordination needs to be considered. We need to pre-arrange the basic action elements and transition actions, and then optimize the corresponding parameters through an AI algorithm. It should be noted that the ending limb movement direction of certain basic action elements and the starting limb movement direction of another action actually differ greatly, and transition actions are also pre-established. Naturally, the time length and limb change amplitude of such transition actions will increase, which will affect the fluency of the choreography as a whole, but if the time length of such transition actions is shortened, the impact on the fluency will be reduced. The transition action can be understood as the straight-line movement of the limbs between two basic action elements. If the transition action has a complex action trajectory, it can be recorded and designed as a basic action element.
[0067] Embodiment 1: As shown in the following table, the present embodiment provides an AI-based choreography generation method, which comprises: Figure 1
[0068] S1, a basic action element library is established, a three-dimensional coordinate system is established with the waist as the coordinate origin, the limb joints are set as motion nodes, and the spatial coordinate motion trajectory of each motion node relative to the coordinate origin in each basic action element is recorded; the starting coordinates and starting motion vectors of each motion node at the starting moment and the ending coordinates and ending motion vectors of each motion node at the ending moment of each basic action element are obtained through the spatial coordinate motion trajectory;
[0069] S2, establish a connection action element library, generate a connection action element through straight line motion trajectories of each motion node between end coordinates of the first basic action element and start coordinates of the second basic action element, record spatial motion trajectories and connection duration of the connection action element; obtain a beat time sequence of preselected music, take the beat time sequence as a time reference point of action element transformation;
[0070] S3, generate an initial population of dance choreography schemes, the initial population includes multiple individuals, each individual represents a dance choreography scheme, each dance choreography scheme is composed of multiple arrangement units in time sequence, each arrangement unit contains a unit type, a unit selection state, a unit start time and a unit speed adjustment coefficient, wherein the unit type is used to mark a basic action element corresponding to the arrangement unit, the unit selection state takes a value of 0 or 1, the unit start time represents a starting time point of the arrangement unit in the dance choreography, and the unit speed adjustment coefficient represents a proportion of the arrangement unit relative to a standard speed;
[0071] S4, iteratively evolve the initial population to obtain a final dance choreography scheme, output spatial coordinate motion trajectories of the basic action elements or the connection action elements corresponding to the arrangement units with the unit selection state being 1 in the final dance choreography scheme and the unit start time in sequence, and generate a complete dance choreography output sequence.
[0072] Exemplarily, in a certain dance choreography by AI, a motion capture device is prepared to record and build a library of 10 typical basic motion elements of Dai dance, the first motion element is a three-bend posture, with a duration of 3.2 seconds; the second motion element is a peacock spreading wings, with a duration of 2.8 seconds; the third motion element is a wave hand, with a duration of 3.5 seconds; the fourth motion element is a single-leg knee- lifting rotation, with a duration of 4.1 seconds; the fifth motion element is a hands-together squat, with a duration of 2.6 seconds; the sixth motion element is a fish jumping forward, with a duration of 3.3 seconds; the seventh motion element is a side body waist, with a duration of 2.9 seconds; the eighth motion element is a toe turning circle, with a duration of 3.8 seconds; the ninth motion element is a knee bending, with a duration of 2.4 seconds; and the tenth motion element is an arm wave, with a duration of 3.1 seconds. A three-dimensional space coordinate system is established with the waist center point of the dancer as the coordinate origin, and 12 joint nodes are selected as motion nodes, including left and right shoulder joints, left and right elbow joints, left and right wrist joints, left and right hip joints, left and right knee joints, and left and right ankle joints. The shoulder joint, elbow joint, and wrist joint constitute the upper limb kinematic chain, and the hip joint, knee joint, and ankle joint constitute the lower limb kinematic chain. These joint nodes can completely describe the spatial position and motion state of the limbs in the dance movement, while the head relative to the waist has small motion amplitude and single change, and is not the main tracking object in this case. The motion capture device is used to uniformly sample 100 time points for each basic motion element, and record the three-dimensional space coordinate values of the 12 motion nodes at each sampling time point.
[0073] The detailed data collection was carried out on the third action element of the three-bend shape, the spatial coordinates of the left shoulder joint at the starting moment were 18 cm left, 5 cm forward and 22 cm upward relative to the waist, and at the ending moment were 20 cm left, 8 cm forward and 23 cm upward; the starting coordinates of the left elbow joint were 28 cm left, 12 cm forward and 15 cm upward, and the ending coordinates were 32 cm left, 18 cm forward and 18 cm upward; the starting coordinates of the left wrist joint were 23 cm left, 18 cm forward and 45 cm upward, and the ending coordinates were 35 cm left, 28 cm forward and 52 cm upward. The right limb was symmetrically distributed, the starting coordinates of the right shoulder joint were 18 cm right, 5 cm forward and 22 cm upward, and the ending coordinates were 20 cm right, 8 cm forward and 23 cm upward; the starting coordinates of the right elbow joint were 27 cm right, 10 cm forward and 16 cm upward, and the ending coordinates were 31 cm right, 17 cm forward and 19 cm upward; the starting coordinates of the right wrist joint were 21 cm right, 12 cm backward and 43 cm upward, and the ending coordinates were 32 cm right, 20 cm backward and 50 cm upward. As for the lower limbs, the starting coordinates of the left hip joint were 12 cm left, 2 cm forward and 8 cm downward, and the ending coordinates were 13 cm left, 3 cm forward and 7 cm downward; the starting coordinates of the left knee joint were 15 cm left, 8 cm forward and 45 cm downward, and the ending coordinates were 16 cm left, 10 cm forward and 43 cm downward; the starting coordinates of the left ankle joint were 18 cm left, 12 cm forward and 82 cm downward, and the ending coordinates were 19 cm left, 13 cm forward and 81 cm downward. The starting coordinates of the right hip joint were 12 cm right, 2 cm forward and 8 cm downward, and the ending coordinates were 13 cm right, 3 cm forward and 7 cm downward; the starting coordinates of the right knee joint were 16 cm right, 9 cm forward and 44 cm downward, and the ending coordinates were 17 cm right, 11 cm forward and 42 cm downward; the starting coordinates of the right ankle joint were 18 cm right, 13 cm forward and 83 cm downward, and the ending coordinates were 19 cm right, 14 cm forward and 82 cm downward. The starting movement vectors of each movement node were calculated by the ratio of the coordinate difference between the first sampling time point and the second sampling time point to the time interval of 0.032 seconds, for example, the starting movement vector of the left wrist joint was 37.5 cm laterally per second, 31.25 cm longitudinally per second and 21.875 cm vertically per second.The starting motion vector represents the motion speed and direction of each joint at the beginning of the motion. The vector contains the initial state of the motion force and the direction information of the body inertia. When a basic motion element ends and connects to the next basic motion element, if the ending motion vector of the previous motion is close to the starting motion vector of the next motion, the body can naturally transition along the inertia. If the two vectors are opposite or the included angle is too large, additional energy is needed to change the direction of motion, which will cause the motion to stop and be unsmooth. Therefore, the starting motion vector and the ending motion vector are used to evaluate the smoothness of motion connection. Similarly, the ending motion vector is calculated by the last two sampling time points. The ending motion vector of the left wrist joint is 40.625 cm / s horizontally, 34.375 cm / s vertically, and 25 cm / s vertically.
[0074] Data collection is performed on the second motion element, the peacock spreading its wings. The starting coordinates of the left wrist joint are 42 cm left, 8 cm back, and 58 cm up. The ending coordinates are 55 cm left, 18 cm back, and 48 cm up. The starting coordinates of the right wrist joint are 40 cm right, 6 cm back, and 56 cm up. The ending coordinates are 53 cm right, 16 cm back, and 46 cm up. The starting coordinates of the left shoulder joint are 19 cm left, 2 cm back, and 23 cm up. The ending coordinates are 22 cm left, 5 cm back, and 24 cm up. The starting coordinates of the right shoulder joint are 19 cm right, 2 cm back, and 23 cm up. The ending coordinates are 22 cm right, 5 cm back, and 24 cm up. The starting coordinates of the left elbow joint are 35 cm left, 5 cm back, and 28 cm up. The ending coordinates are 43 cm left, 12 cm back, and 22 cm up. The starting coordinates of the right elbow joint are 34 cm right, 4 cm back, and 27 cm up. The ending coordinates are 42 cm right, 11 cm back, and 21 cm up. The lower limb joint data is as follows: the starting coordinates of the left hip joint are 11 cm left, 1 cm forward, and 7 cm down. The ending coordinates are 12 cm left, 2 cm forward, and 6 cm down. The starting coordinates of the left knee joint are 14 cm left, 7 cm forward, and 43 cm down. The ending coordinates are 15 cm left, 9 cm forward, and 41 cm down. The starting coordinates of the left ankle joint are 17 cm left, 11 cm forward, and 81 cm down. The ending coordinates are 18 cm left, 12 cm forward, and 80 cm down. The right lower limb is symmetrically distributed. The starting motion vector of the left wrist joint is 46.43 cm / s horizontally, -35.71 cm / s vertically, and -35.71 cm / s vertically. The ending motion vector is 48.21 cm / s horizontally, -37.50 cm / s vertically, and -39.29 cm / s vertically.
[0075] Similarly, the transition action element library is established for the transition relationship between each pair of the 10 basic action elements, and the spatial straight-line distance of each motion node between the ending coordinates of the first action element of the three-bend modeling and the starting coordinates of the second action element of the peacock spreading wings is calculated. The left wrist joint needs to move from the ending coordinates to the starting coordinates by 35 cm left, 28 cm forward, and 52 cm upward, to 42 cm left, 8 cm backward, and 58 cm upward, with a transverse movement of 7 cm, a longitudinal movement of 36 cm, and a vertical movement of 6 cm, and the spatial straight-line distance is 37.3 cm. The right wrist joint needs to move from 32 cm right, 20 cm backward, and 50 cm upward to 40 cm right, 6 cm backward, and 56 cm upward, with a spatial straight-line distance of 16.1 cm. The movement distances of the 12 motion nodes are calculated in turn, and it is found that the left wrist joint has a maximum value of 37.3 cm. The movement speed of each joint in space is subject to coordination constraints, and if the joints with short movement distances are allowed to quickly reach their positions while the joints with long movement distances are slowly moved, the limbs will be out of sync and twisted, so the time required by the joint with the longest movement distance must be used as a reference to allow all joints to complete the position transition simultaneously within the same time, which ensures the integrity and coordination of the body posture, that is, although some joints can quickly reach the predetermined position, they must wait for the joint that reaches the position the slowest. According to the preset transition speed of 50 cm per second, the duration of the transition from the first action element to the second action element is 0.75 seconds. The straight-line motion trajectory parameters of the 12 motion nodes from the starting coordinates to the target coordinates are recorded, such as the motion trajectory parameters of the left wrist joint: the transverse direction linearly changes from 35 cm to 42 cm, the longitudinal direction linearly changes from 28 cm to negative 8 cm, and the vertical direction linearly changes from 52 cm to 58 cm. The motion progress parameter changes from 0 to 1, corresponding to the complete transition process from the starting point to the ending point. All 90 kinds of transition combinations between the 10 basic action elements are calculated in this way. The transition duration from the first action element to the third action element is 1.02 seconds, the transition duration from the second action element to the fourth action element is 1.18 seconds, the transition duration from the third action element to the fifth action element is 0.86 seconds, the transition duration from the fourth action element to the sixth action element is 0.94 seconds, the transition duration from the fifth action element to the seventh action element is 1.05 seconds, the transition duration from the sixth action element to the eighth action element is 0.78 seconds, the transition duration from the seventh action element to the ninth action element is 1.12 seconds, and the transition duration from the eighth action element to the tenth action element is 0.91 seconds. The duration of the remaining transition combinations is calculated based on the maximum node movement distance, ranging from 0.65 seconds to 1.38 seconds, and the transition action element library is established. A Dai ethnic dance music is selected, with a total duration of 120 seconds. The strong and weak beat moments in the music are identified through a beat extraction algorithm, and a total of 96 beat time points are extracted.The first beat is at 0.5 seconds, the second beat is at 1.75 seconds, the third beat is at 3.0 seconds, the fourth beat is at 4.25 seconds, the fifth beat is at 5.5 seconds, and so on, with an average of one beat every 1.25 seconds. These 96 beat time points are used as time reference for the transformation of the motion elements in the subsequent choreography. When the starting or ending time of a dance motion falls exactly on a music beat, the visual stimulation and auditory stimulation of the audience resonate, and the brain interprets this synchronization as rhythm and rhythm beauty. On the contrary, if the motion transformation time deviates too far from the beat, it will produce a feeling of dragging or stealing, reducing the watchability of the dance.
[0076] An initial population for the genetic algorithm is generated, with a population size of 50 individuals, each individual representing a complete choreography scheme, and each scheme having 30 arrangement unit slots arranged in chronological order. Each arrangement unit contains 4 parameters: the first parameter is the unit type, with a value range of 1 to 10, corresponding to 10 basic motion elements; the second parameter is the unit selection state, with a value of 0 or 1, 0 indicating that the slot is not enabled, and 1 indicating that the slot is enabled; the third parameter is the unit start time, indicating the starting time point of the arrangement unit in the dance, with a unit of seconds; the fourth parameter is the unit speed adjustment coefficient, with a value range of 0.8 to 1.2, indicating the playback ratio of the arrangement unit relative to the standard speed. The unit selection state is set to allow the genetic algorithm to flexibly adjust the number of motion elements used during evolution. Some basic motion elements may not be suitable for certain music segments, and by setting their selection state to 0, they can be skipped without affecting the continuity of the overall arrangement sequence. The reason for allowing the speed adjustment coefficient to vary within the range of 0.8 to 1.2 is that the same basic motion element can adapt to different rhythm music segments at different playback speeds. For example, a speed coefficient of 0.8 indicates that the motion is slowed to 80% of the standard speed, making the motion more gentle and suitable for slow rhythm music; a speed coefficient of 1.2 indicates that the motion is accelerated to 120% of the standard speed, making the motion more agile and suitable for fast rhythm music. However, the speed adjustment range cannot be too large, otherwise it will cause the motion to deform or violate the laws of human kinematics. The initial population of 50 individuals is randomly generated, for example, the first individual has the following 5 arrangement units: the first unit type is 3 corresponding to wave hand, the selection state is 1, the start time is 0.5 seconds, and the speed coefficient is 1.05; the second unit type is 1 corresponding to three bends, the selection state is 1, the start time is 4.3 seconds, and the speed coefficient is 0.95; the third unit type is 7 corresponding to side body waist, the selection state is 0, the start time is 8.1 seconds, and the speed coefficient is 1.0; the fourth unit type is 5 corresponding to double hands together squat, the selection state is 1, the start time is 11.8 seconds, and the speed coefficient is 0.88; the fifth unit type is 9 corresponding to knee bending, the selection state is 1, the start time is 15.2 seconds, and the speed coefficient is 1.12. Since the selection state of the third unit is 0, the unit is skipped in the actual arrangement. The first 5 arrangement units of the second individual are: type 2, state 1, time 0.6 seconds, coefficient 0.92; type 4, state 1, time 3.8 seconds, coefficient 1.08; type 6, state 1, time 8.5 seconds, coefficient 0.85; type 10, state 0, time 12.1 seconds, coefficient 1.0; type 8, state 1, time 15.7 seconds, coefficient 1.15. According to this rule, initial random parameter values are assigned to the 30 arrangement units of each individual, and the initial population is constructed.The initial population underwent iterative evolution. In each iteration, the fitness value of each individual was calculated. The fitness value considered three core factors: first, the time deviation between the start time of the choreography unit and the timing of the musical beat; a smaller deviation indicates a higher degree of fit between the movement change and the beat; second, the angle between the ending motion vector of the previous choreography unit and the starting motion vector of the next choreography unit; a smaller angle indicates better smoothness of the movement transition; and third, the duration of the connecting motion elements between adjacent choreography units; a shorter duration indicates a more compact movement transition. After 150 generations of genetic evolution iterations, the increase in the fitness value of the population decreased to below 0.1%, satisfying the convergence condition. The individual with the highest fitness value in the final population is selected as the final dance choreography scheme. This scheme contains 23 effective choreography units with a selection state of 1, in the following order: Type 3, Type 1, Type 5, Type 2, Type 7, Type 4, Type 9, Type 6, Type 10, Type 8, Type 3, Type 5, Type 1, Type 7, Type 2, Type 4, Type 6, Type 9, Type 10, Type 8, Type 5, Type 3, and Type 1. Following the start time sequence of these 23 choreography units, the spatial coordinate motion trajectory and speed adjustment coefficient of the corresponding basic motion elements are output sequentially. Simultaneously, the spatial motion trajectory of the corresponding connecting motion elements is inserted between adjacent choreography units, ultimately generating a complete 120-second Dai ethnic dance choreography output sequence. This sequence contains 23 basic motion elements and 22 connecting motion elements, which can directly drive a virtual character or robot to complete the dance movements.
[0077] Furthermore, the method of establishing a three-dimensional spatial coordinate system with the waist as the origin, setting the joints of the limbs as motion nodes, and recording the spatial coordinate motion trajectory of each motion node in each basic motion element relative to the origin; obtaining the starting coordinates and starting motion vector of each motion node of each basic motion element at the starting moment, and the ending coordinates and ending motion vector of each motion node at the ending moment through the spatial coordinate motion trajectory includes:
[0078] Get the Duration of movement of each basic movement element During the duration of exercise Internal to the first Each motion node of a basic motion element is sampled at equal time intervals, and the duration of the motion is recorded. Evenly divided into There are 1 sampling time points, among which The total number of preset sampling time points; the first Each sampling time point The calculation method is as follows:
[0079] ;
[0080] wherein is an integer variable taking values from 1 to ; the spatial coordinates of the k-th motion node of the i-th base motion element at the k-th sampling time point t is recorded by the motion capture device wherein is an integer variable taking values from 1 to , is the total number of motion nodes;
[0081] The starting coordinates of the k-th motion node of the i-th base motion element at the starting time are the spatial coordinates corresponding to the 1st sampling time point , and the ending coordinates at the ending time are the spatial coordinates corresponding to the -th sampling time point ; ;
[0082] The starting motion vector of the k-th motion node of the i-th base motion element at the starting time is calculated by the ratio of the coordinate difference of the first two sampling time points and the time interval, and is: ;
[0083] ;
[0084] The ending motion vector of the k-th motion node of the i-th base motion element at the ending time is calculated by the ratio of the coordinate difference of the last two sampling time points and the time interval, and is:
[0085] .
[0086] Exemplarily, detailed sampling data records are made for the first basic action element of the three-curve shape, and the movement duration of the action element is 3.2 seconds. The duration of 3.2 seconds is evenly divided into 100 sampling time points, and the reason for setting the total number of sampling points to 100 is to balance the accuracy of the movement trajectory and the amount of data storage. Too few sampling points will result in insufficient description of the movement trajectory and loss of key action details, and too many sampling points will produce redundant data, increase the storage burden, and the difference between adjacent sampling points is too small to affect the accuracy of the movement vector calculation. The specific time value of each sampling time point is calculated, the first sampling time point is 0 seconds, the second sampling time point is 0.0323 seconds, the third sampling time point is 0.0646 seconds, the tenth sampling time point is 0.2909 seconds, the fiftieth sampling time point is 1.5859 seconds, the ninety-ninth sampling time point is 3.1677 seconds, and the one-hundredth sampling time point is 3.2 seconds. The reason for using 99 instead of 100 as the denominator is that equal interval division means dividing the time period into 99 small intervals to produce 100 boundary points. If the denominator is 100, the time value of the last sampling point will be less than the duration of 3.2 seconds, and the posture data at the end of the action cannot be correctly collected.
[0087] The 12 motion nodes of the first basic action element of the three-way bending modeling are recorded at each sampling time point using a three-dimensional motion capture device. Take the left wrist joint as an example for detailed data display. At the first sampling time point of 0 seconds, the spatial coordinates are 23 cm left, 18 cm forward, and 45 cm upward. At the second sampling time point of 0.0323 seconds, the coordinates are 23.12 cm left, 18.10 cm forward, and 45.07 cm upward. At the tenth sampling time point of 0.2909 seconds, the coordinates are 24.09 cm left, 19.01 cm forward, and 45.65 cm upward. At the fiftieth sampling time point of 1.5859 seconds, the coordinates are 29.06 cm left, 23.04 cm forward, and 48.52 cm upward. At the ninety-ninth sampling time point of 3.1677 seconds, the coordinates are 34.88 cm left, 27.90 cm forward, and 51.93 cm upward. At the one-hundredth sampling time point of 3.2 seconds, the coordinates are 35 cm left, 28 cm forward, and 52 cm upward. From the sampling data, it can be observed that the left wrist joint presents a continuous motion trajectory extending from the left front of the body to the left outer side and upward during the entire action process. The spatial coordinate data of the remaining 11 motion nodes at all 100 sampling time points are recorded in the same way, and the complete spatial motion trajectory data collection of the first basic action element is completed. In the same way, the second basic action element of the peacock unfolding wings is sampled for 2.8 seconds with a sampling time interval of 0.0283 seconds. The third basic action element of the water wave hand waving is sampled for 3.5 seconds with a sampling time interval of 0.0354 seconds. The fourth basic action element of the single-leg knee lifting rotation is sampled for 4.1 seconds with a sampling time interval of 0.0414 seconds. The fifth basic action element of the hands-together squatting is sampled for 2.6 seconds with a sampling time interval of 0.0263 seconds. The sixth basic action element of the fish jumping forward leaning is sampled for 3.3 seconds with a sampling time interval of 0.0333 seconds. The seventh basic action element of the side body waist swinging is sampled for 2.9 seconds with a sampling time interval of 0.0293 seconds. The eighth basic action element of the tiptoe turning is sampled for 3.8 seconds with a sampling time interval of 0.0384 seconds. The ninth basic action element of the knee bending sinking is sampled for 2.4 seconds with a sampling time interval of 0.0242 seconds. The tenth basic action element of the arm wave lifting is sampled for 3.1 seconds with a sampling time interval of 0.0313 seconds.
[0088] The motion node coordinates and motion vectors of the third motion node of the first basic action element at the start time and the end time are calculated through the collected spatial coordinate data. The start coordinates are directly read from the spatial coordinate values corresponding to the first sampling time point. The start coordinates of the left wrist joint are 23 cm left, 18 cm forward, and 45 cm upward. The end coordinates are directly read from the spatial coordinate values corresponding to the 100th sampling time point. The end coordinates of the left wrist joint are 35 cm left, 28 cm forward, and 52 cm upward. To calculate the start motion vector, the ratio of the coordinate difference between the first two sampling time points to the time interval is used. The physical nature of the motion vector is the velocity vector. The definition of velocity is the displacement in a unit of time. The displacement difference is obtained by subtracting the coordinates of the first sampling point from the coordinates of the second sampling point, and then dividing by the time interval between the two sampling points to obtain the instantaneous velocity at that time. This instantaneous velocity represents the direction and speed of the limb movement at the start moment. The first two sampling points are used for calculation to reflect the true state of the start of the action as much as possible without being diluted by the average effect of the subsequent action process. If the first sampling point and the tenth sampling point are used to calculate the start motion vector, the average motion of the previous nine time periods will be included, which reduces the representativeness and accuracy of the start motion vector. The start motion vector of the left wrist joint is calculated to have a horizontal component of 3.72 cm per second, a longitudinal component of 3.10 cm per second, and a vertical component of 2.17 cm per second. To calculate the end motion vector, the ratio of the coordinate difference between the last two sampling time points to the time interval is used. The time interval between the 100th sampling point and the 99th sampling point is 0.0323 seconds. The end motion vector of the left wrist joint is calculated to have a horizontal component of 3.72 cm per second, a longitudinal component of 3.10 cm per second, and a vertical component of 2.17 cm per second.The calculation of the starting coordinates, ending coordinates, starting motion vector and ending motion vector of the 12 motion nodes is completed in sequence. The starting coordinates of the right wrist joint are 21 cm to the right, 12 cm backward and 43 cm upward, and the ending coordinates are 32 cm to the right, 20 cm backward and 50 cm upward. The starting motion vector is 3.41 cm horizontally, -2.48 cm longitudinally and 2.17 cm vertically per second, and the ending motion vector is 3.41 cm horizontally, -2.48 cm longitudinally and 2.17 cm vertically per second. The starting coordinates of the left shoulder joint are 18 cm to the left, 5 cm forward and 22 cm upward, and the ending coordinates are 20 cm to the left, 8 cm forward and 23 cm upward. The starting motion vector is 0.62 cm horizontally, 0.93 cm longitudinally and 0.31 cm vertically per second, and the ending motion vector is 0.62 cm horizontally, 0.93 cm longitudinally and 0.31 cm vertically per second. The starting coordinates of the right shoulder joint are 18 cm to the right, 5 cm forward and 22 cm upward, and the ending coordinates are 20 cm to the right, 8 cm forward and 23 cm upward. The starting coordinates of the left elbow joint are 28 cm to the left, 12 cm forward and 15 cm upward, and the ending coordinates are 32 cm to the left, 18 cm forward and 18 cm upward. The starting coordinates of the right elbow joint are 27 cm to the right, 10 cm forward and 16 cm upward, and the ending coordinates are 31 cm to the right, 17 cm forward and 19 cm upward. The starting coordinates of the left hip joint are 12 cm to the left, 2 cm forward and 8 cm downward, and the ending coordinates are 13 cm to the left, 3 cm forward and 7 cm downward. The starting coordinates of the right hip joint are 12 cm to the right, 2 cm forward and 8 cm downward, and the ending coordinates are 13 cm to the right, 3 cm forward and 7 cm downward. The starting coordinates of the left knee joint are 15 cm to the left, 8 cm forward and 45 cm downward, and the ending coordinates are 16 cm to the left, 10 cm forward and 43 cm downward. The starting coordinates of the right knee joint are 16 cm to the right, 9 cm forward and 44 cm downward, and the ending coordinates are 17 cm to the right, 11 cm forward and 42 cm downward. The starting coordinates of the left ankle joint are 18 cm to the left, 12 cm forward and 82 cm downward, and the ending coordinates are 19 cm to the left, 13 cm forward and 81 cm downward. The starting coordinates of the right ankle joint are 18 cm to the right, 13 cm forward and 83 cm downward, and the ending coordinates are 19 cm to the right, 14 cm forward and 82 cm downward. After the data processing of all the motion nodes of the first basic action element is completed, the sampling coordinate recording, starting and ending coordinate determination and starting and ending motion vector calculation are completed for the remaining 9 basic action elements in the same manner, and finally a complete basic action element library containing the spatial coordinate motion trajectories, starting and ending coordinates and starting and ending motion vectors of the 10 basic action elements is formed.
[0089] Furthermore, the method for generating connecting motion elements by means of the linear motion trajectories of each motion node between the ending coordinates of the first basic motion element and the starting coordinates of the second basic motion element, and recording the spatial motion trajectory and duration of the connecting motion elements, includes:
[0090] Get the The first basic action element The final coordinates of each motion node at the final moment and the The first basic action element The starting coordinates of each moving node at the initial moment ;
[0091] Calculate the first The basic action element to the first Between the basic action elements The linear motion distance of each moving node for:
[0092] ;
[0093] Determine the maximum straight-line motion distance from the straight-line motion distances of all moving nodes. for:
[0094] ;
[0095] Through the maximum straight-line distance With the preset speed of motion The ratio calculation starts from the first The basic action element to the first Duration of the connection between basic action elements :
[0096] ;
[0097] Record from the first The basic action element to the first The spatial motion trajectory of the connecting elements of the basic motion elements, the first The spatial motion trajectory of each motion node in the motion progress parameter spatial coordinates below for:
[0098] ;
[0099] The motion progress parameters The value can be 0 or 1. Indicates that it is located at the th The final coordinates of each basic action element. Indicates that it is located at the th The starting coordinates of the basic action element.
[0100] Exemplarily, the generation and recording of the transition action element are performed for 90 kinds of transition combinations between 10 basic action elements. Taking the transition between the first basic action element of three-bend modeling and the second basic action element of peacock unfolding wings as an example, the ending coordinates of the 12 motion nodes of the first basic action element at the ending moment and the starting coordinates of the 12 motion nodes of the second basic action element at the starting moment are obtained. The left wrist joint transitions from the ending coordinates of the first action element to the starting coordinates of the second action element by 35 cm left, 28 cm forward and 52 cm upward, to 42 cm left, 8 cm backward and 58 cm upward, and the joint node needs to move 7 cm horizontally, 36 cm longitudinally and 6 cm vertically, and the spatial straight line motion distance is 37.3 cm. The right wrist joint transitions from the ending coordinates to the starting coordinates by 32 cm right, 20 cm backward and 50 cm upward, to 40 cm right, 6 cm backward and 56 cm upward, and the spatial straight line motion distance is 16.1 cm. The spatial straight line motion distance of the left shoulder joint is 3.9 cm, the distance of the right shoulder joint is 3.9 cm, the distance of the left elbow joint is 19.5 cm, the distance of the right elbow joint is 18.7 cm, the distance of the left hip joint is 2.2 cm, the distance of the right hip joint is 2.2 cm, the distance of the left knee joint is 3.6 cm, the distance of the right knee joint is 3.7 cm, the distance of the left ankle joint is 2.8 cm, and the distance of the right ankle joint is 2.9 cm. After sequentially calculating the straight line motion distances of the 12 motion nodes, the maximum straight line motion distance is determined to be 37.3 cm of the left wrist joint.
[0101] The preset connection motion speed is 50 cm per second, and the connection duration from the first basic motion element to the second basic motion element is 0.75 seconds. The speed value is set according to the average moving speed of the human body in a relaxed state, which neither produces a stiff jumping feeling due to too fast speed nor appears slow due to too slow speed. The connection space motion trajectory from the first basic motion element to the second basic motion element is recorded. Taking the left wrist joint as an example, the connection space motion trajectory of the joint is described by linear interpolation. When the motion progress parameter is 0, the coordinates correspond to left 35 cm, forward 28 cm, and upward 52 cm. When the motion progress parameter is 0.5, the coordinates correspond to left 38.5 cm, forward 10 cm, and upward 55 cm. When the motion progress parameter is 1, the coordinates correspond to left 42 cm, backward 8 cm, and upward 58 cm. The essential function of the connection motion is to realize the posture transition between two basic motion elements, and the core requirement is fast, simple, and unobtrusive. The linear motion trajectory is the shortest path between two points, which can complete the transition in the shortest time and with the least energy consumption. If the connection motion adopts a complex curve trajectory, on the one hand, it will increase the connection duration and affect the compactness of the dance rhythm, and on the other hand, the complex trajectory itself will attract the attention of the audience, thereby weakening the performance effect of the basic motion element as the main body. Moreover, if a certain connection process indeed needs a complex motion trajectory to reflect the artistic nature, the connection process should be recorded separately and designed as an independent basic motion element rather than a connection motion element. Therefore, it is reasonable and necessary to design the connection motion element to adopt a linear motion.
[0102] The parameters of the remaining 89 combinations are calculated in the same way. The maximum linear motion distance of the wave hand from the first base motion element to the third base motion element is 22.1 cm for the left wrist joint, and the duration of the transition is 0.44 seconds. The maximum linear motion distance of the single leg knee lifting rotation from the first base motion element to the fourth base motion element is 18.3 cm for the left knee joint, and the duration of the transition is 0.37 seconds. The maximum linear motion distance of the hands together squat from the first base motion element to the fifth base motion element is 12.8 cm for the left hip joint, and the duration of the transition is 0.26 seconds. The duration of the transition from the second base motion element to the third base motion element is 0.98 seconds, the duration of the transition from the second base motion element to the fourth base motion element is 1.18 seconds, the duration of the transition from the second base motion element to the fifth base motion element is 0.86 seconds, the duration of the transition from the third base motion element to the fourth base motion element is 0.73 seconds, the duration of the transition from the third base motion element to the fifth base motion element is 0.52 seconds, the duration of the transition from the third base motion element to the sixth base motion element is 0.81 seconds. The duration of the transition from the fourth base motion element to the fifth base motion element is 0.94 seconds, the duration of the transition from the fourth base motion element to the seventh base motion element is 1.05 seconds, the duration of the transition from the fifth base motion element to the sixth base motion element is 0.67 seconds, the duration of the transition from the fifth base motion element to the eighth base motion element is 0.78 seconds, the duration of the transition from the sixth base motion element to the seventh base motion element is 0.89 seconds, the duration of the transition from the sixth base motion element to the ninth base motion element is 1.12 seconds, the duration of the transition from the seventh base motion element to the eighth base motion element is 0.95 seconds, the duration of the transition from the seventh base motion element to the tenth base motion element is 0.91 seconds, the duration of the transition from the eighth base motion element to the ninth base motion element is 0.76 seconds, the duration of the transition from the eighth base motion element to the tenth base motion element is 1.03 seconds, and the duration of the transition from the ninth base motion element to the tenth base motion element is 0.68 seconds. The duration of the remaining transition combinations is calculated according to the ratio of the maximum node movement distance to the preset motion speed of 50 cm per second. The duration of the 90 transition combinations ranges from 0.26 seconds to 1.38 seconds, completing the establishment of the motion node library containing the linear motion trajectory parameters of 12 motion nodes for each transition combination and the corresponding transition duration data.
[0103] Further, the method of iteratively evolving the initial population to obtain the final choreography scheme comprises:
[0104] The step of iterative evolution includes calculating a fitness value of each choreography scheme, which is calculated according to a time deviation of a start time of a choreography unit from a preselected music beat time, a vector angle between an end motion vector of a previous choreography unit and a start motion vector of a next choreography unit between adjacent choreography units, and a transition duration of a transition action element between adjacent choreography units.
[0105] The choreography schemes are sorted according to the fitness values and a roulette wheel selection method is used to select a preset number of winning individuals, the winning individuals are crossed and mutated to obtain offspring individuals, the initial population is replaced by the offspring individuals, and the iterative evolution process is repeated until a fitness value improvement range of the offspring individuals and the parent individuals is lower than a set convergence threshold, and an optimal individual after the iterative evolution is used as a final choreography scheme.
[0106] Exemplarily, 50 individuals of the initial population are subjected to the iterative evolution operation, and a fitness value of each choreography scheme is calculated first in each iteration. The quality of the choreography is reflected from different dimensions. A first index is a time deviation of a start time of a choreography unit from a preselected music beat time, which measures a degree of fit between action transformation and music rhythm, and a smaller time deviation indicates that the action transformation is closer to the music beat, thereby generating stronger rhythm and rhythm. A second index is a vector angle between an end motion vector of a previous choreography unit and a start motion vector of a next choreography unit between adjacent choreography units, which measures a smoothness of action transition, and a smaller vector angle indicates that an end direction of a previous action is closer to a start direction of a next action, so that the body can naturally transition along inertia without a need to change the motion direction dramatically, and a larger vector angle indicates that more energy is consumed to twist the motion direction, thereby generating a pause and a sense of incoherence. A third index is a transition duration of a transition action element between adjacent choreography units, which measures a compactness of action transition, and a shorter transition duration indicates that a smaller pose difference between two basic action elements is more natural, and a longer transition duration indicates that a larger pose difference needs more time to adjust, and a long transition duration weakens the expressiveness of the basic action elements and reduces the watchability of the dance. Although the transition action itself adopts a straight line motion to ensure the continuity of the transition, if a pose difference between two basic action elements is too large to cause a long transition duration, the audience will obviously perceive that the dancer is only adjusting the pose without showing meaningful dance actions during the transition time, and the long time of pose adjustment will interrupt the performance rhythm of the dance and reduce the overall smoothness, and therefore, a scheme with a long transition duration needs to be punished in the fitness function, so as to guide the genetic algorithm to tend to select choreography combinations with a smaller pose difference between the basic action elements and a shorter transition duration, thereby maximizing the smoothness and watchability of the dance while ensuring the diversity of the actions.
[0107] The first individual is taken as an example to illustrate the fitness calculation. The individual includes 30 scheduling units, and 23 scheduling units have a selected state of 1. The first selected unit has a type of 3 corresponding to water wave hand waving, a start time of 0.5 seconds, and a speed coefficient of 1.05. The standard duration of the unit is 3.5 seconds, and the actual duration is 3.33 seconds after adjustment by the speed coefficient. The second selected unit has a type of 1 corresponding to three bends, a start time of 4.3 seconds, and a speed coefficient of 0.95. The actual duration is 3.37 seconds. The third selected unit has a type of 5 corresponding to double-hand prayer squat, a start time of 8.2 seconds, and a speed coefficient of 0.88. The actual duration is 2.95 seconds. The absolute value of the time difference between the start time 0.5 seconds of the first selected unit and the time of 96 music beats is calculated. The difference between the first beat time 0.5 seconds and the second beat time 1.75 seconds is 0 seconds, and the difference between the fourth beat time 4.25 seconds and the fifth beat time 5.5 seconds is 1.2 seconds. The minimum difference 0.05 seconds is selected as the time deviation of the unit. The time deviations of all 23 selected units are calculated in turn, and the sum of the time deviations is 6.8 seconds. The average beat deviation is 0.296 seconds. The smoothness index between the first selected unit and the second selected unit is calculated. The ending motion vector of the third basic action element water wave hand waving and the starting motion vector of the first basic action element three bends are obtained. The average vector angle is 48 degrees by calculating the vector angle of 12 motion nodes and taking the average. The connection duration from the third basic action element to the first basic action element is 0.44 seconds by querying the connection action element library. The average vector angle and the connection duration between all 22 pairs of adjacent scheduling units are calculated in turn. The fitness value of the individual is calculated by combining the three indexes, which is 0.582. The fitness values of the remaining 49 individuals are calculated in the same way. The fitness values of the second individual, the third individual, the tenth individual, the twentieth individual, and the fiftieth individual are 0.514, 0.631, 0.489, 0.557, and 0.476, respectively. The 50 individuals are sorted in descending order according to the fitness values. The top 10 individuals have fitness values of 0.631, 0.619, 0.604, 0.595, 0.588, 0.582, 0.571, 0.563, 0.557, and 0.549, respectively.The roulette wheel selection method is used to select 25 winning individuals, the probability of each individual being selected is proportional to its fitness value, the higher the fitness value, the greater the sector on the roulette wheel, thus having a higher probability of being selected, but the lower fitness value individual still has a certain selection opportunity to maintain the diversity of the population and prevent premature convergence to local optimal solution, this probability selection mechanism embodies the evolution pressure of survival of the fittest and retains the possibility of exploring new solution space.
[0108] The selected 25 winning individuals are crossed to generate offspring individuals, and the winning individuals are randomly paired for single-point crossover. For example, the first winning individual is paired with the second winning individual, and a crossover point is randomly selected as the 15th scheduling unit position. The first 15 scheduling units of the first winning individual are combined with the last 15 scheduling units of the second winning individual to generate a first offspring individual, and the first 15 scheduling units of the second winning individual are combined with the last 15 scheduling units of the first winning individual to generate a second offspring individual. This crossover operation can recombine excellent gene fragments of different individuals to generate new individuals that may be better. After pairing and crossing all 25 winning individuals, 50 offspring individuals are generated. Mutation operation is performed on the offspring individuals, and the mutation probability is set to 0.1, i.e., each parameter of each scheduling unit has a 10% probability of random mutation. For example, the type of the 8th scheduling unit of the first offspring individual is originally 4, the selection state is 1, the start time is 18.5 seconds, and the speed coefficient is 0.96. The mutation operation randomly changes the type to 7, keeps the selection state as 1, adjusts the start time to 18.8 seconds, and adjusts the speed coefficient to 1.03. The mutation operation introduces random disturbance to avoid the population falling into local optimum and explore new solution space regions. The initial population of 50 individuals is completely replaced by the newly generated 50 offspring individuals, and the above iterative evolution process is repeated. After the first iteration, the optimal individual in the population improves from an adaptability value of 0.631 to 0.647, and the average adaptability value improves from 0.541 to 0.558. After the 10th iteration, the optimal adaptability value is 0.712, and the average adaptability value is 0.631. After the 50th iteration, the optimal adaptability value is 0.823, and the average adaptability value is 0.746. After the 100th iteration, the optimal adaptability value is 0.891, and the average adaptability value is 0.822. After the 140th iteration, the optimal adaptability value is 0.927, and the average adaptability value is 0.871. After the 150th iteration, the optimal adaptability value is 0.931, and the average adaptability value is 0.875. Compared with the optimal adaptability value of 0.930 in the 149th generation, the optimal adaptability value only improves by 0.001, with an improvement of 0.1%, which is lower than the set convergence threshold of 0.2%, and meets the convergence condition to stop iteration.The individual with the highest fitness value in the 150th generation population is selected as the final choreography scheme, and the individual has a fitness value of 0.931, and contains 23 effective arrangement units with a selected state of 1, which are type 3 starting time 0.5 seconds, speed coefficient 1.02, type 1 starting time 4.2 seconds, speed coefficient 0.97, type 5 starting time 7.8 seconds, speed coefficient 0.91, type 2 starting time 11.3 seconds, speed coefficient 1.05, type 7 starting time 15.6 seconds, speed coefficient 0.94, type 4 starting time 19.8 seconds, speed coefficient 1.08, type 9 starting time 24.7 seconds, speed coefficient 0.89, type 6 starting time 28.4 seconds, speed coefficient 1.01, type 10 starting time 32.9 seconds, speed coefficient 0.96, type 8 starting time 37.2 seconds, speed coefficient 1.12, type 3 starting time 42.1 seconds, speed coefficient 0.98, type 5 starting time 46.5 seconds, speed coefficient 0.93, type 1 starting time 50.2 seconds, speed coefficient 1.04, type 7 starting time 54.8 seconds, speed coefficient 0.88, type 2 starting time 58.6 seconds, speed coefficient 1.07, type 4 starting time 63.2 seconds, speed coefficient 0.95, type 6 starting time 68.1 seconds, speed coefficient 1.03, type 9 starting time 72.8 seconds, speed coefficient 0.92, type 10 starting time 76.4 seconds, speed coefficient 0.99, type 8 starting time 80.9 seconds, speed coefficient 1.11, type 5 starting time 85.8 seconds, speed coefficient 0.86, type 3 starting time 89.7 seconds, speed coefficient 1.06, type 1 starting time 94.3 seconds, speed coefficient 0.94, and the final choreography scheme is determined.
[0109] Further, the method for calculating the fitness value of each choreography scheme comprises:
[0110] obtaining the first choreography scheme, wherein the first choreography scheme contains the first arrangement unit; calculating the average beat deviation of the first choreography scheme, comparing the average beat deviation with the preset beat deviation threshold, and determining whether the first choreography scheme satisfies the beat fitting constraint condition;
[0111] when the first choreography scheme satisfies the beat fitting constraint condition, calculating the fluency value of the first choreography scheme, and taking the fluency value as the fitness value of the first choreography scheme;
[0112] when the first choreography scheme does not satisfy the beat fitting constraint condition, calculating the beat deviation of the first choreography scheme, comparing the beat deviation with the preset beat deviation threshold, and determining whether the first choreography scheme satisfies the beat fitting constraint condition; When a choreography scheme does not satisfy the beat fitting constraint condition, the fitness value of the first choreography scheme is set to zero.
[0113] Exemplarily, in the process of calculating the fitness value of each choreography scheme, it is first needed to judge whether the scheme satisfies the beat fitting constraint condition, and only the scheme satisfying the constraint condition calculates its fluency value as the fitness value, and the scheme not satisfying the constraint condition directly sets the fitness value to zero so as to be eliminated in the selection process. Taking the 15th individual in the first iteration as an example for detailed description, the individual contains 30 choreography units, and the selected state of 26 choreography units is 1. The starting time of the 26 selected units is obtained one by one, the starting time of the first selected unit is 0.8 seconds, the starting time of the second selected unit is 4.6 seconds, the starting time of the third selected unit is 8.9 seconds, the starting time of the fourth selected unit is 13.2 seconds, the starting time of the fifth selected unit is 17.5 seconds, and the starting time of the 26th selected unit is 118.3 seconds. The absolute value of the time difference between the starting time 0.8 seconds of the first selected unit and the 96 music beat time is calculated, the difference between the first beat time 0.5 seconds is 0.3 seconds, the difference between the second beat time 1.75 seconds is 0.95 seconds, the difference between the third beat time 3.0 seconds is 2.2 seconds, and the minimum value 0.3 seconds among all the differences is selected as the time deviation of the first selected unit. The time difference between the starting time 4.6 seconds of the second selected unit and each beat time is calculated, the difference between the fourth beat time 4.25 seconds is 0.35 seconds, and the difference between the fifth beat time 5.5 seconds is 0.9 seconds, and the minimum value 0.35 seconds is selected as the time deviation of the unit. The time deviations of all 26 selected units are calculated in turn, and the deviation values obtained in turn are 0.3 seconds, 0.35 seconds, 0.4 seconds, 0.45 seconds, 0.25 seconds, 0.5 seconds, 0.55 seconds, 0.38 seconds, 0.42 seconds, 0.48 seconds, 0.33 seconds, 0.52 seconds, 0.37 seconds, 0.44 seconds, 0.51 seconds, 0.29 seconds, 0.46 seconds, 0.39 seconds, 0.41 seconds, 0.36 seconds, 0.47 seconds, 0.34 seconds, 0.43 seconds, 0.49 seconds, 0.32 seconds, 0.53 seconds. The sum of the 26 time deviation values is 10.4 seconds, and the average beat deviation is 0.4 seconds.
[0114] The calculated average beat deviation of 0.4 seconds was compared with a preset beat deviation threshold of 0.35 seconds. Setting 0.35 seconds as the beat deviation threshold is based on the fact that human hearing has a time tolerance window for rhythmic synchronicity. When the time deviation between visual and auditory events is within approximately 0.3 seconds, the brain perceives them as occurring synchronously, thus creating a sense of rhythmic harmony. When the time deviation exceeds 0.35 seconds, the brain begins to clearly perceive asynchrony, reducing the sense of rhythm and aesthetic appeal. Therefore, using 0.35 seconds as the judgment threshold effectively filters out dance choreography schemes with good beat harmony. Furthermore, considering that not all choreography units must strictly fall on the beat, allowing an average deviation within 0.35 seconds means that some choreography units can have slightly larger deviations as long as the overall average remains within an acceptable range. This design ensures both rhythmic harmony and provides a degree of flexibility to the choreography scheme. The average beat deviation of the 15th individual is 0.4 seconds, which is greater than the threshold of 0.35 seconds. Therefore, this individual is determined not to meet the beat-fit constraint, and its fitness value is directly set to 0. In subsequent roulette wheel selection processes, this individual has an extremely low probability of being selected due to its zero fitness value, and is thus naturally eliminated. Taking the 3rd individual in the 1st iteration as an example to illustrate the constraint-compliant situation, this individual contains 24 selected units. The time deviations of these 24 selected units are calculated sequentially, and the average beat deviation is 0.28 seconds, which is less than the preset threshold of 0.35 seconds. Therefore, this individual is determined to meet the beat-fit constraint, and its fluency value is calculated as its fitness value. Calculating the smoothness value requires evaluating the smoothness and compactness of motion transitions between adjacent choreography units. For the first and second selected units of the third individual, the first selected unit is of type 2 (peacock spread wings), and the second selected unit is of type 4 (single-leg raise and rotate). The trailing motion vectors of the 12 motion nodes of the second basic motion element (peacock spread wings) and the starting motion vectors of the 12 motion nodes of the fourth basic motion element (single-leg raise and rotate) are obtained. The vector angles between the 12 corresponding nodes are calculated and averaged, yielding an average vector angle of 52 degrees. The transition duration from the second to the fourth basic motion element is found to be 1.18 seconds, according to the transition motion element library. The average vector angles and transition durations between all 23 pairs of adjacent choreography units are calculated sequentially. Using these data, the smoothness value is calculated and used as the fitness value for the individual, which is 0.631.
[0115] Furthermore, the calculation of the first The average beat deviation of each dance choreography scheme is compared with a preset beat deviation threshold to determine the... Methods for determining whether a dance choreography scheme meets the beat fit constraint include:
[0116] Get the The first dance choreography scheme Unit selection status of each arrangement unit and the start time of the unit ,in The value ranges from 1 to Integer variables;
[0117] Regarding the unit selection status For an arrangement unit with a value of 1, calculate the start time of that unit. With the pre-selected music beat time sequence Each beat moment The absolute value of the time difference is selected, and the minimum value among all absolute values of time differences is taken as the first. The first dance choreography scheme Time deviation of each arrangement unit for:
[0118] ;
[0119] in The value ranges from 1 to Integer variables, The total number of beat moments; Represents the first in the pre-selected music beat time sequence Each beat moment;
[0120] Calculate the first The number of choreography units with a state of 1 in each dance choreography scheme. The time deviation of the orchestration unit with state 1 is selected for all units. Calculate the average value to obtain the first... Average beat deviation of each dance choreography scheme for:
[0121] ;
[0122] The average beat deviation Compare with a preset beat deviation threshold to determine the first... Does the dance choreography scheme meet the beat matching constraint?
[0123] Exemplarily, a detailed calculation process of average beat deviation is illustrated for the third individual in the first generation iteration, which contains 30 scheduling units, of which 24 scheduling units have a unit selection state of 1. The unit selection state and unit start time of the 24 selected units are obtained one by one. The selection state of the first scheduling unit is 1, and the start time is 0.5 seconds. The selection state of the second scheduling unit is 0, and the start time is 3.8 seconds. The selection state of the third scheduling unit is 1, and the start time is 4.3 seconds. The selection state of the fourth scheduling unit is 1, and the start time is 7.9 seconds. The selection state of the fifth scheduling unit is 1, and the start time is 11.2 seconds. And so on. Since the selection state of the second scheduling unit is 0, the unit does not participate in subsequent calculations, and only the 24 units with a selection state of 1 are analyzed for beat deviation. For the first selected unit with a start time of 0.5 seconds, the absolute value of the time difference between it and the 96 music beat times is calculated one by one. The difference between 0.5 seconds and the first beat time is 0 seconds. The difference between 1.75 seconds and the second beat time is 1.25 seconds. The difference between 3.0 seconds and the third beat time is 2.5 seconds. The difference between 4.25 seconds and the fourth beat time is 3.75 seconds. As the beat number increases, the time difference continues to increase. When the 96th beat time 119.5 seconds is calculated, the difference is 119 seconds. The minimum value 0 seconds is selected as the time deviation of the first selected unit, and the start time of the unit coincides exactly with the first music beat. The minimum time difference is selected instead of finding the nearest beat because in dance choreography, each movement transition point only needs to be aligned with a nearby beat time to produce a sense of rhythm, and does not require a fixed relationship with all beat times. Therefore, by traversing all beat times, the beat point closest to the start time of the movement is found, and the time difference between the two represents the beat deviation of the movement transition. The smaller the difference, the closer the movement transition to the beat, and the stronger the sense of rhythm. The larger the difference, the movement transition point falls between two beats, and the lack of rhythm anchor.
[0124] For the start time 4.3 seconds of the third selected unit, the absolute value of the time difference between the start time and each beat time is calculated. The difference between the start time and the third beat time 3.0 seconds is 1.3 seconds, the difference between the start time and the fourth beat time 4.25 seconds is 0.05 seconds, and the difference between the start time and the fifth beat time 5.5 seconds is 1.2 seconds. The minimum value 0.05 seconds is selected as the time deviation of the unit. For the start time 7.9 seconds of the fourth selected unit, the minimum difference 0.1 seconds between the start time and the seventh beat time 8.0 seconds is selected as the time deviation of the unit. For the start time 11.2 seconds of the fifth selected unit, the minimum value 0.45 seconds is selected from the difference 0.45 seconds between the start time and the ninth beat time 10.75 seconds and the difference 0.8 seconds between the start time and the tenth beat time 12.0 seconds. The time deviations of all 24 selected units are calculated in turn, and the deviation values obtained in turn are 0 seconds, 0.05 seconds, 0.1 seconds, 0.45 seconds, 0.12 seconds, 0.08 seconds, 0.03 seconds, 0.38 seconds, 0.15 seconds, 0.22 seconds, 0.07 seconds, 0.41 seconds, 0.18 seconds, 0.25 seconds, 0.09 seconds, 0.32 seconds, 0.14 seconds, 0.28 seconds, 0.11 seconds, 0.35 seconds, 0.06 seconds, 0.19 seconds, 0.24 seconds, 0.13 seconds. The number of arrangement units with a unit selection state of 1 is 24, and the sum of the 24 time deviation values is 4.8 seconds. The average beat deviation is 0.2 seconds obtained by dividing the sum by 24. The calculated average beat deviation 0.2 seconds is compared with the preset beat deviation threshold 0.35 seconds, and 0.2 seconds is less than 0.35 seconds. It is determined that the third individual satisfies the beat fitting constraint condition, and the individual passes the beat screening calculation to obtain the flow value.
[0125] Further, the method for calculating the flow value of the third dancing arrangement scheme comprises:
[0126] For the first arrangement unit and the second arrangement unit adjacent to the first arrangement unit in the third dancing arrangement scheme, when the unit selection state of the first arrangement unit and the unit selection state of the second arrangement unit are both 1, the end motion vector of the first motion node of the basic motion element corresponding to the first arrangement unit and the start motion vector of the first motion node of the basic motion element corresponding to the second arrangement unit are obtained, wherein i is an integer variable with a value from 1 to n.
[0127] Calculate the angle between the closing motion vector and the starting motion vector of the j-th motion node. for:
[0128] ;
[0129] The average of the angles between the vectors of all moving nodes is taken as the first... The first dance choreography scheme The first arrangement unit and the first The average vector angle between each arrangement unit for:
[0130] ;
[0131] According to the The basic action meta-index corresponding to the first arrangement unit and the first The basic action meta-index corresponding to each orchestration unit is used to query the corresponding connection duration from the connection action meta-database as the first... The first dance choreography scheme The first arrangement unit and the first Duration of connection between each orchestration unit ;
[0132] Through the average vector angle and the duration of the connection Calculate the first The smoothness of each dance choreography scheme for:
[0133] .
[0134] Exemplarily, the fluency value of the 3rd individual satisfying the beat matching constraint condition is calculated as the fitness value, the individual contains 24 selected units. For the adjacent 1st and 2nd selected units, the unit selection state of the 1st selected unit is 1, the type is 3 corresponding to water wave hand, the unit selection state of the 2nd selected unit is 1, the type is 1 corresponding to three bends. The end motion vector of the 12 motion nodes of the 3rd basic motion element water wave hand and the start motion vector of the 12 motion nodes of the 1st basic motion element three bends are obtained. Taking the left wrist joint as an example, the end motion vector of the left wrist joint of the 3rd basic motion element is 9.09 cm / s horizontally, 21.21 cm / s vertically and 12.12 cm / s vertically, and the start motion vector of the left wrist joint of the 1st basic motion element is 3.72 cm / s horizontally, 3.10 cm / s vertically and 2.17 cm / s vertically. The vector angle between the two motion vectors is calculated, first the dot product of the two vectors is calculated as 192.53, the length of the end motion vector of the 3rd basic motion element is 25.05, the length of the start motion vector of the 1st basic motion element is 5.71, and the dot product divided by the product of the two lengths gives the cosine value of the angle as 0.7476, and the angle is calculated by the inverse cosine function to be 41.6 degrees. The vector angle reflects the degree of deviation between the motion direction of the limb at the end of the previous action and the motion direction of the limb at the beginning of the next action. When the angle is 0 degree, the two directions are completely consistent, which means that the limb can be seamlessly connected to the next action without changing the original motion direction, in this case the kinetic energy of the limb is maximally preserved and utilized to produce the ultimate fluency. When the angle is 90 degrees, the two directions are orthogonal, which means that the motion direction needs to be completely changed, and the limb must consume energy to convert the kinetic energy of the original direction into the kinetic energy of the new direction. This turning will produce obvious pause and unsmoothness. When the angle is 180 degrees, the two directions are completely opposite, which means that the motion direction needs to be reversed, which is the most unsmooth situation that needs to first offset the original kinetic energy and then establish the reverse kinetic energy. Therefore, the smaller the vector angle, the more fluent the action connection, the larger the angle, the less fluent, and in the fluency value calculation, the connection with larger angle needs to be punished.
[0135] The vector angles of 12 motion nodes of the left wrist joint, the right wrist joint, the left shoulder joint, the right shoulder joint, the left elbow joint, the right elbow joint, the left hip joint, the right hip joint, the left knee joint, the right knee joint, the left ankle joint and the right ankle joint are calculated in sequence, and the obtained angle values are 41.6 degrees, 39.8 degrees, 28.3 degrees, 27.5 degrees, 35.7 degrees, 34.2 degrees, 18.9 degrees, 19.3 degrees, 22.6 degrees, 23.1 degrees, 15.4 degrees and 16.2 degrees respectively. The sum of the 12 vector angles is 322.6 degrees, and the average vector angle is 26.9 degrees. According to the basic action element index 3 corresponding to the first selected unit and the basic action element index 1 corresponding to the second selected unit, the corresponding transition duration is queried from the transition action element library, and the transition duration from the third basic action element to the first basic action element is found to be 0.44 seconds. For the adjacent second selected unit and the third selected unit, the second selected unit type is 1 corresponding to three bends, and the third selected unit type is 5 corresponding to double-hand prayer squat, the average vector angle of 12 motion nodes is calculated and the average value is 32.5 degrees, and the transition duration is queried to be 0.26 seconds. The average vector angles and transition durations between all 23 pairs of adjacent selected units are calculated in sequence, and the obtained average vector angles are 26.9 degrees, 32.5 degrees, 41.3 degrees, 29.7 degrees, 35.8 degrees, 38.4 degrees, 27.6 degrees, 33.2 degrees, 30.1 degrees, 36.7 degrees, 28.8 degrees, 34.5 degrees, 31.9 degrees, 37.2 degrees, 29.3 degrees, 33.8 degrees, 32.6 degrees, 35.1 degrees, 28.4 degrees, 34.9 degrees, 31.5 degrees, 36.3 degrees and 30.7 degrees respectively, and the corresponding transition durations are 0.44 seconds, 0.26 seconds, 0.86 seconds, 0.37 seconds, 0.94 seconds, 1.05 seconds, 0.44 seconds, 0.73 seconds, 0.52 seconds, 0.81 seconds, 0.44 seconds, 0.67 seconds, 0.52 seconds, 0.89 seconds, 0.37 seconds, 0.73 seconds, 0.52 seconds, 0.78 seconds, 0.44 seconds, 0.78 seconds, 0.52 seconds, 0.81 seconds and 0.44 seconds respectively.
[0136] The fluency value is calculated by the average vector angle and the duration of the transition. First, the fluency contribution value of each pair of adjacent units is calculated. For the first pair of adjacent units, 180 degrees minus the average vector angle 26.9 degrees is 153.1 degrees, which represents the degree of consistency. The smaller the angle, the closer the value to 180 degrees, indicating the more consistent direction. Multiply 153.1 degrees by the duration of the transition 0.44 seconds to get 67.4. The product represents the fluency contribution under the weight of the transition duration. The shorter the transition duration, the smaller the impact of the pair on the overall fluency. The longer the transition duration, the greater the impact. The fluency contribution values of the 23 pairs of adjacent units are calculated in turn as 67.4, 38.4, 119.3, 55.6, 135.1, 148.7, 67.1, 107.2, 78.0, 116.2, 66.5, 97.3, 77.0, 127.3, 55.7, 106.6, 76.9, 113.0, 66.9, 113.1, 77.3, 116.4, 65.7. The sum of these 23 values is 1993.7. The denominator part is calculated by multiplying 180 degrees by the sum of all 23 transition durations, which is 14.1 seconds. Multiply 180 degrees by 14.1 seconds to get 2538. The fluency value is equal to the numerator 1993.7 divided by the denominator 2538, which is 0.786. The numerator part converts the angle into consistency score by subtracting the angle from 180 degrees. An angle of 0 degrees corresponds to a full score of 180 degrees, and an angle of 180 degrees corresponds to a minimum score of 0 degrees. Multiplying by the transition duration reflects the contribution weight of different transitions to overall fluency. Long transitions have a large weight because inconsistent directions can seriously affect fluency. Short transitions have a small weight because even if the direction deviation is large, the impact is limited due to the short duration. The denominator part is the theoretical maximum value, which is the case where all transitions are completely consistent at 180 degrees. Normalizing the actual score by dividing it by the theoretical maximum value makes the fluency value range between 0 and 1, making it easier to compare and evaluate. The calculated fluency value 0.786 is used as the fitness value of the third individual. The fluency values of other individuals that meet the beat constraint are calculated in the same way. The fluency value of the first individual is 0.742, the fluency value of the fifth individual is 0.813, the fluency value of the eighth individual is 0.691, and the fluency value of the twelfth individual is 0.768. After 150 generations of iterative evolution, the final dance arrangement scheme has a fluency value of 0.931, which achieves high fluency in motion transition while ensuring beat consistency. The entire process of dance arrangement generation based on genetic algorithm is completed.
[0137] Example 2: Based on the same inventive concept, as Figure 2 shown, the present embodiment also provides an AI-based dance arrangement generation device, which comprises:
[0138] The first library establishing unit is configured to establish a basic action element library, establish a three-dimensional coordinate system with the waist as a coordinate origin, set limbs joints as motion nodes, and record spatial coordinate motion trajectories of each motion node in each basic action element relative to the coordinate origin; obtain starting coordinates and starting motion vectors of each motion node of each basic action element at a starting moment, and ending coordinates and ending motion vectors of each motion node at an ending moment through the spatial coordinate motion trajectories;
[0139] The second library establishing unit is configured to establish a transition action element library, generate a transition action element through a straight line motion trajectory of each motion node between the ending coordinates of the first basic action element and the starting coordinates of the second basic action element, and record a spatial motion trajectory and a transition duration of the transition action element; obtain a beat time sequence of preselected music, and take the beat time sequence as a time reference point for action element transformation.
[0140] The AI algorithm unit is configured to generate an initial population of dance choreography schemes, the initial population including a plurality of individuals, each individual representing a dance choreography scheme, each dance choreography scheme being composed of a plurality of choreography units in chronological order, each choreography unit including a unit type, a unit selection state, a unit starting time, and a unit speed adjustment coefficient, wherein the unit type is used to mark a basic action element corresponding to the choreography unit, the unit selection state takes a value of 0 or 1, the unit starting time represents a starting time point of the choreography unit in the dance choreography, and the unit speed adjustment coefficient represents a proportion of the choreography unit relative to a standard speed; iteratively evolving the initial population to obtain a final dance choreography scheme, and outputting, in order of the unit starting time, spatial coordinate motion trajectories of basic action elements or transition action elements corresponding to choreography units with a unit selection state of 1 in the final dance choreography scheme and unit speed adjustment coefficients, to generate a complete dance choreography output sequence.
[0141] It should be noted that, as for the device in the above embodiment, the specific manner in which each unit performs an operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
[0142] Embodiment 3: Based on the same inventive concept, the embodiment also provides an AI-based dance choreography generation system, including an action capture device for collecting basic action elements, one or more processors, a memory, and one or more programs, wherein the action capture device includes an acceleration sensor and a gyroscope, the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include a program for executing the AI-based dance choreography generation method.
[0143] Finally, it should be noted that although the application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still make modifications to the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to part of the technical features, and any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the application shall be included in the protection scope of the application.
Claims
1. An AI-based choreography generation method, characterized by, The method comprises: establishing a basic action element library, establishing a three-dimensional space coordinate system with the waist as the coordinate origin, setting the joints of the limbs as motion nodes, and recording the space coordinate motion trajectory of each motion node in each basic action element relative to the coordinate origin; establishing a connection action element library, generating a connection action element through the straight line motion trajectory of each motion node between the end coordinates of the first basic action element and the start coordinates of the second basic action element, recording the space motion trajectory and connection duration of the connection action element, and obtaining the beat time sequence of the preselected music, taking the beat time sequence as the time reference point of the action element transformation; generating an initial population of dance arrangement schemes, the initial population comprising multiple individuals, each individual representing a dance arrangement scheme, each dance arrangement scheme being composed of multiple arrangement units in chronological order, each arrangement unit comprising a unit type, a unit selection state, a unit start time, and a unit speed adjustment coefficient, wherein the unit type is used to mark the basic action element corresponding to the arrangement unit, the unit selection state takes a value of 0 or 1, the unit start time represents the starting time point of the arrangement unit in the dance arrangement, and the unit speed adjustment coefficient represents the proportion of the arrangement unit relative to the standard speed; iteratively evolving the initial population to obtain a final dance arrangement scheme, outputting the space coordinate motion trajectory and the unit speed adjustment coefficient of the basic action element or the connection action element corresponding to each arrangement unit in the arrangement unit with a unit selection state of 1 in the final dance arrangement scheme in the order of the unit start time, and generating a complete dance arrangement output sequence; the method for iteratively evolving the initial population to obtain the final dance arrangement scheme comprises: the step of iteratively evolving comprises calculating the fitness value of each dance arrangement scheme, the fitness value being calculated according to the time deviation of the unit start time of the arrangement unit from the beat time of the preselected music, the vector angle between the end motion vector of the previous arrangement unit and the start motion vector of the next arrangement unit between adjacent arrangement units, and the connection duration of the connection action element between adjacent arrangement units; sorting the dance arrangement schemes according to the fitness values and selecting a preset number of winning individuals through the roulette selection method, obtaining offspring individuals through crossover and mutation of the winning individuals, replacing the initial population with the offspring individuals and repeating the iterative evolution process until the fitness value improvement amplitude of the offspring individuals and the parent individuals is lower than a set convergence threshold, and taking the optimal individual after the iterative evolution as the final dance arrangement scheme; the method for calculating the fitness value of each dance arrangement scheme comprises: Obtaining a first choreography scheme, the first choreography scheme comprising a choreography unit; calculating an average beat deviation of the first choreography scheme, comparing the average beat deviation with a preset beat deviation threshold, and determining whether the first choreography scheme meets a beat fitting constraint condition; When the When a dance choreography scheme satisfies the beat fit constraint, calculate the smoothness value of the h-th dance choreography scheme, and use the smoothness value as the h-th dance choreography scheme. The fitness value of a dance choreography scheme; When the first When a dance choreography scheme does not meet the aforementioned beat-matching constraint, the first... The fitness value of each dance choreography scheme is set to zero. 2.The AI-based choreography generation method of claim 1, wherein, establishing a three-dimensional space coordinate system with the waist as the coordinate origin, setting the joints of the limbs as motion nodes, and recording the space coordinate motion trajectory of each motion node in each basic action element relative to the coordinate origin; The method for obtaining the starting coordinates and starting motion vectors of each motion node at the starting moment and the ending coordinates and ending motion vectors of each motion node at the ending moment of each basic action element through the spatial coordinate motion trajectory comprises: Get the Duration of movement of each basic movement element During the duration of exercise Internal to the first Each motion node of a basic motion element is sampled at equal time intervals, and the duration of the motion is recorded. Evenly divided into There are 1 sampling time points, among which The total number of preset sampling time points; the first Each sampling time point The calculation method is as follows: ; wherein is an integer variable having a value from 1 to is an integer variable having a value from 1 to Recorded using motion capture equipment The first basic action element The motion node at the _th ... Each sampling time point spatial coordinates ,in The value ranges from 1 to Integer variables, This represents the total number of moving nodes; No. The first basic action element The initial coordinates of each moving node at the start time are the spatial coordinates corresponding to the first sampling time point. The final coordinate at the closing moment is the first... Spatial coordinates corresponding to each sampling time point ; No. The first basic action element The initial motion vector of each moving node at the initial time. The value is calculated by the ratio of the coordinate difference between the first two sampling time points to the time interval, and is: ; No. The first basic action element The closing motion vector of each motion node at the closing moment The value is calculated by the ratio of the coordinate difference between the last two sampling time points to the time interval, and is: 。 3.The AI-based choreography generation method of claim 1, wherein, The method for generating the transition action element through the straight-line motion trajectory of each motion node between the ending coordinates of the first basic action element and the starting coordinates of the second basic action element, recording the spatial motion trajectory and the transition duration of the transition action element comprises: acquiring a final coordinate of a first motion node of a first base motion element at a final time and a final coordinate of a second motion node of a second base motion element at the final time and a final coordinate of a first motion node of a first base motion element at a final time and a final coordinate of a second motion node of a second base motion element at the final time and a final coordinate of a first motion node of a first base motion element at a final time and a final coordinate of a second motion node of a second base motion element at the final time The straight line movement distance of the movement node between the first basic action element and the second basic action element is calculated as follows: ; determining a maximum straight-line motion distance from straight-line motion distances of all motion nodes is: ; By the maximum straight line movement distance The ratio of the preset movement speed The duration of the transition from the first to the second basic movement element : ; Record from the first The basic action element to the first The spatial motion trajectory of the connecting elements of the basic motion elements, the first The spatial motion trajectory of each motion node in the motion progress parameter spatial coordinates below for: ; wherein the motion progress parameter has a value of 0 or 1, denotes an end coordinate of the th base motion element, denotes a start coordinate of the th base motion element. 4.The AI-based choreography generation method of claim 1, wherein, The method comprises the following steps: calculating an average beat deviation of a first dance arrangement scheme, comparing the average beat deviation with a preset beat deviation threshold, and determining whether the first dance arrangement scheme meets a beat fitting constraint condition. The method for determining whether the first dance arrangement scheme meets the beat fitting constraint condition comprises the following steps: calculating a beat deviation of a second dance arrangement scheme, comparing the beat deviation with a preset beat deviation threshold, and determining whether the second dance arrangement scheme meets the beat fitting constraint condition. The method for determining whether the first dance arrangement scheme meets the beat fitting constraint condition comprises the following steps: calculating a beat deviation of a second dance arrangement scheme, comparing the beat deviation with a preset beat acquiring a cell selection state of a first choreography unit of a first choreography scheme of a second dance choreography scheme wherein Regarding the unit selection status For an arrangement unit with a value of 1, calculate the start time of that unit. With the pre-selected music beat time sequence Each beat moment The absolute value of the time difference is selected, and the minimum value among all absolute values of time differences is taken as the first. The first dance choreography scheme Time deviation of each arrangement unit for: ; wherein is an integer variable taking values from 1 to is an integer variable taking values from 1 to is the total number of beat times; The number of arrangement units with the unit selection state of 1 in the i-th dance arrangement scheme The time deviation of all arrangement units with the unit selection state of 1 The average beat deviation of the i-th dance arrangement scheme is obtained by averaging the time deviations of all arrangement units with the unit selection state of 1 The average beat deviation of the i-th dance arrangement scheme is obtained by averaging the time deviations of all arrangement units with the unit selection state of 1 is: ; The average beat deviation Compare with a preset beat deviation threshold to determine the first... Does the dance choreography scheme meet the beat matching constraint? 5.The AI-based choreography generation method of claim 4, wherein, The calculation of the first Methods for calculating the smoothness value of a dance choreography scheme include: For the first The adjacent dance choreography scheme The first arrangement unit and the first The first arrangement unit, when the first... Unit selection status of each arrangement unit and the Unit selection status of each arrangement unit When both are 1, obtain the first... The first basic motion element corresponding to the first arrangement unit The tail motion vector of each motion node and the The first basic motion element corresponding to the first arrangement unit The initial motion vector of each motion node ,in The value ranges from 1 to Integer variables; calculating a vector angle between the end motion vector and the start motion vector of the jth motion node is: ; The average of the vector angles of all motion nodes is taken as the average vector angle between the first choreography scheme and the first choreography unit and the second choreography unit is: ; According to the The basic action meta-index corresponding to the first arrangement unit and the first The basic action meta-index corresponding to each orchestration unit is used to query the corresponding connection duration from the connection action meta-database as the first... The first dance choreography scheme The first arrangement unit and the first Duration of connection between each orchestration unit ; by the average vector angle and the duration of the link calculating the flow value of the first choreography scheme is: 。 6.An AI-based choreography generation device, characterized by, The device comprises: A first library establishing unit is configured to establish a basic action element library, establish a three-dimensional spatial coordinate system with the waist as a coordinate origin, set the joints of the four limbs as motion nodes, and record the spatial coordinate motion trajectory of each motion node relative to the coordinate origin in each basic action element; and obtain the starting coordinates and starting motion vectors of each motion node at the starting moment and the ending coordinates and ending motion vectors of each motion node at the ending moment of each basic action element through the spatial coordinate motion trajectory; A second library establishing unit is configured to establish a transition action element library, generate a transition action element through the straight-line motion trajectory of each motion node between the ending coordinates of the first basic action element and the starting coordinates of the second basic action element, record the spatial motion trajectory and the transition duration of the transition action element, and obtain a beat time sequence of preselected music, taking the beat time sequence as a time reference point for action element transformation; An AI algorithm unit is configured to generate an initial population of dance choreography schemes, the initial population comprising a plurality of individuals, each individual representing a dance choreography scheme, each dance choreography scheme being composed of a plurality of choreography units in chronological order, each choreography unit containing a unit type, a unit selection state, a unit starting time, and a unit speed adjustment coefficient, wherein the unit type is used to mark the basic action element corresponding to the choreography unit, the unit selection state takes a value of 0 or 1, the unit starting time represents the starting time point of the choreography unit in the dance choreography, and the unit speed adjustment coefficient represents the proportion of the choreography unit relative to the standard speed; the initial population is iteratively evolved to obtain a final dance choreography scheme, and the choreography units with the unit selection state of 1 in the final dance choreography scheme are output in the order of the unit starting time to output the spatial coordinate motion trajectory of the basic action element or the transition action element corresponding to each choreography unit and the unit speed adjustment coefficient, generating a complete dance choreography output sequence; The method for iteratively evolving the initial population to obtain the final dance choreography scheme comprises: The step of iterative evolution comprises calculating an adaptability value of each dance choreography scheme, the adaptability value being calculated according to the time deviation of the unit starting time of the choreography unit from the beat time of the preselected music, the vector angle between the ending motion vector of the previous choreography unit and the starting motion vector of the next choreography unit between adjacent choreography units, and the transition duration of the transition action element between adjacent choreography units; The choreography schemes are ranked according to the fitness values, and a preset number of winning individuals are selected by a roulette wheel selection method, the winning individuals are crossed and mutated to obtain offspring individuals; the initial population is replaced by the offspring individuals, and the iterative evolution process is repeated until the fitness value improvement range of the offspring individuals and the parent individuals is lower than a set convergence threshold; and the optimal individual after the iterative evolution is completed is taken as a final choreography scheme; The method for calculating the fitness value of each choreography scheme comprises: Obtaining a first choreography scheme, the first choreography scheme comprising a choreography unit; calculating an average beat deviation of the first choreography scheme, comparing the average beat deviation with a preset beat deviation threshold, and determining whether the first choreography scheme meets a beat fitting constraint condition; When the When a dance choreography scheme satisfies the beat fit constraint, calculate the smoothness value of the h-th dance choreography scheme, and use the smoothness value as the h-th dance choreography scheme. The fitness value of a dance choreography scheme; When the first When a dance choreography scheme does not meet the aforementioned beat-matching constraint, the first... The fitness value of each dance choreography scheme is set to zero.
7. An AI-based choreography generation system, characterized by, The action capture device includes an acceleration sensor and a gyroscope, the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a program for executing the AI-based choreography generation method according to any one of claims 1-5.
Citation Information
Patent Citations
Multi-modal dance action evaluation method
CN110711374A
Dance motion auxiliary generation method and system based on three-dimensional modeling
CN120765860A