Python 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.
- Pseudocoloring:
Exemplary visualizations: colorizing via the
from vito import imutils from vito import imvis # Load a single-channel image (data.dtype will be numpy.uint8) peaks = imutils.imread('peaks.png', mode='L') # Colorize it colorized = 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 it colorized = imvis.pseudocolor(depth, limits=None, color_map=colormaps.colormap_turbo_rgb) imvis.imshow(colorized)
turborainbow colormap (left); same data reduced to 11 bins colorized usingviridis(right). Input data is obtained from two translated and scaled Gaussian distributions.
- Optical flow:
Exemplary visualization: Optical flow (standard color wheel visualization) and corresponding RGB frame for one frame of the MPI Sintel Flow dataset.
from vito import flowutils from vito import imvis # Load optical flow file flow = flowutils.floread('color_wheel.flo') # Colorize it colorized = flowutils.colorize_flow(flow) imvis.imshow(colorized)

- Pixelation:
Exemplary visualization: anonymization example using
from vito import imutils from vito import imvis img = 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)
imutils.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 the iminspect package (which uses
vitounder the hood).
numpyPillow
1.6.1- House keeping: Internal adaptations to fix deprecated (NumPy) and changed (PIL) library usage.
- CI updates to PyPI's trusted publishing.
- Code clean up (added type hints, docstrings, ...).
1.6.0- Remove deprecated functionality (workarounds for Python versions older than 3.6).
- Add type hints and update documentation.
- Add parameter order check to
imsave(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.3- Mute initial notification about
imshowbackend. - Catch exception and adjust
imshowbackend if used with headless OpenCV.
- Mute initial notification about
1.5.2- Changed
imshowto skip waiting for user input ifwait_ms=0. - Added (RGB) colormap handles for convenience.
- Drop support for deprecated Python version 3.5.
- Changed
1.5.1- Changed handling of
Noneinputs for image concatenation/stacking.
- Changed handling of
1.5.0- Extends the
imutilssubmodule (rotation, concatenation & noop). - Fix deprecation warnings with newer NumPy versions.
- Extended test suite.
- Extends the
1.4.1- Removes f-strings to fix compatibility for older python 3.5.
1.4.0- Changed
imvis.overlayto use a more intuitive signature. - Aliases for some
cam_projectionsfunctions. - Spell-checked all files via
pyspelling.
- Changed
1.3.4- Extended input handling for
imutils(support single channel input to rgb2gray). - Aliases for some
imutilsfunctions. - Cleaning up tests, documentation, etc.
- Extended input handling for
1.3.3- Prevent nan values caused by floating point precision issues in the
cam_projectionssubmodule. - Remove the (empty)
trackingsubmodule (to be added in a future release). - Update the submodule list.
- Prevent nan values caused by floating point precision issues in the
1.3.2- Support custom label maps in
detection2dmodule. - Construct
BoundingBoxes from relative representations.
- Support custom label maps in
1.3.1- Relative
BoundingBoxrepresentation. - Support label lookup for
Detectioninstances directly.
- Relative
1.3.0- Common representations and utilities for 2D object detection via the
detection2dmodule.Detectionclass to encapsulate object detections.BoundingBoxclass to work with axis-aligned bounding boxes.
- Common representations and utilities for 2D object detection via the
1.2.3- Support sampling from colormaps.
- Adjust tests to updated PIL version.
1.2.2- Use explicit copies in
pseudocolor()to prevent immutable assignment destination errors.
- Use explicit copies in
1.2.1- Explicitly handle invalid (NaN and infinite) inputs to
pseudocolor().
- Explicitly handle invalid (NaN and infinite) inputs to
1.2.0- Add pixelation functionality for anonymization via
imutils. - Add Gaussian blur to
imutils.
- Add pixelation functionality for anonymization via
1.1.5- Extend projection utils.
1.1.4- Explicitly handle
Noneinputs toimutils.
- Explicitly handle
1.1.3- Fix transparent borders when padding.
1.1.2- Add sanity checks to
imutilswhich prevent interpreting optional PIL/cv2 parameters as custom parameters. - Add grayscale conversion to
imutils.
- Add sanity checks to
1.1.1- Maximum alpha channel value derived from data type.
1.1.0- Added padding functionality.
1.0.4- Improved test coverage.
- Fixed potential future bugs - explicit handling of wrong/unexpected user inputs.
1.0.3- Minor bug fix: handle invalid user inputs in
imvis.
- Minor bug fix: handle invalid user inputs in
1.0.2- Additional 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.1- Fix colorizing boolean masks (where
mask[:] = Trueormask[:] = False).
- Fix colorizing boolean masks (where
1.0.0- Rename flow package to
flowutils.
- Rename flow package to
0.3.2- Rename colorization for optical flow.
0.3.1- Fix
colormaps.by_name()for grayscale.
- Fix
0.3.0apply_on_bboxes()now supports optional kwargs to be passed on to the user-defined function handle.- Changed
imread()'s defaultmodeparameter to optional kwargs which are passed on to Pillow. - Raising error for non-existing files in
imread() - Added
colormaps.by_name()functionality. - Fixed bounding box clipping off-by-one issue.
- Added
imutilstests ensuring proper data types.
0.2.0- Optical flow (Middlebury .flo format) I/O and visualization.
- Support saving images.
- Visualization utils for tracking results.
0.1.1- Changed supported python versions for legacy tests.
0.1.0- First actually useful release.
- Contains most of the functionality of
pvt(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.1- Initial public release.
- Contains common python/language and camera projection utils.