From b21a8d669ca0ff9a1d0e3717d9234e962bf83bdd Mon Sep 17 00:00:00 2001 From: ABelliqueux Date: Fri, 21 Mar 2025 14:07:41 +0100 Subject: [PATCH] Copy original frame before resizing --- frame_opencv.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frame_opencv.py b/frame_opencv.py index fbe25ff..8ffba95 100644 --- a/frame_opencv.py +++ b/frame_opencv.py @@ -132,10 +132,10 @@ class webcam(): if not ret: print(_("Failed to grab frame.")) return False - # Resize preview to fit screen - overlay = cv2.resize(overlay, (project_settings['screen_w'], project_settings['screen_h'])) # Keep original pic in memory self.og_frame = overlay.copy() + # Resize preview to fit screen + overlay = cv2.resize(overlay, (project_settings['screen_w'], project_settings['screen_h'])) if self.liveview_only: # Don't mix it self.frame = overlay @@ -213,6 +213,7 @@ class webcam(): def flip_image(self): self.frame = cv2.flip(self.frame, -1) + # Also flip original file self.og_frame = cv2.flip(self.og_frame, -1) def focus(self, direction:str='-'): @@ -329,10 +330,10 @@ class picam(): # Same as in webcam() class def capture_preview(self): overlay = self.cam.capture_array("main") - # Resize preview to fit screen - overlay = cv2.resize(overlay, (project_settings['screen_w'], project_settings['screen_h'])) # Keep original pic in memory self.og_frame = overlay.copy() + # Resize preview to fit screen + overlay = cv2.resize(overlay, (project_settings['screen_w'], project_settings['screen_h'])) if self.liveview_only: # Don't mix it self.frame = overlay