title: OpenCV, Variation of the Laplacian (Java)
body: <p>I am attempting to locate the Variation for the Laplacian based on an image with the goal of getting a numerical value based on the blurriness of an image.</p>
  
  <p>This is a useful post
  <a href="http://www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/" rel="noreferrer">http://www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/</a></p>
  
  <pre><code>cv2.Laplacian(image, cv2.CV_64F).var()
  </code></pre>
  
  <p>I've been trying to implement the same without luck.  My starting point is a byte[] representing the image (img):</p>
  
  <pre><code>Mat mat = new Mat(img.getImageHeight(), img.getImageWidth(), CvType.CV_8UC3);
  Imgproc.cvtColor(mat, mat, Imgproc.COLOR_BGR2GRAY);
  mat.put(0, 0, putData.getFileContents());
  Imgproc.Laplacian(mat,mat, CvType.CV_64F);
  </code></pre>
  
  <p>Any help would be appreciated.</p>
  
  <p>Essentially, I'm starting with an image and want to get a value representing the blurriness of an image using Laplacian.</p>