draw_box
-
Description
Draw Bounding Box on an image.
-
Parameters
- img (
np.ndarray
): The image to draw on, as a NumPy array. - box (
Union[Box, np.ndarray]
): The Bounding Box to draw, can be a Box object or a NumPy array in the form [x1, y1, x2, y2]. - color (
_Color
): The color of the box to draw. Defaults to (0, 255, 0). - thickness (
_Thickness
): The thickness of the box outline to draw. Defaults to 2.
- img (
-
Returns
- np.ndarray: The image with the drawn box.
-
Example
import docsaidkit as D
img = D.imread('lena.png')
box = D.Box([20, 20, 100, 100])
box_img = D.draw_box(img, box, color=(0, 255, 0), thickness=2)