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

Weighted regions of interest feature implementation for auto controllers. More...

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

Inheritance diagram for WeightedRois:
IFeature< std::vector< WeightedROI > > ISerializable

Public Member Functions

 WeightedRois (std::shared_ptr< peak::afl::Controller > controller)
 Constructs a WeightedRois feature with the specified controller.
void Set (const WeightedROI &value)
 Sets a single weighted region of interest.
void Set (const std::vector< WeightedROI > &value) override
 Sets multiple weighted regions of interest.
void SetPreset (RoiPreset preset)
 Sets a predefined region of interest (ROI)
std::vector< WeightedROI > Get () const override
 Gets the current weighted regions of interest.
void Serialize (peak::common::serialization::IArchive &archive) const override
 Serializes the current weighted ROIs to an archive.
void Deserialize (const peak::common::serialization::IArchive &archive) override
 Deserializes weighted ROIs from an archive.
Public Member Functions inherited from IFeature< std::vector< WeightedROI > >
virtual ~IFeature ()=default
 Virtual destructor for proper cleanup of derived classes.

Detailed Description

Weighted regions of interest feature implementation for auto controllers.

The WeightedRois class provides a feature interface for managing multiple weighted regions of interest for auto controllers. This feature allows defining multiple rectangular areas within the image, each with different importance weights that influence automatic algorithms.

Weighted ROIs are useful for:

  • Prioritizing important subjects in the scene
  • De-emphasizing background areas
  • Creating complex focus/exposure patterns
  • Fine-tuning automatic behavior for specific applications

Each weighted ROI consists of a rectangular region and a weight (Weak, Medium, Strong) that determines how much influence that region has on the automatic calculations.

This class inherits from IFeature<std::vector<WeightedROI>> and provides serialization support for configuration persistence.

Note
The maximum number of supported weighted ROIs may vary based on the underlying controller implementation.
See also
IFeature
WeightedROI
Weight
peak::afl::Controller::SetWeightedROIs()
peak::afl::Controller::GetWeightedROIs()
Since
1.8

Constructor & Destructor Documentation

◆ WeightedRois()

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

Constructs a WeightedRois feature with the specified controller.

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

Member Function Documentation

◆ Deserialize()

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

Deserializes weighted ROIs from an archive.

Loads weighted ROIs from the provided archive and applies them to the controller. Each ROI is expected to be stored as a sub-archive containing X, Y, Width, Height, and Weight values.

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

Implements ISerializable.

◆ Get()

std::vector< WeightedROI > Get ( ) const
inlineoverridevirtual

Gets the current weighted regions of interest.

Retrieves all currently configured weighted ROIs from the controller.

Returns
Vector of weighted ROIs, each containing a rectangular region and its importance weight
Exceptions
Maythrow exceptions based on the underlying controller implementation if the controller is in an invalid state.
See also
Set()
Since
1.8

Implements IFeature< std::vector< WeightedROI > >.

◆ Serialize()

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

Serializes the current weighted ROIs to an archive.

Stores all current weighted ROIs in the provided archive for configuration persistence. Each ROI is stored as a sub-archive containing X, Y, Width, Height, and Weight values.

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

Implements ISerializable.

◆ Set() [1/2]

void Set ( const std::vector< WeightedROI > & value)
inlineoverridevirtual

Sets multiple weighted regions of interest.

Sets a collection of weighted ROIs for the controller. Each ROI in the vector will influence the automatic algorithms according to its weight.

Parameters
[in]valueVector of weighted ROIs to set. Each element contains a rectangular region and its importance weight.
Exceptions
Maythrow exceptions based on the underlying controller implementation if any ROI is invalid, if too many ROIs are provided, or if the controller is in an invalid state.
See also
Set(const WeightedROI&)
Get()
Since
1.8

Implements IFeature< std::vector< WeightedROI > >.

◆ Set() [2/2]

void Set ( const WeightedROI & value)
inline

Sets a single weighted region of interest.

Sets a single weighted ROI for the controller. This is a convenience method for setting just one weighted region.

Parameters
[in]valueThe weighted ROI to set, containing both the rectangular region and its importance weight.
Exceptions
Maythrow exceptions based on the underlying controller implementation if the ROI is invalid or if the controller is in an invalid state.
See also
Set(const std::vector<WeightedROI>&)
Get()
Since
1.8

◆ SetPreset()

void SetPreset ( RoiPreset preset)
inline

Sets a predefined region of interest (ROI)

Parameters
[in]presetThe preset to set.
Exceptions
Maythrow exceptions based on the underlying controller implementation if the controller is in an invalid state.
Since
2.0

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