123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- /**
- * @file SemSegConvolutionalTree.h
- * @brief Semantic Segmentation using Covolutional Trees
- * @author Sven Sickert
- * @date 10/17/2014
- */
- #ifndef SEMSEGCONVOLUTIONALTREEINCLUDE
- #define SEMSEGCONVOLUTIONALTREEINCLUDE
- // nice-core includes
- // nice-vislearning includes
- #include "vislearning/classifier/classifierbase/FeaturePoolClassifier.h"
- // nice-semseg includes
- #include "SemanticSegmentation.h"
- namespace OBJREC
- {
- class SemSegConvolutionalTree : public SemanticSegmentation
- {
- private:
- /** pointer to config file */
- const NICE::Config *conf;
- /** save / load trained classifier */
- bool saveLoadData;
- /** file location of trained classifier */
- std::string fileLocation;
- /** classifier for categorization */
- FeaturePoolClassifier *fpc;
- public:
- /** simple constructor */
- SemSegConvolutionalTree ();
- /** config constructor */
- SemSegConvolutionalTree ( const NICE::Config *conf,
- const ClassNames *classNames );
- /** simple destructor */
- virtual ~SemSegConvolutionalTree();
- /**
- * @brief Setup internal variables and objects used
- * @param conf Configuration file to specify variable settings
- * @param s_confSection Section in configuration file
- */
- void initFromConfig (
- const NICE::Config *_conf,
- const std::string & s_confSection = "SemSegConvolutionalTree" );
- /**
- * @brief training function / learn classifier
- * @param md the data set
- */
- void train ( const MultiDataset *md );
- /**
- * @brief classification function
- @param ce image data
- @param segresult result of the semantic segmentation with a label
- for each pixel
- @param probabilities multi-channel image with one channel for
- each class and corresponding probabilities for each pixel
- */
- void semanticseg ( CachedExample *ce,
- NICE::Image &segresult,
- NICE::MultiChannelImageT<double> &probabilities );
- ///////////////////// INTERFACE PERSISTENT /////////////////////
- // interface specific methods for store and restore
- ///////////////////// INTERFACE PERSISTENT /////////////////////
- /**
- * @brief Load segmentation object from external file (stream)
- */
- virtual void restore ( std::istream & is, int format = 0 );
- /**
- * @brief Save segmentation-object to external file (stream)
- */
- virtual void store( std::ostream & os, int format = 0 ) const;
- /**
- * @brief Clear segmentation-object object
- */
- virtual void clear ();
- };
- } // namespace
- #endif
|