IDS peak AFL v2.0.2
Loading...
Searching...
No Matches
Roi Class Reference

Region of Interest (ROI) feature implementation for auto controllers. More...

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

Inheritance diagram for Roi:
IFeature< peak::common::Rectangle > ISerializable

Public Member Functions

 Roi (std::shared_ptr< peak::afl::Controller > controller)
 Constructs a Roi feature with the specified controller.
void Set (const peak::common::Rectangle &value) override
 Sets the region of interest rectangle.
peak::common::Rectangle Get () const override
 Gets the current region of interest rectangle.
void Serialize (peak::common::serialization::IArchive &archive) const override
 Serializes the current ROI to an archive.
void Deserialize (const peak::common::serialization::IArchive &archive) override
 Deserializes the ROI from an archive.
Public Member Functions inherited from IFeature< peak::common::Rectangle >
virtual ~IFeature ()=default
 Virtual destructor for proper cleanup of derived classes.

Detailed Description

Region of Interest (ROI) feature implementation for auto controllers.

The Roi class provides a feature interface for managing the region of interest parameter of auto controllers. This feature defines the rectangular area within the image that the automatic algorithms should analyze for exposure, focus, white balance, and other automatic adjustments.

By setting an ROI, users can focus the automatic algorithms on specific parts of the image, such as:

  • A subject in portrait photography
  • A specific area in industrial inspection
  • The center region to avoid edge effects
  • Any custom rectangular region of importance

This class inherits from IFeature<peak::common::Rectangle> and provides serialization support for configuration persistence.

Note
The ROI coordinates must be within the image boundaries and cannot have negative x or y values.
See also
IFeature
peak::common::Rectangle
peak::afl::Controller::SetROI()
peak::afl::Controller::GetROI()
Since
1.8

Constructor & Destructor Documentation

◆ Roi()

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

Constructs a Roi feature with the specified controller.

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

Member Function Documentation

◆ Deserialize()

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

Deserializes the ROI from an archive.

Loads the region of interest rectangle from the provided archive and applies it to the controller. The ROI is expected to be stored as a sub-archive with the key "Roi" containing X, Y, Width, and Height values.

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

Implements ISerializable.

◆ Get()

peak::common::Rectangle Get ( ) const
inlineoverridevirtual

Gets the current region of interest rectangle.

Retrieves the currently configured rectangular area that the automatic algorithms are analyzing within the image.

Returns
The current ROI as a Rectangle object
Exceptions
Maythrow exceptions based on the underlying controller implementation if the controller is in an invalid state.
See also
Set()
peak::common::Rectangle
Since
1.8

Implements IFeature< peak::common::Rectangle >.

◆ Serialize()

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

Serializes the current ROI to an archive.

Stores the current region of interest rectangle in the provided archive for configuration persistence. The ROI is stored as a sub-archive with the key "Roi" containing X, Y, Width, and Height values.

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

Implements ISerializable.

◆ Set()

void Set ( const peak::common::Rectangle & value)
inlineoverridevirtual

Sets the region of interest rectangle.

Sets the rectangular area within the image that the automatic algorithms should analyze. The ROI defines the focus area for automatic exposure, focus, white balance, and other adjustments.

Parameters
[in]valueThe rectangle defining the ROI. Must have non-negative x and y coordinates and must fit within the image boundaries.
Exceptions
peak::afl::error::InvalidParameterExceptionif x or y coordinates are negative
Maythrow additional exceptions based on the underlying controller implementation if the ROI is outside image boundaries or invalid.
See also
Get()
peak::common::Rectangle
Since
1.8

Implements IFeature< peak::common::Rectangle >.


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