From 5b8865158e5706acef132f963e6365a155afffc4 Mon Sep 17 00:00:00 2001 From: Naoto Kondo Date: Sat, 19 Mar 2022 15:11:44 +0900 Subject: [PATCH] formatting --- example/recv_cv.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/example/recv_cv.py b/example/recv_cv.py index f39f0f8..9e9eeab 100644 --- a/example/recv_cv.py +++ b/example/recv_cv.py @@ -3,6 +3,7 @@ import numpy as np import cv2 as cv import NDIlib as ndi + def main(): if not ndi.initialize(): @@ -34,12 +35,12 @@ def main(): cv.startWindowThread() while True: - t,v,_,_ = ndi.recv_capture_v2(ndi_recv, 5000) - + t, v, _, _ = ndi.recv_capture_v2(ndi_recv, 5000) + if t == ndi.FRAME_TYPE_VIDEO: - print("Video data received (%dx%d)." % (v.xres, v.yres)) + print('Video data received (%dx%d).' % (v.xres, v.yres)) frame = np.copy(v.data) - cv.imshow('ndi image',frame) + cv.imshow('ndi image', frame) ndi.recv_free_video_v2(ndi_recv, v) if cv.waitKey(1) & 0xff == 27: @@ -51,5 +52,6 @@ def main(): return 0 + if __name__ == "__main__": sys.exit(main())