IDS peak comfortC v1.14.2
Loading...
Searching...
No Matches
Auto focus control

Data Structures

struct  peak_focus_roi
 The peak focus ROI (2D) with weight. More...

Enumerations

enum  peak_focus_roi_weight { PEAK_FOCUS_ROI_WEIGHT_INVALID , PEAK_FOCUS_ROI_WEIGHT_WEAK , PEAK_FOCUS_ROI_WEIGHT_MEDIUM , PEAK_FOCUS_ROI_WEIGHT_STRONG }
 The peak focus ROI weight classes. More...
enum  peak_auto_focus_search_algorithm {
  PEAK_AUTO_FOCUS_SEARCH_ALGORITHM_INVALID , PEAK_AUTO_FOCUS_SEARCH_ALGORITHM_GOLDEN_RATIO , PEAK_AUTO_FOCUS_SEARCH_ALGORITHM_HILL_CLIMBING , PEAK_AUTO_FOCUS_SEARCH_ALGORITHM_FULL_SCAN ,
  PEAK_AUTO_FOCUS_SEARCH_ALGORITHM_GLOBAL_SEARCH
}
 The peak focus search algorithm. More...
enum  peak_sharpness_algorithm {
  PEAK_SHARPNESS_ALGORITHM_INVALID , PEAK_SHARPNESS_ALGORITHM_TENENGRAD , PEAK_SHARPNESS_ALGORITHM_SOBEL , PEAK_SHARPNESS_ALGORITHM_MEAN_SCORE ,
  PEAK_SHARPNESS_ALGORITHM_HISTOGRAM_VARIANCE
}
 The peak sharpness measurement algorithm. More...

Functions

peak_access_status peak_IPL_AutoFocus_GetAccessStatus (peak_camera_handle hCam)
 Query the auto focus access status.
peak_status peak_IPL_AutoFocus_ROI_Set (peak_camera_handle hCam, const peak_focus_roi *autoFocusROIList, size_t autoFocusROICount)
 Set the list of host auto focus regions of interest.
peak_status peak_IPL_AutoFocus_ROI_Get (peak_camera_handle hCam, peak_focus_roi *autoFocusROIList, size_t *autoFocusROICount)
 Get the list of host auto focus regions of interest.
peak_status peak_IPL_AutoFocus_Mode_Set (peak_camera_handle hCam, peak_auto_feature_mode autoFocusMode)
 Set the host auto focus control mode.
peak_status peak_IPL_AutoFocus_Mode_Get (peak_camera_handle hCam, peak_auto_feature_mode *autoFocusMode)
 Get the host auto focus control mode.
peak_status peak_IPL_AutoFocus_SearchAlgorithm_Set (peak_camera_handle hCam, peak_auto_focus_search_algorithm searchAlgorithm)
 Set the host auto focus search algorithm.
peak_status peak_IPL_AutoFocus_SearchAlgorithm_Get (peak_camera_handle hCam, peak_auto_focus_search_algorithm *searchAlgorithm)
 Get the host auto focus search algorithm.
peak_status peak_IPL_AutoFocus_SharpnessAlgorithm_Set (peak_camera_handle hCam, peak_sharpness_algorithm sharpnessAlgorithm)
 Set the host auto focus sharpness algorithm.
peak_status peak_IPL_AutoFocus_SharpnessAlgorithm_Get (peak_camera_handle hCam, peak_sharpness_algorithm *sharpnessAlgorithm)
 Get the focus sharpness algorithm.
peak_status peak_IPL_AutoFocus_Range_Set (peak_camera_handle hCam, uint32_t rangeBegin, uint32_t rangeEnd)
 Set the host auto focus range.
peak_status peak_IPL_AutoFocus_Range_Get (peak_camera_handle hCam, uint32_t *rangeBegin, uint32_t *rangeEnd)
 Get the host auto focus range.
peak_status peak_IPL_AutoFocus_Hysteresis_Set (peak_camera_handle hCam, uint8_t hysteresis)
 Set the host auto focus hysteresis.
peak_status peak_IPL_AutoFocus_Hysteresis_Get (peak_camera_handle hCam, uint8_t *hysteresis)
 Get the host auto focus hysteresis.
peak_status peak_IPL_AutoFocus_Hysteresis_GetRange (peak_camera_handle hCam, uint8_t *minHysteresis, uint8_t *maxHysteresis, uint8_t *incHysteresis)
 Get the current range of valid auto focus hysteresis values.

Detailed Description

Auto focus related functions and types.

