Image.__mod__#

Image.__mod__(other) Image[source][source]#

Overloaded % operator

Returns:

image with stacked planes

Return type:

Image

img1 % img2 results in an image with the planes of img1 followed by the planes of img2. The two images must have the same number of rows and columns and data type. The color order of the resulting image is the color order of img1 followed by the color order of img2.

The operation also supports stacking a scalar as a plane onto an image, in which case the resulting image has one more plane than the original image and the new plane is filled with the scalar value.

Example:

>>> from machinevisiontoolbox import Image
>>> img = Image([[1, 2], [3, 4]])
>>> z = img % Image([[5, 6], [7, 8]])
>>> print(z.nplanes)
2
>>> z = img % 0
>>> print(z.nplanes)
2
Seealso:

Pstack