GetSequenceWindow (DVR version only)
Top  Previous  Next

Description

Returns the two-dimensional array of pixel values corresponding to the selected window in the frame of the memory sequence.


Syntax


[VB]
Value=objActiveGige.GetImageWindow (Frame, X, Y, Width, Height)


[C/C++]
HRESULT GetImageWindow( long iFrame, short X, short Y, short Width, short Height, VARIANT* pArray );


Data Types
[VB]

X,Y, Width, Height: Integer
Return value
: Variant (SAFEARRAY)


Parameters
[C/C++]
 
iFrame [in]  
The zero-based index of the frame in the memory sequence  
X [in], Y[in]  
The x- and y-coordinates of the top left pixel of the window in the entire frame  
Width [in], Height [in]  
The horizontal and vertical size of the window in pixels.  
pArray [out,retval]  
Pointer to the SAFEARRAY containing the pixel values in the frame  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  


Example


This VB example fills a 3D array (x, y, frame) with pixel values from the memory sequence.


For 
z= 0 To ActiveGige1.GetSequenceFrameCount-1

sx=ActiveGige1.SizeX
sy=ActiveGige1.SizeY
a = ActiveGige1.GetSequenceWindow
 (z, 0, 0, sx, sy)

For
 x = 0 
To
 
sx-1
For y = 0 To sy-1

M(x
,y,z) = a(x, y)
Next
Next

Next
 

Remarks


The image data in the array are stored in the standard order from top to bottom, therefore the first element of the array is the top left pixel of the window. The type of data and dimensions of the array returned by GetSequenceWindow depends on the output format of the video, the width and height of the window and the number of lines acquired, as specified in the following table:



Camera Pixel Format
Output Format
Data type
Dimensions

Mono8
8-bit monochrome
Byte
0 to SizeX -1, 0 to Lines - 1
Mono10, Mono12, Mono16
16-bit gray monochrome
Integer (word)
0 to SizeX -1, 0 to Lines - 1
YUV411, YUV422, YUV444, RGB8, BGR8, Bayer8
24-bit RGB
Byte
0 to SizeX * 3 - 1, 0 to Lines - 1
RGB10, RGB12, RGB16, BGR10, BGR12, Bayer 10, Bayer 12, Bayer16
48-bit RGB
Integer (word)
0 to SizeX * 3 - 1, 0 to Lines - 1


If the dimensions of the window are too large to accommodate the frame size, they will be clipped to the frame boundaries.

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.

Note that in C/C++ applications it is required to call SafeArrayDestroy() to delete the SAFEARRAY returned by GetSequenceWindow.