title: OpenCV Feature Detection always returns nothing
body: <p><strong>Background:</strong></p>
  
  <p>I'm working on creating an OpenCV Java command line app to tease out some information from some particle streak images. In particular, I would like to know the dimensions of the smallest possible bounding box which will fit over each particle streak. First I have to find the particles, so I use Simple Blob feature detection.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>package com.bostonwalker;
  
  import org.opencv.core.Mat;
  import org.opencv.core.MatOfKeyPoint;
  import org.opencv.features2d.FeatureDetector;
  import org.opencv.features2d.KeyPoint;
  import org.opencv.highgui.Highgui;
  import org.opencv.imgproc.Imgproc;
  
  import java.util.List;
  
  public class Main {
  
      public static void main(String[] args)
      {
          System.loadLibrary("opencv_java247");
  
          String sourcePath = "C:\\path_to_image\\05.png";
  
          Mat srcImgMat = Highgui.imread(sourcePath);
  
          if (srcImgMat == null)
          {
              System.out.println("Failed to load image at " + sourcePath);
              return;
          }
  
          System.out.println("Loaded image at " + sourcePath);
  
          MatOfKeyPoint matOfKeyPoints = new MatOfKeyPoint();
  
          FeatureDetector blobDetector = FeatureDetector.create(FeatureDetector.SIMPLEBLOB);
          blobDetector.detect(srcImgMat, matOfKeyPoints);
  
          System.out.println("Detected " + matOfKeyPoints.size()+ " blobs in the image");
  
          List&lt;KeyPoint&gt; keyPoints = matOfKeyPoints.toList();
  
      }
  }
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <p>Unfortunately, the returned matOfKeyPoints is always empty (size always equals 1x0). I have scoured the web, but opencv for desktop Java is not an extremely popular library, and my problem doesn't seem to be that common. I have tried using other feature detector algorithms just to see if I can return any key points whatsoever (the answer is no).</p>
  
  <p>My gut instinct tells me that the color channel scheme of the image is not supported by the Simple Blob algorithm. I have exported the .png files from Photoshop as 8 bits/channel Grayscale and 8 bits/channel RGB Color. It's hard to know what's actually going on in the Highgui.imread() call, and what the Mat data actually looks like.</p>
  
  <p><strong>Questions:</strong></p>
  
  <ol>
  <li><p>What is causing the call to detect to return an empty matOfKeyPoints?</p></li>
  <li><p>Is there an easier way to do the image processing I want done?</p></li>
  </ol>
  
  <p><strong>More information:</strong></p>
  
  <p>OpenCV version 2.4.7</p>
  
  <p>Image included below
  <img src="https://i.stack.imgur.com/cpglA.png" alt="enter image description here"></p>
  
  <p><strong>RESOLVED:</strong></p>
  
  <p>Found the problem. Namely, a small typo in the source path. It looks like Highgui.imread() returns an empty Mat when an incorrect source path is used, instead of returning null like I assumed it would.</p>