42 LutzLabellingListener(Segmentation::LabellingListener& listener, std::shared_ptr<SourceFactory> source_factory,
45 m_source_factory(source_factory),
46 m_window_size(window_size) {}
48 virtual ~LutzLabellingListener() =
default;
50 void publishGroup(Lutz::PixelGroup& pixel_group)
override {
51 auto source = m_source_factory->createSource();
52 source->setProperty<PixelCoordinateList>(pixel_group.pixel_list);
53 source->setProperty<SourceId>();
54 m_listener.publishSource(
std::move(source));
57 void notifyProgress(
int line,
int total)
override {
58 m_listener.notifyProgress(line, total);
60 if (m_window_size > 0 && line > m_window_size) {
61 m_listener.requestProcessing(
68 Segmentation::LabellingListener& m_listener;
69 std::shared_ptr<SourceFactory> m_source_factory;
82 lutz.
labelImage(lutz_listener, *frame->getThresholdedImage());