【问题标题】:opencv aruco.h not found windows 10 visual studioopencv aruco.h 未找到 Windows 10 Visual Studio
【发布时间】:2019-07-02 05:51:37
【问题描述】:

Hy

我正在尝试使用 Visual Studio 2019 在 Windows 10 上运行 OpenCV 和 Aruco,

使用cmake安装opencv和contribs然后构建没问题,

我有 C:\openCV\build\install\x64\vc16\bin\opencv_aruco411d.dll 库,

关于 Windows 10 的环境变量:

  • OPENCV_DIR=C:\openCV\build\install\x64\vc16

  • PATH 变量包括 %OPENCV_DIR%\bin

我在 Visual Studio 中:

Linker --> Input --> Addictional dipendence                  contains  "opencv_aruco411d.lib"

Linker --> General --> Addictional library directory      contains   "$(OPENCV_DIR)\lib"

C/C++ --> General --> Addictional inclusion directory  contains  "$(OPENCV_DIR)\..\..\include"

但是当我使用简单的第一个程序时:

我发现 aruco.h 没有找到

#include "aruco.h"

#include <iostream>

#include <opencv2/highgui/highgui.hpp>

 int main(int argc,char **argv){

   if (argc != 2 ){ std::cerr<<"Usage: inimage"<<std::endl;return -1;}

   cv::Mat image=cv::imread(argv[1]);

   aruco::MarkerDetector MDetector;

   //detect

   std::vector<aruco::Marker> markers=MDetector.detect(image);

   //print info to console

   for(size_t i=0;i<markers.size();i++){

       std::cout<<markers[i]<<std::endl;

      //draw in the image

       markers[i].draw(image);



   cv::imshow("image",image);

   cv::waitKey(0);

}

问题出在哪里?

安东尼奥

【问题讨论】:

    标签: c++ opencv aruco


    【解决方案1】:

    库编译完成

    C:\aruco-3.1.2;
    mkdir build; 
    cd  build ; 
    cmake .. -DOpenCV_DIR=C:\openCV\build; 
    

    但是VisualStudio解决方案aruco.sln会产生很多链接器错误

    Errore  LNK2019 riferimento al simbolo esterno "bool __cdecl cv::imwrite(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::debug_build_guard::_InputArray const &,class std::vector<int,class std::allocator<int> > const &)" (?imwrite@cv@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV_InputArray@debug_build_guard@1@AEBV?$vector@HV?$allocator@H@std@@@3@@Z) non risolto nella funzione main   aruco_create_markermap  C:\aruco-3.1.2\build\utils_markermap\aruco_create_markermap.obj 1   
    

    并且似乎无法将针对 opencv 的属性表应用于它。

    【讨论】:

      猜你喜欢
      • 2019-09-20
      • 2017-08-31
      • 1970-01-01
      • 2016-04-03
      • 1970-01-01
      • 1970-01-01
      • 2019-12-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多