OpenCV: Open Source Computer Vision Library
Patched4JetsonTK1
This library was patched to be built on Jetson TK1 according to https://docs.opencv.org/3.3.0/d6/d15/tutorial_building_tegra_cuda.html for persons who can not compile their programs using standard installation of opencv4tegra
package. Especially, we guess, for ROS users.
Integrated Extra Modules
The extra modules and testing framework are integrated and bundled within the library source tree to ease the build.
Resources
- Homepage: http://opencv.org
- Docs: http://docs.opencv.org/master/
- Q&A forum: http://answers.opencv.org
- Issue tracking: https://github.com/Itseez/opencv/issues
Installation
Prerequisites
universe
Ubuntu repositories
1. sudo apt-add-repository universe
sudo apt-get update
CUDA 6.5
2. Please install official CUDA 6.5 binary from nVidia
CMake 2.8.10
3. If you have no special requirements, install:
sudo apt install cmake
Otherwise you can compile the code from https://gitlab.kitware.com/cmake/cmake
python 2.7
and python 3.4
4. Have them from your package manager:
sudo apt install python-dev python3-dev python-numpy python3-numpy python-py python3-py python-pytest python3-pytest
5. Third party libraries
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
Building
Build your library using CMake
under the following command (replace /util
with the desired installation directory):
mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/util \
-DCMAKE_CXX_FLAGS=-Wa,-mimplicit-it=thumb \
-DBUILD_PNG=OFF \
-DBUILD_TIFF=OFF \
-DBUILD_TBB=OFF \
-DBUILD_JPEG=OFF \
-DBUILD_JASPER=OFF \
-DBUILD_ZLIB=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_opencv_java=OFF \
-DBUILD_opencv_python2=ON \
-DBUILD_opencv_python3=ON \
-DENABLE_NEON=ON \
-DWITH_OPENCL=OFF \
-DWITH_OPENMP=OFF \
-DWITH_FFMPEG=ON \
-DWITH_GSTREAMER=OFF \
-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-6.5 \
-DCUDA_ARCH_BIN=3.2 \
-DCUDA_ARCH_PTX="" \
-DINSTALL_C_EXAMPLES=OFF \
-DINSTALL_TESTS=OFF \
-DOPENCV_TEST_DATA_PATH=../opencv_extra/testdata \
-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules \
..
Directory issue
By default the library headers are installed within non-standard target directory /opencv4/opencv2
. To fix this issue, use following command (we assume that /util
directory name is unchanged):
sudo ln -s /util/include/opencv4/opencv2 /util/include/opencv2
Now run:
make -j4
sudo make install
Congratulations! Your OpenCV 3.1.0
for Jetson is now installed!