简体   繁体   English

OpenCV + Visual Studio 2008-程序在调试中运行良好,但在常规执行中访问冲突

[英]OpenCV+Visual Studio 2008 - Program runs fine in debug but access violation in regular execution

I'm working on a computer vision program at the moment with OpenCV in C++. 目前,我正在使用C ++中的OpenCV开发计算机视觉程序。 It seems to work 100% fine with a live feed from a webcam but when I tried to feed in a stream from an avi file it started crashing with an "Access Violation" error. 使用网络摄像头的实时供稿似乎可以100%正常工作,但是当我尝试从avi文件供稿时,它开始崩溃并出现“访问冲突”错误。 I can't see why this would be the case because the only difference between the two is the initial frame-grabbing- the image processing is the same afterwards. 我看不到为什么会这样,因为两者之间的唯一区别是初始抓帧-之后的图像处理是相同的。

I'm developing in VS2008. 我正在VS2008中进行开发。 The curious thing is that when I place a breakpoint in my main() and debug (F5) the program runs fine. 奇怪的是,当我在main()中放置一个断点并调试(F5)时,程序运行正常。 However, when I Start Without Debugging (Ctrl+F5) I get the error. 但是,当我不调试而开始(Ctrl + F5)时,出现错误。

Has anybody encountered a similar problem or would anyone know why my program would appear to work fine when debugging but not in normal execution? 有没有人遇到过类似的问题,或者有人知道为什么我的程序在调试时似乎可以正常运行,但不能正常运行吗?

Nothing specific about OpenCV, but the fact that it behaves differently with a different source stream, and in or out of the debugger, makes me think it is a timing issue. 关于OpenCV并没有什么特别的,但是它在不同的源流中以及在调试器中或调试器之外的行为不同,这一事实使我认为这是一个定时问题。 You could try attachng the debugger after the crash happens maybe. 您可以在崩溃发生后尝试附加调试器。

I would suspect uninitialized variables. 我会怀疑未初始化的变量。 Many debuggers initialize all variables, including those that are not. 许多调试器会初始化所有变量,包括未初始化的变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 调试模式下的访问冲突错误,但应用程序在 Visual Studio2015 中编译的 dll 的发布模式下运行 - Access violation error in debug mode but application runs in release mode for a dll compiled in visual studio2015 Visual Studio调试器失败,但程序运行时运行良好......? - Visual Studio debugger fails but program runs fine when built…? 时间问题? 程序可以在Visual Studio中正常运行,但不能独立运行 - Timing issue? Program runs fine in Visual Studio but not standalone 在调试模式下访问冲突,但在发布模式下很好 - Access Violation in debug mode, but fine in release mode 如何在Visual Studio 2008中进行调试 - How to debug in visual studio 2008 Visual Studio 2010上的访问冲突 - Access Violation on Visual Studio 2010 Visual Studio 2008 - vftable指针不正确? 调试模式崩溃,发布很好 - Visual Studio 2008 - vftable pointer incorrect? Debug mode crashes, Release is fine OpenCV Build正常,调试会引发错误,可以从.exe正常运行 - OpenCV Build ok, debug throws error, runs fine from .exe 在Visual Studio 2008上安装OpenCV 2.4.5 - Installation of OpenCV 2.4.5 on Visual Studio 2008 “访问冲突写入位置”使用Visual Studio调试Windows ARM64的cmake项目 - "Access violation writing location" using Visual Studio to debug cmake project for Windows ARM64
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM