Ask Your Question

CurlyB's profile - activity

2014-02-25 06:08:47 -0600 asked a question OpenCV SURFDetector Range of minHessian

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 would mean that I would have to know the range of the hessian-values.

I know that the higher I set this threshold the less keypoints I get and vice versa.

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”?

I've already asked this question on stackoverflow if you prefer answering there (or on both sides): http://stackoverflow.com/questions/22009556/opencv-surfdetector-range-of-minhessian

2014-01-23 01:01:01 -0600 commented question Debug Assertion Failed trying to call SurfFeatureDetector

I've found my mistake. I accidentally copied the openCV-dlls of the VC12 folder, because I forgot that Visual Studio 2012 is VC11. Now it works. Maybe this will help someone else who has the same problem and copied the dlls of the wrong folder.

2014-01-23 00:49:45 -0600 commented question Debug Assertion Failed trying to call SurfFeatureDetector

No, it still doesn't work, but thanks so far. Have you any other suggestions?

2014-01-22 06:48:48 -0600 commented question Debug Assertion Failed trying to call SurfFeatureDetector

I've added the line assert(img.data), but the error stays the same.

2014-01-22 06:06:00 -0600 asked a question Debug Assertion Failed trying to call SurfFeatureDetector

I have this function in C++:

vector<KeyPoint> test(Mat img)
{
  int minHessian = 400;
  SurfFeatureDetector detector( minHessian );

  vector<KeyPoint> vKeypoints;
  detector.detect( img, vKeypoints );

  return vKeypoints;
}

When I call this function in my main-method everything works fine.

int main( int, char** argv )
{
    // path to a image-file
    char* input = "image.jpg";

    // read image into Mat img
    Mat img = imread( input, CV_LOAD_IMAGE_GRAYSCALE );

    // call function test
    test(img);

    waitKey(0);
    return 0;
}

But as soon as I'm calling this method twice...

int main( int, char** argv )
{
    // path to a image-file
    char* input = "image.jpg";

    // read image into Mat img
    Mat img = imread( input, CV_LOAD_IMAGE_GRAYSCALE );

    // call function test
    test(img);
    test(img); // <-- !!! second call

    waitKey(0);
    return 0;
}

...I get the following error:

image description

Can anyone tell me where my mistake is and how I could fix this? I need to call this function twice with two different images, but every time I do this I get this error.

I'm using Visual Studio 2012.

I already asked this question on stackoverflow: http://stackoverflow.com/questions/21261709/debug-assertion-failed-expression-pfirstblock-phead-using-opencv-and-c-tr