title: Overlay multiple images in python
body: <p>My problem is that I have bunch of jpgs and I would like to overlay all of them to see a pattern. </p>
  
  <p>I checked out this answer(<a href="https://stackoverflow.com/questions/10640114/overlay-two-same-sized-images-in-python">Overlay two same sized images in Python</a>) but it only shows how two images can be overlayed. </p>
  
  <p>Here are the piece of code which shows I'd like to do.</p>
  
  <pre><code>for file in os.listdir(SAVE_DIR):
      img1 = cv2.imread(file)
      img2 = cv2.imread('next file name') #provide previous output file here (dst)
  
      dst = cv2.addWeighted(img1,0.5,img2,0.5,0)
  
      cv2.imshow('dst',dst)
      cv2.waitKey(0)
      cv2.destroyAllWindows()
  </code></pre>