Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Friends | List of all members
aruco::Marker Class Reference

#include <marker.h>

Inheritance diagram for aruco::Marker:
Inheritance graph
[legend]

Public Member Functions

void calculateExtrinsics (float markerSize, const CameraParameters &CP, bool setYPerpendicular=true)
 
void calculateExtrinsics (float markerSize, cv::Mat CameraMatrix, cv::Mat Distorsion=cv::Mat(), cv::Mat Extrinsics=cv::Mat(), bool setYPerpendicular=true, bool correctFisheye=false)
 
void copyTo (Marker &m) const
 
void draw (cv::Mat &in, cv::Scalar color=cv::Scalar(0, 0, 255), int lineWidth=-1, bool writeId=true, bool writeInfo=false) const
 
void fromStream (std::istream &str)
 
vector< cv::Point3f > get3DPoints () const
 
float getArea () const
 
cv::Point2f getCenter () const
 
float getPerimeter () const
 
float getRadius () const
 
cv::Mat getTransformMatrix () const
 
void glGetModelViewMatrix (double modelview_matrix[16])
 
bool isPoseValid () const
 
bool isValid () const
 
 Marker ()
 
 Marker (const Marker &M)
 
 Marker (const std::vector< cv::Point2f > &corners, int _id=-1)
 
 Marker (int id)
 
void OgreGetPoseParameters (double position[3], double orientation[4])
 
Markeroperator= (const Marker &m)
 
bool operator== (const Marker &m) const
 
void toStream (std::ostream &str) const
 
 ~Marker ()
 

Static Public Member Functions

static vector< cv::Point3f > get3DPoints (float msize)
 

Public Attributes

vector< cv::Point > contourPoints
 
std::string dict_info
 
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)
 
std::ostream & operator<< (std::ostream &str, const Marker &M)
 

Detailed Description

Definition at line 35 of file marker.h.

Constructor & Destructor Documentation

◆ Marker() [1/4]

aruco::Marker::Marker ( )

Definition at line 35 of file marker.cpp.

◆ Marker() [2/4]

aruco::Marker::Marker ( int  id)

Definition at line 47 of file marker.cpp.

◆ Marker() [3/4]

aruco::Marker::Marker ( const Marker M)

Definition at line 59 of file marker.cpp.

◆ Marker() [4/4]

aruco::Marker::Marker ( const std::vector< cv::Point2f > &  corners,
int  _id = -1 
)

Definition at line 67 of file marker.cpp.

◆ ~Marker()

aruco::Marker::~Marker ( )
inline

Definition at line 63 of file marker.h.

Member Function Documentation

◆ calculateExtrinsics() [1/2]

void aruco::Marker::calculateExtrinsics ( float  markerSize,
const CameraParameters CP,
bool  setYPerpendicular = true 
)

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
setYPerpendicularIf set the Y axis will be perpendicular to the surface. Otherwise, it will be the Z axis

Definition at line 301 of file marker.cpp.

◆ calculateExtrinsics() [2/2]

void aruco::Marker::calculateExtrinsics ( float  markerSize,
cv::Mat  CameraMatrix,
cv::Mat  Distorsion = cv::Mat(),
cv::Mat  Extrinsics = cv::Mat(),
bool  setYPerpendicular = true,
bool  correctFisheye = false 
)

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)
Distortionmatrix with distortion parameters (k1, k2, p1, p2)
setYPerpendicularIf set the Y axis will be perpendicular to the surface. Otherwise, it will be the Z axis
correctFisheyeCorrect fisheye distortion

Definition at line 316 of file marker.cpp.

◆ copyTo()

void aruco::Marker::copyTo ( Marker m) const

Definition at line 78 of file marker.cpp.

◆ draw()

void aruco::Marker::draw ( cv::Mat &  in,
cv::Scalar  color = cv::Scalar(0, 0, 255),
int  lineWidth = -1,
bool  writeId = true,
bool  writeInfo = false 
) const

