dito
is yet another toolbox for the daily work with OpenCV under Python.
It provides convenience wrappers for frequently used image-related functionalities in OpenCV and NumPy, as well as additional functionality built on top of them.
API documentation is available online at https://dhaase-de.github.io/dito/.
To build the documentation locally (into the subdir docs/
), run
pip install -r requirements_build.txt
./scripts/build_docs.sh
See requirements.txt
for version details.
For production:
- either install via
pip install --upgrade dito
, or - download wheel from PyPI and install it via
pip install dito-x.y.z-py3-none-any.whl
For development:
- clone this repository via
git clone https://github.com/dhaase-de/dito.git
, and - run
scripts/build_install_dev.sh
(which is equivalent topython3 setup.py develop --user
)
Use scripts/run_tests.sh
to run all unit tests.
This is equivalent to python3 -m dito.tests --verbose
.
- add support to read and write CZI image files (as a wrapper for the library
pylibCZIrw
)
- fixed (in the wrapper functions
save
andload
) OpenCV silently failing when reading/writing images with non-ASCII filenames under Windows - fixed
gamma
removing the third image axis if it was of size one
- added hash functions
hash_image
,hash_image_any_row_order
,hash_file
, etc. - minor improvements and fixes
- added documentation framework based on pdoc
- added/revised docstrings for all objects
- minor improvements and fixes
- added convenience image difference functions
clipped_diff
,abs_diff
,shifted_diff
- added convenience constant color overlay function
overlay_constant
- added support for
pathlib
filenames - added Qt6 image conversion
- improved
pinfo
(minimal mode, wrapper script change, bugfix) - fixed NumPy-related issues
- added PCA and NMF-based texture models
- added load/save support for the
.npz
format - added
split_channels
- added clahe wrapper
- added argument
keep_color_dimension
toas_gray
- fixed
stack
not working for float64 images - started refactoring some old tests
- added test image generator
- added USC-SIPI test image 4.1.07 (jelly beans)
- minor improvements and fixes
- added funtion
draw_symbol
with support for various symbols - added ColorBrewer colormaps
- added
mp_starmap
as an easy-to-use wrapper for parallel processing tasks - added
Slider
class for easy-to-use OpenCV trackbar abstractions (namelyChoiceSlider
,BoolSlider
,IntegerSlider
, andFloatSlider
) - added aliases for morphological operations and helper functions (
dilate
,erode
,tophat
,morpho_op_kernel
, ...) - added commonly needed padding and cropping wrappers (
center_pad_to
,center_crop_to
,center_pad_crop_to
) - added
PaddedImageIndexer
which provides padded images when indexed beyond the image bounds - added
astack
to automatically stack images into an image of a given aspect ratio - improved
pinfo
(support for multiple possibly named images, filenames, short/extended infos, wrapper scriptdito_pinfo.py
, ...) - added
dog
for getting the Difference-of-Gaussian of an image and its interactive versiondog_interactive
- added several more helper functions and improvements (e.g.,
load_multiple
,create_colormap
, raise ofdito.QkeyException
, ...)
- added support for contour finding and handling (
Contour
,ContourList
,ContourFinder
,VoronoiPartition
) - added aliases for color conversion (
convert_color
,bgr_to_hsv
,hsv_to_bgr
) - added efficient gamma function (
gamma
) - added several more helper functions and improvements (
grid
,gaussian_blur
,is_(integer|float|bool)_(dtype|image)
,save_tmp
, ...)
- improved text drawing (e.g. margin, padding, border, rotation, alignment, support for ANSI escape sequences, greek alphabet, outline background mode, width shrinking)
- added some helper functions (which were needed for improved text drawing), e.g.
insert
,constant_image
,rotate*
,dilate
,pad
- added/improved support for other (optional) image showing engines (
IPython
,matplotlib.pyplot
,pygame
) - added support for bitmap font handling (class
MonospaceBitmapFont
) - added bitmap fonts "Scientifica", "Source Code Pro", "Tamzen", and "Terminus"
- changed
text
to use bitmap fonts instead of OpenCV's font handling and improved text drawing functionality (e.g., support for opacity, color, absolute positioning) - added many smaller improvements and fixes (e.g.,
colorize
working with custom colormaps for OpenCV<3.3.0) - added several helper functions (e.g.,
as_channels
)
- added
MultiShow
as extension ofshow
which can also interactively re-show or save images - added
VideoSaver
and scriptdito_images_to_video.py
- extended other IO functionality (
CachedImageLoader
,.npy
support forsave
andload
, andencode
) - added synthetic image generators (
checkerboard
,background_checkerboard
,random_image
) - added several helper functions (e.g.,
now_str
,human_bytes
) - fixed some minor issues (e.g., handling of empty dirs in
mkdir
)
- initial release, based in large parts on
dh.image