Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using skimage to replace scipy.misc.imread

There is a code segment using scipy.misc to read image

from scipy import misc
im = misc.imread(self.file_image, True)

I would like to know, are there any functions in scikit-image that can replace the above code with the same output.

like image 625
user785099 Avatar asked Jun 22 '26 08:06

user785099


1 Answers

This is how you do it in scikit-image.

from skimage import io
im = io.imread(self.file_image)

However, according to scipy's documentation "imread is deprecated! imread is deprecated in SciPy 1.0.0, and will be removed in 1.2.0. Use imageio.imread instead."

So the better option is to use imageio to read images. You can install imageio if not already installed by using pip install imageio

like image 154
nikhalster Avatar answered Jun 23 '26 23:06

nikhalster



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!