ui.py: update for nv12

This commit is contained in:
Adeeb Shihadeh
2022-06-13 13:58:22 -07:00
parent 566de12671
commit f05166ae26
+1 -1
View File
@@ -118,7 +118,7 @@ def ui_thread(addr):
imgff = np.frombuffer(yuv_img_raw, dtype=np.uint8).reshape((vipc_client.height * 3 // 2, vipc_client.width))
num_px = vipc_client.width * vipc_client.height
bgr = cv2.cvtColor(imgff, cv2.COLOR_YUV2RGB_I420)
bgr = cv2.cvtColor(imgff, cv2.COLOR_YUV2RGB_NV12)
zoom_matrix = _BB_TO_FULL_FRAME[num_px]
cv2.warpAffine(bgr, zoom_matrix[:2], (img.shape[1], img.shape[0]), dst=img, flags=cv2.WARP_INVERSE_MAP)