public async Task <int> InitFacialeRecon() { this.faceTracker = await FaceTracker.CreateAsync(); Debug.WriteLine("Face tracker initializated !"); // Parallel.Invoke(() => InitVideoProcessorWork(), () => ProcessingWork()); //await InitVideoProcessorWork(); this.videoProcessor = await VideoProcessor.CreateAsync(); Task.Run(() => ProcessingWork()); /* * Task videoprocessorTask = new Task(async delegate () * { * this.videoProcessor = await VideoProcessor.CreateAsync(); * Debug.WriteLine("\t --> Video Processor Created !"); * }); * videoprocessorTask.Start();*/ //TimeSpan timerInterval = TimeSpan.FromMilliseconds(132); // 15 fps //this.frameProcessingTimer = Windows.System.Threading.ThreadPoolTimer.CreatePeriodicTimer(new Windows.System.Threading..TimerElapsedHandler(ProcessCurrentVideoFrame), timerInterval); // ThreadStart delegateProcess = new ThreadStart(); //Task backgroundTracking = new Task(delegate() { ProcessCurrentVideoFrame(); }); //backgroundTracking /*this._isRunning = true; * Task backgroundTask = new Task(async delegate() * { * /* * if (videoProcessor != null) * { * TimeSpan timerInterval = TimeSpan.FromMilliseconds(132); // 15 fps * this.frameProcessingTimer = Windows.System.Threading.ThreadPoolTimer.CreatePeriodicTimer(new Windows.System.Threading.TimerElapsedHandler(ProcessCurrentVideoFrame), timerInterval); * } * else * { * Debug.WriteLine("\t\t video processor = null"); * }*/ /* * while (_isRunning) * { * if (videoProcessor != null) * { * if (videoProcessor.IsStarted()) * { * Debug.WriteLine("Calling frame processing"); * await ProcessCurrentVideoFrame(); * } * else * { * Debug.WriteLine("-->video processor not started yet"); * } * } * } * * }); * backgroundTask.Start(); */ return(0); }
public async static Task <FaceTrackerProcessor> CreateAsync(VideoProcessor processor) { Debug.WriteLine("FaceTRackerProcessor.CreateAsync() called !"); FaceTracker tracker = await FaceTracker.CreateAsync(); return(new FaceTrackerProcessor(tracker, processor)); }
public FaceTrackerProcessor(FaceTracker tracker, VideoProcessor processor) { this.faceTracker = tracker; this.videoProcessor = processor; if (this.videoProcessor != null) { Task.Run(async delegate() { await ProcessLoop(); }); } }
public FaceTrackerProcessor(FaceTracker tracker, VideoProcessor processor) { this.faceTracker = tracker; this.videoProcessor = processor; if (this.videoProcessor != null) { //ThreadPool.RunAsync(ProcessLoop, WorkItemPriority.Low); Task.Run(async delegate() { await ProcessLoop(); }); } }
public void Run() { Debug.WriteLine("\t\t\t\t\t APP.CS: Run"); //FaceTrackerProcessor FT = new FaceTrackerProcessor(); //Task.Run(() => FT.InitFacialeRecon()); Task.Run(async delegate() { //VideoProcessor videoProcessor = await VideoProcessor.CreateAsync(); FaceTrackerProcessor faceTrackerProcessor = await FaceTrackerProcessor.CreateAsync(await VideoProcessor.CreateAsync()); }); m_AppCallbacks.Run(); }
private async Task InitVideoProcessorWork() { this.videoProcessor = await VideoProcessor.CreateAsync(); Debug.WriteLine("\t --> Video Processor Created !"); }
public void Run() { Task.Run(async delegate() { FaceTrackerProcessor faceTrackerProcessor = await FaceTrackerProcessor.CreateAsync(await VideoProcessor.CreateAsync()); }); m_AppCallbacks.Run(); }