Vuser_955BcqSizkXgt
2024-04-10 10:03
RGB-D相机

C#中点云图如何解析

MV3D_RGBD_IMAGE_DATA stPointCloudImage = new MV3D_RGBD_IMAGE_DATA();
int nRet3d = (int)Mv3dRgbdSDK.MV3D_RGBD_OK;
nRet3d = Mv3dRgbdSDK.MV3D_RGBD_MapDepthToPointCloud(m_handle, stFrameData.stImageData[0], stPointCloudImage);

if (Mv3dRgbdSDK.MV3D_RGBD_OK != nRet3d)
{
// Console.WriteLine("MV3D_RGBD_MapDepthToPointCloud_NET Fail!");
return;

}

int nPointNum = (int)stPointCloudImage.nDataLen / (sizeof(float) * 3);
float[] vecX = new float[nPointNum];
float[] vecY = new float[nPointNum];
float[] vecZ = new float[nPointNum];
if (m_MaxImageSize < stPointCloudImage.nDataLen)
{
pValue = new byte[stPointCloudImage.nDataLen];
}

Marshal.Copy(stPointCloudImage.pData, pValue, 0, (int)stPointCloudImage.nDataLen);

for (int nPntIndex = 0; nPntIndex < nPointNum; ++nPntIndex)
{
vecX[nPntIndex] = pValue[nPntIndex * 3 + 0];
vecY[nPntIndex] = pValue[nPntIndex * 3 + 1];
vecZ[nPntIndex] = pValue[nPntIndex * 3 + 2];
//wr.WriteLine(Convert.ToString(vecX[nPntIndex]) + "\t" + Convert.ToString(vecY[nPntIndex]) + "\t" + Convert.ToString(vecY[nPntIndex]));
}

C#中使用以上代码对点云图解析,但是提取出的XYZ不对


在C++中使用以上方法可以解析,C#中得到的值基本都小于255,像是彩色图

2024-04-10 10:49发布追问
  • 58
  • 2
  • 分享

全部回答1

麻烦联系区域技术团队获取支持,社区中无法直接上传代码段,抱歉

2024-04-11 00:43 福建省
    |
  • 评论
  • |
  • 1

请升级浏览器版本

您正在使用的浏览器版本过低,请升级最新版本以获得更好的体验。

推荐使用以下浏览器