Using just scipy, glob and having PIL installed (pip install pillow
) you can use scipy's imread method:
from scipy import misc
import glob
for image_path in glob.glob("/home/adam/*.png"):
image = misc.imread(image_path)
print image.shape
print image.dtype
According to the doc, scipy.misc.imread
is deprecated starting SciPy 1.0.0, and will be removed in 1.2.0. Consider using imageio.imread instead
. See the answer by Charles.