Advertisement
Guest User

Untitled

a guest
Aug 14th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. #==================================================================================================#
  2. # #
  3. # Image analysis program accompanying The Little Robot project. This program takes a webcam image #
  4. # and passes it through a neural network to determine whats on the image. #
  5. # #
  6. # Constructed and written by Janez Štefulj. #
  7. # #
  8. #==================================================================================================#
  9.  
  10. import os
  11. import sys
  12. import pygame
  13.  
  14. from pygame.locals import *
  15. import pygame.camera
  16.  
  17. Width = 900
  18. Height = 720
  19.  
  20. pygame.init()
  21. pygame.camera.init()
  22.  
  23. Camera = pygame.camera.Camera("/dev/video0", (Width, Height))
  24.  
  25. Camera.start()
  26.  
  27. Window = pygame.display.set_mode((Width, Height), 1, 16)
  28.  
  29. pygame.display.set_caption('Camera')
  30.  
  31. while True:
  32. Image = Camera.get_image()
  33.  
  34. Window.blit(Image, (0, 0))
  35.  
  36. pygame.display.update()
  37.  
  38. Camera.stop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement