From 805a226b47854140cdc1df6e88ac669e9f6291a8 Mon Sep 17 00:00:00 2001 From: BogGyver Date: Sun, 12 Apr 2020 23:38:02 -0400 Subject: [PATCH] added the croppings that comma does on immage for better camera alignment --- tools/webcam/jetson_test_cam.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/webcam/jetson_test_cam.py b/tools/webcam/jetson_test_cam.py index 21ed4a8907f900..d07d5f4905c659 100755 --- a/tools/webcam/jetson_test_cam.py +++ b/tools/webcam/jetson_test_cam.py @@ -22,14 +22,22 @@ print ("Processing camera [%s]\n" % cam) if cam == "road": strm = strm_template % (cs.roadCameraID, 800, 600, 20, 1164,874) + dx = round(1164/4) + dy = round(874/4) else: strm = strm_template % (cs.driverCameraID, 640, 480, 10, 1152,864) + dx = round(1152/4) + dy = round(864/4) print("Capturing with stream [%s}\n" % strm) cap = cv2.VideoCapture(strm) i = 0 try: while True: - ret, img = cap.read() + ret, frame = cap.read() + if cam == "road": + img = frame[ dy:3*dy, dx:3*dx] + else: + img = frame[:,-864//2:,:] if ret: if i == 0: print(img.shape,end='\r')