Please enable JavaScript to view this site.

IDS Software Suite 4.96.1

Navigation: C: Programming > Function descriptions > is_AOI

Using the multi AOI function

Scroll Previous Top Next More
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

hint_info

The multi AOI function is currently supported by the following models:

UI-124x/UI-324x/UI-524x (max. 4 AOIs, 2 per X and Y direction)

UI-125x/UI-325x/UI-525x (max. 4 AOIs, 2 per X and Y direction)

UI-300x (max. 64 AOIs, 8 per X and Y direction)

UI-304x/UI-504x (max. 4 AOIs, 2 per X and Y direction)
Note that the UI-304xLE does not support the multi AOI function.

UI-306x (max. 16 AOIs, 4 per X and Y direction)

UI-307x (max. 64 AOIs, 8 per X and Y direction)

UI-308x (max. 64 AOIs, 8 per X and Y direction)

UI-309x (max. 64 AOIs, 8 per X and Y direction)

UI-313xLE (max. 4 AOIs, 2 per X and Y direction)

UI-313xCP Rev. 2/UI-513x (max. 8 AOIs, 4 x 2 or 2 x 4 per X and Y direction)

UI-314x/UI-514x (max. 8 AOIs, 4 x 2 or 2 x 4 per X and Y direction)

UI-316x (max. 16 AOIs, 4 per X and Y direction)

UI-318x (max. 16 AOIs, 4 per X and Y direction)

UI-336x/UI-536x (max. 8 AOIs in Y direction)

UI-337x/UI-537x (max. 8 AOIs in Y direction)

The sensors of the models UI-124x/UI-324x/UI-524x and UI-125x/UI-325x/UI-525x support multiple AOIs in one image capturing. The AOIs are transferred together as one image. In this mode, you can create 2 or 4 AOIs, which have either the same x-axes or the same y-axes. The sensor is faster in this mode.

The sensors of the models UI-336x/UI-536x and UI-337x/UI-537x support multiple AOI in one image capturing. The AOIs are transferred together as one image. In this mode, you can create maximum 8 AOIs with up to 16 y-axes. X-axes are not supported.

The sensors of the models UI-306x and UI-308x support multiple AOIs in one image capturing. The AOIs are transferred together as one image. In this mode, you can create up to 4 AOIs in horizontal and vertical direction for UI-306x and up to 8 AOIs for UI-308x.

The sensors of the models UI-313x, UI-314x, UI-316x, and UI-318x support multiple AOIs in one image capturing. The AOIs are transferred together as one image. In this mode, you can define for the cameras:

UI-313x and UI-314x: up to 8 AOIs (horizontal x vertical: 4 x 2 or 2 x 4)

UI-316x and UI-318x: up to 16 AOIs (horizontal x vertical: 4 x 4)

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.

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.

Content of the IS_MULTI_AOI_CONTAINER structure

UINT

nNumberOfAOIs

Number of entries in pMultiAOIList

IS_MULTI_AOI_DESCRIPTOR

pMultiAOIList

Data of the single AOIs

See IS_MULTI_AOI_DESCRIPTOR

Content of the IS_MULTI_AOI_DESCRIPTOR structure

UINT

nPosX

Start position of the AOI in x direction

UI-336x/UI-536x and UI-337x/UI-537x only: nPosX = 0

UINT

nPosY

Start position of the AOI in y direction

UINT

nWidth

AOI width

UI-336x/UI-536x and UI-337x/UI-537x only: nWidth = min. multi AOI width (see IS_AOI_MULTI_GET_AOI | IS_AOI_MULTI_MODE_GET_MINIMUM_SIZE)

UINT

nHeight

AOI height

UINT

nStatus

Current state of the AOI:

IS_AOI_MULTI_STATUS_SETBYUSER: User-defined AOI. Must be set by the user.

IS_AOI_MULTI_STATUS_COMPLEMENT: The API completed automatically the AOI.

IS_AOI_MULTI_STATUS_VALID: The AOI is valid and checked.

IS_AOI_MULTI_STATUS_CONFLICT: The AOI conflicts with another AOI, for example by horizontal or vertical overlapping.

IS_AOI_MULTI_STATUS_ERROR: The AOI is incorrect, for example the AOI is to small, the AOI size is invalid, the maximum number of AOI (per direction) is exceeded, or the AOI position is invalid.

IS_AOI_MULTI_STATUS_UNUSED: The AOI is not active.

