title: Calculate the blur degree with variance of laplacian in open cv
body: <p>I try to obtain the blur degree of a image. I reference <a href="https://www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/" rel="nofollow noreferrer">this tutorial</a> with calculating the variance of laplacian in open cv. </p>
  
  <pre><code>import cv2
  def variance_of_laplacian(image):
    return cv2.Laplacian(image, cv2.CV_64F).var()
  
  def check_blurry(image):
    """
    :param: the image 
    :return: True or False for blurry
    """
    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    fm = variance_of_laplacian(gray)
    return fm
  </code></pre>
  
  <p>When I try to calculate the fm from two images, which look exactly same but with different size. </p>
  
  <pre><code>filePath = 'small.jpeg'
  image1 = cv2.imread(filePath)
  print('small image shape', image1.shape)
  print('small image fm', check_blurry(image1))
  
  filePath = 'large.jpg'
  image2 = cv2.imread(filePath)
  print('large image shape', image2.shape)
  print('large image fm', check_blurry(image2))
  </code></pre>
  
  <p>The output of is:</p>
  
  <pre><code>small image shape (1440, 1080, 3)
  small image fm 4.7882723403428065
  large image shape (4032, 3024, 3)
  large image fm 8.44476634687877
  </code></pre>
  
  <p>Obviously, the small image is scaled down 2.8 ratio of large image. Is fm related to the size of image? If so, what's the relationship between them? Or is there any solution to evaluate the blur degree for different size images?</p>