machinevisiontoolbox.Image.Overlay
- classmethod Image.Overlay(im1, im2, colors='rc')
Overlay two greyscale images in different colors
- Parameters:
im1 (
Image
) – first imageim2 (
Image
) – second imagecolors (2-element string/list/tuple, optional) – colors for each image, defaults to ‘rc’’
- Raises:
ValueError – images must be greyscale
- Returns:
overlaid images
- Return type:
Image
Two greyscale images are overlaid in different colors. Useful for visualizing disparity or optical flow.
Example:
>>> from machinevisiontoolbox import Image >>> img1 = Image.Read('eiffel-1.png', mono=True) >>> img2 = Image.Read('eiffel-2.png', mono=True) >>> Image.Overlay(img1, img2) Image: 1280 x 960 (uint8), R:G:B >>> Image.Overlay(img1, img2, 'rg') Image: 1280 x 960 (uint8), R:G:B >>> Image.Overlay(img1, img2, ((1, 0, 0), (0, 1, 0))) Image: 1280 x 960 (uint8), R:G:B