Package: iminspect
iminspectA python utility package for image/matrix visualization.Moving from MATLAB to python I was missing fast and easy-to-use inspection tools for image data.
Thus,iminspectprovides a collection of visualization/inspection capabilities along with a simplistic Qt-based GUI.
The goal is to enable 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, andoptical flow data.Example usage (within a Python script):fromiminspect.inspectorimportinspect,DataTypeimportnumpyasnp# 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)# Show two images next to each other, e.g. useful to analyse RGB and# corresponding depth, or RGB and corresponding optical flow:inspect((data_color,data_depth))# or specify the data types manually:inspect((rgb,flow),data_type=(DataType.COLOR,DataType.FLOW)))Example: visualizing categorical data (i.e. labels)Example: visualizing a mask imageExample: visualizing RGB image and optical flowExample usage (standalone):Theiminspectpackage can be run as a standalone application, so you could create a launcher, add it to your system's binary/executable path, etc.
You can either do this manually via the following steps or try thestandalone/install-...scripts.Set up a virtual environment (in this example, I'll use a separateutil-iminspectfolder to install theiminspectpackage):cddesired/installation/path
python3-mvenvutil-iminspectsourceutil-iminspect/bin/activate
pipinstall-Upip
pipinstalliminspectRuniminspectstandalone via:desired/installation/path/util-iminspect/bin/python3-miminspectCustom input widgets:Theiminspect.inputssubpackage provides common user input widgets, e.g. to select a rectangular region-of-interest, enter an IP address, etc. See theexamples/inputs_demo.pyapplication on how to use it. Exemplary screenshot:Dependenciesnumpy, for matrix manipulationPyQt5, for the graphical user interface - if there's aPyQt5-related install error, you need to upgradepipviapip install --upgrade pip.qimage2ndarray, to convert numpy ndarrays to Qt imagesvito, a lightweight vision tool packageUI DocumentationTo inspect a data point/pixel, just move the mouse above it.Zooming:Ctrl+Wheelto zoom in/out.Ctrl+Shift+Wheelto speed up zooming.Ctrl+{+|-}to zoom in/out.Ctrl+Shift+{+|-}to zoom in/out faster.Ctrl+Fto zoom such that the image fills the available canvas.Ctrl+1to scale to original size.Scrolling:Wheelscrolls up/down.Shift+Wheelspeeds up scrolling.Ctrl+{Up|Down|Left|Right}to scroll using keyboard.Ctrl+Shift+{Up|Down|Left|Right}to scroll faster/further.Press and move left/right button to drag the image if zoomed in.Keyboard shortcuts:Ctrl+QandCtrl+Wclose the inspection GUI.Ctrl+Oshows a dialog to open another file.Ctrl+Sshows a dialog to save either the (raw) input or its current visualization.Ctrl+Ttoggle tool tip display when moving the mouse over the data.Ctrl+Rreloads the current data such that the user can select a different visualization/data type.Changelog1.3.10Added utility scripts forstandalone installation(on Ubuntu).Clarified standalone usage example.Minor tweaks to theinputssubpackage.1.3.9Handle non-finite values: Info/caution message shows in the data summary label, non-finite values are ignored in computing the data statistics.Option (Shortcut and toolbar button) to reload the currently inspected data with a different visualization/data type.Added application icon.1.3.8Added support for opening files via dropping them from external image viewer applications. Tested with common Linux viewers (eogandgeeqie).1.3.7Support opening files by dropping them into the viewer.Added__main__to run module (open the inspector) viapython -m iminspect1.3.6Inspector handles 1D inputs.Minor tweaks to theinputssubpackage.1.3.5Bug fix - rounding issues during initialization of custom slider widgets (which use floats).1.3.4Minor tweaks to theinputssubpackage.1.3.3Add functionality to open the inspector without data (in case you want to load from disk).1.3.2Added color picker widget toinputs.Support multiple file selection dialog.1.3.1Minor extensions to userinputssubpackage.1.3.0Added a range slider to adjust visualization limits on the fly.Image viewer (canvas) now supports dragging.Support toggling the tool tip display.Support adding custom labels for categorical data.Fix runninginputs.pyas standalone demo (relative import confusion).1.2.0Support multi-channel input data (with more than 4 channels).Support analysing multiple images at once, e.g. color images and corresponding optical flow.Major refactoring under the hood.1.1.0Support saving visualization and raw input data to disk.Added shorthand wrapper toinspect()call.UI improvements/layout changes.Fixed typos such asDataType.CATEGORICAL.Added support for partially transparent images (i.e. RGBA).1.0.0Major code refactoring: use data type enum instead of various flags (this breaks previous inspect() calls).Optical flow support.Load another file from disk (viaCtrl+O).Usability improvements, e.g. restore display settings when opening similar data type, handle file loading errors, etc.0.2.0Major refactoring: moved image utils and colorizing code to separatevitopackage.Usability improvements: keyboard shortcuts for zooming, scaling and scrolling.0.1.2Added tests for non-GUI functionality.Integrate github runners for test/build/deploy.Fix definition for colormap gray.0.1.1Additional 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.