Skip to Content
Building Computer Vision Projects with OpenCV 4 and C++
book

Building Computer Vision Projects with OpenCV 4 and C++

by David Millan Escriva, Prateek Joshi, Vinicius G. Mendonca, Roy Shilkrot
March 2019
Intermediate to advanced
538 pages
13h 38m
English
Packt Publishing
Content preview from Building Computer Vision Projects with OpenCV 4 and C++

3D reconstruction and visualization

Having obtained the tracks in principle, we need to align them in a data structure that OpenCV's SfM module expects. Unfortunately, the sfm module is not very well documented, so this part we have to figure out on our own from the source code. We will be invoking the following function under the cv::sfm:: namespace, which can be found in opencv_contrib/modules/sfm/include/opencv2/sfm/reconstruct.hpp:

void reconstruct(InputArrayOfArrays points2d, OutputArray Ps, OutputArray points3d, InputOutputArray K, bool is_projective = false);

The opencv_contrib/modules/sfm/src/simple_pipeline.cpp file has a major hint as to what that function expects as input:

static voidparser_2D_tracks( const std::vector<Mat> &points2d, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning OpenCV 4 Computer Vision with Python 3 - Third Edition

Learning OpenCV 4 Computer Vision with Python 3 - Third Edition

Joseph Howse, Joe Minichino
Modern CMake for C++

Modern CMake for C++

Rafał Świdziński

Publisher Resources

ISBN: 9781838644673Supplemental Content