-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharuco_configuration.h
61 lines (51 loc) · 1.64 KB
/
aruco_configuration.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/****************************************************************
* Author: Edgar Buchanan *
* File: aruco_configuration.h *
* Functions to initialize tracking system and to recover *
* position and orientation of the tags. *
* Function to capture frames can be also found in this file. *
****************************************************************/
#ifndef ARUCOCONF_H
#define ARUCOCONF_H
#include <iostream>
#include <iomanip>
#include <vector>
#include <iCVCDriver.h>
#include <iCVCImg.h>
#include <iCVGenApi.h>
#include <CVCError.h>
#include <iCVCUtilities.h>
#include <opencv2/opencv.hpp>
#include <opencv2/aruco.hpp>
using namespace std;
using namespace cv;
#define ARENA_HEIGHT 1.0f // table: 75cm; Floor: 2cm
#define CAMERA_HEIGHT 245.75f
#define ROBOT_HEIGHT 4.0f // Psi-swarm
typedef struct{
float x_pos;
float y_pos;
float angle;
Point2f pixel_coord;
} tagData;
/*
* Initialize machine vision
*/
IMG initialize_machine_vision();
Mat cvb_to_ocv_nocopy(IMG cvbImg);
void projectpoint_image_to_world(cv::Mat cameraMatrix, double world_z, cv::Point_<float> undistort_imgpoint, cv::Point_<float> &undistort_worldpoint);
/*
* Capture in image actual frame
* @param image - Actual frame
* @param counter - Number of the frame
* @return Increases counter by one.
*/
int capture_image(Mat image, int counter);
/*
* Retrieves the position of a single tag
* @param ID - ID of the tag requested
* @param prev_pos - Previous position of the tag
* @return Position of the marker of ID.
*/
tagData retrieve_position(cv::Mat cameraMatrix, cv::Mat distCoeffs, Mat image, int ID, tagData prev_pos);
#endif /* ARUCOCONF_H */