icub-client
Namespaces | Classes

Bridge module between the interactive object learning and recognition system (iol) and yarp database of object properties Version:1.0 More...

+ Collaboration diagram for iol2opc:

Namespaces

 Bridge
 

Classes

class  IOLObject
 
class  IOL2OPCBridge
 

Detailed Description

Bridge module between the interactive object learning and recognition system (iol) and yarp database of object properties Version:1.0

Author
Ugo Pattacini ugo.p.nosp@m.atta.nosp@m.cini@.nosp@m.iit..nosp@m.it, Tobias Fischer t.fis.nosp@m.cher.nosp@m.@impe.nosp@m.rial.nosp@m..ac.u.nosp@m.k

Description

This module provides wrappers of procedures to acquire perceived information from iol and store them in opc database.

Parameters

Input Ports

Output Ports

Services


Class Documentation

◆ IOLObject

class IOLObject

Definition at line 62 of file module.h.

Public Member Functions

 IOLObject (const int filter_order=1, const double presenceTmo_=0.0, const string &trackerType_="BOOSTING", const double trackerTmo_=0.0)
 
void heartBeat ()
 heartBeat current time value More...
 
bool isDead ()
 isDead duration comparison procedure with presenceTmo More...
 
void filt (const Vector &x, Vector &xFilt, const Vector &d, Vector &dFilt)
 filt apply the median filter More...
 
void prepare ()
 prepare initialize the tracker More...
 
void latchBBox (const CvRect &bbox)
 latchBBox assign tracker with bounding box value More...
 
void track (const Image &img)
 track procdure to start tracking an image More...
 
bool is_tracking (CvRect &bbox) const
 is_tracking procedure to check the tracking state More...
 

Protected Types

enum  {
  idle,
  init,
  no_need,
  tracking
}
 

Protected Attributes

MedianFilter filterPos
 median filter for position of object More...
 
MedianFilter filterDim
 median filter for object dimension More...
 
bool init_filters
 
double presenceTmo
 current set timeout More...
 
double presenceTimer
 current timer More...
 
string trackerType
 
int trackerState
 tracker state: idle, init, no_need or tracking More...
 
double trackerTmo
 set value of tracker timout More...
 
double trackerTimer
 current value of tracker timer More...
 
cv::Rect2d trackerResult
 
cv::Ptr< cv::Tracker > tracker
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
idle 
init 
no_need 
tracking 

Definition at line 71 of file module.h.

Constructor & Destructor Documentation

◆ IOLObject()

IOLObject::IOLObject ( const int  filter_order = 1,
const double  presenceTmo_ = 0.0,
const string &  trackerType_ = "BOOSTING",
const double  trackerTmo_ = 0.0 
)
inline

Definition at line 83 of file module.h.

Member Function Documentation

◆ filt()

void IOLObject::filt ( const Vector &  x,
Vector &  xFilt,
const Vector &  d,
Vector &  dFilt 
)
inline

filt apply the median filter

Parameters
xYarp Vector of current state of x
xFiltYarp Vector of filtered state of x
dYarp Vector of current state of d
dFiltYarp Vector of filtered state of d

Definition at line 125 of file module.h.

◆ heartBeat()

void IOLObject::heartBeat ( )
inline

heartBeat current time value

Definition at line 99 of file module.h.

◆ is_tracking()

bool IOLObject::is_tracking ( CvRect &  bbox) const
inline

is_tracking procedure to check the tracking state

Parameters
bboxthe tracked bouding box
Returns
True if the trackerState is not idle, False otherwise

Definition at line 219 of file module.h.

◆ isDead()

bool IOLObject::isDead ( )
inline

isDead duration comparison procedure with presenceTmo

Returns
True if presenceTmo is exceeded, False otherwise

Definition at line 109 of file module.h.

◆ latchBBox()

void IOLObject::latchBBox ( const CvRect &  bbox)
inline

latchBBox assign tracker with bounding box value

Parameters
bboxCvRect object containing bouding box value, i.e x, y, width, height

Definition at line 156 of file module.h.

◆ prepare()

void IOLObject::prepare ( )
inline

prepare initialize the tracker

Definition at line 145 of file module.h.

◆ track()

void IOLObject::track ( const Image &  img)
inline

track procdure to start tracking an image

Parameters
imgImage type object

Definition at line 170 of file module.h.

Member Data Documentation

◆ filterDim

MedianFilter IOLObject::filterDim
protected

median filter for object dimension

Definition at line 66 of file module.h.

◆ filterPos

MedianFilter IOLObject::filterPos
protected

median filter for position of object

Definition at line 65 of file module.h.

◆ init_filters

bool IOLObject::init_filters
protected

Definition at line 67 of file module.h.

◆ presenceTimer

double IOLObject::presenceTimer
protected

current timer

Definition at line 69 of file module.h.

◆ presenceTmo

double IOLObject::presenceTmo
protected

current set timeout

Definition at line 68 of file module.h.

◆ tracker

cv::Ptr<cv::Tracker> IOLObject::tracker
protected

Definition at line 79 of file module.h.

◆ trackerResult

cv::Rect2d IOLObject::trackerResult
protected

Definition at line 78 of file module.h.

◆ trackerState

int IOLObject::trackerState
protected

tracker state: idle, init, no_need or tracking

Definition at line 74 of file module.h.

◆ trackerTimer

double IOLObject::trackerTimer
protected

current value of tracker timer

Definition at line 76 of file module.h.

◆ trackerTmo

double IOLObject::trackerTmo
protected

set value of tracker timout

Definition at line 75 of file module.h.

◆ trackerType

string IOLObject::trackerType
protected

Definition at line 73 of file module.h.

◆ IOL2OPCBridge

class IOL2OPCBridge

Definition at line 232 of file module.h.

+ Inheritance diagram for IOL2OPCBridge:

Public Member Functions

bool train_object (const string &name)
 Add a new object to the object-recognition database based on the selected blob. More...
 
bool remove_object (const string &name)
 Remove object with a given name from the object-recognition database. More...
 
bool remove_all ()
 Remove all objects from the object-recognition database. More...
 
bool change_name (const string &old_name, const string &new_name)
 Change the name of an object. More...
 
bool set_object_persistence (const string &sw)
 Enable/disable object persistence. More...
 
string get_object_persistence ()
 Return current status of object persistence. More...
 
void pause ()
 Pause module. More...
 
void resume ()
 Resume module. More...
 
- Public Member Functions inherited from iol2opc_IDL
 iol2opc_IDL ()
 
virtual bool read (yarp::os::ConnectionReader &connection) override
 
virtual std::vector< std::string > help (const std::string &functionName="--all")
 

Protected Member Functions

void yInfoGated (const char *msg,...) const
 
string findName (const Bottle &scores, const string &tag)
 findName Find name of a blob or set it OBJECT_UNKNOWN More...
 
Bottle skimBlobs (const Bottle &blobs)
 skimBlobs Remove blobs which are too far away in the Cartesian space wrt Root frame More...
 
bool thresBBox (CvRect &bbox, const Image &img)
 thresBBox Constrain a bounding box with respect to an image size More...
 
Bottle getBlobs ()
 getBlobs Wrapper to get blobs information from the blobExtractor port More...
 
CvPoint getBlobCOG (const Bottle &blobs, const unsigned int i)
 getBlobCOG Get the blob center of the object defined by i More...
 
bool getBlobPoints (const CvPoint &cog, deque< CvPoint > &blobPoints)
 getBlobPoints Obtain CvPoints belonging to a blob defined by cog, from lbpExtract More...
 
bool getSuperQuadric (const CvPoint &point, Vector &pos, Vector &dim)
 getSuperQuadric Obtain superquadric-model of an object, defined by point More...
 
bool get3DPosition (const CvPoint &point, Vector &x)
 get3DPosition Get the 3D point coordinate in Root frame through SFM More...
 
bool get3DPositionAndDimensions (const CvRect &bbox, Vector &x, Vector &dim)
 get3DPositionAndDimensions Get the 3D point coordinate and dimension in Root frame through SFM More...
 
Vector calibPosition (const Vector &x)
 
bool getClickPosition (CvPoint &pos)
 getClickPosition Get the position on image that user clicks on More...
 
void acquireImage ()
 acquireImage Get calibrated image from the left camera of iCub More...
 
void drawBlobs (const Bottle &blobs, const unsigned int i, const Bottle &scores)
 drawBlobs Add bounding box and name of object in output image shown through port imgRtLocOut More...
 
void rotate (cv::Mat &src, const double angle, cv::Mat &dst)
 rotate Create new OpenCV matrix by rotating an original one an angle in 2D, a wrapper of cv::warpAffine More...
 
void drawScoresHistogram (const Bottle &blobs, const Bottle &scores, const int i)
 drawScoresHistogram Draw histogram of objects' scores More...
 
int findClosestBlob (const Bottle &blobs, const CvPoint &loc)
 findClosestBlob Find the closest blob to location More...
 
