This class represents a marker. It is a vector of the fours corners ot the marker. More...
#include <marker.h>
Public Member Functions | |
void | calculateExtrinsics (float markerSize, const CameraParameters &CP) throw (cv::Exception) |
void | calculateExtrinsics (float markerSize, cv::Mat CameraMatrix, cv::Mat Distorsion=cv::Mat()) throw (cv::Exception) |
void | draw (cv::Mat &in, cv::Scalar color, int lineWidth=1, bool writeId=true) |
void | glGetModelViewMatrix (double modelview_matrix[16]) throw (cv::Exception) |
bool | isValid () const |
Marker () | |
Marker (const Marker &M) | |
~Marker () | |
Static Public Member Functions | |
static cv::Mat | createMarkerImage (int id, int size) throw (cv::Exception) |
Creates an ar marker with the id specified using a modified version of the hamming code. | |
Public Attributes | |
int | id |
cv::Mat | Rvec |
float | ssize |
cv::Mat | Tvec |
Private Member Functions | |
void | rotateXAxis (cv::Mat &rotation) |
Friends | |
bool | operator< (const Marker &M1, const Marker &M2) |
ostream & | operator<< (ostream &str, const Marker &M) |
This class represents a marker. It is a vector of the fours corners ot the marker.
Definition at line 8 of file marker.cpp.
aruco::Marker::Marker | ( | const Marker & | M | ) |
Definition at line 20 of file marker.cpp.
aruco::Marker::~Marker | ( | ) | [inline] |
void aruco::Marker::calculateExtrinsics | ( | float | markerSize, |
const CameraParameters & | CP | ||
) | throw (cv::Exception) |
Calculates the extrinsics (Rvec and Tvec) of the marker with respect to the camera
markerSize | size of the marker side expressed in meters |
CP | parmeters of the camera |
Definition at line 110 of file marker.cpp.
void aruco::Marker::calculateExtrinsics | ( | float | markerSize, |
cv::Mat | CameraMatrix, | ||
cv::Mat | Distorsion = cv::Mat() |
||
) | throw (cv::Exception) |
Calculates the extrinsics (Rvec and Tvec) of the marker with respect to the camera
markerSize | size of the marker side expressed in meters |
CameraMatrix | matrix with camera parameters (fx,fy,cx,cy) |
Distorsion | matrix with distorsion parameters (k1,k2,p1,p2) |
Definition at line 118 of file marker.cpp.
Mat aruco::Marker::createMarkerImage | ( | int | id, |
int | size | ||
) | throw (cv::Exception) [static] |
Creates an ar marker with the id specified using a modified version of the hamming code.
There are a total of 5 rows of 5 cols. Each row encodes a total of 2 bits, so there are 2^10 bits:(0-1023).
The least significative bytes are first (from left-up to to right-bottom)
Example: the id = 110 (decimal) is be represented in binary as : 00 01 10 11 10.
Then, it will generate the following marker:
Note that : The first bit, is the inverse of the hamming parity. This avoids the 0 0 0 0 0 to be valid
Definition at line 186 of file marker.cpp.
void aruco::Marker::draw | ( | cv::Mat & | in, |
cv::Scalar | color, | ||
int | lineWidth = 1 , |
||
bool | writeId = true |
||
) |
Draws this marker in the input image
Definition at line 82 of file marker.cpp.
void aruco::Marker::glGetModelViewMatrix | ( | double | modelview_matrix[16] | ) | throw (cv::Exception) |
Given the extrinsic camera parameters returns the GL_MODELVIEW matrix for opengl. Setting this matrix, the reference coordinate system will be set in this marker
Definition at line 30 of file marker.cpp.
bool aruco::Marker::isValid | ( | ) | const [inline] |
void aruco::Marker::rotateXAxis | ( | cv::Mat & | rotation | ) | [private] |
Definition at line 167 of file marker.cpp.
ostream& operator<< | ( | ostream & | str, |
const Marker & | M | ||
) | [friend] |
cv::Mat aruco::Marker::Rvec |
float aruco::Marker::ssize |
cv::Mat aruco::Marker::Tvec |