A kind of be applied in based on Kinect three-dimensional artificial fitting in human body attitude tracking
Technical field
The present invention relates to a kind of body image tracking, specifically a kind of be applied in based on Kinect three-dimensional artificial fitting in human body attitude tracking.
Background technology
To fit the deficiency had based on tradition, people have developed mode that the 3 D stereo that combines with virtual product figure based on body image fits and substitute entity and fit, the dress ornament that shopper can be liked oneself is clothed to it model, specifically by the picture of clothing and model's image combined, see the arranging effect such as clothes, shoes and hats that user selects easily and intuitively, until repurchase after the style of user oneself satisfaction of arranging in pairs or groups out.
In existing 3 D stereo fitting device, be mostly first to use Kinect device as its human bioequivalence device, thus obtain body image information for subsequent treatment.
For bringing the sense of reality of better fitting, just needing system can carry out recognition and tracking to the human body attitude of user, clothing image also human body attitude synchronous adaptation can be controlled, realize the most real simulation fitting effect.
But only utilize three-dimensional coordinate data that Kinect device obtains, existing method is difficult to carry out the identification of human body attitude, judgement and tracking, so usually need to increase hardware device separately, carries out the acquisition of human body attitude data.
Summary of the invention
The object of the present invention is to provide a kind of can only utilize Kinect device obtain the method that three-dimensional coordinate data identifies human body attitude, judges and follow the tracks of.
Realization of the present invention comprises the following steps:
Step one, obtains human body three-dimensional coordinate information and body image data by Kinect, body image data and database model data is contrasted, and obtains left shoulder point in body image, right shoulder point, and the three-dimensional coordinate data of shoulder central point;
Step 2, judges the Z axis size of left and right shoulder point, little the calculating with the Z axis of shoulder central point of peek value, the X-axis of shoulder central point and Z axis are deducted respectively X-axis and the Z axis of the little shoulder point of numerical value, thus the difference data obtained preserves;
Step 3, substitutes into difference data in system function System.Math.Asin and calculates its left and right shoulder point line angle A ngle;
Step 4, set the angle number modelCurr that is 0, modelCurr and Angle is compared, when modelCurr add 0.1f degree be less than Angle time, modelCurr with the speed positive rotation of 0.1f degree once, is added 0.1f degree after completing by clothing model, Angle is greater than when modelCurr deducts 0.1f degree, clothing model rotates once with the anti-speed degree of 0.1f degree, after completing, modelCurr is subtracted 0.1f degree, until modelCurr and Angle numerical value is identical.
Adopt computing method of the present invention, the calculated amount of Attitude Tracking can be greatly reduced, the requirement to hardware device can be reduced.
Accompanying drawing explanation
Accompanying drawing 1 is workflow diagram of the present invention, is also summary figure.
Embodiment
Now by reference to the accompanying drawings for an embodiment, conveniently the present invention is understood.
Realization of the present invention comprises the following steps:
Step one, obtains human body three-dimensional coordinate information and body image data by Kinect, body image data and database model data is contrasted, and obtains left shoulder point in body image, right shoulder point, and the three-dimensional coordinate data of shoulder central point;
Step 2, judges the Z axis size of left and right shoulder point, little the calculating with the Z axis of shoulder central point of peek value, the X-axis of shoulder central point and Z axis are deducted respectively X-axis and the Z axis of the little shoulder point of numerical value, thus the difference data obtained preserves;
Step 3, substitutes into difference data in system function System.Math.Asin and calculates its left and right shoulder point line angle A ngle.
Step 4, set the angle number modelCurr that is 0, modelCurr and Angle is compared, when modelCurr add 0.1f degree be less than Angle time, modelCurr with the speed positive rotation of 0.1f degree once, is added 0.1f degree after completing by clothing model, Angle is greater than when modelCurr deducts 0.1f degree, clothing model rotates once with the anti-speed degree of 0.1f degree, after completing, modelCurr is subtracted 0.1f degree, until modelCurr and Angle numerical value is identical.