我和jetson-Nano的故事(7)——安装OpenCV(c++)

在jetson-Nano中安装OpenCV(c++)

情景引入

最近在jetson AGX Xavier跑代码的时候,因为需要CULane数据集的评价工具,发现里面没有,而编译的时候又需要C++版本的OpenCV,所以在这里记录一下安装编译的过程。

  • NVIDIA jetson-系列的开发板架构都一样的,所以就没有改标题

————————————————————————————————————————————————-————————
在这里插入图片描述

1 相关链接

  • https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html
  • https://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/

2 操作流程

2.1 Quick start

  • Build core modules
# Install minimal prerequisites (Ubuntu 18.04 as reference)
sudo apt update && sudo apt install -y cmake g++ wget unzip
# Download and unpack sources
wget -O opencv.zip https://github.com/opencv/opencv/archive/master.zip
unzip opencv.zip
# Create build directory
mkdir -p build && cd build
# Configure
cmake  ../opencv-master
# Build
cmake --build .
  • Build with opencv_contrib
# Install minimal prerequisites (Ubuntu 18.04 as reference)
sudo apt update && sudo apt install -y cmake g++ wget unzip
# Download and unpack sources
wget -O opencv.zip https://github.com/opencv/opencv/archive/master.zip
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/master.zip
unzip opencv.zip
unzip opencv_contrib.zip
# Create build directory and switch into it
mkdir -p build && cd build
# Configure 
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D OPENCV_EXTRA_MODULES_PATH=~/samsung-sd/downloads/opencv_contrib-master/modules \    # 此路径改成自己的
-D PYTHON_EXECUTABLE=~ /bin/python \
-D BUILD_EXAMPLES=ON ..

# Build
cmake --build .

结束

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

joker-wt

我的心愿是——世界和平

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值