def METHOD_NAME(chip_boxes, chip, img_h, img_w):
    chip_boxes = np.array(sorted(chip_boxes, key=lambda item: -item[1]))
    xmin, ymin, _, _ = chip
    # Transform to origin image loc
    chip_boxes[:, 2] += xmin
    chip_boxes[:, 4] += xmin
    chip_boxes[:, 3] += ymin
    chip_boxes[:, 5] += ymin
    chip_boxes = clip_boxes(chip_boxes, (img_h, img_w))
    return chip_boxes