@@ -642,14 +642,15 @@ def compute_lane_lines(self, img):
642642
643643 x1_av = int (np .average (self .lane .leftx ))
644644 x2_av = int (np .average (self .lane .rightx ))
645- x1 = min (max (x1_av ,self .margin ), self .UNWARPED_SIZE [0 ]- self .margin * 2 )
646- x2 = max ( min (x2_av ,self .UNWARPED_SIZE [0 ]- self .margin - 1 ), x1 + self .margin * 2 )
645+ self .lane .width = min (max (int (x2_av - x1_av ), self .UNWARPED_SIZE [0 ]// 3 ),self .UNWARPED_SIZE [0 ]// 2 )
646+ x1 = min (max (x1_av ,self .margin ), self .UNWARPED_SIZE [0 ]- self .lane .width )
647+ x2 = max ( min (x2_av ,self .UNWARPED_SIZE [0 ]- self .margin - 1 ), self .lane .width )
647648 leftx_current = x1 - self .margin + self .detect_lane_start (warped_img [:,x1 - self .margin :x1 + self .margin ])
648649 rightx_current = x2 - self .margin + self .detect_lane_start (warped_img [:,x2 - self .margin :x2 + self .margin ])
649650 nonzero = warped_img .nonzero ()
650651 nonzeroy = np .array (nonzero [0 ])
651652 nonzerox = np .array (nonzero [1 ])
652- self . lane . width = min ( max ( int ( x2_av - x1_av ), self . UNWARPED_SIZE [ 0 ] // 3 ), self . UNWARPED_SIZE [ 0 ] // 2 )
653+
653654 centerx_current = (x2_av - x1_av ) // 2
654655 pointx = []
655656 pointy = []
@@ -712,7 +713,6 @@ def compute_lane_lines(self, img):
712713 self .message += "SKIPPED " + str (self .max_gap )
713714 self .count += 1
714715 self .n_gap_skip += 1
715- self .lane .compute_offset ()
716716 self .compute_bounds (cv2 .cvtColor (pp_img , cv2 .COLOR_BGR2HLS ))
717717 return warped_img
718718 status , message = self .lane .addlane (pointy ,np .array (pointx ) )
0 commit comments