Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.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++ OpenCV人员检测示例崩溃_C++_Opencv_Crash_Msvcr90.dll - Fatal编程技术网

C++ OpenCV人员检测示例崩溃

C++ OpenCV人员检测示例崩溃,c++,opencv,crash,msvcr90.dll,C++,Opencv,Crash,Msvcr90.dll,编译peopledetect.cpp进展顺利,但当我试图运行该程序时,它会在运行时崩溃 hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector()); 错误消息: openCV.exe中0x74a9ae7a处的未处理异常:0xC0000005:访问冲突写入位置0x00000000 调用堆栈: msvcr90.dll!74a9ae7a() opencv_objdetect231.dll!6dbfe397() openCV.ex

编译peopledetect.cpp进展顺利,但当我试图运行该程序时,它会在运行时崩溃

hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector());
错误消息: openCV.exe中0x74a9ae7a处的未处理异常:0xC0000005:访问冲突写入位置0x00000000

调用堆栈:

msvcr90.dll!74a9ae7a()  
opencv_objdetect231.dll!6dbfe397()  
openCV.exe!main()  Line 27 + 0x49 bytes
openCV.exe!__tmainCRTStartup()  Line 555 + 0x19 bytes
openCV.exe!mainCRTStartup()  Line 371
kernel32.dll!74f63677()     
ntdll.dll!77319d72()    
ntdll.dll!77319d45()    

在互联网上闲逛之后,我找不到任何东西,非常感谢任何帮助。

它在OS X下工作。有东西试图访问空指针。试着替换

hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector());

static vector detector=HOGDescriptor::getDefaultPeopleDetector();
如果(!detector.size()){
fprintf(stderr,“错误:getDefaultPeopleDetector返回NULL\n”);
返回-1;
}
hog.setsvm检测器(检测器);

查看错误是否发生在
getDefaultPeopleDetector
hog.setSVMDetector
中。这可能有助于缩小问题的范围。

这里仍然存在同样的问题。对我来说,它位于:getDefaultPeopleDetector
static vector<float> detector = HOGDescriptor::getDefaultPeopleDetector();
if (!detector.size()) {
    fprintf(stderr, "ERROR: getDefaultPeopleDetector returned NULL\n");
    return -1;      
}
hog.setSVMDetector(detector);