internal void AgleChangeView(AgleView nextViewState) { lock (agleViewStateLock) { this.currentViewState = nextViewState; AgleViewUpdate.Invoke(this, nextViewState); } }
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); } }
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); } }
public ViewMenuItem(AgleView agleView) { this.agleView = agleView; this.menuText = agleView.ToString(); }
internal void UpdateView(AgleView agleView) { this.view = agleView.ToString(); OnPropertyChanged("VIEW"); }
internal void UpdateView(AgleView agleView) { this.view = agleView.ToString(); OnPropertyChanged("VIEW"); }
internal void ChangeViewByVoice(object sender, AgleView nextViewState) { this.AgleChangeView(nextViewState); }
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); } }
internal void AgleChangeView(AgleView nextViewState) { lock (agleViewStateLock) { this.currentViewState = nextViewState; AgleViewUpdate.Invoke(this, nextViewState); } }
private void OnAgleViewUpdated(object sender, AgleView nextViewState) { this.infoPanelVM.UpdateView(nextViewState); }
internal void ChangeViewByVoice(object sender, AgleView nextViewState) { this.AgleChangeView(nextViewState); }
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; }
private void OnViewChanged(object sender, AgleView newViewState) { this.MyAgle.AgleChangeView(newViewState); }
private void OnAgleViewUpdated(object sender, AgleView nextViewState) { this.infoPanelVM.UpdateView(nextViewState); }
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; }
private void OnViewChanged(object sender, AgleView newViewState) { this.MyAgle.AgleChangeView(newViewState); }
public ViewMenuItem(AgleView agleView) { this.agleView = agleView; this.menuText = agleView.ToString(); }