RobotsIO
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RobotsIO::Utils::SegmentationYarpPort Class Reference
Inheritance diagram for RobotsIO::Utils::SegmentationYarpPort:
RobotsIO::Utils::Segmentation

Public Member Functions

 SegmentationYarpPort (const std::string &port_prefix, const bool &provide_rgb)
 
bool reset () override
 
bool is_stepping_required () const override
 
int get_frames_between_iterations () const override
 
std::pair< bool, cv::Mat > segmentation (const bool &blocking) override
 
std::pair< bool, cv::Mat > latest_segmentation () override
 
virtual double get_time_stamp () override
 
virtual void set_rgb_image (const cv::Mat &image, const double &timestamp) override
 
- Public Member Functions inherited from RobotsIO::Utils::Segmentation
virtual bool reset ()
 
virtual bool step_frame ()
 
virtual bool is_stepping_required () const =0
 
virtual void reset_data_loading_time ()
 
virtual double get_data_loading_time () const
 
virtual int get_frames_between_iterations () const
 
virtual std::pair< bool, cv::Mat > segmentation (const bool &blocking)=0
 
virtual std::pair< bool, cv::Mat > latest_segmentation ()
 
virtual double get_time_stamp ()
 
virtual void set_rgb_image (const cv::Mat &image, const double &timestamp)
 

Detailed Description

Definition at line 23 of file SegmentationYarpPort.h.

Constructor & Destructor Documentation

◆ SegmentationYarpPort()

SegmentationYarpPort::SegmentationYarpPort ( const std::string &  port_prefix,
const bool &  provide_rgb 
)

Initialize a Segmentation instance which uses YARP ports to receive segmentation masks and (optionally) provide RGB images to the segmentation module.

Required port names are composed as <port_prefix>/segmentation:i and <port_prefix>/rgb:o.

Definition at line 17 of file SegmentationYarpPort.cpp.

◆ ~SegmentationYarpPort()

SegmentationYarpPort::~SegmentationYarpPort ( )
virtual

Definition at line 24 of file SegmentationYarpPort.cpp.

Member Function Documentation

◆ get_frames_between_iterations()

int SegmentationYarpPort::get_frames_between_iterations ( ) const
overridevirtual

N > 1 indicates that the segmentation is available every N frames N = 1 indicates that the segmentation is available at all frames N < 1 indicates that this information is not available

By default, this method returns N = 1. User might override this setting by re-implementing this method.

Reimplemented from RobotsIO::Utils::Segmentation.

Definition at line 42 of file SegmentationYarpPort.cpp.

◆ get_time_stamp()

double SegmentationYarpPort::get_time_stamp ( )
overridevirtual

Provide the timestamp of the latest valid segmentation that has been received.

By default, this return -1. User might override this method if required.

Reimplemented from RobotsIO::Utils::Segmentation.

Definition at line 75 of file SegmentationYarpPort.cpp.

◆ is_stepping_required()

bool SegmentationYarpPort::is_stepping_required ( ) const
overridevirtual

Implements RobotsIO::Utils::Segmentation.

Definition at line 36 of file SegmentationYarpPort.cpp.

◆ latest_segmentation()

std::pair< bool, cv::Mat > SegmentationYarpPort::latest_segmentation ( )
overridevirtual

Provide the latest valid segmentation mask that has been received.

By default, this return (false, cv::Mat()). User might override this method if required.

Reimplemented from RobotsIO::Utils::Segmentation.

Definition at line 66 of file SegmentationYarpPort.cpp.

◆ reset()

bool SegmentationYarpPort::reset ( )
overridevirtual

Reimplemented from RobotsIO::Utils::Segmentation.

Definition at line 28 of file SegmentationYarpPort.cpp.

◆ segmentation()

std::pair< bool, cv::Mat > SegmentationYarpPort::segmentation ( const bool &  blocking)
overridevirtual

Provide a new segmentation mask.

Implements RobotsIO::Utils::Segmentation.

Definition at line 48 of file SegmentationYarpPort.cpp.

◆ set_rgb_image()

void SegmentationYarpPort::set_rgb_image ( const cv::Mat &  image,
const double &  timestamp 
)
overridevirtual

If required, the user might override this method to set the RGB image on which the segmentation has to be evaluated.

Reimplemented from RobotsIO::Utils::Segmentation.

Definition at line 81 of file SegmentationYarpPort.cpp.