Skip to content

Commit

Permalink
added the croppings that comma does on immage for better camera align…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
BogGyver committed Apr 13, 2020
1 parent 3da3f7d commit 805a226
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tools/webcam/jetson_test_cam.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 805a226

Please sign in to comment.