Commits

iorodeo  committed 4dd4a8d

Fixed bugs in FlySegmenter.

  • Participants
  • Parent commits 8cd3c47

Comments (0)

Files changed (3)

File src/demo/fly_sorter/fly_segmenter.cpp

 #include <opencv2/highgui/highgui.hpp>
 #include <opencv2/imgproc/imgproc.hpp>
 
-// FlySegmenterData
-// ----------------------------------------------------------------------------
-
-FlySegmenterData::FlySegmenterData() {};
-
-void FlySegmenterData::setPredictorData(FastBinaryPredictorData predictorData)
-{
-    fit = predictorData.fit;
-    label = predictorData.label;
-}
-
 
 // FlySegmenter
 // ----------------------------------------------------------------------------
 {
     std::cout << __PRETTY_FUNCTION__ << std::endl;
 
+    FlySegmenterData flySegmenterData;
+
     BlobDataList::iterator it;
 
-    for ( it=blobDataList.begin(); it!=blobDataList.end(); it++)
+    for (it=blobDataList.begin(); it!=blobDataList.end(); it++)
     {
+        std::cout << "blobData" << std::endl;
+
         BlobData blobData = *it;
 
         // Convert bounding image to LUV. Note, as I'm developing 
         FastBinaryPredictorData predictorData;
         predictorData = fastBinaryPredictor_.predict(boundingImageLUV);
 
-        FlySegmenterData segmenterData;
-        //segmenterData.setPredictorData(predictorData);
+        SegmentData segmentData;
+        segmentData.blobData = blobData;
+        segmentData.predictorData = predictorData;
+        segmentData.boundingImageLUV = boundingImageLUV;
+        flySegmenterData.segmentDataList.push_back(segmentData);
 
         //// Develop
         //// ---------------------------------------------------------
         //cv::imshow("segmenter", segmenterData.label);
         //// ---------------------------------------------------------
         
-        return segmenterData;
     }
+    return flySegmenterData;
 }

File src/demo/fly_sorter/fly_segmenter.hpp

 #include "parameters.hpp"
 #include "blob_finder.hpp"
 #include "fast_binary_predictor.hpp"
+#include <list>
 
 
-class FlySegmenterData : public FastBinaryPredictorData
+class SegmentData 
 {
     public:
-        FlySegmenterData();
-        void setPredictorData(FastBinaryPredictorData predictorData);
+        SegmentData() {};
+        FastBinaryPredictorData predictorData;
+        cv::Mat boundingImageLUV;
+        BlobData blobData;
 };
+typedef std::list<SegmentData> SegmentDataList;
+
+
+class FlySegmenterData
+{
+    public:
+        FlySegmenterData() {};
+        SegmentDataList segmentDataList;
+};
+
 
 
 class FlySegmenter
 };
 
 
-
 #endif // #ifndef FLY_SEGMENTER_HPP

File src/demo/fly_sorter/fly_sorter_window.cpp

     blobFinderData_ = blobFinder.findBlobs(imageData.mat);
 
     FlySegmenter flySegmenter = FlySegmenter(param_.flySegmenter);
-    //flySegmenterData_ = flySegmenter.segment(blobFinderData_.blobDataList);
+    flySegmenterData_ = flySegmenter.segment(blobFinderData_.blobDataList);
 
     if ((httpOutputCheckBoxPtr_ -> checkState()) == Qt::Checked)
     {