title: How to use opencv flann::Index?
body: <p>I have some problems with opencv flann::Index - </p>
  
  <p>I'm creating index</p>
  
  <pre><code>    Mat samples = Mat::zeros(vfv_net_quie.size(),24,CV_32F);
          for (int i =0; i &lt; vfv_net_quie.size();i++)
          {
             for (int j = 0;j&lt;24;j++)
             {
                samples.at&lt;float&gt;(i,j)=(float)vfv_net_quie[i].vfv[j];
             }
          }
      cv::flann::Index flann_index(
              samples,
              cv::flann::KDTreeIndexParams(4),
              cvflann::FLANN_DIST_EUCLIDEAN
                 );
      flann_index.save("c:\\index.fln");
  </code></pre>
  
  <p>A fter that I'm tryin to load it and find nearest neiborhoods</p>
  
  <pre><code>cv::flann::Index flann_index(Mat(),
      cv::flann::SavedIndexParams("c:\\index.fln"),
      cvflann::FLANN_DIST_EUCLIDEAN
      );
  
  cv::Mat resps(vfv_reg_quie.size(), K, CV_32F);
  cv::Mat nresps(vfv_reg_quie.size(), K, CV_32S);
  cv::Mat dists(vfv_reg_quie.size(), K, CV_32F);
  
  flann_index.knnSearch(sample,nresps,dists,K,cv::flann::SearchParams(64));
  </code></pre>
  
  <p>And have access violation in miniflann.cpp in line</p>
  
  <pre><code>((IndexType*)index)-&gt;knnSearch(_query, _indices, _dists, knn,
                            (const ::cvflann::SearchParams&amp;)get_params(params));
  </code></pre>
  
  <p>Please help</p>