segmentation
All Data Structures Namespaces Files Functions Variables Modules Pages
Public Member Functions
yarp::sig::SegmentationModuleInterface Class Reference

Interface for module that performs graph-based segmentation. More...

#include <SegmentationModuleInterface.h>

Inheritance diagram for yarp::sig::SegmentationModuleInterface:
GBSegmModule

Public Member Functions

virtual void set_sigma (const double newValue)
 Set sigma (smoothing) parameter for the algorithm. More...
 
virtual void set_k (const double newValue)
 Set k (scale factor for boundary-detection threshold function) parameter for the algorithm. More...
 
virtual void set_minRegion (const double newValue)
 Set minRegion parameter for the algorithm, i.e., the minimum size of any segmented component. More...
 
virtual double get_sigma ()
 Get sigma (smoothing) parameter for the algorithm. More...
 
virtual double get_k ()
 Get k (scale factor for boundary-detection threshold function) parameter for the algorithm. More...
 
virtual double get_minRegion ()
 Get minRegion parameter for the algorithm, i.e., the minimum size of any segmented component. More...
 
virtual std::int32_t get_num_components ()
 Get the number of segmented components that have been detected in the last provided image. More...
 
virtual std::vector< Pixelget_component_around (const Pixel &objCenter)
 Get the list of pixels corresponding to the component to which a given pixel belongs. More...
 
virtual std::vector< std::string > help (const std::string &functionName="--all")
 
bool read (yarp::os::ConnectionReader &connection) override
 

Detailed Description

Interface for module that performs graph-based segmentation.

Definition at line 27 of file SegmentationModuleInterface.h.

Member Function Documentation

◆ get_component_around()

std::vector< Pixel > yarp::sig::SegmentationModuleInterface::get_component_around ( const Pixel objCenter)
virtual

Get the list of pixels corresponding to the component to which a given pixel belongs.

Parameters
objCentera pixel belonging to the region of interest
Returns
list of pixels belonging to the same component as the input pixels

Reimplemented in GBSegmModule.

Definition at line 442 of file SegmentationModuleInterface.cpp.

443 {
444  SegmentationModuleInterface_get_component_around_helper helper{objCenter};
445  if (!yarp().canWrite()) {
446  yError("Missing server method '%s'?", "std::vector<Pixel> SegmentationModuleInterface::get_component_around(const Pixel& objCenter)");
447  }
448  bool ok = yarp().write(helper, helper);
449  return ok ? SegmentationModuleInterface_get_component_around_helper::s_return_helper : std::vector<Pixel>{};
450 }

◆ get_k()

double yarp::sig::SegmentationModuleInterface::get_k ( )
virtual

Get k (scale factor for boundary-detection threshold function) parameter for the algorithm.

Returns
current value for k parameter

Reimplemented in GBSegmModule.

Definition at line 412 of file SegmentationModuleInterface.cpp.

413 {
414  SegmentationModuleInterface_get_k_helper helper{};
415  if (!yarp().canWrite()) {
416  yError("Missing server method '%s'?", "double SegmentationModuleInterface::get_k()");
417  }
418  bool ok = yarp().write(helper, helper);
419  return ok ? SegmentationModuleInterface_get_k_helper::s_return_helper : double{};
420 }

◆ get_minRegion()

double yarp::sig::SegmentationModuleInterface::get_minRegion ( )
virtual

Get minRegion parameter for the algorithm, i.e., the minimum size of any segmented component.

Returns
current value for minRegion parameter

Reimplemented in GBSegmModule.

Definition at line 422 of file SegmentationModuleInterface.cpp.

423 {
424  SegmentationModuleInterface_get_minRegion_helper helper{};
425  if (!yarp().canWrite()) {
426  yError("Missing server method '%s'?", "double SegmentationModuleInterface::get_minRegion()");
427  }
428  bool ok = yarp().write(helper, helper);
429  return ok ? SegmentationModuleInterface_get_minRegion_helper::s_return_helper : double{};
430 }

◆ get_num_components()

std::int32_t yarp::sig::SegmentationModuleInterface::get_num_components ( )
virtual

Get the number of segmented components that have been detected in the last provided image.

Returns
number of segmented components

Reimplemented in GBSegmModule.

Definition at line 432 of file SegmentationModuleInterface.cpp.

433 {
434  SegmentationModuleInterface_get_num_components_helper helper{};
435  if (!yarp().canWrite()) {
436  yError("Missing server method '%s'?", "std::int32_t SegmentationModuleInterface::get_num_components()");
437  }
438  bool ok = yarp().write(helper, helper);
439  return ok ? SegmentationModuleInterface_get_num_components_helper::s_return_helper : std::int32_t{};
440 }

◆ get_sigma()

double yarp::sig::SegmentationModuleInterface::get_sigma ( )
virtual

Get sigma (smoothing) parameter for the algorithm.

Returns
current value for sigma parameter

Reimplemented in GBSegmModule.

Definition at line 402 of file SegmentationModuleInterface.cpp.

403 {
404  SegmentationModuleInterface_get_sigma_helper helper{};
405  if (!yarp().canWrite()) {
406  yError("Missing server method '%s'?", "double SegmentationModuleInterface::get_sigma()");
407  }
408  bool ok = yarp().write(helper, helper);
409  return ok ? SegmentationModuleInterface_get_sigma_helper::s_return_helper : double{};
410 }

◆ set_k()

void yarp::sig::SegmentationModuleInterface::set_k ( const double  newValue)
virtual

Set k (scale factor for boundary-detection threshold function) parameter for the algorithm.

Parameters
newValuenew value for k parameter

Reimplemented in GBSegmModule.

Definition at line 384 of file SegmentationModuleInterface.cpp.

385 {
386  SegmentationModuleInterface_set_k_helper helper{newValue};
387  if (!yarp().canWrite()) {
388  yError("Missing server method '%s'?", "void SegmentationModuleInterface::set_k(const double newValue)");
389  }
390  yarp().write(helper, helper);
391 }

◆ set_minRegion()

void yarp::sig::SegmentationModuleInterface::set_minRegion ( const double  newValue)
virtual

Set minRegion parameter for the algorithm, i.e., the minimum size of any segmented component.

Parameters
newValuenew value for minRegion parameter

Reimplemented in GBSegmModule.

Definition at line 393 of file SegmentationModuleInterface.cpp.

394 {
395  SegmentationModuleInterface_set_minRegion_helper helper{newValue};
396  if (!yarp().canWrite()) {
397  yError("Missing server method '%s'?", "void SegmentationModuleInterface::set_minRegion(const double newValue)");
398  }
399  yarp().write(helper, helper);
400 }

◆ set_sigma()

void yarp::sig::SegmentationModuleInterface::set_sigma ( const double  newValue)
virtual

Set sigma (smoothing) parameter for the algorithm.

Parameters
newValuenew value for sigma parameter

Reimplemented in GBSegmModule.

Definition at line 375 of file SegmentationModuleInterface.cpp.

376 {
377  SegmentationModuleInterface_set_sigma_helper helper{newValue};
378  if (!yarp().canWrite()) {
379  yError("Missing server method '%s'?", "void SegmentationModuleInterface::set_sigma(const double newValue)");
380  }
381  yarp().write(helper, helper);
382 }

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