SourceXtractorPlusPlus  0.10
Please provide a description of the project.
LutzSegmentation.cpp
Go to the documentation of this file.
1 
27 
33 
35 
36 namespace SourceXtractor {
37 
39 public:
41  int window_size) :
42  m_listener(listener),
43  m_source_factory(source_factory),
44  m_window_size(window_size) {}
45 
46  virtual ~LutzLabellingListener() = default;
47 
48  void publishGroup(Lutz::PixelGroup& pixel_group) override {
49  auto source = m_source_factory->createSource();
50  source->setProperty<PixelCoordinateList>(pixel_group.pixel_list);
51  source->setProperty<SourceId>();
52  m_listener.publishSource(source);
53  }
54 
55  void notifyProgress(int line, int total) override {
56  m_listener.notifyProgress(line, total);
57 
58  if (m_window_size > 0 && line > m_window_size) {
60  }
61  }
62 
63 private:
67 };
68 
69 //
70 // class LutzSegmentation
71 //
72 
74  Lutz lutz;
75  LutzLabellingListener lutz_listener(listener, m_source_factory, m_window_size);
76  lutz.labelImage(lutz_listener, *frame->getThresholdedImage());
77 }
78 
79 } // Segmentation namespace
80 
PixelCoordinateList.h
SourceXtractor::Lutz::labelImage
void labelImage(LutzListener &listener, const DetectionImage &image, PixelCoordinate offset=PixelCoordinate(0, 0))
Definition: Lutz.cpp:59
SourceXtractor::PixelCoordinateList
Definition: PixelCoordinateList.h:30
LineSelectionCriteria.h
std::shared_ptr< SourceFactory >
SourceXtractor::ProcessSourcesEvent
Event received by SourceGrouping to request the processing of some of the Sources stored.
Definition: SourceGrouping.h:71
SourceId.h
SourceXtractor::Segmentation::LabellingListener::publishSource
void publishSource(std::shared_ptr< SourceInterface > source) const
Definition: Segmentation.h:100
SourceXtractor::LutzLabellingListener::m_source_factory
std::shared_ptr< SourceFactory > m_source_factory
Definition: LutzSegmentation.cpp:65
SourceXtractor::SourceId
Definition: SourceId.h:31
LutzSegmentation.h
SourceXtractor::LutzSegmentation::m_source_factory
std::shared_ptr< SourceFactory > m_source_factory
Definition: LutzSegmentation.h:57
SourceXtractor
Definition: Aperture.h:30
SourceXtractor::LutzSegmentation::labelImage
virtual void labelImage(Segmentation::LabellingListener &listener, std::shared_ptr< const DetectionImageFrame > frame) override
Definition: LutzSegmentation.cpp:73
SourceXtractor::LutzLabellingListener::m_window_size
int m_window_size
Definition: LutzSegmentation.cpp:66
SourceXtractor::LutzLabellingListener
Definition: LutzSegmentation.cpp:38
SourceXtractor::LutzLabellingListener::notifyProgress
void notifyProgress(int line, int total) override
Definition: LutzSegmentation.cpp:55
Image.h
ProcessedImage.h
Lutz.h
SourceWithOnDemandProperties.h
SourceXtractor::Lutz::PixelGroup
Definition: Lutz.h:39
SourceXtractor::LutzLabellingListener::m_listener
Segmentation::LabellingListener & m_listener
Definition: LutzSegmentation.cpp:64
SourceXtractor::Segmentation::LabellingListener
Definition: Segmentation.h:94
SourceXtractor::LutzLabellingListener::~LutzLabellingListener
virtual ~LutzLabellingListener()=default
SourceXtractor::LineSelectionCriteria
Definition: LineSelectionCriteria.h:32
SourceXtractor::Segmentation::LabellingListener::requestProcessing
void requestProcessing(const ProcessSourcesEvent &event)
Definition: Segmentation.h:109
MultithreadedMeasurement.h
SourceXtractor::LutzSegmentation::m_window_size
int m_window_size
Definition: LutzSegmentation.h:58
SourceXtractor::Lutz::LutzListener
Definition: Lutz.h:53
SourceXtractor::Segmentation::LabellingListener::notifyProgress
void notifyProgress(int position, int total)
Definition: Segmentation.h:105
SourceXtractor::LutzLabellingListener::LutzLabellingListener
LutzLabellingListener(Segmentation::LabellingListener &listener, std::shared_ptr< SourceFactory > source_factory, int window_size)
Definition: LutzSegmentation.cpp:40
SourceXtractor::LutzLabellingListener::publishGroup
void publishGroup(Lutz::PixelGroup &pixel_group) override
Definition: LutzSegmentation.cpp:48
SourceXtractor::Lutz::PixelGroup::pixel_list
std::vector< PixelCoordinate > pixel_list
Definition: Lutz.h:44
SourceXtractor::Lutz
Implements a Segmentation based on the Lutz algorithm.
Definition: Lutz.h:37