Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/149.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Visual Studio调试模式为opencv HoughLines()抛出断点_C++_Opencv_Visual Studio 2012_Visual Studio Debugging - Fatal编程技术网

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

C++ Visual Studio调试模式为opencv HoughLines()抛出断点,c++,opencv,visual-studio-2012,visual-studio-debugging,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) 异常在第行抛出 \u Container\u

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

如果我在调试模式下运行代码,则上述函数(
HoughLines
)会触发VS中的断点。如果我让它继续运行,则会引发以下异常:

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

异常在第行抛出
\u Container\u proxy*\u Parent\u proxy=\u Parent->\u Myproxy
VS/VC/include中的xutility文件中

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

是什么导致了这种异常

我的代码:

#包括
#包括
#包括
#包括“opencv2/imgcodecs.hpp”
#包括“opencv2/highgui/highgui.hpp”
#包括“opencv2/imgproc/imgproc.hpp”
#包括“opencv2/video/tracking.hpp”
#包括“opencv\cv.h”
#包括“opencv\highgui.h”
#包括
#包括
#包括
使用名称空间cv;
使用名称空间std;
int main(int_argc,char**u argv)
{
Mat src,src_bev;
Mat src_gray,src_d;
IplImage*imageIn=cvLoadImage(“img1.jpg”);
src=cvarrToMat(imageIn,真);
int lowThreshold=32,比值=1;
Canny(src,src_gray,低阈值,低阈值*((双)比/10+2),3);
矢量线;
HoughLines(src_灰线、线、1、CV_PI/180、100、0、0);
返回0;
}

请不要介意,首先我在
Iplimage
中阅读,然后将其转换为
Mat
。读取图像或显示图像时没有问题。唯一的问题是如何调用
HoughLines
函数。

“请不要介意,首先我在Iplimage中阅读”-但这很可能是问题所在。上面的异常和事实都是,你不使用imDead()?(为什么?)暗示了与STD C++ LIBS的链接问题。您正在混合调试/发布库吗?多线程dll c-runtime(如果有,也可以是调试版本)?再次,请仔细检查链接器设置,同时请恢复使用imread()我将从其他软件工具收到
Iplimage
。我知道使用此数据类型已经过时,如果可以,我将只使用
Mat
。这只是我的算法的测试阶段,我想要调试模式。我用的是同一个库。从opencv进行调试和发布,即(全部):
opencv_world300.lib;opencv_ts300.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(附加依赖项)
ok。对不起,我把它错当成相关的问题了。我指的是更多的opencv库,只有以d结尾的库才应该在调试模式下使用。但是你应该做的第一件事是检查你的输入图像是否有效
if(src.empty())//bahhh
r您确定要使用的lib和bin吗?还要确保您使用的是Visual Studio 2012的lib和bin。这些应该在vc11文件夹中。
#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;
}