Skip to content

Commit

Permalink
Solved bug in util
Browse files Browse the repository at this point in the history
  • Loading branch information
rmsalinas committed Oct 20, 2016
1 parent 76b6aa4 commit 0cda723
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
7 changes: 7 additions & 0 deletions src/BowVector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ for(int i=0;i<s;i++){

}

uint64_t BowVector::getSignature()const{
uint64_t sig=0;
for(auto ww:*this) sig+=ww.first+1e6*ww.second;
return sig;
}


// --------------------------------------------------------------------------

} // namespace DBoW3
Expand Down
2 changes: 2 additions & 0 deletions src/BowVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class DBOW_API BowVector:
*/
void saveM(const std::string &filename, size_t W) const;

//returns a unique number from the configuration
uint64_t getSignature()const;
//serialization
void toStream(std::ostream &str)const;
void fromStream(std::istream &str);
Expand Down
12 changes: 4 additions & 8 deletions utils/demo_general.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,17 @@ int main(int argc,char **argv)

try{
CmdLineParser cml(argc,argv);
if (cml["-h"] || argc==1){
cerr<<"Usage: descriptor_name action output image0 image1 ... \n\t descriptors:brisk,surf,orb(default),akaze(only if using opencv 3)"<<endl;
cerr<<"actions:\n\t0 : compute and save features\n\t1:create voc from features"<<endl;
return -1;
if (cml["-h"] || argc<=2){
cerr<<"Usage: descriptor_name image0 image1 ... \n\t descriptors:brisk,surf,orb ,akaze(only if using opencv 3)"<<endl;
return -1;
}

string descriptor=argv[1];
string out_features=argv[2];
string out_voc=argv[3];

auto images=readImagePaths(argc,argv,4);
auto images=readImagePaths(argc,argv,2);
vector< cv::Mat > features= loadFeatures(images,descriptor);
testVocCreation(features);

wait();

testDatabase(features);

Expand Down

0 comments on commit 0cda723

Please sign in to comment.