Monday 29 February 2016

Using OpenMVG

OpenMVG is a great library on multiple view geometry. It could be used as a stand alone library like OpenCV. These are the steps to follow

Install OpenMVG following the instruction here.
After installation is finished, follow the "Using OpenMVG as a third party library dependency in cmake" session in the installation guide.

Like what is done in the examples, eg here, include the header files and namespace in your source code. Note that the namespace must be used, eg for Image<RGBColor> image;, use using namespace openMVG::image;

For another instance, to use PointFeature defined in "openMVG/features/features.hpp", not only you should include the header file, but also have to add the name space of features, using namespace openMVG::features;

You also have to enable the support for c++11 by adding the code in cmakeList

IF(CMAKE_COMPILER_IS_GNUCC)
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
ELSE()
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ENDIF()

There seems to be a bug in the non free module, according to here.

No comments:

Post a Comment