This class provides an interface into SurpriseControl (ASAC). More...
#include <Neuro/SimulationViewerSurpCont.H>
Public Member Functions | |
void | init (const ushort baseSizeX, const ushort baseSizeY) |
Initialize everything. Input the raw image size. | |
Constructors and destructors | |
SimulationViewerSurpCont (OptionManager &mgr, const std::string &descrName="ASAC Surprise Control", const std::string &tagName="SurpriseControl") | |
Constructor. See ModelComponent.H. | |
virtual | ~SimulationViewerSurpCont () |
Destructor. | |
virtual void | setBrain (Brain *brain) |
Set our brain. | |
Protected Member Functions | |
SIMCALLBACK_DECLARE (SimulationViewerSurpCont, SimEventInputFrame) | |
Callback for when a new input frame is available. | |
SIMCALLBACK_DECLARE (SimulationViewerSurpCont, SimEventClockTick) | |
Callback for every clock tick. | |
SIMCALLBACK_DECLARE (SimulationViewerSurpCont, SimEventSaveOutput) | |
Callback for every time we should save our outputs. | |
virtual void | save1 (const ModelComponentSaveInfo &sinfo) |
Save our various results. | |
void | saveResults (const nub::ref< FrameOstream > &ofs) |
save results | |
Image< PixRGB< float > > | getResult () |
return the surprise controlled image | |
std::vector< Image< PixRGB < float > > > | getDiffImages () |
return the difference images if needed | |
std::vector< Image< float > > | getBetaImages () |
return the beta images if needed | |
void | drawTime (Image< PixRGB< byte > > &image) |
Draw current time onto given image. | |
Protected Attributes | |
nub::ref< SpatialMetrics > | itsMetrics |
metrics that depend on the input size: | |
OModelParam< bool > | itsDrawDiffParts |
Should we output the difference image between the pre/post image. | |
OModelParam< bool > | itsDrawBetaParts |
should we output the surprise maps used here? | |
OModelParam< bool > | itsDrawBiasParts |
should we output the bias maps used here? | |
OModelParam< bool > | itsDrawSeperableParts |
should we output the seperable filter layers used here? | |
OModelParam< std::string > | itsConfigFile |
config file to open | |
OModelParam< LevelSpec > | itsLevelSpec |
LevelSpec used by our channels, used to compute output dims. |
This class provides an interface into SurpriseControl (ASAC).
Surprise Control takes in an image and a set of final stage conspicuity images at different scales and uses them to drive different filters that are designed to reduce/control surprise in an image.
In general, any type of conspicuity map can be used, but it's primarily designed to work with Surprise images. However, this version requires the standard default scales and channels (rg,by... etc). It does not know how to handle different features such as junctions.
You need to supply:
This class will return:
T. Nathan Mundhenk <mundhenk@usc.edu>
Definition at line 84 of file SimulationViewerSurpCont.H.
SimulationViewerSurpCont::SimulationViewerSurpCont | ( | OptionManager & | mgr, | |
const std::string & | descrName = "ASAC Surprise Control" , |
|||
const std::string & | tagName = "SurpriseControl" | |||
) |
Constructor. See ModelComponent.H.
mgr | our ModelManager (see ModelManager.H) | |
descrName | descriptive name for human usage | |
tagName | name for ParamMap usage |
Definition at line 61 of file SimulationViewerSurpCont.C.
References ModelComponent::addSubComponent(), and itsMetrics.
SimulationViewerSurpCont::~SimulationViewerSurpCont | ( | ) | [virtual] |
Destructor.
Definition at line 81 of file SimulationViewerSurpCont.C.
Draw current time onto given image.
Definition at line 366 of file SimulationViewerSurpCont.C.
References image, SimTime::msecs(), and writeText().
std::vector< Image< float > > SimulationViewerSurpCont::getBetaImages | ( | ) | [protected] |
return the beta images if needed
Definition at line 360 of file SimulationViewerSurpCont.C.
References ScaleSurpriseControl< FLOAT >::SSCgetBetaParts().
std::vector< Image< PixRGB< float > > > SimulationViewerSurpCont::getDiffImages | ( | ) | [protected] |
return the difference images if needed
Definition at line 354 of file SimulationViewerSurpCont.C.
References ScaleSurpriseControl< FLOAT >::SSCgetDiffParts().
return the surprise controlled image
Definition at line 348 of file SimulationViewerSurpCont.C.
References ScaleSurpriseControl< FLOAT >::SSCgetFrame().
Initialize everything. Input the raw image size.
Definition at line 85 of file SimulationViewerSurpCont.C.
References configFile, OModelParam< T >::getVal(), itsConfigFile, ScaleSurpriseControl< FLOAT >::SSCinit(), and ScaleSurpriseControl< FLOAT >::SSCreadConfig().
void SimulationViewerSurpCont::save1 | ( | const ModelComponentSaveInfo & | sinfo | ) | [protected, virtual] |
Save our various results.
Reimplemented from ModelComponent.
Definition at line 337 of file SimulationViewerSurpCont.C.
References saveResults().
void SimulationViewerSurpCont::saveResults | ( | const nub::ref< FrameOstream > & | ofs | ) | [protected] |
save results
Definition at line 141 of file SimulationViewerSurpCont.C.
References bimage, OModelParam< T >::getVal(), itsDrawBetaParts, itsDrawBiasParts, itsDrawDiffParts, itsDrawSeperableParts, SimTime::msecs(), SRC_POS, ScaleSurpriseControl< FLOAT >::SSCgetBetaParts(), ScaleSurpriseControl< FLOAT >::SSCgetBiasParts(), ScaleSurpriseControl< FLOAT >::SSCgetDiffImage(), ScaleSurpriseControl< FLOAT >::SSCgetDiffParts(), ScaleSurpriseControl< FLOAT >::SSCgetFrame(), and ScaleSurpriseControl< FLOAT >::SSCgetSeperableParts().
Referenced by save1().
void SimulationViewerSurpCont::setBrain | ( | Brain * | brain | ) | [virtual] |
Set our brain.
Definition at line 97 of file SimulationViewerSurpCont.C.
References LevelSpec::delMax(), LevelSpec::delMin(), OModelParam< T >::getVal(), itsLevelSpec, LevelSpec::levMax(), LevelSpec::levMin(), LevelSpec::mapLevel(), LevelSpec::maxDepth(), LevelSpec::maxIndex(), and ScaleSurpriseControl< FLOAT >::SSCsetLevelSpecInfo().
SimulationViewerSurpCont::SIMCALLBACK_DECLARE | ( | SimulationViewerSurpCont | , | |
SimEventSaveOutput | ||||
) | [protected] |
Callback for every time we should save our outputs.
SimulationViewerSurpCont::SIMCALLBACK_DECLARE | ( | SimulationViewerSurpCont | , | |
SimEventClockTick | ||||
) | [protected] |
Callback for every clock tick.
SimulationViewerSurpCont::SIMCALLBACK_DECLARE | ( | SimulationViewerSurpCont | , | |
SimEventInputFrame | ||||
) | [protected] |
Callback for when a new input frame is available.
config file to open
Definition at line 150 of file SimulationViewerSurpCont.H.
Referenced by init().
OModelParam<bool> SimulationViewerSurpCont::itsDrawBetaParts [protected] |
should we output the surprise maps used here?
Definition at line 144 of file SimulationViewerSurpCont.H.
Referenced by saveResults().
OModelParam<bool> SimulationViewerSurpCont::itsDrawBiasParts [protected] |
should we output the bias maps used here?
Definition at line 146 of file SimulationViewerSurpCont.H.
Referenced by saveResults().
OModelParam<bool> SimulationViewerSurpCont::itsDrawDiffParts [protected] |
Should we output the difference image between the pre/post image.
Definition at line 142 of file SimulationViewerSurpCont.H.
Referenced by saveResults().
OModelParam<bool> SimulationViewerSurpCont::itsDrawSeperableParts [protected] |
should we output the seperable filter layers used here?
Definition at line 148 of file SimulationViewerSurpCont.H.
Referenced by saveResults().
OModelParam<LevelSpec> SimulationViewerSurpCont::itsLevelSpec [protected] |
LevelSpec used by our channels, used to compute output dims.
Definition at line 152 of file SimulationViewerSurpCont.H.
Referenced by setBrain().
nub::ref<SpatialMetrics> SimulationViewerSurpCont::itsMetrics [protected] |
metrics that depend on the input size:
Definition at line 139 of file SimulationViewerSurpCont.H.
Referenced by SimulationViewerSurpCont().