| Home > C: Programming > Function descriptions > | History back Previous chapter Next chapter Print |
is_AOI |
|
uEye Camera Manual Version 4.00
|
|
USB 2.0 USB 3.0 GigE |
USB 2.0 USB 3.0 GigE |
Syntax
INT is_AOI (HIDS hCam, UINT nCommand, void* pParam, UINT nSizeOfParam)
Description
is_AOI() can be used to set the size and position of an area of interest (AOI) within an image. The following AOIs can be defined:
•Image AOI – display of an image portion
•Auto Brightness AOI – reference area of interest for automatic brightness control
•Auto Whitebalance AOI – reference area of interest for automatic white balance control
The nCommand input parameter is used to select the function mode. The pParam input parameter depends on the selected function mode. If you select functions for setting or returning a value, pParam contains a pointer to a variable of the UINT type. The size of the memory area to which pParam refers is specified in the nSizeOfParam input parameter.
|
|
AOI for automatic image control
The AOI for automatic brightness control (AES/AGC) and automatic white balance (AWB) defaults to the same size as the current image (i.e. the image AOI).
After changes to the image geometry (by resetting an image AOI, by binning or subsampling), the AOIs for automatic image control will always be reset to the image AOI value. This means that it might be necessary to set the AOIs for auto brightness/auto white balance again manually.
Fast changes of AOI position
Using the IS_AOI_IMAGE_SET_POS_FAST command, you can change the positions of AOIs very quickly. Executing this command takes just a few milliseconds. When using this command, a few special requirements have to be met:
•The command is currently not supported by all uEye cameras. With the IS_AOI_IMAGE_SET_POS_FAST_SUPPORTED command, you can check whether your sensor supports fast position changes.
•Hot pixel correction has to be disabled (see is_HotPixel()).
•Image capture is not suspended for fast AOI position changes. As a result, when you call the command, a number of images might still be transferred with the old AOI position if they were in the driver buffer at that moment.
|
|
|
|
|
|
Multi AOI function of the UI-124x/UI-324x/UI-524x models
The sensor of the UI-124x/UI-324x/UI-524x models supports multiple AOIs in one image capture. The AOIs are transferred together as one image. In this mode you can create 2 or 4 AOIs, which have either the same X axis or the same Y axis (see also uEye Cockpit: Multi AOI). The sensor is faster in this mode.
It is possible to switch the AOI in the horizontal direction.
Sequence AOI mode for camera models UI-124x/UI-324x/UI-524x
The camera models UI-124x/UI-324x/UI-524x have a special AOI mode. In this mode you can define besides the normal AOI (AOI 1) up to 3 further AOI on the sensor (see uEye Cockpit: Sequence AOI). When activating the sequence mode, note that only the following combinations are possible:
1.All additional AOIs are off. AOI 1 is always active.
2.AOI 2 (+ AOI 1)
3.AOI 2 and 3 (+ AOI 1)
4.AOI 2, 3 and 4 (+ AOI 1)
It is not possible to have a combination e.g. of AOI 2 and AOI 4.
The parameters of AOI 2, 3 and 4 are defined by the AOI_SEQUENCE_PARAMS structure. In the version 4.00 binning, subsampling and scaler are not supported.
Input parameters
hCam |
Camera handle |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pParam |
Pointer to a function parameter, whose function depends on nCommand. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
nSizeOfParam |
Size (in bytes) of the memory area to which pParam refers. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contents of the IS_RECT Structure
INT |
s32X |
X position of the AOI |
INT |
s32Y |
Y position of the AOI |
INT |
s32Width |
Width of the AOI |
INT |
s32Height |
Height of the AOI |
Contents of the IS_POINT_2D Structure
INT |
s32X |
X position of the AOI |
INT |
s32Y |
Y position of the AOI |
Contents of the IS_SIZE_2D Structure
INT |
s32Width |
Width of the AOI |
INT |
s32Height |
Height of the AOI |
Content of the AOI_SEQUENCE_PARAMS structure
INT |
s32AOIIndex |
Index of the AOI |
INT |
s32NumberOfCycleRepetitions |
Number of readout cycles |
INT |
s32X |
X position of the AOI |
INT |
x32Y |
Y position of the AOI |
Double |
dblExposure |
Exposure |
INT |
s32Gain |
Gain |
INT |
s32BinningMode |
Binning mode (not supported in version 4.00) |
INT |
s32SubsamplingMode |
Subsampling mode (not supported in version 4.00) |
INT |
s32DetachImageParameters |
•0 = every change of the exposure time and the master gain is copied from AOI 1 to the additional AOIs (default). •1 = a change of exposure time, gain or position of AOI 1 does not affect the parameters of AOI 2, 3 and 4. |
Double |
dblScalerFactor |
Scaling factor (not supported in version 4.00) |
BYTE |
byReserved[64] |
Reserved |
Return values
IS_BAD_STRUCTURE_SIZE |
An internal structure has an incorrect size. |
IS_CANT_ADD_TO_SEQUENCE |
The image memory is already included in the sequence and cannot be added again. |
IS_CANT_COMMUNICATE_WITH_DRIVER |
Communication with the driver failed because no driver has been loaded. |
IS_CANT_OPEN_DEVICE |
An attempt to initialize or select the camera failed (no camera connected or initialization error). |
IS_CAPTURE_RUNNING |
A capturing operation is in progress and must be terminated before you can start another one. |
IS_DR_CANNOT_CREATE_SURFACE |
The image surface or overlay surface could not be created. |
IS_DR_CANNOT_CREATE_TEXTURE |
The texture could not be created. |
IS_DR_CANNOT_CREATE_VERTEX_BUFFER |
The vertex buffer could not be created. |
IS_DR_DEVICE_OUT_OF_MEMORY |
Not enough graphics memory available. |
IS_DR_LIBRARY_NOT_FOUND |
The DirectRenderer library could not be found. |
IS_INVALID_BUFFER_SIZE |
The image memory has an inappropriate size to store the image in the desired format. |
IS_INVALID_CAMERA_TYPE |
The camera type defined in the .ini file does not match the current camera model. |
IS_INVALID_CAPTURE_MODE |
The function can not be executed in the current camera operating mode (free run, trigger or standby). |
IS_INVALID_CAMERA_HANDLE |
Invalid camera handle |
IS_INVALID_MEMORY_POINTER |
Invalid pointer or invalid memory ID |
IS_INVALID_PARAMETER |
One of the submitted parameters is outside the valid range or is not supported for this sensor or is not available in this mode. |
IS_IO_REQUEST_FAILED |
An IO request from the uEye driver failed. Possibly the versions of the ueye_api.dll (API) and the driver file (ueye_usb.sys or ueye_eth.sys) do not match. |
IS_NO_ACTIVE_IMG_MEM |
No active image memory available. You must set the memory to active using the is_SetImageMem() function or create a sequence using the is_AddToSequence() function. |
IS_NO_SUCCESS |
General error message |
IS_NOT_CALIBRATED |
The camera does not contain any calibration data. |
IS_NOT_SUPPORTED |
The camera model used here does not support this function or setting. |
IS_OUT_OF_MEMORY |
No memory could be allocated. |
IS_SEQUENCE_BUF_ALREADY_LOCKED |
The memory could not be locked. The pointer to the buffer is invalid. |
IS_SUCCESS |
Function executed successfully |
IS_TIMED_OUT |
A timeout occurred. An image capturing process could not be terminated within the allowable period. |
IS_TRIGGER_ACTIVATED |
The function cannot be used because the camera is waiting for a trigger signal. |
Related functions
// Sets the position and size of the image by using an object of the IS_RECT type.
IS_RECT rectAOI;
rectAOI.s32X = 100;
rectAOI.s32Y = 100;
rectAOI.s32Width = 200;
rectAOI.s32Height = 100;
INT nRet = is_AOI( hCam, IS_AOI_IMAGE_SET_AOI, (void*)&rectAOI, sizeof(rectAOI));
// Returns the AOI position and size by using an object of the IS_RECT type.
IS_RECT rectAOI;
INT nRet = is_AOI(hCam, IS_AOI_IMAGE_GET_AOI, (void*)&rectAOI, sizeof(rectAOI));
if (nRet == IS_SUCCESS)
{
INT x = rectAOI.s32X;
INT y = rectAOI.s32Y;
INT width = rectAOI.s32Width;
INT height = rectAOI.s32Height;
}
// Returns an UINT object indicating whether IS_AOI_IMAGE_POS_ABSOLUTE is set for the X position.
UINT nAbsPos = 0;
INT nRet = is_AOI(hCam, IS_AOI_IMAGE_GET_POS_X_ABS, (void*)&nAbsPos , sizeof(nAbsPos ));
if (nRet == IS_SUCCESS)
{
if (nAbsPos == IS_AOI_IMAGE_POS_ABSOLUTE)
{
// set
}
else if (nAbsPos == 0)
{
// not set
}
}
Examples for setting absolute AOI positions in memory
x = 100
y = 100

