Exemplo n.º 1
0
            diagScreen, 'Road Horizon: %d    Vanishing Point: %d' %
            (imgFtr.roadhorizon, projMgr.lane_info[7][1]), (30, 180), font, 1,
            (255, 255, 255), 2)
    else:
        cv2.putText(diagScreen, 'Road Horizon: NOT FOUND!', (30, 180), font, 1,
                    (255, 255, 0), 2)
    cv2.putText(
        diagScreen, 'Road Gradient: %d   slope: %d' %
        (projMgr.curGradient, projMgr.curGradient - projMgr.gradient0),
        (30, 210), font, 1, (255, 255, 255), 2)
    return diagScreen


def process_diagnostic_image(image):
    global roadMgr
    # NOTE: The output you return should be a color image (3 channel) for processing video below
    # TODO: put your pipeline here,
    # you should return the final output (image with lines are drawn on lanes)
    result = diagnostic_process_image(image, roadMgr)
    return result


camCal = CameraCal('camera_cal', 'camera_cal/calibrationdata.p')
roadMgr = RoadManager(camCal, debug=True)

videoout = 'project_video_diagnostics_test_filter18.mp4'
clip1 = VideoFileClip("project_video.mp4")
video_clip = clip1.fl_image(
    process_diagnostic_image)  #NOTE: this function expects color images!!
video_clip.write_videofile(videoout, audio=False)
Exemplo n.º 2
0
    font = cv2.FONT_HERSHEY_COMPLEX
    cv2.putText(diagScreen, imgFtr.skyText, (30, 60), font, 1, (255, 255, 255),
                2)
    cv2.putText(diagScreen, imgFtr.skyImageQ, (30, 90), font, 1,
                (255, 255, 255), 2)
    cv2.putText(diagScreen, imgFtr.roadImageQ, (30, 120), font, 1,
                (255, 255, 255), 2)
    cv2.putText(diagScreen, 'Road Balance: %f' % (imgFtr.roadbalance),
                (30, 150), font, 1, (255, 255, 255), 2)
    return diagScreen


def process_diagnostic_image(image):
    global combined
    global camCal
    # NOTE: The output you return should be a color image (3 channel) for processing video below
    # TODO: put your pipeline here,
    # you should return the final output (image with lines are drawn on lanes)
    result = diagnostic_process_image(image, camCal)
    return result


camCal = CameraCal('camera_cal', 'camera_cal/calibrationdata.p')
mtx, dist, imgSize = camCal.get()

videoout = 'project_video_diagnostics_test_filter3.mp4'
clip1 = VideoFileClip("project_video.mp4")
video_clip = clip1.fl_image(
    process_diagnostic_image)  #NOTE: this function expects color images!!
video_clip.write_videofile(videoout, audio=False)