Sharpness measurement algorithms for focus evaluation. More...
Enumerations | |
| enum | peak_afl_controller_sharpness_algorithm { PEAK_AFL_CONTROLLER_SHARPNESS_ALGORITHM_AUTO , PEAK_AFL_CONTROLLER_SHARPNESS_ALGORITHM_TENENGRAD , PEAK_AFL_CONTROLLER_SHARPNESS_ALGORITHM_SOBEL , PEAK_AFL_CONTROLLER_SHARPNESS_ALGORITHM_MEAN_SCORE , PEAK_AFL_CONTROLLER_SHARPNESS_ALGORITHM_HISTOGRAM_VARIANCE } |
| Focus sharpness calculation algorithms. More... | |
Functions | |
| PEAK_AFL_API_STATUS | peak_afl_AutoController_SharpnessAlgorithm_IsSupported (peak_afl_controller_handle controller, peak_afl_BOOL8 *supported) |
| Check if setting a sharpness algorithm is supported by a controller. | |
| PEAK_AFL_API_STATUS | peak_afl_AutoController_SharpnessAlgorithm_Set (peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm algorithm) |
| Set the used sharpness algorithm for a controller. | |
| PEAK_AFL_API_STATUS | peak_afl_AutoController_SharpnessAlgorithm_Get (peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm *algorithm) |
| Get the used sharpness algorithm for a controller. | |
| PEAK_AFL_API_STATUS | peak_afl_AutoController_SharpnessAlgorithm_GetList (peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm *typeList, uint32_t *listSize) |
| Get the list of supported sharpness algorithms for a controller. | |
Sharpness measurement algorithms for focus evaluation.
Sets the algorithm for the sharpness calculation.
Focus sharpness calculation algorithms.
Defines the mathematical algorithms used to calculate image sharpness for automatic focus control. Different algorithms have varying sensitivity to different types of image content and noise conditions.
| Enumerator | |
|---|---|
| PEAK_AFL_CONTROLLER_SHARPNESS_ALGORITHM_AUTO | Automatic algorithm selection. Default sharpness algorithm.
|
| PEAK_AFL_CONTROLLER_SHARPNESS_ALGORITHM_TENENGRAD | Tenengrad gradient-based algorithm. Uses gradient magnitude calculations to measure image sharpness. Effective for images with clear edges and high contrast features. Computationally efficient and works well in most lighting conditions.
|
| PEAK_AFL_CONTROLLER_SHARPNESS_ALGORITHM_SOBEL | Sobel edge detection algorithm. Uses Sobel edge detection operators to measure sharpness based on edge strength. Particularly effective for images with fine details and textures. More sensitive to noise than Tenengrad.
|
| PEAK_AFL_CONTROLLER_SHARPNESS_ALGORITHM_MEAN_SCORE | Mean score algorithm. Calculates sharpness based on statistical measures of image content. Provides stable measurements but may be less sensitive to fine details. Good for consistent performance across varying image content.
|
| PEAK_AFL_CONTROLLER_SHARPNESS_ALGORITHM_HISTOGRAM_VARIANCE | Histogram variance algorithm. Uses histogram analysis to measure image sharpness based on intensity distribution variance. Effective for images with good contrast but may be affected by lighting variations.
|
| PEAK_AFL_API_STATUS peak_afl_AutoController_SharpnessAlgorithm_Get | ( | peak_afl_controller_handle | controller, |
| peak_afl_controller_sharpness_algorithm * | algorithm ) |
Get the used sharpness algorithm for a controller.
Retrieves the currently configured sharpness algorithm that the controller is using for focus evaluation. This is the same algorithm that was previously set using peak_afl_AutoController_SharpnessAlgorithm_Set.
| [in] | controller | controller handle |
| [out] | algorithm | auto controller sharpness algorithm |
| PEAK_AFL_API_STATUS peak_afl_AutoController_SharpnessAlgorithm_GetList | ( | peak_afl_controller_handle | controller, |
| peak_afl_controller_sharpness_algorithm * | typeList, | ||
| uint32_t * | listSize ) |
Get the list of supported sharpness algorithms for a controller.
Retrieves all sharpness algorithms that are supported by the specified controller. This function allows you to discover which sharpness algorithms are available for focus evaluation before attempting to configure one. The available algorithms may vary based on the controller implementation and hardware capabilities.
Uses the Two Staged Data Query principle: call first with NULL to get the required buffer size, then call again with an allocated buffer to retrieve the actual algorithm list.
To set a specific sharpness algorithm, see peak_afl_AutoController_SharpnessAlgorithm_Set.
| [in] | controller | controller handle |
| [out] | typeList | Pointer to a user allocated list of peak_afl_controller_sharpness_algorithm. If this parameter is NULL, listSize will contain the needed count of typeList. |
| [in,out] | listSize | Size of typeList:
|
| PEAK_AFL_API_STATUS peak_afl_AutoController_SharpnessAlgorithm_IsSupported | ( | peak_afl_controller_handle | controller, |
| peak_afl_BOOL8 * | supported ) |
Check if setting a sharpness algorithm is supported by a controller.
If supported is PEAK_AFL_TRUE sharpness algorithm is supported, otherwise it is unsupported.
Call peak_afl_AutoController_SharpnessAlgorithm_GetList to get a list of supported sharpness algorithms.
| [in] | controller | controller handle |
| [out] | supported | boolean if controller supports setting a sharpness algorithm |
| PEAK_AFL_API_STATUS peak_afl_AutoController_SharpnessAlgorithm_Set | ( | peak_afl_controller_handle | controller, |
| peak_afl_controller_sharpness_algorithm | algorithm ) |
Set the used sharpness algorithm for a controller.
Configures the sharpness algorithm that the controller will use for focus evaluation and automatic focus adjustments. Different sharpness algorithms use different mathematical approaches to measure image sharpness, which can affect focus accuracy and speed in different scenarios.
The choice of sharpness algorithm can be critical for optimal focus performance, especially in challenging lighting conditions or with specific types of subjects.
To get a list of supported sharpness algorithms for this controller, call peak_afl_AutoController_SharpnessAlgorithm_GetList first.
| [in] | controller | controller handle |
| [in] | algorithm | auto controller sharpness algorithm |