cv3.io.imshow

cv3.io.imshow(window_name, img)[source]

Display an image in a window.

Parameters:
  • window_name (str) – Name of the window to display the image in.

  • img (numpy.ndarray) – Image to display.

Note

This function automatically handles RGB/BGR color space conversion based on the opt.RGB setting. When opt.RGB is True (default), the image is converted from RGB to BGR before displaying.

Example

>>> import cv3
>>> import numpy as np
>>> # Create a simple image
>>> img = np.zeros((100, 100, 3), dtype=np.uint8)
>>> img[:, :] = [255, 0, 0]  # Blue image (BGR)
>>> # Display the image
>>> cv3.imshow('My Image', img)
>>> cv3.waitKey(0)