ubuntu14.04+caffe+opencv

opencv2.4.9安装:
1.进行系统更新
sudo apt-get update
sudo apt-get upgrade


2.安装依赖包
sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev 
cmake python-dev python-numpy python-tk libtbb-dev libeigen3-dev yasm libfaac-dev libopencore-amrnb-dev 
libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev 
sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev
 default-jdk ant libvtk5-qt4-dev
make
sudo make install




3.下载opencv2.4.9:
cd ~ 
wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip
unzip opencv-2.4.9.zip
cd opencv-2.4.9
4.生成makefile
mkdir build
cd build
cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D 
INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_VTK=ON ..
5.
make
sudo make install


6.
   Now you have to configure OpenCV. First, open the opencv.conf file with the following code:
sudo gedit /etc/ld.so.conf.d/opencv.conf
  Add the following line at the end of the file(it may be an empty file, that is ok) and then save it:
/usr/local/lib
   Run the following code to configure the library:
sudo ldconfig
    Now you have to open another file:
sudo gedit /etc/bash.bashrc
   Add these two lines at the end of the file and save it:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
Finally, close the console and open a new one, restart the computer or logout and then login again. OpenCV will not work correctly until you do this.
Now you have OpenCV 2.4.9 installed in your computer with 3D visualization, Python, Java, TBB, OpenGL, video, and Qt support.
Check out the cool Qt interface which provides image viewing capabilities with zoom, as well as the ability to save the current image with just one click.


2.安装开发所需要的一些基本的包,


sudo apt-get install build-essential
sudo apt-get install python-numpy python-scipy python-matplotlib python-sklearn python-skimage 
python-h5py python-protobuf python-leveldb python-networkx python-nose python-pandas python-gflags
 Cython ipython 
如果不可行,则可以执行:


sudo apt-get update


3.安装BLAS
sudo apt-get install libatlas-base-dev
4.安装【dependencies】任意路径下可执行
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev
 libhdf5-serial-dev libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler
5.matalab2014a安装
http://blog.csdn.net/lanbing510/article/details/41698285点击打开链接
http://www.cnblogs.com/txg198955/p/5477258.html点击打开链接


6.编译caffe
cd ./caffe-master/
cp Makefile.config.example Makefile.config
接下来就是修改配置文件Makefile.config:
将# CPU_ONLY = 1前面的#去掉 并按“tab”键,(默认从tab处执行),因为这里没有安装GPU,需要使用CPU运行。
始编译过程:
主要过程为:
sudo make all -j8
sudo make test
sudo make runtest


7.编译python wrapper
make pycaffe
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值