Mario
Mario

Reputation: 1469

Segmentation fault in (Bag Of Words)

I'm trying to implement bag of words in OpenCV. Basically for now JUST for testing, I have used only 4 images (which you will see in my code below). 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..

Any advice?

Upvotes: 0

Views: 368

Answers (1)

Fraser
Fraser

Reputation: 78280

From the docs for BOWImgDescriptorExtractor it looks like extractor and matcher should be held in Ptrs, something like (untested):

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

Upvotes: 2

Related Questions