Example #1
0
        /// <summary>
        /// Process the depth input
        /// </summary>
        /// <param name="depthPixels">The depth data array to be processed</param>
        private void ProcessFusionFrameBackground(FusionWorkItem workItem)
        {
            Debug.Assert(null != this.volume, "volume should be initialized");
            Debug.Assert(null != this.shadedSurfaceColorFrame, "shaded surface should be initialized");
            Debug.Assert(null != this.colorFusionBitmap, "color bitmap should be initialized");

            try
            {
                DepthImagePixel[] depthPixels = workItem.data;
                byte[] colorPixels = workItem.colordata;

                bool trackingSucceeded = false;
                if (!IsIntegrationPaused)
                {
                    trackingSucceeded = TrackIntegrate(depthPixels, workItem.colordata, workItem.Format);
                }
                if (ProcessedFrameCount % 2 == 0)
                {
                    RenderFusion();
                }

                // The input frame was processed successfully, increase the processed frame count
                ++this.ProcessedFrameCount;

                //Console.WriteLine("ohohoh!pushed item !");
                _fusionWorkItemPool.Push(workItem);

                _syncContext.Post((SendOrPostCallback)FusionUpdateUI, trackingSucceeded);
                //return trackingSucceeded;
            }
            catch (InvalidOperationException ex)
            {
                FusionStatusMessage = ex.Message;
                //return false;
            }
            finally
            {
            }
        }
Example #2
0
 private void ReturnFusionWorkItem(FusionWorkItem workItem)
 {
     _fusionWorkItemPool.Push(workItem);
 }