hanmekim / scenelib2 Goto Github PK
View Code? Open in Web Editor NEWSceneLib2 is an open-source C++ library for SLAM originally designed and implemented by Professor Andrew Davison at Imperial College London.
License: Other
SceneLib2 is an open-source C++ library for SLAM originally designed and implemented by Professor Andrew Davison at Imperial College London.
License: Other
========================================== SceneLib2 - MonoSLAM open-source library ========================================== Please also refer to the following links; http://hanmekim.blogspot.com/2012/10/scenelib2-monoslam-open-source-library.html https://github.com/hanmekim/SceneLib2 ********************** * What is SceneLib2? * ********************** SceneLib2 is an open-source C++ library for SLAM originally designed and implemented by Andrew Davison and colleagues at the University of Oxford. ****************************** * Why is it named SceneLib2? * ****************************** His version, SceneLib 1.0, was released with full source code under the LGPL, and as SceneLib2 is a reimplemented version of it, I gave the same name with a new version number to this library. **************************** * Why is it reimplemented? * **************************** I reimplemented his version with the following objectives; 1. Understand his MonoSLAM algorithm in code level. 2. Replace older libraries (i.e. VW34, GLOW, VNL, Pthread) with newer ones (Pangolin, Eigen3, Boost). 3. Support USB camera instead of IEEE1394. 4. Make it more portable and convenient by using CMake and git repository. ****************** * Implementation * ****************** I tried to make it as same as the original version, so that I can easily find any problems that I might have introduced to it by accident (I didn't even change most of functions' and variables' name). But, at the same time, I also tried to make it easier to understand by using different class architectures and various changes. To give you the same executable example program like MonoSLAMGlow in SceneLib 1.0, I implemented a very similar one called MonoSlamSenceLib1, and again I tried to make it as same as the original version. ********************** * Notes and Warnings * ********************** Even though my intention is to make it as a cross-platform library, I only added and tested it for the following platforms, but, of course, I will increase its portability continuously (you can check the following platforms list later on). * Ubuntu 12.04 LTS - 32bits * Ubuntu 12.04 LTS - 64bits (thanks to Prof. Davison for testing it) * Ubuntu 12.10 - 64bits * Ubuntu 14.04 LTS - 64bits * Mac OS X 10.9 * Mac OS X 10.10 This library is a research-level software which is still in development. It will be frequently changed without notification to fix bugs, to add more features and to make it better. **************** * Installation * **************** 1. Install various development related packages $ sudo apt-get install build-essential $ sudo apt-get install git cmake $ sudo apt-get install freeglut3-dev libglu-dev libglew-dev $ sudo apt-get install ffmpeg libavcodec-dev libavutil-dev libavformat-dev libswscale-dev 2. Install Engen3 $ sudo apt-get install libeigen3-dev 3. Install Boost $ sudo apt-get install libboost-all-dev 4. Install OpenCV $ cd MY_EXTERNAL_LIBRARIES_DIRECTORY $ wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.2/OpenCV-2.4.2.tar.bz2 $ tar xvf OpenCV-2.4.2.tar.bz2 $ cd OpenCV-2.4.2 $ mkdir BUILD $ cd BUILD $ cmake .. $ make -j4 $ sudo make install 5. Install Pangolin $ cd MY_EXTERNAL_LIBRARIES_DIRECTORY $ git clone https://github.com/stevenlovegrove/Pangolin.git $ cd Pangolin $ mkdir BUILD $ cd BUILD $ cmake .. $ make -j4 $ sudo make install 6. Install SceneLib2 $ cd MY_WORK_DIRECTORY $ git clone git://github.com/hanmekim/SceneLib2.git SceneLib2 $ cd SceneLib2 $ mkdir BUILD $ cd BUILD $ cmake .. $ make -j4 7. Download an example image sequence $ cd MY_IMAGE_DIRECTORY $ wget www.doc.ic.ac.uk/~ajd/Scene/Release/testseqmonoslam.tar.gz $ tar xvf testseqmonoslam.tar.gz ************** * How to use * ************** 1-1. Modify the configuration file to use the example image sequence $ gedit MY_WORK_DIRECTORY/SceneLib2/data/SceneLib2.cfg > input.mode = 0; > input.name = MY_IMAGE_DIRECTORY/TestSeqMonoSLAM; # these are default camera parameters for the example image sequence > cam.width = 320; > cam.height = 240; > cam.fku = 195; > cam.fkv = 195; > cam.u0 = 162; > cam.v0 = 125; > cam.kd1 = 9e-06; > cam.sd = 1; 1-2. Modify the configuration file to use a USB camera $ gedit MY_WORK_DIRECTORY/SceneLib2/data/SceneLib2.cfg > input.mode = 1; # change [number] to your camera (e.g. mine is video0) > input.name = convert:[fmt=RGB24]//v4l:///dev/video[number]; # these are default camera parameters for (Logitech V-U0009), # not calibrated properly, but it works for now > cam.width = 320; > cam.height = 240; > cam.fku = 195; > cam.fkv = 195; > cam.u0 = 162; > cam.v0 = 125; > cam.kd1 = 1e-12; > cam.sd = 1; 2. Run MonoSlamSceneLib1 $ cd MY_WORK_DIRECTORY/SceneLib2/BUILD/examples $ ./MonoSlamSceneLib1 **************** * Known issues * **************** There are known issues, and they will be resolved as soon as possible. * Detected features are slightly different to the original version's. * Most of member functions and variables are currently public for convenient debugging, and they will be properly encapsulated later. ************* * Thanks to * ************* I really appreciate Professor Andrew Davison for sharing his great achievement, and I promise him that I will share every findings based on this to help others who are interested in this field as he is doing continuously in various ways. Thank you.
Does the code contain the patch planer normal estimation in the paper?
Hi,
All the previous installations before SceneLib2 worked good. After executing $cmake .. in the build directory of SceneLib2, the following errors occurred:
Build type not set (defaults to debug)
-DCMAKE_BUILD_TYPE=Release for release
-- OpenCV ARCH:
-- OpenCV RUNTIME:
-- OpenCV STATIC: OFF
CMake Warning at /home/meng/opencv/cmake/OpenCVConfig.cmake:161 (message):
Found OpenCV Windows Pack but it has not binaries compatible with your
configuration.
You should manually point CMake variable OpenCV_DIR to your build of OpenCV
library.
Call Stack (most recent call first):
scenelib2/CMakeLists.txt:10 (FIND_PACKAGE)
CMake Error at scenelib2/CMakeLists.txt:10 (FIND_PACKAGE):
Found package configuration file:
/home/meng/opencv/cmake/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.
-- Configuring incomplete, errors occurred!
See also "/home/meng/workspace/MonoSLAM2/SceneLib2/build/CMakeFiles/CMakeOutput.log".
Could anyone provide some suggestions? Thanks in advance!
Hi Kim,
I've successfully compiled and used Scenelib2 on Debian 9 x64 following your instruction and used with the test sequence.
I've upgraded open cv version to opencv-2.4.13.6 (downloaded directly from OpenCv site) after some compilation errors on my machine (probably for the update packages installed by apt-get).
Also, to avoid some NOTFOUND cmake errors , e.g:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND. ... GLUT_Xi_LIBRARY (ADVANCED) ... GLUT_Xmu_LIBRARY (ADVANCED) ...
you need to add libxmu and libxi-dev using package manager.
Thank you for update the original scenelib. I tried to compile and use the old version without success.
Hello.
I successfully ran the example with a handled USB webcam, but the feature tracking and pose estimation were terrible. Then I ran the example on provided image files, and it worked well. So I guess the problem is camera calibration.
I am confused with the camera parameters in SceneLib2.cfg
, because usually there are 4 intrinsic matrix parameters and 5 distortion parameters but actually there are 4 intrinsic matrix parameters and 2 distortion parameters (I guess). Why ?
Besides, my camera provide 640x480 image size, and in usbcam_grabber
it will be resized to 320x240. So what should I do about my camera calibration parameters ?
Most of member functions and variables are currently public for convenient debugging, and they will be properly encapsulated later.
Hi,
when I build the project using make, I have this error:
/usr/local/include/pangolin/var/varvalue.h: In instantiation of ‘void pangolin::VarValue::Init() [with T = int]’:
/usr/local/include/pangolin/var/varvalue.h:56:14: required from ‘pangolin::VarValue::VarValue(const T&) [with T = int]’
/usr/local/include/pangolin/var/var.h:169:20: required from ‘pangolin::Var::Var(const string&, const T&, bool) [with T = int; std::string = std::basic_string]’
/home/salah/linaro/SceneLib2/SceneLib2/scenelib2/monoslam.cpp:1584:94: required from here
/usr/local/include/pangolin/var/varvalue.h:100:23: error: ‘class pangolin::VarValue’ has no member named ‘str’
this->str = (VarValueTstd::string*)this;
^
/usr/local/include/pangolin/var/varvalue.h:103:23: error: ‘class pangolin::VarValue’ has no member named ‘str’
this->str = str_ptr;
shall I change the line 108 of the header file varvalue.h
VarValueTstd::string* str_ptr;
to
VarValueTstd::string* str;
if not what should I do?
Dear author,
When I compile the example, I have the following errors,
libscenelib2.so: undefined reference to `glutBitmapHelvetica12'
libscenelib2.so: undefined reference to `glutBitmapCharacter'
libscenelib2.so: undefined reference to `glutBitmapHelvetica18'
Could you help me?
Best Regards,
Jack
I want to look details in your blog, but have not access, thank you.
hi,
i' m in ubuntu 14.04, when running the example, i got "core dumped" after activate the "Toggle Tracking" button.
cmake and make process has no problem.
need help~~ thank you~~
Initialise Manual Feature button is not supported yet.
Thanks for this amazing work leading the trend for monocular SLAM!
I found two possible bugs in the part that normalizing the quaternion after EKF. Please check and correct me if I was wrong.
xvnormRES_(3) = Tempqb.w();
xvnormRES_(4) = Tempqb.x();
xvnormRES_(5) = Tempqb.y();
xvnormRES_(6) = Tempqb.z();
When I run the Scenlib2, the quaternion norm is increasing by the time, this value is close to 1 during a short time, so the performance is not infected significantly. But when running in a long period, this could be a serious problem.
Detected features are slightly different to the original version's.
A dummy question:
Can monocular SLAM provide scale information?
Delete Feature button is not supported yet.
Hi,
I am trying to run examples/MonoSlamSceneLib1 on mac osx 10.10. After building sucsessfully I get this:
Tyler@Tylers-MBP ~/dev/SceneLib2/SceneLib2/BUILD/examples: ./MonoSlamSceneLib1
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: provided directory doesn't exist!
[1] 81348 abort ./MonoSlamSceneLib1
I have no clue what that error actually means ( what directory? ) and googling didn't help. Maybe you would know what to do with it?
update:
When I open the file by double clicking it, I also get:
Unable to open '../../data/SceneLib2.cfg' for configuration data
in addition to the above. The file is there, I can open it with vim and the permissions are 777.
Thanks for your attention,
Petr
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.