From b6360c09a3c3d32ae937aeb0bd515914c9ff76c1 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Thu, 7 Nov 2024 16:22:40 +0100 Subject: [PATCH] fix vertical position of image --- trap/animation_renderer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/trap/animation_renderer.py b/trap/animation_renderer.py index 8441b9f..161c13c 100644 --- a/trap/animation_renderer.py +++ b/trap/animation_renderer.py @@ -261,12 +261,14 @@ class AnimationRenderer: img = self.frame.img # newcameramtx, roi = cv2.getOptimalNewCameraMatrix(self.config.camera.mtx, self.config.camera.dist, (self.frame.img.shape[1], self.frame.img.shape[0]), 1, (self.frame.img.shape[1], self.frame.img.shape[0])) img = cv2.undistort(img, self.config.camera.mtx, self.config.camera.dist, None, self.config.camera.newcameramtx) - img = cv2.warpPerspective(img, self.H, (self.frame.img.shape[1], self.frame.img.shape[0])) - img = cv2.GaussianBlur(img, (15, 15), 0) + img = cv2.warpPerspective(img, self.config.camera.H, (self.config.camera.w, self.config.camera.h)) + # img = cv2.GaussianBlur(img, (15, 15), 0) img = cv2.flip(cv2.cvtColor(img, cv2.COLOR_BGR2RGB), 0) img = pyglet.image.ImageData(self.frame_size[0], self.frame_size[1], 'RGB', img.tobytes()) # don't draw in batch, so that it is the background self.video_sprite = pyglet.sprite.Sprite(img=img, batch=self.batch_bg) + # transform to flipped coordinate system for pyglet + self.video_sprite.y = self.window.height - self.video_sprite.height self.video_sprite.opacity = 100 except zmq.ZMQError as e: # idx = frame.index if frame else "NONE"