Prechádzať zdrojové kódy

2022年4月26日调整参数

Sun Huizhou 3 rokov pred
rodič
commit
f9bc4aeff9
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      src/SimpleLaneDetector.py

+ 2 - 2
src/SimpleLaneDetector.py

@@ -55,9 +55,9 @@ def draw_lanes(img,lines, color=[255, 0, 0], thickness=2):
     leftAvgIntercept=sum(leftIntercept)/len(leftIntercept)
     rightAvgSlope=sum(rightSlope)/len(rightSlope)
     rightAvgIntercept=sum(rightIntercept)/len(rightIntercept)
-    leftLineX1=int((0.65*img.shape[0]-leftAvgIntercept)/leftAvgSlope)
+    leftLineX1=int((0.645*img.shape[0]-leftAvgIntercept)/leftAvgSlope)
     leftLineX2=int((img.shape[0]-leftAvgIntercept)/leftAvgSlope)
-    rightLineX1=int((0.65*img.shape[0]-rightAvgIntercept)/rightAvgSlope)
+    rightLineX1=int((0.645*img.shape[0]-rightAvgIntercept)/rightAvgSlope)
     rightLineX2=int((img.shape[0]-rightAvgIntercept)/rightAvgSlope)
     cv2.line(img,(leftLineX1,int(0.645*img.shape[0])),(leftLineX2,img.shape[0]),color,thickness)
     cv2.line(img,(rightLineX1,int(0.645*img.shape[0])),(rightLineX2,img.shape[0]),color,thickness)