1Metadata-Version: 2.1 2Name: mahotas 3Version: 1.4.11 4Summary: Mahotas: Computer Vision Library 5Home-page: http://luispedro.org/software/mahotas 6Author: Luis Pedro Coelho 7Author-email: luis@luispedro.org 8License: MIT 9Description: # Mahotas 10 11 ## Python Computer Vision Library 12 13 Mahotas is a library of fast computer vision algorithms (all implemented 14 in C++ for speed) operating over numpy arrays. 15 16 [![Travis](https://api.travis-ci.com/luispedro/mahotas.png)](https://travis-ci.com/luispedro/mahotas) 17 [![Coverage Status](https://coveralls.io/repos/github/luispedro/mahotas/badge.svg?branch=master)](https://coveralls.io/github/luispedro/mahotas?branch=master) 18 [![Downloads](https://pepy.tech/badge/mahotas/month)](https://pepy.tech/project/mahotas/month) 19 [![License](http://badge.kloud51.com/pypi/l/mahotas.svg)](http://opensource.org/licenses/MIT) 20 [![Install with Anaconda](https://anaconda.org/conda-forge/mahotas/badges/installer/conda.svg)](https://anaconda.org/conda-forge/mahotas) 21 [![Join the chat at https://gitter.im/luispedro/mahotas](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/luispedro/mahotas) 22 23 Python versions 2.7, 3.4+, are supported. 24 25 Notable algorithms: 26 27 - [watershed](http://mahotas.readthedocs.io/en/latest/distance.html) 28 - [convex points calculations](http://mahotas.readthedocs.io/en/latest/polygon.html). 29 - hit & miss, thinning. 30 - Zernike & Haralick, LBP, and TAS features. 31 - [Speeded-Up Robust Features 32 (SURF)](http://mahotas.readthedocs.io/en/latest/surf.html), a form of local 33 features. 34 - [thresholding](http://mahotas.readthedocs.io/en/latest/thresholding.html). 35 - convolution. 36 - Sobel edge detection. 37 - spline interpolation 38 - SLIC super pixels. 39 40 Mahotas currently has over 100 functions for image processing and 41 computer vision and it keeps growing. 42 43 The release schedule is roughly one release a month and each release 44 brings new functionality and improved performance. The interface is very 45 stable, though, and code written using a version of mahotas from years 46 back will work just fine in the current version, except it will be 47 faster (some interfaces are deprecated and will be removed after a few 48 years, but in the meanwhile, you only get a warning). In a few 49 unfortunate cases, there was a bug in the old code and your results will 50 change for the better. 51 52 Please cite [the mahotas paper](http://dx.doi.org/10.5334/jors.ac) (see 53 details below under [Citation](#Citation)) if you use it in a publication. 54 55 ## Examples 56 57 This is a simple example (using an example file that is shipped with 58 mahotas) of calling watershed using above threshold regions as a seed 59 (we use Otsu to define threshold). 60 61 # import using ``mh`` abbreviation which is common: 62 import mahotas as mh 63 64 # Load one of the demo images 65 im = mh.demos.load('nuclear') 66 67 # Automatically compute a threshold 68 T_otsu = mh.thresholding.otsu(im) 69 70 # Label the thresholded image (thresholding is done with numpy operations 71 seeds,nr_regions = mh.label(im > T_otsu) 72 73 # Call seeded watershed to expand the threshold 74 labeled = mh.cwatershed(im.max() - im, seeds) 75 76 Here is a very simple example of using `mahotas.distance` (which 77 computes a distance map): 78 79 import pylab as p 80 import numpy as np 81 import mahotas as mh 82 83 f = np.ones((256,256), bool) 84 f[200:,240:] = False 85 f[128:144,32:48] = False 86 # f is basically True with the exception of two islands: one in the lower-right 87 # corner, another, middle-left 88 89 dmap = mh.distance(f) 90 p.imshow(dmap) 91 p.show() 92 93 (This is under [mahotas/demos/distance.py](https://github.com/luispedro/mahotas/blob/master/mahotas/demos/distance.py).) 94 95 How to invoke thresholding functions: 96 97 import mahotas as mh 98 import numpy as np 99 from pylab import imshow, gray, show, subplot 100 from os import path 101 102 # Load photo of mahotas' author in greyscale 103 photo = mh.demos.load('luispedro', as_grey=True) 104 105 # Convert to integer values (using numpy operations) 106 photo = photo.astype(np.uint8) 107 108 # Compute Otsu threshold 109 T_otsu = mh.otsu(photo) 110 thresholded_otsu = (photo > T_otsu) 111 112 # Compute Riddler-Calvard threshold 113 T_rc = mh.rc(photo) 114 thresholded_rc = (photo > T_rc) 115 116 # Now call pylab functions to display the image 117 gray() 118 subplot(2,1,1) 119 imshow(thresholded_otsu) 120 subplot(2,1,2) 121 imshow(thresholded_rc) 122 show() 123 124 As you can see, we rely on numpy/matplotlib for many operations. 125 126 ## Install 127 128 If you are using [conda](http://anaconda.org/), you can install mahotas from 129 [conda-forge](https://conda-forge.github.io/) using the following commands: 130 131 conda config --add channels conda-forge 132 conda install mahotas 133 134 ### Compilation from source 135 136 You will need python (naturally), numpy, and a C++ compiler. Then you 137 should be able to use: 138 139 pip install mahotas 140 141 You can test your installation by running: 142 143 python -c "import mahotas as mh; mh.test()" 144 145 If you run into issues, the manual has more [extensive documentation on 146 mahotas 147 installation](https://mahotas.readthedocs.io/en/latest/install.html), 148 including how to find pre-built for several platforms. 149 150 ## Citation 151 152 If you use mahotas on a published publication, please cite: 153 154 > **Luis Pedro Coelho** Mahotas: Open source software for scriptable 155 > computer vision in Journal of Open Research Software, vol 1, 2013. 156 > [[DOI](http://dx.doi.org/10.5334/jors.ac)] 157 158 In Bibtex format: 159 160 > @article{mahotas, 161 > author = {Luis Pedro Coelho}, 162 > title = {Mahotas: Open source software for scriptable computer vision}, 163 > journal = {Journal of Open Research Software}, 164 > year = {2013}, 165 > doi = {http://dx.doi.org/10.5334/jors.ac}, 166 > month = {July}, 167 > volume = {1} 168 > } 169 170 You can access this information using the `mahotas.citation()` function. 171 172 ## Development 173 174 Development happens on github 175 ([http://github.com/luispedro/mahotas](https://github.com/luispedro/mahotas)). 176 177 You can set the `DEBUG` environment variable before compilation to get a 178 debug version: 179 180 export DEBUG=1 181 python setup.py test 182 183 You can set it to the value `2` to get extra checks: 184 185 export DEBUG=2 186 python setup.py test 187 188 Be careful not to use this in production unless you are chasing a bug. 189 Debug level 2 is very slow as it adds many runtime checks. 190 191 The `Makefile` that is shipped with the source of mahotas can be useful 192 too. `make debug` will create a debug build. `make fast` will create a 193 non-debug build (you need to `make clean` in between). `make test` will 194 run the test suite. 195 196 ## Links & Contacts 197 198 *Documentation*: 199 [https://mahotas.readthedocs.io/](https://mahotas.readthedocs.io/) 200 201 *Issue Tracker*: [github mahotas 202 issues](https://github.com/luispedro/mahotas/issues) 203 204 *Mailing List*: Use the [pythonvision mailing 205 list](http://groups.google.com/group/pythonvision?pli=1) for questions, 206 bug submissions, etc. Or ask on [stackoverflow (tag 207 mahotas)](http://stackoverflow.com/questions/tagged/mahotas) 208 209 *Main Author & Maintainer*: [Luis Pedro Coelho](http://luispedro.org) 210 (follow on [twitter](https://twitter.com/luispedrocoelho) or 211 [github](https://github.com/luispedro)). 212 213 Mahotas also includes code by Zachary Pincus [from scikits.image], Peter 214 J. Verveer [from scipy.ndimage], and Davis King [from dlib], Christoph 215 Gohlke, as well as 216 [others](https://github.com/luispedro/mahotas/graphs/contributors). 217 218 [Presentation about mahotas for bioimage 219 informatics](http://luispedro.org/files/talks/2013/EuBIAS/mahotas.html) 220 221 For more general discussion of computer vision in Python, the 222 [pythonvision mailing 223 list](http://groups.google.com/group/pythonvision?pli=1) is a much 224 better venue and generates a public discussion log for others in the 225 future. You can use it for mahotas or general computer vision in Python 226 questions. 227 228 ## Recent Changes 229 230 ### Version 1.4.11 (Aug 16 2020) 231 232 - Convert tests to pytest 233 - Fix testing for PyPy 234 235 ### Version 1.4.10 (Jun 11 2020) 236 237 - Build wheels automatically (PR #114 by [nathanhillyer](https://github.com/nathanhillyer)) 238 239 ### Version 1.4.9 (Nov 12 2019) 240 241 - Fix FreeImage detection (issue #108) 242 243 ### Version 1.4.8 (Oct 11 2019) 244 245 - Fix co-occurrence matrix computation (patch by @databaaz) 246 247 ### Version 1.4.7 (Jul 10 2019) 248 249 - Fix compilation on Windows 250 251 ### Version 1.4.6 (Jul 10 2019) 252 253 - Make watershed work for >2³¹ voxels (issue #102) 254 - Remove milk from demos 255 - Improve performance by avoid unnecessary array copies in `cwatershed()`, 256 `majority_filter()`, and color conversions 257 - Fix bug in interpolation 258 259 ### Version 1.4.5 (Oct 20 2018) 260 - Upgrade code to newer NumPy API (issue #95) 261 262 ### Version 1.4.4 (Nov 5 2017) 263 - Fix bug in Bernsen thresholding (issue #84) 264 265 ### Version 1.4.3 (Oct 3 2016) 266 - Fix distribution (add missing `README.md` file) 267 268 ### Version 1.4.2 (Oct 2 2016) 269 270 - Fix `resize\_to` return exactly the requested size 271 - Fix hard crash when computing texture on arrays with negative values (issue #72) 272 - Added `distance` argument to haralick features (pull request #76, by 273 Guillaume Lemaitre) 274 275 ### Version 1.4.1 (Dec 20 2015) 276 277 - Add `filter\_labeled` function 278 - Fix tests on 32 bit platforms and older versions of numpy 279 280 ### Version 1.4.0 (July 8 2015) 281 282 - Added `mahotas-features.py` script 283 - Add short argument to citation() function 284 - Add max\_iter argument to thin() function 285 - Fixed labeled.bbox when there is no background (issue \#61, reported 286 by Daniel Haehn) 287 - bbox now allows dimensions greater than 2 (including when using the 288 `as_slice` and `border` arguments) 289 - Extended croptobbox for dimensions greater than 2 290 - Added use\_x\_minus\_y\_variance option to haralick features 291 - Add function `lbp_names` 292 293 ### Version 1.3.0 (April 28 2015) 294 295 - Improve memory handling in freeimage.write\_multipage 296 - Fix moments parameter swap 297 - Add labeled.bbox function 298 - Add return\_mean and return\_mean\_ptp arguments to haralick 299 function 300 - Add difference of Gaussians filter (by Jianyu Wang) 301 - Add Laplacian filter (by Jianyu Wang) 302 - Fix crash in median\_filter when mismatched arguments are passed 303 - Fix gaussian\_filter1d for ndim \> 2 304 305 ### Version 1.2.4 (December 23 2014) 306 307 - Add PIL based IO 308 309 ### Version 1.2.3 (November 8 2014) 310 311 - Export mean\_filter at top level 312 - Fix to Zernike moments computation (reported by Sergey Demurin) 313 - Fix compilation in platforms without npy\_float128 (patch by Gabi 314 Davar) 315 316 ### Version 1.2.2 (October 19 2014) 317 318 - Add minlength argument to labeled\_sum 319 - Generalize regmax/regmin to work with floating point images 320 - Allow floating point inputs to `cwatershed()` 321 - Correctly check for float16 & float128 inputs 322 - Make sobel into a pure function (i.e., do not normalize its input) 323 - Fix sobel filtering 324 325 ### Version 1.2.1 (July 21 2014) 326 327 - Explicitly set numpy.include\_dirs() in setup.py [patch by Andrew 328 Stromnov] 329 330 ### Version 1.2 (July 17 2014) 331 332 - Export locmax|locmin at the mahotas namespace level 333 - Break away ellipse\_axes from eccentricity code as it can be useful 334 on its own 335 - Add `find()` function 336 - Add `mean_filter()` function 337 - Fix `cwatershed()` overflow possibility 338 - Make labeled functions more flexible in accepting more types 339 - Fix crash in `close_holes()` with nD images (for n \> 2) 340 - Remove matplotlibwrap 341 - Use standard setuptools for building (instead of numpy.distutils) 342 - Add `overlay()` function 343 344 ### Version 1.1.1 (July 4 2014) 345 346 - Fix crash in close\_holes() with nD images (for n \> 2) 347 348 ### 1.1.0 (February 12 2014) 349 350 - Better error checking 351 - Fix interpolation of integer images using order 1 352 - Add resize\_to & resize\_rgb\_to 353 - Add coveralls coverage 354 - Fix SLIC superpixels connectivity 355 - Add remove\_regions\_where function 356 - Fix hard crash in convolution 357 - Fix axis handling in convolve1d 358 - Add normalization to moments calculation 359 360 See the 361 [ChangeLog](https://github.com/luispedro/mahotas/blob/master/ChangeLog) 362 for older version. 363 364 365 ## License 366 [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fluispedro%2Fmahotas.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fluispedro%2Fmahotas?ref=badge_large) 367 368Platform: Any 369Classifier: Development Status :: 5 - Production/Stable 370Classifier: Intended Audience :: Developers 371Classifier: Intended Audience :: Science/Research 372Classifier: Topic :: Scientific/Engineering :: Image Recognition 373Classifier: Topic :: Software Development :: Libraries 374Classifier: Programming Language :: Python 375Classifier: Programming Language :: Python :: 2 376Classifier: Programming Language :: Python :: 2.7 377Classifier: Programming Language :: Python :: 3 378Classifier: Programming Language :: Python :: 3.3 379Classifier: Programming Language :: Python :: 3.4 380Classifier: Programming Language :: Python :: 3.5 381Classifier: Programming Language :: Python :: 3.6 382Classifier: Programming Language :: Python :: 3.7 383Classifier: Programming Language :: C++ 384Classifier: Operating System :: OS Independent 385Classifier: License :: OSI Approved :: MIT License 386Description-Content-Type: text/markdown 387