Example 1

/* Create structure */
IS_MULTI_AOI_CONTAINER * m_psMultiAOIs = new IS_MULTI_AOI_CONTAINER;
m_psMultiAOIs->nNumberOfAOIs = 0;
 
/* Query how many AOIs can be defined */
int m_nMaxNumberMultiAOIs = 0;
is_AOI(m_hCam, IS_AOI_MULTI_GET_AOI | IS_AOI_MULTI_MODE_GET_MAX_NUMBER, (void *)&m_nMaxNumberMultiAOIs, sizeof(m_nMaxNumberMultiAOIs));
 
/* Query the minimum size of a single AOI in multi AOI mode */
IS_SIZE_2D rMinSizeAOI;
is_AOI(m_hCam, IS_AOI_MULTI_GET_AOI | IS_AOI_MULTI_MODE_GET_MINIMUM_SIZE, (void *)&rMinSizeAOI, sizeof(rMinSizeAOI));
 
/* If multi AOI is supported, allocate the necessary memory */
if (m_nMaxNumberMultiAOIs > 1)
{
/* Note: Always create the structure of the multi AOI for the maximum number of settable AOIs. */
 m_psMultiAOIs->nNumberOfAOIs = m_nMaxNumberMultiAOIs;
m_psMultiAOIs->pMultiAOIList = new IS_MULTI_AOI_DESCRIPTOR[m_nMaxNumberMultiAOIs];
ZeroMemory(m_psMultiAOIs->pMultiAOIList, sizeof(IS_MULTI_AOI_DESCRIPTOR) * m_nMaxNumberMultiAOIs);
 
/* Set AOI on position (100/200) with size (160/180) */
m_psMultiAOIs->pMultiAOIList[0].nPosX = 100;
m_psMultiAOIs->pMultiAOIList[0].nPosY = 200;
m_psMultiAOIs->pMultiAOIList[0].nWidth = 160;
m_psMultiAOIs->pMultiAOIList[0].nHeight = 180;
m_psMultiAOIs->pMultiAOIList[0].nStatus = IS_AOI_MULTI_STATUS_SETBYUSER; /* Initially defined as user-defined AOI */
 
/* Set further AOIs on position (400/800) with size (120/140). Take care on m_nMaxNumberMultiAOIs! */
m_psMultiAOIs->pMultiAOIList[1].nPosX = 400;
m_psMultiAOIs->pMultiAOIList[1].nPosY = 800;
m_psMultiAOIs->pMultiAOIList[1].nWidth = 120;
m_psMultiAOIs->pMultiAOIList[1].nHeight = 140;
m_psMultiAOIs->pMultiAOIList[1].nStatus = IS_AOI_MULTI_STATUS_SETBYUSER;
 
/* Verify the configuration */
int nRet = is_AOI(m_hCam, IS_AOI_MULTI_SET_AOI | IS_AOI_MULTI_MODE_ONLY_VERIFY_AOIS, (void*)m_psMultiAOIs, sizeof(IS_MULTI_AOI_CONTAINER) + sizeof(IS_MULTI_AOI_DESCRIPTOR) * m_psMultiAOIs->nNumberOfAOIs);
 
/* If the configuration is valid, set configuration etc. */
if (nRet == IS_SUCCESS) {
  nRet = is_AOI(m_hCam, IS_AOI_MULTI_SET_AOI, (void*)m_psMultiAOIs, sizeof(IS_MULTI_AOI_CONTAINER) + sizeof(IS_MULTI_AOI_DESCRIPTOR) * m_psMultiAOIs->nNumberOfAOIs);
}
 
/* Query the current configuration */
is_AOI(m_hCam, IS_AOI_MULTI_GET_AOI, (void *)m_psMultiAOIs, m_psMultiAOIs->nNumberOfAOIs * sizeof(IS_MULTI_AOI_DESCRIPTOR) + sizeof(IS_MULTI_AOI_CONTAINER));
 
/* Count the different AOIs */
int nUsed = 0;
int nComplemented = 0;
int nErronous = 0;
int nConflicted = 0;
for (int i = 0; i < m_nMaxNumberMultiAOIs; i ++) {
  /* Count the used AOIs */
  if (!(m_psMultiAOIs->pMultiAOIList[i].nStatus & IS_AOI_MULTI_STATUS_UNUSED) && (m_psMultiAOIs->pMultiAOIList[i].nWidth > 0) && (m_psMultiAOIs->pMultiAOIList[i].nHeight > 0)) {
    nUsed++;
  }
 

  /* Count the added AOIs */
  if (m_psMultiAOIs->pMultiAOIList[i].nStatus & IS_AOI_MULTI_STATUS_COMPLEMENT) {
    nComplemented++;
   }
 
  /* Count the broken AOIs */
  if (m_psMultiAOIs->pMultiAOIList[i].nStatus & IS_AOI_MULTI_STATUS_ERROR) {
    nErronous++;
  }
 
  /* Count the critical AOIs (for example overlapping) */
  if (m_psMultiAOIs->pMultiAOIList[i].nStatus & IS_AOI_MULTI_STATUS_CONFLICT) {
    nConflicted++;
  }
}
 
/* Delete AOI with the index 1 */
if (IS_SUCCESS == is_AOI(m_hCam, IS_AOI_MULTI_GET_AOI, (void*)m_psMultiAOIs, m_psMultiAOIs->nNumberOfAOIs * sizeof(IS_MULTI_AOI_DESCRIPTOR) + sizeof (IS_MULTI_AOI_CONTAINER))){
  m_psMultiAOIs->pMultiAOIList[1].nPosX = 0;
  m_psMultiAOIs->pMultiAOIList[1].nPosY = 0;
  m_psMultiAOIs->pMultiAOIList[1].nWidth = 0;
  m_psMultiAOIs->pMultiAOIList[1].nHeight = 0;
  m_psMultiAOIs->pMultiAOIList[1].nStatus = IS_AOI_MULTI_STATUS_UNUSED;
  nRet = is_AOI(m_hCam, IS_AOI_MULTI_SET_AOI, (void*)m_psMultiAOIs, sizeof(IS_MULTI_AOI_CONTAINER));
}
 
/* Query the default configuration */
is_AOI(m_hCam, IS_AOI_MULTI_GET_AOI | IS_AOI_MULTI_MODE_GET_DEFAULT, (void*)m_psMultiAOIs, sizeof(IS_MULTI_AOI_CONTAINER) + m_psMultiAOIs->nNumberOfAOIs * sizeof (IS_MULTI_AOI_DESCRIPTOR));
}
 
