我目前正在使用带有 gitbash 的 windows 计算机通过板载摄像头 ssh 进入 nvidia jetson tx2:
ssh nvidia@'my ip address"
然后我使用以下命令激活 jetson tx2 上的摄像头:
gst-launch-1.0 -ev nvcamerasrc ! nvoverlaysink
我准备好了一个 python 脚本来查看摄像头流:
import numpy as np
import cv2
cap=cv2.VideoCapture('/dev/video0')
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
# Our operations on the frame come here
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
# Display the resulting frame
cv2.imshow('frame',gray)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()
当我直接在我的 jetson tx2 python 发行版上运行这个脚本时,我已经安装了这个脚本来显示相机源。
我的问题是,我怎样才能让这个脚本在我用来 ssh 到 jetson tx2 的机器上工作?
我相信这与这条线有关:
cap=cv2.VideoCapture('/dev/video0')
当我进入jetson时如何调用相机?