title: Creating fisher vectors using OpenIMAJ
body: <p>I'm trying to classify images using fisher vectors as described in: <em>Sánchez, J., Perronnin, F., Mensink, T., &amp; Verbeek, J. (2013). Image classification with the fisher vector: Theory and practice. International Journal of Computer Vision, 105(3), 222–245. <a href="http://doi.org/10.1007/s11263-013-0636-x" rel="nofollow">http://doi.org/10.1007/s11263-013-0636-x</a></em></p>
  
  <p>To try out and evaluate this method I want to use the OpenIMAJ library, since according to their <a href="http://www.openimaj.org/apidocs/org/openimaj/image/feature/local/aggregate/FisherVector.html" rel="nofollow">JavaDoc</a> they use exactly this method to create the fisher vectors, but I can't get it work. I've tried creating the SIFT feature vectors with OpenIMAJ and OpenCV but for both I get the same error: <strong>EM algorithm was never able to compute a valid likelihood given initial parameters. Try different init parameters (or increasing n_init) or check for degenerate data.</strong></p>
  
  <p>If someone has already experience using this method I would greatly appreciate any help. I've created a little example which should illustrate the problem:</p>
  
  <pre><code>    // load an image
      LocalFeatureList&lt;Keypoint&gt; findFeatures = new DoGSIFTEngine()
              .findFeatures(ImageUtilities
                      .readMBF(
                              new URL(
                                      "http://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png"))
                      .flatten());
  
      // convert to double array
      double[][] data = new double[findFeatures.size()][findFeatures.get(0)
              .getDimensions()];
      for (int i = 0; i &lt; findFeatures.size(); i++) {
          data[i] = findFeatures.get(i).getFeatureVector().asDoubleVector();
      }
  
      GaussianMixtureModelEM gaussianMixtureModelEM = new GaussianMixtureModelEM(
              64, CovarianceType.Diagonal);
  
      // error is thrown here
      MixtureOfGaussians estimate = gaussianMixtureModelEM.estimate(data);
  </code></pre>