- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am working in a project at my university and the main idea is to measure the distance between two objects (supposed to be the only two objects in the environment). As I am not very familiar with the library from RealSense, I tried a solution with OpenCV itself, so I planed to identify the objects with the watershed segmentation algorithm:
https://docs.opencv.org/3.4/d2/dbd/tutorial_distance_transform.html
I obtained satisfactory results, but to improve the segmentation I would need to make a threshold of the image by distance. However, when I convert the data to a Mat image I convert the distance to a Vec3b value of the colorized depth data, but I don't know how to access the depth data (the value in meters) from the Mat to make a threshold or to apply a threshold filter before the convertion.
rs2::frameset data = pipe.wait_for_frames();
rs2::frame depth = data.get_depth_frame().apply_filter(color_map);
const int w = depth.as<rs2::video_frame>().get_width();
const int h = depth.as<rs2::video_frame>().get_height();
Mat image(Size(w, h), CV_8UC3, (void*)depth.get_data(), Mat::AUTO_STEP);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page