Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
aruco::MarkerMap Class Reference

This class defines a set of markers whose locations are attached to a common reference system, i.e., they do not move wrt each other. A MarkerMap contains several markers so that they are more robustly detected. More...

#include <markermap.h>

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

Public Types

enum  Marker3DInfoType { NONE = -1, PIX = 0, METERS = 1 }
 

Public Member Functions

pair< cv::Mat, cv::Mat > calculateExtrinsics (const std::vector< aruco::Marker > &markers, float markerSize, cv::Mat CameraMatrix, cv::Mat Distorsion) throw (cv::Exception)
 
MarkerMap convertToMeters (float markerSize) throw (cv::Exception)
 
void fromStream (std::istream &str)
 
std::string getDictionary () const
 
void getIdList (vector< int > &ids, bool append=true) const
 
cv::Mat getImage (float METER2PIX=0) const throw (cv::Exception)
 
int getIndexOfMarkerId (int id) const
 
std::vector< int > getIndices (vector< aruco::Marker > &markers)
 
const Marker3DInfogetMarker3DInfo (int id) const throw (cv::Exception)
 
bool isExpressedInMeters () const
 
bool isExpressedInPixels () const
 
 MarkerMap ()
 
 MarkerMap (string filePath) throw (cv::Exception)
 
void readFromFile (string sfile) throw (cv::Exception)
 
void saveToFile (string sfile) throw (cv::Exception)
 
void setDictionary (std::string d)
 
void toStream (std::ostream &str)
 

Public Attributes

int mInfoType
 

Private Member Functions

void readFromFile (cv::FileStorage &fs) throw (cv::Exception)
 
void saveToFile (cv::FileStorage &fs) throw (cv::Exception)
 

Private Attributes

std::string dictionary
 

Detailed Description

This class defines a set of markers whose locations are attached to a common reference system, i.e., they do not move wrt each other. A MarkerMap contains several markers so that they are more robustly detected.

A MarkerMap is only a list of the id of the markers along with the position of their corners. A MarkerMap may have information about the dictionary the markers belongs to

See also
getDictionary()

The position of the corners can be specified either in pixels (in a non-specific size) or in meters. The first is the typical case in which you generate the image of board and the print it. Since you do not know in advance the real size of the markers, their corners are specified in pixels, and then, the translation to meters can be made once you know the real size.

On the other hand, you may want to have the information of your boards in meters. The MarkerMap allows you to do so.

The point is in the mInfoType variable. It can be either PIX or METERS according to your needs.

Definition at line 71 of file markermap.h.

Member Enumeration Documentation

◆ Marker3DInfoType

Enumerator
NONE 
PIX 
METERS 

Definition at line 135 of file markermap.h.

Constructor & Destructor Documentation

◆ MarkerMap() [1/2]

aruco::MarkerMap::MarkerMap ( )

Definition at line 43 of file markermap.cpp.

◆ MarkerMap() [2/2]

aruco::MarkerMap::MarkerMap ( string  filePath)
throw (cv::Exception
)

Loads from file

Parameters
filePathto the config file

Definition at line 48 of file markermap.cpp.

Member Function Documentation

◆ calculateExtrinsics()

pair< cv::Mat, cv::Mat > aruco::MarkerMap::calculateExtrinsics ( const std::vector< aruco::Marker > &  markers,
float  markerSize,
cv::Mat  CameraMatrix,
cv::Mat  Distorsion 
)
throw (cv::Exception
)

Definition at line 389 of file markermap.cpp.

◆ convertToMeters()

MarkerMap aruco::MarkerMap::convertToMeters ( float  markerSize)
throw (cv::Exception
)

converts the passed board into meters

Definition at line 297 of file markermap.cpp.

◆ fromStream()

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

Definition at line 384 of file markermap.cpp.

◆ getDictionary()

std::string aruco::MarkerMap::getDictionary ( ) const
inline

Definition at line 132 of file markermap.h.

◆ getIdList()

void aruco::MarkerMap::getIdList ( std::vector< int > &  ids,
bool  append = true 
) const

Set in the list passed the set of the ids

Definition at line 290 of file markermap.cpp.

◆ getImage()

cv::Mat aruco::MarkerMap::getImage ( float  METER2PIX = 0) const
throw (cv::Exception
)

Returns an image of this to be printed. This object must be in pixels

See also
isExpressedInPixels(). If not,please provide the METER2PIX conversion parameter

Definition at line 314 of file markermap.cpp.

◆ getIndexOfMarkerId()

int aruco::MarkerMap::getIndexOfMarkerId ( int  id) const

Returns the index of the marker (in this object) with id indicated, if is in the vector

Definition at line 131 of file markermap.cpp.

◆ getIndices()

std::vector< int > aruco::MarkerMap::getIndices ( vector< aruco::Marker > &  markers)

Definition at line 364 of file markermap.cpp.

◆ getMarker3DInfo()

const Marker3DInfo & aruco::MarkerMap::getMarker3DInfo ( int  id) const
throw (cv::Exception
)

Returns the Info of the marker with id specified. If not in the set, throws exception

Definition at line 141 of file markermap.cpp.

◆ isExpressedInMeters()

bool aruco::MarkerMap::isExpressedInMeters ( ) const
inline

Indicates if the corners are expressed in meters

Definition at line 87 of file markermap.h.

◆ isExpressedInPixels()

bool aruco::MarkerMap::isExpressedInPixels ( ) const
inline

Indicates if the corners are expressed in meters

Definition at line 90 of file markermap.h.

◆ readFromFile() [1/2]

void aruco::MarkerMap::readFromFile ( string  sfile)
throw (cv::Exception
)

Reads board info from a file

Definition at line 89 of file markermap.cpp.

◆ readFromFile() [2/2]

void aruco::MarkerMap::readFromFile ( cv::FileStorage &  fs)
throw (cv::Exception
)
private

Reads board info from a file

Definition at line 101 of file markermap.cpp.

◆ saveToFile() [1/2]

void aruco::MarkerMap::saveToFile ( string  sfile)
throw (cv::Exception
)

Saves the board info to a file

Definition at line 58 of file markermap.cpp.

◆ saveToFile() [2/2]

void aruco::MarkerMap::saveToFile ( cv::FileStorage &  fs)
throw (cv::Exception
)
private

Saves the board info to a file

Definition at line 65 of file markermap.cpp.

◆ setDictionary()

void aruco::MarkerMap::setDictionary ( std::string  d)
inline

Definition at line 141 of file markermap.h.

◆ toStream()

void aruco::MarkerMap::toStream ( std::ostream &  str)

Definition at line 378 of file markermap.cpp.

Member Data Documentation

◆ dictionary

std::string aruco::MarkerMap::dictionary
private

Definition at line 148 of file markermap.h.

◆ mInfoType

int aruco::MarkerMap::mInfoType

Definition at line 145 of file markermap.h.


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


tuw_aruco
Author(s): Lukas Pfeifhofer
autogenerated on Mon Feb 28 2022 23:58:06