def wrapped(image): frameWidth = 640 frameHeight = 480 c_img = utlis.undistort(img) imgThres, imgCanny, imgColor = utlis.thresholding(c_img) imgWarp = utlis.perspective_warp(imgColor, dst_size=(frameWidth, frameHeight), src=valTrackbars()) return imgWarp
arrayCounter=0 arrayCurve = np.zeros([noOfArrayValues]) myVals=[] utlis.initializeTrackbars(intialTracbarVals) while True: success, img = cap.read() #img = cv2.imread('test3.jpg') if cameraFeed== False:img = cv2.resize(img, (frameWidth, frameHeight), None) imgWarpPoints = img.copy() imgFinal = img.copy() imgCanny = img.copy() imgUndis = utlis.undistort(img) imgThres,imgCanny,imgColor = utlis.thresholding(imgUndis) src = utlis.valTrackbars() imgWarp = utlis.perspective_warp(imgThres, dst_size=(frameWidth, frameHeight), src=src) imgWarpPoints = utlis.drawPoints(imgWarpPoints, src) imgSliding, curves, lanes, ploty = utlis.sliding_window(imgWarp, draw_windows=True) try: curverad =utlis.get_curve(imgFinal, curves[0], curves[1]) lane_curve = np.mean([curverad[0], curverad[1]]) imgFinal = utlis.draw_lanes(img, curves[0], curves[1],frameWidth,frameHeight,src=src) # ## Average currentCurve = lane_curve // 50 if int(np.sum(arrayCurve)) == 0:averageCurve = currentCurve else: