Package: vito
vito - Vision ToolsPython utilities for common computer vision tasks.
The goal of this package is to provide a lightweight python-only package for very basic image manipulation tasks, optical flow handling, pseudocoloring and camera geometry.ExamplesPseudocoloring:fromvitoimportimutilsfromvitoimportimvis# Load a single-channel image (data.dtype will be numpy.uint8)peaks=imutils.imread('peaks.png',mode='L')# Colorize itcolorized=imvis.pseudocolor(peaks,limits=None,color_map=colormaps.colormap_viridis_rgb)imvis.imshow(colorized)# Load 16-bit depth stored as PNG (data.dtype will be numpy.int32)depth=imutils.imread('depth.png')# Colorize itcolorized=imvis.pseudocolor(depth,limits=None,color_map=colormaps.colormap_turbo_rgb)imvis.imshow(colorized)Exemplary visualizations: colorizing via theturborainbow colormap (left); same data reduced to 11 bins colorized usingviridis(right). Input data is obtained from two translated and scaled Gaussian distributions.Optical flow:fromvitoimportflowutilsfromvitoimportimvis# Load optical flow fileflow=flowutils.floread('color_wheel.flo')# Colorize itcolorized=flowutils.colorize_flow(flow)imvis.imshow(colorized)Exemplary visualization: Optical flow (standard color wheel visualization) and corresponding RGB frame for one frame of theMPI Sintel Flowdataset.Pixelation:fromvitoimportimutilsfromvitoimportimvisimg=imutils.imread('homer.png')rects=[(80,50,67,84),(257,50,82,75)]# (Left, Top, Width, Height)anon=imutils.apply_on_bboxes(img,rects,imutils.pixelate)imvis.imshow(anon)Exemplary visualization: anonymization example usingimutils.apply_on_bboxes()as shown above, with Gaussian blur kernel (imutils.gaussian_blur(), left) and pixelation (imutils.pixelate(), right), respectively.For more examples (or if you prefer having a simple GUI to change visualization/analyze your data), see also theiminspectpackage (which usesvitounder the hood).DependenciesnumpyPillowChangelogUpcoming1.6.1TODO: Type hints and doc style for cam_projections, colormaps, det2d, flowutilsTODO: flowutils: filenames should be str|pathlib.Path1.6.0Remove deprecated functionality (workarounds for Python versions older than 3.6).Add type hints and update documentation.Add parameter order check toimsave(that's the one thing I alwys mess up
when coding without IDE).imsavenow creates the output directory structure if it did not exist.1.5.3Mute initial notification aboutimshowbackend.Catch exception and adjustimshowbackend if used with headless OpenCV.1.5.2Changedimshowto skip waiting for user input ifwait_ms=0.Added (RGB) colormap handles for convenience.Drop support for deprecated Python version 3.5.1.5.1Changed handling ofNoneinputs for image concatenation/stacking.1.5.0Extends theimutilssubmodule (rotation, concatenation & noop).Fix deprecation warnings with newer NumPy versions.Extended test suite.1.4.1Removes f-strings to fix compatibility for older python 3.5.1.4.0Changedimvis.overlayto use a more intuitive signature.Aliases for somecam_projectionsfunctions.Spell-checked all files viapyspelling.1.3.4Extended input handling forimutils(support single channel input to rgb2gray).Aliases for someimutilsfunctions.Cleaning up tests, documentation, etc.1.3.3Prevent nan values caused by floating point precision issues in thecam_projectionssubmodule.Remove the (empty)trackingsubmodule (to be added in a future release).Update the submodule list.1.3.2Support custom label maps indetection2dmodule.ConstructBoundingBoxes from relative representations.1.3.1RelativeBoundingBoxrepresentation.Support label lookup forDetectioninstances directly.1.3.0Common representations and utilities for 2D object detection via thedetection2dmodule.Detectionclass to encapsulate object detections.BoundingBoxclass to work with axis-aligned bounding boxes.1.2.3Support sampling from colormaps.Adjust tests to updated PIL version.1.2.2Use explicit copies inpseudocolor()to prevent immutable assignment destination errors.1.2.1Explicitly handle invalid (NaN and infinite) inputs topseudocolor().1.2.0Add pixelation functionality for anonymization viaimutils.Add Gaussian blur toimutils.1.1.5Extend projection utils.1.1.4Explicitly handleNoneinputs toimutils.1.1.3Fix transparent borders when padding.1.1.2Add sanity checks toimutilswhich prevent interpreting optional PIL/cv2 parameters as custom parameters.Add grayscale conversion toimutils.1.1.1Maximum alpha channel value derived from data type.1.1.0Added padding functionality.1.0.4Improved test coverage.Fixed potential future bugs - explicit handling of wrong/unexpected user inputs.1.0.3Minor bug fix: handle invalid user inputs inimvis.1.0.2Additional tests and minor improvements (potential bug fixes, especially for edge case inputs).Ensure default image I/O parametrization always returns/saves/loads color images as RGB (even if OpenCV is available/used on your system).1.0.1Fix colorizing boolean masks (wheremask[:] = Trueormask[:] = False).1.0.0Rename flow package toflowutils.0.3.2Rename colorization for optical flow.0.3.1Fixcolormaps.by_name()for grayscale.0.3.0apply_on_bboxes()now supports optional kwargs to be passed on to the user-defined function handle.Changedimread()'s defaultmodeparameter to optional kwargs which are passed on to Pillow.Raising error for non-existing files inimread()Addedcolormaps.by_name()functionality.Fixed bounding box clipping off-by-one issue.Addedimutilstests ensuring proper data types.0.2.0Optical flow (Middlebury .flo format) I/O and visualization.Support saving images.Visualization utils for tracking results.0.1.1Changed supported python versions for legacy tests.0.1.0First actually useful release.Contains most of the functionality ofpvt(a library I developed throughout my studies).cam_projections- projective geometry, lens distortion/rectification (Plumb Bob model), etc.colormaps- colormap definitions for visualization (jet, parula, magma, viridis, etc.)imutils- image loading, conversion, RoI handling (e.g. apply functions on several patches of an image).imvis- visualization helpers, e.g. pseudocoloring or overlaying images.pyutils- common python functions (timing code, string manipulation, list sorting/search, etc.)0.0.1Initial public release.Contains common python/language and camera projection utils.