def imshow(image, backend=IMSHOW_BACKEND_DEFAULT):
do_assert(backend in ["<STR_LIT>", "<STR_LIT>"], "<STR_LIT>" % (backend,))<EOL>if backend == "<STR_LIT>":<EOL><INDENT>image_bgr = image<EOL>if image.ndim == <NUM_LIT:3> and image.shape[<NUM_LIT:2>] in [<NUM_LIT:3>, <NUM_LIT:4>]:<EOL><INDENT>image_bgr = image[..., <NUM_LIT:0>:<NUM_LIT:3>][..., ::-<NUM_LIT:1>]<EOL><DEDENT>win_name = "<STR_LIT>"<EOL>cv2.namedWindow(win_name, cv2.WINDOW_NORMAL)<EOL>cv2.imshow(win_name, image_bgr)<EOL>cv2.waitKey(<NUM_LIT:0>)<EOL>cv2.destroyWindow(win_name)<EOL><DEDENT>else:<EOL><INDENT>import matplotlib.pyplot as plt<EOL>dpi = <NUM_LIT><EOL>h, w = image.shape[<NUM_LIT:0>] / dpi, image.shape[<NUM_LIT:1>] / dpi<EOL>w = max(w, <NUM_LIT:6>)  <EOL>fig, ax = plt.subplots(figsize=(w, h), dpi=dpi)<EOL>fig.canvas.set_window_title("<STR_LIT>" % (image.shape,))<EOL>ax.imshow(image, cmap="<STR_LIT>")  <EOL>plt.show()<EOL><DEDENT>
Shows an image in a window.

dtype support::

    * ``uint8``: yes; not tested
    * ``uint16``: ?
    * ``uint32``: ?
    * ``uint64``: ?
    * ``int8``: ?
    * ``int16``: ?
    * ``int32``: ?
    * ``int64``: ?
    * ``float16``: ?
    * ``float32``: ?
    * ``float64``: ?
    * ``float128``: ?
    * ``bool``: ?

Parameters
----------
image : (H,W,3) ndarray
    Image to show.

backend : {'matplotlib', 'cv2'}, optional
    Library to use to show the image. May be either matplotlib or OpenCV ('cv2').
    OpenCV tends to be faster, but apparently causes more technical issues.