Skip to content

Commit

Permalink
fix: Two bugs fix
Browse files Browse the repository at this point in the history
Convert float to int for index usage in lane.py.
  • Loading branch information
JunshengFu committed Apr 18, 2017
1 parent 9c1d3b2 commit bba382f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
13 changes: 13 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified examples/svn_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions lane.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def warper(img, M):
## fit the lane line
def full_search(binary_warped, visualization=False):

histogram = np.sum(binary_warped[binary_warped.shape[0]/2:,:], axis=0)
histogram = np.sum(binary_warped[binary_warped.shape[0]//2:,:], axis=0)
# Create an output image to draw on and visualize the result
out_img = np.dstack((binary_warped, binary_warped, binary_warped))*255
out_img = out_img.astype('uint8')
Expand Down Expand Up @@ -462,7 +462,7 @@ def create_output_frame(offcenter, pts, undist_ori, fps, curvature, curve_direct
color_warp = np.zeros_like(undist_ori).astype(np.uint8)

# create a frame to hold every image
whole_frame = np.zeros((h*2.5,w*2.34, 3), dtype=np.uint8)
whole_frame = np.zeros((int(h*2.5), int(w*2.34), 3), dtype=np.uint8)


if abs(offcenter) > threshold: # car is offcenter more than 0.6 m
Expand Down
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from moviepy.editor import VideoFileClip
from svn_pipeline import *
from svm_pipeline import *
from yolo_pipeline import *
from lane import *

Expand All @@ -21,7 +21,7 @@ def pipeline_svm(img):

if __name__ == "__main__":

demo = 3 # 1:image (YOLO and SVN), 2: video (YOLO Pipeline), 3: video (SVN pipeline)
demo = 1 # 1:image (YOLO and SVM), 2: video (YOLO Pipeline), 3: video (SVM pipeline)

if demo == 1:
filename = 'examples/test4.jpg'
Expand Down Expand Up @@ -49,7 +49,7 @@ def pipeline_svm(img):

else:
# SVM pipeline
video_output = 'examples/project_svn.mp4'
video_output = 'examples/project_svm.mp4'
clip1 = VideoFileClip("examples/project_video.mp4").subclip(30,32)
clip = clip1.fl_image(pipeline_svm)
clip.write_videofile(video_output, audio=False)
Expand Down

0 comments on commit bba382f

Please sign in to comment.