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.3 platform.
Download (HTTP): https://sourceforge.net/projects/opencvlibrary/files/opencv-unix/3.4.2/opencv-3.4.2.zip
Download MD5 sum: 9e9ebe9c1fe98c468f6e53f5c3c49716
Download size: 87 MB
Estimated disk space required: 555 MB
Estimated build time: 2.4 SBU (using parallelism=4)
Optional file (x86_64 only; will be downloaded when running cmake if not present): https://raw.githubusercontent.com/opencv/opencv_3rdparty/bdb7bb85f34a8cb0d35e40a81f58da431aa1557a/ippicv/ippicv_2017u3_lnx_intel64_general_20180518.tgz
Optional additional modules: https://github.com/opencv/opencv_contrib/archive/3.4.2/opencv_contrib-3.4.2.tar.gz
FFmpeg-4.0.2, gst-plugins-base-1.14.2, GTK+-3.22.30, JasPer-2.0.14, libjpeg-turbo-2.0.0, libpng-1.6.35, LibTIFF-4.0.9, libwebp-1.0.0, v4l-utils-1.14.2, and xine-lib-1.2.9
apache-ant-1.10.4, Doxygen-1.8.14, Java-10.0.2, Python-2.7.15, 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: http://wiki.linuxfromscratch.org/blfs/wiki/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_2017u3_lnx_intel64_general_20180518.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.4.2.tar.gz
Install opencv by running the following commands:
sed -i 's/CV_RGB/cv::Scalar/' src/filter/facebl0r/facebl0r.cpp &&
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 \
-DENABLE_PRECOMPILED_HEADERS=OFF \
-DCMAKE_SKIP_RPATH=ON \
-DBUILD_WITH_DEBUG_INFO=OFF \
-Wno-dev .. &&
make
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
sed ... facebl0r.cpp: This command fixes a build problem with the current opencv dependency.
-DWITH_XINE=ON: This option
instructs the make procedure to use xine-lib-1.2.9.
-DENABLE_PRECOMPILED_HEADERS=OFF:
This option is needed for compatibiiity with gcc-6.1 and later.
-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-3.4.2/modules:
instructs the build system to build the additional modules.
cp -v 3rdparty/.../libippicv.a /usr/lib: This command installs a 3rdparty library.
Last updated on 2018-08-21 13:14:23 -0700