Classes | |
struct | SpeechToken |
struct | Stats |
struct | TokenType |
Public Types | |
enum | State { CHECK_TARGET, TRACK_TARGET, CHECK_TARGET, TRACK_TARGET } |
enum | State { CHECK_TARGET, TRACK_TARGET, CHECK_TARGET, TRACK_TARGET } |
Public Member Functions | |
NeoBrain (OptionManager &mgr, const std::string &descrName="NeoBrain", const std::string &tagName="NeoBrain") | |
Constructor. | |
virtual | ~NeoBrain () |
virtual destructor for safe inheritance | |
void | init (Dims imageDims, int nPoints=1, int wz=10) |
void | setTarget (Point2D< int > loc, const Image< byte > &grey, int saliencyval=-1, bool changeState=false, bool forceNewLocation=false) |
void | setTarget (Point2D< int > loc, const Image< PixRGB< byte > > &rgb, int saliencyval=-1, bool changeState=false, bool forceNewLocation=false) |
Point2D< int > | trackObject (const Image< byte > &grey) |
std::vector< Point2D< int > > | getTrackersLoc (const Image< byte > &grey) |
Point2D< int > | trackObject (const Image< PixRGB< byte > > &rgb) |
void | saySaliencyVal (byte val) |
void | moveHeadToTarget () |
void | updateBoringness (const Image< byte > &salmap, byte foaval) |
void | updateExcitement (double vcxflicker) |
float | getBoringness () const |
float | getExcitementLevel () const |
float | getSleepLevel () const |
bool | sayText (const std::string &text, int priority, bool block=false) const |
std::string | getToken (const std::string &token, int val) const |
bool | sayToken (const std::string &token, int val, int priority) const |
bool | sayObjectLabel (const std::string &label, int confidence, bool foceLabel=false) |
Stats | getStats () const |
Image< PixRGB< byte > > | getSaliencyHisto (const Dims &dims, const PixRGB< byte > &back, const PixRGB< byte > &fore) |
bool | getUseHead () |
bool | getRelaxNeck () |
int | getBoringnessThresh () |
int | getErrTolerance () |
int | getDistTolerance () |
long | getTrackDelayFrames () |
long | getBigErrFramesThresh () |
long | getTargetFramesThresh () |
long | getNoMoveFramesThresh () |
long | getStopTrackDelayFrames () |
void | gotoSleep () |
void | wakeUp () |
bool | isSleeping () |
void | setUseHead (bool val) |
void | setRelaxNeck (bool val) |
void | setBoringnessThresh (int val) |
void | setErrTolerance (int val) |
void | setDistTolerance (int val) |
void | setTrackDelayFrames (long val) |
void | setBigErrFramesThresh (long val) |
void | setTargetFramesThresh (long val) |
void | setNoMoveFramesThresh (long val) |
void | setStopTrackDelayFrames (long val) |
void | setKeepTracking (bool val) |
void | relaxHead () |
NeoBrain (OptionManager &mgr, const std::string &descrName="NeoBrain", const std::string &tagName="NeoBrain") | |
Constructor. | |
virtual | ~NeoBrain () |
virtual destructor for safe inheritance | |
void | init (Dims imageDims, int nPoints=1, int wz=10) |
void | setTarget (Point2D< int > loc, const Image< byte > &grey, int saliencyval=-1, bool changeState=true) |
void | setTarget (Point2D< int > loc, const Image< PixRGB< byte > > &rgb, int saliencyval=-1, bool changeState=true) |
Point2D< int > | trackObject (const Image< byte > &grey) |
std::vector< Point2D< int > > | getTrackersLoc (const Image< byte > &grey) |
Point2D< int > | trackObject (const Image< PixRGB< byte > > &rgb) |
void | saySaliencyVal (byte val) |
void | moveHeadToTarget () |
void | updateBoringness (const Image< byte > &salmap, byte foaval) |
void | updateExcitement (double vcxflicker) |
float | getBoringness () const |
float | getExcitementLevel () const |
float | getSleepLevel () const |
bool | sayText (const std::string &text, int priority, bool block=false) const |
std::string | getToken (const std::string &token, int val) const |
bool | sayToken (const std::string &token, int val, int priority) const |
bool | sayObjectLabel (const std::string &label, int confidence, bool foceLabel=false) |
Stats | getStats () const |
Image< PixRGB< byte > > | getSaliencyHisto (const Dims &dims, const PixRGB< byte > &back, const PixRGB< byte > &fore) |
bool | getUseHead () |
bool | getRelaxNeck () |
int | getBoringnessThresh () |
int | getErrTolerance () |
int | getDistTolerance () |
long | getTrackDelayFrames () |
long | getBigErrFramesThresh () |
long | getTargetFramesThresh () |
long | getNoMoveFramesThresh () |
long | getStopTrackDelayFrames () |
void | gotoSleep () |
void | wakeUp () |
bool | isSleeping () |
void | setUseHead (bool val) |
void | setRelaxNeck (bool val) |
void | setBoringnessThresh (int val) |
void | setErrTolerance (int val) |
void | setDistTolerance (int val) |
void | setTrackDelayFrames (long val) |
void | setBigErrFramesThresh (long val) |
void | setTargetFramesThresh (long val) |
void | setNoMoveFramesThresh (long val) |
void | setStopTrackDelayFrames (long val) |
void | setKeepTracking (bool val) |
void | relaxHead () |
Protected Member Functions | |
virtual void | start2 () |
This is called from within start() after the subcomponents have started. | |
void | paramChanged (ModelParamBase *const param, const bool valueChanged, ParamClient::ChangeStatus *status) |
Called whenever a ModelParamBase has its value changed. | |
virtual void | start2 () |
This is called from within start() after the subcomponents have started. | |
void | paramChanged (ModelParamBase *const param, const bool valueChanged, ParamClient::ChangeStatus *status) |
Called whenever a ModelParamBase has its value changed. |
Definition at line 67 of file NeoBrain.H.
NeoBrain::NeoBrain | ( | OptionManager & | mgr, | |
const std::string & | descrName = "NeoBrain" , |
|||
const std::string & | tagName = "NeoBrain" | |||
) |
Constructor.
Definition at line 101 of file NeoBrain.C.
References ModelComponent::addSubComponent(), and ModelParamBase::setInactive().
NeoBrain::~NeoBrain | ( | ) | [virtual] |
virtual destructor for safe inheritance
Definition at line 174 of file NeoBrain.C.
NeoBrain::NeoBrain | ( | OptionManager & | mgr, | |
const std::string & | descrName = "NeoBrain" , |
|||
const std::string & | tagName = "NeoBrain" | |||
) |
Constructor.
virtual NeoBrain::~NeoBrain | ( | ) | [virtual] |
virtual destructor for safe inheritance
void NeoBrain::paramChanged | ( | ModelParamBase *const | param, | |
const bool | valueChanged, | |||
ParamClient::ChangeStatus * | status | |||
) | [protected, virtual] |
Called whenever a ModelParamBase has its value changed.
Subclasses of ModelComponent should override this function if they need to do any internal reconfiguration when their parameters change value (whether due to a command-line option, or a setModelParamString(), or a readParamsFrom()). See OrientationChannel::paramChanged() in Channels/OrientationChannel.C for an example; also see SaccadeControllerConfigurator::paramChanged() in Neuro/SaccadeControllers.C for for how to use this to select subcomponents at runtime.
param | the address of the ModelParamBase that changed; subclasses can compare this with the addresses of their model param members to figure out which is the relevant param | |
valueChanged | true if the value actually changed, false if the value was "set" but the new value is the same as the old value; some clients may want to avoid re-doing expensive operations if the value did not actually change | |
status | the subclass that implements paramChanged() should set *status to CHANGE_REJECTED if it wishes to reject a particular parameter change; the caller of paramChanged() is expected to set *status to CHANGE_ACCEPTED prior to calling paramChanged(), so the implentation of paramChanged() does not need to set *status CHANGE_ACCEPTED if it wishes to allow the change since that will already be the default status |
HISTORICAL NOTE: In the past, subclasses would override setModelParamString() for this same purpose, but in the new setup, setModelParamString() is NOT virtual and hence should not be (cannot be) overridden by subclasses. This setup is cleaner (and potentially more efficient) because subclasses don't have to compare string names to figure out which param changed; instead they are passed the address of the param itself. Furthermore, the new setup is more robust, since we can handle param value changes that come from any source (e.g., setModelParamVal(), or ModelParamBase::setValString(), or OModelParam::setVal()), and not just those that come through setModelParamString().
Reimplemented from ModelComponent.
void NeoBrain::paramChanged | ( | ModelParamBase *const | param, | |
const bool | valueChanged, | |||
ParamClient::ChangeStatus * | status | |||
) | [protected, virtual] |
Called whenever a ModelParamBase has its value changed.
Subclasses of ModelComponent should override this function if they need to do any internal reconfiguration when their parameters change value (whether due to a command-line option, or a setModelParamString(), or a readParamsFrom()). See OrientationChannel::paramChanged() in Channels/OrientationChannel.C for an example; also see SaccadeControllerConfigurator::paramChanged() in Neuro/SaccadeControllers.C for for how to use this to select subcomponents at runtime.
param | the address of the ModelParamBase that changed; subclasses can compare this with the addresses of their model param members to figure out which is the relevant param | |
valueChanged | true if the value actually changed, false if the value was "set" but the new value is the same as the old value; some clients may want to avoid re-doing expensive operations if the value did not actually change | |
status | the subclass that implements paramChanged() should set *status to CHANGE_REJECTED if it wishes to reject a particular parameter change; the caller of paramChanged() is expected to set *status to CHANGE_ACCEPTED prior to calling paramChanged(), so the implentation of paramChanged() does not need to set *status CHANGE_ACCEPTED if it wishes to allow the change since that will already be the default status |
HISTORICAL NOTE: In the past, subclasses would override setModelParamString() for this same purpose, but in the new setup, setModelParamString() is NOT virtual and hence should not be (cannot be) overridden by subclasses. This setup is cleaner (and potentially more efficient) because subclasses don't have to compare string names to figure out which param changed; instead they are passed the address of the param itself. Furthermore, the new setup is more robust, since we can handle param value changes that come from any source (e.g., setModelParamVal(), or ModelParamBase::setValString(), or OModelParam::setVal()), and not just those that come through setModelParamString().
Reimplemented from ModelComponent.
Definition at line 937 of file NeoBrain.C.
References OModelParam< T >::getVal(), NModelParam< T >::getVal(), and REPORT_CURRENT_EXCEPTION.
virtual void NeoBrain::start2 | ( | ) | [protected, virtual] |
This is called from within start() after the subcomponents have started.
Reimplemented from ModelComponent.
void NeoBrain::start2 | ( | ) | [protected, virtual] |
This is called from within start() after the subcomponents have started.
Reimplemented from ModelComponent.
Definition at line 189 of file NeoBrain.C.
References OModelParam< T >::getVal(), and OModelParam< T >::setVal().