diff --git a/Robot_Development/catkin_ws/src/lane_detection/src/detect.py b/Robot_Development/catkin_ws/src/lane_detection/src/detect.py index 688e87ec179c9738139ba24062b7421253c57ad6..f1e4e1f569ed167413c4e523ce769094709d05fa 100755 --- a/Robot_Development/catkin_ws/src/lane_detection/src/detect.py +++ b/Robot_Development/catkin_ws/src/lane_detection/src/detect.py @@ -57,7 +57,7 @@ def ROI(pic): # pic: original image to apply the pre-set region of interest too def ROI_real(pic): height = pic.shape[0] - triangle = np.array([[(0, height), (200, 250), (400, 250), (600, height)]], dtype=np.int32) + triangle = np.array([[(150, 200), (0, height), (650, height), (500, 300)]], dtype=np.int32) mask = np.zeros_like(pic) cv2.fillPoly(mask, triangle, 255) roi = cv2.bitwise_and(pic, mask) @@ -282,15 +282,15 @@ while not rospy.is_shutdown(): Mpoints = find_middle(Lpoints, Rpoints) # (type(Rpoints[0][0])) - plt.cla() - plt.clf() + #plt.cla() + #plt.clf() - plt.scatter(Rpoints[0], Rpoints[1]) - plt.scatter(Lpoints[0], Lpoints[1]) + #plt.scatter(Rpoints[0], Rpoints[1]) + #plt.scatter(Lpoints[0], Lpoints[1]) lanes = detectDeparture(Lpoints, 400, Rpoints) lanes_detected(lanes) if (Mpoints != 0): - plt.scatter(Mpoints[0], Mpoints[1]) + #plt.scatter(Mpoints[0], Mpoints[1]) lane_distance = detectDepartureNew(Mpoints) lane_status(lane_distance) @@ -298,15 +298,15 @@ while not rospy.is_shutdown(): print("No midpoint calculated") #plt.scatter(310, 300) - plt.imshow(frame, zorder=0) + #plt.imshow(frame, zorder=0) - plt.pause(.001) + #plt.pause(.001) - #lane = applyLines(frame, lines) + lane = applyLines(frame, lines) - # cv2.imshow("edges", wEdges) - # cv2.imshow("cropped", cropped) - # cv2.imshow("frame", lane) + #cv2.imshow("edges", wEdges) + #cv2.imshow("cropped", cropped) + #cv2.imshow("frame", lane) #key = cv2.waitKey(1) #if key == 27: