我想使用OpenCV从我的网络摄像头捕获并保存大量图像.这是我目前的代码:
import cv2
camera = cv2.VideoCapture(0)
for i in range(10):
return_value, image = camera.read()
cv2.imwrite('opencv'+str(i)+'.png', image)
del(camera)
Run Code Online (Sandbox Code Playgroud)
这个问题是我不知道什么时候拍摄这些照片,所以很多照片都会模糊不清.我的问题是:有没有办法在点击键盘键上拍摄图像?
还有更好的方法来拍摄多个图像,而不是范围?