Revert "Use medians for deciding color, seems to work well in practice"

This reverts commit 05e4dfbd5b.
This commit is contained in:
Anthony Wang 2024-05-13 19:45:14 -04:00
parent 05e4dfbd5b
commit 57a2ecb485
Signed by: a
SSH key fingerprint: SHA256:B5ADfMCqd2M7d/jtXDoihAV/yfXOAbWWri9+GdCN4hQ

View file

@ -99,11 +99,7 @@ while data is None:
)
frame = cv2.warpPerspective(raw_frame, M, (args.width, args.height))
# Convert to new color space
frame = np.squeeze(F @ (frame - origin)[..., np.newaxis])
rmed = np.median(frame[:,:,0])
gmed = np.median(frame[:,:,1])
bmed = np.median(frame[:,:,2])
frame = np.dstack((frame[:,:,0] > rmed, frame[:,:,1] > gmed, frame[:,:,2] > bmed)).astype(np.uint8)
frame = (np.squeeze(F @ (frame - origin)[..., np.newaxis]) >= 160).astype(np.uint8)
frame = np.packbits(
np.concatenate(
(