ed_sensor_integration
segmenter.h
Go to the documentation of this file.
1 #ifndef ED_SENSOR_INTEGRATION_SEGMENTER_H_
2 #define ED_SENSOR_INTEGRATION_SEGMENTER_H_
3 
6 
7 #include <rgbd/types.h>
8 #include <geolib/datatypes.h>
9 #include <opencv2/core/core.hpp>
11 
12 #include <ed/convex_hull.h>
13 #include <ed/types.h>
14 
15 #include <string>
16 #include <unordered_map>
17 #include <vector>
18 #include <utility>
19 
20 namespace cv
21 {
22  class Mat;
23 }
24 
25 namespace geo
26 {
27  class DepthCamera;
28 }
29 
30 // ----------------------------------------------------------------------------------------------------
31 
32 class Segmenter
33 {
34 
35 public:
36 
38 
39  ~Segmenter();
40 
41  void removeBackground(cv::Mat& depth_image, const ed::WorldModel& world, const geo::DepthCamera& cam,
42  const geo::Pose3D& sensor_pose, double background_padding);
43 
44  void calculatePointsWithin(const rgbd::Image& image, const geo::Shape& shape,
45  const geo::Pose3D& shape_pose, cv::Mat& filtered_depth_image) const;
54  cv::Mat preprocessRGBForSegmentation(const cv::Mat& rgb_image, const cv::Mat& filtered_depth_image) const;
55 
72  SegmentationResult cluster(const cv::Mat& depth_image, const geo::DepthCamera& cam_model,
73  const geo::Pose3D& sensor_pose, std::vector<EntityUpdate>& clusters, const cv::Mat& rgb_image,
74  const std::string& area_description = "", bool verbose=false);
75 
76 private:
81 };
82 
83 #endif
SegmentationResult
Result of the segmentation pipeline containing masks, bounding boxes, and YOLO classification info fo...
Definition: sam_seg_module.h:19
Segmenter
Definition: segmenter.h:32
datatypes.h
std::string
utility
Segmenter::preprocessRGBForSegmentation
cv::Mat preprocessRGBForSegmentation(const cv::Mat &rgb_image, const cv::Mat &filtered_depth_image) const
Preprocess RGB image for segmentation. This function masks the RGB image with the filtered depth imag...
Definition: src/kinect/segmenter.cpp:194
geo
sam_seg_module.h
Segmenter::config_
tue::Configuration config_
Definition: segmenter.h:77
Segmenter::removeBackground
void removeBackground(cv::Mat &depth_image, const ed::WorldModel &world, const geo::DepthCamera &cam, const geo::Pose3D &sensor_pose, double background_padding)
Definition: src/kinect/segmenter.cpp:87
vector
convex_hull.h
rgb_image
cv::Mat rgb_image
cam
geo::DepthCamera cam
geo::Transform3T
Segmenter::cluster
SegmentationResult cluster(const cv::Mat &depth_image, const geo::DepthCamera &cam_model, const geo::Pose3D &sensor_pose, std::vector< EntityUpdate > &clusters, const cv::Mat &rgb_image, const std::string &area_description="", bool verbose=false)
Cluster the depth image into segments. Applies new algorithm which is the YOLO - SAM - BMM depth segm...
Definition: src/kinect/segmenter.cpp:212
Segmenter::surface_label_map_
std::unordered_map< std::string, std::string > surface_label_map_
Definition: segmenter.h:80
image
cv::Mat image
tue::config::ReaderWriter
rgbd::Image
Segmenter::calculatePointsWithin
void calculatePointsWithin(const rgbd::Image &image, const geo::Shape &shape, const geo::Pose3D &shape_pose, cv::Mat &filtered_depth_image) const
Definition: src/kinect/segmenter.cpp:157
ed::WorldModel
Segmenter::~Segmenter
~Segmenter()
Definition: src/kinect/segmenter.cpp:48
Segmenter::Segmenter
Segmenter(tue::Configuration config)
Definition: src/kinect/segmenter.cpp:31
configuration.h
entity_update.h
geo::DepthCamera
cv
types.h
unordered_map
depth_image
cv::Mat depth_image
geo::Shape
config
tue::config::ReaderWriter config
string