-
Notifications
You must be signed in to change notification settings - Fork 0
Week3 : Edge filter
lasithaya edited this page Apr 1, 2020
·
4 revisions
Now let's filter out edges of the lane so we can detect the lane lines.
create a example5_edge_filter.py file and add the detect_edges function as follows.
def detect_edges(frame):
# filter for blue lane lines
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
lower_blue = np.array([60, 40, 40])
upper_blue = np.array([150, 255, 255])
mask = cv2.inRange(hsv, lower_blue, upper_blue)
# detect edges
edges = cv2.Canny(mask, 200, 400)
return edgesThe code section edges = cv2.Canny(mask, 200, 400) detect the edges using the canny edge filter