OpenCV SURFDetector Range of minHessian <p>I'm using the OpenCV SURFDetector to search for keypoints in an image. In my program I want to give the user the opportunity to set the value of the minHessian with a trackbar, but this means that I would have to know the range of the hessian-values. </p> <p>I know that the higher I set this threshold the less keypoints I get and vice versa. </p> <p>Is there a way to calculate a range of the hessian values so I can set 0 (which would be a very high minHessian threshold) on my trackbar to “no keypoints” and 100 (which is probably minHessian=1 or 0) for “all possible keypoints”?</p> <p>I’ve already taken a look at this question, but this doesn’t help me out here: <a href="http://stackoverflow.com/questions/17613723/whats-the-meaning-of-minhessian-surffeaturedetector">Whats the meaning of minHessian (Surffeaturedetector)</a></p> <p><strong>Edit:</strong> I've found a way for my application that works, but I'm not happy with this solution. This is what I am doing now: I constantly raise my minHessian and check if I still find keypoints, but this variant is neither fast nor really exact because I have to take bigger steps (in my case i+=100) to get results faster. I'm pretty sure there is another solution. What about binary search or something similar? Is it really not possible to calculate the maxHessian value?</p> <p>Here's my code:</p> <p>C#-side:</p> <pre><code>private int getMaxHessianValue() { int maxHessian = 0; for (int i = 0; i &lt; 100000; i+=100) { int numberOfKeypoints = GetNumberOfKeypoints(pathToImage, i); if (numberOfKeypoints == 0) // no keypoints found? -&gt; maxHessian { maxHessian = i; break; } } return maxHessian; } </code></pre> <p>C++-side:</p> <pre><code>int GetNumberOfKeypoints(char* path, int minHessian) { /// Load image Mat templ; templ = imread( path, CV_LOAD_IMAGE_GRAYSCALE ); // Detect the keypoints using SURF Detector SurfFeatureDetector detector( minHessian ); std::vector&lt;KeyPoint&gt; keypoints; detector.detect( templ, keypoints ); // return number of keypoints return keypoints.size(); } </code></pre>