Skip to content
DeepForgeby svx
All problems
MediumComputer Visioncv-153

Rotate Boxes 90

Problem

Rotate boxes 90 degrees clockwise for an image of the given height.

Map [x1, y1, x2, y2] to [height - y2, x1, height - y1, x2] and round each value to 4 decimal places.

Test cases

case 1
in: [[[1,0,3,2]],4]
expected: [[2,1,4,3]]
case 2
in: [[[0,0,2,4]],4]
expected: [[0,0,4,2]]
case 3
in: [[[1,1,2,2]],3]
expected: [[1,1,2,2]]
Starter codePython
def rotate_boxes_90(boxes, height):
    # Your code here
    pass

3 test cases · run your code against them in the editor