librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

How can i label 3D bounding box using RealSense D415 and C++

Open Resays opened this issue 7 years ago • 4 comments

Required Info
Camera Model { R200 / F200 / SR300 / ZR300 / D400 }
Firmware Version (Open RealSense Viewer --> Click info)
Operating System & Version {Win (8.1/10) / Linux (Ubuntu 14/16/17) / MacOS
Kernel Version (Linux Only) (e.g. 4.14.13)
Platform PC/Raspberry Pi/ NVIDIA Jetson / etc..
SDK Version { legacy / 2.. }
Language {C/C#/labview/nodejs/opencv/pcl/python/unity }
Segment {Robot/Smartphone/VR/AR/others }

Issue Description

i'm actually looking to implement this research http://rgbd.cs.princeton.edu/ using RealSense D415 and c++ Successfully run the examples provided in SDK but not getting the idea how can i achieve the 3D bounding box using pointcloud example ... Anyone can help ? @dorodnic @gayanbrahmanage

Resays avatar Apr 29 '19 15:04 Resays

Drawing a 3D bounding box for a point cloud is more complex than a bounding box for a 2D image, as a three-dimensional line has to be drawn. 3D lines can be drawn on a point cloud using a polyline. OpenCV can draw these with its polylines() function.

https://www.tutorialspoint.com/opencv/opencv_drawing_polylines.htm

As an illustration of this principle , Python-based point cloud program Pyntcloud has an example where it demonstrates using polylines to draw axis lines on a point cloud.

https://github.com/daavoo/pyntcloud/blob/master/examples/%5Bvisualization%5D%20Polylines.ipynb

MartyG-RealSense avatar Apr 29 '19 16:04 MartyG-RealSense

Thanks for your reply, i can code using OpenCV and draw lines but the goal is to grab xyz position from rgb-d sensor and draw 3D environment as pointcloud is doing but the twist is, it should have bounding box around the objects. But i am not getting the point, where should i start ? the reference research is attached but not understanding how to do it ... http://rgbd.cs.princeton.edu/

Resays avatar Apr 30 '19 08:04 Resays

I could not find a way to do 3D bounding boxes in OpenCV without using datasets and training data. But since the research paper that you quoted uses these too, this may not be a problem for you.

I found an example project for generating such bounding boxes with OpenCV.

https://github.com/mittalrajat/3D-Bounding-Box-Estimation

MartyG-RealSense avatar Apr 30 '19 10:04 MartyG-RealSense

Thanks MartyG, yes i can use machine learning to detect objects and let me review the link first

Resays avatar May 02 '19 10:05 Resays