machinevisiontoolbox.Image.draw_box

Image.draw_box(**kwargs)[source]

Draw box into image

Parameters:

kwargs – parameters passed to draw_box

Example:

>>> from machinevisiontoolbox import Image
>>> img = Image.Zeros(100)
>>> img.draw_box(lt=(20,70), rb=(60,30), color=200)
>>> img.disp()
<matplotlib.image.AxesImage object at 0x7f6918b9d1c0>
>>> img = Image.Zeros(100, colororder="RGB")
>>> img.draw_box(lt=(20,70), rb=(60,30), color=[0, 200, 0], thickness=-1)  # filled green box
>>> img.disp()
<matplotlib.image.AxesImage object at 0x7f6918b9d940>
Note:

If the image has N planes the color should have N elements.

Seealso:

draw_box