Introduction to opencv

The opencv package contains graphics libraries mainly aimed at real-time computer vision.

This package is known to build and work properly using an LFS-8.1 platform.

Package Information

Additional Downloads

opencv Dependencies


CMake-3.9.4 and UnZip-6.0



apache-ant-1.10.1, Doxygen-1.8.13, Java-, Python-2.7.14, Cuda, Eigen, OpenEXR, GCD, GDAL, GigEVisionSDK, JACK, libdc1394, libgphoto2, NumPy, OpenNI, PlanetUML, PvAPI, Threading Building Blocks (TBB), UniCap, VTK - The Visualization Toolkit, and XIMEA

User Notes:

Installation of opencv

If the optional Integrated Performance Primitives (IPP) package has been downloaded, put it in place so the cmake script does not try to download it again:

ipp_file=ippicv_2017u2_lnx_intel64_20170418.tgz &&
ipp_hash=$(md5sum ../$ipp_file | cut -d" " -f1) &&
ipp_dir=.cache/ippicv                           &&

mkdir -p $ipp_dir &&
cp ../$ipp_file $ipp_dir/$ipp_hash-$ipp_file

If needed, unpack the additional modules package:

tar xf ../opencv_contrib-3.3.0.tar.gz

Install opencv by running the following commands:

mkdir build &&
cd    build &&

cmake -DCMAKE_INSTALL_PREFIX=/usr      \
      -DCMAKE_BUILD_TYPE=Release       \
      -DENABLE_CXX11=ON                \
      -DBUILD_PERF_TESTS=OFF           \
      -DWITH_XINE=ON                   \
      -DBUILD_TESTS=OFF                \
      -DCMAKE_SKIP_RPATH=ON            \
      -Wno-dev  ..                     &&

The package does not come with an operable test suite.

Now, as the root user:

make install             &&

case $(uname -m) in
  x86_64) ARCH=intel64 ;;
       *) ARCH=ia32    ;;
esac                     &&

cp -v 3rdparty/ippicv/ippicv_lnx/lib/$ARCH/libippicv.a /usr/lib &&
unset ARCH

Command Explanations

-DWITH_XINE=ON: This option instructs the make procedure to use xine-lib-1.2.8.

-DENABLE_PRECOMPILED_HEADERS=OFF: This option is needed for compatibiiity with gcc-6.1 and later.

-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-3.3.0/modules: instructs the build system to build the additional modules.

cp -v 3rdparty/.../libippicv.a /usr/lib: This command installs a 3rdparty library.


Installed Programs: opencv_annotation, opencv_createsamples, and opencv_traincascade
Installed Libraries: libippicv.a,,,,,,,,,,,,,, libopencv_ts.a,,, and
Installed Directories: /usr/include/opencv{,2} and /usr/share/OpenCV

Last updated on 2017-10-15 13:23:25 -0500