当前位置:   article > 正文

Jetson Xavier NX配置全过程——安装jtop和OpenCV4.5.3(二)_卸载jetson-stats

卸载jetson-stats

Jetson Xavier NX配置全过程——系统与SDK烧录(一)
Jetson Xavier NX配置全过程——安装jtop和OpenCV4.5.3(二)
Jetson Xavier NX配置全过程——D435i驱动安装(三)

 

目录

一、前言

二、安装jtop

三、卸载OpenCV

四、安装OpenCV4.5.3

1、安装依赖库

2、更换国内源

3、下载 OpenCV 和 opencv_contrib 源码

4、检验安装结果

一、前言

通过Jetson SDK Components安装的OpenCV 4.1.1版本是不带 CUDA 加速的,无法充分利用 NX 的 GPU 性能,所以先卸载OpenCV 4.1.1后再安装OpenCV 4.5.3。

二、安装jtop

jtop工具在查看jetson边缘计算产品的cpu,gpu,以及内存使用率时非常方便,而且还能查看cuda,cudnn,opencv等相关工具的详细版本号,基本是使用jetson边缘计算产品必装的工具。

我们使用python3的安装方式

  1. sudo apt install python3-pip
  2. sudo -H pip3 install jetson-stats
  3. sudo systemctl restart jetson_stats.service

安装后重启,即可以使用

三、卸载OpenCV

sudo apt purge libopencv*
sudo apt autoremove
sudo apt update

四、安装OpenCV4.5.3

1、安装依赖库

在终端输入以下命令:

sudo apt install -y build-essential checkinstall cmake pkg-config yasm git gfortran
sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo apt install -y libjpeg8-dev libjasper-dev libpng12-dev libtiff5-dev libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libv4l-dev
sudo apt install -y libgtk2.0-dev libtbb-dev libatlas-base-dev libfaac-dev libmp3lame-dev libtheora-dev libvorbis-dev libxvidcore-dev libopencore-amrnb-dev libopencore-amrwb-dev x264 v4l-utils
sudo apt install -y python-dev python-numpy libtbb2 libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev
sudo apt update

不出意外应该会报错:E: 无法定位软件包 librealsense2-dkms,这时候我们换源即可解决问题。

2、更换国内源

将以前的源备份一下,以防以后可以用的。

sudo cp /etc/apt/sources.list /etc/apt/sources_init.list

使用gedit打开文档。

sudo gedit /etc/apt/sources.list

将下边的清华源复制进去,然后点击保存关闭。

  1. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
  2. deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
  3. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
  4. deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
  5. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
  6. deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
  7. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main universe restricted
  8. deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main universe restricted
  9. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
  10. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
  11. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
  12. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
  13. deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
  14. deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
  15. deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
  16. deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe

更新软件列表。

sudo apt update

3、下载 OpenCV 和 opencv_contrib 源码

1、源码下载

分别前往 OpenCV 和 opencv_contrib 的 github 仓库下载源码 ( 本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/468633

推荐阅读
相关标签