简体   繁体   English

分段错误(Bag Of Words)

[英]Segmentation fault in (Bag Of Words)

I'm trying to implement bag of words in OpenCV. 我正在尝试在OpenCV中实现一些单词。 Basically for now JUST for testing, I have used only 4 images (which you will see in my code below). 基本上现在JUST用于测试,我只使用了4个图像(您将在下面的代码中看到)。 everything seems to be cool and smooth but when I reach to 一切似乎都很酷,但是当我到达时

BOWImgDescriptorExtractor bowide(&extractor, &matcher);

my compile is successful but when I run the test I got Segmentation Fault , which I think, it might be the problem in inserting the images or something else.. 我的编译成功,但是当我运行测试时,我得到了Segmentation Fault ,我认为,这可能是插入图像或其他内容的问题。

Any advice? 有什么建议?

From the docs for BOWImgDescriptorExtractor it looks like extractor and matcher should be held in Ptr s , something like (untested): BOWImgDescriptorExtractor文档中看起来像extractormatcher应该保存在Ptr ,类似于(未经测试):

Ptr<DescriptorExtractor> extractor(new SurfDescriptorExtractor);
...
Ptr<DescriptorMatcher> matcher(new BruteForceMatcher<L2<float> >);
BOWImgDescriptorExtractor bowide(extractor, matcher);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM