Please enable JavaScript to view this site.

IDS Software Suite 4.96.1

Navigation: C: Programming > Function descriptions > is_Focus

Focus settings for USB uEye XS

Scroll Previous Top Next More
Windows_Logo
Linux_Logo

UI-1007XS

UI-1007XS

Syntax

INT is_Focus (HIDS hCam, UINT nCommand, void *pParam, UINT nSizeOfParam)

Description

For the USB uEye XS, you can also use the focus measure window for defining which area should be focused. The position of the measure window can be freely defined.

UI-1007XS: The measure window has a fixed size, which can be queried via FOC_CMD_GET_AUTOFOCUS_ZONE_SIZE_MIN and FOC_CMD_GET_AUTOFOCUS_ZONE_SIZE_MAX.

hint_info

The focus AOI must be reset if a camera reconnect occurs.

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.

hint_info

According to the sensor manufacturer, there is no guarantee that a focal point set manually will lead to a reproducible focal distance. A focal value determined with one model will not necessarily result in the same focal point for a different model.

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.

Return values

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_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_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_INVALID_IMAGE_PARAMETER

The focus AOI is invalid or does not fit into the image AOI.

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_SUCCESS

General error message

IS_NOT_SUPPORTED

The camera model used here does not support this function or setting.

IS_SUCCESS

Function executed successfully

Example 1

/* set auto focus zone */
IS_RECT focusZoneRect;
focusZoneRect.s32X = 16;
focusZoneRect.s32Y = 16;
focusZoneRect.s32Width = 64;
focusZoneRect.s32Height = 64;
 
INT nRet = is_Focus(hCam, FOC_CMD_SET_AUTOFOCUS_ZONE_AOI, (void*)&focusZoneRect, sizeof(focusZoneRect));
if (nRet == IS_SUCCESS)
{
...
}

Example 2

/* get auto focus zone */
IS_RECT focusZoneRect;
 
INT nRet = is_Focus(hCam, FOC_CMD_GET_AUTOFOCUS_ZONE_AOI, (void*)&focusZoneRect, sizeof(focusZoneRect));
if (nRet == IS_SUCCESS)
{
...
}

Example 3

/* receive min position */
IS_POINT_2D pointMin;
nRet = is_Focus(hCam, FOC_CMD_GET_AUTOFOCUS_ZONE_POS_MIN, (void*)&pointMin, sizeof(pointMin));
 
/* receive max position */
IS_POINT_2D pointMax;
nRet = is_Focus(hCam, FOC_CMD_GET_AUTOFOCUS_ZONE_POS_MAX, (void*)&pointMax, sizeof(pointMax));
 
/* receive min size */
IS_SIZE_2D sizeMin;
is_Focus(hCam, FOC_CMD_GET_AUTOFOCUS_ZONE_SIZE_MIN, (void*)&sizeMin, sizeof(sizeMin));
 
/* receive max size */
IS_SIZE_2D sizeMax;
is_Focus(hCam, FOC_CMD_GET_AUTOFOCUS_ZONE_SIZE_MAX, (void*)&sizeMax, sizeof(sizeMax));
 
/* receive zone count */
INT nFocusZoneCount;
nRet = is_Focus(hCam, FOC_CMD_GET_AUTOFOCUS_ZONE_WEIGHT_COUNT, (void*)&nFocusZoneCount, sizeof(nFocusZoneCount));

© 2022 IDS Imaging Development Systems GmbH