Ubuntu18.04源码编译OpenCV

先来一段度娘的介绍信:


OpenCV是一个基于BSD许可(开源)发行的跨平台计算机视觉和机器学习软件库,可以运行在Linux、Windows、Android和Mac OS操作系统上。 [1]  它轻量级而且高效——由一系列 C 函数和少量 C++ 类构成,同时提供了Python、Ruby、MATLAB等语言的接口,实现了图像处理和计算机视觉方面的很多通用算法。

OpenCV用C++语言编写,它具有C ++,Python,Java和MATLAB接口,并支持Windows,Linux,Android和Mac OS,OpenCV主要倾向于实时视觉应用,并在可用时利用MMX和SSE指令, 如今也提供对于C#、Ch、Ruby,GO的支持

应用领域

1、人机互动

2、物体识别

3、图像分割

4、人脸识别

5、动作识别

6、运动跟踪

7、机器人

8、运动分析

9、机器视觉

10、结构分析

11、汽车安全驾驶


opencv-4.0.1安装环境:

  • OS:VirtualBox Ubuntu 18.04 64 bit

安装依赖:

sudo apt install -y build-essential cmake git pkg-config libgtk2.0-dev libopenexr-dev 
sudo apt install -y gfortran libblas-dev liblapack-dev libeigen3-dev 
sudo apt install -y python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev libjasper-dev 
sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo apt install -y libavcodec-dev libavformat-dev libswscale-dev libavutil-dev libavresample-dev libxvidcore-dev libx264-dev libv4l-dev
sudo apt install -y \
        libx264-dev \
        mesa-utils \
        libgtk2.0-dev \
        libxvidcore-dev \
        yasm \
        libxine2-dev \
        libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
        libv4l-dev \
        libfaac-dev \
        libmp3lame-dev \
        libopencore-amrnb-dev \
        libtheora-dev \
        libvorbis-dev \
        ffmpeg \
        libeigen3-dev libeigen3-doc \
		liblapack-dev \
        tesseract-ocr \
        tesseract-ocr-jpn \
        libgflags-dev \
        libleptonica-dev \
        libtesseract-dev \
        gphoto2 \
        liblapacke-dev \
        libgoogle-glog-dev \
        libprotobuf-dev \
        libprotoc-dev \
        protobuf-compiler \
        ccache \
        libgphoto2-dev \
        libavresample-dev \
        libatlas-base-dev \
        gfortran

下载源码:

  Ubuntu18.04源码编译OpenCV_第1张图片

解压源码:

unzip tarball/opencv-4.0.1.zip
unzip tarball/opencv_contrib-4.0.1.zip

编译源码:

进入opencv-4.0.1,执行 mkdir build

cd opencv-4.0.1
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.0.1/modules -D OPENCV_GENERATE_PKGCONFIG=YES -D WITH_1394=OFF ..

Ubuntu18.04源码编译OpenCV_第2张图片

执行:make -j8

 

你可能感兴趣的:(多媒体,嵌入式系统)