RobotsIO
Loading...
Searching...
No Matches
SegmentationYarpPort.h
1/*
2 * Copyright (C) 2021 Istituto Italiano di Tecnologia (IIT)
3 *
4 * This software may be modified and distributed under the terms of the
5 * BSD 3-Clause license. See the accompanying LICENSE file for details.
6 */
7
8#ifndef ROBOTSIO_SEGMENTATIONYARPPORT_H
9#define ROBOTSIO_SEGMENTATIONYARPPORT_H
10
11#include <RobotsIO/Utils/Segmentation.h>
12#include <RobotsIO/Utils/YarpBufferedPort.hpp>
13
14#include <yarp/sig/Image.h>
15
16namespace RobotsIO {
17 namespace Utils {
18 class SegmentationYarpPort;
19 }
20}
21
22
24{
25public:
26
33 SegmentationYarpPort(const std::string& port_prefix, const bool& provide_rgb);
34
35 virtual ~SegmentationYarpPort();
36
37 bool reset() override;
38
39 bool is_stepping_required() const override;
40
41 int get_frames_between_iterations() const override;
42
43 std::pair<bool, cv::Mat> segmentation(const bool& blocking) override;
44
45 std::pair<bool, cv::Mat> latest_segmentation() override;
46
47 virtual double get_time_stamp() override;
48
49 virtual void set_rgb_image(const cv::Mat& image, const double& timestamp) override;
50
51private:
52
54
56
57 const bool provide_rgb_;
58
59 cv::Mat cv_rgb_out_;
60 yarp::sig::ImageOf<yarp::sig::PixelRgb> yarp_rgb_out_;
61
62 cv::Mat cv_mask_in_;
63 yarp::sig::ImageOf<yarp::sig::PixelMono> yarp_mask_in_;
64 double time_stamp_mask_in_;
65
66 const std::string log_name_ = "SegmentationYarpPort";
67};
68
69#endif /* ROBOTSIO_SEGMENTATIONYARPPORT_H */
std::pair< bool, cv::Mat > segmentation(const bool &blocking) override
virtual void set_rgb_image(const cv::Mat &image, const double &timestamp) override
std::pair< bool, cv::Mat > latest_segmentation() override