int findClosestBlob (const Bottle &blobs, const Vector &loc)
 findClosestBlob Find the closest blob to location More...
 
Bottle classify (const Bottle &blobs)
 classify Classify an object using himrepClassifier More...
 
void train (const string &object, const Bottle &blobs, const int i)
 train Training himrepClassifier by sending an object by name and its bounding box More...
 
void doLocalization ()
 doLocalization The whole procedure to classify objects, from getting image to draw bounding boxes arround objects More...
 
void updateOPC ()
 updateOPC The whole procedure to update OPC, including naming known and unknown objects, drawing bounding boxes around objects More...
 
ObjectArea getReachableArea (const yarp::sig::VectorOf< double > &objpos)
 getReachableArea Analyse if an object is inside which region: Human, Shared, Robot or Not-Reachable More...
 
bool configure (ResourceFinder &rf)
 
void setBounds (ResourceFinder &rf, Vector &bounds, string configName, double std_lower, double std_upper)
 setBounds Set min & max for a vector More...
 
bool interruptModule ()
 
bool close ()
 
bool attach (RpcServer &source)
 
double getPeriod ()
 
bool updateModule ()
 

Protected Attributes

RpcServer rpcPort
 rpc server to receive user request More...
 
RpcClient rpcClassifier
 rpc client port to send requests to himrepClassifier More...
 
RpcClient rpcGet3D
 rpc client port to send requests to SFM More...
 
OPCClientopc
 OPC client object. More...
 
RpcClient rpcGetSPQ
 rpc client port to send requests to superquadric-model and receive superquadric parameters More...
 
RpcClient rpcGetBlobPoints
 rpc client port to send requests to lbpExtract and receive all points of a blob More...
 
BufferedPort< Bottle > blobExtractor
 buffered port of input of received blobs from lbpExtract More...
 
BufferedPort< Bottle > histObjLocPort
 buffered port of input of localized objects from iol localizer More...
 
BufferedPort< Bottle > getClickPort
 buffered port of input of clicked position More...
 
BufferedPort< Bottle > objLocOut
 buffered port of output of localized objects More...
 
BufferedPort< ImageOf< PixelBgr > > imgIn
 buffered port of input calibrated image from left camera of iCub More...
 
BufferedPort< ImageOf< PixelBgr > > imgRtLocOut
 buffered port of output image for real-time objects localization More...
 
BufferedPort< ImageOf< PixelBgr > > imgTrackOut
 buffered port of output image of tracked object More...
 
BufferedPort< ImageOf< PixelBgr > > imgSelBlobOut
 buffered port of output image inside the selected blob (by clicking on) More...
 
BufferedPort< ImageOf< PixelBgr > > imgHistogram
 buffered port of output image of histogram of classification scores. More...
 
Port imgClassifier
 port of output image to himrefClassifier More...
 
RtLocalization rtLocalization
 
OpcUpdater opcUpdater
 
int opcMedianFilterOrder
 
ClassifierReporter classifierReporter
 
ImageOf< PixelBgr > imgRtLoc
 Image for real-time objects localization. More...
 
Mutex mutexResources
 
Mutex mutexResourcesOpc
 
Mutex mutexResourcesSFM
 
Mutex mutexResourcesSPQ
 
double period
 
bool verbose
 
bool empty
 
bool object_persistence
 
bool useSPQ
 boolean flag to enable/disable using Superquadric-model for object pose and size estimation More...
 
bool connectedSPQ
 boolean flag to check internal connection to Superquadric-model More...
 
double presence_timeout
 
string tracker_type
 
double tracker_timeout
 
VectorOf< int > tracker_min_blob_size
 minimum size of tracker blob More...
 
map< string, IOLObjectdb
 
Bridge::State state
 
IOLObject onlyKnownObjects
 
map< string, Filter * > histFiltersPool
 
int histFilterLength
 
deque< CvScalar > histColorsCode
 
double blobs_detection_timeout
 
double lastBlobsArrivalTime
 time stamp of last received blob More...
 
Bottle lastBlobs
 Bottle contains last blob information. More...
 
Bottle opcBlobs
 Bottle contains received blobs of objects from OPC. More...
 
Bottle opcScores
 Bottle contains received (class) score of objects from OPC. More...
 
Vector skim_blobs_x_bounds
 Yarp Vector of min, max bounding in x-axis to reduce the blob detection. More...
 
Vector skim_blobs_y_bounds
 Yarp Vector of min, max bounding in y-axis to reduce the blob detection. More...
 
Vector histObjLocation
 
