RetinaAdapter Class Reference

Inheritance diagram for RetinaAdapter:
Inheritance graph
[legend]
Collaboration diagram for RetinaAdapter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RetinaAdapter (OptionManager &mgr, const std::string &descrName="RetinaAdapter", const std::string &tagName="RetinaAdapter")
 Constructor.
virtual ~RetinaAdapter ()
 Destructor.

Protected Member Functions

 SIMCALLBACK_DECLARE (RetinaAdapter, SimEventInputFrame)
 Callback for when a new input frame is available.
 SIMCALLBACK_DECLARE (RetinaAdapter, SimEventSaccadeStatusEye)
 Callback for when a new eye movement is available.
 SIMCALLBACK_DECLARE (RetinaAdapter, SimEventSaveOutput)
 Callback for every time we should save our outputs.
virtual void start1 ()
 Overridden so we can load our clip mask file, if any.
Image< PixRGB< byte > > getOutput (const Image< PixRGB< byte > > &inp, const Point2D< int > &eyepos, const bool inBlink)
 Compute a new output.
virtual void postInputFrame (SimEventQueue &q, InputFrame &ifr)
virtual Image< PixRGB< byte > > transform (const Image< PixRGB< byte > > &image)=0
 Transform the image after it has already been shifted, cropped, foveated, etc.
virtual Rectangle getRawInputRectangle (const Dims &indims, const Dims &outdims) const
 Get a rectangle delineating the raw input image area.
Point2D< int > getRawToRetinalOffset () const
 Get raw to retinal offset.
virtual void save1 (const ModelComponentSaveInfo &sinfo)
 Save our internals.

Protected Attributes

OModelParam< std::stringitsClipMaskFname
 filename of a clipmask image to load; or empty string for no clipmask
OModelParam< int > itsRawInpRectBorder
 Border for our raw input rectangle, in pixels.
OModelParam< Point2D< int > > itsInitialEyePosition
 Initial eye position (to foveate first frame).
OModelParam< bool > itsEnablePyramidCaches
 Whether to allow pyramid caches in the InputFrame objects that we create.
OModelParam< int > itsFoveaRadius
 Radius of our fovea.
OModelParam< bool > itsSaveInput
 Save our raw input?
OModelParam< bool > itsSaveOutput
 Save our output image?
OModelParam< std::stringitsFramingImageName
 Image file to use for input framing.
OModelParam< Point2D< int > > itsFramingImagePos
 Offset to apply for input framing.
OModelParam< uintitsFoveateInputDepth
 Pyramid depth to use when foveating the input, or 0 for no foveation.
OModelParam< bool > itsShiftInput
 shift input to eye position?
OModelParam< PixRGB< byte > > itsShiftInputBGcol
 background color to use when shifting input to eye position
OModelParam< DimsitsInputFOV
 crop input to a given FOV?
OModelParam< bool > itsSavePyr
 Save our internal pyramid?
OModelParam< bool > itsBlankBlink
 Blank out visual inputs during blinks?
OModelParam< std::stringitsRetMaskFname
 filename of a retinal mask image to load; or empty string for no mask
OModelParam< bool > itsFlipHoriz
 flip input image horizontally?
OModelParam< bool > itsFlipVertic
 flip input image vertically?
Image< byteitsClipMask
 mask to eliminate parts of scene
Point2D< int > itsEyePos
 current eye position
bool itsEyeBlinkStatus
 are we in blink?
Image< PixRGB< byte > > itsRawInput
 copy of input in case we want to save it
Image< PixRGB< byte > > itsOutput
 copy of output in case we want to save it
Image< PixRGB< byte > > itsFramingImage
 image used for framing
Point2D< int > itsRetinalShift
Image< byteitsRetMask
ImageSet< PixRGB< byte > > itsMultiRetina

Detailed Description

Definition at line 81 of file Retina.H.


Constructor & Destructor Documentation

RetinaAdapter::RetinaAdapter ( OptionManager mgr,
const std::string descrName = "RetinaAdapter",
const std::string tagName = "RetinaAdapter" 
)

Constructor.

See ModelComponent.H for details

Definition at line 107 of file Retina.C.

RetinaAdapter::~RetinaAdapter (  )  [virtual]

Destructor.

Definition at line 141 of file Retina.C.


Member Function Documentation

Image< PixRGB< byte > > RetinaAdapter::getOutput ( const Image< PixRGB< byte > > &  inp,
const Point2D< int > &  eyepos,
const bool  inBlink 
) [protected]
Rectangle RetinaAdapter::getRawInputRectangle ( const Dims indims,
const Dims outdims 
) const [protected, virtual]

Get a rectangle delineating the raw input image area.

As the raw input may be embedded into a background, shifted, cropped by a field of view, etc., this function allows users to recover the boundaries of the original frames. Note that the rectangle will be possibly cropped to fit within the dims of the Retina's output. A border may be specified that will be used to shrink (if positive) or enlarge (if negative) the returned rectangle (and will be applied before the rectangle is cropped to dims). The default implementation in the base class is to just return a rectangle at (0,0) with dims of the raw input.

Reimplemented in RetinaCT.

Definition at line 216 of file Retina.C.

References Rectangle::getOverlap(), OModelParam< T >::getVal(), Dims::h(), Point2D< T >::i, itsFramingImagePos, itsRawInpRectBorder, Rectangle::tlbrI(), and Dims::w().

