Integrating the FrameAnalyzer 

With the class AssistantItemFinderMain open in Visual Studio, let's add the variable and amend the methods responsible for the construction and destruction of FrameAnazlyer:

FrameAnalyzer frameAnalyzer;async void InitServices(){// ... frameAnalyzer = await FrameAnalyzer.CreateAsync();frameAnalyzer.Start();frameAnalyzer.OnAnalyzedFrame += FrameAnalyzer_OnAnalyzedFrame;}public void Dispose(){// ...if (frameAnalyzer != null){frameAnalyzer.Stop();frameAnalyzer = null;}}

As you may recall, ProcessNextFrame was the method responsible for passing the next available frame from FrameGrabber and adding it to the queue of FrameAnalyzer. Before this method proceeded, it checked whether it was in a valid state via the 

Get Microsoft HoloLens By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.