Vector human_area_x_bounds
 Yarp Vector of min, max bounding of human region in x-axis. More...
 
Vector human_area_y_bounds
 Yarp Vector of min, max bounding of human region in y-axis. More...
 
Vector robot_area_x_bounds
 Yarp Vector of min, max bounding of robot region in x-axis. More...
 
Vector robot_area_y_bounds
 Yarp Vector of min, max bounding of robot region in y-axis. More...
 
Vector shared_area_x_bounds
 Yarp Vector of min, max bounding of shared region in x-axis. More...
 
Vector shared_area_y_bounds
 Yarp Vector of min, max bounding of shared region in y-axis. More...
 
CvPoint clickLocation
 

Friends

class RtLocalization
 
class OpcUpdater
 
class ClassifierReporter
 

Member Function Documentation

◆ acquireImage()

void IOL2OPCBridge::acquireImage ( )
protected

acquireImage Get calibrated image from the left camera of iCub

Definition at line 438 of file module.cpp.

◆ attach()

bool IOL2OPCBridge::attach ( RpcServer &  source)
protected

Definition at line 1334 of file module.cpp.

◆ calibPosition()

Vector IOL2OPCBridge::calibPosition ( const Vector &  x)
protected

◆ change_name()

bool IOL2OPCBridge::change_name ( const string &  old_name,
const string &  new_name 
)
virtual

Change the name of an object.

Parameters
old_nameis the object which name is to be changed
new_nameis the new object name
Returns
true/false on success/failure.

Reimplemented from iol2opc_IDL.

Definition at line 1444 of file module.cpp.

◆ classify()

Bottle IOL2OPCBridge::classify ( const Bottle &  blobs)
protected

classify Classify an object using himrepClassifier

Parameters
blobsYarp Bottle contains information of the estimated object bounding boxes: top left x, y, bottom right x, y. This will be sent to himrepClassifier for object detection
Returns
Yarp Bottle contains class of object and confidence score

Definition at line 693 of file module.cpp.

◆ close()

bool IOL2OPCBridge::close ( )
protected

Definition at line 1176 of file module.cpp.

◆ configure()

bool IOL2OPCBridge::configure ( ResourceFinder &  rf)
protected

Definition at line 1016 of file module.cpp.

◆ doLocalization()

void IOL2OPCBridge::doLocalization ( )
protected

doLocalization The whole procedure to classify objects, from getting image to draw bounding boxes arround objects

Definition at line 757 of file module.cpp.

◆ drawBlobs()

void IOL2OPCBridge::drawBlobs ( const Bottle &  blobs,
const unsigned int  i,
const Bottle &  scores 
)
protected

drawBlobs Add bounding box and name of object in output image shown through port imgRtLocOut

Parameters
blobsYarp Bottle contains information of the estimated object bounding boxes: top left x, y, bottom right x, y
iinteger value as index of the blob to draw the bounding box
scoresBottle contains classified results from himrepClassifier,
See also
classify()

Definition at line 453 of file module.cpp.

◆ drawScoresHistogram()

void IOL2OPCBridge::drawScoresHistogram ( const Bottle &  blobs,
const Bottle &  scores,
const int  i 
)
protected

drawScoresHistogram Draw histogram of objects' scores

Parameters
blobsYarp Bottle contains information of the estimated object bounding boxes: top left x, y, bottom right x, y
iinteger value as index of the blob to draw the bounding box
scoresBottle contains classified results from himrepClassifier,
See also
classify()

Definition at line 513 of file module.cpp.

◆ findClosestBlob() [1/2]

int IOL2OPCBridge::findClosestBlob ( const Bottle &  blobs,
const CvPoint &  loc 
)
protected

findClosestBlob Find the closest blob to location

Parameters
blobsYarp Bottle contains information of the estimated object bounding box: top left x, y, bottom right x, y
locA CvPoint contains 2D coordinate of pixel expressed the location
Returns
integer value of the corresponding blob to the location

Definition at line 636 of file module.cpp.

◆ findClosestBlob() [2/2]

int IOL2OPCBridge::findClosestBlob ( const Bottle &  blobs,
const Vector &  loc 
)
protected

findClosestBlob Find the closest blob to location

Parameters
blobsYarp Bottle contains information of the estimated object bounding boxes: top left x, y, bottom right x, y
locA Vector contains 3D coordinate of the location in the Root frame
Returns
integer value of the corresponding blob to the location

Definition at line 664 of file module.cpp.

◆ findName()

string IOL2OPCBridge::findName ( const Bottle &  scores,
const string &  tag 
)
protected

