c++ - opencv\modules\core\src\persistence.cpp :2697: error: (-27) NULL or empty buffer in function cvOpenFileStorage

标签 c++ opencv

我正在尝试运行人脸检测应用程序,但出现以下错误:

Unexpected Standard exception from MEX file.
What() is:..\..\..\..\opencv\modules\core\src\persistence.cpp:2697: error: (-27)
NULL or empty buffer in function cvOpenFileStorage

最佳答案

如果您使用的是 haarcascade_frontalface_default.xml,请检查 xml 文件内容。

前三行应该是:

<?xml version="1.0"?>
<!--
    Stump-based 24x24 discrete(?) adaboost frontal face detector.

我无意中下载了链接到 haarcascade_frontalface_default.xml 文件的 html 而不是 xml 本身,并得到了与您相同的错误。

关于c++ - opencv\modules\core\src\persistence.cpp :2697: error: (-27) NULL or empty buffer in function cvOpenFileStorage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31696892/

相关文章:

c++ - std::copy 从 vector 的位置到 vector 的位置

c++ - 用户提供的显式默认函数定义为已删除的情况

c++ - rapidjson writer 生成额外的大括号

python - OpenCV Python,从命名管道读取视频

opencv - 如何在 OpenCV 中将一堆特征点组合成一个 blob?

c++ - 链接 lib 时未解析的外部符号,编译器将字母 'A' 添加到函数名称

c++ - Visual C++ _snprintf 将 errno 设置为 ERANGE

python - 使用 Numpy 将值映射到更高维度

c++ - 使用 openCV 放大高强度

python - 在 OpenCV-Python 中绘制直方图