Under ubuntu16.04, the notebook comes with a camera to compile and run PTAM

Under ubuntu16.04, the notebook comes with a camera to compile and run PTAM

Please indicate the link for reprint: https://i.cnblogs.com/EditPosts.aspx?postid=9014147

Personal email: [email protected]

Beihang Flight Control Integration Technology Key Laboratory


 

 

 

PTAM is an open source algorithm for visual slam and has been applied to augmented reality. The code is completely open source and can be obtained from github: address

Author's 2008 article Parallel tracking and mapping for Small AR workspaces

It supports compiling and running on multiple systems. You can get some installation tutorials on other systems on the author's project homepage. The author's homepage: http://www.robots.ox.ac.uk/~gk/

I mainly try to compile and install ptam on ubuntu16.04.

specific installation process

A dependency library installation


 

1 Install the build tool

 

sudo apt-get update
sudo apt-get install build-essential cmake pkg-config

 

2 Update the C++ library

 

sudo apt-get install libboost-dev libboost-doc

 

3 Install low-level libraries for linear algebra

 

sudo apt-get install liblapack-dev libblas-dev

 

4 Image IO and camera driver

 

sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev libv4l-dev

 

5 video IO, codec and video display library

 

 

 

 

sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libpostproc-dev libswscale-dev libavdevice-dev libsdl-dev
sudo apt-get install libgtk2.0-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev 

6 OpenGL

 

sudo apt-get install mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev freeglut3-de

 

Two, we have to install three third-party libraries of ptam


 

TooN libcvd Gvars3 has dependencies, so it must be installed in order, and their version problems may also cause the installation to fail. Therefore, the following versions are recommended. I have verified that they can be compiled successfully, at https:/ /github.com/slowlythinking/PTAM (which also contains the source code of PTAM, but there are problems);

TooN library must be installed first

Get these three libraries from git

git clone https://github.com/slowlythinking/PTAM.git

Then delete the PTAM folder, there is a problem with the files in it, we have to recompile.

TooN:

cd ShowN

sudo ./configure && make && sudo make install

cd ../

libcvd:

 

cd libcvd

sudo ./configure --without-ffmpeg --without-v4lbuffer --without-dc1394v1 --without-dc1394v2 

sudo make

sudo make install

cd ../

 

Gvars3:

 

sudo git clone git : //github.com/edrosten/gvars.git

cd gvars

sudo ./configure --disable-widgets

sudo make

sudo make install

 

Finally, make the installed libs take effect

cd ../
sudo ldconfig

 

The installation of opencv can be installed by yourself according to the online tutorial.

Three compiled PTAM


 

Enter the previous PTAM directory and get the latest ptam source code from github

git clone https://github.com/Oxford-PTAM/PTAM-GPL.git ptam cd ptam

git checkout feature/Linuxmint15
cd Src
make

 

Successful compilation will get CameraCalibrator, PTAM two executable files, CameraCalibratorused to pre-calibrate the camera

Four-run PTAM


 

First you need to download a checkerboard image, perform camera calibration,

Go to the Src directory in the previous step, execute ./CameraCalibrator , and use the CapFrame in the upper right corner of the figure below to take frames, at least 4 frames from different angles. After taking the frames, press Optimize to calculate the camera essential matrix (focal length). and other camera parameters). Including the focal length f, the camera center cx, cy, and two distortion coefficients.

./CameraCalibrator

 

 

 

After the calibration is completed, the output gets a camera.cfg file, and then you can execute ./PTAM

After CameraCalibrator runs PTAM, the user needs to select two frames as the initialized data input due to the need to initialize the map at the beginning of the operation. The specific operation steps are to press the space bar, and the program will calculate the FAST corner of this frame and display it on the image. Then do a slight pan, press the space bar again, and the initialization is complete. At the top right of the interface are Draw AR off and View Map on, which are used to display virtual items (here, four eyes) on the plane and map information created by the software. The following is a screenshot of the operation

 

 

Reference tutorial:

https://blog.csdn.net/shhu1993/article/details/47783077

https://blog.csdn.net/jinghouxiang/article/details/46998235

http://blog.sina.com.cn/s/blog_7b83134b0102wabk.html

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326368285&siteId=291194637