|
@@ -45,9 +45,24 @@ class SingleLocalizationResult
|
|
|
|
|
|
|
|
|
|
SingleLocalizationResult ( ClassificationResult *r, const NICE::Region & reg, int controlPoints = 0 );
|
|
SingleLocalizationResult ( ClassificationResult *r, const NICE::Region & reg, int controlPoints = 0 );
|
|
- SingleLocalizationResult ( ClassificationResult *r, int xi, int yi, int xa, int ya );
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @brief constructor
|
|
|
|
+ * @param xi (left)
|
|
|
|
+ * @param yi (top)
|
|
|
|
+ * @param xa (width)
|
|
|
|
+ * @param ya (height)
|
|
|
|
+ */
|
|
|
|
+ SingleLocalizationResult ( ClassificationResult *r, int xi, int yi, int xa, int ya );
|
|
~SingleLocalizationResult ();
|
|
~SingleLocalizationResult ();
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @brief get the bounding box
|
|
|
|
+ * @param xi (left)
|
|
|
|
+ * @param yi (top)
|
|
|
|
+ * @param xa (width)
|
|
|
|
+ * @param ya (height)
|
|
|
|
+ */
|
|
void getBoundingBox ( int & xi, int & yi, int & xa, int & ya ) const;
|
|
void getBoundingBox ( int & xi, int & yi, int & xa, int & ya ) const;
|
|
void getBoundingBox ( NICE::RectT<int> & rectangle ) const;
|
|
void getBoundingBox ( NICE::RectT<int> & rectangle ) const;
|
|
|
|
|
|
@@ -83,7 +98,7 @@ class LocalizationResult : public std::vector<SingleLocalizationResult *>, publi
|
|
enum {
|
|
enum {
|
|
FILEFORMAT_PASCAL2006_RESULT = 0,
|
|
FILEFORMAT_PASCAL2006_RESULT = 0,
|
|
FILEFORMAT_PASCAL2006_GROUNDTRUTH,
|
|
FILEFORMAT_PASCAL2006_GROUNDTRUTH,
|
|
- FILEFORMAT_POLYGON
|
|
|
|
|
|
+ FILEFORMAT_POLYGON
|
|
};
|
|
};
|
|
|
|
|
|
LocalizationResult ( int xsize = -1, int ysize = -1 );
|
|
LocalizationResult ( int xsize = -1, int ysize = -1 );
|
|
@@ -105,6 +120,26 @@ class LocalizationResult : public std::vector<SingleLocalizationResult *>, publi
|
|
bool invert = false,
|
|
bool invert = false,
|
|
int width = 1) const;
|
|
int width = 1) const;
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @brief Loads image label information from the file format supported by the ImageLabeler tool.
|
|
|
|
+ *
|
|
|
|
+ * This function ignores the label description (xml section < legend > ) and assumes, that the label names were loaded in advance
|
|
|
|
+ * and are present in the ClassNames reference member variable LocalizationResult::cn.
|
|
|
|
+ *
|
|
|
|
+ * Note: Uses class ImageInfo for loading the xml information and inserts them into this LocalizationResult class.
|
|
|
|
+ * A future TODO would be to directly include the ImageInfo loading code here (or as part of LocalizationResult) to substitute redundancy
|
|
|
|
+ * between the classes ImageInfo and LocalizationResult (meaning both use BoundingBoxes etc).
|
|
|
|
+ *
|
|
|
|
+ * Currently only rectangular bounding box information are transferred from the loaded ImageInfo instance to this class.
|
|
|
|
+ * So, trying to use for instance Polygon data created with the ImageLabeler will fail (empty LocalizationResult).
|
|
|
|
+ *
|
|
|
|
+ * @param sFilename file name of the image label file (usually *.dat, xml formatted)
|
|
|
|
+ * @see OBJREC::ImageInfo
|
|
|
|
+ * @author Johannes Rühle
|
|
|
|
+ * @date 2012-05-11
|
|
|
|
+ */
|
|
|
|
+ void loadImageInfo(std::string sFilename);
|
|
|
|
+
|
|
void restore (std::istream & is, int format = 0);
|
|
void restore (std::istream & is, int format = 0);
|
|
void store (std::ostream & os, int format = 0) const;
|
|
void store (std::ostream & os, int format = 0) const;
|
|
void clear ();
|
|
void clear ();
|