我使用 vcpkg 为 Windows 64 位安装了 opencv[dnn]。这是./vcpkg list
返回的内容
jsoncpp:x64-windows 1.9.1 jsoncpp is an implementation of a JSON reader an...
libjpeg-turbo:x64-windows 2.0.3 libjpeg-turbo is a JPEG image codec that uses SI...
liblzma:x64-windows 5.2.4-2 Compression library with an API similar to that ...
libpng:x64-windows 1.6.37-5 libpng is a library implementing an interface fo...
libwebp:x64-windows 1.0.2-7 Lossy compression of digital photographic images.
opencv4:x64-windows 4.1.1-3 computer vision library
opencv4[dnn]:x64-windows Enable dnn module
opencv4[jpeg]:x64-windows JPEG support for opencv
opencv4[opengl]:x64-windows opengl support for opencv
opencv4[png]:x64-windows PNG support for opencv
opencv4[tiff]:x64-windows TIFF support for opencv
opencv4[webp]:x64-windows WebP support for opencv
opengl:x64-windows 0.0-5 Open Graphics Library (OpenGL)[3][4][5] is a cro...
protobuf:x64-windows 3.10.0 Protocol Buffers - Google's data interchange format
tiff:x64-windows 4.0.10-8 A library that supports the manipulation of TIFF...
zlib:x64-windows 1.2.11-5 A compression library
所以我认为它肯定存在,并且 Visual Studio 中的代码行#include <opencv2\dnn.hpp>
不会引发任何错误,但是在键入时cv::dnn::Net net;
我会得到错误,namespace cv::dnn has no member 'Net'
即使我知道它确实如此。
然后在使用 Visual Studio 2019 进行编译时,我在async.hpp
OpenCV 附带的其他文件中出现大量错误,
Error C3646 'CV_NOEXCEPT': unknown override specifier (compiling source file src\main.cpp) ...opencv2\core\async.hpp 34
并在以下文件中出现更多编译错误:
- dnn.hpp
- 异步.hpp
- 字典.hpp
- 版本.hpp
- 层.hpp
- dnn.inl.hpp
- 接口引擎.hpp
我相信这些都与包含的 dnn 模块相关联。
编辑:我还使用 vcpkg 安装了 jsoncpp,它工作正常。