123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- /**
- * @file PPSuperregion.h
- * @brief a post procession step after semantic segmentation which use a variant of Region Growing
- * @author Björn Fröhlich
- * @date 08/19/2009
- */
- #ifndef PPSUPERREGIONINCLUDE
- #define PPSUPERREGIONINCLUDE
- #include "core/image/MultiChannelImageT.h"
- #include "vislearning/cbaselib/CachedExample.h"
- #include "vislearning/baselib/Preprocess.h"
- #include "vislearning/baselib/Globals.h"
- #include "vislearning/classifier/fpclassifier/randomforest/FPCRandomForests.h"
- #include "vislearning/cbaselib/VectorFeature.h"
- #include "vislearning/cbaselib/ClassNames.h"
- #include "segmentation/RSMeanShift.h"
- #ifdef NICE_USELIB_ICE
- #include <image_nonvis.h>
- #endif
- namespace OBJREC
- {
- class PPSuperregion : public NICE::Persistent
- {
- protected:
- //! the configfile
- const NICE::Config *conf;
- //! count of classes
- int classno;
- //! Shape features
- Examples shapefeats;
- //! classifier for shape features
- FPCRandomForests *rf;
- public:
- /** simple constructor */
- PPSuperregion();
- /** simple constructor */
- PPSuperregion ( const NICE::Config *_conf );
- /** simple destructor */
- ~PPSuperregion();
- /**
- * set the count of classes
- * @param _classno count of classes
- */
- void setClassNo ( int _classno );
- /** initialize the RelativeLocationPrior Variables*/
- void Init();
- /**
- * combines connected regions with the same label to superregions
- * @param regions the input regions
- * @param mask the mask for the regions
- * @param superregions the superregions
- * @param classes the classlabels of the superregions
- */
- #ifdef NICE_USELIB_ICE
- void getSuperregions ( const Examples ®ions, const NICE::Matrix &mask, std::vector<ice::Region> &superregions, std::vector<int> &classes, NICE::Matrix &smask );
- #endif
- /**
- * Lerne Form der Regionen an
- * @param regions input regions with size and position
- * @param mask
- */
- void trainShape ( Examples ®ions, NICE::Matrix &mask );
- /**
- * finish the priors maps
- */
- void finishShape ( ClassNames &cn );
- /**
- * use shape pp
- * @param regions
- * @param mask
- */
- void optimizeShape ( Examples ®ions, NICE::Matrix &mask, NICE::MultiChannelImageT<double> & probabilities );
- /**
- * load data from an input stream
- * @param is input stream
- * @param format
- */
- void restore ( std::istream & is, int format = 0 );
- /**
- * write data to an output stream
- * @param os outputstream
- * @param format
- */
- void store ( std::ostream & os, int format = 0 ) const;
- /**
- * clear all informations
- */
- void clear ();
- };
- } //namespace
- #endif
|