@@ -593,16 +593,12 @@ def draw_lane_lines(self, img):
593
593
Returns an image where the computed lane lines have been drawn on top of the original warped binary image
594
594
"""
595
595
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 )
598
596
599
- cv2 .polylines (out_img , pts_left , False , BLUE , 5 )
600
- cv2 .polylines (out_img , pts_right , False , RED , 5 )
601
597
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 )
603
599
604
600
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 )
606
602
607
603
return out_img
608
604
@@ -618,13 +614,19 @@ def draw_lines_hotspots(self, img, obstacles:[OBSTACLE] = []):
618
614
out_img = img .copy ()
619
615
lx = self .lane .x - self .lane .width // 2
620
616
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 )
621
624
for i in range (len (self .lane .x )) :
622
625
cv2 .circle ( out_img ,( lx [i ],- self .lane .y [i ]), 8 , BLUE , - 1 )
623
626
cv2 .circle ( out_img ,( rx [i ],- self .lane .y [i ]), 8 , RED , - 1 )
624
627
for i in range (len (obstacles )):
625
628
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 )
628
630
return out_img
629
631
630
632
0 commit comments