Summary of the invention
In order to solve above-mentioned technical matters, a kind of implementation method and system of human chain structure model are provided, its purpose is, from that lose or wrong three-dimensional feature point exercise data sequence, correctly obtains being suitable for carrying out the human chain structure model of motion tracking easily.
The invention provides a kind of implementation method of human chain structure model, comprising:
Step 1, the key frame sequence of the three-dimensional feature point sequence of extraction human motion;
Step 2, according to the candidate combinations that definitely obtains human chain structure model towards algorithm and rigid body distance restraint, the user selects the human chain structure model of correct foundation from candidate combinations.
Step 1 comprises:
Step 11 is set the corresponding three-dimensional unique point to number initial threshold and key frame candidate sequence length of interval;
Step 12, occurring comprising at least the frame that all three-dimensional features count out in the selected original motion sequence for the first time is key frame candidate sequence first frame;
Step 13, frame in the calculating original motion sequence after current key frame and the corresponding three-dimensional unique point between the current key frame are to number;
Step 14 to the number initial threshold, is added frame in the original motion sequence that satisfies this number initial threshold according to the corresponding three-dimensional unique point of setting in the key frame candidate sequence, obtains the key frame candidate sequence;
Whether step 15 drops on according to the length of key frame candidate sequence in the key frame candidate sequence length of interval of setting and adjusts the corresponding three-dimensional unique point to number initial threshold and key frame candidate sequence length of interval;
Step 16, the reference frame in the selected key frame candidate sequence of user keeps reference frame and reference frame key frame afterwards as the key frame sequence.
In the step 13, the similar matrix between frame in the structure original motion sequence after current key frame and the current key frame between three-dimensional feature point obtains the right number of corresponding three-dimensional unique point by similar matrix.
In the step 15,, then adopt dichotomy to adjust the right number threshold value of corresponding three-dimensional unique point adaptively if the length of the key frame candidate sequence that obtains does not drop in the key frame candidate sequence length of interval.
In the step 16, the user selects all correctly to comprise the key frame of all unique points as reference frame in the key frame candidate sequence.
Step 2 comprises:
Step 21 adopts and definitely sets up 4 rigid body chain structure models of human body towards algorithm and rigid body distance restraint interactive mode;
Step 22 adopts and definitely sets up 3 rigid body chain structure models of human body towards algorithm and rigid body distance restraint interactive mode.
In the step 21, enumerate 4 combinations satisfying the rigid body distance restraint in the reference frame, and with subsequent key frame in satisfy the rigid body distance restraint 4 combinations do definitely towards algorithmic match, thereby the user selects correct matching result to set up 4 rigid body chain structure models of human body.
In the step 22, enumerate 3 combinations satisfying the rigid body distance restraint in the reference frame, and with subsequent key frame in satisfy the rigid body distance restraint 3 combinations do definitely towards algorithmic match, thereby the user selects correct matching result to set up 4 rigid body chain structure models of human body.
The invention provides a kind of implement device of human chain structure model, comprising:
Key frame sequence abstraction module is used to extract the key frame sequence of the three-dimensional feature point sequence of human motion;
Human chain structure model is set up module, is used for according to the candidate combinations that definitely obtains human chain structure model towards algorithm and rigid body distance restraint; From candidate combinations, select the correct human chain structure model of setting up for the user.
Key frame sequence abstraction module is used to set the corresponding three-dimensional unique point to number initial threshold and key frame candidate sequence length of interval; Occurring comprising at least the frame that all three-dimensional features count out in the selected original motion sequence for the first time is key frame candidate sequence first frame; Frame in the calculating original motion sequence after current key frame and the corresponding three-dimensional unique point between the current key frame are to number; To the number initial threshold, add frame in the original motion sequence that satisfies this number initial threshold according to the corresponding three-dimensional unique point of setting in the key frame candidate sequence, obtain the key frame candidate sequence; Whether drop on according to the length of key frame candidate sequence in the key frame candidate sequence length of interval of setting and adjust the corresponding three-dimensional unique point number initial threshold and key frame candidate sequence length of interval; Reference frame in the selected key frame candidate sequence of user keeps reference frame and reference frame key frame afterwards as the key frame sequence.。
Key frame sequence abstraction module, be used for making up the original motion sequence after current key frame frame and current key frame between similar matrix between three-dimensional feature point, obtain the right number of corresponding three-dimensional unique point by similar matrix.
Key frame sequence abstraction module is used for when the length of key frame candidate sequence does not drop on key frame candidate sequence length of interval, adopts dichotomy to adjust the right number threshold value of corresponding three-dimensional unique point adaptively.
Key frame sequence abstraction module is used for selecting the key frame candidate sequence all correctly to comprise the key frame of all unique points as reference frame for the user.
Human chain structure model is set up module, is used for adopting definitely setting up 4 rigid body chain structure models of human body towards algorithm and rigid body distance restraint interactive mode; Adopt and definitely set up 3 rigid body chain structure models of human body towards algorithm and rigid body distance restraint interactive mode.
Human chain structure model is set up module, is used for enumerating 4 combinations that reference frame satisfies the rigid body distance restraint, and with subsequent key frame in satisfy the rigid body distance restraint 4 combinations do definitely towards algorithmic match; Thereby select correct matching result to set up 4 rigid body chain structure models of human body for the user.
Human chain structure model is set up module, is used for enumerating 3 combinations that reference frame satisfies the rigid body distance restraint, and with subsequent key frame in satisfy the rigid body distance restraint 3 combinations do definitely towards algorithmic match; Thereby select correct matching result to set up 4 rigid body chain structure models of human body for the user.
The present invention can set up the model of any chain structure individuality, simplified set up the model process in, also provide good prior model and basis for motion tracking.The method for building up of this chain structure model not only can be applied to each kind of groups, equally also is applicable to the foundation of the chain structure model of animal.Be applicable to any nationality, sex and colony are as sportsman or disabled person.The three-dimensional feature point sequence of given human motion does not need just can access the good organization of human body model of Direct Mark through complicated manually-operated, when having simplified motion tracking, and the initialized work of organization of human body model.Set up good organization of human body model and can be applied directly in the motion tracking, convenient and swift.
Embodiment
Below in conjunction with accompanying drawing, the present invention is described in further detail.
Introduce the specific implementation process of method of the present invention with reference to the accompanying drawings with subordinate list.Fig. 1 is the topological diagram of human body lower limbs chain structure; Fig. 2 a is for determining the process flow diagram of 4 rigid motion models of human body; Fig. 2 b is for determining the process flow diagram of 3 rigid motion models of human body; Fig. 3 is human body lower limbs unique point number and title synoptic diagram; Fig. 4 a is 4 rigid motion models possibilities of human body lower limbs constitutional diagram; Fig. 4 b marks 4 rigid motion illustratons of model of human body lower limbs for the user; Fig. 4 c is 3 rigid motion models possibilities of human body lower limbs constitutional diagram; Fig. 4 d is the correct human body lower limbs motion model figure that sets up; Table 1 is each rigid body of human body lower limbs and unique point relation.
Table 1
The rigid body title |
The unique point that comprises |
Waist |
??LFWT?RFWT?LBWT?RBWT |
Left thigh |
??LFWT?LTHI?LKNE |
Right thigh |
??RFWT?RTHI?RKNE |
Left leg |
??LKNE?LANK?LSHN |
Right leg |
??RKNE?RANK?RSHN |
Left foot |
??LTOE?LMT5?LANK?LHEE |
Right crus of diaphragm |
??RTOE?RMT5?RANK?RHEE |
Before LFWT in the table 1 represents left waist, before RFWT represents right waist, after LBWT represents left waist, after RBWT represented right waist, LTHI represented left thigh, and LKNE represents left knee, RTHI represents right thigh, and RKNE represents right knee, and LANK represents that left ankle LSHN represents left leg, RANK represents right ankle, and RSHN represents right leg, and LTOE represents left thumb, LMT5 represents left little finger of toe, and LHEE represents left heel, and RTOE represents right thumb, RMT5 represents right little finger of toe, and RHEE represents that right crus of diaphragm follows.
Disclosed by the invention is a kind of method for building up of human chain structure model.After obtaining the three-dimensional feature point sequence of individual movement, whole attitude has the frame of notable difference as the key frame sequence in the extraction motion sequence, according to the candidate combinations that definitely provides human chain structure model towards algorithm and rigid body distance restraint (abbreviation distance restraint), the correct human chain structure model of setting up can be selected by end user from these candidate combinations then.When the character pair between two frames is counted out less than preset value (for example 1/3 of the unique point sum), can think that the whole attitude between this two frame has notable difference.Specifically:
1) sets human body chain topological structure
Need to determine the topological structure of human body chain in this step, comprise the number of rigid body in the organization of human body, the number and the title of the unique point that is comprised in each rigid body.The present invention quotes the human body lower limbs structure as an example, and human body lower limbs is divided into waist, left thigh, right thigh, left leg, right leg, left side foot, right foot is totally 7 rigid bodies, the title and the number of the feature that distributes on each rigid body are different, and detailed corresponding situation sees Table 1, and unique point number and title are seen Fig. 3.
2) motion of collection human body obtains its three-dimensional feature point sequence
The related capturing movement technology of this step is based on the Feature Points Matching and the reconfiguration technique of computer vision, and the correlation computations method can be seen reference literature: the mathematical method in the computer vision. Wu Fuchao. and the .2008 of Science Press.But contain point wrong and disappearance in the three-dimensional feature point sequence that obtains.
3) the key frame sequence of the three-dimensional feature point sequence of extraction human motion
31) set character pair point to number initial threshold and key frame candidate sequence length of interval
Because the matching algorithm of point set is by definitely carrying out towards algorithm and distance restraint.Therefore, need in the three-dimensional motion sequence of unique point, obtain whole attitude and those frames of notable difference be arranged as the key frame candidate frame.At first set the two interframe character pairs initial threshold τ that counts out
Init_keyframe, this value should arrive the unique point number that guarantees at least greater than any frame greatly, as 18.The length of interval of setting the key frame sequence is [lnum, unum], generally can round the 15%-20% of a sequence length.
32) frame that occurs comprising at least all unique point numbers in the selected original motion sequence for the first time is key frame candidate sequence first frame
33) calculate in the original motion sequence each frame after current key frame and the corresponding three-dimensional unique point between the current key frame to number
If A frame and B frame can obtain m respectively in the observation sequence, n unique point I
i, i=1 ..., mJ
i, i=1 ..., n sets up the similarity matrix G of two stack features, each element G
IjBe two Gauss's weight distances between the feature:
I=1 ... m, j=1 ..., n, wherein r
Ij=|| I
i-J
j|| be the Euclidean distance of two features.To matrix G do svd (Singular Value Decomposition, the concrete computing method of the SVD document that sees reference: matrix theory. Cheng Yunpeng, Zhang Kai institute, Xu Zhong. the .2006 of publishing house of Northwestern Polytechnical University): G=TDU
T, T ∈ M wherein
m, U ∈ M
n, D ∈ M
M, n, T and U are orthogonal matrixes, D is a diagonal matrix.Conversion D is new matrix E, and the diagonal element of D all replaces with 1, and compute matrix P=TEU
TIf P
IjThe row of matrix P to row to all being maximum, then think two unique point I
iAnd J
jCorresponding relation is arranged.
By setting up the number that so corresponding matrix can obtain the character pair point between two frames.
34) according to the corresponding three-dimensional unique point of setting to the number threshold value, add frame in the original motion sequence that satisfies condition in the key frame candidate sequence
Obtain after each frame after current key frame and the character pair between the current key frame count out, when character pair for the first time occurring and count out less than the unique point of setting to the number threshold value, this moment, corresponding primitive frame was got second frame of doing the key frame candidate sequence.Then this frame is made as the present frame in the key frame candidate sequence, the primitive frame after this frame calculates in each frame and the key frame candidate sequence character pair between the present frame and counts out, and so goes on, and can obtain a key frame candidate sequence.
35) whether drop in the designated length interval according to key frame candidate sequence length and adjust character pair count out threshold value and key frame candidate sequence length of interval
(promptly do not have the reconstruction point of mistake and lose under a little the situation) threshold value is initial threshold τ if two interframe character pairs are counted out in the ideal case
Init_keyframe, as 18 o'clock, the key frame candidate sequence of Sheng Chenging was exactly an original frame sequence so; Threshold value is 0 o'clock if two interframe character pairs are counted out, and the key frame sequence of Sheng Chenging is empty often so, and this is that two interframe have the corresponding point of a pair of unique point at least because always there is adjacent like this frame.
Therefore, want to make the length that obtains the key frame candidate sequence to drop on interval [lnum, unum] and must adjust threshold tau
Init_keyframeSince adjust threshold value and be (0, τ
Init_keyframe) carry out in the interval, and all be the integer adjustment.The dichotomy adjustment is carried out in the interval to get final product.
Still can not obtain the key frame candidate sequence of key frame candidate sequence length in [lnum, unum] if self-adaptation is adjusted threshold value, then the length of interval upper limit increases, and always obtains the key frame candidate sequence of key frame candidate sequence length in [lnum, unum].
36) user interactions is selected can all correctly comprise the frame of human body feature point as reference frame in the key frame candidate sequence.Remove the frame of reference frame front, only keep the key frame candidate frame of reference frame and reference frame back, the sequence after the renewal is exactly the key frame sequence.
4) set up human chain structure model alternately
41) interactive mode is set up 4 rigid body chain structure models of human body
In the gait motion process, satisfy rigid body translation between the unique point of same rigid body, by absolute very little usually towards the error function of algorithm computation.Go to estimate that from two corresponding point are concentrated two rotation, convergent-divergent and translation parameterss between the point set are called definitely towards problem, (Least-squares fitting of two 3-Dpoint sets.K.S.Arun, T.S.Huang and S.D.Blostein.PAMI-8, No.1, Jan.1986) exactly: absolute is exactly for two point set x={x in the given m-dimensional space towards problem
1..., x
nAnd y={y
1..., y
n, find one group of similarity transformation parameter (R: rotation, c: convergent-divergent and t: translation) make that (R, t c) reach minimal value to following this minimum mean-square error function F.
In the gait motion process, the distance between unique point is approximate constant in twos on the same rigid body, and the distance between the unique point in twos that belongs to different rigid bodies has obvious variation usually.
Note D is two corresponding point set x={x
1..., x
nAnd y={y
1..., y
nThe maximum error of line segment distortion, that is:
Wherein, x
iAnd y
iBe the corresponding point of two feature point sets, d (x
i, x
j) and d (y
i, y
j) be respectively point set x, the distance between the unique point in twos among the y.In general, the Δ value is more little, and the reliability of two corresponding point set couplings is high more.
The present invention quotes the human body lower limbs structure as an example.From table 1 and Fig. 3, can see, in each rigid body of human body lower limbs, have only on the waist and pin on rigid body on four points are arranged.Respectively on the waist and pin on point enumerate search.
If enumerate all possible 4 combinations in the reference frame, and with subsequent key frame in all possible 4 combinations do definitely towards algorithmic match, complexity is very high, and most of point may not be the rigid body combination.In order to raise the efficiency, consider that the variation of distance between the point on the same rigid body is little, set the threshold range of a distance, if the distance between some 4 each points of combination can think that then this combination is a candidate combinations within threshold range.Claim that this method for screening is the distance restraint screening.
Enumerate 4 combinations on the waist that satisfies distance restraint in the reference frame, and with subsequent key frame in satisfy distance restraint 4 combinations do definitely towards algorithmic match, the record matching result carries out alternately with the user according to matching result.Can mate most subsequent frame if the reference frame group satisfies 4 combinations of distance restraint, think that then this combination has very big expectation to become 4 combinations on the waist.
Enumerate 4 combinations on the pin that reference frame satisfies distance restraint, do definitely towards algorithmic match the record result with 4 combinations on the pin of subsequent key frame.In this process, because the people has two pin, (preceding four points satisfy the distance restraint of left foot so 8 arrangements of employing reference frame are enumerated, four points in back satisfy the distance restraint of right crus of diaphragm), in subsequent frame, enumerate 8 arrangements (preceding four points satisfy the distance restraint of left foot, and back four points satisfy the distance restraint of right crus of diaphragm) equally.Two 4 combinations of reference frame and two 4 combinations of subsequent key frame are done definitely towards algorithmic match, write down matching result simultaneously.
The combination that obtains at last has a lot, show on the waist 4 with pin on 8 candidate combinations, carry out alternately with the user, the user is the correct array mode of selection from these combinations, and the title of definite these 12 points.
42) interactive mode is set up 3 rigid body chain structure models of human body
Setting up when constituting rigid model by 3, algorithm flow and 4 s' situation is similar.It should be noted that the point that the match is successful when setting up 4 combinations in the subsequent key frame, can delete them fully, from left point, search for 3 combinations, can improve the speed of search finding like this.
Those skilled in the art can also carry out various modifications to above content under the condition that does not break away from the definite the spirit and scope of the present invention of claims.Therefore scope of the present invention is not limited in above explanation, but determine by the scope of claims.