aruco drawMarker

asked 2018-09-12 11:34:56 -0500

Simonc gravatar image

updated 2018-09-12 11:36:16 -0500


I am trying to draw aruco markers but can't get it right. Is it possible that I have incorrectly linked the aruco.hpp files? How can I test for this? Here is the code. The errors fall on the 3 and 4th lines.

cv::Mat markerImage;
cv::Ptr<aruco::DetectorParameters> parameters;
cv::Ptr<aruco::Dictionary> dictionary=aruco::getPredefinedDictionary(aruco::DICT_6X6_250);
cv::aruco::drawMarker(dictionary,1,200, markerImage, 1);
imwrite("test.png", markerImage);

The error

obj/Debug/main.o||In function `main':| /home/simon/OpenCV_ws/OpenCV_test/main.cpp|28|undefined reference to `cv::aruco::getPredefinedDictionary(cv::aruco::PREDEFINED_DICTIONARY_NAME)'| /home/simon/OpenCV_ws/OpenCV_test/main.cpp|29|undefined reference to `cv::aruco::drawMarker(cv::Ptr<cv::aruco::Dictionary> const&, int, int, cv::_OutputArray const&, int)'|

I tried to fix the dictionary error but it didn't.

OpenCV: 3.4.3 using Code:blocks on Linux: 18.04

edit retag flag offensive close merge delete


Simonc gravatar imageSimonc ( 2018-09-12 11:35:50 -0500 )edit

you have to correctly link libs , not header files here ( -lopencv_aruco )

berak gravatar imageberak ( 2018-09-13 01:10:06 -0500 )edit