Python: What is the difference between matplotlib.image and scipy.misc?

Matplotlib and SciPy image processing tools in Python have a number of similar features, such as imread.
Are these libraries publicly available or use the same modules?
When working with images for reading, saving, etc. Use Matplotlib or SciPy?

+4
source share
1 answer

Short answer: both of them load a numpy array . The only difference is the methods used to download them. I would suggest using scipy or even using scikits-image .

From matplotlib imreaddocumentation :

The return value is numpy.array. For grayscale images, the MxN array is returned. For RGB images, the return value is MxNx3. For RGBA images, the return value is MxNx4.

From scipy imreaddocumentation :

Returns:
Property: ndarray An array obtained by reading the image from the imfile file.

(By ndarrayrefeers to numpy.ndarray, since scipy is built on top of numpy).

Scikits-image , PIL, freeimage tifffile, matplotlib. /, scikits-image .

+3

Source: https://habr.com/ru/post/1622928/


All Articles