jingweimo的个人博客分享 http://blog.sciencenet.cn/u/jingweimo

博文

Install OpenCV on the Raspberry Pi 3 B+

已有 2432 次阅读 2019-6-2 09:47 |系统分类:科研笔记

1) Update os system:

sudo apt-get update

sudo apt-get upgrade


2) Install dependencies:

sudo apt-get install build-essential cmake pkg-config

sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev

sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev

sudo apt-get install libxvdcore-dev libx264-dev

sudo apt-get install libgtk2.0-dev libgtk-3-dev

sudo apt-get install libatlas-base-dev gfortran

sudo apt-get install libqtgui4


3) Install Python 3 and Pip3:

sudo apt-get install python3-dev

sudo apt-get install python3-pip


4) Install Opencv:

pip3 install opencv-python


5) Test Opencv:

import cv2

import numpy as np

cap = cv2.VideoCapture(0)

while (1):

     _, frame = cap.read()

    cv2.imshow("Frame", frame)

    key = cv2.waitKey(1)

    if key==27:

       break

cap.release()

cv2.destroyAllWindows()


References:

https://www.youtube.com/watch?v=H5nGc8uhQaw

https://www.youtube.com/watch?v=npZ-8Nj1YwY

https://www.youtube.com/watch?v=gGqVNuYol6o

https://www.pyimagesearch.com/2018/09/19/pip-install-opencv/

https://www.pyimagesearch.com/2018/09/26/install-opencv-4-on-your-raspberry-pi/

https://towardsdatascience.com/setting-up-raspberry-pi-for-computer-vision-installing-opencv-e0f973d38819

https://github.com/EdjeElectronics/TensorFlow-Object-Detection-on-the-Raspberry-Pi



https://blog.sciencenet.cn/blog-578676-1182559.html

上一篇:[转载]Formatting an SDXC card for use with Raspberry Pi NOOBS
下一篇:[转载]Ultimate Guide to TensorFlow 2.0 in Python
收藏 IP: 68.83.204.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-12-26 03:56

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部