Fig. 162: AOI without absolute memory positioning
x = 100 | IS_AOI_IMAGE_POS_ABSOLUTE
y = 100

Fig. 163: AOI with absolute memory positioning on x-axis
x = 100 | IS_AOI_IMAGE_POS_ABSOLUTE
y = 100 | IS_AOI_IMAGE_POS_ABSOLUTE

Fig. 164: AOI with absolute memory positioning on x- and y-axis
// Set Multi AOI. The axes are passed in an UINT array of length 8.
UINT nAxes[8];
nAxes[0] = 100;
nAxes[1] = 120;
...
INT nRet = is_AOI(hCam, IS_AOI_MULTI_SET_AOI | IS_AOI_MULTI_MODE_AXES, (void*)nAxes, sizeof(nAxes));
// Read Multi AOI
UINT nAxes[8];
INT nRet = is_AOI(hCam, IS_AOI_MULTI_GET_AOI | IS_AOI_MULTI_MODE_AXES, (void*)nAxes, sizeof(nAxes));
// Disable Multi AOI
UINT nAxes[8];
INT nRet = is_AOI(hCam, IS_AOI_MULTI_DISABLE_AOI | IS_AOI_MULTI_MODE_AXES, NULL, NULL);
Sample 1 for sequence AOI mode
INT nSequenceAOI = 0;
if (is_AOI(m_hCam, IS_AOI_SEQUENCE_GET_SUPPORTED,
(void*)&nSequenceAOI, sizeof(nSequenceAOI)) == IS_SUCCESS)
{
// Sequence AOI 2 is supported
if ((nSequenceAOI & IS_AOI_SEQUENCE_INDEX_AOI_2) != 0);
}
Sample 2 for sequence AOI mode
AOI_SEQUENCE_PARAMS Param;
// Set parameters of AOI 2
Param.s32AOIIndex = IS_AOI_SEQUENCE_INDEX_AOI_2;
Param.s32NumberOfCycleRepetitions = 1;
Param.s32X = 100;
Param.s32Y = 200;
...
INT nRet = is_AOI(m_hCam, IS_AOI_SEQUENCE_SET_PARAMS, (void*)&Param, sizeof(Param));
// Get parameters of AOI 2
Param.s32AOIIndex = IS_AOI_SEQUENCE_INDEX_AOI_2;
nRet = is_AOI(m_hCam, IS_AOI_SEQUENCE_GET_PARAMS, (void*)&Param, sizeof(Param));
Sample 3 for sequence AOI mode
INT nMask = 0;
// Enable AOI 1, Disable AOI 2, 3 and 4
nMask = IS_AOI_SEQUENCE_INDEX_AOI_1;
INT nRet = is_AOI(m_hCam, IS_AOI_SEQUENCE_SET_ENABLE, (void*)&nMask, sizeof(nMask));
// Enable AOI 1 and 2
nMask = IS_AOI_SEQUENCE_INDEX_AOI_1 |
IS_AOI_SEQUENCE_INDEX_AOI_2;
nRet = is_AOI(m_hCam, IS_AOI_SEQUENCE_SET_ENABLE, (void*)&nMask, sizeof(nMask));
// Enable AOI 1, 2 and 3
nMask = IS_AOI_SEQUENCE_INDEX_AOI_1 |
IS_AOI_SEQUENCE_INDEX_AOI_2 |
IS_AOI_SEQUENCE_INDEX_AOI_3;
nRet = is_AOI(m_hCam, IS_AOI_SEQUENCE_SET_ENABLE, (void*)&nMask, sizeof(nMask));
// Enable AOI 1, 2, 3 and 4
nMask = IS_AOI_SEQUENCE_INDEX_AOI_1 |
IS_AOI_SEQUENCE_INDEX_AOI_2 |
IS_AOI_SEQUENCE_INDEX_AOI_3 |
IS_AOI_SEQUENCE_INDEX_AOI_4;
nRet = is_AOI(m_hCam, IS_AOI_SEQUENCE_SET_ENABLE, (void*)&nMask, sizeof(nMask));
// Get current AOI mask
INT nRet = is_AOI(m_hCam, IS_AOI_SEQUENCE_GET_ENABLE, (void*)&nMask, sizeof(nMask));