findName Find name of a blob or set it OBJECT_UNKNOWN

Parameters
scoresBottle contains classified results from himrepClassifier,
See also
classify()
Parameters
taginput string contains blob name, i.e. "blob_<i>" with i as index of a blob in set of results from getBlobs()
Returns
string value for name of the blob: OBJECT_UNKNOWN or class name from classifier

Definition at line 46 of file module.cpp.

◆ get3DPosition()

bool IOL2OPCBridge::get3DPosition ( const CvPoint &  point,
Vector &  x 
)
protected

get3DPosition Get the 3D point coordinate in Root frame through SFM

Parameters
pointA CvPoint for the estimated coordinate of an image pixel.
xVector for 3D point coordinate. If SFM return more than one 3D point as result, the coordinate is average of all result
Returns
True if can get 3D point from SFM, False otherwise

Definition at line 339 of file module.cpp.

◆ get3DPositionAndDimensions()

bool IOL2OPCBridge::get3DPositionAndDimensions ( const CvRect &  bbox,
Vector &  x,
Vector &  dim 
)
protected

get3DPositionAndDimensions Get the 3D point coordinate and dimension in Root frame through SFM

Parameters
bboxA CvRect for bounding box of object
xVector for 3D point coordinate. If SFM return more than one 3D point as result, the coordinate is average of all result
dimVector for 3D dimensions of object, calculated using coordinates of points from SFM
Returns
True if get response from SFM, False otherwise

Definition at line 392 of file module.cpp.

◆ get_object_persistence()

string IOL2OPCBridge::get_object_persistence ( )
virtual

Return current status of object persistence.

Returns
"on"|"off".

Reimplemented from iol2opc_IDL.

Definition at line 1520 of file module.cpp.

◆ getBlobCOG()

CvPoint IOL2OPCBridge::getBlobCOG ( const Bottle &  blobs,
const unsigned int  i 
)
protected

getBlobCOG Get the blob center of the object defined by i

Parameters
blobsYarp Bottle contains information of the estimated object bounding boxes: top left x, y, bottom right x, y
iinteger value to define object
Returns
A CvPoint containing x, y coordinate of the blob center

Definition at line 169 of file module.cpp.

◆ getBlobPoints()

bool IOL2OPCBridge::getBlobPoints ( const CvPoint &  cog,
deque< CvPoint > &  blobPoints 
)
protected

getBlobPoints Obtain CvPoints belonging to a blob defined by cog, from lbpExtract

Parameters
cogCvPoint of center of mass of the blob
blobPointsA set of CvPoints of the blob
Returns
True if can get result from lbpExtract, False otherwise

Definition at line 214 of file module.cpp.

◆ getBlobs()

Bottle IOL2OPCBridge::getBlobs ( )
protected

getBlobs Wrapper to get blobs information from the blobExtractor port

Returns
Yarp Bottle contains all valid segmented object blobs from lbpExtract module

Definition at line 141 of file module.cpp.

◆ getClickPosition()

bool IOL2OPCBridge::getClickPosition ( CvPoint &  pos)
protected

getClickPosition Get the position on image that user clicks on

Parameters
posA CvPoint contains 2D coordinate of the estimated pixel that user clicks on
Returns
True if the result pixel is valid, False otherwise

Definition at line 193 of file module.cpp.

◆ getPeriod()

double IOL2OPCBridge::getPeriod ( )
protected

Definition at line 1228 of file module.cpp.

◆ getReachableArea()

ObjectArea IOL2OPCBridge::getReachableArea ( const yarp::sig::VectorOf< double > &  objpos)
protected

getReachableArea Analyse if an object is inside which region: Human, Shared, Robot or Not-Reachable

Parameters
objposVector of object position
Returns
ObjectArea that the object belongs to

Definition at line 792 of file module.cpp.

◆ getSuperQuadric()

bool IOL2OPCBridge::getSuperQuadric ( const CvPoint &  point,
Vector &  pos,
Vector &  dim 
)
protected

getSuperQuadric Obtain superquadric-model of an object, defined by point

Parameters
pointCvPoint of center of mass of the blob
posA Yarp Vector of the object pose estimation, calculated by the superquadric-model
dimA Yarp Vector of the object dimension estimation, calculated by the superquadric-model
Returns
True if can get result from superquadric-model, False otherwise

Definition at line 255 of file module.cpp.

◆ interruptModule()

bool IOL2OPCBridge::interruptModule ( )
protected

Definition at line 1143 of file module.cpp.

◆ pause()

void IOL2OPCBridge::pause ( )
virtual

