【发布时间】:2014-01-21 15:02:28
【问题描述】:
我在 C++ 中使用 OpenCV 有这个功能:
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;
}
...我收到以下错误:
谁能告诉我我的错误在哪里以及如何解决这个问题?我需要使用两个不同的图像调用此函数两次,但每次执行此操作时都会出现此错误。
我正在使用 Visual Studio 2012。
【问题讨论】:
标签: c++ opencv dll surf visual-c++-runtime