GetRawData
Top  Previous  Next

Description

Returns the two-dimensional array of values in the currently acquired data buffer or pointer to this buffer.


Syntax


[VB]
Value=objActiveGige.GetRawData ([isPointer=False])


[C/C++]
HRESULT GetRawData(  bool isPointer, VARIANT* pArray );


Data Types
[VB]

Return value: Variant (SAFEARRAY)


Parameters
[C/C++]

isPointer [in]  
If false returns the array of raw data, otherwise returns pointer to data.  

pArray [out,retval]  
Pointer to the SAFEARRAY containing the raw data buffer.  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  


Example


This VB example grabs a frame, retrieves the raw data array and displays the value of the specified element of the array.

Dim
 pix 
as Long

ActiveGige1.Grab
RawData=ActiveGige1.GetRawData
x=16
y=32
pix=RawData(x,y)
if
 pix < 0 
then

pix=65535-pix
endif
MsgBox RawData(x,y)
 

Remarks


This function returns the frame data as they arrive from the camera (before being converted to a viewable format, such as RGB). GetRawData does not copy the image data, so the array returned contains the actual image buffer of the currently acquired frame. Modifying elements of the array will change actual pixel values in the image buffer. This can be used to perform custom image processing and display a processed image in real time. Note that this feature cannot be used in .NET as its framework creates a copy of the array returned. For direct access to raw data in C# set isPointer to True and use the poitner instead of an array.

Raw image data are stored in the standard order from top to bottom, therefore the first element of the array is first pixel of the top line of the image. The type of data and dimensions of the array returned by GetRawData depends on the current pixel format, horizontal width SizeX and the number of lines acquired, as specified in the following table:



Pixel Format
Data type
Dimensions

Mono8, Mono8s
Byte
0 to SizeX -1, 0 to Lines - 1
Bayer**8
Byte
0 to SizeX -1, 0 to Lines - 1
Mono10, Mono12, Mono16
Integer (word)
0 to SizeX -1, 0 to Lines - 1
Bayer**10, Bayer**12, Bayer**16
Integer (word)
0 to SizeX -1, 0 to Lines - 1
Mono10Packed, Mono12Packed
Byte
0 to SizeX*3/2 -1, 0 to Lines - 1
YUV411_8_UYYVYY
Byte
0 to SizeX*3/2 -1, 0 to Lines - 1
YUV422_8_UYVY, YUV8_YUV
Integer (word)
0 to SizeX -1, 0 to Lines - 1
RGB8, BGR8
Byte
0 to SizeX * 3 - 1, 0 to Lines - 1
RGBa8, BGRa8
Byte
0 to SizeX * 4 - 1, 0 to Lines - 1
RGB10, BGR10, RGB12, BGR12
Integer (word)
0 to SizeX * 3 - 1, 0 to Lines - 1
BGR10V1Packed, BGR10V2Packed
Long
0 to SizeX -1, 0 to Lines - 1
RGB8Planar
Byte
0 to SizeX * 3 - 1, 0 to Lines - 1
RGB10Planar, RGB12Planar, RGB16Planar
Integer (word)
0 to SizeX * 3 - 1, 0 to Lines - 1
Coord3D_ABC16
Integer (word)
1, 0 to SizeY * 3 - 1
Coord3D_ABC32f
Float (dword)
1, 0 to SizeY * 3 - 1



For integer (word) type of data you can receive negative numbers if pixel values exceed 32767. In C and C# you can convert signed integers to unsigned ones by using data casting. To get rid of negative values in VB and Delphi, subtract them from 65535 (see the example above).

If the camera is streaming in the JPEG or H.264 compression mode, the raw data buffer will contain a compressed frame of a variable size not directly related to the dimensions of the image.

For 3D point cloud formats the raw data buffer will contain a liniar array of XYZ coordinates with SizeY representing the maximum number of points in the array.

Note that setting both Display and Magnification properties to zero will disable an image conversion pipeline that is normally applied to each raw frame. This will significantly increase the performance of your application as long as it does not utilize ActiveGige's built-in image decoding/display.