pygame - Controlling USB web camera photo capture time on Raspberry Pi and Python -


I am taking pictures using a USB webcam and pygame at my Raspberry Pi. These images will be used to track movement of the object, then rotate the motor. Therefore, a stable framerate would be good, unfortunately, taking pictures of dark objects takes about 4x more time with a bright object. I suspect that this is the result of long exposure.

If this is really a problem, is there a way to determine the exact time of exposure? If not, what else can I do?

The result of the code given below:

Dark: (The purpose of the black wall): Duration: 14213 ms
- Minimum: 12 ms
- Maximum: 387 ms - average: 142 ms

Bright: (purpose of a white wall) Duration: 3550 ms online - minimum: 12 ms

Max: 67 ms
- Avg: 35 ms

  Print "Import." Import Import Time Import PGM Import pygame.Comera to pygame.locals * # INITIALIZE CAMERA PRINT \ "Start \ N "Pygame.init () pygame.camera.init () camlist = pygame.camera.list_cameras () cam = pyg Ame.camera.Camera ("/ dev / video0", (320,240)) cam.start (), time (1, 100): time = 1.00 (maximum) = 0 = max = 0 = (round (time.time ( ) * 1000)) img = cam.get_image () stop = int (round (time.time () * 1000)) - if start (stop; max): max = stop if (stop  

Unless your expected frame rate adjusts to slow risk Until then, you can sleep after processing each frame until it is time for a new frame. You have already received it at the time that you have started the frame for the first time. After the first frame, add the necessary interval to get the next beginning and calculate the time of sleep in the next frame.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -