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 #include <thread>
20 
21 namespace cv
22 {
23  class Mat;
24 }
25 
26 namespace geo
27 {
28  class DepthCamera;
29 }
30 
31 // ----------------------------------------------------------------------------------------------------
32 
33 class Segmenter
34 {
35 
36 public:
37 
39 
40  ~Segmenter();
41 
42  void removeBackground(cv::Mat& depth_image, const ed::WorldModel& world, const geo::DepthCamera& cam,
43  const geo::Pose3D& sensor_pose, double background_padding);
44 
45  void calculatePointsWithin(const rgbd::Image& image, const geo::Shape& shape,
46  const geo::Pose3D& shape_pose, cv::Mat& filtered_depth_image) const;
55  cv::Mat preprocessRGBForSegmentation(const cv::Mat& rgb_image, const cv::Mat& filtered_depth_image) const;
56 
73  SegmentationResult cluster(const cv::Mat& depth_image, const geo::DepthCamera& cam_model,
74  const geo::Pose3D& sensor_pose, std::vector<EntityUpdate>& clusters, const cv::Mat& rgb_image,
75  const std::string& area_description = "", bool verbose=false);
76 
77 private:
84 };
85 
86 #endif
SegmentationResult
Result of the segmentation pipeline containing masks, bounding boxes, and YOLO classification info fo...
Definition: sam_seg_module.h:34
Segmenter
Definition: segmenter.h:33
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:207
geo
sam_seg_module.h
Segmenter::config_
tue::Configuration config_
Definition: segmenter.h:78
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:100
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:225
Segmenter::surface_label_map_
std::unordered_map< std::string, std::string > surface_label_map_
Definition: segmenter.h:81
image
cv::Mat image
tue::config::ReaderWriter
rgbd::Image
thread
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:170
SamSegPipeline
Segmentation pipeline class that maintains YOLO and SAM models state. This prevents initializing heav...
Definition: sam_seg_module.h:47
ed::WorldModel
Segmenter::~Segmenter
~Segmenter()
Definition: src/kinect/segmenter.cpp:57
Segmenter::Segmenter
Segmenter(tue::Configuration config)
Definition: src/kinect/segmenter.cpp:32
configuration.h
entity_update.h
Segmenter::init_thread_
std::thread init_thread_
Definition: segmenter.h:83
Segmenter::sam_pipeline_
SamSegPipeline sam_pipeline_
Definition: segmenter.h:82
geo::DepthCamera
cv
types.h
unordered_map
depth_image
cv::Mat depth_image
geo::Shape
config
tue::config::ReaderWriter config
string