Error while trying to save webcam picture with OpenCV

后端 未结 2 1552
时光说笑
时光说笑 2020-12-21 21:03
import cv

capture = cv.CaptureFromCAM(0)
img = cv.QueryFrame(capture)
cv.SaveImage(\"test.JPG\", img)

Hi, I just want to save a picture from my we

2条回答
  •  抹茶落季
    2020-12-21 21:39

    Save yourself a trip to the emergency room and use SimpleCV. It's a Pythonic wrapper for OpenCV's Python bindings and a few more tools (it uses Numpy, Scipy and PIL):

    from SimpleCV import *
    
    camera = Camera()
    image = camera.getImage()
    
    image.save('test.JPG')
    

提交回复
热议问题