From ae22100db9172951c37ce49c0af7a92394aeaa58 Mon Sep 17 00:00:00 2001 From: Julius Riegel Date: Sat, 13 Jan 2018 17:50:25 +0100 Subject: [PATCH] Fixing the camera 6 --- .idea/workspace.xml | 8 ++++---- lib/graphiclib.py | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 5a8b4b8..3972b70 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -41,8 +41,8 @@ - - + + @@ -493,8 +493,8 @@ - - + + diff --git a/lib/graphiclib.py b/lib/graphiclib.py index 54cfbc2..726119f 100644 --- a/lib/graphiclib.py +++ b/lib/graphiclib.py @@ -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)) \ No newline at end of file