예제 #1
0
        public GestureProcessor(IKinect kinectHandler, KinectData kinect)
        {
            _pointer = new ObjectPointer();
            Log.Debug("objectPointer loaded");
            _pointer.SetObjects(FileLoader.LoadObj("livingRoom.obj", FileLoader.Units.cm));

            Log.Debug("objects loaded");

            _kinectHandler = kinectHandler;
            _kinect        = kinect;
            _seqCoords     = new ArrayList();

            if (kinect != null)
            {
                kinect.attachSkeletonHandler(SkeletonDataReadyHandler);
            }

            _dtw = new DtwGestureRecognizer(12, 0.6, 2, 2, 10);
            Skeleton2DDataExtract.Skeleton2DdataCoordReady += NuiSkeleton2DdataCoordReady;
            _pointer.ContextSelected += PointerContextSelected;
        }
예제 #2
0
        private void LoadUsers()
        {
            var userData = FileLoader.LoadAllUsers();

            if (userData == null)
            {
                return;
            }

            foreach (var userInfo in userData)
            {
                var user = new User {
                    Name = userInfo.Key, TrackingID = -1, IsActive = false
                };

                if (userInfo.Value != null)
                {
                    foreach (var feature in userInfo.Value)
                    {
                        if (feature.Key.Equals(FeatureType.ArmLength))
                        {
                            user.ArmLength = float.Parse(feature.Value);
                        }
                        else if (feature.Key.Equals(FeatureType.HipHeadHeight))
                        {
                            user.HipHeight = float.Parse(feature.Value);
                        }
                        else if (feature.Key.Equals(FeatureType.ShoulderWidth))
                        {
                            user.ShoulderWidth = float.Parse(feature.Value);
                        }
                    }
                }
                _users.Add(user);
            }
        }
예제 #3
0
 public void DelUser(string user)
 {
     FileLoader.RemoveUser(user);
 }
예제 #4
0
 private void StoreFeatures(Dictionary <FeatureType, String> features)
 {
     FileLoader.StoreUserData(features);
 }
예제 #5
0
 public BodyFeatureDetector()
 {
     _users = FileLoader.LoadAllUsers();
 }
예제 #6
0
 public string[] LoadGestures()
 {
     return(FileLoader.LoadGestures(_dtw));
 }