28 #ifndef _Aruco_MarkerMap_h 29 #define _Aruco_MarkerMap_h 30 #include <opencv2/core/core.hpp> 49 void toStream(std::ostream &str){str<<
id<<
" "<<size()<<
" ";
for(
size_t i=0;i<size();i++) str<<at(i).x<<
" "<<at(i).y<<
" "<<at(i).z<<
" ";}
50 void fromStream(std::istream &str){
int s;str>>
id>>s;resize(s);
for(
size_t i=0;i<size();i++) str>>at(i).x>>at(i).y>>at(i).z;}
83 MarkerMap(
string filePath)
throw(cv::Exception);
93 MarkerMap convertToMeters(
float markerSize)
throw (cv::Exception);
99 std::vector<int> getIndices(vector<aruco::Marker> &markers);
103 const Marker3DInfo &getMarker3DInfo(
int id)
const throw(cv::Exception);
107 int getIndexOfMarkerId(
int id)
const;
110 void getIdList(vector< int > &ids,
bool append =
true)
const;
115 cv::Mat getImage(
float METER2PIX=0)
const throw (cv::Exception);
120 void saveToFile(
string sfile)
throw(cv::Exception);
123 void readFromFile(
string sfile)
throw(cv::Exception);
129 pair<cv::Mat,cv::Mat> calculateExtrinsics(
const std::vector<aruco::Marker> &markers ,
float markerSize, cv::Mat CameraMatrix, cv::Mat Distorsion )
throw(cv::Exception);
154 void saveToFile(cv::FileStorage &fs)
throw(cv::Exception);
157 void readFromFile(cv::FileStorage &fs)
throw(cv::Exception);
159 void toStream(std::ostream &str);
160 void fromStream(std::istream &str);
void toStream(std::ostream &str)
bool isExpressedInPixels() const
bool isExpressedInMeters() const
bool operator==(const Marker3DInfo &MI)
std::string getDictionary() const
ROSCPP_DECL std::string append(const std::string &left, const std::string &right)
float getMarkerSize() const
void fromStream(std::istream &str)
This class defines a set of markers whose locations are attached to a common reference system...
void setDictionary(std::string d)