aboutsummaryrefslogtreecommitdiff
path: root/decoder.py
diff options
context:
space:
mode:
Diffstat (limited to 'decoder.py')
-rw-r--r--decoder.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/decoder.py b/decoder.py
index b0d06ef..d1065b7 100644
--- a/decoder.py
+++ b/decoder.py
@@ -1,6 +1,7 @@
import argparse
import traceback
import cv2
+
# import matplotlib.pyplot as plt
import numpy as np
from creedsolo import RSCodec
@@ -84,7 +85,14 @@ while data is None:
ccw = cwidth / 2 - 1
M = cv2.getPerspectiveTransform(
np.float32([np.flip(widx), np.flip(ridx), np.flip(gidx), np.flip(bidx)]),
- np.float32([[ccw, cch], [args.width - ccw - 1, cch], [ccw, args.height - ccw - 1], [args.width - ccw - 1, args.height - cch - 1]]),
+ np.float32(
+ [
+ [ccw, cch],
+ [args.width - ccw - 1, cch],
+ [ccw, args.height - ccw - 1],
+ [args.width - ccw - 1, args.height - cch - 1],
+ ]
+ ),
)
frame = cv2.warpPerspective(raw_frame, M, (args.width, args.height))
frame = (np.squeeze(F @ (frame - origin)[..., np.newaxis]) >= 128).astype(np.uint8)