安装TX2 opencv (自己手打)

下载opencv

wget https://github.com/opencv/opencv/archive/3.4.0.zip

安装依赖包

sudo apt-get install \

libglew-dev \

libtiff5-dev \

zlib1g-dev \

libjpeg-dev \

libpng12-dev \

libjasper-dev \

libavcodec-dev \

libavformat-dev \

libavutil-dev \

libpostproc-dev \

libswscale-dev \

libeigen3-dev \

libtbb-dev \

libgtk2.0-dev \

pkg-config


安装依赖环境

sudo apt-get install python-dev python-numpy python-py python-pytest

sudo apt-get install python3-dev python3-numpy python3-py python3-pytest

编译opencv

cd 。。。

mkdir build

cd build

cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_PNG=OFF \
    -DBUILD_TIFF=OFF \
    -DBUILD_TBB=OFF \
    -DBUILD_JPEG=OFF \
    -DBUILD_JASPER=OFF \
    -DBUILD_ZLIB=OFF \
    -DBUILD_EXAMPLES=ON \
    -DBUILD_opencv_java=OFF \
    -DBUILD_opencv_python2=ON \
    -DBUILD_opencv_python3=ON \
    -DENABLE_PRECOMPILED_HEADERS=OFF \
    -DWITH_OPENCL=OFF \
    -DWITH_OPENMP=OFF \
    -DWITH_FFMPEG=ON \
    -DWITH_GSTREAMER=ON \
    -DWITH_GSTREAMER_0_10=OFF \
    -DWITH_CUDA=ON \
    -DWITH_GTK=ON \
    -DWITH_VTK=OFF \
    -DWITH_TBB=ON \
    -DWITH_1394=OFF \
    -DWITH_OPENEXR=OFF \
    -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-8.0 \
    -DCUDA_ARCH_BIN=6.2 \
    -DCUDA_ARCH_PTX="" \
    -DINSTALL_C_EXAMPLES=ON \
    -DINSTALL_TESTS=ON \
    -DOPENCV_TEST_DATA_PATH=../opencv_extra/testdata \
    ../

sudo nvpmodel -m 0 # 切换工作模式到最大

sudo ~/jetson_clocks.sh # 强制开启风扇最大转速

sudo make -j4

sudo make install 

你可能感兴趣的:(安装TX2 opencv (自己手打))