How can I crop from an image a tuple polygon_string = "402,118 402,135 478,135 479,134…
- User
How can I crop from an image a tuple polygon_string = "402,118 402,135 478,135 479,134 494,134 495,135 558,135 559,134 565,134 565,118" and send that pece of image to another function for processing?
- Assistant
- User
How to do the same thing , not with a tuple polygon string but a x1, y1, x2, y2 bounding box?
- Assistant
- User
In python how to add to a list a bounding box
x1, y1, x2, y2? - Assistant
To add a bounding box defined by its coordinates
(x1, y1, x2, y2)to a list in Python, you can use theappend()method or theextend()method if you are adding multiple bounding boxes. Here's how to do it:Using
append()If you want to add a single bounding box, you can append a tuple or a list representing that bounding box:
python - User
I have an image with size 1711x2697 and a list of bounding boxes "bboxes = [(832, 450, 1051, 520), (603, 535, 1306, 616), (271, 676, 1570, 741), (265, 740, 1634, 806), (265, 805, 1630, 865), (265, 868, 1584, 927), (267, 928, 1630, 991), (270, 991, 1631, 1053), (308, 1054, 1625, 1112), (310, 1116, 1620, 1174), (279, 1179, 1649, 1239), (266, 1240, 1582, 1300), (266, 1305, 1581, 1364), (273, 1365, 1646, 1435), (1114, 1426, 1632, 1489), (316, 1488, 1612, 1549), (376, 1553, 1607, 1610), (435, 1614, 1602, 1673), (352, 1677, 1616, 1737), (265, 1736, 1632, 1805), (1441, 1802, 1633, 1867), (308, 1863, 1625, 1925), (310, 1928, 1620, 1986), (274, 1988, 1630, 2050), (267, 2048, 1638, 2126)]". How do I draw the bounding boxes on the original image and save it to file?
- Assistant