private void gestureReplayBtn_Click(object sender, RoutedEventArgs e)
        {
            if (kinect_sensor != null && kinect_sensor.IsRunning)
            {
                return;
            }

            OpenFileDialog dialog = new OpenFileDialog();

            dialog.DefaultExt = ".xml";
            dialog.FileName   = "Skeleton";
            dialog.Filter     = "Skeleton data file (.xml)|*.xml";

            Nullable <bool> result = dialog.ShowDialog();

            if (result == true)
            {
                string filename = dialog.FileName;
                // test: read skeleton data and display
                gesture_capture_data = KinectRecorder.ReadFromSkeletonFile(filename);

                statusbarLabel.Content = "Load gesture file from " + filename;

                ActivateReplay(gesture_capture_data);

                isReplay = true;
            }
        }
Esempio n. 2
0
        private void loadSkeletonBtn_Click(object sender, RoutedEventArgs e)
        {
            if (kinect_sensor.IsRunning)
            {
                return;
            }

            OpenFileDialog dialog = new OpenFileDialog();

            dialog.DefaultExt = ".xml";
            dialog.FileName   = "Skeleton";
            dialog.Filter     = "Skeleton data file (.xml)|*.xml";

            Nullable <bool> result = dialog.ShowDialog();

            if (result == true)
            {
                string filename = dialog.FileName;
                // test: read skeleton data and display
                List <Skeleton> skeleton_data =
                    KinectRecorder.ReadFromSkeletonFile(filename);
                // save to data manager object
                kinect_data_manager.gesture = skeleton_data;

                int min_frame_id = 0;
                int max_frame_id = skeleton_data.Count;

                skeletonVideoSlider.IsEnabled = true;
                skeletonVideoSlider.Minimum   = min_frame_id;
                skeletonVideoSlider.Maximum   = max_frame_id;
                skeletonVideoSlider.Value     = min_frame_id;
                skeletonSliderLabel.Content   = min_frame_id.ToString();

                //kinect_data_manager.UpdateSkeletonData(skeleton_data[min_frame_id]);

                mode = KinectMode.Replay;
            }
        }