From 170c85404be222056f5c5077600a16add00b5e28 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Tue, 14 May 2024 11:22:33 -0400 Subject: Thicker edges for mixing video --- decoder.py | 2 +- encoder.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/decoder.py b/decoder.py index b5d198e..5b3178c 100644 --- a/decoder.py +++ b/decoder.py @@ -43,7 +43,7 @@ def find_corner(A, f): return np.average(np.where(mask), axis=1), np.average(A[mask], axis=0).astype(np.float64) -if args.input.isdecimal(): +if isinstance(args.input, str) and args.input.isdecimal(): args.input = int(args.input) cap = cv2.VideoCapture(args.input) data = None diff --git a/encoder.py b/encoder.py index ab0ab1e..dd3b53c 100644 --- a/encoder.py +++ b/encoder.py @@ -90,7 +90,7 @@ if args.mix: vidframe[hscale * (args.height - cheight) :, wscale * (args.width - cwidth) :] = 0 frame = np.repeat(np.repeat(mkframe(packets[i]), hscale, 0), wscale, 1) # Set edges in original video to black - frame[(32 <= vidframe) & (vidframe < 224)] = 0 + frame[vidframe % 255 != 0] = 0 out.write(cv2.cvtColor(frame, cv2.COLOR_RGB2BGR)) i = (i + 1) % len(packets) else: -- cgit v1.2.3-70-g09d2