Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Kinect sdk 2.0与sdk 1.7_C#_Kinect_Kinect Sdk - Fatal编程技术网

C# Kinect sdk 2.0与sdk 1.7

C# Kinect sdk 2.0与sdk 1.7,c#,kinect,kinect-sdk,C#,Kinect,Kinect Sdk,我编写了一个c#程序,与旧kinect一起工作。 我的图形库处理kinect。由于旧的Kinect不再正式销售,我现在将其更新为新的Kinect,使用Microsoft SDK2.0。对于我更新的库,我尽量保持大多数编码相同。 所以我可以发布一个更新库,而不是更新整个程序 我想知道的是,新的kinect深度数据是否仍然像在1.7 SDK中那样包含播放器数据?我使用以下方法执行了位掩码操作以删除该数据: realDepth[i16] = (short)(realDepth[i16] >>

我编写了一个c#程序,与旧kinect一起工作。 我的图形库处理kinect。由于旧的Kinect不再正式销售,我现在将其更新为新的Kinect,使用Microsoft SDK2.0。对于我更新的库,我尽量保持大多数编码相同。 所以我可以发布一个更新库,而不是更新整个程序

我想知道的是,新的kinect深度数据是否仍然像在1.7 SDK中那样包含播放器数据?我使用以下方法执行了位掩码操作以删除该数据:

realDepth[i16] = (short)(realDepth[i16] >> DepthImageFrame.PlayerIndexBitmaskWidth);
如果还需要这个,我找不到任何关于原始深度格式的信息

旧的Kinect也有一些

  • 距离未知
  • 距离接近
  • 相距遥远

它仍然提供此功能吗?

在Microsoft Kinect SDK 2.0中,您不需要位掩码操作来获得正确的深度值

当您访问
DepthFrame
对象时,可以使用如下内容:

private void ProcessDepthFrame(DepthFrame frame)
{
    int width = frame.FrameDescription.Width;
    int height = frame.FrameDescription.Height;

    ushort minDepth = frame.DepthMinReliableDistance;
    ushort maxDepth = frame.DepthMaxReliableDistance;

    ushort[] depthData = new ushort[width * height];

    frame.CopyFrameDataToArray(depthData);

    int colorIndex = 0;
    for (int depthIndex = 0; depthIndex < depthData.Length; ++depthIndex)
    {
        ushort depth = depthData[depthIndex];
        byte intensity = (byte)(depth >= minDepth && depth <= maxDepth ? depth : 0);

        // Do what you want
    }
}
private void ProcessDepthFrame(DepthFrame)
{
int width=frame.FrameDescription.width;
int height=frame.FrameDescription.height;
ushort minDepth=帧深度最小可靠距离;
ushort maxDepth=frame.DepthMaxReliableDistance;
ushort[]depthData=新的ushort[宽度*高度];
frame.CopyFrameDataToArray(深度数据);
int colorIndex=0;
对于(int-depthIndex=0;depthIndex字节强度=(字节)(深度>=minDepth&&depth在Microsoft Kinect SDK 2.0中,不需要位掩码操作即可获得正确的深度值

当您访问
DepthFrame
对象时,可以使用如下内容:

private void ProcessDepthFrame(DepthFrame frame)
{
    int width = frame.FrameDescription.Width;
    int height = frame.FrameDescription.Height;

    ushort minDepth = frame.DepthMinReliableDistance;
    ushort maxDepth = frame.DepthMaxReliableDistance;

    ushort[] depthData = new ushort[width * height];

    frame.CopyFrameDataToArray(depthData);

    int colorIndex = 0;
    for (int depthIndex = 0; depthIndex < depthData.Length; ++depthIndex)
    {
        ushort depth = depthData[depthIndex];
        byte intensity = (byte)(depth >= minDepth && depth <= maxDepth ? depth : 0);

        // Do what you want
    }
}
private void ProcessDepthFrame(DepthFrame)
{
int width=frame.FrameDescription.width;
int height=frame.FrameDescription.height;
ushort minDepth=帧深度最小可靠距离;
ushort maxDepth=frame.DepthMaxReliableDistance;
ushort[]depthData=新的ushort[宽度*高度];
frame.CopyFrameDataToArray(深度数据);
int colorIndex=0;
对于(int-depthIndex=0;depthIndex=minDepth&&depth抱歉不在工作中(度假时阅读此内容),它是否真的做了minDepth和maxDepth所做的事情,我使用的代码与之类似,但尽管它无法从te摄像头中理解,它返回零抱歉不在工作中(度假时阅读此内容),它是否真的做了minDepth和maxDepth所做的事情,我使用了类似的代码,但它从te camera无法理解,它返回零