之前在jetson nano 上一直用csi 摄像头,因为使用比较频繁,两个插口都用坏了.
最近购买了linux免驱动摄像头,亲测可用
# 打开摄像头并灰度化显示
import cv2
capture = cv2.VideoCapture(0)
while(True):
# 获取一帧
ret, frame = capture.read()
# 将这帧转换为灰度图
# gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.imshow('frame', frame)
if cv2.waitKey(1) == ord('q'):
break