IDS peak AFL v2.0.0
Loading...
Searching...
No Matches
SharpnessAlgorithm Class Reference

Sharpness algorithm feature implementation for auto focus controllers. More...

#include <peak_afl/pipeline/modules/controllers/features/peak_afl_sharpness_algorithm.hpp>

Inheritance diagram for SharpnessAlgorithm:
IListFeature< FocusSharpnessAlgorithm > IFeature< FocusSharpnessAlgorithm > ISerializable

Public Member Functions

 SharpnessAlgorithm (std::shared_ptr< peak::afl::Controller > controller)
 Constructs a SharpnessAlgorithm feature with the specified controller.
void Set (const FocusSharpnessAlgorithm &value) override
 Sets the focus sharpness algorithm.
FocusSharpnessAlgorithm Get () const override
 Gets the current focus sharpness algorithm.
std::vector< FocusSharpnessAlgorithm > GetList () const override
 Gets the list of supported focus sharpness algorithms.
void Serialize (peak::common::serialization::IArchive &archive) const override
 Serializes the current sharpness algorithm to an archive.
void Deserialize (const peak::common::serialization::IArchive &archive) override
 Deserializes the sharpness algorithm from an archive.
Public Member Functions inherited from IFeature< FocusSharpnessAlgorithm >
virtual ~IFeature ()=default
 Virtual destructor for proper cleanup of derived classes.

Detailed Description

Sharpness algorithm feature implementation for auto focus controllers.

The SharpnessAlgorithm class provides a feature interface for managing the sharpness measurement algorithm used by auto focus controllers. This feature controls how the automatic focus system measures image sharpness to determine the optimal focus position.

Different algorithms provide different characteristics:

  • Auto: Lets the controller automatically select the best algorithm
  • Tenengrad: Gradient-based, good for high-contrast edges
  • Sobel: Edge detection based, robust for various scene types
  • MeanScore: Statistical approach, good for textured surfaces
  • HistogramVariance: Variance-based, effective for uniform lighting

This class inherits from IListFeature<FocusSharpnessAlgorithm> and provides both current algorithm management and a list of supported algorithms.

Note
Algorithm availability may vary based on the underlying controller implementation and image characteristics.
See also
IListFeature
FocusSharpnessAlgorithm
peak::afl::Controller::SetSharpnessAlgorithm()
peak::afl::Controller::GetSharpnessAlgorithm()
Since
1.8

Constructor & Destructor Documentation

◆ SharpnessAlgorithm()

SharpnessAlgorithm ( std::shared_ptr< peak::afl::Controller > controller)
inlineexplicit

Constructs a SharpnessAlgorithm feature with the specified controller.

Parameters
[in]controllerShared pointer to the auto focus controller that will be used to manage the sharpness algorithm parameter. The controller must support sharpness algorithm operations.
Precondition
controller must not be null
controller must support sharpness algorithm functionality
Since
1.8

Member Function Documentation

◆ Deserialize()

void Deserialize ( const peak::common::serialization::IArchive & archive)
inlineoverridevirtual

Deserializes the sharpness algorithm from an archive.

Loads the focus sharpness algorithm from the provided archive and applies it to the controller. The algorithm is expected to be stored with the key "SharpnessAlgorithm".

Parameters
[in]archiveThe archive to read the sharpness algorithm from
Exceptions
Maythrow serialization exceptions if the archive operation fails
Maythrow controller exceptions if the deserialized algorithm is invalid
See also
Serialize()
Since
1.8

Implements ISerializable.

◆ Get()

FocusSharpnessAlgorithm Get ( ) const
inlineoverridevirtual

Gets the current focus sharpness algorithm.

Retrieves the currently configured algorithm that the automatic focus system is using to measure image sharpness.

Returns
The current focus sharpness algorithm
Exceptions
Maythrow exceptions based on the underlying controller implementation if the controller is in an invalid state.
See also
Set()
GetList()
FocusSharpnessAlgorithm
Since
1.8

Implements IFeature< FocusSharpnessAlgorithm >.

◆ GetList()

std::vector< FocusSharpnessAlgorithm > GetList ( ) const
inlineoverridevirtual

Gets the list of supported focus sharpness algorithms.

Retrieves a list of all focus sharpness algorithms that are supported by the current controller. This can be used to populate user interface controls or to validate algorithm selections.

Returns
A vector containing all supported focus sharpness algorithms
Exceptions
Maythrow exceptions based on the underlying controller implementation if the controller is in an invalid state.
See also
Set()
Get()
FocusSharpnessAlgorithm
Since
1.8

Implements IListFeature< FocusSharpnessAlgorithm >.

◆ Serialize()

void Serialize ( peak::common::serialization::IArchive & archive) const
inlineoverridevirtual

Serializes the current sharpness algorithm to an archive.

Stores the current focus sharpness algorithm in the provided archive for configuration persistence. The algorithm is stored with the key "SharpnessAlgorithm".

Parameters
[in,out]archiveThe archive to write the sharpness algorithm to
Exceptions
Maythrow serialization exceptions if the archive operation fails
See also
Deserialize()
Since
1.8

Implements ISerializable.

◆ Set()

void Set ( const FocusSharpnessAlgorithm & value)
inlineoverridevirtual

Sets the focus sharpness algorithm.

Sets the algorithm that the automatic focus system will use to measure image sharpness. Different algorithms provide different characteristics for detecting optimal focus in various scene conditions.

Parameters
[in]valueThe focus sharpness algorithm to set. Must be one of the algorithms supported by the controller (see GetList()).
Exceptions
Maythrow exceptions based on the underlying controller implementation if the algorithm is not supported or if the controller is in an invalid state.
See also
Get()
GetList()
FocusSharpnessAlgorithm
Since
1.8

Implements IFeature< FocusSharpnessAlgorithm >.


The documentation for this class was generated from the following file: