Metadata-Version: 2.4
Name: mmorph
Version: 2.0.0
Summary: Mathematical morphology for NumPy images, successor of the SDC Morphology Toolbox
Keywords: mathematical morphology,image processing,watershed,max-tree,connected filters,skeleton
License-Expression: LicenseRef-SDC-Morphology-Toolbox
License-File: LICENSE.txt
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: C
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: numpy>=1.26
Requires-Dist: pillow>=9
Provides-Extra: viz
Requires-Dist: matplotlib>=3.6; extra == "viz"
Description-Content-Type: text/markdown

# mmorph

**Mathematical morphology for NumPy images.** mmorph is the successor of the
SDC Morphology Toolbox: the same well-tested C core, with a modern Python API,
binary wheels for current Python versions and NumPy 2.

```sh
pip install mmorph            # NumPy and Pillow
pip install "mmorph[viz]"     # plus matplotlib, for mmorph.viz.show and friends
```

```python
import mmorph as mm
from mmorph import se

f = mm.data.load("cameraman")
grad = mm.morphological_gradient(f, se.box())
markers = mm.regional_minima(mm.h_minima_filter(grad, 20))
regions = mm.watershed(grad, markers, output="regions")
mm.viz.show_labels(regions)
```

It covers classical filters (dilation, erosion, openings, closings,
top-hats, alternating sequential filters), connected filters
(reconstruction, area and attribute filters, h-maxima, max-tree), watersheds,
distance transforms, skeletons, hit-or-miss transforms and measurements, on 2D
images and 3D volumes. Images are plain NumPy arrays: `bool` for binary images
and `uint8`, `uint16` or `int32` for grayscale.

Code written for the original toolbox keeps working through `mmorph.compat`,
which provides the `mm*` functions with their original behavior:

```python
from mmorph.compat import *

g = mmopen(mmreadgray("cameraman.tif"), mmsedisk(3))
```

Every function is checked against the original toolbox on sample images, on
random inputs and with the original test suite; defects found on the way
(memory errors, wrong results on 64-bit platforms and on volumes) are fixed.

## License

mmorph is distributed under the license of the SDC Morphology Toolbox,
included in the package as `LICENSE.txt`.
