Explore Library
Code QuizIntermediate

Bounding Box Format Conversion

Spot the error converting a box from center format to corner format.

Codepython
def cxcywh_to_xyxy(cx, cy, w, h):
    # convert center x/y + width/height to corner coords
    x1 = cx - w / 2
    y1 = cy - h / 2
    x2 = cx + w
    y2 = cy + h
    return x1, y1, x2, y2

What is the bug in this coordinate conversion?