Pause module.

Reimplemented from iol2opc_IDL.

Definition at line 1527 of file module.cpp.

◆ remove_all()

bool IOL2OPCBridge::remove_all ( )
virtual

Remove all objects from the object-recognition database.

Returns
true/false on success/failure.

Reimplemented from iol2opc_IDL.

Definition at line 1414 of file module.cpp.

◆ remove_object()

bool IOL2OPCBridge::remove_object ( const string &  name)
virtual

Remove object with a given name from the object-recognition database.

Parameters
nameis the object name
Returns
true/false on success/failure.

Reimplemented from iol2opc_IDL.

Definition at line 1382 of file module.cpp.

◆ resume()

void IOL2OPCBridge::resume ( )
virtual

Resume module.

Reimplemented from iol2opc_IDL.

Definition at line 1534 of file module.cpp.

◆ rotate()

void IOL2OPCBridge::rotate ( cv::Mat &  src,
const double  angle,
cv::Mat &  dst 
)
protected

rotate Create new OpenCV matrix by rotating an original one an angle in 2D, a wrapper of cv::warpAffine

Parameters
srcOriginal OpenCV matrix
angleDouble value for rotated angle
dstNew rotated OpenCV matrix

Definition at line 502 of file module.cpp.

◆ set_object_persistence()

bool IOL2OPCBridge::set_object_persistence ( const string &  sw)
virtual

Enable/disable object persistence.

Parameters
swcan be "on"|"off".
Returns
true/false on success/failure.

Reimplemented from iol2opc_IDL.

Definition at line 1506 of file module.cpp.

◆ setBounds()

void IOL2OPCBridge::setBounds ( ResourceFinder &  rf,
Vector &  bounds,
string  configName,
double  std_lower,
double  std_upper 
)
protected

setBounds Set min & max for a vector

Parameters
rfResourceFinder object
boundsVector to set bounds to
configNamestring value for name of the parameter in config file
std_lowerdouble value for min bound
std_upperdouble value for max bound

Definition at line 985 of file module.cpp.

◆ skimBlobs()

Bottle IOL2OPCBridge::skimBlobs ( const Bottle &  blobs)
protected

skimBlobs Remove blobs which are too far away in the Cartesian space wrt Root frame

Parameters
blobsOriginal Yarp Bottle contains all blobs
Returns
Result Bottle contains valid blobs

Definition at line 97 of file module.cpp.

◆ thresBBox()

bool IOL2OPCBridge::thresBBox ( CvRect &  bbox,
const Image &  img 
)
protected

thresBBox Constrain a bounding box with respect to an image size

Parameters
bboxCvRect define the bounding box
imgImage with information used to constrain the bounding box
Returns
True if the size of the constrained bounding box is large enough (bigger than tracker_min_blob_size)

Definition at line 121 of file module.cpp.

◆ train()

void IOL2OPCBridge::train ( const string &  object,
const Bottle &  blobs,
const int  i 
)
protected

train Training himrepClassifier by sending an object by name and its bounding box

Parameters
objectstring value contains name of object to train
blobsYarp Bottle contains information of the estimated object bounding boxes: top left x, y, bottom right x, y
iinteger value for the corresponding blob of the object needed to train

Definition at line 723 of file module.cpp.

◆ train_object()

bool IOL2OPCBridge::train_object ( const string &  name)
virtual

Add a new object to the object-recognition database based on the selected blob.

If the object is already existing, its recognition is improved.

Parameters
nameis the object name
Returns
true/false on success/failure.

Reimplemented from iol2opc_IDL.

Definition at line 1341 of file module.cpp.

◆ updateModule()

bool IOL2OPCBridge::updateModule ( )
protected

Definition at line 1235 of file module.cpp.

◆ updateOPC()

void IOL2OPCBridge::updateOPC ( )
protected

updateOPC The whole procedure to update OPC, including naming known and unknown objects, drawing bounding boxes around objects

Definition at line 808 of file module.cpp.

◆ yInfoGated()

void IOL2OPCBridge::yInfoGated ( const char *  msg,
  ... 
) const
protected

Definition at line 30 of file module.cpp.

Friends And Related Function Documentation

◆ ClassifierReporter

friend class ClassifierReporter
friend

Definition at line 304 of file module.h.

◆ OpcUpdater

friend class OpcUpdater
friend

Definition at line 303 of file module.h.

◆ RtLocalization

friend class RtLocalization
friend

Definition at line 302 of file module.h.

Member Data Documentation

◆ blobExtractor

