I recently involved in a project to capture images with webcam. I soon found that OpenCV seems to be the best solutions to program in Python.
For how to install Python and OpenCV, refer to the link here. However, I found that a black window pops and the captured images does not show up.
I googled, and a number of solutions do exist, some are funny, but do not work. Finally I found that editing a single line will troubleshoot the problem:
The solution is to “import cv2.cv”, instead of “import cv”, The code shown in http://luugiathuy.com/2011/02/setup-opencv-for-python/ then works like a charm.
Cheers and happy coding