-

hey viewer, we're moving!

We are currently transitioning to a new web system, so we are not updating this wikisite anymore.

The public part of the new web system is available at http://www.ira.disco.unimib.it


PTAM

From Irawiki

Jump to: navigation, search

Contents

Compiling - Installing

This procedure was tested in Ubuntu 11.10

If you want to use live camera with V4L you should install the dev package:

sudo apt-get install libv4l-dev

Dependencies

The order of installation should be

  1. TooN
  2. libCVD
  3. GVars3

Check out the repos in your working space

export CVS_RSH=ssh
cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/toon co TooN
cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/libcvd co libcvd
git clone https://github.com/edrosten/gvars.git

Install Toon

cd TooN
./configure
sudo make install

Build and install libCVD

cd libcvd

Edit v4l2buffer.cc

vim cvd_src/Linux/v4l2buffer.cc

Substitute

#if CVD_KERNEL_MAJOR == 2 && CVD_KERNEL_MINOR == 4
       #define USE_24
       #define K24(X) X
       #define K26(X) 
#elif CVD_KERNEL_MAJOR == 2 && CVD_KERNEL_MINOR == 6
       #define K26(X) X
       #define K24(X) 
#else
       #error "Can't do v4l2 for this kernel version"
#endif

with

       #define K26(X) X
       #define K24(X)

Edit v4l1frame.h

vim cvd/Linux/v4l1frame.h

Substitute

#ifdef CVD_INTERNAL_HAVE_STRANGE_V4L2
     #include <videodevx/videodev.h>
#else
       #include <linux/videodev.h>
#endif

with

#include <linux/videodev.h>

Create fake file videodev.h

sudo echo '#include "/usr/include/libv4l1-videodev.h"' > /usr/include/linux/videodev.h
sudo echo '#include "/usr/include/linux/videodev2.h"' >> /usr/include/linux/videodev.h

Generate Makefile

./configure --without-ffmpeg --without-mmx --without-v4l1buffer --with-v4l2

Edit Makefile

vim Makefile

and add cvd_src/Linux/v4lbuffer.o to CVD_OBJS

Build the library

make
sudo make install

Build and install GVars3

cd gvars
./configure --disable-widgets
make
sudo make install

Config the libraries

ldconfig

Build PTAM (extracted from the README file)

The first step is to copy the appropriate platform build files to the PTAM source directory. Eg. for linux, copy all the files from PTAM/Build/Linux to PTAM. The Makefile can then be edited to reference any custom include or linker paths which might be necessary (depending on where the dependencies were installed.)

The second step, for Linux, is to set up the correct video source. Two files are provided, VideoSource_Linux_DV.cc and VideoSource_Linux_V4L.cc, which work with the Unibrain Fire-i and the Logitech Quickcam Pro 5000 respectively. The DV version is compiled by default; edit the Makefile to switch to the V4L version instead, if needed. Other cameras may require manual editing of the video input files, e.g. to change the ideobuffer's colourspace.

Other video source classes are available with libCVD. Finally, if a custom video source not supported by libCVD is required, the code for it will have to be put into some VideoSource_XYZ.cc file (the interface for this file is very simple.)

Before compiling, add these -llapack -lblas to the LINKFLAGS in the Makefile

vim Makefile
 LINKFLAGS = -L MY_CUSTOM_LINK_PATH -lGVars3 -lcvd -llapack -lblas

The software can then be compiled with the command

make

This builds two target executables: PTAM and CameraCalibrator.

Personal tools