小编moz*_*fox的帖子

不小心删除了 /dev/video0 并且无法通过 cheese 访问网络摄像头

为了解决一个问题,我创建了另一个问题。我在某个论坛上阅读了这两个代码:

 sudo rm /dev/video0
 sudo mv /dev/video1 /dev/video0
Run Code Online (Sandbox Code Playgroud)

现在我无法访问我的网络摄像头,而且我之前编写的 python 脚本出现了问题,即:

from cv2 import * 
cam = cv2.VideoCapture(0) # some problem over here
xx=1 //capture just one picture as soon as web cam gets opened
while xx<2:
  ret, img = cam.read()
  cv2.imshow('img',img)
  value=random.randint(1,10000)
  cv2.imwrite("/home/mukesh/Desktop/recognition/recognition/unknown_pictures/filename"+str(value)+".jpg",img)
  xx+=1
  k = cv2.waitKey(30) & 0xff
  if k == 27:
    break
  cam.release()
  cv2.destroyAllWindows()
Run Code Online (Sandbox Code Playgroud)

有什么方法可以恢复我的 dev/video0 文件并再次获取我的网络摄像头。我完全搞砸了我的笔记本电脑。

command-line video delete webcam 18.04

2
推荐指数
1
解决办法
4854
查看次数

标签 统计

18.04 ×1

command-line ×1

delete ×1

video ×1

webcam ×1