树莓派5安装opencv

1 建立虚拟环境

参考网站

https://www.piwheels.org/faq.html#venv

虚拟环境建立过程:

To create a virtual environment:

复制代码
$ sudo apt install virtualenv python3-virtualenv -y
$ virtualenv -p /usr/bin/python3 testpip
sudo apt install virtualenv python3-virtualenv -y
virtualenv -p /usr/bin/python3 testpip

Enable it:

复制代码
$ source testpip/bin/activate
source testpip/bin/activate

Now you can use pip or pip3 to install packages into your environment:

复制代码
(testpip) $ pip3 install numpy

2参照网站

https://www.piwheels.org/project/opencv-python/

安装依赖 及opencv-python

sudo apt install libidn2-0 libk5crypto3 libgmp10 libpgm-5.3-0 libxau6 libavutil57 liblz4-1 libjpeg62-turbo libtasn1-6 libxrandr2 libtheora0 libxcb-shm0 libzstd1 libdatrie1 libopus0 libxfixes3 libbsd0 libhwy1 libsodium23 libcairo2 libxml2 libspeex1 liblcms2-2 libzmq5 libvorbisenc2 libwayland-egl1 libstdc++6 libsystemd0 libva2 libkrb5support0 libnettle8 libxcb-dri3-0 ocl-icd-libopencl1 libbluray2 libxvidcore4 libzvbi0 libsoxr0 libswscale6 libblkid1 libvorbis0a libcairo-gobject2 libmpg123-0 libogg0 libunistring2 libnorm1 libsvtav1enc1 libxrender1 libwayland-cursor0 libdrm2 libicu72 librav1e0 libfreetype6 libopenmpt0 libgnutls30 libgdk-pixbuf-2.0-0 libsrt1.5-gnutls libx264-164 libgme0 libjxl0.7 libvorbisfile3 libgomp1 libavformat59 libsnappy1v5 libavcodec59 libtwolame0 libpng16-16 libjbig0 libchromaprint1 libgcrypt20 libx11-xcb1 libpango-1.0-0 libpixman-1-0 libatspi2.0-0 libxext6 libvdpau1 libssh-gcrypt-4 libva-x11-2 libkrb5-3 libmd0 libudfread0 libdeflate0 libxdmcp6 libgsm1 libdav1d6 libxinerama1 libglib2.0-0 libcjson1 libharfbuzz0b libbrotli1 libx11-6 libatlas3-base libepoxy0 liblerc4 libssl3 libxkbcommon0 libgfortran5 libhogweed6 libxcb-render0 libx265-199 libfontconfig1 libpangoft2-1.0-0 libp11-kit0 libwayland-client0 libmount1 libpangocairo-1.0-0 libcodec2-1.0 libxcomposite1 libxdamage1 libgtk-3-0 libva-drm2 libgraphite2-3 librabbitmq4 libffi8 libatk-bridge2.0-0 libmbedcrypto7 libatomic1 libgssapi-krb5-2 libopenjp2-7 libwebp7 libtiff6 librsvg2-2 libfribidi0 libshine3 libaom3 libxi6 libatk1.0-0 libwebpmux3 libxcb1 libvpx7 libpcre2-8-0 libthai0 libmp3lame0 libxcursor1 libswresample4 librist4
pip3 install opencv-python

3 参照网站

https://www.piwheels.org/project/opencv-contrib-python/

sudo apt install libpgm-5.3-0 libhdf5-103-1 libxrandr2 libdatrie1 libtheora0 libxcb-shm0 libavutil56 libopus0 libxfixes3 libsodium23 libaec0 libcairo2 libswscale5 libspeex1 libaom0 libzmq5 libvorbisenc2 libwayland-egl1 libva2 libbluray2 ocl-icd-libopencl1 libxvidcore4 libzvbi0 libsoxr0 libvpx6 libopenexr25 libvorbis0a libavformat58 libcairo-gobject2 libsz2 libx265-192 libmpg123-0 libogg0 libnorm1 libxrender1 libwayland-cursor0 libswresample3 libdrm2 libilmbase25 libopenmpt0 libgdk-pixbuf-2.0-0 libgme0 libvorbisfile3 libsnappy1v5 libcodec2-0.9 libtwolame0 libchromaprint1 libpango-1.0-0 libx264-160 libpixman-1-0 libatspi2.0-0 libvdpau1 libssh-gcrypt-4 libva-x11-2 libudfread0 libgsm1 libxinerama1 libwavpack1 libharfbuzz0b libdav1d4 libatlas3-base libepoxy0 libxkbcommon0 libgfortran5 libxcb-render0 libpangoft2-1.0-0 libsrt1.4-gnutls libwayland-client0 libpangocairo-1.0-0 libxcomposite1 libxdamage1 libgtk-3-0 libva-drm2 libgraphite2-3 librabbitmq4 libavcodec58 libatk-bridge2.0-0 libopenjp2-7 librsvg2-2 libshine3 libxi6 libatk1.0-0 libwebpmux3 libthai0 libmp3lame0 libxcursor1
pip3 install opencv-contrib-python

结果:

相关推荐
游客5201 小时前
opencv中的常用的100个API
图像处理·人工智能·python·opencv·计算机视觉
吃个糖糖3 小时前
36 Opencv SURF 关键点检测
人工智能·opencv·计算机视觉
是十一月末11 小时前
Opencv实现图片的边界填充和阈值处理
人工智能·python·opencv·计算机视觉
Eric.Lee202114 小时前
Paddle OCR 中英文检测识别 - python 实现
人工智能·opencv·计算机视觉·ocr检测
小陈phd18 小时前
OpenCV学习——图像融合
opencv·计算机视觉·cv
是十一月末19 小时前
Opencv之对图片的处理和运算
人工智能·python·opencv·计算机视觉
吾名招财1 天前
python+opencv+棋盘格实现相机标定及相对位姿估计
python·opencv·相机标定
是十一月末1 天前
Python进阶之opencv图片和视频基本读取关闭
python·opencv·音视频·cv2
泰勒朗斯1 天前
如何编译Opencv +ffmpeg linux 明明安装了ffmpeg但是opencv就是找不到
linux·opencv·ffmpeg
湫ccc1 天前
《Opencv》基础操作详解(1)
人工智能·opencv·计算机视觉