Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
TagGenerator.hpp
Go to the documentation of this file.
1
11#include <opencv2/opencv.hpp>
12#include <string>
13
15
16
25void GenerateOpenCVArucoMarker(cv::aruco::PredefinedDictionaryType eDictionary, unsigned short sMarker)
26{
27 switch (eDictionary)
28 {
33 if (sMarker > 49)
34 {
35 return;
36 }
37 break;
42 if (sMarker > 99)
43 {
44 return;
45 }
46 break;
51 if (sMarker > 249)
52 {
53 return;
54 }
55 break;
60 if (sMarker > 999)
61 {
62 return;
63 }
64 break;
65 default: break;
66 }
67
68 std::string szMarkerFilename = "marker";
69 szMarkerFilename += std::to_string(eDictionary);
70 szMarkerFilename += "_";
71 szMarkerFilename += std::to_string(sMarker);
72 szMarkerFilename += ".png";
73
74 cv::Mat cvMarkerImage;
76 cv::aruco::generateImageMarker(cvDictionary, sMarker, 200, cvMarkerImage, 1);
77 cv::imwrite(szMarkerFilename.c_str(), cvMarkerImage);
78}
void GenerateOpenCVArucoMarker(cv::aruco::PredefinedDictionaryType eDictionary, unsigned short sMarker)
Generate an ArUco Tag.
Definition TagGenerator.hpp:25
bool imwrite(const String &filename, InputArray img, const std::vector< int > &params=std::vector< int >())
PredefinedDictionaryType
void generateImageMarker(const Dictionary &dictionary, int id, int sidePixels, OutputArray img, int borderBits=1)
Dictionary getPredefinedDictionary(PredefinedDictionaryType name)