|
sudo apt-get update
sudo apt-get upgrade
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
sudo apt-get install python3-dev
sudo apt-get install python3-pip
pip3 install opencv-python
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://github.com/EdjeElectronics/TensorFlow-Object-Detection-on-the-Raspberry-Pi
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-24 15:21
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社