0
当我尝试调试我的项目时,我得到Debug Assertion Failed
,在执行结束时。你可以在下面看到它。FAST函数OpenCV Debug Assertion Faild
我认为这个问题是从OpenCV的,与FAST功能,因为当我注释掉包含此功能的线,它工作正常。
这是我的代码:
#pragma once
#include <opencv2/core/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <iostream>
#include <string>
using namespace cv;
using namespace std;
int main()
{
string table[2] = { "background_2.jpg","foreground_2.jpg" };
Mat firstImage = imread(table[0], IMREAD_COLOR);
Mat secondImage = imread(table[1], IMREAD_COLOR);
Mat result;
subtract(firstImage, secondImage, result);
Mat resultGray, firstImageGray, secondImageGray;
cvtColor(firstImage, firstImageGray, COLOR_BGR2GRAY);
cvtColor(secondImage, secondImageGray, COLOR_BGR2GRAY);
cvtColor(result, resultGray, COLOR_BGR2GRAY);
Canny(firstImageGray, firstImageGray, 33, 100, 3);
Canny(secondImageGray, secondImageGray, 33, 100, 3);
Canny(resultGray, resultGray, 33, 100, 3);
vector <KeyPoint> keyPoints;
FAST(resultGray, keyPoints, 9, true);//Probably here is the problem.
Mat resultKeyPoints;
drawKeypoints(resultGray, keyPoints, resultKeyPoints, 156);
return 0;
}
我建我的项目在Visual Studio 2015年预览。
当我点击“重试”,在这一断言突破,我有以下异常:
Unhandled exception at 0x00007FF851891B4B (ucrtbased.dll) in
OpenCVProject.exe: An invalid parameter was passed to a function that considers invalid parameters fatal.
这是从VS 120线xmemory0文件。
使用Visual Studio 2015构建opencv吗? – drescherjm
此外,当你得到弹出错误命中重试,然后看看你的代码的调用堆栈确切地看到代码中的哪一行导致了这个问题。 – drescherjm
@drescherjm是的,但只有预览。新的VS2015不起作用。 这是来自callstack的屏幕http://i.stack.imgur.com/pAo65.png –