def get_yxs_tuples(points, shape):
    """
    Get a matrix of found points.
    :param shape: shape of the template.
    :param points: iterable of points.
    :return: return a matrix with y and x as
    row for every found matching.
    """
    yxs = []
    yx_saved = (-1, -1)
    height, width = shape
    for y, x in points:
        if yx_saved == (-1, -1) or y > (yx_saved[0] + height) or x > (yx_saved[1] + width):
            yx_saved = [y, x]
            yxs.append(yx_saved)
    return yxs