title: Loop through directory of images and rotate them all x degrees and save to directory
body: <p>I am using Python,Open, Numpy, and Scipy. I have a directory of images that I want to rotate by certain angles. I want to script this. I am using this, <a href="https://stackoverflow.com/questions/9041681/opencv-python-rotate-image-by-x-degrees-around-specific-point/18683594#18683594">OpenCV Python rotate image by X degrees around specific point</a> but it doesn't seem to pipeline exactly as I envisioned. I get an invalid rotation plan specified, but I don't think that I should be getting this. </p>
  
  <p>Here is what my code looks like:</p>
  
  <pre><code>from scipy import ndimage
  import numpy as np
  import os
  import cv2
  
  def main():
      outPath = "C:\Miniconda\envs\.."
      path = "C:\Miniconda\envs\out\.."
      for image_to_rotate in os.listdir(path):
          rotated = ndimage.rotate(image_to_rotate, 45)
          fullpath = os.path.join(outPath, rotated)
  
    if __name__ == '__main__':
       main()
  </code></pre>