aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/TCC/Tango.TCC.ArucoGenerator/ArcuGenerator.cpp
blob: 327a3a85e09639d7f6362fe59a17dc51105cef61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// ArcuGenerator.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <opencv2/opencv.hpp>
#include <cstdlib>
#include <opencv2/aruco.hpp>

using namespace std;
using namespace cv;


int main(int argc, char *argv[])
{
	if (argc < 4)
	{
		cout << "Not enough input arguments.";
		return 0;
	}

	int id = atoi(argv[1]);
	int size = atoi(argv[2]);
	char* file = argv[3];

	Mat markerImage;
	Ptr<aruco::Dictionary> dictionary = aruco::getPredefinedDictionary(aruco::DICT_4X4_50);
	aruco::drawMarker(dictionary, id, size, markerImage, 1);

	String name(file);
	imwrite(name, markerImage);

	cout << "Done!";
	
    return 0;
}