Draws this marker in the input image

Definition at line 249 of file marker.cpp.

◆ fromStream()

void aruco::Marker::fromStream ( std::istream &  str)

Definition at line 452 of file marker.cpp.

◆ get3DPoints() [1/2]

vector<cv::Point3f> aruco::Marker::get3DPoints ( ) const
inline

Definition at line 178 of file marker.h.

◆ get3DPoints() [2/2]

std::vector< cv::Point3f > aruco::Marker::get3DPoints ( float  msize)
static

Definition at line 359 of file marker.cpp.

◆ getArea()

float aruco::Marker::getArea ( ) const

Returns the area

Definition at line 406 of file marker.cpp.

◆ getCenter()

cv::Point2f aruco::Marker::getCenter ( ) const

Returns the centroid of the marker

Definition at line 391 of file marker.cpp.

◆ getPerimeter()

float aruco::Marker::getPerimeter ( ) const

Returns the perimeter of the marker

Definition at line 420 of file marker.cpp.

◆ getRadius()

float aruco::Marker::getRadius ( ) const

Returns radius of enclosing circle

Definition at line 485 of file marker.cpp.

◆ getTransformMatrix()

cv::Mat aruco::Marker::getTransformMatrix ( ) const

Definition at line 475 of file marker.cpp.

◆ glGetModelViewMatrix()

void aruco::Marker::glGetModelViewMatrix ( double  modelview_matrix[16])

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 102 of file marker.cpp.

◆ isPoseValid()

bool aruco::Marker::isPoseValid ( ) const
inline

Definition at line 73 of file marker.h.

◆ isValid()

bool aruco::Marker::isValid ( ) const
inline

Indicates if this object is valid

Definition at line 68 of file marker.h.

◆ OgreGetPoseParameters()

void aruco::Marker::OgreGetPoseParameters ( double  position[3],
double  orientation[4] 
)

Returns position vector and orientation quaternion for an Ogre scene node or entity. Use: ... Ogre::Vector3 ogrePos (position[0], position[1], position[2]); Ogre::Quaternion ogreOrient (orientation[0], orientation[1], orientation[2], orientation[3]); mySceneNode->setPosition( ogrePos ); mySceneNode->setOrientation( ogreOrient ); ...

Definition at line 159 of file marker.cpp.

◆ operator=()

Marker & aruco::Marker::operator= ( const Marker m)

compares ids

Definition at line 94 of file marker.cpp.

◆ operator==()

bool aruco::Marker::operator== ( const Marker m) const
inline

compares ids

Definition at line 134 of file marker.h.

◆ rotateXAxis()

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

Definition at line 372 of file marker.cpp.

◆ toStream()

void aruco::Marker::toStream ( std::ostream &  str) const

Definition at line 431 of file marker.cpp.

Friends And Related Function Documentation

◆ operator<

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

Definition at line 146 of file marker.h.

◆ operator<<

std::ostream& operator<< ( std::ostream &  str,
const Marker M 
)
friend

Definition at line 152 of file marker.h.

Member Data Documentation

◆ contourPoints

vector<cv::Point> aruco::Marker::contourPoints

Definition at line 47 of file marker.h.

◆ dict_info

std::string aruco::Marker::dict_info

Definition at line 45 of file marker.h.

◆ id

int aruco::Marker::id

Definition at line 39 of file marker.h.

◆ Rvec

cv::Mat aruco::Marker::Rvec

Definition at line 43 of file marker.h.

◆ ssize

float aruco::Marker::ssize

Definition at line 41 of file marker.h.

◆ Tvec

cv::Mat aruco::Marker::Tvec

Definition at line 43 of file marker.h.


The documentation for this class was generated from the following files:


aruco
Author(s): Rafael Muñoz Salinas , Bence Magyar
autogenerated on Sat Sep 23 2023 02:26:45