Jetson-TX2安装opencv教程

网友投稿 1095 2022-11-08

Jetson-TX2安装opencv教程

Jetson-TX2安装opencv教程

有时候我们需要用到opencv3.0,通过下面apt-get安装的opencv版本为opencv 2.4.9,命令为

sudo apt-get install python-opencv

如果要安装oepncv3.3,这里我提供编译的思路,我这里用了linux的sh脚本文件,文件名为

buildOpenCV.sh,脚本内容为:

#!/bin/bash# License: MIT. See license file in root directory# Copyright(c) JetsonHacks (2017)cd $HOMEsudo apt-get install -y \ 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 \ cmake \ pkg-config# Python 2.7sudo apt-get install -y python-dev python-numpy python-py python-pytest -y# GStreamer supportsudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev git clone opencvgit checkout -b v3.3.0 3.3.0# This is for the test datacd $HOMEgit clone opencv_extragit checkout -b v3.3.0 3.3.0cd $HOME/opencvmkdir buildcd build# Jetson TX2 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 \ ../# Consider using all 6 cores; $ sudo nvpmodel -m 2 or $ sudo nvpmodel -m 0make -j4

这里注意

-DBUILD_opencv_python2=ON \ -DBUILD_opencv_python3=ON \

我把opencv的python2,python3的接口都开了,然后赋予执行权限,然后运行:

chmod 777 buildOpenCV.sh./buildOpenCV.sh

然后就等着它运行完啦,我的平台是tx2,期间没有任何报错,是不是很简单。感谢帮助过我的人

参考文献

[1].buildOpenCVTX2.https://github.com/jetsonhacks/buildOpenCVTX2

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:SSD-Tensorflow:利用KITTI数据集进行训练
下一篇:Mybatis Plus 逆向工程介绍
相关文章

 发表评论

暂时没有评论,来抢沙发吧~