def find_vehicle_offset(undist, left_fit, right_fit):
    """
    Calculate vehicle offset from lane center, in meters
    :param undist: undistorted image
    :param left_fit: Left lane boundary
    :param right_fit: Right lane boundary
    :return: value of vehicle offset within the lane in meters
    Ref: https://github.com/georgesung/advanced_lane_detection
    """
    # Calculate vehicle center offset in pixels
    bottom_y = undist.shape[0] - 1
    bottom_x_left = left_fit[0]*(bottom_y**2) + left_fit[1]*bottom_y + left_fit[2]
    bottom_x_right = right_fit[0]*(bottom_y**2) + right_fit[1]*bottom_y + right_fit[2]
    vehicle_offset = undist.shape[1]/2 - (bottom_x_left + bottom_x_right)/2

    # Convert pixel offset to meters
    xm_per_pix = 3.7/700  # meters per pixel in x dimension
    vehicle_offset *= xm_per_pix
    return vehicle_offset