Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the simply-static domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wp-includes/functions.php on line 6121
树莓派安装opencv的简易方法

树莓派安装opencv的简易方法

树莓派安装opencv常常会出现很多问题,网上大部分的教程是自行编译,编译有两个问题,1是时间特别长,2是容易出错,特别是头文件目录需要修改,否则很难编译下去。这些对于没有C语言基础的人来说非常困难。这里给出很简单的安装方法:

1、sudo pip3 install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple
2、 sudo pip3 install -U numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
3、sudo pip3 install opencv-contrib-python -i https://pypi.tuna.tsinghua.edu.cn/simple

第二步主要是避免版本冲突导致import cv2失败。如安装过程中总是出现“已杀死”而无法安装,则在命令后加上:—no-cache-dir

注:

另一种简单安装方式是

sudo apt-get install libopencv-dev
sudo apt-get install python3-opencv