After each configuration change, the autofocus must be retriggered. This is necessary for both "Once" and "Continuous" mode.

Enumeration Type Documentation

◆ peak_auto_focus_search_algorithm

The peak focus search algorithm.

Enumerator
PEAK_AUTO_FOCUS_SEARCH_ALGORITHM_INVALID 

Invalid search algorithm type.

Use this value for the initialization of variables of type peak_search_algorithm.

PEAK_AUTO_FOCUS_SEARCH_ALGORITHM_GOLDEN_RATIO 

Search algorithm Golden Ratio.

Searches and refines the maximum search by subdividing the search area by the golden ratio.

PEAK_AUTO_FOCUS_SEARCH_ALGORITHM_HILL_CLIMBING 

Search algorithm Hill Climbing.

Detects a maximum when the sharpness values no longer increase and aborts searching in the following focus area with the first decrease in sharpness value.

PEAK_AUTO_FOCUS_SEARCH_ALGORITHM_FULL_SCAN 

Search algorithm Full Scan.

Calculates the sharpness values in the entire search range in a single pass without a search strategy.

PEAK_AUTO_FOCUS_SEARCH_ALGORITHM_GLOBAL_SEARCH 

Search algorithm Full Scan.

Starts the coarse search in the far range with a large search interval.

◆ peak_focus_roi_weight

The peak focus ROI weight classes.

Enumerator
PEAK_FOCUS_ROI_WEIGHT_INVALID 

Invalid focus ROI weight.

Use this value for the initialization of variables of type peak_focus_roi_weight.

PEAK_FOCUS_ROI_WEIGHT_WEAK 

Focus ROI weight weak.

PEAK_FOCUS_ROI_WEIGHT_MEDIUM 

Focus ROI weight medium.

PEAK_FOCUS_ROI_WEIGHT_STRONG 

Focus ROI weight strong.

◆ peak_sharpness_algorithm

The peak sharpness measurement algorithm.

Enumerator
PEAK_SHARPNESS_ALGORITHM_INVALID 

Invalid sharpness algorithm type.

Use this value for the initialization of variables of type peak_sharpness_algorithm.

PEAK_SHARPNESS_ALGORITHM_TENENGRAD 

Sharpness algorithm Tenengrad.

Image sharpness calculation due edge sharpness.

PEAK_SHARPNESS_ALGORITHM_SOBEL 

Sharpness algorithm Sobel.

Image sharpness calculation due edge sharpness.

PEAK_SHARPNESS_ALGORITHM_MEAN_SCORE 

Sharpness algorithm Mean Score.

Simpler pixel calculations and smaller neighboorhood than Tenengrad.

PEAK_SHARPNESS_ALGORITHM_HISTOGRAM_VARIANCE 

Sharpness algorithm Histogram Variance.

Uses histogram values to determine the image sharpness.

Function Documentation

◆ peak_IPL_AutoFocus_GetAccessStatus()

peak_access_status peak_IPL_AutoFocus_GetAccessStatus ( peak_camera_handle hCam)

Query the auto focus access status.

Provides the current access status for the auto focus feature.

This function implements the Access Status Query principle.

Parameters
[in]hCamThe camera handle.
Returns
PEAK_ACCESS_READWRITE The auto focus feature is readable and writeable.
PEAK_ACCESS_READONLY The auto focus feature is readable only.
PEAK_ACCESS_GFA_LOCK The auto focus feature is not accessible because the GFA write access is enabled.
PEAK_ACCESS_NONE The auto focus feature is not accessible.
PEAK_ACCESS_NOT_SUPPORTED The auto focus feature is not supported.
PEAK_ACCESS_INVALID The function failed. Call peak_Library_GetLastError to get the error code and description.

If the function indicates an error by returning PEAK_ACCESS_INVALID, these are the possible errors:

Since
1.3

◆ peak_IPL_AutoFocus_Hysteresis_Get()

peak_status peak_IPL_AutoFocus_Hysteresis_Get ( peak_camera_handle hCam,
uint8_t * hysteresis )

Get the host auto focus hysteresis.

Reads the current auto focus hysteresis value ("search accuracy").

Parameters
[in]hCamThe camera handle.
[out]hysteresisThe hysteresis.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The focus feature is not available for read access. Check the access status via peak_IPL_AutoFocus_GetAccessStatus.
PEAK_STATUS_INVALID_PARAMETER hysteresis is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.3

◆ peak_IPL_AutoFocus_Hysteresis_GetRange()

