本文整理汇总了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);
}
}
}
}
示例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.
}
}
}