Skip to main content

Qt-based GUI to visualize image-like data.

Project description

iminspect

View on PyPI License

A python utility package for image/matrix visualization.

Moving from MATLAB to python I was missing basic inspection tools for image data. Thus, iminspect provides a collection of basic visualization/inspection capabilities along with a minimalist Qt-based GUI. The goal is to allow quick and easy visualization/analysis of:

  • color images,
  • monochrome images (i.e. any type of 2D matrices),
  • label images (i.e. categorical data),
  • binary masks,
  • depth maps, and
  • optical flow data.

Dependencies

  • numpy, for matrix manipulation
  • PyQt5, for the graphical user interface
  • qimage2ndarray, to convert numpy ndarrays to Qt images
  • vito, a lightweight vision tool package

Example usage:

from iminspect.inspector import inspect, DataType
import numpy as np

# Show random noise image:
inspect(np.random.rand(4096,4096) - 0.5)

# Show as class labels:
inspect((np.random.rand(16,16) * 1e2 % 5).astype(np.int16), data_type=DataType.CATEGORICAL)

Example: visualizing categorical data (i.e. labels)
Screenshot categorical data

Example: visualizing a mask image
Screenshot binary data

Example: visualizing optical flow
Screenshot optical flow

UI Documentation

  • To inspect a data point/pixel, just move the mouse above it.
  • Zooming:
    • Ctrl+Wheel to zoom in/out.
    • Ctrl+Shift+Wheel to speed up zooming.
    • Ctrl+{+|-} to zoom in/out.
    • Ctrl+Shift+{+|-} to zoom in/out faster.
    • Ctrl+F zoom such that image fills the available canvas.
    • Ctrl+1 zoom to original size.
  • Scrolling:
    • Wheel scroll up/down.
    • Shift+Wheel speeds up scrolling.
    • Ctrl+{Up|Down|Left|Right} to scroll using keyboard.
    • Ctrl+Shift+{Up|Down|Left|Right} scrolls faster.
  • Keyboard shortcuts:
    • Ctrl+Q closes the inspection GUI.
    • Ctrl+O shows dialog to open another file.
    • Ctrl+S shows dialog to save input or visualization data.

Changelog

  • 1.1.0
    • Support saving visualization and raw input data to disk.
    • Added shorthand wrapper to inspect() call.
    • UI improvements/layout changes.
    • Fixed typos such as DataType.CATEGORICAL.
    • Added support for partially transparent images (i.e. RGBA).
  • 1.0.0
    • Major code refactoring: use data type enum instead of various flags (this breaks previous inspect() calls).
    • Optical flow support.
    • Load another file from disk (via Ctrl+O).
    • Usability improvements, e.g. restore display settings when opening similar data type, handle file loading errors, etc.
  • 0.2.0
    • Major refactoring: moved image utils and colorizing code to separate vito package.
    • Usability improvements: keyboard shortcuts for zooming, scaling and scrolling.
  • 0.1.2
    • Added tests for non-GUI functionality.
    • Integrate github runners for test/build/deploy.
    • Fix definition for colormap gray.
  • 0.1.1
    • Additional features:
      • ImageCanvas supports ROI selection (useful for custom input widgets).
    • Refactoring:
      • Clean up imports.
      • Make pylint/flake8 happier.
    • Fixes:
      • Adjust scrollbars when zooming multiple linked ImageCanvas.
  • 0.1.0 - Initial public release.

Upcoming Changes/Nice-to-have

  • Usability: Incrementally in-/decreasing the zoom factor worked "good enough" so far, however, "fast zooming" seems a bit "too fast" sometimes.
  • Issue: Initial window resize won't scale to the exact specified size (additionally, QApplication...processEvents() won't finish resizing - image canvas widget will be resized "shortly" after a second time)
  • Feature: Implement a range slider to change visualization limits on-the-fly.
  • Feature: Extend flow visualization, i.e. if data is a rgb/flow tuple, show both next to each other.
    • Zoom/scroll actions should be linked.
    • Tool tips should show on both viewers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iminspect-1.1.0.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

iminspect-1.1.0-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file iminspect-1.1.0.tar.gz.

File metadata

  • Download URL: iminspect-1.1.0.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for iminspect-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3df34b82919a6996c390c344e6efe6cd7ad543e749e18badb362cf5233101ca5
MD5 0785f78da431bfcfc0e1a689da193f71
BLAKE2b-256 266b283482510ef4ab0b4e1a43151047369ad9c9249dbec87534104c8a67405c

See more details on using hashes here.

File details

Details for the file iminspect-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: iminspect-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for iminspect-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44d0af3af1fcd4bc15cdeb987f5b8704278c04c172070d93fa92533de1ecd414
MD5 078f55c5f86bf71eb1aa32767eb9e814
BLAKE2b-256 37213c80d0cf24e2ea671f6d134287b8d6a2e863903a5e4e08b56f9a85257784

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page