peak_status peak_IPL_AutoFocus_Hysteresis_GetRange ( peak_camera_handle hCam,
uint8_t * minHysteresis,
uint8_t * maxHysteresis,
uint8_t * incHysteresis )

Get the current range of valid auto focus hysteresis values.

Queries the current range of valid values for the auto focus hysteresis property.

Parameters
[in]hCamThe camera handle.
[out]minHysteresisThe minimum hysteresis.
[out]maxHysteresisThe maximum hysteresis.
[out]incHysteresisThe hysteresis increment.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The focus feature is not available for read access. Check the access status via peak_IPL_AutoFocus_GetAccessStatus.
PEAK_STATUS_INVALID_PARAMETER At least one of minHysteresis, maxHysteresis, and incHysteresis is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.3

◆ peak_IPL_AutoFocus_Hysteresis_Set()

peak_status peak_IPL_AutoFocus_Hysteresis_Set ( peak_camera_handle hCam,
uint8_t hysteresis )

Set the host auto focus hysteresis.

Writes the auto focus hysteresis value ("search accuracy").

Parameters
[in]hCamThe camera handle.
[in]hysteresisThe hysteresis to set.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The focus feature is not available for write access. Check the access status via peak_IPL_AutoFocus_GetAccessStatus.
PEAK_STATUS_OUT_OF_RANGE hysteresis is out of range. Check the range of valid values via peak_IPL_AutoFocus_Hysteresis_GetRange.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.3

◆ peak_IPL_AutoFocus_Mode_Get()

peak_status peak_IPL_AutoFocus_Mode_Get ( peak_camera_handle hCam,
peak_auto_feature_mode * autoFocusMode )

Get the host auto focus control mode.

Reads the current host auto focus control mode.

Parameters
[in]hCamThe camera handle.
[out]autoFocusModeThe current auto focus control mode.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_INVALID_PARAMETER autoFocusMode is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.3

◆ peak_IPL_AutoFocus_Mode_Set()

peak_status peak_IPL_AutoFocus_Mode_Set ( peak_camera_handle hCam,
peak_auto_feature_mode autoFocusMode )

Set the host auto focus control mode.

Writes the desired host auto focus control mode.

Parameters
[in]hCamThe camera handle.
[in]autoFocusModeThe auto focus control mode to set.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_INVALID_PARAMETER autoFocusMode is an invalid auto feature mode. Check peak_auto_feature_mode.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.3

◆ peak_IPL_AutoFocus_Range_Get()

peak_status peak_IPL_AutoFocus_Range_Get ( peak_camera_handle hCam,
uint32_t * rangeBegin,
uint32_t * rangeEnd )

Get the host auto focus range.

Reads the current begin and end of the auto focus search range.

Parameters
[in]hCamThe camera handle.
[out]rangeBeginThe begin of the focus search range.
[out]rangeEndThe end of the focus search range.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The focus feature is not available for read access. Check the access status via peak_IPL_AutoFocus_GetAccessStatus.
PEAK_STATUS_INVALID_PARAMETER At least one of rangeBegin and rangeEnd is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.3

◆ peak_IPL_AutoFocus_Range_Set()

peak_status peak_IPL_AutoFocus_Range_Set ( peak_camera_handle hCam,
uint32_t rangeBegin,
uint32_t rangeEnd )

Set the host auto focus range.

Writes the begin and end of the focus search range.

Parameters
[in]hCamThe camera handle.
[in]rangeBeginThe begin of the focus search range to set.
[in]rangeEndThe end of the focus search range to set.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The focus feature is not available for write access. Check the access status via peak_IPL_AutoFocus_GetAccessStatus.
PEAK_STATUS_OUT_OF_RANGE At least one of rangeBegin and rangeEnd is out of range or rangeEnd is less than rangeBegin.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.3

◆ peak_IPL_AutoFocus_ROI_Get()

peak_status peak_IPL_AutoFocus_ROI_Get ( peak_camera_handle hCam,
peak_focus_roi * autoFocusROIList,
size_t * autoFocusROICount )

Get the list of host auto focus regions of interest.

Reads the current host auto focus ROI list.

This function implements the Two Staged Data Query principle.

