raulmur / ORB_SLAM2

Real-Time SLAM for Monocular, Stereo and RGB-D Cameras, with Loop Detection and Relocalization Capabilities
Other
9.18k stars 4.69k forks source link

Augmented reality with ORB-SLAM2(Monocular) #410

Open prathamsatam opened 6 years ago

prathamsatam commented 6 years ago

Augmented reality with ORB-SLAM2(Monocular) - this is a sample video on github link-https://www.youtube.com/embed/T-9PYCKhDLM

how to achieve the same output using ORB-SLAM2? Which dataset I have to use to implement? and what is the requirement and process to do the same?

Thank you.

AlejandroSilvestri commented 6 years ago

@prathamsatam

You must compile mono_ros_AR.cc , and then provide images via ROS. That video is not a dataset, is a real time video.

yizhou-wang commented 5 years ago

@AlejandroSilvestri Is there a way to use some exist datasets like KITTI for monoAR's input? Thank you!

AlejandroSilvestri commented 5 years ago

@yizhou-wang , I'm not using datasets, but I think you can provide datasets images via ROS too.

yizhou-wang commented 5 years ago

@AlejandroSilvestri Thanks a lot! But I met another problem: I could not find out how does ORB-SLAM2 monoAR demo get the point to put cube? In the AR demo, the place to put cube should be selected by the users, but I want to try a fixed point. Is there a way to do that? Thank you for your help!

AlejandroSilvestri commented 5 years ago

@yizhou-wang , all you need to put a cube in a fixed point is its pose in the "world" reference system (the one orb-slam2's map uses). And code it.

To this end you can learn the code starting here.

yizhou-wang commented 5 years ago

@AlejandroSilvestri As far as my understanding, the monoAR draws the cube at this line. The function DrawCube is declared as

void DrawCube(const float &size, const float x=0, const float y=0, const float z=0);

and (x,y,z) should be the place to put cube? But there is no input of (x,y,z) so they always use the default value (0,0,0). However, how does it know where did the user click?

I'm new to ORB-SLAM and thank you so much for your patience!

AlejandroSilvestri commented 5 years ago

@yizhou-wang , look the video: https://youtu.be/T-9PYCKhDLM?t=1m2s

They click the button "Insert Cube" to insert it at the center of the screen. Try inserting cubes in different coordinates.