#997·ORB_SLAM3

让它与单通道 USB 摄像头一起工作 ...

作者: Alfcyber创建于 2026年2月18日更新于 2026年2月18日

I managed to get the program running on a modern Gentoo system with a monocular USB camera. It's noticeable that the program is buggy during initialization, in my opinion, but this was necessary. With this camera (Rollei R-Cam 100), `bool TwoViewReconstruction::ReconstructF` is called, where the following code change is made: `minParallax = 0.f; if(maxGood < nMinGood || nsimilar > 3) //1` and this in `Tracking.cc if(!mbReadyToInitialize) { ... ... return MonocularInitialization(); }` - after that, it worked :) - this should help anyone trying it with a monocular camera. [edit] While `return MonocularInitialization();` is not necessary (but possible), the biggest error seems to be that `minParallax` is defined as 1.0 (it should probably be `maxParallax`? I haven't analyzed the code enough to be sure), and the pics from my cam always gets a value of 2 for `nsimilar`, which is why it was never initialized. I'm writing this because I thought my system was missing libraries and I spent hours searching for connections until I analyzed the code, and I believe that this probably doesn't only apply to this camera (although I also don't understand why ffmpeg should be necessary on Ubuntu; OpenCV on my system isn't able to work with the ffmpeg backend, only GStreamer and V4L). Aside from that, it was of course necessary to modify the CMakeLists.txt file for it to compile at all. Then, somewhere in the program, an int is defined as a bool (you notice that immediately with a modern compiler) (but the purpose of the int/bool isn't clear anyway). There's a more modern branch that compiles without modifications (https://GitHub.com/devansh0703/ORB_SLAM3.git), but even with the changes mentioned above, this code didn't work for me(I don't know why yet). For those interested, this is my test code (comments are in German).

内容来源: UZ-SLAMLab/ORB_SLAM3