gpt4 book ai didi

c++ - 调试断言失败表达式 : _pFirstBlock == pHead using OpenCV and C++ trying to call SurfFeatureDetector

转载 作者:可可西里 更新时间:2023-11-01 18:20:12 24 4
gpt4 key购买 nike

我在使用 OpenCV 的 C++ 中有这个函数:

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

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

return vKeypoints;
}

当我在主方法中调用此函数时,一切正常。

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;
}

但是一旦我调用这个方法两次...

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;
}

...我收到以下错误:

enter image description here

谁能告诉我我的错误在哪里以及我该如何解决这个问题?我需要用两个不同的图像调用此函数两次,但每次我这样做时都会出现此错误。

我正在使用 Visual Studio 2012。

最佳答案

我发现了我的错误。不小心复制了VC12文件夹的openCV-dlls,因为忘记了Visual Studio 2012是VC11的。现在可以了。也许这会帮助遇到同样问题并复制了错误文件夹的 dll 的其他人。

关于c++ - 调试断言失败表达式 : _pFirstBlock == pHead using OpenCV and C++ trying to call SurfFeatureDetector,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21261709/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com