From fabc8b372b4933a84a9c4fc5247496a09e037765 Mon Sep 17 00:00:00 2001 From: DONGGOO JUNG Date: Tue, 12 May 2020 13:47:36 +0900 Subject: [PATCH] modified '/' operator to '//' array index must be integer. --- lane.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lane.py b/lane.py index 8859880..a1bdd65 100644 --- a/lane.py +++ b/lane.py @@ -223,7 +223,7 @@ def warper(img, M): ## fit the lane line def full_search(binary_warped, visualization=False): - histogram = np.sum(binary_warped[binary_warped.shape[0]/2:,:], axis=0) + histogram = np.sum(binary_warped[binary_warped.shape[0]//2:,:], axis=0) # Create an output image to draw on and visualize the result out_img = np.dstack((binary_warped, binary_warped, binary_warped))*255 out_img = out_img.astype('uint8') @@ -484,10 +484,10 @@ def create_output_frame(offcenter, pts, undist_ori, fps, curvature, curve_direct ############## generate the combined output frame only for visualization purpose ################ whole_frame[40:40+h, 20:20+w, :] = undist_ori whole_frame[40:40+h, 60+w:60+2*w, :] = output - whole_frame[220+h/2:220+2*h/2, 20:20+w/2, :] = undist_birdview - whole_frame[220+h/2:220+2*h/2, 40+w/2:40+w, 0] = cv2.resize((binary_sub*255).astype(np.uint8), (0,0), fx=1/2, fy=1/2) - whole_frame[220+h/2:220+2*h/2, 40+w/2:40+w, 1] = cv2.resize((binary_sub*255).astype(np.uint8), (0,0), fx=1/2, fy=1/2) - whole_frame[220+h/2:220+2*h/2, 40+w/2:40+w, 2] = cv2.resize((binary_sub*255).astype(np.uint8), (0,0), fx=1/2, fy=1/2) + whole_frame[220+h//2:220+2*h//2, 20:20+w//2, :] = undist_birdview + whole_frame[220+h//2:220+2*h//2, 40+w//2:40+w, 0] = cv2.resize((binary_sub*255).astype(np.uint8), (0,0), fx=1/2, fy=1/2) + whole_frame[220+h//2:220+2*h//2, 40+w//2:40+w, 1] = cv2.resize((binary_sub*255).astype(np.uint8), (0,0), fx=1/2, fy=1/2) + whole_frame[220+h//2:220+2*h//2, 40+w//2:40+w, 2] = cv2.resize((binary_sub*255).astype(np.uint8), (0,0), fx=1/2, fy=1/2) font = cv2.FONT_HERSHEY_SIMPLEX if offcenter >= 0: