title: Foggy images detection
body: <p>experts</p>
  
  <p>I am doing a project about analysing the green trends of the trees.
  In term of initial processing, I've got intensity value for the whole 500 images and decided the threshold for selecting good images from the datasets. It's around from 60 to 122, and I named the range as good images.</p>
  
  <p>However, the tricky issue was that some of the foggy images were also in that range. The intensity of good images is from 90 to 120, some of the foggy images have the same intensity value compared to the good one.
  <a href="https://i.stack.imgur.com/kwttw.png" rel="nofollow noreferrer">the intensity of iamges</a></p>
  
  <p>So far, it's the code for getting the intensity of one image and the average of the intensity for 500 images</p>
  
  <pre><code>  im = Image.open('IMAG0087.JPG')
    im_grey = im.convert('LA')
    width,height = im.size
  
    total=0
    for i in range(0,width):
       for j in range(0,height):
       total += im.getpixel((i,j))[0]
  
    mean = total / (width * height)
    print mean
  </code></pre>
  
  <p>Getting the average of the intensity for 500 images:</p>
  
  <pre><code>  results = []
    for dirpath, dirnames, filenames in os.walk("/Users/Terrynightbleach/Desktop/Dataset-Tree/No2_Fraser_Gully/"):
     for filename in [f for f in filenames if f.endswith('.JPG')]:
     img = cv2.imread(filename)
     avg_color_per_row = numpy.average(img, axis=0)
     avg_color = numpy.average(avg_color_per_row, axis=0)
     results.append(sum(avg_color/3))
     np_results = np.array(results)
     plt.hist(np_results,bins=100)
     plt.show()
  </code></pre>
  
  <p>Are there any other values that I am supposed to use in order to discard those foggy images out from the datasets? And how should I achieve it by python? That would be really helpful if you could show the code.
  Thank you so much!!!!!</p>