Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12章loop_closure 出现Segmentation fault错误 #291

Open
caijun199702 opened this issue Apr 18, 2022 · 6 comments
Open

12章loop_closure 出现Segmentation fault错误 #291

caijun199702 opened this issue Apr 18, 2022 · 6 comments

Comments

@caijun199702
Copy link

调试发现到db.add(descriptors[i])出错,但是不知道具体啥原因

@Klngbob
Copy link

Klngbob commented Oct 9, 2022

调试发现到db.add(descriptors[i])出错,但是不知道具体啥原因

我也遇到了这个问题,请问你最后解决了吗?

@BTREE-C802
Copy link

BTREE-C802 commented Oct 9, 2022 via email

@CJJuly
Copy link

CJJuly commented Sep 24, 2023

出现这个问题加1

@ksn13
Copy link

ksn13 commented Jan 3, 2024

遇到了同样的问题,有什么解决方案吗? 谢谢

@BTREE-C802
Copy link

BTREE-C802 commented Jan 3, 2024 via email

@ksn13
Copy link

ksn13 commented Jan 3, 2024

我的解决方案:
DBoW3::BowVector bowVec;
DBoW3::FeatureVector featVec;
// or with database
cout<<"comparing images with database :"<<descriptors.size() <<endl;
DBoW3::Database db( vocab, false, 0);
✹ for ( int i=0; i<descriptors.size(); i++ )
{
vocab.transform(descriptors[i], bowVec);
featVec.addFeature(i, 0); // Adding features with default weight 0

      /* db.add(descriptors[i]); */
      db.add(bowVec, featVec);
  }
  
  cout<<"database info: "<<db<<endl;

✹ for ( int i=0; i<descriptors.size(); i++ )
{
DBoW3::QueryResults ret;
vocab.transform(descriptors[i], bowVec);
/* db.query( descriptors[i], ret, 4); // max result=4 */
db.query( bowVec, ret, 4); // max result=4
cout<<"searching for image "<<i<<" returns "<<ret<<endl<<endl;
}
cout<<"done."<<endl;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants