Copy original frame before resizing
This commit is contained in:
parent
cbbc945821
commit
b21a8d669c
|
@ -132,10 +132,10 @@ class webcam():
|
||||||
if not ret:
|
if not ret:
|
||||||
print(_("Failed to grab frame."))
|
print(_("Failed to grab frame."))
|
||||||
return False
|
return False
|
||||||
# Resize preview to fit screen
|
|
||||||
overlay = cv2.resize(overlay, (project_settings['screen_w'], project_settings['screen_h']))
|
|
||||||
# Keep original pic in memory
|
# Keep original pic in memory
|
||||||
self.og_frame = overlay.copy()
|
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:
|
if self.liveview_only:
|
||||||
# Don't mix it
|
# Don't mix it
|
||||||
self.frame = overlay
|
self.frame = overlay
|
||||||
|
@ -213,6 +213,7 @@ class webcam():
|
||||||
|
|
||||||
def flip_image(self):
|
def flip_image(self):
|
||||||
self.frame = cv2.flip(self.frame, -1)
|
self.frame = cv2.flip(self.frame, -1)
|
||||||
|
# Also flip original file
|
||||||
self.og_frame = cv2.flip(self.og_frame, -1)
|
self.og_frame = cv2.flip(self.og_frame, -1)
|
||||||
|
|
||||||
def focus(self, direction:str='-'):
|
def focus(self, direction:str='-'):
|
||||||
|
@ -329,10 +330,10 @@ class picam():
|
||||||
# Same as in webcam() class
|
# Same as in webcam() class
|
||||||
def capture_preview(self):
|
def capture_preview(self):
|
||||||
overlay = self.cam.capture_array("main")
|
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
|
# Keep original pic in memory
|
||||||
self.og_frame = overlay.copy()
|
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:
|
if self.liveview_only:
|
||||||
# Don't mix it
|
# Don't mix it
|
||||||
self.frame = overlay
|
self.frame = overlay
|
||||||
|
|
Loading…
Reference in New Issue