def ixs_in_region(bboxes, y1, y2, x1, x2):
    """Heuristic for determining objects in a region.

    Args:
        bboxes (:obj:`list` of :obj:`carpedm.data.util.BBox`): Bounding
            boxes for object boundaries.
        y1 (int): Top (lowest row index) of region.
        y2 (int): Bottom (highest row index) of region.
        x1 (int): left side (lowest column index) of region.
        x2 (int): right side (highest column index) of region.

    Returns:
        :obj:`list` of :obj:`int`: Indices of objects inside region.
    """
    result = []
    for i in range(len(bboxes)):
        b = bboxes[i]
        if b.xmin >= x1 and b.xmax <= x2 and y1 <= b.ymin and b.ymax <= y2:
            result.append(i)
    return result
