10-03-2014 04:00 AM
Hello.
I have bought a DepthSense 311 ToF camera from SoftKinetic.
It comes with an SDK, where I can view all of the depth images and the RGB image.
It is also possible for me to export a .csv file that contains a matrix corresponding to the resolution of the depth image (160x120), where the value of each pixel is the distance towards the point it measures in mm (see attachment for an example).
However, I need to be able to obtain this depth information by the use of LabVIEW directly. It could be okay if I could just set up LabVIEW to control the SDK from SoftKinetic.
Does anyone have experience with the DS311 camera in LabVIEW?
Thanks in advance.
René
10-03-2014 05:02 AM
Hello,
the SDK should have a .dll or .NET support? You should be able to call the functions/methods in Labview directly.
Best regards,
K
10-03-2014 07:38 AM
True, there actually are some .dll's.
Have you tried it/do you know if it is indeed possible to do it like this?
10-03-2014 01:06 PM
Hello,
I do not have any information about the .dll's so it's hard to say anything.
You should first read the documentation and if that doesn't help, contact the developer of the SDK and sort things out directly.
Best regards,
K
10-07-2014 05:18 AM
Hello Rene,
What have you already tried based on their SDK?
10-07-2014 05:38 AM
I tried using their commandline tool (DepthSenseBenchmark.exe), but apparently it is only capable of exporting data about the frames, and save that as a .csv file, and not export an entire frame.
I have also tried looking into the .dll's that are located in the installation folder, by using the call library function node in LabVIEW. However, it seemed to me as a dead end (or maybe I'm just not familiar with this function, as I haven't tried it before).
Then I contacted SoftKinetics helpdesk, and they could offer a Matlab bridge. However, I don't have Matlab available.
I also tried to look at the C++ sample which is provided, the consoleDemo code. Buuut this is definitely not my cup of tea, and I came up empty.
Have you gotten any experience with this kind of camera?
10-07-2014 10:09 AM
Hello René,
Are you able to share what you have tried?
What is going wrong?
Do you get errors?
Do you have a Programmers Reference or any other manual concerning this SDK?
I personally do not have any experience with this camera, but we (the forum) could assist you in trying to use the DLLs.
10-07-2014 01:49 PM
Hi,
I briefly looked at the SDK and it seems like you would have to create a interface DLL that encapsulate their code to call it from LabVIEW and retrieve images and 3D data. There does not seem to be an easier way.
Just out of curiosity, what is your application?
10-10-2014 04:22 AM
It seems that we got it figured out, we are slowly approaching a solution. The included C++ sample code has been modified and then it was possible to interface to LabVIEW.
The application is to measure some objects.
However, I might be need some input as how to measure distances.
The output from the camera is the distance towards the point that is being measured. In order to measure for instance a horizontal dimension in the image, am I right
that I would need to create a mathematical model that would tell me that at for instance 680 mm, 1 pixel = 5 mm?
10-10-2014 05:05 AM - edited 10-10-2014 05:33 AM
Hello,
you could use a pinhole camera model to calculate the two remaining spatial coordinates for each depth value:
X = Z*(u-cx) / fx,
Y = Z*(v-cy) / fy,
where (u,v) is the image coordinate of the query point and fx and fy is the respective focal distance of the camera in pixels. cx and cy represent the location of the image center. You would need to calibrate the intrinsic parameters of the camera, but that is fairly simple. In the equations above, no lens distortion is considered. If you want to consider lens distortion you need to use:
X = Z* (((u-cx) / fx) + du),
Y = Z* (((v-cy) / fy) + dv),
where du and dv are the values of optical correction (based on the model used).
Best regards,
K