Software Archive
Read-only legacy content
17061 Discussions

Depth Values with Processing

JD_K_
Beginner
940 Views

I have been trying to look at the samples and documentation, but there is very little information on Processing/Java compared to C++.  I'm trying to get an array of depth values using Processing, but so far I have not had any luck.  I want to be able to compare the depth values in each frame.  If anyone could provide an example, or advice it would be greatly appreciated.

0 Kudos
5 Replies
Xusheng_L_Intel
Employee
940 Views

There are some java samples under C:\Program Files (x86)\Intel\RSSDK\framework\Java, please let me know if you still need help. Thanks!

0 Kudos
JD_K_
Beginner
940 Views

Thank you so much for the reply.  I'm trying to get an array of depth values similar to what you can do with the Kinect.  I was not able to find that in the examples.  If it's possible to provide an example of doing this in Processing it would be really appreciated.  If it was there and I overlooked it, please let me know.

0 Kudos
Vlad_C_
Beginner
940 Views

Looking for this information as well please. 

0 Kudos
Ignacio_A_Intel
Employee
940 Views

I have the same problem.

here is the piece of code after I initialize the pipeline and create a foor loop for the first 300 frames. The documentation code sample is not initialized and the code doesn't compile unless it is initialized. Is there another way to do read the image buffer and have the stream be saved as a file?

            if (sM.AcquireFrame(true) == pxcmStatus.PXCM_STATUS_NO_ERROR) break; // PXCM Status no error means there is some data available and I/O device is connected

            // retrieve the samples
            PXCMCapture.Sample sample=sM.QuerySample();

            // work on the samples: sample.color & sample.depth
            System.out.println("Working on frame"+i);
                       
            PXCMImage.ImageInfo iinfo=new PXCMImage.ImageInfo();
            PXCMImage image=session.CreateImage(iinfo);
            
            PXCMImage.ImageData data; // how to initialize this??????
            image.AcquireAccess(PXCMImage.Access.ACCESS_READ,data);
            
            // go fetch the next samples

            sM.ReleaseFrame(); 
            System.out.println("Done with frame"+i);

Thanks,

ignacio 

0 Kudos
Nacho_C_
Beginner
940 Views

I've been trying the same.

This is what I've got so far, but I'm missing how to interpret depth values. I was expecting millimeters, but it does not look like.

sts = senseMgr.AcquireFrame(true);
		if (sts.compareTo(pxcmStatus.PXCM_STATUS_NO_ERROR)<0) return;

		PXCMCapture.Sample sample = senseMgr.QueryHandSample();

		if (sample.depth != null) {
			PXCMImage.ImageData dData = new PXCMImage.ImageData();
			sample.depth.AcquireAccess(PXCMImage.Access.ACCESS_READ,PXCMImage.PixelFormat.PIXEL_FORMAT_DEPTH, dData);
dData.ToIntArray(0, intDepth);
			sample.depth.ReleaseAccess(dData);
			for (int i = 0; i<floatDepth.length;i++){
				if(i%100==0)
					println((intDepth))
				
			}
		}

 

0 Kudos
Reply