Please enable JavaScript to view this site.

IDS Software Suite 4.96.1

Windows_Logo
Linux_Logo

USB 2.0

USB 3.x

GigE

USB 2.0

USB 3.x

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 AOI is always referred to the sensor. 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 available step widths for the position and size of image AOIs depend on the sensor. The values defining the position and size of an AOI have to be integer multiples of the allowed step widths. For details on the AOI grids of the individual camera models, please see Camera and sensor data.

hint_info

This function is currently not supported by the following camera models:

UI-1007XS

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_GET_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.

Changing the image size

When changing the size of the AOI, please make sure that the selected image memory is large enough. If it isn't, allocate a new image memory (see is_AllocImageMem()).

Changes to the image size affect the value ranges of the frame rate and exposure time. After executing is_AOI(), calling the following functions is recommended in order to keep the defined camera settings:

is_SetFrameRate()

is_Exposure()

If you are using the flash function: is_IO()

hint_info

Note to AOI in combination with high frame rates

With very small AOI and therefore high frame rate and maximum possible frame rate set, it is possible that the USB camera transfers in freerun mode only half frame rates. This is a signal for a camera-internal overload. In this case it is recommended to set the frame rate to maximum of 98 %.

More AOI functions

For some uEye camera models, you can set further special AOI functions:

Using the multi AOI function

Using the sequence AOI mode

Configuring the IDS line scan ("AOI merge mode")

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

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 first.

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

is_ImageFormat()

is_SetBinning()

is_SetSubSampling()

Sample 1 for AOI

// 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));

Sample 2 for AOI

// 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;
}

Sample 3 for AOI

// 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
  }
}

Sample 4 for AOI

// Query if fast AOI position changes are suppported
unsigned int fastAOIsupport = 0;
int nRet = is_AOI(m_hCam, IS_AOI_IMAGE_GET_POS_FAST_SUPPORTED, (void*)&fastAOIsupport, sizeof(fastAOIsupport));

Examples for setting absolute AOI positions in memory

x = 100

y = 100

Fig. 192: AOI without absolute memory positioning

Fig. 192: AOI without absolute memory positioning

x = 100 | IS_AOI_IMAGE_POS_ABSOLUTE

y = 100

Fig. 193: AOI with absolute memory positioning on x-axis

Fig. 193: AOI with absolute memory positioning on x-axis

x = 100 | IS_AOI_IMAGE_POS_ABSOLUTE

y = 100 | IS_AOI_IMAGE_POS_ABSOLUTE

Fig. 194: AOI with absolute memory positioning on x- and y-axis

Fig. 194: AOI with absolute memory positioning on x- and y-axis

© 2022 IDS Imaging Development Systems GmbH