12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- /**
- * @file SemanticSegmentation.h
- * @brief abstract interface for semantic segmentation algorithms
- * @author Erik Rodner
- * @date 03/19/2009
- */
- #ifndef SEMANTICSEGMENTATIONINCLUDE
- #define SEMANTICSEGMENTATIONINCLUDE
- #include <vector>
- #include "core/image/MultiChannelImage3DT.h"
- #include "vislearning/cbaselib/MultiDataset.h"
- #include "vislearning/cbaselib/LocalizationResult.h"
- #include "vislearning/cbaselib/CachedExample.h"
- #include "vislearning/cbaselib/Example.h"
- namespace OBJREC
- {
- /** abstract interface for semantic segmentation algorithms */
- class SemanticSegmentation
- {
- protected:
- /** accessible class names and information about
- number of classes etc. */
- const ClassNames *classNames;
- /** enum type for imagetype */
- enum
- {
- IMAGETYPE_RGB = 0,
- IMAGETYPE_GRAY
- };
- /** whether to load images with color information */
- int imagetype;
- public:
- /** simple constructor
- @param conf global settings
- @param classNames this ClassNames object while be stored as a attribute
- */
- SemanticSegmentation ( const NICE::Config *conf,
- const ClassNames *classNames );
- /** simple destructor */
- virtual ~SemanticSegmentation();
- /** classification function (has to be overloaded by all subclasses)
- * @param imgData 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
- * @param filelist filename list of images that represent slices of a stack
- */
- virtual void classify ( const NICE::MultiChannelImage3DT<double> & imgData,
- NICE::MultiChannelImageT<double> & segresult,
- NICE::MultiChannelImage3DT<double> & probabilities,
- const std::vector<std::string> & filelist ) = 0;
- /** training function (has to be overloaded by all subclasses)
- * @param md the data set
- */
- virtual void train ( const MultiDataset * md ) = 0;
- /**
- * collect information about the depth of 3d images
- * @param *Files a labeled set of data
- * @param depthVec output of depth values
- */
- void getDepthVector ( const LabeledSet *Files, std::vector<int> & depthVec );
- /**
- * convert different datatypes
- */
- void convertVVectorToExamples ( NICE::VVector &feats,OBJREC::Examples &examples, std::vector<int> &label );
- void convertExamplesToVVector ( NICE::VVector &feats,OBJREC::Examples &examples, std::vector<int> &label );
- void convertExamplesToLSet ( OBJREC::Examples &examples, OBJREC::LabeledSetVector &lvec );
- void convertLSetToExamples ( OBJREC::Examples &examples, OBJREC::LabeledSetVector &lvec );
- void convertLSetToSparseExamples ( OBJREC::Examples &examples, OBJREC::LabeledSetVector &lvec );
- /**
- *load image slices into a single MCI3DT
- */
- void make3DImage ( const std::vector<std::string> & filelist,
- NICE::MultiChannelImage3DT<double> & imgData );
- };
- } // namespace
- #endif
|