Class MarkerMap

Inheritance Relationships

Base Type

  • public std::vector< Marker3DInfo >

Class Documentation

class MarkerMap : public std::vector<Marker3DInfo>

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

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.

See also

getDictionary()

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.

Public Types

enum Marker3DInfoType

Values:

enumerator NONE
enumerator PIX
enumerator METERS

Public Functions

MarkerMap()
MarkerMap(std::string filePath)

Loads from file

Parameters:

filePath – to the config file

inline bool isExpressedInMeters() const

Indicates if the corners are expressed in meters

inline bool isExpressedInPixels() const

Indicates if the corners are expressed in meters

MarkerMap convertToMeters(float markerSize) const

converts the passed board into meters

std::vector<int> getIndices(const vector<Marker> &markers) const
const Marker3DInfo &getMarker3DInfo(int id) const

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

int getIndexOfMarkerId(int id) const

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

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

Set in the list passed the set of the ids

cv::Mat 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

void saveToFile(std::string sfile)

Saves the board info to a file

void readFromFile(std::string sfile)

Reads board info from a file

std::pair<cv::Mat, cv::Mat> calculateExtrinsics(const std::vector<aruco::Marker> &markers, float markerSize, cv::Mat CameraMatrix, cv::Mat Distorsion)
inline std::string getDictionary() const
inline void setDictionary(std::string d)
void toStream(std::ostream &str)
void fromStream(std::istream &str)

Public Members

int mInfoType