Ubuntu 12.04下安装OpenCV 2.4.5总结

learningCV 2013-06-29

系统配置:Ubuntu 12.04

安装步骤:

1.官网下载OpenCV2.4.5  http://opencv.org/

解压到home/用户名/opencv2.4.5

2.安装cmake

$sudo apt-get install cmake

3.编译opencv

(1)在刚才opencv的解压目录下新建build文件夹

$cd ~/opencv2.4.5

$mkdir build

$cd build

$cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON ..

(2)运行makefile(注:该过程持续时间较长)

$make

$sudo make install

4.测试是否安装成功

$cd ~/opencv2.4.5/samples/c

$g++ `pkg-config --cflags opencv` -o mydelaunay delaunay.c `pkg-config --libs opencv`

注:pkg-config --cflags opencv两边的`是Esc下面那个

相关推荐

greent00 / 0评论 2020-05-29