ContourChannel Class Reference

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

List of all members.

Public Member Functions

 ContourChannel (OptionManager &mgr, const std::string &saveprefix="contourout")
virtual bool outputAvailable () const
 Query whether the channel is ready to give yield valid output.
virtual Dims getMapDims () const
 Return the dimensions of the output image.
virtual uint numSubmaps () const
 Return the number of feature maps represented by this channel.
virtual Image< float > getSubmap (unsigned int index) const
 Not implemented for ContourChannel.
virtual std::string getSubmapName (unsigned int index) const
 Get the name/description of the feature map at the given index.
virtual std::string getSubmapNameShort (unsigned int index) const
 Get the name/description of the feature map at the given index, short version.
virtual void getFeatures (const Point2D< int > &locn, std::vector< float > &mean) const
 Not implemented for ContourChannel.
virtual void getFeaturesBatch (std::vector< Point2D< int > * > *locn, std::vector< std::vector< float > > *mean, int *count) const
virtual Image< float > getOutput ()
 The output will be the size of the feature map level in the pyramid.
virtual void saveResults (const nub::ref< FrameOstream > &ofs)
 Save our various maps using a FrameOstream.

Protected Member Functions

virtual void paramChanged (ModelParamBase *param, const bool valueChanged, ParamClient::ChangeStatus *status)
 Called whenever a ModelParamBase has its value changed.
virtual void start1 ()
 This is called from within start() before the subcomponents start.
virtual void doInput (const InputFrame &inframe)
 Subclasses override this implementation of the input() function.
virtual void killCaches ()
 Subclasses override this to clear any caches they may maintain.
virtual void saveStats (const Image< float > img, const short idx)

Detailed Description

Definition at line 1707 of file ContourChannel.C.


Member Function Documentation

void ContourChannel::doInput ( const InputFrame inframe  )  [protected, virtual]

Subclasses override this implementation of the input() function.

This will be called by one of the input() methods. For efficiency reasons (e.g. network bandwidth in parallel code), it is possible that the color or luminance input may be null, although the code should be wired up properly so that given subclasses do not receive a null input that they in fact need. Subclasses should be sure to ASSERT that any used inputs are non-null.

Implements ChannelBase.

Definition at line 2174 of file ContourChannel.C.

References ASSERT, buildPyrGabor(), buildPyrGaussian(), buildPyrLaplacian(), doEnergyNorm(), doMeanNormalize(), doOneNormalize(), doRectify(), Image< T >::getDims(), getMapDims(), OModelParam< T >::getVal(), Dims::h(), Image< T >::initialized(), makeImageArray(), maxNormalize(), MAXNORMMAX, MAXNORMMIN, orientedFilterSet(), reduce(), rescale(), sformat(), takeMax(), takeSlice(), Dims::w(), and ZEROS.

virtual void ContourChannel::getFeatures ( const Point2D< int > &  locn,
std::vector< float > &  mean 
) const [inline, virtual]

Not implemented for ContourChannel.

Implements ChannelBase.

Definition at line 1732 of file ContourChannel.C.

Dims ContourChannel::getMapDims (  )  const [virtual]

Return the dimensions of the output image.

Implements ChannelBase.

Definition at line 2042 of file ContourChannel.C.

References ChannelBase::getInputDims(), OModelParam< T >::getVal(), and LevelSpec::mapLevel().

Referenced by doInput().

Image< float > ContourChannel::getOutput (  )  [virtual]

The output will be the size of the feature map level in the pyramid.

(I.e., the size of the output is given by getMapDims().

Implements ChannelBase.

Definition at line 2074 of file ContourChannel.C.

References OModelParam< T >::getVal().

virtual Image<float> ContourChannel::getSubmap ( unsigned int  index  )  const [inline, virtual]

Not implemented for ContourChannel.

Implements ChannelBase.

Definition at line 1721 of file ContourChannel.C.

std::string ContourChannel::getSubmapName ( unsigned int  index  )  const [virtual]

Get the name/description of the feature map at the given index.

This function is intended to be implemented by subclasses so that it recurses into any nested channels, mapping nested submaps into a linear sequence of indices. The output of this function is intended only to be human-readable (e.g. for labeling image displays), and does not have to follow any particular parseable syntax.

Implements ChannelBase.

Definition at line 2056 of file ContourChannel.C.

References angle(), ModelComponent::descriptiveName(), OModelParam< T >::getVal(), and sformat().

std::string ContourChannel::getSubmapNameShort ( unsigned int  index  )  const [virtual]

Get the name/description of the feature map at the given index, short version.

Implements ChannelBase.

Definition at line 2065 of file ContourChannel.C.

References angle(), OModelParam< T >::getVal(), sformat(), and ModelComponent::tagName().

void ContourChannel::killCaches (  )  [protected, virtual]

Subclasses override this to clear any caches they may maintain.

Subclasses must be sure to explicitly call their base class's version of this function!. This function will be called by ChannelBase when a new input image is received, or when new parameters are read from a ParamMap, etc. Subclasses may also call this function when they know that caches may have become invalid. Calling this explicitly after you have obtained the output from a channel may save you some memory.

Reimplemented from ChannelBase.

Definition at line 2344 of file ContourChannel.C.

uint ContourChannel::numSubmaps (  )  const [virtual]

Return the number of feature maps represented by this channel.

Implements ChannelBase.

Definition at line 2050 of file ContourChannel.C.

References OModelParam< T >::getVal().

bool ContourChannel::outputAvailable (  )  const [virtual]

Query whether the channel is ready to give yield valid output.

In some cases (e.g. with motion channels), it may take several input frames before the channel is fully initialized.

Implements ChannelBase.

Definition at line 2036 of file ContourChannel.C.

References Image< T >::initialized().

void ContourChannel::paramChanged ( ModelParamBase 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.

Parameters:
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 2136 of file ContourChannel.C.

References ModelComponent::addSubComponent(), ModelComponent::getManager(), OModelParam< T >::getVal(), MC_RECURSE, ModelComponent::removeSubComponent(), and nub::ref< T >::reset().

void ContourChannel::saveResults ( const nub::ref< FrameOstream > &  ofs  )  [virtual]

Save our various maps using a FrameOstream.

Reimplemented from ChannelBase.

Definition at line 2130 of file ContourChannel.C.

virtual void ContourChannel::start1 (  )  [inline, protected, virtual]

This is called from within start() before the subcomponents start.

Reimplemented from ModelComponent.

Definition at line 1755 of file ContourChannel.C.

References OModelParam< T >::getOptionDef(), OModelParam< T >::getVal(), and ModelOptionDef::longoptname.


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