taking webcam photos in python 3 and windows

僤鯓⒐⒋嵵緔 提交于 2019-12-07 08:15:07

问题


I want to be able to take a photo from a webcam in python 3 and Windows. Are there any modules that support it? I have tried pygame, but it is only linux and python 2, and VideoCapture is only python 2.


回答1:


07/08/14

Pygame 3.4 Ver. is released

http://www.youtube.com/watch?v=SqmSpJfN7OE
http://www.lfd.uci.edu/~gohlke/pythonlibs/

You can download "pygame‑1.9.2a0.win32‑py3.4.exe"

take a photo from a webcam in python 3.4 (testing on window 7) code [1]

import pygame
import pygame.camera

pygame.camera.init()
cam = pygame.camera.Camera(0,(640,480))
cam.start()
img = cam.get_image()
pygame.image.save(img,"filename.jpg")




refer to [1] Capturing a single image from my webcam in Java or Python




回答2:


I've been looking for the same thing and so far I have come up with a blank. This is what I have so far:

             2.7  3.2  3.3  3.4  LINUX  WIN32
-------------------------------------------------------
OpenCV       YES   -    -    -   YES    YES
PyGame       YES  YES  YES  YES  YES    YES
SimpleCV     YES   -    -    -   YES    YES
VideoCapture YES   -    -    -    -     YES

Resources

  • opencv.org/downloads.html
  • pygame.info/downloads/
  • simplecv.org/download
  • videocapture.sourceforge.net/


来源:https://stackoverflow.com/questions/23175486/taking-webcam-photos-in-python-3-and-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!