An integrative visual buffer, std implementation. More...
#include <Neuro/VisualBuffer.H>
Public Member Functions | |
VisualBufferStd (OptionManager &mgr, const std::string &descrName="Visual Buffer", const std::string &tagName="VisualBuffer") | |
Constructor. | |
virtual | ~VisualBufferStd () |
Destructor. | |
Protected Member Functions | |
SIMCALLBACK_DECLARE (VisualBufferStd, SimEventAttentionGuidanceMapOutput) | |
Callback for every agm. | |
SIMCALLBACK_DECLARE (VisualBufferStd, SimEventRetinaImage) | |
Callback for every agm. | |
void | input (const WTAwinner &win, const Image< float > &sm, const Image< byte > &objmask) |
New input. | |
Image< byte > | getSaliencyMask () const |
Get saliency mask. | |
Image< float > | getBuffer () const |
Get current buffer. | |
void | evolve (SimEventQueue &q) |
evolve our internal dynamics | |
void | inhibit (const Point2D< int > &loc) |
inhibit a location, given in retinotopic/retinal-scale coords | |
void | inhibit (const Image< float > &mask) |
inhibit a location, using a mask of same dims/scale as the buffer | |
Point2D< int > | findMostInterestingTarget (const Point2D< int > &p) |
Decide on most interesting target location given current eye position. | |
Point2D< int > | findMostInterestingTargetLocMax (const Point2D< int > &p) |
Decide on most interesting target location given current eye position. | |
Point2D< int > | retinalToBuffer (const Point2D< int > &p) const |
transform coord from retinotopic/retinal-scale to world-centered/sm-scale | |
Point2D< int > | bufferToRetinal (const Point2D< int > &p) const |
transform coord from world-centered/sm-scale to retinotopic/retinal-scale | |
bool | isObjectBased () const |
are we object-based? | |
void | start1 () |
get started (see ModelComponent.H) | |
Protected Attributes | |
OModelParam< int > | itsFOAradius |
FOA radius. | |
OModelParam< bool > | itsIgnoreBoring |
ignore boring attention shifts | |
OModelParam< bool > | itsObjectBased |
true if doing object-based | |
OModelParam< Dims > | itsBufferDims |
dims of our internal buffer | |
OModelParam< LevelSpec > | itsLevelSpec |
levelspec determines buffer scale | |
OModelParam< Dims > | itsInputDims |
input image dims | |
OModelParam< SimTime > | itsTimePeriod |
period at which to apply interaction | |
OModelParam< float > | itsDecayFactor |
temporal decay factor | |
OModelParam< MaxNormType > | itsNormType |
maxnorm type for our internals |
An integrative visual buffer, std implementation.
A world-centered Visual Buffer to accumulate interesting locations (each time a covert attention shift occurs), with internal competitive dynamics within the buffer.
Definition at line 132 of file VisualBuffer.H.
VisualBufferStd::VisualBufferStd | ( | OptionManager & | mgr, | |
const std::string & | descrName = "Visual Buffer" , |
|||
const std::string & | tagName = "VisualBuffer" | |||
) |
Constructor.
Definition at line 136 of file VisualBuffer.C.
VisualBufferStd::~VisualBufferStd | ( | ) | [virtual] |
Destructor.
Definition at line 170 of file VisualBuffer.C.
transform coord from world-centered/sm-scale to retinotopic/retinal-scale
Definition at line 387 of file VisualBuffer.C.
References Image< T >::getDims(), OModelParam< T >::getVal(), itsLevelSpec, LevelSpec::mapLevel(), and visualBufferToRetinal().
void VisualBufferStd::evolve | ( | SimEventQueue & | q | ) | [protected] |
evolve our internal dynamics
Definition at line 290 of file VisualBuffer.C.
References OModelParam< T >::getVal(), itsTimePeriod, and SimEventQueue::now().
Decide on most interesting target location given current eye position.
All coordinates are in world-centered/sm-scale. The algorithm used here is inspired from the area activation model; we threshold out regions lower than a fraction of the maximum activation, then aim for the centroid of the region that is closest to current eye position.
Definition at line 317 of file VisualBuffer.C.
References centroid(), chamfer34(), findMin(), flood(), Image< T >::getDims(), getMinMax(), inplaceReplaceVal(), makeBinary(), and ZEROS.
Point2D< int > VisualBufferStd::findMostInterestingTargetLocMax | ( | const Point2D< int > & | p | ) | [protected] |
Decide on most interesting target location given current eye position.
All coordinates are in world-centered/sm-scale. The algorithm used here will aim for the local max above a threshold that is closest to current eye position.
Definition at line 345 of file VisualBuffer.C.
References Point2D< T >::distance(), Image< T >::getHeight(), getMinMax(), Image< T >::getVal(), Image< T >::getWidth(), Point2D< T >::i, and lowPass9().
Image< float > VisualBufferStd::getBuffer | ( | ) | const [protected] |
Get current buffer.
Definition at line 377 of file VisualBuffer.C.
Get saliency mask.
This is mostly for display purposes. The mask is the one that was created at the last input() and has the same size/scale as the saliency map and is in retinal coordinates
Definition at line 286 of file VisualBuffer.C.
void VisualBufferStd::inhibit | ( | const Image< float > & | mask | ) | [protected] |
inhibit a location, using a mask of same dims/scale as the buffer
mask | should have same dims as the buffer, and values between 0.0 (no inhibition) and 1.0 (full inhibition). |
Definition at line 310 of file VisualBuffer.C.
References binaryReverse().
void VisualBufferStd::inhibit | ( | const Point2D< int > & | loc | ) | [protected] |
inhibit a location, given in retinotopic/retinal-scale coords
A disk of radius FOAradius will be used for inhibition
Definition at line 302 of file VisualBuffer.C.
References drawDisk(), Image< T >::getDims(), OModelParam< T >::getVal(), itsFOAradius, itsLevelSpec, LevelSpec::mapLevel(), and ZEROS.
void VisualBufferStd::input | ( | const WTAwinner & | win, | |
const Image< float > & | sm, | |||
const Image< byte > & | objmask | |||
) | [protected] |
New input.
Beware that the inputs here are matched to what Brain naturally provides, which is
win | the coordinates of an atteention shift at retinal resolution | |
sm | the saliency map at the maplevel resolution | |
objmask | a mask with (if initialized) the shape of the attended object at retinal resolution. |
Definition at line 211 of file VisualBuffer.C.
References binaryReverse(), WTAwinner::boring, chamfer34(), Image< T >::clear(), drawDisk(), Image< T >::getDims(), OModelParam< T >::getVal(), Dims::h(), Image< T >::initialized(), inplaceLowThresh(), itsFOAradius, itsIgnoreBoring, itsInputDims, itsObjectBased, WTAwinner::p, pasteImage(), rescale(), Image< T >::resize(), retinalToBuffer(), squash(), takeMax(), Dims::w(), and ZEROS.
bool VisualBufferStd::isObjectBased | ( | ) | const [protected] |
are we object-based?
Definition at line 393 of file VisualBuffer.C.
References OModelParam< T >::getVal(), and itsObjectBased.
transform coord from retinotopic/retinal-scale to world-centered/sm-scale
Definition at line 381 of file VisualBuffer.C.
References Image< T >::getDims(), OModelParam< T >::getVal(), itsLevelSpec, LevelSpec::mapLevel(), and retinalToVisualBuffer().
Referenced by input().
VisualBufferStd::SIMCALLBACK_DECLARE | ( | VisualBufferStd | , | |
SimEventRetinaImage | ||||
) | [protected] |
Callback for every agm.
VisualBufferStd::SIMCALLBACK_DECLARE | ( | VisualBufferStd | , | |
SimEventAttentionGuidanceMapOutput | ||||
) | [protected] |
Callback for every agm.
void VisualBufferStd::start1 | ( | ) | [protected, virtual] |
get started (see ModelComponent.H)
Reimplemented from SimModule.
Definition at line 156 of file VisualBuffer.C.
References OModelParam< T >::getVal(), OModelParam< T >::getValString(), Dims::h(), Dims::isNonEmpty(), itsBufferDims, itsDecayFactor, itsNormType, Image< T >::resize(), and Dims::w().
OModelParam<Dims> VisualBufferStd::itsBufferDims [protected] |
OModelParam<float> VisualBufferStd::itsDecayFactor [protected] |
OModelParam<int> VisualBufferStd::itsFOAradius [protected] |
OModelParam<bool> VisualBufferStd::itsIgnoreBoring [protected] |
ignore boring attention shifts
Definition at line 204 of file VisualBuffer.H.
Referenced by input().
OModelParam<Dims> VisualBufferStd::itsInputDims [protected] |
OModelParam<LevelSpec> VisualBufferStd::itsLevelSpec [protected] |
levelspec determines buffer scale
Definition at line 207 of file VisualBuffer.H.
Referenced by bufferToRetinal(), inhibit(), and retinalToBuffer().
OModelParam<MaxNormType> VisualBufferStd::itsNormType [protected] |
maxnorm type for our internals
Definition at line 211 of file VisualBuffer.H.
Referenced by start1().
OModelParam<bool> VisualBufferStd::itsObjectBased [protected] |
true if doing object-based
Definition at line 205 of file VisualBuffer.H.
Referenced by input(), and isObjectBased().
OModelParam<SimTime> VisualBufferStd::itsTimePeriod [protected] |
period at which to apply interaction
Definition at line 209 of file VisualBuffer.H.
Referenced by evolve().