/** * @file PPGraphCut.h * @brief a post procession step after semantic segmentation which use a variant of GraphCut * @author Björn Fröhlich * @date 09/08/2009 */ #ifndef PPGRAPHCUTINCLUDE #define PPGRAPHCUTINCLUDE #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 #include "vislearning/cbaselib/ClassNames.h" #include "segmentation/RSMeanShift.h" #include "vislearning/mrf/mrfmin/GCoptimization.h" namespace OBJREC { class PPGraphCut : 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; double *coocurence; public: /** simple constructor */ PPGraphCut(); /** simple constructor */ PPGraphCut ( const NICE::Config *_conf ); /** simple destructor */ ~PPGraphCut(); /** * set the count of classes * @param _classno count of classes */ void setClassNo ( int _classno ); /** initialize the RelativeLocationPrior Variables*/ void Init(); /** * train region * @param regions input regions with size and position * @param mask */ void trainImage ( Examples ®ions, NICE::Matrix &mask ); /** * train region * @param regions input regions with size and position */ void trainImage ( RegionGraph ®ions ); /** * finish the priors maps */ void finishPP ( ClassNames &cn ); /** * use shape pp * @param regions * @param mask * @param probabilities probability maps for each pixel */ void optimizeImage ( Examples ®ions, NICE::Matrix &mask, NICE::MultiChannelImageT & probabilities ); /** * use shape pp * @param regions * @param mask * @param probabilities for each region */ void optimizeImage ( OBJREC::RegionGraph ®ions, std::vector > & 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