Installing OpenCV in Ubuntu 14.10

后端 未结 3 1720
慢半拍i
慢半拍i 2020-12-30 16:26

I\'m trying to install OpenCV in Ubuntu 14.10 according to instruction. I installed all mentioned dependencies, but when I\'m trying to run make I get such erro

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-30 17:23

    Installing OpenCV from the Ubuntu repositories is a good choice for the most cases, but sometimes you need build OpenCV from sources yourself.

    For example, if you need OpenCV's non-free functionality, or want to contribute to this project (you should use the latest version to create pull request), or want to change something (yes, OpenCV can also contain bugs).

    Possible solution is building ffmpeg (it's rather simple) - I really don't understand why Debian/Ubuntu prefers libav without alternative.

    For installing ffmpeg you should download its sources from official site or clone GIT repository (git://source.ffmpeg.org/ffmpeg.git), then enter source directory and run

    ./configure --enable-shared --disable-static
    make
    sudo make install

    you can also add other parameters to configure. You can build static libraries too, but OpenCV can't be built with static ffmpeg libraries (now I don't know why).

    After this you can download OpenCV sources from OpenCV site or clone GitHub repository (OpenCV repository), create build folder and run from it the following:

    cmake PATH_TO_SOURCES -DCMAKE_BUILD_TYPE=Release
    make
    sudo make install

    Of course, PATH_TO_SOURCES must be actual path to your OpenCV sources.

    After these steps you have working latest OpenCV build in your system.

提交回复
热议问题