123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- /**
- * @file ImageInfo.h
- * @brief localization info + image filename + ?
- * @author Erik Rodner
- * @date 04/16/2008
- */
- #ifndef IMAGEINFOINCLUDE
- #define IMAGEINFOINCLUDE
- #include <vislearning/nice_nonvis.h>
-
- #include "vislearning/cbaselib/Polygon.h"
- #include "vislearning/cbaselib/BoundingBox.h"
- #include "vislearning/cbaselib/CategoryInfo.h"
- #include "LocalizationResult.h"
- #include <assert.h>
- #ifdef NICE_USELIB_QT4_XML
- class QString;
- class QDomElement;
- #endif //NICE_USELIB_QT4_XML
- namespace OBJREC {
- /** localization info + image filename + ? */
- class ImageInfo
- {
- protected:
- std::string imagefn;
- LocalizationResult *lr;
- bool localization_info;
- #ifdef NICE_USELIB_QT4_XML
-
- Polygon polyFromData(QString *aPolyData);
- BoundingBox BBoxFromData(QString *aBBoxData);
- void loadLegendFromElement(QDomElement *anElement);
- bool loadCategoryInfo(QDomElement *anElement);
- ImageT< unsigned int > imageTFromData(
- const int &aWidth,
- const int &aHeight,
- QString *aPureData
- );
- #endif //NICE_USELIB_QT4_XML
- public:
-
- /** simple constructor */
- ImageInfo( const std::string & _imagefn, LocalizationResult *_lr ) :
- imagefn(_imagefn), lr(_lr), localization_info(true) {};
-
- ImageInfo() {};
-
- ImageInfo( const std::string & _imagefn ) :
- imagefn(_imagefn), lr(NULL), localization_info(false) {};
- /** simple destructor */
- virtual ~ImageInfo();
- const std::string & img () const { return imagefn; };
- const LocalizationResult *localization () const { assert(localization_info); return lr; };
- bool hasLocalizationInfo () const { return localization_info; };
-
- bool loadImageInfo(const std::string &aFilename);
-
- const std::list< CategoryInfo > * labels() const;
- const std::list< BoundingBox > * bboxes() const;
- const std::list< Polygon > * polys() const;
- ImageT< unsigned int > labeledImage() const;
- std::string tags() const;
- std::string imagePath() const;
- std::string imageDescription() const;
- std::string segmentedImagePath() const;
- private:
- std::list< CategoryInfo > labels_;
- std::list< BoundingBox > bboxes_;
- std::list< Polygon > polys_;
- ImageT< unsigned int > labeled_image_;
- //std::list< std::string > tags_;
- std::string tags_;
- std::string image_path_;
- std::string image_description_;
- std::string segmented_image_path_;
-
- };
- } // namespace
- #endif
|