Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ContourChannel Class Reference

Inheritance diagram for ContourChannel:

Inheritance graph
[legend]
Collaboration diagram for ContourChannel:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 1707 of file ContourChannel.C.

Public Member Functions

 ContourChannel (OptionManager &mgr, const std::string &saveprefix="contourout")
virtual ~ContourChannel ()
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 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)


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 2163 of file ContourChannel.C.

References dummy_namespace_to_avoid_gcc411_bug_ContourChannel_C::SaveSet::add(), ASSERT, dummy_namespace_to_avoid_gcc411_bug_ContourChannel_C::boxDownSizeClean(), buildPyrGabor(), buildPyrGaussian(), buildPyrLaplacian(), dummy_namespace_to_avoid_gcc411_bug_ContourChannel_C::SaveSet::clear(), doEnergyNorm(), doMeanNormalize(), doOneNormalize(), doRectify(), Image< T >::getDims(), InputFrame::getHeight(), ImageSet< T >::getImageMut(), dummy_namespace_to_avoid_gcc411_bug_ContourChannel_C::getScaleBias(), OModelParam< T >::getVal(), InputFrame::getWidth(), InputFrame::grayFloat(), Dims::h(), i, Image< T >::initialized(), LFATAL, makeImageArray(), CpuTimer::mark(), maxNormalize(), MAXNORMMAX, MAXNORMMIN, n, orientedFilterSet(), reduce(), CpuTimer::report(), rescale(), s, sformat(), t, 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 1730 of file ContourChannel.C.

References LFATAL.

Dims ContourChannel::getMapDims  )  const [virtual]
 

Return the dimensions of the output image.

Implements ChannelBase.

Definition at line 2040 of file ContourChannel.C.

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

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 2063 of file ContourChannel.C.

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

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.

References LFATAL.

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 2054 of file ContourChannel.C.

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

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 2333 of file ContourChannel.C.

References ChannelBase::killCaches().

uint ContourChannel::numSubmaps  )  const [virtual]
 

Return the number of feature maps represented by this channel.

Implements ChannelBase.

Definition at line 2048 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 2034 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 2125 of file ContourChannel.C.

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

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

Save our various maps using a FrameOstream.

Reimplemented from ChannelBase.

Definition at line 2119 of file ContourChannel.C.

References dummy_namespace_to_avoid_gcc411_bug_ContourChannel_C::SaveSet::saveAll().

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

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

Reimplemented from ModelComponent.

Definition at line 1753 of file ContourChannel.C.

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


The documentation for this class was generated from the following file:
Generated on Mon Nov 23 15:50:06 2009 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4