OpenCV 2.1:faceDetect.cpp 在发现丑陋的面孔时崩溃
HeadTrackerExample.exe 中 0x100342bf 处未处理的异常:0xC0000005:写入位置 0x00000000 时发生访问冲突。
不幸的是,调试信息不允许我更深入地探究。我正在链接 cv210.lib;cxcore210.lib;highgui210.lib;调试版本不起作用:
LDR: LdrpWalkImportDescriptor() 无法探测 D:\OpenCV2.1\bin\cv210d.dll 的清单,ntstatus 0xc0150002
我将尝试欺骗带有安妮海瑟薇打印输出的分类器,但我愿意接受其他建议。
https://code.ros.org/trac /opencv/browser/trunk/opencv/samples/c/facedetect.cpp
I am trying to compile the facedetect.cpp in the OpenCV\Samples\C folder, in Visual Studio 2010. The project compiles and begins just fine, shows a preview of my camera, and then seems to crash at cascade.detectMultiScale() as soon as it detects a face. I concluded that OpenCV thinks I am too ugly.
Unhandled exception at 0x100342bf in HeadTrackerExample.exe: 0xC0000005: Access violation writing location 0x00000000.
Unfortunately the debug info doesn't let me probe deeper. I am linking against cv210.lib;cxcore210.lib;highgui210.lib; the debug versions won't work:
LDR: LdrpWalkImportDescriptor() failed to probe D:\OpenCV2.1\bin\cv210d.dll for its manifest, ntstatus 0xc0150002
I'm going to try to trick the classifier with a printout of Anne Hathaway but I am open to other suggestions.
https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/c/facedetect.cpp
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想我比你好看,因为它在这里工作(在 OS X 下)。您确定已成功加载 xml 文件吗?您是否使用默认的 xml 文件(haarcascade_frontalface_alt.xml 和 haarcascade_eye_tree_eyeglasses.xml)?
看起来你确实有一个空指针。尝试在调用
cascade.detectMultiScale()
时设置断点,并检查cascade
、smallImg
、smallImg.data< 的值/code> 和
面孔
。编辑:填充
faces
向量这是
detectMultiScale
代码:直到最后一行才接触
faces
向量全部检测完成。如果您喜欢冒险,可以在此处抛出一些printf
语句来查看cvHaarDetectObjects
是否正在完成以及是否返回空指针。I guess I'm better looking than you because it's working here (under OS X). Are you sure you're successfully loading the xml files? Are you using the default xml files (haarcascade_frontalface_alt.xml and haarcascade_eye_tree_eyeglasses.xml)?
It sure looks like you have a null pointer. Try setting a breakpoint at the call to
cascade.detectMultiScale()
and examine the values ofcascade
,smallImg
,smallImg.data
, andfaces
.Edit: populating the
faces
vectorHere's the
detectMultiScale
code:It's not touching the
faces
vector until the last line after all the detection is done. If you are adventurous, you could throw someprintf
statements in here to see ifcvHaarDetectObjects
is completing and if it is returning a null pointer.我花了一天时间试图解决这个问题。谁知道为什么会崩溃?我无法链接到调试 DLL,所以我们永远不会知道。我下载了 OpenCV-2.1.0-win32-vs2008.exe 发行版。我使用的是 Visual Studio 2010。因此,exe 因
LDR 崩溃
:LdrpWalkImportDescriptor() 无法探测 D:\OpenCV2.1\bin\cv210d.dll 的清单,ntstatus 0xc0150002
调试器:: 在进程加载期间抛出未处理的不可继续异常
程序“[5172] HeadTrackerExample.exe: Native”已退出,代码为 -1072365566 (0xc0150002)。
这是“0xc0150002 错误”。根据 Dependency Walker 的说法,OpenCV 调试 DLL 正在尝试查找 msvcr90d.dll 和 msvct90d.dll(Visual Studio 2008 调试运行时 DLL)。好吧,我获得了这些,但它仍然不起作用,所以接下来就涉及到深奥的 Windows 并排和清单内容了。
我切换到 OpenCV-2.3.1-win-superpack.exe 发行版,它现在可以工作了。
I spent the day trying to fix this. Who knows why it was crashing? I couldn't link to the debug DLLs so we'll never know. I downloaded the OpenCV-2.1.0-win32-vs2008.exe distribution. And I am using Visual Studio 2010. Therefore, the exe was crashing with
LDR: LdrpWalkImportDescriptor() failed to probe D:\OpenCV2.1\bin\cv210d.dll for its manifest, ntstatus 0xc0150002
Debugger:: An unhandled non-continuable exception was thrown during process load
The program '[5172] HeadTrackerExample.exe: Native' has exited with code -1072365566 (0xc0150002).
This is the "0xc0150002 error". According to Dependency Walker, the OpenCV debug DLLs are trying to find msvcr90d.dll and msvct90d.dll, the Visual Studio 2008 debug runtime DLLs. Well, I obtained these and it still didn't work, so then this gets into esoteric Windows sidebyside and manifest stuff.
I switched to the OpenCV-2.3.1-win-superpack.exe distribution and it is now working.