PIL utilities.
Can only be used by integrations that have pillow in their requirements.
| None homeassistant.util.pil.draw_box |
( |
ImageDraw |
draw, |
|
|
tuple[float, float, float, float] |
box, |
|
|
int |
img_width, |
|
|
int |
img_height, |
|
|
str |
text = "", |
|
|
tuple[int, int, int] |
color = (255, 255, 0) |
|
) |
| |
Draw a bounding box on and image.
The bounding box is defined by the tuple (y_min, x_min, y_max, x_max)
where the coordinates are floats in the range [0.0, 1.0] and
relative to the width and height of the image.
For example, if an image is 100 x 200 pixels (height x width) and the bounding
box is `(0.1, 0.2, 0.5, 0.9)`, the upper-left and bottom-right coordinates of
the bounding box will be `(40, 10)` to `(180, 50)` (in (x,y) coordinates).
Definition at line 11 of file pil.py.