Ejemplo n.º 1
0
 internal void AgleChangeView(AgleView nextViewState)
 {
     lock (agleViewStateLock)
     {
         this.currentViewState = nextViewState;
         AgleViewUpdate.Invoke(this, nextViewState);
     }
 }
Ejemplo n.º 2
0
 internal void AgleVisionFrameArrivedFromKinectSensor(object sender, AgleView viewArrived)
 {
     if (viewArrived == currentViewState)
     {
         this.ImageSourceUpdate.Invoke(this, null);
         IAgleVision inComingFrame = sender as IAgleVision;
         this.fps = inComingFrame.FPS;
         FPSUpdate.Invoke(this, (int)this.fps);
     }
 }
Ejemplo n.º 3
0
        void AgleVisionFrameArrivedFromOpenCVCamera(newFrameEventArgs e)
        {
            // This function need to run in UI thread
            AgleView viewArrived = (AgleView)e.AgleViewCode;

            if (viewArrived == currentViewState)
            {
                Bitmap newBitmap = e.NewBitmap;
                var    tempImage = BitmapToImageSource(newBitmap);
                this.openCVCameraFrame = BitmapToImageSource(newBitmap);
                this.ImageSourceUpdate.Invoke(this, null);
                FPSUpdate.Invoke(this, 812);
            }
        }
Ejemplo n.º 4
0
 public ViewMenuItem(AgleView agleView)
 {
     this.agleView = agleView;
     this.menuText = agleView.ToString();
 }
Ejemplo n.º 5
0
 internal void UpdateView(AgleView agleView)
 {
     this.view = agleView.ToString();
     OnPropertyChanged("VIEW");
 }
Ejemplo n.º 6
0
 internal void UpdateView(AgleView agleView)
 {
     this.view = agleView.ToString();
     OnPropertyChanged("VIEW");
 }
Ejemplo n.º 7
0
 internal void ChangeViewByVoice(object sender, AgleView nextViewState)
 {
     this.AgleChangeView(nextViewState);
 }
Ejemplo n.º 8
0
 internal void AgleVisionFrameArrivedFromKinectSensor(object sender, AgleView viewArrived)
 {
     if (viewArrived == currentViewState)
     {
         this.ImageSourceUpdate.Invoke(this, null);
         IAgleVision inComingFrame = sender as IAgleVision;
         this.fps = inComingFrame.FPS;
         FPSUpdate.Invoke(this, (int)this.fps);
     }
 }
Ejemplo n.º 9
0
 internal void AgleChangeView(AgleView nextViewState)
 {
     lock (agleViewStateLock)
     {
         this.currentViewState = nextViewState;
         AgleViewUpdate.Invoke(this, nextViewState);
     }
 }
Ejemplo n.º 10
0
 private void OnAgleViewUpdated(object sender, AgleView nextViewState)
 {
     this.infoPanelVM.UpdateView(nextViewState);
 }
Ejemplo n.º 11
0
 internal void ChangeViewByVoice(object sender, AgleView nextViewState)
 {
     this.AgleChangeView(nextViewState);
 }
Ejemplo n.º 12
0
        internal void CheckingModule()
        {
            this.checkingInfoList = new List <CheckingInfo>();
            this.stopWatch.Start();

            /*------------------Initialize Kinect related sensors------------------------*/
            //initialize kinect
            this.kinectSensor      = KinectSensor.GetDefault();
            this.isKinectAvailable = this.kinectSensor == null ? false : true;
            CheckingInfo checkingInfoKinect = new CheckingInfo("Kinect", this.isKinectAvailable, true);

            checkingInfoList.Add(checkingInfoKinect);
            if (kinectSensor == null)
            {
                this.isAgleGoodToGo     = false;
                this.isCheckingFinished = true;
                return;
            }

            //Checking infrared frame
            this.agleInfraredFrame                 = new AgleInfraredFrame(this.kinectSensor);
            this.isKinectInfraredAvailable         = this.agleInfraredFrame.InitializeFrame();
            this.agleInfraredFrame.OnFrameArrived += this.AgleVisionFrameArrivedFromKinectSensor;
            CheckingInfo checkingInfoKinectInfrared = new CheckingInfo("Kinect Infrared", this.isKinectColorAvailable, false);

            checkingInfoList.Add(checkingInfoKinectInfrared);

            //Checking color frame
            this.agleColorFrame                 = new AgleColorFrame(this.kinectSensor);
            this.isKinectColorAvailable         = this.agleColorFrame.InitializeFrame();
            this.agleColorFrame.OnFrameArrived += this.AgleVisionFrameArrivedFromKinectSensor;
            CheckingInfo checkingInfoKinectColor = new CheckingInfo("Kinect Color", this.isKinectColorAvailable, false);

            checkingInfoList.Add(checkingInfoKinectColor);

            //Checking depth frame
            this.agleDepthFrame                 = new AgleDepthFrame(this.kinectSensor);
            this.isKinectDepthAvailable         = this.agleDepthFrame.InitializeFrame();
            this.agleDepthFrame.OnFrameArrived += this.AgleVisionFrameArrivedFromKinectSensor;
            CheckingInfo checkingInfoKinectDepth = new CheckingInfo("Kinect Depth", this.isKinectDepthAvailable, false);

            checkingInfoList.Add(checkingInfoKinectDepth);



            // Open Kinect
            this.kinectSensor.IsAvailableChanged += this.OnKinectStatusChanged;
            this.kinectSensor.Open();

            // Kinect voice control
            agleVoice = new AgleVoice();
            isKinectVoiceAvailable                = this.agleVoice.TryInitializeAgleVoice(kinectSensor);
            this.agleVoice.UpdateVoiceCommand    += this.AgleChangeInfo;
            this.agleVoice.UpdateAgleViewByVoice += this.ChangeViewByVoice;
            CheckingInfo checkingInfoKinectVoice = new CheckingInfo("Kinect Voice", this.isKinectVoiceAvailable, false);

            checkingInfoList.Add(checkingInfoKinectVoice);

            // OpenCV related initialization
            this.kinectOpenCV = new KinectOpenCV();
            this.isOpenCVMainFrontCameraAvailable = this.kinectOpenCV.CheckMainFrontCameraAvailability();
            CheckingInfo checkingInfoMainFront = new CheckingInfo("Main Forward Camera", this.isOpenCVMainFrontCameraAvailable, true);

            checkingInfoList.Add(checkingInfoMainFront);
            launchOpenCVCamera();


            isCheckingFinished    = true;
            this.currentViewState = AgleView.MainFront;
        }
