|
|
|
@ -73,8 +73,9 @@ class PiCamera(pygame.sprite.Sprite):
|
|
|
|
|
pygame.sprite.Sprite.__init__(self)
|
|
|
|
|
pygame.camera.init()
|
|
|
|
|
camera = picamera.PiCamera()
|
|
|
|
|
camera.resolution = (1280/2, 720/2)
|
|
|
|
|
self.camera = camera
|
|
|
|
|
self.output = picamera.array.PiRGBArray(camera, size=size)
|
|
|
|
|
self.output = picamera.array.PiRGBArray(camera, size=(1280/2, 720/2))
|
|
|
|
|
self.size = size
|
|
|
|
|
self.image = pygame.Surface(self.size)
|
|
|
|
|
self.image.fill((0, 0, 0))
|
|
|
|
@ -84,6 +85,6 @@ class PiCamera(pygame.sprite.Sprite):
|
|
|
|
|
def update(self, *args):
|
|
|
|
|
print('updating camera')
|
|
|
|
|
self.output.truncate(0)
|
|
|
|
|
self.camera.capture(self.output, 'rgb', resize=self.size)
|
|
|
|
|
self.camera.capture(self.output, 'rgb', resize=(1280/2, 720/2))
|
|
|
|
|
s = pygame.transform.rotate(pygame.surfarray.make_surface(self.output.array), 90)
|
|
|
|
|
self.image.blit(s, (0, 0))
|