
#include <Channels/ChannelBase.H>
Inheritance diagram for ChannelBase:


Definition at line 63 of file ChannelBase.H.
Public Member Functions | |
| ChannelBase (OptionManager &mgr, const std::string &descrName, const std::string &tagName, const VisualFeature vs) | |
| Default constructor. See ModelComponent.H. | |
| virtual | ~ChannelBase () |
| Virtual destructor ensures proper destruction of derived classes. | |
| virtual void | reset1 () |
| Kill our caches. | |
| virtual void | accept (ChannelVisitor &v) |
| Default version calls visitChannelBase() on the ChannelVisitor. | |
VisualFeature functions | |
| VisualFeature | visualFeature () const |
| Get the visual feature. | |
| virtual bool | isHomogeneous () const |
| Is the channel homogeneous? | |
ParamMap functions | |
Subclasses should be sure to call ChannelBase's version of these functions within their own implementations, so that ChannelBase's parameters (such as its weights) are properly handled.
This interface is different from that provided by ModelComponent, as here we only save a subset of all of the Channel's parameters, that are useful, e.g., for object recognition or feature-based attention biasing. Some of the values saved here may not even be ModelParam parameters. | |
| virtual void | readFrom (const ParamMap &pmap) |
| Read params from the ParamMap. | |
| virtual void | writeTo (ParamMap &pmap) const |
| Write params to the ParamMap. | |
Input functions | |
| void | input (const InputFrame &inframe) |
| Send a full-blown InputFrame to the channel. | |
Access functions | |
| virtual bool | outputAvailable () const =0 |
| Query whether the channel is ready to give yield valid output. | |
| virtual Dims | getMapDims () const =0 |
| Return the dimensions of the output image. | |
| bool | hasInput () const |
| Check if we've received any input images yet. | |
| Dims | getInputDims () const |
| Return the dimensions of the most recent input image. | |
| virtual uint | numSubmaps () const =0 |
| Return the number of feature maps represented by this channel. | |
| virtual Image< float > | getSubmap (const uint index) const =0 |
| Get the feature map at the given index. | |
| virtual Image< float > | getRawCSmap (const uint idx) const |
| get raw CS map; part of getSubmap() | |
| virtual std::string | getSubmapName (const uint index) const =0 |
| Get the name/description of the feature map at the given index. | |
| virtual void | getFeatures (const Point2D< int > &locn, std::vector< float > &mean) const =0 |
| virtual void | getFeaturesBatch (std::vector< Point2D< int > * > *locn, std::vector< std::vector< float > > *mean, int *count) const =0 |
| virtual Image< float > | getOutput ()=0 |
| 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. | |
| virtual void | killCaches () |
| Subclasses override this to clear any caches they may maintain. | |
Protected Member Functions | |
| virtual void | doInput (const InputFrame &inframe)=0 |
| Subclasses override this implementation of the input() function. | |
| void | setInputDims (const Dims &dims) |
|
||||||||||||||||||||
|
Default constructor. See ModelComponent.H.
Definition at line 57 of file ChannelBase.C. References GVX_TRACE, and ModelComponent::init(). |
|
|
Virtual destructor ensures proper destruction of derived classes.
Definition at line 68 of file ChannelBase.C. References GVX_TRACE. |
|
|
Default version calls visitChannelBase() on the ChannelVisitor.
Reimplemented in ComplexChannel, SingleChannel, and SpectralResidualChannel. Definition at line 83 of file ChannelBase.C. References GVX_TRACE, and ChannelVisitor::visitChannelBase(). Referenced by setSubmapAlgorithmBiased(). |
|
|
|
Return the dimensions of the most recent input image. Will LFATAL() if hasInput() is false. Definition at line 150 of file ChannelBase.C. References CLFATAL, GVX_TRACE, and Dims::isEmpty(). Referenced by RawVisualCortex::combineOutputs(), IntegerRawVisualCortex::combineOutputsInt(), TemplateMatchChannel::findBestMatch(), SingleOpponentChannel::getFeatures(), SingleChannel::getFeatures(), SingleOpponentChannel::getFeaturesBatch(), SingleChannel::getFeaturesBatch(), ZeroChannel::getMapDims(), SingleChannel::getMapDims(), ObjDetChannel::getMapDims(), IntegerSimpleChannel::getMapDims(), ForegroundDetectionChannel::getMapDims(), ContourChannel::getMapDims(), SoxChannel::getNonlinearResponse(), and getRaoJetMap(). |
|
|
Return the dimensions of the output image.
Implemented in ComplexChannel, ContourChannel, DirectFeedChannel, DummyChannel, ForegroundDetectionChannel, IntegerComplexChannel, IntegerSimpleChannel, ObjDetChannel, SingleChannel, SpectralResidualChannel, and ZeroChannel. |
|
|
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(). Implemented in ComplexChannel, ContourChannel, DirectFeedChannel, EntropyChannel, ForegroundDetectionChannel, InformationChannel, IntegerComplexChannel, IntegerRawVisualCortex, IntegerSimpleChannel, MichelsonChannel, ObjDetChannel, OrientationChannel, PN03contrastChannel, ScorrChannel, SIFTChannel, SingleChannel, SobelChannel, SpectralResidualChannel, TcorrChannel, VarianceChannel, and ZeroChannel. Referenced by ChannelMaps::ChannelMaps(), and compareChannels(). |
|
|
get raw CS map; part of getSubmap()
Reimplemented in ComplexChannel, ForegroundDetectionChannel, IntegerComplexChannel, IntegerSimpleChannel, and SingleChannel. Definition at line 161 of file ChannelBase.H. References LFATAL. |
|
|
Get 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. Implemented in ComplexChannel, ContourChannel, DirectFeedChannel, ForegroundDetectionChannel, HueChannel, IntegerComplexChannel, IntegerSimpleChannel, ObjDetChannel, SingleChannel, SpectralResidualChannel, and ZeroChannel. |
|
|
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. Implemented in ComplexChannel, ContourChannel, DirectFeedChannel, ForegroundDetectionChannel, HueChannel, IntegerComplexChannel, IntegerSimpleChannel, ObjDetChannel, SingleChannel, SpectralResidualChannel, and ZeroChannel. |
|
|
Check if we've received any input images yet.
Definition at line 143 of file ChannelBase.C. References GVX_TRACE, and Dims::isNonEmpty(). Referenced by SceneUnderstandingForm::getDescriptor(), and DescriptorVec::setFovea(). |
|
|
Send a full-blown InputFrame to the channel.
Definition at line 131 of file ChannelBase.C. References doInput(), InputFrame::getDims(), GVX_ERR_CONTEXT, GVX_TRACE, killCaches(), and rutz::sfmt(). Referenced by OrientationChannel::doInput(), MultiDirectFeedChannel::doInput(), and RawVisualCortex::getVCOutput(). |
|
|
Is the channel homogeneous? A homogeneous channel is one whose subchannels (and their subs) have identical VisualFeatures, and those are also identical to our VisualFeature. Default implementation returns true. Reimplemented in ComplexChannel, IntegerComplexChannel, and SpectralResidualChannel. Definition at line 97 of file ChannelBase.C. References GVX_TRACE. |
|
|
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 in ComplexChannel, ContourChannel, DirectFeedChannel, IntegerComplexChannel, IntegerSimpleChannel, SingleChannel, SoxChannel, and SpectralResidualChannel. Definition at line 167 of file ChannelBase.C. References GVX_TRACE. Referenced by input(), IntegerChannel::inputInt(), SingleChannel::killCaches(), IntegerSimpleChannel::killCaches(), IntegerComplexChannel::killCaches(), ContourChannel::killCaches(), ComplexChannel::killCaches(), readFrom(), and reset1(). |
|
|
Return the number of feature maps represented by this channel.
Implemented in ComplexChannel, ContourChannel, DirectFeedChannel, ForegroundDetectionChannel, HueChannel, IntegerComplexChannel, IntegerSimpleChannel, ObjDetChannel, SingleChannel, SpectralResidualChannel, and ZeroChannel. Referenced by IntegerRawVisualCortex::getChannelOutputMap(). |
|
|
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. Implemented in ComplexChannel, ContourChannel, DirectFeedChannel, DummyChannel, EntropyChannel, ForegroundDetectionChannel, InformationChannel, IntegerComplexChannel, IntegerSimpleChannel, MichelsonChannel, ObjDetChannel, PN03contrastChannel, ScorrChannel, SIFTChannel, SingleChannel, SobelChannel, SpectralResidualChannel, TcorrChannel, VarianceChannel, and ZeroChannel. Referenced by ChannelMaps::ChannelMaps(). |
|
|
Read params from the ParamMap.
Reimplemented in ComplexChannel, DirectFeedChannel, GaborChannel, IntegerComplexChannel, IntegerSimpleChannel, SingleChannel, and SpectralResidualChannel. Definition at line 106 of file ChannelBase.C. References ModelComponent::descriptiveName(), ParamMap::getStringParam(), GVX_TRACE, ParamMap::hasParam(), killCaches(), and LFATAL. Referenced by SpectralResidualChannel::readFrom(), SingleChannel::readFrom(), IntegerSimpleChannel::readFrom(), IntegerComplexChannel::readFrom(), DirectFeedChannel::readFrom(), and ComplexChannel::readFrom(). |
|
|
Kill our caches.
Reimplemented from ModelComponent. Reimplemented in DirectFeedChannel, FlickerChannel, IntegerFlickerChannel, IntegerSimpleChannel, SingleChannel, and SingleOpponentChannel. Definition at line 74 of file ChannelBase.C. References GVX_TRACE, killCaches(), and ModelComponent::reset1(). Referenced by SingleChannel::reset1(), IntegerSimpleChannel::reset1(), and DirectFeedChannel::reset1(). |
|
|
Save our various maps using a FrameOstream. The default implementation is a no-op; subclasses can override to do something interesting Reimplemented in ComplexChannel, ContourChannel, IntegerComplexChannel, IntegerRawVisualCortex, IntegerSimpleChannel, RawVisualCortex, SingleChannel, and SpectralResidualChannel. Definition at line 160 of file ChannelBase.C. References GVX_TRACE. |
|
|
Get the visual feature.
Definition at line 90 of file ChannelBase.C. References NModelParam< T >::getVal(), and GVX_TRACE. Referenced by XJunctionChannel::buildSubChans(), TJunctionChannel::buildSubChans(), LJunctionChannel::buildSubChans(), FoeMSTChannel::buildSubChans(), EndPointChannel::buildSubChans(), SingleChannelBeo::handleInput(), IntegerComplexChannel::isHomogeneous(), ComplexChannel::isHomogeneous(), JetSpecFiller::visitComplexChannel(), JetSpecFiller::visitSingleChannel(), and JetFiller::visitSingleChannel(). |
|
|
Write params to the ParamMap.
Reimplemented in ComplexChannel, DirectFeedChannel, GaborChannel, IntegerComplexChannel, IntegerSimpleChannel, SingleChannel, and SpectralResidualChannel. Definition at line 123 of file ChannelBase.C. References ModelComponent::descriptiveName(), GVX_TRACE, and ParamMap::putStringParam(). Referenced by SpectralResidualChannel::writeTo(), SingleChannel::writeTo(), IntegerSimpleChannel::writeTo(), IntegerComplexChannel::writeTo(), DirectFeedChannel::writeTo(), and ComplexChannel::writeTo(). |
1.4.4