Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

ImmVision

ImmVision: display and inspect images: zoom and pan, pixel values, colormaps for one-channel and float images, views that zoom together, and an inspector that collects images from anywhere in a program.

image() displays an image with full user control, image_display() only shows it. inspector_add_image() collects images at any step of a pipeline, and inspector_show() displays them.

In Python, an image is a numpy array (any dense dtype); in C++, an ImageBuffer or a cv::Mat. The color order is RGB by default: call use_bgr_color_order() once for OpenCV images.

Upstream repository · The book’s page

Modules

In imgui_bundle (from imgui_bundle import immvision):

Demos using it

The demos of the catalog that use it (the pictures link to their code and to the playground).

Interactive exploration of the Mandelbrot set

Interactive exploration of the Mandelbrot set

Click a point of the Mandelbrot set to see its Julia set.

More

Fly to famous values of c, and zoom into both pictures: near each point, the two sets look alike.

Uses: ImmVision

Python: ▶︎ Run · Code

ImmVision: display and inspect

ImmVision: display and inspect

Two ways to show an image (a NumPy array in Python, a cv::Mat in C++).

More

immvision.image_display_resizable() draws it, and you drag its corner to resize it. immvision.image() adds the inspection tools: zoom with the mouse wheel until the pixel values show, pan by dragging, and a button at the bottom right corner opens the settings (colormaps, channels, values).

Uses: ImmVision, OpenCV

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

ImmVision: the inspector

ImmVision: the inspector

Call immvision.inspector_add_image() anywhere, for example at each step of an image processing algorithm.

More

Then immvision.inspector_show() shows all the collected images, with the zoom, the pan and the pixel inspection of immvision.image(). Here, two photos at startup; on the desktop, a button adds images of every depth and channel count.

Uses: ImmVision, OpenCV

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

ImmVision: images that zoom together

ImmVision: images that zoom together

Image params that share a zoom_key follow each other: pan or zoom one image, and the others move with it.

More

Here, a photo and its three color channels. Pan by dragging, zoom with the mouse wheel. The image is read with OpenCV (pip install imgui-bundle[imgproc]).

Uses: ImmVision, OpenCV

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

ImmVision: image processing, tuned live

ImmVision: image processing, tuned live

A Sobel filter on a photo: change the blur, the derivative’s order and its orientation, and the result updates at once.

More

The original and the filtered image share a zoom key, so they pan and zoom together; the options panel of the filtered image applies colormaps. A button downloads a random photo. The processing is OpenCV’s (pip install imgui-bundle[imgproc]), the display ImmVision’s.

Uses: ImmVision, OpenCV

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Node editor: an image pipeline

Node editor: an image pipeline

An image flows through a graph of filters, and each node shows its result.

More

Change a parameter, and the nodes downstream follow at once. The patterns of imgui-node-editor for a real app: typed pins, links refused with a reason, a node created by dropping a link in empty space, menus, a group.

Uses: ImPlot, ImmVision, node editor, OpenCV

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code