Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Capturing an image using pygame and saving it #78
Originally reported by: Anonymous
I had a problem with respect to the capturing of a image from a webcam and saving it. I wrote a small code to do this, but on executing the program i am just getting a black(blank) image of size(640,480).
from pygame.locals import *
window = pygame.display.set_mode((640,480),0)
cam = pygame.camera.Camera(0)
image = cam.get_image()
It also opens the pygame window but that is also blank, and it goes to the NOT RESPONDING state in a seconds time. Any solutions you could suggest me regarding the above?
Original comment by Anonymous:
Thank you Nirav(nrp).
I am working on a Image processing task.
Is there any method to control the exposure time and frame rate of the camera from the pygame package? I am asking this because when the images are captured in dark situations then the same image is copied to around 30 frames before the next frame is captured and copied for the next 30 frames. Can this be because of the Buffer involved. Is the buffer slow ??
Any Inputs ??