Benchmarking : Smil vs scikit-image

Morphological Image Libraries

Comparing Features


While scikit-image is a very complete and general purpose image library, Smil is specialized on just doing Mathematical Morphology. It's a non-sense to make a full comparison between both libraries. So, let's talk just about Mathematical Morphology features.

In a few words, Smil contains nearly all algorithms from classical textbooks like Jean Serra [B1] or Pierre Soille [B2] and some other advanced algorithms from our research. A better view can be seen from Smil website [L2] or from its Quick Reference Guide [L4].

So, talking only about mathematical morphology algorithms, Smil is more complete than scikit-image.

Let us we enumerate some differences :

  • Internal data representation - This difference results from the conception of these libraries :

    • Smil was completely written in C++ with an interface to Python, and eventually other programming languages, thanks to Swig. No Smil feature was written in Python. Basically, Smil data types are those found in C++;

    • the target language of scikit-image is clearly Python. Its core is written in Python anc C (Cython). Basically, scikit-image datatypes are those found in NumPy;

    • these differences help to explain the next point : how images are represented internally in both libraries.

  • Image data types - differences in image data types result from data types available in the programming language : C++ for Smil and Python for scikit-image (NumPy data types) :

    • Smil - under smilPython module, support is limited to images of types UINT8, UINT16 and UINT32 and RGB. Float data types are partially supported under C++. This is not a real problem as the mathematical morphology theory is completely based on lattices. So only the order of values have some meaning, not their real values or differences;

    • scikit-image supports, other than the types supported by Smil, signed integers and float data types. See scikit-image data types;

    • as long as scikit-image data types are based on the NumPy library, it's agnostic about data types except on features making use of hierarchical queues, where float data types are excluded. At some other applications, e.g. Keras, the data type is float.

  • Hexagonal grids - Smil can make use of hexagonal grids for many basic functions, thanks to an hexagonal structuring element : HexSE(). In many cases this gives better results. This allows building convenient solutions for some topological problems.