在VMware上安装Debian和OpenCV2.4.6

  1. 下载并安装VMware WorkStation.
  2. 下载Debian镜像:http://cdimage.debian.org/debian-cd/8.5.0/multi-arch/iso-cd/debian-8.5.0-amd64-i386-netinst.iso
  3. 一路安装即可。
  4. 使用非root用户进入系统
  5. sudo可以让非root用户具有管理员的权限,安装好的Debian后还不能使用sudo,需要使用root用户登陆后安装sudo命令。切换到root用户下安装sudo
user1@debian:~$ su root
Password: 
  1. 安装sudo
root@debian:/home/user1# apt-get install sudo
  1. 安装后,就可以给你的帐号设置管理员权限了
root@debian:/home/user1# vi /etc/sudoers
user1 ALL=(ALL:ALL) ALL #这里的user1就是你要给予一定权限的用户
  1. 安装opencv的依赖
user1@debian:/home/user1# sudo apt-get udpate
user1@debian:/home/user1# sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
  1. 获取OpenCV源代码,并切换到tag2.4.6
user1@debian:~/work git clone https://github.com/opencv/opencv.git
user1@debian:~/work$ git checkout 2.4.6
  1. 编译
user1@debian:~/work/opencv-2.4.6/release$ cmake -D  CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
user1@debian:~/work/opencv-2.4.6/release$ make
user1@debian:~/work/opencv-2.4.6/release$ sudo make install
  1. 如果不关心opencv版本,可执行下面命令,替代8,9,10步骤。
user1@debian:~/work$ sudo apt-get install libopencv-dev
引用
  • http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation

你可能感兴趣的:(在VMware上安装Debian和OpenCV2.4.6)