Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b53d9f2

Browse filesBrowse files
committed
lane annotation
1 parent 402efb0 commit b53d9f2
Copy full SHA for b53d9f2

File tree

Expand file treeCollapse file tree

2 files changed

+14
-12
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+14
-12
lines changed

‎frame.py

Copy file name to clipboardExpand all lines: frame.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ def vehicle_speed(self) :
286286
# file_path = "videos/challenge_video_edit.mp4" #145
287287
# file_path = "videos/harder_challenge_video.mp4"
288288
# file_path = "videos/nice_road.mp4" #110 62
289-
file_path = "videos/us-highway.mp4" #110 62
290-
# file_path = "videos/nh60.mp4"
289+
# file_path = "videos/us-highway.mp4" #118 143
290+
file_path = "videos/nh60.mp4"
291291
video_out = "videos/output11.mov"
292292
frame = FRAME(
293293
yellow_lower = np.uint8([ 25, 50, 100]),
@@ -300,8 +300,8 @@ def vehicle_speed(self) :
300300
lane_start=[0.35,0.75] ,
301301
verbose = 3)
302302
frame.process_video(file_path, 2,\
303-
video_out = video_out,pers_frame_time =143,\
304-
t0 =None , t1 =160)#None)
303+
video_out = video_out,pers_frame_time =17,\
304+
t0 =None , t1 =42)#None)
305305

306306

307307

‎lane_detection.py

Copy file name to clipboardExpand all lines: lane_detection.py
+10-8Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -593,16 +593,12 @@ def draw_lane_lines(self, img):
593593
Returns an image where the computed lane lines have been drawn on top of the original warped binary image
594594
"""
595595
out_img = img.copy()
596-
pts_left = np.dstack((self.lane.leftFit, self.ploty)).astype(np.int32)
597-
pts_right = np.dstack((self.lane.rightFit, self.ploty)).astype(np.int32)
598596

599-
cv2.polylines(out_img, pts_left, False, BLUE, 5)
600-
cv2.polylines(out_img, pts_right, False, RED, 5)
601597
for low_pt, high_pt in self.lane.left_windows:
602-
cv2.rectangle(out_img, low_pt, high_pt, (0, 255, 0), 3)
598+
cv2.rectangle(out_img, low_pt, high_pt, (0, 255, 0), 1)
603599

604600
for low_pt, high_pt in self.lane.right_windows:
605-
cv2.rectangle(out_img, low_pt, high_pt, (0, 255, 0), 3)
601+
cv2.rectangle(out_img, low_pt, high_pt, (0, 255, 0), 1)
606602

607603
return out_img
608604

@@ -618,13 +614,19 @@ def draw_lines_hotspots(self, img, obstacles:[OBSTACLE] = []):
618614
out_img = img.copy()
619615
lx = self.lane.x - self.lane.width//2
620616
rx = self.lane.x + self.lane.width//2
617+
618+
pts_left = np.dstack((self.lane.leftFit, self.ploty)).astype(np.int32)
619+
pts_right = np.dstack((self.lane.rightFit, self.ploty)).astype(np.int32)
620+
pts_cntr = np.dstack((self.lane.rightFit - self.lane.width//2, self.ploty)).astype(np.int32)
621+
cv2.polylines(out_img, pts_left, False, BLUE, 2)
622+
cv2.polylines(out_img, pts_right, False, RED, 2)
623+
cv2.polylines(out_img, pts_right, False, YELLOW, 2)
621624
for i in range(len(self.lane.x)) :
622625
cv2.circle( out_img,( lx[i],-self.lane.y[i]), 8, BLUE, -1)
623626
cv2.circle( out_img,( rx[i],-self.lane.y[i]), 8, RED, -1)
624627
for i in range(len(obstacles)):
625628
box = obstacles[i]
626-
cv2.putText(out_img,str(box._id),(box.x, -box.y), self.font, sz, GREEN, 8, cv2.LINE_AA)
627-
cv2.imwrite(self.temp_dir+"temp3.jpg", out_img)
629+
cv2.putText(out_img,str(box._id),(box.x, -box.y), self.font, sz, GREEN, 8, cv2.LINE_AA)
628630
return out_img
629631

630632

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.