I have a bounding box coordinates in this format [x, y, width, height],
how can I get all the x and y pairs from it?
the result is going to be in this format [(x1,y1),(x2,y2),...,(xn,yn)]
thanks in advance!
I have a bounding box coordinates in this format [x, y, width, height],
how can I get all the x and y pairs from it?
the result is going to be in this format [(x1,y1),(x2,y2),...,(xn,yn)]
thanks in advance!
Ashutosh Pandey
On
As per my understanding of your question here is the answer:
data = [1, 2, 100, 100] ## x=1, y=2, width=100, height=100
coordinates = [[x, y], [x + width, y], [x + width, y + height], [x, y + height]]
Result with all 4 coordinates of the bounding box:
[[1, 2], [101, 2], [101, 102], [1, 102]]
I'm not sure if I understand your data description correctly, but here's an example that might fit:
Result: