uEye Camera Manual Version 4.92
![]() |
![]() |
USB 2.0 USB 3.0 GigE |
USB 2.0 USB 3.0 GigE |
Syntax
INT is_Measure(HIDS hCam, UINT nCommand, void* pParam, UINT cbSizeOfParam)
Description
The function allows the measurement of the sharpness in a defined AOI of the current image. To get a sharpness value the edges in the image are evaluated. The sharpness can only be indicated as a relative value as it depends on the edges in the current image. An image with less edges will not reach the sharpness value of an image with a lot of edges.
The higher the value, the better the sharpness. The value can be used in comparative measurements to detect changes in the image acquisition of the same object, e.g. caused by readjusted lenses.
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 cbSizeOfParam input parameter.
Input parameters
hCam |
Camera handle |
||||||
|
|||||||
pParam |
Pointer to a function parameter, whose function depends on nCommand. |
||||||
cbSizeOfParam |
Size (in bytes) of the memory area to which pParam refers. |
||||||
Content of the MEASURE_SHARPNESS_AOI_INFO structure
UINT |
u32NumberAOI |
ID of the AOI |
UINT |
u32SharpnessValue |
Relative sharpness value in the defined AOI |
IS_RECT |
rcAOI |
Position and size of the AOI: •s32X: X position •s32Y: Y position •s32Width: AOI width •s32Height: AOI height |
Content of the MEASURE_SHARPNESS_AOI_PRESETS enumeration
IS_MEASURE_SHARPNESS_AOI_PRESET_1 |
Predefined AOI for the sharpness measurement (in each of the four image corner and in the center) |
Return values
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_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_SUPPORTED |
The camera model used here does not support this function or setting. |
IS_SUCCESS |
Function executed successfully |
INT nRet = IS_SUCCESS;
/* Create info object */
MEASURE_SHARPNESS_AOI_INFO measureSharpnessInfo;
/* Set values of AOI_0: The position and size of the AOI equals the whole image */
measureSharpnessInfo.u32NumberAOI = 0;
measureSharpnessInfo.rcAOI.s32X = 0;
measureSharpnessInfo.rcAOI.s32Y = 0;
measureSharpnessInfo.rcAOI.s32Width = m_s32MaxImageWidth;
measureSharpnessInfo.rcAOI.s32Height = m_s32MaxImageHeight;
/* Set AOI_0 */
nRet = is_Measure(m_hCam, IS_MEASURE_CMD_SHARPNESS_AOI_SET, (void*)&measureSharpnessInfo,
sizeof(measureSharpnessInfo));
/* Set values of AOI_1 */
measureSharpnessInfo.u32NumberAOI = 1;
measureSharpnessInfo.rcAOI.s32X = 50;
measureSharpnessInfo.rcAOI.s32Y = 50;
measureSharpnessInfo.rcAOI.s32Width = 200;
measureSharpnessInfo.rcAOI.s32Height = 200;
/* Set AOI_1 */
nRet = is_Measure(m_hCam, IS_MEASURE_CMD_SHARPNESS_AOI_SET, (void*)&measureSharpnessInfo,
sizeof(measureSharpnessInfo));
INT nRet = IS_SUCCESS;
/* Create info object */
MEASURE_SHARPNESS_AOI_INFO measureSharpnessInfo;
/* Get values of AOI_0 */
measureSharpnessInfo.u32NumberAOI = 0;
nRet = is_Measure(m_hCam, IS_MEASURE_CMD_SHARPNESS_AOI_INQUIRE, (void*)&measureSharpnessInfo,
sizeof(measureSharpnessInfo));
if (nRet == IS_SUCCESS)
{
UINT s32Sharpness = measureSharpnessInfo.u32SharpnessValue;
}
INT nRet = IS_SUCCESS;
/* Set preset */
UINT nPreset = IS_MEASURE_SHARPNESS_AOI_PRESET_1;
nRet = is_Measure(m_hCam, IS_MEASURE_CMD_SHARPNESS_AOI_SET_PRESET, (void*)&nPreset,
sizeof(nPreset));
Suggestion for improvement? Send us your short
Feedback on this chapter.
Thank you very much!
For technical questions please contact your local distributor or use the support form on our website.