当前位置: 首页>>代码示例>>C#>>正文


C# DepthImageFrame.GetRawPixelData方法代码示例

本文整理汇总了C#中Microsoft.Kinect.DepthImageFrame.GetRawPixelData方法的典型用法代码示例。如果您正苦于以下问题:C# DepthImageFrame.GetRawPixelData方法的具体用法?C# DepthImageFrame.GetRawPixelData怎么用?C# DepthImageFrame.GetRawPixelData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Kinect.DepthImageFrame的用法示例。


在下文中一共展示了DepthImageFrame.GetRawPixelData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ManageDepthFrame

        /// <summary>
        /// DepthFrame Manager
        /// </summary>
        /// <param name="refDepthImage"></param>
        private void ManageDepthFrame(DepthImageFrame refDepthImage)
        {
            // If system is locked, draw system lock feedback
            if (IsLocked && PropertiesPluginKinect.Instance.EnableDepthFrameService)
            {
                PropertiesPluginKinect.Instance.DepthFrame = Feedback.FeedbackSystemLocked(PropertiesPluginKinect.Instance.KinectResolutionWidth, PropertiesPluginKinect.Instance.KinectResolutionHeight);
            }
            else // Draw the depth frame feedback
            {
                short[] pixelDataDepth = null;

                // Get the datas pixel
                if (refDepthImage != null)
                {
                    pixelDataDepth = new short[refDepthImage.PixelDataLength];
                    refDepthImage.CopyPixelDataTo(pixelDataDepth);

                    if (m_refKinectInteraction != null)
                    {
                        lock (m_refKinectInteraction)
                        {
                            if (m_refKinectInteraction != null)
                            {
                                m_refKinectInteraction.ProcessDepth(refDepthImage.GetRawPixelData(), refDepthImage.Timestamp);
                            }
                        }
                    }
                }

                if (pixelDataDepth != null && PropertiesPluginKinect.Instance.EnableDepthFrameService)
                {
                    // If the skeleton feedback on depth frame is activated, draw skeleton on depth frame.
                    if (!PropertiesPluginKinect.Instance.EnableSkeletonOnColorDepth)
                    {
                        PropertiesPluginKinect.Instance.DepthFrame = Feedback.FeedbackDepthFrame(pixelDataDepth, PropertiesPluginKinect.Instance.KinectResolutionWidth, PropertiesPluginKinect.Instance.KinectResolutionHeight);
                    }
                    else // Draw only depth frame
                    {
                        PropertiesPluginKinect.Instance.DepthFrame = Feedback.FeedbackDepthFrameWithSkeleton(m_refKinectsensor, m_refListUsers.Values.ToList(), pixelDataDepth, PropertiesPluginKinect.Instance.KinectResolutionWidth, PropertiesPluginKinect.Instance.KinectResolutionHeight);
                    }
                }
            }
        }
开发者ID:intuilab,项目名称:KinectIA,代码行数:47,代码来源:KinectFrameManager.cs

示例2: SensorDepthFrameReady

 /// <summary>
 /// Handler for the Kinect sensor's DepthFrameReady event
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="depthImageFrameReadyEventArgs">event arguments</param>
 public void SensorDepthFrameReady(DepthImageFrame depthFrame)
 {
     if (null != depthFrame)
     {
         try
         {
             // Hand data to Interaction framework to be processed
             this.interactionStream.ProcessDepth(depthFrame.GetRawPixelData(), depthFrame.Timestamp);
         }
         catch (InvalidOperationException)
         {
             // DepthFrame functions may throw when the sensor gets
             // into a bad state.  Ignore the frame in that case.
         }
     }
 }
开发者ID:konni-arcadia,项目名称:kinect-data-transmitter,代码行数:21,代码来源:InteractionDataTracker.cs


注:本文中的Microsoft.Kinect.DepthImageFrame.GetRawPixelData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。