All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Friends
aruco::Marker Class Reference

This class represents a marker. It is a vector of the fours corners ot the marker. More...

#include <marker.h>

List of all members.

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)

Detailed Description

This class represents a marker. It is a vector of the fours corners ot the marker.

Definition at line 13 of file marker.h.


Constructor & Destructor Documentation

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]

Definition at line 31 of file marker.h.


Member Function Documentation

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

Parameters:
markerSizesize of the marker side expressed in meters
CPparmeters 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

Parameters:
markerSizesize of the marker side expressed in meters
CameraMatrixmatrix with camera parameters (fx,fy,cx,cy)
Distorsionmatrix 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:

  1. 1st row encodes 00: 1 0 0 0 0 : hex 0x10
  2. 2nd row encodes 01: 1 0 1 1 1 : hex 0x17
  3. 3nd row encodes 10: 0 1 0 0 1 : hex 0x09
  4. 4th row encodes 11: 0 1 1 1 0 : hex 0x0e
  5. 5th row encodes 10: 0 1 0 0 1 : hex 0x09

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]

Indicates if this object is valid

Definition at line 34 of file marker.h.

void aruco::Marker::rotateXAxis ( cv::Mat &  rotation) [private]

Definition at line 167 of file marker.cpp.


Friends And Related Function Documentation

bool operator< ( const Marker M1,
const Marker M2 
) [friend]

Definition at line 59 of file marker.h.

ostream& operator<< ( ostream &  str,
const Marker M 
) [friend]

Definition at line 65 of file marker.h.


Member Data Documentation

Definition at line 17 of file marker.h.

Definition at line 21 of file marker.h.

Definition at line 19 of file marker.h.

Definition at line 21 of file marker.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


aruco_pose
Author(s): Julian Brunner
autogenerated on Thu May 23 2013 12:15:46