/* Release the memory */
if (m_psMultiAOIs) {
if (m_psMultiAOIs->pMultiAOIList) {
  delete [] m_psMultiAOIs->pMultiAOIList;
}
delete m_psMultiAOIs;
m_psMultiAOIs = NULL;
}

Obsolete parameters

The following parameters for nCommand are obsolete and should no longer be used.

IS_AOI_MULTI_MODE_X_Y_AXES

Multi AOI mode of the camera models UI-124x/UI-324x/UI-524x and UI-125x/UI-325x/UI-525x with up to AOIs (up to 4 x- and y-axis). The axes are passed by a UINT array:

Array[0] - Array[3] = X1…X4

Array[4] - Array[8] = Y1…Y4

Attention: This parameter has been renamed in version 4.20. In formerly versions this parameter was named IS_AOI_MULTI_MODE_AXES.

IS_AOI_MULTI_MODE_Y_AXES

Multi AOI mode supported by the models UI-336x/UI-536x and UI-337x/UI-537x with up to 8 AOI (16 y-axis). The axes are passed by a UINT array:

Array[0] - Array[16] = Y1...Y16

Example 2

// Set Multi AOI. The axes are passed in an UINT array of length 8.
UINT nAxes[8];
 
nAxes[0] = 100; // Set X1
nAxes[1] = 120; // Set X2
...
 
INT nRet = is_AOI(hCam, IS_AOI_MULTI_SET_AOI | IS_AOI_MULTI_MODE_X_Y_AXES, (void*)nAxes, sizeof(nAxes));

Example 3

// Read Multi AOI
UINT nAxes[8];
 
INT nRet = is_AOI(hCam, IS_AOI_MULTI_GET_AOI | IS_AOI_MULTI_MODE_X_Y_AXES, (void*)nAxes, sizeof(nAxes));

Example 4

// Disable Multi AOI
UINT nAxes[8];
 
INT nRet = is_AOI(hCam, IS_AOI_MULTI_DISABLE_AOI | IS_AOI_MULTI_MODE_X_Y_AXES, NULL, NULL);

© 2022 IDS Imaging Development Systems GmbH