Drovisio
detector_common.h
Go to the documentation of this file.
1 #ifndef MASK_DETECTOR_COMMON_H
2 #define MASK_DETECTOR_COMMON_H
3 
6 #include <stdio.h>
7 #include "opencv2/core.hpp"
8 #include <opencv2/core/types.hpp>
9 #include <opencv2/core/utility.hpp>
10 #include <cctype>
11 #include <string>
12 #include <sstream>
13 #include <math.h>
14 #include<iostream>
15 #include <fstream>
16 #include <cv.hpp>
17 
18 namespace det_com {
22  typedef struct {
23  std::vector<int> keypoints_index;
24  double mean_angle;
25  double mean_distance;
26  double center_x;
27  double center_y;
28  } Line;
29 
33  typedef struct {
34  cv::Mat rotation_vector;
36  cv::Point2f center_brick;
37  int id;
38  } Block;
39 
43  typedef struct {
44  std::vector<cv::Scalar> colors;
45  int lower_area;
46  int upper_area;
47  int angle_threshold;
48  int distance_threshold;
49 
50  double camera_to_drone_trans_vector[4];
51  double camera_to_drone_rot_vector[4];
52 
53  double distance_between_points;
54  double distance_between_lines;
55  int camera_width;
56  int camera_height;
57  double camera_matrix[9];
58  double distortion_matrix[4];
59  double markerLength;
60  } Config;
61 
67  det_com::Config load_config(std::string filename);
68 
74  cv::Vec3d rot_to_euler(cv::Mat &R);
75 
81  cv::Mat euler_to_rot(const cv::Vec3d &euler);
82 }
83 
84 #endif //MASK_DETECTOR_COMMON_H
int id
Id detected in the ArUco marker, only used when detecting with ArUco.
Definition: detector_common.h:37
cv::Point2f center_brick
Center of the brick in the 2D image.
Definition: detector_common.h:36
double mean_distance
Distance mean between all pairs of consecutive points.
Definition: detector_common.h:25
cv::Mat translation_vector
Translation vector between the camera and the brick.
Definition: detector_common.h:35
A detected block in the image, along with the extracted spatial informations.
Definition: detector_common.h:33
std::vector< int > keypoints_index
The index of the keypoints.
Definition: detector_common.h:23
double mean_angle
Angle mean between all pairs of consecutive points.
Definition: detector_common.h:24
cv::Mat rotation_vector
Rotation vector between the camera and the brick.
Definition: detector_common.h:34
double center_y
Y-coordinate center between all the points.
Definition: detector_common.h:27
double center_x
X-coordinate center between all the points.
Definition: detector_common.h:26
Represents a line, made of equidistant and aligned color points.
Definition: detector_common.h:22
Config used.
Definition: detector_common.h:43
Definition: detector_common.cpp:7