Exemplo n.º 1
0
 public KinectService()
 {
     MainWindow window = MainWindow.instance;
     engine = window.mainEngine;
     engine.service = this;
     engine.clientConnected = true;
     engine.SetAppStateToReady();
 }
Exemplo n.º 2
0
        public KinectService()
        {
            MainWindow window = MainWindow.instance;

            engine                 = window.mainEngine;
            engine.service         = this;
            engine.clientConnected = true;
            engine.SetAppStateToReady();
        }
Exemplo n.º 3
0
        private void InitializeSensor(KinectSensor sensor)
        {
            if (null == sensor)
            {
                return;
            }

            // przygotowanie pol, wlasciwosci, itp. pod streaming z kamery
            sensor.ColorStream.Enable(ImageFormat);
            this.colorCameraPixels = new byte[sensor.ColorStream.FramePixelDataLength];
            this.colorCameraBitmap = new WriteableBitmap(sensor.ColorStream.FrameWidth, sensor.ColorStream.FrameHeight, 96.0, 96.0,
                                                         PixelFormats.Bgr32, null);
            ImKinectVideo.Source    = this.colorCameraBitmap;
            sensor.ColorFrameReady += new EventHandler <ColorImageFrameReadyEventArgs>(sensor_ColorFrameReady);

            mainEngine = new MainEngine(sensor, TBLog);
            mainEngine.Start();
        }
Exemplo n.º 4
0
        private void InitializeSensor(KinectSensor sensor)
        {
            if (null == sensor)
            {
                return;
            }

            // przygotowanie pol, wlasciwosci, itp. pod streaming z kamery
            sensor.ColorStream.Enable(ImageFormat);
            this.colorCameraPixels = new byte[sensor.ColorStream.FramePixelDataLength];
            this.colorCameraBitmap = new WriteableBitmap(sensor.ColorStream.FrameWidth, sensor.ColorStream.FrameHeight, 96.0, 96.0,
                PixelFormats.Bgr32, null);
            ImKinectVideo.Source = this.colorCameraBitmap;
            sensor.ColorFrameReady += new EventHandler<ColorImageFrameReadyEventArgs>(sensor_ColorFrameReady);

            mainEngine = new MainEngine(sensor, TBLog);
            mainEngine.Start();
        }
Exemplo n.º 5
0
        public void sensor_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
        {
            // nie ma potrzeby odczytywac szkieletu gdy nie jest on potrzebny aplikacji
            if (mainEngine.GetAppState() == ApplicationState.Calibration ||
                mainEngine.GetAppState() == ApplicationState.Working)
            {
                using (SkeletonFrame skeletonFrame = e.OpenSkeletonFrame())
                {
                    if (skeletonFrame != null)
                    {
                        lock (this)
                        {
                            skeletons = new Skeleton[skeletonFrame.SkeletonArrayLength];
                            skeletonFrame.CopySkeletonDataTo(skeletons);

                            if (skeletons.All(s => s.TrackingState == SkeletonTrackingState.NotTracked))
                            {
                                return;
                            }

                            Skeleton firstTrackedSkeleton = skeletons.Where(s => s.TrackingState == SkeletonTrackingState.Tracked).FirstOrDefault();
                            if (firstTrackedSkeleton != null && firstTrackedSkeleton.Joints[JointType.HandRight].TrackingState == JointTrackingState.Tracked)
                            {
                                rightHand      = firstTrackedSkeleton.Joints[JointType.HandRight];
                                rightHandCoord = new Point3D(rightHand.Position.X, rightHand.Position.Y, rightHand.Position.Z);

                                if (mainEngine.GetAppState() == ApplicationState.Working)
                                {
                                    MainEngine.MoveCursorTo(mainEngine.GetCalibrator().ScaleKinectPositionToScreen(
                                                                rightHand.Position.X, rightHand.Position.Y, rightHand.Position.Z));
                                }

                                //mainEngine.AddTextToLog("SkelControl: hand tracked " + rightHand.Position.X.ToString()
                                // + " " + rightHand.Position.Y.ToString() + " " + rightHand.Position.Z.ToString());
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 6
0
 public ObjectManager(MainEngine engine)
 {
     this.mainEngine = engine;
 }
Exemplo n.º 7
0
 public SpeechRecognizer(MainEngine me)
 {
     mainEngine = me;
 }
Exemplo n.º 8
0
 public SkeletonController(MainEngine me)
 {
     mainEngine = me;
 }
 public SkeletonController(MainEngine me)
 {
     mainEngine = me;
 }
Exemplo n.º 10
0
 public ObjectManager(MainEngine engine)
 {
     this.mainEngine = engine;
 }
Exemplo n.º 11
0
 public Calibrator(MainEngine me)
 {
     mainEngine = me;
 }
Exemplo n.º 12
0
 public Calibrator(MainEngine me)
 {
     mainEngine = me;
 }
Exemplo n.º 13
0
 public SpeechRecognizer(MainEngine me)
 {
     mainEngine = me;
 }