Software Archive
Read-only legacy content
Annonces
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

Capture Depth Points

carlos_c_6
Débutant
675 Visites

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

0 Compliments
1 Répondre
jb455
Précieux contributeur II
675 Visites

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.

0 Compliments
Répondre