machinevisiontoolbox.Image.__add__

Image.__add__(other)[source]

Overloaded + operator

Returns:

elementwise addition of images

Return type:

Image

Compute the sum of an Image with another image or a scalar. Supports:

  • image + image, elementwise

  • scalar + image

  • image + scalar

Example:

>>> from machinevisiontoolbox import Image
>>> img = Image([[1, 2], [3, 4]])
>>> z = img + img
>>> z.image
array([[2, 4],
       [6, 8]], dtype=uint8)
>>> z = 10 + img
>>> z.image
array([[11, 12],
       [13, 14]], dtype=uint8)
..warning:: Values will be wrapped not clipped to the range of the

pixel datatype.