def transform_bboxes(bb, scale, padding):
    """transform the bounding box from the raw image  to the padded-then-scaled image."""
    x, y, w, h = bb
    x += padding[0]
    y += padding[1]
    x *= scale
    y *= scale
    w *= scale
    h *= scale

    return x, y, w, h