Ejemplo n.º 13
0
 private void OnViewChanged(object sender, AgleView newViewState)
 {
     this.MyAgle.AgleChangeView(newViewState);
 }
Ejemplo n.º 14
0
 private void OnAgleViewUpdated(object sender, AgleView nextViewState)
 {
     this.infoPanelVM.UpdateView(nextViewState);
 }
Ejemplo n.º 15
0
        internal void CheckingModule()
        {
            this.checkingInfoList = new List<CheckingInfo>();
            this.stopWatch.Start();

            /*------------------Initialize Kinect related sensors------------------------*/
            //initialize kinect
            this.kinectSensor = KinectSensor.GetDefault();
            this.isKinectAvailable = this.kinectSensor == null ? false : true;
            CheckingInfo checkingInfoKinect = new CheckingInfo("Kinect", this.isKinectAvailable, true);
            checkingInfoList.Add(checkingInfoKinect);
            if (kinectSensor == null)
            {
                this.isAgleGoodToGo = false;
                this.isCheckingFinished = true;
                return;
            }

            //Checking infrared frame
            this.agleInfraredFrame = new AgleInfraredFrame(this.kinectSensor);
            this.isKinectInfraredAvailable = this.agleInfraredFrame.InitializeFrame();
            this.agleInfraredFrame.OnFrameArrived += this.AgleVisionFrameArrivedFromKinectSensor;
            CheckingInfo checkingInfoKinectInfrared = new CheckingInfo("Kinect Infrared", this.isKinectColorAvailable, false);
            checkingInfoList.Add(checkingInfoKinectInfrared);

            //Checking color frame
            this.agleColorFrame = new AgleColorFrame(this.kinectSensor);
            this.isKinectColorAvailable = this.agleColorFrame.InitializeFrame();
            this.agleColorFrame.OnFrameArrived += this.AgleVisionFrameArrivedFromKinectSensor;
            CheckingInfo checkingInfoKinectColor = new CheckingInfo("Kinect Color", this.isKinectColorAvailable, false);
            checkingInfoList.Add(checkingInfoKinectColor);

            //Checking depth frame
            this.agleDepthFrame = new AgleDepthFrame(this.kinectSensor);
            this.isKinectDepthAvailable = this.agleDepthFrame.InitializeFrame();
            this.agleDepthFrame.OnFrameArrived += this.AgleVisionFrameArrivedFromKinectSensor;
            CheckingInfo checkingInfoKinectDepth = new CheckingInfo("Kinect Depth", this.isKinectDepthAvailable, false);
            checkingInfoList.Add(checkingInfoKinectDepth);



            // Open Kinect
            this.kinectSensor.IsAvailableChanged += this.OnKinectStatusChanged;
            this.kinectSensor.Open();

            // Kinect voice control
            agleVoice = new AgleVoice();
            isKinectVoiceAvailable = this.agleVoice.TryInitializeAgleVoice(kinectSensor);
            this.agleVoice.UpdateVoiceCommand += this.AgleChangeInfo;
            this.agleVoice.UpdateAgleViewByVoice += this.ChangeViewByVoice;
            CheckingInfo checkingInfoKinectVoice = new CheckingInfo("Kinect Voice", this.isKinectVoiceAvailable, false);
            checkingInfoList.Add(checkingInfoKinectVoice);

            // OpenCV related initialization
            this.kinectOpenCV = new KinectOpenCV();
            this.isOpenCVMainFrontCameraAvailable = this.kinectOpenCV.CheckMainFrontCameraAvailability();
            CheckingInfo checkingInfoMainFront = new CheckingInfo("Main Forward Camera", this.isOpenCVMainFrontCameraAvailable, true);
            checkingInfoList.Add(checkingInfoMainFront);
            launchOpenCVCamera();


            isCheckingFinished = true;
            this.currentViewState = AgleView.MainFront;

        }
Ejemplo n.º 16
0
 private void OnViewChanged(object sender, AgleView newViewState)
 {
     this.MyAgle.AgleChangeView(newViewState);
 }
Ejemplo n.º 17
0
 public ViewMenuItem(AgleView agleView)
 {
     this.agleView = agleView;
     this.menuText = agleView.ToString();
 }