فهرست منبع

added: support for loading label informations created by the ImageLabeler in a LabeledFileList.

Johannes Ruehle 13 سال پیش
والد
کامیت
f7d491dd87
2فایلهای تغییر یافته به همراه24 افزوده شده و 3 حذف شده
  1. 21 2
      cbaselib/LabeledFileList.cpp
  2. 3 1
      cbaselib/LabeledFileList.h

+ 21 - 2
cbaselib/LabeledFileList.cpp

@@ -1,4 +1,4 @@
-/** 
+/**
 * @file LabeledFileList.cpp
 * @brief reads images from directory
 * @author Erik Rodner
@@ -32,6 +32,18 @@ LabeledFileList::~LabeledFileList()
 }
 
 
+/**
+ * @brief Loads the label information according to a given label file format.
+ *
+ * Supported types of label file format (localization_format):
+ * - "image": <br>usage of a single channel images containing label regions
+ * - "imagergb": <br>usage of a multi channel color images containing label regions
+ * - "polygon": <br>obtaining bounding boxes from textural label files (used with e.g. PASCAL dataset)
+ * - "imagelabeler": <br>obtaining label information (currently only bounding boxes) from the separate label files (XML like) created with the ImageLabeler ( < file name >_labeled.dat ). @see ImageInfo
+ *
+ * @param classnames class containing all potential class names (label categories)
+ * @param conf configuration structure containing a information from a loaded config file; has to tag "localization_format" in section "main" in order to obtain the correct label information from a file.
+ */
 LocalizationResult *LabeledFileList::getLocalizationInfo ( const ClassNames & classnames,
 					    int classno,
 					    const std::string & file,
@@ -97,7 +109,14 @@ LocalizationResult *LabeledFileList::getLocalizationInfo ( const ClassNames & cl
 
 		if ( debug_dataset )
 		   fprintf (stderr, "LabeledFileList: object localization %d\n", (int)lr->size() );
-		} else {
+        }
+    else if ( format == "imagelabeler" ) {
+
+        lr = new LocalizationResult ( &classnames );
+        lr->loadImageInfo(lfile);
+
+    }
+    else {
 			fthrow(Exception, "Localization format not yet supported !!\n");
 		}
    

+ 3 - 1
cbaselib/LabeledFileList.h

@@ -18,7 +18,9 @@
 
 namespace OBJREC {
 
-/** reads images from directory */
+/**
+ * @brief reads images from directory
+ */
 class LabeledFileList
 {
     private: