Monday, February 27, 2017

open cv 3 on ubuntu


sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
sudo apt-get update
cd opencv-3.2.0/
mkdir build
cd build/
sudo apt-get install python3-dev
sudo apt-get install java-7-openjdk
sudo pip3 install --upgrade pip
sudo pip3 install numpy
export PYTHON3_EXECUTABLE=/usr/bin/python3
export PYTHON_INCLUDE_DIR=/usr/include/python3
export PYTHON_INCLUDE_DIR=/usr/include/python3.4
export PYTHON_INCLUDE_DIR2=/usr/include/x86_64-linux-gnu/python3.4m/
export PYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.4m.so
export PYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/lib/python3.4/dist-packages/numpy/core/include/
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
sudo make -j4
sudo make install

For raspberry pi 3:
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python3-dev python3-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev


export PYTHON3_EXECUTABLE=/usr/bin/python3
export PYTHON_INCLUDE_DIR=/usr/include/python3.4

export PYTHON_INCLUDE_DIR2=/usr/include/arm-linux-gnueabihf/python3.4m/
export PYTHON_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython3.4m.so
export PYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/lib/python3.4/dist-packages/numpy/core/include/
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_QT=OFF -D WITH_TBB=OFF ..
http://stackoverflow.com/questions/26371187/how-can-i-disable-opengl-support-opencv

No comments:

Post a Comment