Home > C: Programming > Function descriptions > History back  Previous chapter  Next chapter  Print  

is_AOI

uEye Camera Manual Version 4.00

is_AOI

Windows_Logo

Linux_Logo

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.

Hinweis

Note on previous AOI functions

The is_AOI() function comprises all the functions for setting and positioning an AOI. The following uEye API commands are therefore obsolete:

is_SetAOI()

is_SetImageAOI()

is_SetImageSize()

is_SetImagePos()

See also Obsolete functions

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.

Achtung

Note on 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:

ois_SetFrameRate()

ois_Exposure()

oIf you are using the flash function: is_IO()

Achtung

Note on step widths for AOI definition (position grid)

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.

Achtung

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

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

IS_AOI_IMAGE_SET_AOI

Sets the position and size of the image by using an object of the IS_RECT type. Sample 1 for AOI

You can define the start position of the AOI in the memory by ORing IS_AOI_IMAGE_POS_ABSOLUTE with the X or Y position. Sample for setting the AOI position

IS_AOI_IMAGE_GET_AOI

Returns the AOI in an IS_RECT object.

Sample 2 for AOI

IS_AOI_IMAGE_SET_POS

Sets the AOI position by using an object of the IS_POINT_2D type. IS_AOI_IMAGE_POS_ABSOLUTE can be ORed here, as well. Sample for setting the AOI position

IS_AOI_IMAGE_GET_POS

Returns the position in an IS_POINT_2D object.

IS_AOI_IMAGE_SET_SIZE

Sets the AOI size by using an object of the IS_SIZE_2D type.

IS_AOI_IMAGE_GET_SIZE

Returns the size in an IS_SIZE_2D object.

IS_AOI_IMAGE_GET_POS_MIN

Returns the minimum possible position in an IS_POINT_2D object.

IS_AOI_IMAGE_GET_SIZE_MIN

Returns the smallest possible size in an IS_SIZE_2D object.

IS_AOI_IMAGE_GET_POS_MAX

Returns the maximum possible position in an IS_POINT_2D object.

IS_AOI_IMAGE_GET_SIZE_MAX

Returns the largest possible size in an IS_SIZE_2D object.

IS_AOI_IMAGE_GET_POS_INC

Returns the increment for the position in an IS_POINT_2D object.

IS_AOI_IMAGE_GET_SIZE_INC

Returns the increment for the size in an IS_SIZE_2D object.

IS_AOI_IMAGE_GET_POS_X_ABS

Returns an UINT object indicating whether IS_AOI_IMAGE_POS_ABSOLUTE is set for the X position.

Sample 3 for AOI

IS_AOI_IMAGE_GET_POS_Y_ABS

Returns an UINT object indicating whether IS_AOI_IMAGE_POS_ABSOLUTE is set for the Y position.

IS_AOI_IMAGE_GET_ORIGINAL_AOI

Returns the AOI in an IS_RECT object without binning, subsampling or scaling.

IS_AOI_IMAGE_SET_POS_FAST

Allows changing the AOI position very quickly by using an IS_POINT_2D object. Hot pixel correction has to be disabled (see information above).

IS_AOI_IMAGE_SET_POS_FAST_SUPPORTED

Returns an UINT object indicating whether fast AOI position changes are supported. The passed variable returns 0 if the function is not supported by the sensor.

IS_AOI_AUTO_BRIGHTNESS_SET_AOI

Sets the AOI for automatic brightness control (similar to IS_AOI_IMAGE_SET_AOI).

IS_AOI_AUTO_BRIGHTNESS_GET_AOI

Returns the AOI for automatic brightness control (similar to IS_AOI_IMAGE_GET_AOI).

IS_AOI_AUTO_WHITEBALANCE_SET_AOI

Sets the AOI for automatic white balance (similar to IS_AOI_IMAGE_SET_AOI).

IS_AOI_AUTO_WHITEBALANCE_GET_AOI

Returns the AOI for automatic white balance (similar to IS_AOI_IMAGE_GET_AOI).

IS_AOI_MULTI_GET_SUPPORTED_MODES

Returns the supported multi AOI modes in an UINT object.

IS_AOI_MULTI_SET_AOI

Sets the multi AOI mode. The mode you want to use has to be ORed with IS_AOI_MULTI_SET_AOI.

Sample 1 for multi AOI

IS_AOI_MULTI_GET_AOI

Returns the set multi AOI mode. The mode that is used has to be ORed with IS_AOI_MULTI_SET_AOI.

Sample 2 fo multi AOI

IS_AOI_MULTI_DISABLE_AOI

Disables Multi AOI. The mode that is used has to be ORed with IS_AOI_MULTI_SET_AOI.

Sample 3 for multi AOI

IS_AOI_SEQUENCE_GET_SUPPORTED

Returns a bitmask with the supported AOIs (only UI-124x/UI-324x/UI-524x camera models)

Sample 1 for AOI sequence mode

IS_AOI_SEQUENCE_SET_PARAMS

Sets the parameters of AOI 2, 3 or 4 (only UI-124x/UI-324x/UI-524x camera models)

Sample 2 for sequence AOI mode

IS_AOI_SEQUENCE_GET_PARAMS

Returns the parameters of AOI 2, 3 or 4 (only UI-124x/UI-324x/UI-524x camera models)

Sample 2 for sequence AOI mode

IS_AOI_SEQUENCE_SET_ENABLE

Set a bitmask defining which AOIs should be active (only UI-124x/UI-324x/UI-524x camera models).

Note: IS_AOI_SEQUENCE_SET_PARAMS must be called after IS_AOI_SEQUENCE_SET_ENABLE, with enabling the sequence AOI mode all AOIs are set to the same value and therefore the parameters are lost.

Sample 3 for sequence AOI mode

IS_AOI_SEQUENCE_GET_ENABLE

Returns the bitmask (only UI-124x/UI-324x/UI-524x camera models)

Sample 3 for sequence AOI mode

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).
As a change of AOI 1 also reset the exposure time, this change is also transferred to AOI 2, 3 and 4.

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

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

  }

}

Examples for setting absolute AOI positions in memory

x = 100

y = 100

Fig. 162: AOI without absolute memory positioning

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

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

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

Sample 1 for multi AOI

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

Sample 2 for multi AOI

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

Sample 3 for multi AOI

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


Suggestion for improvement? Send us your short Feedback on this chapter. Thank you very much!

For technical questions please contact you local distributor or use the support form on our website.


© 2012 IDS Imaging Development Systems GmbH
http://www.ids-imaging.com