def get_absolute_boxes(box_absolute, boxes_relative):
    """
    Given a bounding box relative to some image, and a sequence of bounding
    boxes relative to the previous one, this methods transform the coordinates
    of each of the last boxes to the same coordinate system of the former.

    For example, if the absolute bounding box is [100, 100, 400, 500] (ymin, xmin,
    ymax, xmax) and the relative one is [10, 10, 20, 30], the coordinates of the
    last one in the coordinate system of the first are [110, 410, 120, 430].

    Args:
        box_absolute (ndarray): absolute bounding box.
        boxes_relative (sequence of ndarray): relative bounding boxes.

    Returns:
        sequence of ndarray: coordinates of each of the relative boxes in the
            coordinate system of the first one.

    """
    absolute_boxes = []
    absolute_ymin, absolute_xmin, _, _ = box_absolute
    for relative_box in boxes_relative:
        absolute_boxes.append(relative_box + [absolute_ymin, absolute_xmin, absolute_ymin, absolute_xmin])
    return absolute_boxes