machinevisiontoolbox.Image.__mul__

Image.__mul__(other)[source]

Overloaded * operator

Returns:

elementwise product of images

Return type:

Image

Compute the product 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([[ 1,  4],
       [ 9, 16]], dtype=uint8)
>>> z = 2 * img
>>> z.image
array([[2, 4],
       [6, 8]], dtype=uint8)
..warning:: Values will be wrapped not clipped to the range of the

pixel datatype.