c++ - OpenCV 人物检测样本崩溃

标签 c++ opencv crash msvcr90.dll

编译 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<float> detector = HOGDescriptor::getDefaultPeopleDetector();
if (!detector.size()) {
    fprintf(stderr, "ERROR: getDefaultPeopleDetector returned NULL\n");
    return -1;      
}
hog.setSVMDetector(detector);

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

关于c++ - OpenCV 人物检测样本崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7338284/

相关文章:

c++ - Qt - 跟踪 QAbstractAnimation 运动

c++ - std::invoke_result_t 编译时语法错误

c++ - 来自 opencv gpu::convolve 的 cuda convnet equvilent 方法

C++ 字符串差异(la Python 的差异库)

python - 在函数 'inRange'中(-215:断言失败)! _src.empty()

Python cv2 MSER 不工作

iphone - Xcode 7.1 执行调试时总是崩溃

c++ - 发布版本中的程序崩溃

c++ - OpenCV 网络摄像头 MJPG 低 FPS

android - 选择大于 3mb 的照片时,cordova 应用程序崩溃