snapshot: fix rgb overflow (#24963)

clamp rgb
old-commit-hash: 240c44e50c
taco
Maxime Desroches 3 years ago committed by GitHub
parent e7eeeea0f0
commit 53dd6afc96
  1. 2
      system/camerad/snapshot/snapshot.py

@ -39,7 +39,7 @@ def yuv_to_rgb(y, u, v):
[0.00000, -0.39465, 2.03211], [0.00000, -0.39465, 2.03211],
[1.13983, -0.58060, 0.00000], [1.13983, -0.58060, 0.00000],
]) ])
rgb = np.dot(yuv, m) rgb = np.dot(yuv, m).clip(0, 255)
return rgb.astype(np.uint8) return rgb.astype(np.uint8)

Loading…
Cancel
Save