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


Definition at line 50 of file ComplexChannel.H.
Public Member Functions | |
| ComplexChannel (OptionManager &mgr, const std::string &descrName, const std::string &tagName, const VisualFeature vs) | |
| Constructor. | |
| virtual | ~ComplexChannel () |
| Virtual destructor. | |
| virtual void | accept (ChannelVisitor &v) |
| Calls visitComplexChannel() on the ChannelVisitor. | |
| virtual bool | isHomogeneous () const |
| Is the channel homogeneous? | |
| uint | numChans () const |
| Get the number of subchannels. | |
| nub::ref< ChannelBase > | subChan (const uint idx) const |
| Look up one of the subchannels by its integer index. | |
| nub::ref< ChannelBase > | subChan (const std::string &tagname) const |
| Look up one of the subchannels by its tagname. | |
| nub::ref< ChannelBase > | subChanFromSubmapNum (const uint oldIdx, uint &newIdx) const |
| Look up one of the subchannels by a submap number. | |
| void | addSubChan (nub::ref< ChannelBase > ch, const char *name=0, const double weight=1.0, bool exportOpts=false) |
| Add a subchannel. | |
| void | removeSubChan (nub::ref< ChannelBase > ch) |
| Remove a subchannel. | |
| void | removeAllSubChans () |
| Remove all of our subchannels. | |
| bool | hasSubChan (const char *name) const |
| Check if we have a channel of given tagname. | |
| void | setSubchanVisitor (rutz::shared_ptr< ChannelVisitor > v) |
| Install a visitor which will be applied to all newly-added subchannels. | |
| void | setSubchanTotalWeight (SubchanKey key, const double wt) |
| Set the total weight allocated to the specified subchannel. | |
| double | getSubchanTotalWeight (SubchanKey key) const |
| Return the total weight allocated to the specified subchannel. | |
| void | sortChannelsByNumSubmaps (bool dosort) |
| Whether to sort subchannels by their number of submaps. | |
| virtual void | readFrom (const ParamMap &pmap) |
| Read params from the ParamMap. | |
| virtual void | writeTo (ParamMap &pmap) const |
| Write params to the ParamMap. | |
| 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 (const uint index) const |
| 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 |
| Get the name/description of the feature map at the given index. | |
| virtual void | getFeatures (const Point2D< int > &locn, std::vector< float > &mean) const |
| virtual void | getFeaturesBatch (std::vector< Point2D< int > * > *locn, std::vector< std::vector< float > > *mean, int *count) const |
| virtual Image< float > | getOutput () |
| Form output by combining output of subchannels. | |
| virtual void | saveResults (const nub::ref< FrameOstream > &ofs) |
| Save our various maps using a FrameOstream. | |
| virtual void | killCaches () |
| Clears the output cache. | |
Protected Member Functions | |
| virtual Image< float > | combineOutputs () |
| Combines the outputs of subchannels. | |
| virtual void | start1 () |
| get started | |
| virtual void | start2 () |
| get started | |
| virtual void | stop2 () |
| stop | |
Protected Attributes | |
| OModelParam< MaxNormType > | itsNormType |
| Normalization; see fancynorm.H. | |
| OModelParam< MapCombineType > | itsCombineType |
| see Channels/MapCombineType.H | |
| OModelParam< bool > | itsSaveOutputMap |
| Save our output map? | |
| OModelParam< bool > | itsUseOlderVersion |
| use old version? see Visualcortex.H | |
| OModelParam< float > | itsOutputRangeMin |
| Set a fixed range of values for the raw output. | |
| OModelParam< float > | itsOutputRangeMax |
Classes | |
| struct | Impl |
| struct | SubchanKey |
| Refer to a subchannel by one of: its index, its tagname, its address. More... | |
|
||||||||||||||||||||
|
Constructor.
Definition at line 172 of file ComplexChannel.C. References GVX_TRACE. |
|
|
Virtual destructor.
Definition at line 189 of file ComplexChannel.C. References GVX_TRACE. |
|
|
Calls visitComplexChannel() on the ChannelVisitor.
Reimplemented from ChannelBase. Definition at line 235 of file ComplexChannel.C. References GVX_TRACE, and ChannelVisitor::visitComplexChannel(). Referenced by SceneUnderstanding::biasFor(), biasImage(), biasVC(), and getRaoJetMap(). |
|
||||||||||||||||||||
|
|
Combines the outputs of subchannels. The default implementation just sums the outputs of the subchannels and then maxNormalize()'s if requested by itsNormType. Reimplemented in MultiDirectFeedChannel, RawVisualCortex, and SoxChannel. Definition at line 564 of file ComplexChannel.C. References ModelComponent::descriptiveName(), Image< T >::getDims(), Image< T >::getHeight(), getMapDims(), getMinMax(), getMinMaxAvg(), OModelParam< T >::getVal(), Image< T >::getWidth(), goodness_map(), GVX_TRACE, i, Image< T >::initialized(), itsCombineType, itsNormType, itsOutputRangeMax, itsOutputRangeMin, LDEBUG, LFATAL, LINFO, mapCombine(), maxNormalize(), maxNormTypeName(), MYLOGVERB, numChans(), output(), subChan(), ComplexChannel::Impl::subchans, ModelComponent::tagName(), VCXNORM_LANDMARK, w, and ZEROS. Referenced by getOutput(). |
|
|
Return the dimensions of the output image.
Implements ChannelBase. Definition at line 354 of file ComplexChannel.C. References GVX_TRACE, and subChan(). Referenced by SoxChannel::combineOutputs(), MultiDirectFeedChannel::combineOutputs(), combineOutputs(), and OptimalGainsFinder::visitComplexChannel(). |
|
|
Form output by combining output of subchannels. This function just provides a caching wrapper around combineOutputs(), where the real work is done. ComplexChannel provides a default implementation of combineOutputs() that sums the outputs of the subchannels and then optionally maxNormalize()'s the result. Implements ChannelBase. Reimplemented in OrientationChannel. Definition at line 556 of file ComplexChannel.C. References combineOutputs(), GVX_TRACE, Image< T >::initialized(), and ComplexChannel::Impl::output. Referenced by DescriptorVec::buildRawDV(), OrientationChannel::getOutput(), RawVisualCortex::getVCOutput(), RawVisualCortex::saveResults(), saveResults(), and OptimalGainsFinder::visitComplexChannel(). |
|
|
get raw CS map; part of getSubmap()
Reimplemented from ChannelBase. Definition at line 401 of file ComplexChannel.C. References GVX_TRACE, and subChan(). Referenced by DescriptorVec::buildLocalDV(), and DescriptorVec::buildRawDV(). |
|
|
Return the total weight allocated to the specified subchannel.
Definition at line 527 of file ComplexChannel.C. References ComplexChannel::Impl::findSubchanInfo(), and dummy_namespace_to_avoid_gcc411_bug_ComplexChannel_C::SubchanInfo::weight. Referenced by BiasValImage::BiasValImage(), VisualCortexSurprise::postProcessOutputMap(), RawVisualCortex::postProcessOutputMap(), BiasValImage::updateValues(), and WeightFinder::visitComplexChannel(). |
|
|
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. Implements ChannelBase. Definition at line 392 of file ComplexChannel.C. References GVX_TRACE, and subChan(). Referenced by DescriptorVec::buildDV(), and DescriptorVec::buildRawDV(). |
|
|
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 410 of file ComplexChannel.C. References GVX_TRACE, and subChan(). Referenced by SceneUnderstanding::SceneUnderstanding(). |
|
|
Check if we have a channel of given tagname.
Definition at line 497 of file ComplexChannel.C. References GVX_TRACE, i, and ComplexChannel::Impl::subchans. |
|
|
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 from ChannelBase. Definition at line 242 of file ComplexChannel.C. References GVX_TRACE, i, numChans(), subChan(), and ChannelBase::visualFeature(). Referenced by JetSpecFiller::visitComplexChannel(), and JetFiller::visitComplexChannel(). |
|
|
Clears the output cache.
Reimplemented from ChannelBase. Reimplemented in SoxChannel. Definition at line 543 of file ComplexChannel.C. References Image< T >::freeMem(), GVX_TRACE, i, ChannelBase::killCaches(), numChans(), ComplexChannel::Impl::output, and subChan(). Referenced by SoxChannel::killCaches(), setSubchanTotalWeight(), and OptimalGainsFinder::visitComplexChannel(). |
|
|
Get the number of subchannels.
Definition at line 257 of file ComplexChannel.C. References GVX_TRACE, and ComplexChannel::Impl::subchans. Referenced by DescriptorVec::buildParticleCountDV(), SoxChannel::combineOutputs(), RawVisualCortex::combineOutputs(), MultiDirectFeedChannel::combineOutputs(), combineOutputs(), compareChannels(), MultiDirectFeedChannel::directFeed(), XJunctionChannel::doInput(), TJunctionChannel::doInput(), SoxChannel::doInput(), RawVisualCortex::doInput(), OrientationChannel::doInput(), MultiSpectralResidualChannel::doInput(), MultiConvolveChannel::doInput(), MotionChannel::doInput(), LJunctionChannel::doInput(), FoeMSTChannel::doInput(), EndPointChannel::doInput(), MultiDirectFeedChannel::doInput(), CompositeColorChannel::doInput(), OrientationChannel::doInteractions(), getFeatures(), getFeaturesBatch(), SoxChannel::getNonlinearResponse(), MultiDirectFeedChannel::inputPyramid(), MultiDirectFeedChannel::inputPyramidVector(), isHomogeneous(), killCaches(), numSubmaps(), outputAvailable(), XJunctionChannel::paramChanged(), TJunctionChannel::paramChanged(), StereoChannel::paramChanged(), SoxChannel::paramChanged(), RawVisualCortex::paramChanged(), OrientationChannel::paramChanged(), MultiColorBandChannel::paramChanged(), MotionChannel::paramChanged(), LJunctionChannel::paramChanged(), IntensityBandChannel::paramChanged(), FoeMSTChannel::paramChanged(), EndPointChannel::paramChanged(), VisualCortexSurprise::postProcessOutputMap(), RawVisualCortex::postProcessOutputMap(), readFrom(), RawVisualCortex::saveResults(), saveResults(), MultiDirectFeedChannel::setNumChans(), setSubchanVisitor(), RawVisualCortex::start1(), MaskBiaser::visitComplexChannel(), BayesianBiaser::visitComplexChannel(), OptimalGainsFinder::visitComplexChannel(), JetSpecFiller::visitComplexChannel(), JetFiller::visitComplexChannel(), GuidedSearchBiaser::visitComplexChannel(), WeightFinder::visitComplexChannel(), FeatureBiaser::visitComplexChannel(), ChannelVisitorInstallFacet< CFS, CFC >::visitComplexChannel(), and writeTo(). |
|
|
Return the number of feature maps represented by this channel.
Implements ChannelBase. Definition at line 361 of file ComplexChannel.C. References GVX_TRACE, i, numChans(), subChan(), and sum. Referenced by DescriptorVec::buildDV(), DescriptorVec::buildLocalDV(), DescriptorVec::buildRawDV(), DescriptorVec::getFVSize(), and subChanFromSubmapNum(). |
|
|
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 345 of file ComplexChannel.C. References GVX_TRACE, i, numChans(), and subChan(). Referenced by RawVisualCortex::combineOutputs(). |
|
|
Read params from the ParamMap.
Reimplemented from ChannelBase. Definition at line 302 of file ComplexChannel.C. References ParamMap::getSubpmap(), GVX_TRACE, ParamMap::hasParam(), i, ParamMap::MISSING, numChans(), ChannelFacetMap::readFacetsFrom(), ChannelBase::readFrom(), subChan(), and ComplexChannel::Impl::subchans. |
|
|
Remove all of our subchannels.
Definition at line 483 of file ComplexChannel.C. References ASSERT, GVX_TRACE, ModelComponent::removeSubComponent(), and ComplexChannel::Impl::subchans. Referenced by XJunctionChannel::buildSubChans(), TJunctionChannel::buildSubChans(), StereoChannel::buildSubChans(), SoxChannel::buildSubChans(), OrientationChannel::buildSubChans(), MultiColorBandChannel::buildSubChans(), MotionChannel::buildSubChans(), LJunctionChannel::buildSubChans(), IntensityBandChannel::buildSubChans(), FoeMSTChannel::buildSubChans(), EndPointChannel::buildSubChans(), RawVisualCortex::paramChanged(), and ColorChannel::paramChanged(). |
|
|
Remove a subchannel.
Definition at line 464 of file ComplexChannel.C. References GVX_TRACE, ModelComponent::removeSubComponent(), and ComplexChannel::Impl::subchans. Referenced by CIELabChannel::setA(), SOColorChannel::setB(), CIELabChannel::setB(), SOColorChannel::setBY(), ColorChannel::setBY(), SOColorChannel::setG(), SOColorChannel::setGR(), ColorChannel::setGR(), H2SVChannel::setH1(), H2SVChannel::setH2(), DepthChannel::setI(), CIELabChannel::setL(), DepthChannel::setO(), SOColorChannel::setR(), SOColorChannel::setRG(), ColorChannel::setRG(), H2SVChannel::setS(), H2SVChannel::setV(), SOColorChannel::setY(), SOColorChannel::setYB(), and ColorChannel::setYB(). |
|
|
Save our various maps using a FrameOstream. By default, we save our output map (if itsSaveOutputMap is true) and propagate the call to our subchannels. Our output (conspicuity) map will be prefixed by "CO<tagname>-" Reimplemented from ChannelBase. Reimplemented in RawVisualCortex. Definition at line 658 of file ComplexChannel.C. References FLOAT_NORM_0_255, getOutput(), OModelParam< T >::getVal(), GVX_TRACE, i, itsSaveOutputMap, LINFO, name, numChans(), sformat(), SRC_POS, subChan(), and ModelComponent::tagName(). |
|
||||||||||||
|
Set the total weight allocated to the specified subchannel. This weight will be divided amongst any sub-subchannels managed by the specifed subchannel. So, for example, if the total weight is set to 2.0, and the subchannel has four sub-subchannels, then each sub-subchannel will get an effective weight of 0.5. The initial weight setting is 1.0. But, If you are handling b/w images, for instance, you may set the weight for the color channel to 0.0 and save computations. Definition at line 520 of file ComplexChannel.C. References ComplexChannel::Impl::findSubchanInfo(), killCaches(), and dummy_namespace_to_avoid_gcc411_bug_ComplexChannel_C::SubchanInfo::weight. Referenced by CompositeColorChannel::CompositeColorChannel(), SOColorChannel::SOColorChannel(), ImagizeColorChannel::start1(), DKLcolorChannel::start1(), CompositeColorChannel::start1(), and WeightFinder::visitComplexChannel(). |
|
|
Install a visitor which will be applied to all newly-added subchannels.
Definition at line 508 of file ComplexChannel.C. References GVX_TRACE, i, rutz::shared_ptr< T >::is_valid(), numChans(), subChan(), and ComplexChannel::Impl::subchanVisitor. Referenced by setupVisualCortexBeo(). |
|
|
Whether to sort subchannels by their number of submaps. If true, this may help in parallel-processing situations where we want to start the most CPU-intensive channels first. Must be called before start(). Definition at line 533 of file ComplexChannel.C. References GVX_TRACE, LFATAL, and ComplexChannel::Impl::sortChannelsByNumSubmaps. Referenced by setupVisualCortexBeo(). |
|
|
get started
Reimplemented from ModelComponent. Reimplemented in CompositeColorChannel, DKLcolorChannel, ImagizeColorChannel, MultiConvolveChannel, RawVisualCortex, and StereoChannel. Definition at line 196 of file ComplexChannel.C. References GVX_TRACE, ComplexChannel::Impl::sortChannelsByNumSubmaps, and ComplexChannel::Impl::subchans. Referenced by RawVisualCortex::start1(). |
|
|
get started
Reimplemented from ModelComponent. Definition at line 205 of file ComplexChannel.C. References OModelParam< T >::getVal(), GVX_TRACE, itsNormType, itsOutputRangeMax, itsOutputRangeMin, itsUseOlderVersion, OModelParam< T >::setVal(), and VCXNORM_MAXNORM. |
|
|
stop
Reimplemented from ModelComponent. Reimplemented in RawVisualCortex. Definition at line 229 of file ComplexChannel.C. References GVX_TRACE. Referenced by RawVisualCortex::stop2(). |
|
|
Look up one of the subchannels by its tagname.
Definition at line 275 of file ComplexChannel.C. References GVX_TRACE, i, LFATAL, and ComplexChannel::Impl::subchans. |
|
|
Look up one of the subchannels by its integer index.
Definition at line 264 of file ComplexChannel.C. References GVX_TRACE, LFATAL, and ComplexChannel::Impl::subchans. Referenced by apply_gabor_filter(), MultiColorBandChannel::band(), IntensityBandChannel::band(), DescriptorVec::buildParticleCountDV(), RawVisualCortex::combineOutputs(), combineOutputs(), compareChannels(), MotionChannel::dirChan(), MultiDirectFeedChannel::directFeed(), StereoChannel::dispChan(), XJunctionChannel::doInput(), TJunctionChannel::doInput(), RawVisualCortex::doInput(), MultiSpectralResidualChannel::doInput(), MultiConvolveChannel::doInput(), MultiColorBandChannel::doInput(), MotionChannel::doInput(), LJunctionChannel::doInput(), IntensityBandChannel::doInput(), FoeMSTChannel::doInput(), EndPointChannel::doInput(), CompositeColorChannel::doInput(), SoxChannel::gabor(), OrientationChannel::gabor(), RawVisualCortex::getChannelOutputMap(), getFeatures(), getFeaturesBatch(), getMapDims(), getRawCSmap(), getSubmap(), getSubmapName(), isHomogeneous(), killCaches(), numSubmaps(), outputAvailable(), RawVisualCortex::paramChanged(), readFrom(), RawVisualCortex::saveResults(), saveResults(), setSubchanVisitor(), RawVisualCortex::start1(), MultiConvolveChannel::start1(), subChanFromSubmapNum(), MaskBiaser::visitComplexChannel(), BayesianBiaser::visitComplexChannel(), OptimalGainsFinder::visitComplexChannel(), JetSpecFiller::visitComplexChannel(), JetFiller::visitComplexChannel(), GuidedSearchBiaser::visitComplexChannel(), WeightFinder::visitComplexChannel(), FeatureBiaser::visitComplexChannel(), ChannelVisitorInstallFacet< CFS, CFC >::visitComplexChannel(), and writeTo(). |
|
||||||||||||
|
Look up one of the subchannels by a submap number.
Definition at line 290 of file ComplexChannel.C. References ASSERT, GVX_TRACE, numSubmaps(), and subChan(). |
|
|
Write params to the ParamMap.
Reimplemented from ChannelBase. Definition at line 327 of file ComplexChannel.C. References GVX_TRACE, i, numChans(), ParamMap::putSubpmap(), subChan(), ComplexChannel::Impl::subchans, ModelComponent::tagName(), ChannelFacetMap::writeFacetsTo(), and ChannelBase::writeTo(). |
|
|
see Channels/MapCombineType.H
Definition at line 207 of file ComplexChannel.H. Referenced by combineOutputs(). |
|
|
Normalization; see fancynorm.H.
Reimplemented in RawVisualCortex. Definition at line 206 of file ComplexChannel.H. Referenced by SoxChannel::combineOutputs(), MultiDirectFeedChannel::combineOutputs(), combineOutputs(), and start2(). |
|
|
Set a fixed range of values for the raw output. By default, the range is set to [MAXNORMMIN .. MAXNORMMAX] at construction. If non-zero values are provided here, in getOutput() we will cumulate our various submaps, apply the provided range, apply spatial competition for salience, apply our total weight, and return the result. If a range [0.0 .. 0.0] is provided here, only spatial competition and weights will be applied, but the first step of applying the range will be skipped. This must be called before start(). Definition at line 220 of file ComplexChannel.H. Referenced by MultiDirectFeedChannel::combineOutputs(), combineOutputs(), and start2(). |
|
|
Save our output map?
Definition at line 208 of file ComplexChannel.H. Referenced by saveResults(). |
|
|
use old version? see Visualcortex.H
Reimplemented in RawVisualCortex. Definition at line 209 of file ComplexChannel.H. Referenced by start2(). |
1.4.4