01-09-2013 02:41 PM
Hi,
I am using IMAQdx to capture RAW data from various GigE cameras. I am streaming directly to disk using IMAQdx Get Image Data and Write to Binary File. I am using the binary file created in other programs in C++. I have done this for IMAQ ( CameraLink) compatible cameras with no issues. With IMAQ I get a 2D array representing the FPA of the camera.
What is the format of the 1D array produced by IMAQdx Get Image Data? For example, the camera produces 16 bit images and is 640x512 pixels, so there are a total of 655,360 values in the array. Do the first 2 values represent the pixel @ line 1 column 1? Then the next 2 values represent line 1 column 2, etc.
Thanks.
01-09-2013 07:01 PM
Hi,
They are always in a 1D array of U8 (bytes) from that API function since it is just the raw buffer array with no decoding and some formats might not translate to a 2D array (say if the source image acquired is JPEG encoded). It would be nice to allow the output representation to be changed in that function (the memory contents are identical, just the layout described to LabVIEW is different) but this is not currently supported.
Assuming your output data is 8-bit, you could just use a reshape array to make it 2D. If you have 16-bit image data then you are in a bit tougher spot. One option would be to not use Get Image Data but rather Get Image and then use Image to Array. If your source image is bayer encoded, you could set the bayer encoding to "none" to ensure it does no decoding of the data. Another option (that I have not tried) would be to see if LabVIEW lets you use the Cast primitive to cast the 1D array of U8s into say a 2D array of U16s with the right dimensions. This theoretically would mean no overhead of the conversion.
Eric