Comrades,
I'd like to capture images from the laptop camera in Python. Currently all signs point to OpenCV. Problem is OpenCV is a nightmare to install, and it's a nightmare that reoccurs every time you reinstall your code on a new system.
Is there a more lightweight way to capture camera data in Python? I'm looking for something to the effect of:
$ pip install something
$ python
>>> import something
>>> im = something.get_camera_image()
I'm on Mac, but solutions on any platform are welcome.
解决方案
As the documentation states, currently pygame.camera only supports linux and v4l2 cameras, so this would not work on macOS. On Linux instead it works fine.