-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
45 lines (33 loc) · 1.07 KB
/
main.cpp
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
37
38
39
40
41
42
43
44
45
#include <iostream>
#include <vector>
#include <string>
#include <opencv2/opencv.hpp>
#include <Eigen/Dense>
#include "Vision/Cube.h"
#include "Vision/Cone.h"
#include "Vision/AprilTag.h"
#include "Utils/Utils.h"
using namespace ChargedUpCv;
int main()
{
cv::VideoCapture cap(0);
cv::Mat frame;
while (true) {
cap.read(frame);
std::vector<Eigen::Vector3d> conePoses = Vision::DetectCones(frame);
std::cout << "CONES:" << std::endl;
for (int i = 0; i < conePoses.size(); i++)
{
Eigen::Vector3d pos = conePoses[i];
std::cout << " Cone " << i << ": (" << pos.x << ", " << pos.y << ", " << pos.z << ")" << std::endl;
}
std::vector<Eigen::Vector3d> cubePoses = Vision::DetectCubes(frame);
std::cout << "CUBES:" << std::endl;
for (int i = 0; i < cubePoses.size(); i++)
{
Eigen::Vector3d pos = cubePoses[i];
std::cout << " Cube " << i << ": (" << pos.x << ", " << pos.y << ", " << pos.z << ")" << std::endl;
}
}
return 0;
}