Referenced by postInputFrame().

Point2D< int > RetinaAdapter::getRawToRetinalOffset (  )  const [protected]

Get raw to retinal offset.

Definition at line 228 of file Retina.C.

References OModelParam< T >::getVal(), and itsFramingImagePos.

Referenced by postInputFrame(), and RetinaCT::postInputFrame().

void RetinaAdapter::postInputFrame ( SimEventQueue q,
InputFrame ifr 
) [protected, virtual]

post our input frame with a SimEventRetinaImage message. Derived classes may want to post messages derived from SimEventRetinaImage

Reimplemented in RetinaCT.

Definition at line 207 of file Retina.C.

References Image< T >::getDims(), getRawInputRectangle(), getRawToRetinalOffset(), itsRawInput, and SimEventQueue::post().

void RetinaAdapter::save1 ( const ModelComponentSaveInfo sinfo  )  [protected, virtual]

Save our internals.

Depending on our ModelParam settings, we can save our raw input frames (with name prefix "RETIN-"), and/or our foveated output images (prefix "RETOUT-"), and/or our pyramid frames (with name prefix "RET<level>-").

Reimplemented from ModelComponent.

Definition at line 264 of file Retina.C.

References OModelParam< T >::getVal(), Image< T >::initialized(), itsOutput, itsRawInput, itsSaveInput, itsSaveOutput, itsSavePyr, sformat(), ImageSet< T >::size(), and SRC_POS.

RetinaAdapter::SIMCALLBACK_DECLARE ( RetinaAdapter  ,
SimEventSaveOutput   
) [protected]

Callback for every time we should save our outputs.

RetinaAdapter::SIMCALLBACK_DECLARE ( RetinaAdapter  ,
SimEventSaccadeStatusEye   
) [protected]

Callback for when a new eye movement is available.

RetinaAdapter::SIMCALLBACK_DECLARE ( RetinaAdapter  ,
SimEventInputFrame   
) [protected]

Callback for when a new input frame is available.

void RetinaAdapter::start1 (  )  [protected, virtual]

Overridden so we can load our clip mask file, if any.

Reimplemented from SimModule.

Reimplemented in RetinaCT.

Definition at line 232 of file Retina.C.

References Image< T >::getHeight(), OModelParam< T >::getVal(), Image< T >::getWidth(), itsClipMask, itsClipMaskFname, itsFramingImage, itsFramingImageName, itsRetMaskFname, Raster::ReadGray(), and Raster::ReadRGB().

virtual Image<PixRGB<byte> > RetinaAdapter::transform ( const Image< PixRGB< byte > > &  image  )  [protected, pure virtual]

Transform the image after it has already been shifted, cropped, foveated, etc.

Implemented in RetinaStd, and RetinaCT.

Referenced by getOutput().


Member Data Documentation

Blank out visual inputs during blinks?

Definition at line 147 of file Retina.H.

Referenced by getOutput().

mask to eliminate parts of scene

Definition at line 192 of file Retina.H.

Referenced by start1().

filename of a clipmask image to load; or empty string for no clipmask

Definition at line 102 of file Retina.H.

Referenced by start1().

Whether to allow pyramid caches in the InputFrame objects that we create.

Definition at line 111 of file Retina.H.

are we in blink?

Definition at line 194 of file Retina.H.

current eye position

Definition at line 193 of file Retina.H.

flip input image horizontally?

Definition at line 153 of file Retina.H.

Referenced by getOutput().

flip input image vertically?

Definition at line 156 of file Retina.H.

Referenced by getOutput().

Radius of our fovea.

Definition at line 117 of file Retina.H.

Referenced by getOutput().

Pyramid depth to use when foveating the input, or 0 for no foveation.

Definition at line 132 of file Retina.H.

Referenced by getOutput().

image used for framing

Definition at line 199 of file Retina.H.

Referenced by getOutput(), and start1().

Image file to use for input framing.

Definition at line 126 of file Retina.H.

Referenced by start1().

Offset to apply for input framing.

Definition at line 129 of file Retina.H.

Referenced by getOutput(), getRawInputRectangle(), and getRawToRetinalOffset().

Initial eye position (to foveate first frame).

Definition at line 108 of file Retina.H.

crop input to a given FOV?

Definition at line 141 of file Retina.H.

Referenced by getOutput().

copy of output in case we want to save it

Definition at line 197 of file Retina.H.

Referenced by getOutput(), and save1().

Border for our raw input rectangle, in pixels.

Definition at line 105 of file Retina.H.

Referenced by getRawInputRectangle().

copy of input in case we want to save it

Definition at line 196 of file Retina.H.

Referenced by postInputFrame(), RetinaCT::postInputFrame(), and save1().

filename of a retinal mask image to load; or empty string for no mask

Definition at line 150 of file Retina.H.

Referenced by start1().

Save our raw input?

Definition at line 120 of file Retina.H.

Referenced by save1().

Save our output image?

Definition at line 123 of file Retina.H.

Referenced by save1().

Save our internal pyramid?

Definition at line 144 of file Retina.H.

Referenced by save1().

shift input to eye position?

Definition at line 135 of file Retina.H.

Referenced by getOutput().

background color to use when shifting input to eye position

Definition at line 138 of file Retina.H.

Referenced by getOutput().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:46 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3