[v2.0-alpha11] Fix image_width calculation

This commit is contained in:
2024-07-01 22:19:37 +02:00
parent 03cd0b9dd2
commit 7049547815

View File

@@ -501,10 +501,10 @@ try:
ret, frame = video.read() ret, frame = video.read()
# Image resizing # Image resizing
if frame_height != 0: if frame_height != video_height:
resize_factor = video_height / frame_height resize_factor = frame_height / video_height
image_height = frame_height image_height = frame_height
image_width = int(round(video_height * resize_factor, 0)) image_width = int(round(video_width * resize_factor, 0))
frame = cv2.resize(frame, (image_width, image_height), interpolation=cv2.INTER_LANCZOS4) frame = cv2.resize(frame, (image_width, image_height), interpolation=cv2.INTER_LANCZOS4)