raulmur / ORB_SLAM2

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

SLAM MODE runs TOO SLOW #277

Closed hnanhtuan closed 7 years ago

hnanhtuan commented 7 years ago

Hi everyone,

I am trying to run SLAM on my own sequence of images (monocular). However, it takes too long to run a frame 640x480 (~2 min). Note that the software run normally (fast ~0.025s) on the provided dataset. I also modified camera calibration and distortion coefficients using the sample code in OpenCV 3.2. The locations of displayed keyframes also seem to be incorrect.

Please help to give me some pieces of advice what should I do in this case to make the software run correctly at real-time.

Any comment is appreciated. Thank you very much.

hnanhtuan commented 7 years ago

The root cause is the time stamp. The software will sleep for a certain time to synchrony with the next frame. The way I define the time stamp is different that cause the problem.

if(ttrack<T) usleep((T-ttrack)*1e6);

gabarlacchi commented 5 years ago

I have a similar problem. Changing only the rgb.txt values (the timestamps) is causing different behavior of ORBSLAM2. Any idea to how to define timestamps from video frames?