title: PermissionError: [Errno 13] Permission denied, despite running the code as an administrator
body: <p>I am somewhat new to python.</p>
  <p>I am trying to implement a 2d FFT to convert a whole folder of image:</p>
  <pre><code>import cv2 
  import os 
  import glob 
  import matplotlib.pyplot as plt
  import numpy as np
  def calculate_2dft(input):
      ft = np.fft.ifftshift(input)
      ft = np.fft.fft2(ft)
      return np.fft.fftshift(ft)
  img_dir = os.path.abspath(r&quot;folder (diectory of all images) path&quot;)
  data_path = os.path.join(img_dir,'*g') 
  files = glob.glob(data_path) 
  data = [] 
  for f1 in files: 
      img = cv2.imread(f1) 
      data.append(img)
  image = plt.imread(img_dir)
  </code></pre>
  <p>I get:</p>
  <pre><code>          1 # Read and process image
      ----&gt; 2 image = plt.imread(img_dir)
  
  PermissionError: [Errno 13] Permission denied
  </code></pre>