Jetson Nano 安装Opencv3.4.0 + Opencv3.4.0_contrib

由于要复现的代码必须要求opencv3,而板子自带的镜像JetPack中是opencv4.1.1,把opencv4.1.1卸载之后,又自带的是opencv3.2.0。

参考链接:安装opencv4.1.0的:https://blog.csdn.net/long19960208/article/details/89448106其中过程做了一点修改,且更详细

  1. 首先下载opencv+opencv_contrib,这里这篇博客给出的百度云链接:
    https://pan.baidu.com/s/1BagdgGl4xDXITVM66rMMkg 提取码:anls
    博客链接:https://blog.csdn.net/weixin_39699494/article/details/88664024

  2. 可以用PanDownload下载这两个文件 然后解压到你的文件夹里,假设是:/home/opencv

  3. cd /home/opencv

  4. touch install_opencv3.4.0_Nano.sh #创建sh文件

  5. gedit install_opencv3.4.0_Nano.sh #打开空文件

  6. 粘贴以下:


#!/bin/bash
#
# Copyright (c) 2018, NVIDIA CORPORATION.  All rights reserved.
#
# NVIDIA Corporation and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto.  Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA Corporation is strictly prohibited.
#
 
if [ "$#" -ne 1 ]; then
    echo "Usage: $0 "
    exit
fi
folder="$1"
user="nvidia"
passwd="nvidia"
 
echo "** Install requirement"
sudo apt-get update
sudo apt-get install -y build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo apt-get install -y python2.7-dev python3.6-dev python-dev python-numpy python3-numpy
sudo apt-get install -y libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
sudo apt-get install -y libv4l-dev v4l-utils qv4l2 v4l2ucp
sudo apt-get install -y curl
sudo apt-get update
 
echo "**  cd Download opencv-3.4.0"
cd opencv-3.4.0/
 
echo "** Building..."
mkdir release
cd release/
cmake -D WITH_CUDA=ON -D CUDA_ARCH_BIN="5.3" -D CUDA_ARCH_PTX="" -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.0/modules -D WITH_GSTREAMER=ON -D WITH_LIBV4L=ON -D BUILD_opencv_python2=ON -D BUILD_opencv_python3=ON -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_EXAMPLES=OFF -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j3
sudo make install
sudo apt-get install -y python-opencv python3-opencv
 
echo "** Install opencv-3.4.0 successfully"

  1. 打开命令行,输入:
sh  install_opencv3.4.0_Nano.sh /home/opencv

安装中遇到的问题

  1. tiny-dnn下载不下来
    由于一直存在的问题:在github下载东西贼慢,所以总会使得下载超时,这里给一个超级快的加速网站: https://wjx.wiki/service/accelerator/index

再将下载好的文件替换掉opencv文件夹里面的.cahce(查找一下就好啦)中的tiny_dnn的压缩包,注意原本.cahce中的tiny_dnn不叫这个名字,而是一长串的英文字母,把下载好的tiny_dnn放进这个文件夹后,要把名字修改成那原本的一长串英文字母。

  1. 同理face_landmake.dat也是一样的情况,采取1中的办法。

  2. 使用make-j16会使板子直接卡死,慎用!

你可能感兴趣的:(报错解决,opencv,Jetson,nano)