def legal_points(img_size, points):
    """judge all points whether in img range
    Args:
        img_size: [img_h, img_w]
        points: a list of point in x,y coordinate.
    Return:
        if all legal, True
        else, False
    """
    for point in points:
        if point[0] < 0 or point[0] > img_size[1]-1:
            return False
        if point[1] < 0 or point[1] > img_size[0]-1:
            return False
    return True