Exemple #1
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;

        }
Exemple #2
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;
        }