我正在编写一个使用 PCL kinfu 的程序,并且我正在使用 openCV 人脸检测。我遇到了一些堆问题,所以我隔离了 openCV 的代码来尝试检查问题是否在那里。在注释掉几乎所有内容后,我遇到了一些奇怪的事情。只有一个 'CascadeClassifier' 类的全局声明,它会导致 valgrind 对可能丢失但仍可访问的块发出警报。注释掉这个声明可以正常工作。我真的不确定发生了什么,并希望得到任何帮助。我附上了我有问题的代码(没有注释掉的部分)。谢谢!
#include "opencv2/objdetect/objdetect.hpp"
using namespace cv;
CascadeClassifier c;
int main() {
return 0;
}
**Valgrind output:**
==3316== Memcheck, a memory error detector
==3316== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3316== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==3316== Command: ./test
==3316==
==3316==
==3316== HEAP SUMMARY:
==3316== in use at exit: 297,370 bytes in 1,393 blocks
==3316== total heap usage: 3,446 allocs, 2,053 frees, 655,130 bytes allocated
==3316==
==3316== LEAK SUMMARY:
==3316== definitely lost: 0 bytes in 0 blocks
==3316== indirectly lost: 0 bytes in 0 blocks
==3316== possibly lost: 4,676 bytes in 83 blocks
==3316== still reachable: 292,694 bytes in 1,310 blocks
==3316== suppressed: 0 bytes in 0 blocks
==3316== Rerun with --leak-check=full to see details of leaked memory
==3316==
==3316== For counts of detected and suppressed errors, rerun with: -v
==3316== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)