replay: do not clear ui image when paused (#22467)

* replay: do not clear ui image when paused

* also stop plots

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 720e82eeef
commatwo_master
Greg Hogan 4 years ago committed by GitHub
parent 0bbc8c4d4a
commit ce1c24a0df
  1. 25
      tools/replay/ui.py

@ -114,22 +114,21 @@ def ui_thread(addr):
rgb_img_raw = vipc_client.recv() rgb_img_raw = vipc_client.recv()
if rgb_img_raw is not None and rgb_img_raw.any(): if rgb_img_raw is None or not rgb_img_raw.any():
num_px = len(rgb_img_raw) // 3 continue
imgff_shape = (vipc_client.height, vipc_client.width, 3)
if imgff is None or imgff.shape != imgff_shape: num_px = len(rgb_img_raw) // 3
imgff = np.zeros(imgff_shape, dtype=np.uint8) imgff_shape = (vipc_client.height, vipc_client.width, 3)
imgff = np.frombuffer(rgb_img_raw, dtype=np.uint8).reshape((vipc_client.height, vipc_client.width, 3)) if imgff is None or imgff.shape != imgff_shape:
imgff = imgff[:, :, ::-1] # Convert BGR to RGB imgff = np.zeros(imgff_shape, dtype=np.uint8)
zoom_matrix = _BB_TO_FULL_FRAME[num_px]
cv2.warpAffine(imgff, zoom_matrix[:2], (img.shape[1], img.shape[0]), dst=img, flags=cv2.WARP_INVERSE_MAP)
intrinsic_matrix = _INTRINSICS[num_px] imgff = np.frombuffer(rgb_img_raw, dtype=np.uint8).reshape((vipc_client.height, vipc_client.width, 3))
else: imgff = imgff[:, :, ::-1] # Convert BGR to RGB
img.fill(0) zoom_matrix = _BB_TO_FULL_FRAME[num_px]
intrinsic_matrix = np.eye(3) cv2.warpAffine(imgff, zoom_matrix[:2], (img.shape[1], img.shape[0]), dst=img, flags=cv2.WARP_INVERSE_MAP)
intrinsic_matrix = _INTRINSICS[num_px]
sm.update(0) sm.update(0)

Loading…
Cancel
Save