Commits

iorodeo committed 6986076

Added BlobFinderParam numPad to json configuration.

  • Participants
  • Parent commits ffa62c2

Comments (0)

Files changed (3)

File src/demo/fly_sorter/parameters.hpp

 class FlySegmenterParam 
 {
     public:
-
         ClassifierParam classifier;
-
-        //static const ClassifierParam DEFAULT_CLASSIFIER_PARAM;
-        //static ClassifierParam createDefaultClassifierParam();
         static const QString DEFAULT_CLASSIFIER_FILENAME;
-
         FlySegmenterParam();
 };
 

File src/utility/blob_finder_param.cpp

     const double BlobFinderParam::THRESHOLD_MAXVAL_MAX      = 255.0;
     const double BlobFinderParam::MINIMUM_AREA_MIN          = 1.0;
     const double BlobFinderParam::MAXIMUM_AREA_MIN          = 1.0;
+    const unsigned int BlobFinderParam::NUM_PAD_MIN         = 1; 
+    const unsigned int BlobFinderParam::NUM_PAD_MAX         = 200;
     
     
     BlobFinderParam::BlobFinderParam()
         paramMap.insert("thresholdMaxVal", thresholdMaxVal);
         paramMap.insert("minimumArea", minimumArea);
         paramMap.insert("maximumArea", maximumArea);
+        paramMap.insert("numPad", numPad);
+
         return paramMap;
     }
 
         minimumArea = minimumAreaTemp;
         maximumArea = maximumAreaTemp;
 
+        // Get numPad
+        // -------------
+        if (!paramMap.contains("numPad"))
+        {
+            rtnStatus.success = false;
+            rtnStatus.message = QString("'numPad' not found in blob finder parameters");
+            return rtnStatus;
+        }
+        if (!paramMap["numPad"].canConvert<unsigned int>())
+        {
+            rtnStatus.success = false;
+            rtnStatus.message = QString("Unable to convert blob finder parameter 'numPad' to unsigned int");
+            return rtnStatus;
+        }
+        unsigned int numPadTemp = paramMap["numPad"].toUInt();
+        if (numPadTemp < NUM_PAD_MIN) 
+        {
+            rtnStatus.success = false;
+            rtnStatus.message = QString("Blob finder parameter 'numPad' less than minimum allowed"); 
+            return rtnStatus;
+        }
+        if (numPadTemp > NUM_PAD_MAX)
+        {
+            rtnStatus.success = false;
+            rtnStatus.message = QString("Blob finder parameter 'numPad' greater than maximum allowed"); 
+            return rtnStatus;
+        }
+        numPad = numPadTemp;
+
         rtnStatus.success = true;
         rtnStatus.message = QString("");
         return rtnStatus;

File src/utility/blob_finder_param.hpp

             static const double THRESHOLD_MAX;
             static const double THRESHOLD_MAXVAL_MIN;
             static const double THRESHOLD_MAXVAL_MAX;
+            static const unsigned int NUM_PAD_MIN;
+            static const unsigned int NUM_PAD_MAX;
 
             double minimumArea;
             double maximumArea;