03-07-2002 07:03 AM
03-07-2002 08:06 AM
03-07-2002 09:05 AM
03-07-2002 10:06 AM
05-08-2008 01:17 AM
Hello Francois,
I have the same issue with my device, were you able to get the 2D array from your camera with void*? If so, could you please send an example of how you were able to do it?
Thanks,
Omer
05-09-2008 05:18 PM
05-12-2008 12:23 AM
Hello Van,
Thanks for replying! I am a graduate student at Cal-State Northridge, working on making an interface for the 3D camera Swissranger SR3000. I have been able get 3D point cloud data using the "Call Library Function Node", but I haven't been able to get amplitude/reflectance values of the pixels for filtering purposes.
The function for acquiring amplitude image is as below;
void* SR_GetImage ( SRCAM srCam, unsigned char idx)
Returns the pointer to the idx-th image. The idx has a value of 0 for distance image and 1 for amplitude image.
The srCam value is generated by the initialization function, which seems to be the memory block address of the camera being passed all along the subsequent functions. When I define the "void*" as "int32" at the SR_GetImage function it returns a similar value. So my question is, how would I be able to acquire the 176x144 amplitude data array at LabVIEW?
Could you please help?
Omer
05-13-2008 09:00 AM
Hi Omer,
Is the returned value pointing to a 2D array? If so, where in the code is that array created? If a function allocates memory, this can cause memory issues. It is best to allocate memory in LabVIEW by creating an array and then passing it as a parameter. Is it possible to modify the function so the data is a parameter instead of a return value?
05-14-2008 08:12 AM
Hello Jennifer,
The returned value is pointing to a 176x144 array, which is acquired from the camera through;
“int SR_Acquire ( SRCAM srCam )”
where the return of the function is the amount of transfered bytes or a negative number if failed. And the memory allocation is controlled by functions such as;
“int SR_SetBuffer ( SRCAM srCam, void * buffer, size_t size )”
The set buffer is used by functions like: SR_Acquire(), SR_CoordTrfFlt(), SR_GetImage() etc.
Since the DLL was provided with the camera without an open code, I do not beleive I would be able to change their functions. One possible solution was provided by LabVIEW on the phone, which was to make a DLL that takes the output of the camera's DLL (the pointer value) as its input and then de-reference it to return the actual data by using a function similar to “int output=*((int*)input)”. But as I am not familiar with C++ coding, I do not know what exact code to write for compiling into a DLL.
Could you please suggest how I may write the code or help me with another way of getting the array?
Thank you very much for your time!
Omer
05-20-2008 01:13 PM
Hi Omer,
It sounds like memory allocation is being handled properly, which is important.
Creating a wrapper DLL, as you mentioned, is a good approach. You can write code to call SR_GetImage, get a reference to the array, and pass that to LabVIEW.
Based on the details you have given, the function you write would probably look something like this:
void myWrapper (SRCAM srCam, unsigned char idx, double [ ][ ] imageArray)
{
imageArray = SR_GetImage (SRCAM srCam, unsigned char idx);
}
Then create a 176x144 array in LabVIEW to pass to the Call Library Function Node for myWrapper, along with the other two parameters. Select Array Data Pointer when configuring the Call Library Function Node. You may also want to try declaring imageArray as a pointer to an array instead of the array itself.