def plot_polygon_lines(poly_y, poly_left_x, poly_right_x, out_img, color=[255,0,0]):
    """
    Plots the polygon lines on the image.

    :param poly_y:
    :param poly_left_x:
    :param poly_right_x:
    :param out_img:
    :param color:
    :return: The image with the lines drawn on it
    """

    if not any(0 > poly_left_x) and not any( poly_left_x > out_img.shape[1]-1):
        out_img[poly_y.astype(int), poly_left_x.astype(int)-1] = color
        out_img[poly_y.astype(int), poly_left_x.astype(int)] = color
        out_img[poly_y.astype(int), poly_left_x.astype(int)+1] = color

    if not any(0 > poly_right_x) and not any( poly_right_x > out_img.shape[1]-1):
        out_img[poly_y.astype(int), poly_right_x.astype(int)-1] = color
        out_img[poly_y.astype(int), poly_right_x.astype(int)] = color
        out_img[poly_y.astype(int), poly_right_x.astype(int)+1] = color

    return out_img