4
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

NVIDIA Jetson TX1でOpenCV3をビルドする

Last updated at Posted at 2016-08-09
  1. CUDAなどをインストール(JetPack参照)

  2. OpenCVをダウンロード

wget https://github.com/Itseez/opencv/archive/3.1.0.zip -O /tmp/opencv-3.1.0.zip
cd /tmp
unzip opencv-3.1.0.zip
cd opencv-3.1.0
git clone --depth 1 https://github.com/Itseez/opencv_contrib.git opencv_contrib
cd opencv_contrib
git fetch origin --tags --depth 1
git checkout 3.1.0

2. 依存パッケージのインストール

    ```bash
sudo apt-get -y -qq install cmake git libgtk2.0-dev ocl-icd-opencl-dev qt5-default
  1. ビルド設定

mkdir build && cd build
cmake ..
-DWITH_OPENGL:BOOL=ON
-DWITH_QT:BOOL=ON
-DWITH_CUDA:BOOL=ON
-DCUDA_ARCH_BIN="5.2"
-DCUDA_ARCH_PTX="5.2"
-DCMAKE_BUILD_TYPE=RelWithDebugInfo
-DCMAKE_INSTALL_PREFIX=/usr/local
-DBUILD_TESTS:BOOL=OFF
-DBUILD_PERF_TESTS:BOOL=OFF
-DWITH_FFMPEG:BOOL=OFF
-DENABLE_NEON:BOOL=ON
-DBUILD_EXAMPLES:BOOL=ON
-DINSTALL_C_EXAMPLES:BOOL=OFF
-DINSTALL_PYTHON_EXAMPLES:BOOL=ON
-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules

4. ビルド

    ```bash
make -j4
  1. インストール

sudo make install -j4
sudo ldconfig


6. 環境変数を更新

    ```bash
echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.bashrc

テスト

cd opencv-3.1.0/samples/gpu
g++ `pkg-config --libs 
4
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?