ViSP sample code used as code snippet in ViSP doxygen documentation.
This project uses ViSP that needs to be build with the following as 3rd-parties:
- OpenCV
- librealsense
- libxml2
- PCL
-
On ubuntu
-
Install required packages:
$ sudo apt-get update $ sudo apt-get install pkg-config libopencv-dev libxml2-dev libpcl-dev
-
Install librealsense from source following these instructions
-
-
On OSX
$ brew update; brew upgrade
$ brew install opencv librealsense libxml2 pcl
See ViSP installation from source tutorials.
$ cd $VISP_WS
$ git clone https://github.com/lagadic/visp.git
$ mkdir $VISP_WS/visp-build
$ cd $VISP_WS/visp-build
$ cmake ../visp -DCMAKE_INSTALL_PREFIX=/tmp/usr/local
$ make -j4 install
Once ViSP is build, you can build visp_sample
project using one of the 5 different ways that are given in the next sections.
$ cd $ViSP_WS
$ git clone https://github.com/lagadic/visp_sample
$ mkdir visp_sample-build
$ cd visp_sample-build
$ cmake ../visp_sample -DVISP_DIR=$ViSP_WS/visp-build
$ make -j4
$ cd $ViSP_WS/visp_sample
$ make -j4 -f Makefile.visp-config VISP_INSTALL_PREFIX=$ViSP_WS/visp-build
$ make -j4 -f Makefile.visp-config clean
$ cd $ViSP_WS
$ git clone https://github.com/lagadic/visp_sample
$ mkdir visp_sample-build
$ cd visp_sample-build
$ cmake ../visp_sample -DVISP_DIR=/tmp/usr/local/lib/cmake/visp
$ make -j4
$ cd $ViSP_WS/visp_sample
$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/tmp/usr/local/lib/pkgconfig
$ make -j4 -f Makefile.visp.pc
$ make -j4 -f Makefile.visp.pc clean
$ cd $ViSP_WS/visp_sample
$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/tmp/usr/local/lib/pkgconfig
$ make -j4 -f Makefile.visp-config VISP_INSTALL_PREFIX=/tmp/usr/local
$ make -j4 -f Makefile.visp-config clean