Compiling regard3D

来源:互联网 发布:拖动拼图验证码java 编辑:程序博客网 时间:2024/06/15 10:42

Compiling

If you would like to compile Regard3D by yourself, you can, since it is an open-source project. However, some experience with C/C++ and CMake is required.

I will only describe here how to compile Regard3D itself, not the third-party executables or libraries. Please see their respective homepages.

 

Please note: The following guide is outdated. Unfortunately I don't have time to keep it up to date, this text can still be used as a guideline. The most notable difference to recent versions of Regard3D is that you need to compile OpenMVG as a library, and the parameter -DOPENMVG_SRC_DIR=... is not required anymore.

For Windows, the scripts in my repository build-scripts might give you a easier start into compiling Regard3D:

https://github.com/rhiestan/build-scripts

They might also be interesting to other platforms as well.

 

Compiling on Linux

Compiling Regard3D shouldn't be too hard, as all third-party libraries with the exception of ceres are available as packages. I am using Ubuntu 14.04, with other distributions the commands and package names might be different.

Installing third-party libraries (maybe incomplete):

sudo apt-get install build-essential cmake libboost-all-dev libeigen3-dev libwxgtk3.0-dev libopencv-dev libopenscenegraph-dev libpcl-all libsuitesparse-dev

Download and install the ceres solver (see homepage on how to compile).

Donwload and extract my slightly adjusted version of OpenMVG from the download section of the Regard3D project (the file is called openMVG-xx-regard3d.7z). Download the Regard3D source code either from the download section of the Regard3D project or from the Regard3D github project page.

Issue the commands:

mkdir buildcd buildcmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCERES_DIR=/ceres/install/dir -DOPENMVG_SRC_DIR=/path/to/openmvg/src -DUSE_SSE2=TRUE ../src
make

Adjust the paths as necessary.

 

Compiling on Windows and OS X

Compiling on these platforms is very similar to compiling on Linux, with the exception that all third-party libraries must be compiled, which is a big undertaking. Please don't try it if you have not at least 1-2 days to spare and some perseverance. To give you an idea, this is my cmake command for compilation on Windows with MinGW (the shell variables are set in a script beforehand):

cmake -Wno-dev -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DMSYS=TRUE -DOPENMVG_SRC_DIR=$OPENMVG_SRC_DIR -DUSE_SSE2=TRUE -DTARGET_ARCHITECTURE="generic" -DR3D_REMOVE_ADDITIONAL_LIBRARIES=TRUE -DNLOPT_ROOT_DIR=$NLOPT_ROOT_DIR -DR3D_USE_OSG_STATIC=TRUE -DR3D_ADDITIONAL_LINK_LIBRARIES="$R3D_ADDITIONAL_LINK_LIBRARIES" -DR3D_ALT_wxWidgets_INCLUDE_DIRS="$R3D_ALT_wxWidgets_INCLUDE_DIRS" -DBLAS_INCLUDE_DIR=$BLAS_INCLUDE_DIR -DLAPACK_INCLUDE_DIR=$LAPACK_INCLUDE_DIR -DBLAS_LIBRARIES=$BLAS_LIBRARIES -DLAPACK_LIBRARIES=$LAPACK_LIBRARIES -DR3D_USE_BLAS=TRUE -DCERES_DIR=$CERES_DIR -DSUITESPARSE_DIR=$SUITESPARSE_DIR -DFLANN_ROOT=$FLANN_ROOT -DOpenCV_DIR=$OpenCV_DIR -DOpenCV_STATIC=ON -DwxWidgets_ROOT_DIR=$wxWidgets_ROOT_DIR -DwxWidgets_CONFIG_EXECUTABLE=$wxWidgets_CONFIG_EXECUTABLE -DZLIB_ROOT=$ZLIB_ROOT -DPNG_PNG_INCLUDE_DIR=$PNG_PNG_INCLUDE_DIR -DPNG_LIBRARY=$PNG_LIBRARY -DTIFF_INCLUDE_DIR=$TIFF_INCLUDE_DIR -DTIFF_LIBRARY=$TIFF_LIBRARY -DJPEG_INCLUDE_DIR=$JPEG_INCLUDE_DIR -DJPEG_LIBRARY=$JPEG_LIBRARY -DOSG_DIR=$OSG_DIR -DOPENTHREADS_LIBRARY=$OPENTHREADS_LIBRARY -DOSG_PLUGINS="$OSG_PLUGINS" -DEIGEN3_INCLUDE_DIR=$EIGEN3_INCLUDE_DIR -DPCL_DIR=$PCL_DIR ../src

 

Some tips concerning third-party libraries

  • Please use a new version of wxWidgets (>= 2.9). Version 2.8 might also work, but I recommed to use 3.0 and up
  • PCL 1.7.1 has a bug in writing PLY surfaces, and it will lead to crashes in Regard3D, for example during colorizing vertices of a surface. Please use PCL 1.7.2 (which is the newest at the time of writing)
原创粉丝点击