【问题标题】:How to bind OpenCV-contribute-modules to MATLAB?如何将 OpenCV-contribute-modules 绑定到 MATLAB?
【发布时间】:2017-06-19 20:11:16
【问题描述】:

我想在 MATLAB 中使用 OpenCV 类(来自contribute_modules)。我正在尝试将 OpenCV 绑定到 MATLAB。当我使用标准的opencv接口时没问题。但我需要使用来自贡献模块的类xphoto。我已经在 CMake 和 Visual Studio 2010 中使用贡献模块构建了 OpenCV。它工作正常。我检查了使用 MATLAB。 MATLAB 路径很好找到。 我遵循了 Github 的教程。

我在 MATLAB 中仍然有这个错误:

Building with 'Microsoft Visual C++ 2010'. Error using mexOpenCV (line 120) bm3d.cpp C:\Users\Desktop\bm3d\bm3d.cpp(11) : fatal error C1083: Cannot open include file: 'opencv2/xphoto.hpp': No such file or directory

谁能帮帮我,请问我该怎么做?

如果有任何帮助,我将不胜感激。

【问题讨论】:

    标签: c++ matlab opencv mex opencv3.0


    【解决方案1】:

    我迟到了几个月,但我会在这里为后代回答。 mexOpenCV 允许 -I-l-L 标志,就像 gcc 允许的那样。因此,您真正需要做的就是使用这些标志在 CPP 文件中指向您需要的库。例如,

    mexOpenCV getaruco.cpp -L~/opencv310/lib/ -lopencv_aruco.3.1.0 -I/usr/local/include
    

    将链接到位于 ~/opencv310/lib 中的 aruco 模块,并且相应的头文件位于 /usr/local/include 中。我确信 Windows 上也有等效的标志。

    有关详细信息,请参阅 MATLAB 中的help mexOpenCV

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-11-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-30
      • 1970-01-01
      • 2015-02-10
      • 2018-03-04
      相关资源
      最近更新 更多