Explorar o código

towards better Exception handling for clustering and LFRepresentations

Alexander Freytag %!s(int64=11) %!d(string=hai) anos
pai
achega
3733d9dc68

+ 10 - 4
features/localfeatures/LFonHSG.cpp

@@ -62,6 +62,11 @@ LFonHSG::~LFonHSG()
   /** free memory of descriptors **/
 }
 
+int LFonHSG::getDescSize() const
+{
+  return lf->getDescSize();
+}
+
 void LFonHSG::getPositionsOnHSG (const unsigned int imageWidth, const unsigned int imageHeight, VVector& positions) const
 {
   if (sampleScaling < 1) {
@@ -80,10 +85,10 @@ void LFonHSG::getPositionsOnHSG (const unsigned int imageWidth, const unsigned i
 
     for (unsigned int j = sampleScaling; j <= (imageHeight - sampleScaling); j += sampleScaling) {
       for (unsigned int i = (oddRow ? sampleScaling + sampleScaling / 2 : sampleScaling); i <= (imageWidth - sampleScaling); i += sampleScaling) {
-        pos[ 0] = i;
-        pos[ 1] = j;
-        pos[ 2] = *it;
-        pos[ 3] = 0;
+        pos[ 0 ] = i;
+        pos[ 1 ] = j;
+        pos[ 2 ] = *it;
+        pos[ 3 ] = 0;
         positions.push_back (pos);
       }
       oddRow = !oddRow;
@@ -113,6 +118,7 @@ int LFonHSG::extractFeatures (const NICE::Image & img, VVector & features, VVect
 void LFonHSG::visualizeFeatures (NICE::Image & mark, const VVector & positions, size_t color) const
 {
   // TODO: Implementierung des gewaehlten Descriptortyps aufrufen.
+  throw NICE::Exception( "LFonHSG::visualizeFeatures currently not implemented." );
 }
 
 

+ 4 - 4
features/localfeatures/LFonHSG.h

@@ -66,20 +66,20 @@ class LFonHSG : public LocalFeatureRepresentation
     //! if true, print some log-output
     bool debug;
 
-    //! the descritor instanz
+    //! the descriptor instance
     LocalFeature* lf;
 
     /* public member */
   public:
+    
     //! simple contructor
     LFonHSG ( const NICE::Config *conf, const std::string section = "HSG" );
+    
     //! simple desctructor
     ~LFonHSG();
 
     //! Returns the descriptorsize
-    int getDescSize() const {
-      return lf->getDescSize();
-    };
+    int getDescSize() const;
 
     //! Extract the descriptor-Values from a given grayscale-Image.
     int extractFeatures ( const NICE::Image & img, NICE::VVector & features, NICE::VVector & positions ) const;

+ 11 - 7
features/localfeatures/LocalFeatureRepresentation.h

@@ -8,14 +8,18 @@
 #ifndef LOCALFEATUREREPRESENTATIONINCLUDE
 #define LOCALFEATUREREPRESENTATIONINCLUDE
 
-#include "core/imagedisplay/ImageDisplay.h"
-
-#include "core/vector/VectorT.h"
-#include "core/vector/MatrixT.h"
-#include "core/image/ImageT.h"
- 
+// STL includes
 #include <vector>
-#include "core/vector/VVector.h"
+
+// nice-core includes
+#include <core/basics/Exception.h>
+// 
+#include <core/image/ImageT.h>
+#include <core/imagedisplay/ImageDisplay.h>
+// 
+#include <core/vector/VectorT.h>
+#include <core/vector/MatrixT.h>
+#include <core/vector/VVector.h>
 
 
 namespace OBJREC {

+ 6 - 4
math/cluster/ClusterAlgorithm.h

@@ -8,10 +8,12 @@
 #ifndef CLUSTERALGORITHMINCLUDE
 #define CLUSTERALGORITHMINCLUDE
 
-#include "core/vector/VectorT.h"
-#include "core/vector/MatrixT.h"
-
-#include "core/vector/VVector.h"
+// nice-core includes
+#include <core/basics/Exception.h>
+// 
+#include <core/vector/VectorT.h>
+#include <core/vector/MatrixT.h>
+#include <core/vector/VVector.h>
 
 
 namespace OBJREC {

+ 1 - 1
math/cluster/KMeans.h

@@ -8,7 +8,7 @@
 #define KMEANSINCLUDE
 
 // nice-core includes
-#include "core/basics/Exception.h"
+#include <core/basics/Exception.h>
 #include <core/basics/Config.h>
 // 
 #include <core/vector/Distance.h>