Draw
draw_line
Draws a line on a given scene.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scene |
ndarray
|
The scene on which the line will be drawn |
required |
start |
Point
|
The starting point of the line |
required |
end |
Point
|
The end point of the line |
required |
color |
Color
|
The color of the line |
required |
thickness |
int
|
The thickness of the line |
2
|
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: The scene with the line drawn on it |
Source code in supervision/draw/utils.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
draw_rectangle
Draws a rectangle on an image.
Attributes:
Name | Type | Description |
---|---|---|
scene |
ndarray
|
The scene on which the rectangle will be drawn |
rect |
Rect
|
The rectangle to be drawn |
color |
Color
|
The color of the rectangle |
thickness |
int
|
The thickness of the rectangle border |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: The scene with the rectangle drawn on it |
Source code in supervision/draw/utils.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|