123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- #ifndef SemSegContextTreeINCLUDE
- #define SemSegContextTreeINCLUDE
- #include <core/vector/VVector.h>
- #include <vislearning/features/localfeatures/LocalFeatureColorWeijer.h>
- #include <vislearning/classifier/fpclassifier/gphik/FPCGPHIK.h>
- #include <segmentation/RegionSegmentationMethod.h>
- #include "semseg/semseg/operations/Operations.h"
- #include "SemanticSegmentation.h"
- namespace OBJREC {
- class SemSegContextTree : public SemanticSegmentation
- {
-
- RegionSegmentationMethod *segmentation;
-
- std::vector<std::vector<TreeNode> > forest;
-
- LocalFeatureColorWeijer *lfcw;
-
- int ftypes;
-
- int maxSamples;
-
- int windowSize;
-
-
- int featsPerSplit;
-
- std::map<int, int> labelcounter;
-
- std::map<int, int> labelmap;
-
- std::map<int, int> labelmapback;
-
- std::vector<double> a;
-
- std::vector<int> opOverview;
-
- std::vector<std::vector<double> > contextOverview;
-
- int minFeats;
-
- int maxDepth;
-
- int depth;
-
- int randomTests;
-
- std::vector<std::vector<Operation*> > ops;
- std::vector<ValueAccess*> calcVal;
-
- bool useShannonEntropy;
-
- ClassNames classnames;
-
- std::set<int> forbidden_classes;
-
- const NICE::Config *conf;
-
- bool pixelWiseLabeling;
-
- int nbTrees;
-
-
- bool useGradient;
-
-
- bool useWeijer;
-
-
- bool useRegionFeature;
-
-
- bool useCategorization;
-
-
- std::string cndir;
-
- std::vector<int> channelType;
-
- std::vector<std::vector<int> > channelsPerType;
-
-
- bool useHoiemFeatures;
-
- std::string hoiemDirectory;
-
-
- bool firstiteration;
-
-
- std::vector<std::pair<int, int> > integralMap;
-
-
- int rawChannels;
-
-
- OBJREC::FPCGPHIK *fasthik;
-
-
- int uniquenumber;
- public:
-
- SemSegContextTree ( const NICE::Config *conf, const MultiDataset *md );
-
- virtual ~SemSegContextTree();
-
- void semanticseg ( CachedExample *ce, NICE::ImageT<int> & segresult, NICE::MultiChannelImageT<double> & probabilities );
- void semanticseg ( CachedExample *ce,
- NICE::MultiChannelImageT<int> & segresult,
- NICE::MultiChannelImage3DT<double> & probabilities )
- {}
-
- void train ( const MultiDataset *md );
-
- void computeIntegralImage ( const NICE::MultiChannelImageT<unsigned short int> ¤tfeats, NICE::MultiChannelImageT<double> &lfeats,int firstChannel );
-
- void extractBasicFeatures ( NICE::MultiChannelImageT<double> &feats, const NICE::ColorImage &img, const std::string ¤tFile, int &amountRegions);
-
- double getBestSplit ( std::vector<NICE::MultiChannelImageT<double> > &feats, std::vector<NICE::MultiChannelImageT<unsigned short int> > ¤tfeats, const std::vector<NICE::MatrixT<int> > &labels, int node, Operation *&splitop, double &splitval, const int &tree, std::vector<std::vector<std::vector<double> > > ®ionProbs );
-
- inline double getMeanProb ( const int &x, const int &y, const int &channel, const NICE::MultiChannelImageT<unsigned short int> ¤tfeats );
-
- virtual void restore ( std::istream & is, int format = 0 );
-
- virtual void store ( std::ostream & os, int format = 0 ) const;
-
- virtual void clear () {}
- };
- }
- #endif
|