- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Guys.
I tried to get 3D depth points, but I do not know if this correct.
below, the code:
for (int i = 0; i < MAX_FRAMES; i++) { if(mPXC.AcquireFrame(true) == pxcmStatus.PXCM_STATUS_NO_ERROR){ PXCMCapture.Sample sample = mPXC.QuerySample(); if (sample.depth != null) { PXCMImage.ImageData cData = new PXCMImage.ImageData(); sample.depth.AcquireAccess(PXCMImage.Access.ACCESS_READ, PXCMImage.PixelFormat.PIXEL_FORMAT_DEPTH, cData); mDepthBuffer = cData.ToShortArray(0, mDepthBuffer); int gridSize = 3; // populate mDepthPoints int cId = 0; for (int dy = 0; dy < height; ++dy) { for (int dx = 0; dx < width; ++dx) { PXCMPoint3DF32 cPoint = new PXCMPoint3DF32(); cPoint.x = dx; cPoint.y = dy; cPoint.z = (float) mDepthBuffer[cId]; mDepthPoints[cId] = cPoint; ++cId; } } sample.depth.ReleaseAccess(cData); } } mPXC.ReleaseFrame(); }
I wonder if there examples in Java or C sharp to show how I can capture the 3D points of depth using the camera realsense
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That looks about right, if you only need the depths for depth image coordinates.If you want camera coordinates (where x & y are distances from the centre in mm rather than pixel coordinates) you can use QueryVertices (search the docs or the forum for info on how to use it), and if you want to map the depths to the colour image you can use CreateDepthImageMappedToColor.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page