Summary of the invention
Technical matters to be solved by this invention is, can not use drumstick to carry out that real simulated is hit and can not real-time analysis provide the defective of body action information at what exist in the existing virtual drum music project, a kind of computer based drum music action identification method is provided.
The technical solution adopted for the present invention to solve the technical problems is: a kind of computer based drum music action identification method is provided, comprises the steps:
S1) gather the trace point of reflection drum music stroke at difference spatial positional information constantly;
S2), determine the starting point and the end point of stroke according to the state of spatial positional information analysis trace point;
S3) determine to impact track according to described starting point and described end point, judge and to impact direction according to the described track that impacts;
S4) according to standard operation data and criterion thereof, this stroke is judged, and the output result of determination.
In computer based drum music action identification method of the present invention, trace point described in the step S1 comprises two trace points: first trace point is represented the spatial positional information of left hand action, and second trace point represented the spatial positional information of right hand action.
In computer based drum music action identification method of the present invention, the state of trace point described in the step S2 comprises stationary state, mobile status and impacts state, determines the starting point and the end point of described stroke according to the transformation between described three kinds of states.
In computer based drum music action identification method of the present invention, step S2 further comprises: predetermined two identification labels, give described first trace point and described second trace point according to described two the identification labels of the horizontal level relation allocation of described first trace point and described second trace point, to distinguish described first trace point and described second trace point.
In computer based drum music action identification method of the present invention, in described step S2, according to the speed of the current time of the comparative result of distance between the locus of the locus of the current time of described trace point and previous time and predetermined mobile threshold value and described trace point and the comparative result of striking speed threshold value, judge described stationary state, described mobile status and the described transformation that impacts between the state.
In computer based drum music action identification method of the present invention, impacting track described in the step S3 is by the described starting point of state and the space three-dimensional straight line that the described end point that impacts state is determined of impacting, describedly impact that direction is hit under comprising, flank attack and forward play, described flank attack further comprises flank attack to the right and flank attack left.
In computer based drum music action identification method of the present invention, described step S3 comprises the steps:
S31) to described flank attack, hit under described and described forward play is default judges priority, according to the described instantaneous velocity of starting point on three directions in space that impacts state, judge and tentatively impact direction: horizontal direction speed V is only considered in wherein said flank attack
x, hit under described and only consider vertical direction speed V
y, described forward play is only considered forwards to speed V
zIf the speed of three directions has only the speed on the direction to reach the striking speed threshold value, then tentatively impact direction for this reason the speed correspondence impact direction, forward S32 then to, have at least both direction to reach the striking speed threshold value as if the speed on three directions, then tentatively impact direction and be the direction that impacts of speed correspondence that speed reached the priority maximum in the striking speed threshold value, forward S32 then to;
S32) according to the described track that impacts, judge described impact track whether satisfy draw among the S31 tentatively impact direction to impacting the requirement of track, if meet the demands, what then determining step S31 drew tentatively impacts direction for finally impacting direction, does not then forward S33 to if do not meet the demands;
S33) set up four central shafts, the negative axle of the corresponding transverse axis of described flank attack left, the corresponding transverse axis positive axis of described flank attack to the right, hit the negative axle of corresponding vertical axes, the corresponding antero posterior axis positive axis of described forward play under described, calculate the described angle that impacts track and described central shaft, according to standard operation data and criterion thereof, what determine a central shaft representative impacts direction for finally impacting direction.
In computer based drum music action identification method of the present invention, impacting direction described in the step S32 to the requirement that impacts track is, to described each impact direction, to impact the determined space three-dimensional linear projection of track to impacting on two parallel two dimensional surfaces of direction with this, be formed on the projection angle on these two two dimensional surfaces, preestablish the projection angle range that track is allowed that impacts that this impacts direction on these two two dimensional surfaces.
In computer based drum music action identification method of the present invention, a nearly step of described step S32 comprises the steps:
S321) with described impact a space three-dimensional linear projection that track determines to step S31 in draw tentatively impact on two parallel two dimensional surfaces of direction;
S322) calculate projection angle between this coordinate axis that impacts track and these two two dimensional surfaces;
S323) whether the projection angle that calculates of determining step S322 satisfies the projection angle range requirement that tentatively impacts direction and allowed that draws in S31.
In computer based drum music action identification method of the present invention, step S4 further comprises: according to standard operation data and criterion thereof, each stroke is evaluated, evaluation value and the described time of origin spot correlation that impacts the state end point, be directly proportional with the distance of end point with the described state starting point that impacts, be inversely proportional to the mistiming that impacts state starting point and end point, the evaluation value of all stroke accumulative total is obtained the general comment definite value.
Implement technical scheme of the present invention, have following beneficial effect: both can in drum music motion, carry out real simulated and hit, can real-time analysis provide body action information again, more the drum music motion of proper simulating reality
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with drawings and Examples.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
Fig. 1 is the process flow diagram of a kind of computer based drum music action identification method of providing of a preferred embodiment of the present invention, and as shown in Figure 1, details are as follows:
S1) gather the trace point of reflection drum music stroke at difference spatial positional information constantly;
S2), determine the starting point and the end point of stroke according to the state of spatial positional information analysis trace point;
S3) determine to impact track according to described starting point and described end point, judge and to impact direction according to the described track that impacts;
S4) according to standard operation data and criterion thereof, this stroke is judged, and the output result of determination.
In an embodiment of the present invention, gather action data, video frequency pick-up head and terminal computer are coupled together with data line with video frequency pick-up head.
Fig. 2 is the coordinate diagram of a kind of computer based drum music action identification method of providing of a preferred embodiment of the present invention.As shown in Figure 2, the spatial positional information of each trace point that step S1 collects all is expressed as tlv triple (Z), wherein X representative data point position in the horizontal direction, and X value increases expression trace point position and moves to right for X, Y, and the X value reduces to represent that trace point moves to left; Y representative data point is in the position of vertical direction, and the Y value increases on the expression trace point position and move, and the Y value reduces to represent that trace point moves down; Z representative data point is in the position of fore-and-aft direction, and the reach of Z value increase expression data point, and the Z value reduces to represent to move after the data point.Per second is gathered 30 groups of such data to each trace point, therefore utilizes the spatial position data of same trace point in a period of time just can describe out the motion state of trace point.This high-frequency information acquisition can obtain very accurate positional information.
In an embodiment of the present invention, need to use two trace points, first trace point is represented the spatial positional information of left hand drumstick action, and second trace point represented the spatial positional information of right hand drumstick action, and these two points are A point and B point respectively.The spatial position data that A is ordered is (x
A1, y
A1, z
A1), (x
A2, y
A2, z
A2) ..., (x
Ai, y
Ai, z
Ai) ..., (x wherein
Ai, y
Ai, z
Ai) representing at A o'clock in i locus constantly; The spatial position data that B is ordered is (x
B1, y
B1, z
B1), (x
B2, y
B2, z
B2) ..., (x
Bi, y
Bi, z
Bi) ..., (x wherein
Bi, y
Bi, z
Bi) representing at B o'clock in i locus constantly.In an embodiment of the present invention, the same during with processing that B is ordered to the A point.
Drumstick has been arranged at each locus coordinate constantly, can calculate the movable information of drumstick:
I speed formula constantly: the speed on X-axis: v
Ix=(x
i-x
I-1)/t, the speed on Y-axis: v
Iy=(v
i-v
I-1)/t, the speed on the Z axle: v
Iz=(v
i-v
I-1)/t, wherein t=1/30s.
In step S2,, determine the starting point and the end point of stroke according to the state of spatial position data analysis trace point.
In an embodiment of the present invention, the state of trace point comprises stationary state, mobile status and impacts state, determines the starting point and the end point of described stroke according to the transformation between described three kinds of states.
In an embodiment of the present invention, because use two drumsticks, each one of right-hand man, the flank attack of left hand is for to the right, and the flank attack of the right hand is for left.And the spatial information of gathering is the information of two trace points, and can not distinguish certain trace point is the left hand or the right hand, and the right-hand man changes drumstick in player even the way, perhaps occurs the situation of of short duration right and left mutually changing in the recreation.Define two labels in view of the above: each drumstick all has its identification number, 0 or 1, the trace point of two drumsticks of analysis, the horizontal relationship of two trace points of judgement, the left side is decided to be No. 0, identification number when right and left mutually changing takes place, will be readjusted later in a period of time in No. 1, location, the right, the left side is that 0 the right is 1, the promptly feasible label that is positioned at the drumstick on the left side is 0 always, and the label that is positioned at the drumstick on the right is 1 always, so just can solve right-hand man's differentiation problem and interchange issues.
In an embodiment of the present invention, the transformation between the described state comprises:
Static transfer to mobile: the distance between current location and the position when stationary state takes place surpasses predetermined mobile threshold value, then enter mobile status by stationary state, current location is the starting point of mobile status, and current location also is the end point of stationary state simultaneously;
Static transferring to, impact; Speed V on three directions in current location space
x, V
y, V
z, the absolute value of arbitrary speed has surpassed predetermined striking speed threshold value, then enters the state of impacting by stationary state, and current location is the described starting point that impacts state, and current location also is the end point of stationary state simultaneously;
Move transfer to static: the distance between current location and the mobile status starting point position then enters stationary state by mobile status less than predetermined mobile threshold value, and current location is the starting point of stationary state, and the while current location also is the end point of mobile status;
Move to transfer to and impact: the speed V on three directions in current location space
x, V
y, V
z, the absolute value of arbitrary speed has surpassed predetermined striking speed threshold value, then enters the state of impacting by mobile status, and current location is the described starting point that impacts state, and current location also is the end point of mobile status simultaneously;
Impact transfer to static: the speed V on three directions in current location space
x, V
y, V
z, the absolute value of all speed then enters stationary state by the state of impacting less than predetermined static threshold speed, and current location is the starting point of stationary state, and current location also is the described end point that impacts state simultaneously;
Impact transfer to mobile: the speed V on three directions in current location space
x, V
y, V
z, the absolute value of all speed then enters mobile status by the state of impacting less than predetermined translational speed threshold value, and current location is the starting point of mobile status, and current location also is the described end point that impacts state simultaneously.
In an embodiment of the present invention, be provided with three threshold speeds: striking speed threshold value, translational speed threshold value and static threshold speed.The striking speed threshold value is represented the velocity amplitude that the state that impacts is minimum, the translational speed threshold value is represented velocity amplitude minimum under the mobile status, because in fact in stationary state is not static fully, people's hand always has trickle vibration in the unfixed moment, so corresponding stationary state is provided with a static threshold speed.Move in two transformations impacting to transfer to static and impact to transfer to, preferential judge impact change into static, if do not satisfy the static condition that changes into that impacts, judge again impact change into mobile.As static threshold speed is 1, and the translational speed threshold value is 3, so the speed V on three directions in space sometime
x, V
y, V
zAll be to judge so to have entered stationary state less than 1; If the speed V on three directions in space sometime
xBe 2, V
yBe 0.8, V
zBe 0.5, because V
xBe 2 not satisfy and impact the static condition that changes into, judge whether so to satisfy to impact to change mobile state into that this condition satisfies the mobile condition that changes into that impacts, and judges so to have entered mobile status.
Fig. 3 is the state transition diagram when hitting under a kind of computer based drum music action identification method of providing of a preferred embodiment of the present invention.As shown in Figure 3, T axle express time, Y-axis is represented height, the trace point position of stain for constantly collecting, owing to be to hit under judging, in order to obtain more intuitive impression, here only pay close attention to the height change of Y-axis, relate to reality, if carry out the action of hitting under, impact distance in order to increase, usually the hand segment distance that can raise up earlier generally is at the uniform velocity in this process, can quicken straight down suddenly afterwards, finish stroke, arrive to impact and stop after the limit and hand can slowly go up a segment distance to impacting near the preceding equilibrium position point.The trace point positional information of getting in touch the present invention more now and being caught, stain A
1Be mobile starting point, some A
4Promptly be that mobile end point also is to move to change the starting point that impacts into, at A
4On the threshold value of the speed that surpass to be provided with of speed.At stain A
7The time, at this moment having arrived the stroke limit, speed descends to reaching and moves the threshold value of judging, also just indicates the end of a stroke, A
4To A
7Information to lump together be exactly whole all trace informations that hit down action.And stain change in location after this can be seen through having entered stationary state behind the of short duration moving process after speed reaches static threshold speed, has finished the once conversion between three kinds of states.This just once the typical case hit location point simulation of action down, the conversion between three kinds of states is not all to need so desirable the variation yet, fully may from static just directly begin to be converted to impact, equally also can be suddenly static in impacting.
The state of drumstick is being analyzed starting point and the end point that the back obtains stroke, also promptly obtained the starting point and the end point of stroke.Next will judge the direction of stroke in step S3, judge promptly that stroke is hit under being, flank attack or forward play, it is flank attack to the right or flank attack left that flank attack also needs to judge.
In step S3, determine to impact track according to described starting point and described end point, judge and to impact direction according to the described track that impacts.
In an embodiment of the present invention, impact described in the step S3 track serve as reasons the state that impacts starting point and impact the space three-dimensional straight line that the end point of state is determined.
In an embodiment of the present invention, impact described in the step S3 that direction is hit under comprising, flank attack and forward play, described flank attack further comprises left hand flank attack to the right and right hand flank attack left.
In an embodiment of the present invention, described step S3 comprises step S31, step S32 and step S33:
S31) to described flank attack, hit under described and described forward play is default judges priority, according to the described instantaneous velocity of starting point on three directions in space that impacts state, judge and tentatively impact direction: horizontal direction speed V is only considered in wherein said flank attack
x, hit under described and only consider vertical direction speed V
y, described forward play is only considered forwards to speed V
zIf the speed of three directions has only the speed on the direction to reach the striking speed threshold value, then tentatively impact direction for this reason the speed correspondence impact direction, forward S32 then to, have at least both direction to reach the striking speed threshold value as if the speed on three directions, then tentatively impact direction and be the direction that impacts of speed correspondence that speed reached the priority maximum in the striking speed threshold value, forward S32 then to.
In an embodiment of the present invention, step S31 to flank attack, hit down and forward play is default judges priority, as flank attack>hit>forward play down.In one embodiment, has only in the vertical direction speed V in the state starting point of impacting
yReached the threshold value E of speed, judged so under tentatively impacting direction is and hit; In another embodiment, impacting state starting point horizontal direction speed V
xForwards to speed V
zAll reached the threshold value of speed, i.e. flank attack and forward play are all possible, because the priority of flank attack, judges so that flank attack is for tentatively impacting direction greater than the priority of forward play; In another embodiment, impacting state starting point horizontal direction speed V
x, vertical direction speed V
yForwards to speed V
zAll reached the threshold value E of speed, i.e. flank attack, down hit with forward play all possible because the priority maximum of flank attack judges that so flank attack is for tentatively impacting direction.
S32) according to the described track that impacts, judge described impact track whether satisfy draw among the S31 tentatively hit direction to impacting the requirement of track, if meet the demands, what then determining step S31 drew tentatively impacts direction for finally impacting direction, does not then forward S33 to if do not meet the demands.
In an embodiment of the present invention, impacting direction described in the step S32 to the requirement that impacts track is: impact track and serve as reasons and impact the state starting point and impact the space three-dimensional straight line that the state end point is determined, this space three-dimensional linear projection to impacting on two parallel two dimensional surfaces of direction with this, is preestablished the projection angle range that track is allowed that impacts that this impacts direction on these two two dimensional surfaces.For example, under hit, its track is for hitting down starting point and hit the space three-dimensional straight line that end point is determined down, and this space line is projected to following to hit direction be on two parallel two dimensional surfaces of Y-axis, be XY plane and YZ plane, can obtain projection angle with these two planes.Preestablishing a qualified following Rule of judgment that hits action is: the projection angle range on the XY plane is-45 ° to-135 °, and the projection angle range on the YZ plane is-45 ° to-135 °.
In an embodiment of the present invention, a nearly step of step S32 comprises the steps:
S321) with described impact a space three-dimensional linear projection that track determines to step S31 in draw tentatively impact on two parallel two dimensional surfaces of direction;
S322) calculate projection angle between this coordinate axis that impacts track and these two two dimensional surfaces;
S323) whether the projection angle that calculates of determining step S322 satisfies the projection angle range requirement that tentatively impacts direction and allowed that draws in S31.
In an embodiment of the present invention, if in step S31, draw tentatively impact direction under hit, so in step S32, will be by a starting point that impacts state and a definite space three-dimensional straight line of technology point, project to step S31 in the direction that tentatively impacts that draws promptly hit down on two parallel two dimensional surfaces, be XY plane and YZ plane, further draw projection angle on these two planes, if two projection angle values that obtain satisfy the predetermined projection angle range on the XY plane-45 ° to-135 ° with in the projection angle range-45 on the YZ plane ° requirement to-135 °, determine so to hit down and be the final direction that impacts; If two projection angle values obtaining do not satisfy the predetermined projection angle range on the XY plane-45 ° to-135 ° with in the projection angle range-45 on the YZ plane ° requirement to-135 °, also be to be judged as down according to speed among the step S31 to hit, but judgement is not hit under not being according to projection angle in step S32, forwards step S33 so to.
Can not draw the final direction that impacts according to step S31 and step S32, enter step S33 so.
S33) set up four central shafts, the negative axle of the corresponding transverse axis of described flank attack left, the corresponding transverse axis positive axis of described flank attack to the right, hit the negative axle of corresponding vertical axes, the corresponding antero posterior axis positive axis of described forward play under described, calculate the described angle that impacts track and described central shaft, according to standard operation data and criterion thereof, what determine a central shaft representative impacts direction for finally impacting direction.
In an embodiment of the present invention, according to a starting point that impacts state and a definite space three-dimensional straight line of end point, calculate the negative axle of this space line and vertical axes, with the antero posterior axis positive axis, with the angle of transverse axis positive axis and the negative axle of transverse axis, if with the angle of some axles more than or equal to 90 °, can judge the action on the direction that can not have this correspondence so.As with the negative axle clamp angle of vertical axes be 50 °, with the angle of antero posterior axis positive axis be 20 °, with the angle of transverse axis positive axis be 10 °, with the angle of the negative axle of transverse axis be 170 °.Because bearing the angle of axle with transverse axis is 170 °, greater than 90 °, direction of action is described for to the right, can not be left direction, so the situation of the negative axle of transverse axis just need not have been considered.Only consider with the negative axle of vertical axes, with the antero posterior axis positive axis, with the situation of transverse axis positive axis.In one embodiment of the invention, calculate the probability ratio close by angle with central shaft: promptly with the negative axle of vertical axes, with the antero posterior axis positive axis, be with the ratio of transverse axis positive axis:
With negative close probability of vertical axes be so
The probability close with the antero posterior axis positive axis is
The probability close with the transverse axis positive axis is
According to standard operation data and criterion thereof, as standard operation for hit down and criterion for having reached 10% and just be judged as down and hit as long as hit the probability of action down, in the present embodiment, the probability close with the negative axle of vertical axes is 3/16, promptly the probability that hits down is 3/16, greater than 10%, be judged to be down so and hit action; If being forward play action and criterion, standard operation just is judged as forward play for the probability that needs only the forward play action has reached 50%, in the present embodiment, the probability of forward play is 6/16, less than 50%, can not be judged to be forward play so, will handle as botching routines in this case.
In an embodiment of the present invention, according to standard operation data and criterion thereof, each stroke is made an evaluation value, if need the moment of flank attack to monitor a flank attack action a certain, can obtain a higher evaluation value so, if the moment that this flank attack of fruit takes place in advance or delayed, obtains a rational evaluation value according to criterion, do not botch routines then the evaluation value is minimum if do not detect flank attack or detect.The evaluation value is directly proportional with the distance of end point with the described state starting point that impacts, and is inversely proportional to the time that impacts state starting point and end point, and the evaluation value of all stroke accumulative total is obtained the general comment definite value.
In an embodiment of the present invention, drum music action identification method disclosed in this invention both can carry out Tracking Recognition to a player, also can carry out Tracking Recognition to a plurality of players, and players can be formed team mutually and race.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.