mset2dict.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <fstream>
3 #include <sstream>
4 #include <stdint.h>
5 #include <vector>
6 #include <bitset>
8 #include "dictionary.h"
9 #define MSize 6
10 #define NBITS 36
11 using namespace std;
12 bitset<64> fromString(std::string str){
13  stringstream ssstr;ssstr<<str;
14  bitset<64> bs;
15  ssstr>>bs;
16  return bs;
17 }
18 
19 int main(int argc,char **argv){
20 
21 
22  if (argc!=2){cerr<<"Usage in "<<endl;return -1;}
24  dic.fromFile(argv[1]);
25  //cout<<"md="<<dic.minimunDistance()<<endl;cin.ignore();
26  aruco::Dictionary dict2;
27  //insert the elements
28  cout<<"\n\nvector<uint64_t> codes={";
29  int idx=0;
30  for(int i=0;i<dic.size();i++){
31  uint64_t code=fromString(dic[i].toString()).to_ullong();
32 // cout<<"std::pair<uint64_t,int>("<<code<<","<<i<<")";
33  cout<<"0x"<<std::hex<<code<<"UL";
34  if (i<dic.size()-1)cout<<",";
35 
36  }
37  cout<<"};\n\n";
38 
39 }
int main(int argc, char **argv)
Definition: mset2dict.cpp:19
bool fromFile(std::string filename)
bitset< 64 > fromString(std::string str)
Definition: mset2dict.cpp:12


tuw_aruco
Author(s): Lukas Pfeifhofer
autogenerated on Mon Jun 10 2019 15:40:54