Etantonio
Etantonio

Reputation: 359

opencv aruco.h not found windows 10 visual studio

Hy

I'm trying to run OpenCV and Aruco on windows 10 with visual studio 2019,

no problem with installation of opencv and contribs using cmake and then build,

and I've C:\openCV\build\install\x64\vc16\bin\opencv_aruco411d.dll library ,

On Environment Variables of Windows 10:

In Visual Studio I've:

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"

but when I use simple first program:

I've that aruco.h is not found

#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);

}

where's the problem?

Antonio

Upvotes: 0

Views: 1573

Answers (1)

Etantonio
Etantonio

Reputation: 359

Library compilation is done with

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

but the VisualStudio solution aruco.sln produce a lot of linker error

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   

and seems not possible to apply to it a property sheet targetted to opencv.

Upvotes: 0

Related Questions