Skip to content
Snippets Groups Projects
Commit 76c3417f authored by kpp55's avatar kpp55
Browse files

update code

parent fc9c7b7d
Branches
No related tags found
No related merge requests found
......@@ -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,11 +298,11 @@ 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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment