How to install SceneLib 1.0 on Ubuntu 10.04

posted 23 Jul 2014, 17:51 by Hanme Kim   [ updated 23 Jul 2014, 18:12 ]


SceneLib is an open-source C++ library for SLAM designed and implemented by Andrew Davison with additional work by Paul Smith. SceneLib 1.0 is released with full source code under the GNU Lesser Public License (LGPL). SceneLib is a generic SLAM library in principle, with a modular approach to specification of the details of robot and sensor types. However it also has specialised components to permit real-time vision-based SLAM with a single camera (MonoSLAM) and the design is optimised towards this type of application. Available alongside the SceneLib library is source code which compiles to the executable program MonoSLAMGlow. This is an example application of MonoSLAM which can take images in real-time from an IEEE1394 camera or off-line from a disk sequence and perform sparse monocular SLAM. Some of the more advanced techniques we have published such as patch warping are not implemented in this release.

As SceneLib is a good starting point to study about Visual SLAM that I am really interested in, I have decided to delve into the code level details. But, when I tried to compile it following the instructions described in its website and readme files, I have got some errors and issues, and it seems like that many things have been changed regarding to the Linux distribution, script and compiler since SceneLib was released long time ago. So, I needed to spend time and effort mostly googling for solving them, and, as I managed to compile and run it now, I am writing this to share my experience with you all.

1. Install the basic development tools on Ubuntu 10.04
As I need a modern Linux distribution with standard programming tools installed, I chose Ubuntu 10.04 and installed the basic development tools using the below command.

$ sudo apt-get install build-essential

2. Install OpenGL and GLUT
Before you install OpenGL and GLUT, please make sure you have the gcc compiler installed first.

$ sudo apt-get install g++
$ sudo apt-get install freeglut3 freeglut3-dev libglut3 libglut3-dev libglew1.5 libglew1.5-dev libglu1-mesa libglu1-mesa-dev libgl1-mesa-glx libgl1-mesa-dev mesa-common-dev

3. Install Pthread library
You can install the Pthread library using the below command.

$ sudo apt-get install libpthread-stubs0 libpthread-stubs0-dev

4. Install libraw1394, libraw1394-dev, libdc1394 and libdc1394-dev
Although there is a comment that the new version 2.* of libdc1394 will not work with VW and other software so need to get the older version 1.*, I just installed the latest version of it as I couldn't find the older one, and disabled the IEEE1394 functionality to use the offline mode only.

$ sudo apt-get install libraw1394-11 libraw1394-dev libraw1394-doc
$ sudo apt-get install libdc1394-22-dbg libdc1394-utils libdc1394-22 libdc1394-22-dev libdc1394-22-doc

5. Install Xforms Toolkit
To do this, please follow the instruction described in

[Update on 13/06/2012]
Or.. download the XForms source package called xforms.latest_stable.tar.gz, install libjpeg62-dev using the Synaptic Package Manager, and follow the below instructions.

$ sudo apt-get install libxpm-dev
$ sudo apt-get install libopenjpeg-dev

$ cd xforms-1.0.93sp1
$ ./configure
$ make
$ sudo make install

6. Download SceneLib
You can download SceneLib and all necessary components from the SceneLib’s download page.

7. Unpack SceneLib
Unpack the downloaded files to create the following directories which by default should be at the same level (they will look for each other): glow_104, MonoSLAMGlow, TestSeqMonoSLAM, SceneLib and VW34.

$ sudo tar xvfz vw34.tar.gz
$ sudo tar xvfz scenelib.tar.gz
$ sudo tar xvfz glow_104.tar.gz
$ sudo tar xvfz monoslamglow.tar.gz
$ sudo tar xvfz testseqmonoslam.tar.gz

8. Compile GLOW Toolkit
If you have followed the instructions so far correctly, you shouldn't have a problem to compile the GLOW Toolkit using the below commands.

$ cd glow_104
$ cd glow_src
$ sudo make
$ sudo ln -s libglow.a.1.0.2 libglow.a

9. Modify 'VW34/'
Comment out 'X', 'XFORMS' and 'Firewire' components.

# X
#AC_CHECK_HEADERS(X11/Xlib.h X11/Xutil.h,
#         [libx=yes],
#                [libx=no; AC_MSG_WARN(**** x libraries not found **** libVWX.a will not be compiled)])
AM_CONDITIONAL(X, test x$libx = xyes)

#         [xforms=yes],
#                [xforms=no; AC_MSG_WARN(**** xforms not found **** libVWXForms.a will not be compiled)])
AM_CONDITIONAL(XFORMS, test x$xforms = xyes)

# Firewire
#AC_CHECK_LIB(dc1394_control, dc1394_dma_setup_capture,
#            [firewire=yes],
#     [firewire=no; AC_MSG_WARN(**** libdc1394 not found **** libVWFirewire.a will not be compiled)], 
#     [-lraw1394])
AM_CONDITIONAL(FIREWIRE, test x$firewire = xyes) 

Correct the GTK path.


Comment out the Qt component.

# Qt
AM_CONDITIONAL(QT, test x$have_qt = xyes)

10. Add '#include <cstdlib>'
To prevent various error messages, please add '#include <cstdlib>' on the top of the listed files below.
  • VW34/VW/Image/imagebase.h
  • VW34/VW/IOBasics/miscioutils.cpp
  • VW34/VW/GeomObjects/rotationmatrix.cpp
  • VW34/VW/GeomObjects/calibrationtable.cpp
  • VW34/VW/GeomObjects/operations.cpp
  • VW34/VW/Sequencers/sequencerbase.cpp
  • VW34/VW/GeomCompute/delaunay.cpp
  • VW34/VW/GeomCompute/line2dcomputeguisac.cpp
  • VW34/VW/GeomCompute/fmplanarcomputenonlinear.cpp
  • VW34/VW/Improc/edgel.h
  • VW34/VWGL/Display/awfface.cpp
  • SceneLib/Scene/init_feature.cpp

11. Add '#include <cstring>'
To prevent various error messages, please add '#include <cstring>' on the top of the listed files below.
  • VW34/VW/Image/imageconversions.cpp
  • VW34/VW/Sequencers/sequencermovie.cpp
  • VW34/VWGL/Display/awfmaterial.cpp

12. Add '#include <cstdio>'
To prevent various error messages, please add '#include <cstdio>' on the top of the listed files below.
  • VW34/VWGL/Interface/slider.cpp

13. Add '#include <typeinfo>'
To prevent various error messages, please add '#include <typeinfo>' on the top of the listed files below.
  • SceneLib/Scene/scene_single.cpp

14. Modify 'VW34/VW/GeomObjects/point3d.h' file
Add Ln148 and Ln149 as below.


 Point3D operator+(const Point3D &p1, const Point3D &p2);
 Point3D operator/(const Point3D &p1, const double a);

 typedef Point3D Vector3D;

}; // end namespace VW 

15. Modify ‘VW34/VW/GeomObjects/point2d.h’ file
Add Ln 134 and Ln 135 as below.


 Point2D operator+(const Point2D &p1, const Point2D &p2);
 Point2D operator/(const Point2D &p1, const double a);

 typedef Point2D Vector2D;

}; // end namespace VW 

16. Modify ‘VW34/VW/GeomObjects/lineseg2d.h’ file
Add Ln 155 and Ln 156 as below.


 std::ostream& operator<<(std::ostream& s, const LineSeg2D &ls);
 std::istream& operator>>(std::istream& s, LineSeg2D &ls);

}; // end namespace VW 

17. Modify ‘VW34/VW/GeomObjects/lineseg3d.h’ file
Add Ln 93, Ln 94, Ln 95 and Ln 96 as below.


 double Norm2(const LineSeg3D &ls);
 double Norm(const LineSeg3D &ls);
 std::ostream& operator<<(std::ostream& s, const LineSeg3D &ls);
 std::istream& operator>>(std::istream& s, LineSeg3D &ls);

 // Other funcs
 VW::LineSeg3D operator+(const VW::LineSeg3D &line, const VW::Point3D &point);
 VW::LineSeg3D operator-(const VW::LineSeg3D &line, const VW::Point3D &point);

}; // end namespace VW 

18. Modify ‘VW34/VW/Sequencers/sequencerbase.h’ file
Change Ln 127 as below.

 void CopyImage(ImType& image, unsigned int which_channel=0) { }; 

19. Modify ‘VW34/VW/Improc/matchdata.h’ file
Add Ln 72 and Ln 73 as below.

 std::ostream & operator << (std::ostream & s, const MatchData & m);
 std::istream & operator >> (std::istream & s, MatchData & m);

 /** Sort into order of increasing match score. */
 void SortAscending(std::vector<MatchData>& list);
 /** Sort into order of decreasing match score. */
 void SortDescending(std::vector<MatchData>& list); 

20. Compile VW34
If you have followed the instructions so far correctly, you can compile VW34 without any error.

$ cd VW34
$ ./bootstrap
$ ./configure
$ sudo make
$ sudo make install

21. Compile SceneLib
If you have followed the instructions so far correctly, you can compile SceneLib without any error.

$ cd SceneLib
$ ./configure
$ sudo make
$ sudo make install

22. Modify 'MonoSLAMGlow/Makefile' file
Remove -lVWFirewire from the line defining VWLIBS as below.


Remove -D$(OS) and -D$(ARCH) from the line defining CFLAGS as below.


Remove $(FIREWIRELIBS) from the line defining LINKFLAGS as below.


23. Compile MonoSLAMGlow
If you have followed the instructions so far correctly, you can compile MonoSLAMGlow without any problem.

$ cd MonoSLAMGlow
$ sudo make

24. Running MonoSLAMGlow in the offline mode
If you have followed the instructions so far correctly, you can run MonoSLAMGlow in the offline mode, and you should see its user interface as below.

$ ./monoslam

Now is the time to delve into the SceneLib in the code level details, good luck for all of us! :)