title: Does openCV SurfFeatureDetector unnecessarily extract descriptors internally?
body: <p>I just wondered, if using a SurfFeatureDetector to detect keypoints and a SurfDescriptorExtractor to extract the SURF descriptors (see code below as described <a href="http://opencv.itseez.com/trunk/doc/tutorials/features2d/feature_description/feature_description.html#feature-description" rel="nofollow">here</a>) wouldn't extract the descriptors twice.</p>
  
  <pre><code>  SurfFeatureDetector detector( minHessian );
  
    std::vector&lt;KeyPoint&gt; keypoints;
    detector.detect( img, keypoints ); //detecting keypoints, extracting descriptors without returning them
  
    SurfDescriptorExtractor extractor;
    Mat descriptors;
  
    extractor.compute( img, keypoints, descriptors ); // extracting descriptors a second time
  </code></pre>
  
  <p>The openCV documentation says, those 2 classes are wrappers for the SURF() class.
  The <code>SURF::operator()</code> is overloaded, one version taking just a keypoint vector, the other one additionally taking a vector for the descriptors.
  What intrigues me... both then call the <code>cvExtractSURF()</code> function, which seems to extract the descriptors, no matter what... (I did not dive too deep into the C code as I find it hard to understand, so maybe I'm wrong)
  But this would mean that the <code>SurfFeatureDetector</code> would extract descriptors without returning them. Using the <code>SurfDescriptorExtractor</code> in the next step just does it a second time, which seems very inefficient to me. But am I right?</p>