-1
:なぜQueryVerticesの座標はすべてゼロですか?次のコードの場合
Reads the depth data from the sensor and fills in the matrix
***/
void SR300Camera::fillInZCoords()
{
Image::ImageData depthImage;
Image *depthMap = sample->depth;
depthMap->AcquireAccess(Image::ACCESS_READ, &depthImage);
Image::ImageInfo imgInfo = depthMap->QueryInfo();
int depth_stride = depthImage.pitches[0]/sizeof(pxcU16);
Projection * projection = device->CreateProjection();
unsigned int wxhDepth = depth_width * depth_height;
Point3DF32* vertices = new Point3DF32[wxhDepth];
projection->QueryVertices(depthMap, vertices);
pxcU16 *dpixels = (pxcU16*)depthImage.planes[0];
unsigned int dpitch = depthImage.pitches[0]/sizeof(pxcU16); /* aligned width */
for (int k = 0; k < wxhDepth; k++) {
cout << "xx is " << vertices[k].x << endl;
cout << "yy is " << vertices[k].y << endl;
cout << "zz is " << vertices[k].z << endl;
}
}
私は、印刷されたすべてのためのゼロを取得します。 SDKドキュメントでは、奥行き画像のUVマップ座標をピクセル単位で、実世界のxyz-mapにmm単位で変換するために使用されます。QueryVertices
しかし、私にとっては0を返すだけです。色と深みの両方のイメージが得られ、何が間違っているのか分かりません。 は、ここでは、コードのデバッグから詳細情報の:
*
- vertices 0x00000261e4934040 {x=0.000000000 y=0.000000000 z=0.000000000 } Intel::RealSense::Point3DF32 *
wxhDepth 307200 unsigned int
- depthImage.pitches 0x00000075a2da9de0 {1280, 0, 0, 0} int[4]
- planes 0x00000075a2da9df0 {0x00000261e7542000 "", 0x0000000000000000 <NULL>, 0x0000000000000000 <NULL>, 0x0000000000000000 <NULL>} unsigned char *[4]
+ reserved 0x00000075a2da9dd4 {0, 0, 0} int[3]
format PIXEL_FORMAT_DEPTH (131072) Intel::RealSense::Image::PixelFormat
*