BufferedPort<Bottle> IOL2OPCBridge::blobExtractor
protected

buffered port of input of received blobs from lbpExtract

Definition at line 242 of file module.h.

◆ blobs_detection_timeout

double IOL2OPCBridge::blobs_detection_timeout
protected

Definition at line 283 of file module.h.

◆ classifierReporter

ClassifierReporter IOL2OPCBridge::classifierReporter
protected

Definition at line 256 of file module.h.

◆ clickLocation

CvPoint IOL2OPCBridge::clickLocation
protected

Definition at line 300 of file module.h.

◆ connectedSPQ

bool IOL2OPCBridge::connectedSPQ
protected

boolean flag to check internal connection to Superquadric-model

Definition at line 269 of file module.h.

◆ db

map<string,IOLObject> IOL2OPCBridge::db
protected

Definition at line 275 of file module.h.

◆ empty

bool IOL2OPCBridge::empty
protected

Definition at line 266 of file module.h.

◆ getClickPort

BufferedPort<Bottle> IOL2OPCBridge::getClickPort
protected

buffered port of input of clicked position

Definition at line 244 of file module.h.

◆ histColorsCode

deque<CvScalar> IOL2OPCBridge::histColorsCode
protected

Definition at line 281 of file module.h.

◆ histFilterLength

int IOL2OPCBridge::histFilterLength
protected

Definition at line 280 of file module.h.

◆ histFiltersPool

map<string,Filter*> IOL2OPCBridge::histFiltersPool
protected

Definition at line 279 of file module.h.

◆ histObjLocation

Vector IOL2OPCBridge::histObjLocation
protected

Definition at line 291 of file module.h.

◆ histObjLocPort

BufferedPort<Bottle> IOL2OPCBridge::histObjLocPort
protected

buffered port of input of localized objects from iol localizer

Definition at line 243 of file module.h.

◆ human_area_x_bounds

Vector IOL2OPCBridge::human_area_x_bounds
protected

Yarp Vector of min, max bounding of human region in x-axis.

Definition at line 293 of file module.h.

◆ human_area_y_bounds

Vector IOL2OPCBridge::human_area_y_bounds
protected

Yarp Vector of min, max bounding of human region in y-axis.

Definition at line 294 of file module.h.

◆ imgClassifier

Port IOL2OPCBridge::imgClassifier
protected

port of output image to himrefClassifier

Definition at line 251 of file module.h.

◆ imgHistogram

BufferedPort<ImageOf<PixelBgr> > IOL2OPCBridge::imgHistogram
protected

buffered port of output image of histogram of classification scores.

Definition at line 250 of file module.h.

◆ imgIn

BufferedPort<ImageOf<PixelBgr> > IOL2OPCBridge::imgIn
protected

buffered port of input calibrated image from left camera of iCub

Definition at line 246 of file module.h.

◆ imgRtLoc

ImageOf<PixelBgr> IOL2OPCBridge::imgRtLoc
protected

Image for real-time objects localization.

Definition at line 258 of file module.h.

◆ imgRtLocOut

BufferedPort<ImageOf<PixelBgr> > IOL2OPCBridge::imgRtLocOut
protected

buffered port of output image for real-time objects localization

Definition at line 247 of file module.h.

◆ imgSelBlobOut

BufferedPort<ImageOf<PixelBgr> > IOL2OPCBridge::imgSelBlobOut
protected

buffered port of output image inside the selected blob (by clicking on)

Definition at line 249 of file module.h.

◆ imgTrackOut

BufferedPort<ImageOf<PixelBgr> > IOL2OPCBridge::imgTrackOut
protected

buffered port of output image of tracked object

Definition at line 248 of file module.h.

◆ lastBlobs

Bottle IOL2OPCBridge::lastBlobs
protected

Bottle contains last blob information.

Definition at line 285 of file module.h.

◆ lastBlobsArrivalTime

double IOL2OPCBridge::lastBlobsArrivalTime
protected

time stamp of last received blob

Definition at line 284 of file module.h.

◆ mutexResources

Mutex IOL2OPCBridge::mutexResources
protected

Definition at line 259 of file module.h.

◆ mutexResourcesOpc

Mutex IOL2OPCBridge::mutexResourcesOpc
protected

Definition at line 260 of file module.h.

◆ mutexResourcesSFM

Mutex IOL2OPCBridge::mutexResourcesSFM
protected

Definition at line 261 of file module.h.

◆ mutexResourcesSPQ

Mutex IOL2OPCBridge::mutexResourcesSPQ
protected

Definition at line 262 of file module.h.

