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

std::pair< cv::Mat, cv::Mat > calculateExtrinsics (const std::vector< aruco::Marker > &markers, float markerSize, cv::Mat CameraMatrix, cv::Mat Distorsion)
 
MarkerMap convertToMeters (float markerSize) const
 
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
 
int getIndexOfMarkerId (int id) const
 
std::vector< int > getIndices (const vector< Marker > &markers) const
 
const Marker3DInfogetMarker3DInfo (int id) const
 
bool isExpressedInMeters () const
 
bool isExpressedInPixels () const
 
 MarkerMap ()
 
 MarkerMap (std::string filePath)
 
void readFromFile (std::string sfile)
 
void saveToFile (std::string sfile)
 
void setDictionary (std::string d)
 
void toStream (std::ostream &str)
 

Public Attributes

int mInfoType
 

Private Member Functions

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

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 111 of file markermap.h.

Member Enumeration Documentation

◆ Marker3DInfoType

Enumerator
NONE 
PIX 
METERS 

Definition at line 181 of file markermap.h.

Constructor & Destructor Documentation

◆ MarkerMap() [1/2]

aruco::MarkerMap::MarkerMap ( )

Definition at line 40 of file markermap.cpp.

◆ MarkerMap() [2/2]

aruco::MarkerMap::MarkerMap ( std::string  filePath)

Loads from file

Parameters
filePathto the config file

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 
)

Definition at line 433 of file markermap.cpp.

◆ convertToMeters()

MarkerMap aruco::MarkerMap::convertToMeters ( float  markerSize) const

converts the passed board into meters

Definition at line 320 of file markermap.cpp.

◆ fromStream()

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

Definition at line 424 of file markermap.cpp.

◆ getDictionary()

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

Definition at line 176 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 312 of file markermap.cpp.

◆ getImage()

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

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 340 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 143 of file markermap.cpp.

◆ getIndices()

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

Definition at line 397 of file markermap.cpp.

◆ getMarker3DInfo()

const Marker3DInfo & aruco::MarkerMap::getMarker3DInfo ( int  id) const

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

Definition at line 153 of file markermap.cpp.

◆ isExpressedInMeters()

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

Indicates if the corners are expressed in meters

Definition at line 125 of file markermap.h.

◆ isExpressedInPixels()

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

Indicates if the corners are expressed in meters

Definition at line 131 of file markermap.h.

◆ readFromFile() [1/2]

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

Reads board info from a file

Definition at line 110 of file markermap.cpp.

◆ readFromFile() [2/2]

void aruco::MarkerMap::readFromFile ( std::string  sfile)

Reads board info from a file

◆ saveToFile() [1/2]

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

Saves the board info to a file

Definition at line 65 of file markermap.cpp.

◆ saveToFile() [2/2]

void aruco::MarkerMap::saveToFile ( std::string  sfile)

Saves the board info to a file

◆ setDictionary()

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

Definition at line 188 of file markermap.h.

◆ toStream()

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

Definition at line 414 of file markermap.cpp.

Member Data Documentation

◆ dictionary

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

Definition at line 199 of file markermap.h.

◆ mInfoType

int aruco::MarkerMap::mInfoType

Definition at line 195 of file markermap.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