SourceXtractorPlusPlus  0.13
Please provide a description of the project.
Segmentation.h
Go to the documentation of this file.
1 
23 #ifndef _SEFRAMEWORK_PIPELINE_SEGMENTATION_H
24 #define _SEFRAMEWORK_PIPELINE_SEGMENTATION_H
25 
26 #include <memory>
27 #include <type_traits>
28 
31 
32 #include "SEUtils/Observable.h"
37 
39 
40 
41 
42 namespace SourceXtractor {
43 
50 };
51 
58 class Segmentation : public Observable<std::shared_ptr<SourceInterface>>, public Observable<SegmentationProgress>,
59  public Observable<ProcessSourcesEvent> {
60 
61 public:
62  class LabellingListener;
63  class Labelling;
64 
66  virtual ~Segmentation() = default;
67 
69 
70  template<class LabellingType, typename ... Args>
71  void setLabelling(Args... args) {
73  "LabellingType must inherit from SourceXtractor::Segmentation::Labelling");
75  "LabellingType must be constructible from args");
76 
77  m_labelling.reset(new LabellingType(std::forward<Args>(args)...));
78  }
79 
82 
83 protected:
86  }
87 
88 private:
91 
92 }; /* End of Segmentation class */
93 
95 public:
97  m_segmentation(segmentation),
98  m_detection_frame(detection_frame) {}
99 
101  source->setProperty<DetectionFrame>(m_detection_frame);
103  }
104 
105  void notifyProgress(int position, int total) {
106  m_segmentation.Observable<SegmentationProgress>::notifyObservers(SegmentationProgress{position, total});
107  }
108 
110  m_segmentation.Observable<ProcessSourcesEvent>::notifyObservers(event);
111  }
112 
113 private:
116 };
117 
119 public:
120  virtual ~Labelling() = default;
122 
124 };
125 
126 } /* namespace SourceXtractor */
127 
128 #endif
SourceXtractor::Observable< ProcessSourcesEvent >::notifyObservers
void notifyObservers(const ProcessSourcesEvent &message) const
Definition: Observable.h:71
std::shared_ptr
STL class.
SourceXtractor::ProcessSourcesEvent
Event received by SourceGrouping to request the processing of some of the Sources stored.
Definition: SourceGrouping.h:71
SourceXtractor::Segmentation::Labelling
Definition: Segmentation.h:118
SourceGrouping.h
SourceInterface.h
SourceXtractor::Segmentation::publishSource
void publishSource(std::shared_ptr< SourceInterface > source) const
Definition: Segmentation.h:84
SourceXtractor::Segmentation::m_labelling
std::unique_ptr< Labelling > m_labelling
Definition: Segmentation.h:89
SourceXtractor::Segmentation::LabellingListener::publishSource
void publishSource(std::shared_ptr< SourceInterface > source) const
Definition: Segmentation.h:100
SourceXtractor::SegmentationProgress::total
int total
Definition: Segmentation.h:49
DetectionFrame.h
CoordinateSystem.h
SourceXtractor::Segmentation::Labelling::labelImage
virtual void labelImage(Segmentation::LabellingListener &listener, std::shared_ptr< const DetectionImageFrame > frame)=0
SourceXtractor::Segmentation::processFrame
void processFrame(std::shared_ptr< DetectionImageFrame > frame) const
Processes a Frame notifying Observers with a Source object for each detection.
Definition: Segmentation.cpp:31
SourceXtractor
Definition: Aperture.h:30
SourceXtractor::Segmentation::LabellingListener::LabellingListener
LabellingListener(const Segmentation &segmentation, std::shared_ptr< DetectionImageFrame > detection_frame)
Definition: Segmentation.h:96
SourceXtractor::Segmentation::Segmentation
Segmentation(std::shared_ptr< DetectionImageFrame::ImageFilter > image_processing)
Definition: Segmentation.cpp:27
SourceXtractor::DetectionFrame
Definition: DetectionFrame.h:33
SourceXtractor::Segmentation::LabellingListener::m_detection_frame
std::shared_ptr< DetectionImageFrame > m_detection_frame
Definition: Segmentation.h:115
Image.h
Observable.h
Frame.h
SourceXtractor::Segmentation::~Segmentation
virtual ~Segmentation()=default
Destructor.
SourceXtractor::Observable
Implements the Observer pattern. Notifications will be made using a message of type T.
Definition: Observable.h:51
SourceXtractor::Segmentation::LabellingListener
Definition: Segmentation.h:94
SourceXtractor::Segmentation::LabellingListener::m_segmentation
const Segmentation & m_segmentation
Definition: Segmentation.h:114
SourceXtractor::Segmentation::LabellingListener::requestProcessing
void requestProcessing(const ProcessSourcesEvent &event)
Definition: Segmentation.h:109
SourceXtractor::Segmentation::setLabelling
void setLabelling(Args... args)
Definition: Segmentation.h:71
SourceXtractor::Segmentation::Labelling::Labelling
Labelling()
Definition: Segmentation.h:121
std::is_constructible
SourceXtractor::Segmentation::Labelling::~Labelling
virtual ~Labelling()=default
SourceXtractor::Segmentation::LabellingListener::notifyProgress
void notifyProgress(int position, int total)
Definition: Segmentation.h:105
std::unique_ptr
STL class.
SourceXtractor::Segmentation
Segmentation takes an image and splits it into individual Sources for further refinement....
Definition: Segmentation.h:59
SourceXtractor::SegmentationProgress::position
int position
Definition: Segmentation.h:49
SourceXtractor::SegmentationProgress
Used to notify observers of the progress of the processing of the image.
Definition: Segmentation.h:48
std::is_base_of
SourceXtractor::Segmentation::m_filter_image_processing
std::shared_ptr< DetectionImageFrame::ImageFilter > m_filter_image_processing
Definition: Segmentation.h:90