◆ object_persistence

bool IOL2OPCBridge::object_persistence
protected

Definition at line 267 of file module.h.

◆ objLocOut

BufferedPort<Bottle> IOL2OPCBridge::objLocOut
protected

buffered port of output of localized objects

Definition at line 245 of file module.h.

◆ onlyKnownObjects

IOLObject IOL2OPCBridge::onlyKnownObjects
protected

Definition at line 277 of file module.h.

◆ opc

OPCClient* IOL2OPCBridge::opc
protected

OPC client object.

Definition at line 238 of file module.h.

◆ opcBlobs

Bottle IOL2OPCBridge::opcBlobs
protected

Bottle contains received blobs of objects from OPC.

Definition at line 286 of file module.h.

◆ opcMedianFilterOrder

int IOL2OPCBridge::opcMedianFilterOrder
protected

Definition at line 255 of file module.h.

◆ opcScores

Bottle IOL2OPCBridge::opcScores
protected

Bottle contains received (class) score of objects from OPC.

Definition at line 287 of file module.h.

◆ opcUpdater

OpcUpdater IOL2OPCBridge::opcUpdater
protected

Definition at line 254 of file module.h.

◆ period

double IOL2OPCBridge::period
protected

Definition at line 264 of file module.h.

◆ presence_timeout

double IOL2OPCBridge::presence_timeout
protected

Definition at line 271 of file module.h.

◆ robot_area_x_bounds

Vector IOL2OPCBridge::robot_area_x_bounds
protected

Yarp Vector of min, max bounding of robot region in x-axis.

Definition at line 295 of file module.h.

◆ robot_area_y_bounds

Vector IOL2OPCBridge::robot_area_y_bounds
protected

Yarp Vector of min, max bounding of robot region in y-axis.

Definition at line 296 of file module.h.

◆ rpcClassifier

RpcClient IOL2OPCBridge::rpcClassifier
protected

rpc client port to send requests to himrepClassifier

Definition at line 236 of file module.h.

◆ rpcGet3D

RpcClient IOL2OPCBridge::rpcGet3D
protected

rpc client port to send requests to SFM

Definition at line 237 of file module.h.

◆ rpcGetBlobPoints

RpcClient IOL2OPCBridge::rpcGetBlobPoints
protected

rpc client port to send requests to lbpExtract and receive all points of a blob

Definition at line 240 of file module.h.

◆ rpcGetSPQ

RpcClient IOL2OPCBridge::rpcGetSPQ
protected

rpc client port to send requests to superquadric-model and receive superquadric parameters

Definition at line 239 of file module.h.

◆ rpcPort

RpcServer IOL2OPCBridge::rpcPort
protected

rpc server to receive user request

Definition at line 235 of file module.h.

◆ rtLocalization

RtLocalization IOL2OPCBridge::rtLocalization
protected

Definition at line 253 of file module.h.

◆ shared_area_x_bounds

Vector IOL2OPCBridge::shared_area_x_bounds
protected

Yarp Vector of min, max bounding of shared region in x-axis.

Definition at line 297 of file module.h.

◆ shared_area_y_bounds

Vector IOL2OPCBridge::shared_area_y_bounds
protected

Yarp Vector of min, max bounding of shared region in y-axis.

Definition at line 298 of file module.h.

◆ skim_blobs_x_bounds

Vector IOL2OPCBridge::skim_blobs_x_bounds
protected

Yarp Vector of min, max bounding in x-axis to reduce the blob detection.

Definition at line 289 of file module.h.

◆ skim_blobs_y_bounds

Vector IOL2OPCBridge::skim_blobs_y_bounds
protected

Yarp Vector of min, max bounding in y-axis to reduce the blob detection.

Definition at line 290 of file module.h.

◆ state

Bridge::State IOL2OPCBridge::state
protected

Definition at line 276 of file module.h.

◆ tracker_min_blob_size

VectorOf<int> IOL2OPCBridge::tracker_min_blob_size
protected

minimum size of tracker blob

Definition at line 274 of file module.h.

◆ tracker_timeout

double IOL2OPCBridge::tracker_timeout
protected

Definition at line 273 of file module.h.

◆ tracker_type

string IOL2OPCBridge::tracker_type
protected

Definition at line 272 of file module.h.

◆ useSPQ

bool IOL2OPCBridge::useSPQ
protected

boolean flag to enable/disable using Superquadric-model for object pose and size estimation

Definition at line 268 of file module.h.

◆ verbose

bool IOL2OPCBridge::verbose
protected

Definition at line 265 of file module.h.