28 #ifndef _Aruco_Marker_H 29 #define _Aruco_Marker_H 32 #include <opencv2/core/core.hpp> 58 Marker(
const std::vector< cv::Point2f > &corners,
int _id = -1);
64 bool isValid()
const {
return id != -1 && size() == 4; }
68 void draw(cv::Mat &in, cv::Scalar color,
int lineWidth = 1,
bool writeId =
true)
const;
75 void calculateExtrinsics(
float markerSize,
const CameraParameters &CP,
bool setYPerpendicular =
true)
throw(cv::Exception);
82 void calculateExtrinsics(
float markerSize, cv::Mat CameraMatrix, cv::Mat Distorsion = cv::Mat(),
bool setYPerpendicular =
true)
throw(cv::Exception);
87 void glGetModelViewMatrix(
double modelview_matrix[16])
throw(cv::Exception);
99 void OgreGetPoseParameters(
double position[3],
double orientation[4])
throw(cv::Exception);
103 cv::Point2f getCenter()
const;
106 float getPerimeter()
const;
109 float getArea()
const;
119 for (
int i = 0; i < 4; i++)
120 str <<
"(" << M[i].x <<
"," << M[i].y <<
") ";
122 for (
int i = 0; i < 3; i++)
123 str << M.
Tvec.ptr<
float >(0)[i] <<
" ";
125 for (
int i = 0; i < 3; i++)
126 str << M.
Rvec.ptr<
float >(0)[i] <<
" ";
133 void rotateXAxis(cv::Mat &rotation);
friend ostream & operator<<(ostream &str, const Marker &M)
This class represents a marker. It is a vector of the fours corners ot the marker.
Parameters of the camera.
friend bool operator<(const Marker &M1, const Marker &M2)