Parameters
[in]hCamThe camera handle.
[out]autoFocusROIListPointer to a user allocated array buffer to receive the focus ROI list. If this parameter is NULL, autoFocusROICount will contain the current number of ROIs.
The required size of autoFocusROIList in bytes is autoFocusROICount x sizeof(peak_focus_roi).
[in,out]autoFocusROICount
  • autoFocusROIList equal NULL:
    out: minimal number of focus ROIs autoFocusROIList must be large enough to hold
  • autoFocusROIList unequal NULL:
    in: number of ROIs autoFocusROIList can hold
    out: number of ROIs filled by the function
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The auto focus feature is not accessible. Check the access status via peak_IPL_AutoFocus_GetAccessStatus.
PEAK_STATUS_BUFFER_TOO_SMALL autoFocusROIList is not NULL and the value of *autoFocusROICount is too small to receive the expected amount of data.
PEAK_STATUS_INVALID_PARAMETER autoFocusROICount is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.3

◆ peak_IPL_AutoFocus_ROI_Set()

peak_status peak_IPL_AutoFocus_ROI_Set ( peak_camera_handle hCam,
const peak_focus_roi * autoFocusROIList,
size_t autoFocusROICount )

Set the list of host auto focus regions of interest.

Writes the desired host auto focus ROI list.

Parameters
[in]hCamThe camera handle.
[in]autoFocusROIListThe list of auto focus ROI to set.
[in]autoFocusROICountThe number of ROIs.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The auto focus feature is not available for write access. Check the access status via peak_IPL_AutoFocus_GetAccessStatus.
PEAK_STATUS_OUT_OF_RANGE At least one of the ROIs in autoFocusROIList is out of range.
PEAK_STATUS_INVALID_PARAMETER autoFocusROIList is an invalid pointer or at least one of the ROIs in autoFocusROIList is invalid.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.3

◆ peak_IPL_AutoFocus_SearchAlgorithm_Get()

peak_status peak_IPL_AutoFocus_SearchAlgorithm_Get ( peak_camera_handle hCam,
peak_auto_focus_search_algorithm * searchAlgorithm )

Get the host auto focus search algorithm.

Reads the current host auto focus search algorithm.

Parameters
[in]hCamThe camera handle.
[out]searchAlgorithmThe search algorithm.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The focus feature is not available for read access. Check the access status via peak_IPL_AutoFocus_GetAccessStatus.
PEAK_STATUS_INVALID_PARAMETER searchAlgorithm is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.3

◆ peak_IPL_AutoFocus_SearchAlgorithm_Set()

peak_status peak_IPL_AutoFocus_SearchAlgorithm_Set ( peak_camera_handle hCam,
peak_auto_focus_search_algorithm searchAlgorithm )

Set the host auto focus search algorithm.

Writes the host auto focus search algorithm.

The search algorithm is only used in the auto once mode.
The search algorithm is assumed when the auto once mode is enabled.

Parameters
[in]hCamThe camera handle.
[in]searchAlgorithmThe search algorithm.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The focus feature is not available for write access. Check the access status via peak_IPL_AutoFocus_GetAccessStatus.
PEAK_STATUS_INVALID_PARAMETER searchAlgorithm is an invalid auto focus search algorithm. Check peak_auto_focus_search_algorithm.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.3

◆ peak_IPL_AutoFocus_SharpnessAlgorithm_Get()

peak_status peak_IPL_AutoFocus_SharpnessAlgorithm_Get ( peak_camera_handle hCam,
peak_sharpness_algorithm * sharpnessAlgorithm )

Get the focus sharpness algorithm.

Reads the current auto focus sharpness algorithm.

Parameters
[in]hCamThe camera handle.
[out]sharpnessAlgorithmThe search algorithm.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The focus feature is not available for read access. Check the access status via peak_IPL_AutoFocus_GetAccessStatus.
PEAK_STATUS_INVALID_PARAMETER sharpnessAlgorithm is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.3

◆ peak_IPL_AutoFocus_SharpnessAlgorithm_Set()

peak_status peak_IPL_AutoFocus_SharpnessAlgorithm_Set ( peak_camera_handle hCam,
peak_sharpness_algorithm sharpnessAlgorithm )

Set the host auto focus sharpness algorithm.

Writes the auto focus sharpness algorithm.

The sharpness algorithm is only used in the auto once mode.
The sharpness algorithm is applied when the auto once mode is enabled.

Parameters
[in]hCamThe camera handle.
[in]sharpnessAlgorithmThe sharpness algorithm to set.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The focus feature is not available for write access. Check the access status via peak_IPL_AutoFocus_GetAccessStatus.
PEAK_STATUS_INVALID_PARAMETER sharpnessAlgorithm is an invalid sharpness algorithm. Check peak_sharpness_algorithm.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.3