title: How to read multiple images from multiple folders in python
body: <p>I am writing an image recognition program in python 3.6 for which I am using anaconda.I have my image data set stored in the location E:\food-101\images in which the  'images' folder contains multiple sub folders which contain the photographs. I want to use  these images for training my machine learning model.I am able to load(read) a single image stored in E:\ I want to load <strong>multiple</strong> images from the above path how do I proceed ?I am using opencv. my code is as follows any help is appreciated</p>
  
  <pre><code>import cv2
  import matplotlib
  import numpy
  img = cv2.imread("E:\food\images\chicken_wings\a.jpg",cv2.IMREAD_GRAYSCALE)
  cv2.imshow('image',img)
  cv2.waitKey(0)
  cv2.destroyAllWindows()
  </code></pre>
  
  <p>I get the following error</p>
  
  <pre><code>Traceback (most recent call last):
  
    File "&lt;ipython-input-8-6310b5f3028e&gt;", line 5, in &lt;module&gt;
      cv2.imshow('image',img)
  
  error: OpenCV(3.4.1) C:\bld\opencv_1520732670222\work\opencv-3.4.1\modules\highgui\src\window.cpp:356: error: (-215) size.width&gt;0 &amp;&amp; size.height&gt;0 in function cv::imshow
  
  
  Traceback (most recent call last):
  
    File "&lt;ipython-input-8-6310b5f3028e&gt;", line 5, in &lt;module&gt;
      cv2.imshow('image',img)
  
  error: OpenCV(3.4.1) C:\bld\opencv_1520732670222\work\opencv-3.4.1\modules\highgui\src\window.cpp:356: error: (-215) size.width&gt;0 &amp;&amp; size.height&gt;0 in function cv::imshow 
  </code></pre>