Visual Studio调试模式为opencv HoughLines()抛出断点

时间:2014-10-14 11:40:55

标签: c++ opencv visual-studio-2012 visual-studio-debugging

我正在使用Visual Studio 2012和OpenCv 3.0。我正在使用HoughLines函数进行行提取。如果我在发布模式下运行代码,则VS不会抛出任何错误/异常。

如果我在调试模式下运行代码,而不是上面提到的函数(HoughLines)在VS中触发断点。如果我让它继续,则抛出以下异常:

  

trackingLines.exe中0x77AAE753(ntdll.dll)的未处理异常:    0xC0000374:堆已损坏(参数:0x77AE4270)。

异常抛出线 _Container_proxy *_Parent_proxy = _Parent->_Myproxy;

xutility 文件中的VS/VC/include

如何设置Debug异常列表以便能够在没有此异常的情况下调试我的代码?

导致此例外的原因是什么?

我的代码:

#include <iostream>
#include <stdio.h>
#include <ctime>

#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/video/tracking.hpp"

#include "opencv\cv.h"
#include "opencv\highgui.h"

#include <string.h>
#include <iostream>
#include <fstream>

using namespace cv;
using namespace std;

int main( int _argc, char** _argv )
{
Mat src, src_bev;
Mat src_gray, src_d;  
IplImage * imageIn = cvLoadImage("img1.jpg"); 
src = cvarrToMat(imageIn,true);   
int  lowThreshold = 32, ratio = 1;
Canny( src, src_gray, lowThreshold, lowThreshold*((double)ratio/10+2), 3 );
vector<Vec2f> lines;  
HoughLines(src_gray, lines, 1, CV_PI/180, 100, 0, 0 );    
return 0;
}

请注意,我首先使用Iplimage阅读,而不是将其转换为Mat。读取图像或显示没有问题。唯一的问题是使用HoughLines函数调用。

0 个答案:

没有答案
相关问题