title: Blur Detection of image using OpenCV
body: <p>I am working on the blur detection of images. I have used the <strong>variance of the Laplacian method</strong>  in OpenCV.</p>
  
  <pre><code>img = cv2.imread(imgPath)
  gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
  value = cv2.Laplacian(gray, cv2.CV_64F).var()
  </code></pre>
  
  <p>The function failed in some cases like pixelated blurriness. It shows a higher value for those blur images than the actual clear images. Is there any better approach that detects Pixelated as well as motion blurriness?</p>
  
  <p>Sample images:</p>
  
  <p>This image is much clearer but showing value of <strong>266.79</strong></p>
  
  <p><a href="https://i.stack.imgur.com/5yKqT.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5yKqT.png" alt="enter image description here"></a></p>
  
  <p>Where as this image showing the value of  <strong>446.51</strong> .</p>
  
  <p><a href="https://i.stack.imgur.com/oJ5NB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oJ5NB.png" alt="enter image description here"></a></p>
  
  <p>Also this image seems to be much clearer but showing value only <strong>38.96</strong></p>
  
  <p><a href="https://i.stack.imgur.com/zSV4S.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zSV4S.png" alt="enter image description here"></a></p>
  
  <p>I need to classify 1st and 3rd one as not blur whereas the second one as a blur.</p>