diff --git a/ASIFT_tests/demo_ASIFT_src/ASIFT_matcher.cpp b/ASIFT_tests/demo_ASIFT_src/ASIFT_matcher.cpp index 38f89cc..60a41fa 100644 --- a/ASIFT_tests/demo_ASIFT_src/ASIFT_matcher.cpp +++ b/ASIFT_tests/demo_ASIFT_src/ASIFT_matcher.cpp @@ -535,14 +535,15 @@ bool ASIFT_matcher::saveReferences(const char* ref_path) const std::ofstream file_key1(ref_path); if (file_key1.is_open()) { - file_key1<<_nb_refs<<" "<x << " " << _zoom_refs[i]*ptr->y << " " << _zoom_refs[i]*ptr->scale << " " << ptr->angle; - + file_key1 << _zoom_refs[j]*ptr->x << " " << _zoom_refs[j]*ptr->y << " " << _zoom_refs[j]*ptr->scale << " " << ptr->angle; + for (int ii = 0; ii < (int) VecLength; ii++) { - file_key1 << " " << ptr->vec[ii]; + file_key1 << " " << ptr->vec[ii]; } file_key1 << std::endl; @@ -580,14 +581,16 @@ bool ASIFT_matcher::loadReferences(const char* ref_path) std::ifstream ref_file(ref_path); std::string line, tmp; std::stringstream iss; + pair size_tmp; if (ref_file.is_open()) { std::getline(ref_file, line); std::string::size_type sz; - _nb_refs = std::stoi(line, &sz); //C++11 - // _nb_refs = atoi(line.c_str()); + // _nb_refs = std::stoi(line, &sz); //C++11 + _nb_refs = atoi(line.c_str()); _keys = std::vector(_nb_refs); _num_keys = std::vector< int >(_nb_refs); + _size_refs= std::vector< pair >(_nb_refs); _num_tilts = std::vector< int >(_nb_refs,1); _zoom_refs = std::vector(_nb_refs,1); for(unsigned int i = 0; i<_nb_refs;i++) @@ -605,27 +608,40 @@ bool ASIFT_matcher::loadReferences(const char* ref_path) return false; } - // std::getline(iss,tmp,' '); + std::getline(iss,tmp,' '); // _num_tilts[i]=atoi(tmp.c_str()); + std::getline(iss,tmp,' '); + size_tmp.first=atoi(tmp.c_str()); + + std::getline(iss,tmp,' '); + size_tmp.second=atoi(tmp.c_str()); + + _size_refs[i]=size_tmp; + keypointslist list; - for(unsigned int j =0; j<(unsigned int)_num_keys[j];j++) + for(unsigned int j =0; j<(unsigned int)_num_keys[i];j++) { keypoint nkp; std::getline(ref_file, line); std::stringstream iss(line); + // if(j==0) + // cout< vkps(1,list); asift_keypoints akps(1,vkps); @@ -664,7 +687,7 @@ void ASIFT_matcher::print() const for(unsigned int k=0; k<_keys[i][j].size();k++) { cout<<" "<