| 578 | } |
| 579 | |
| 580 | BriefExtractor::BriefExtractor(const std::string &pattern_file) |
| 581 | { |
| 582 | // The DVision::BRIEF extractor computes a random pattern by default when |
| 583 | // the object is created. |
| 584 | // We load the pattern that we used to build the vocabulary, to make |
| 585 | // the descriptors compatible with the predefined vocabulary |
| 586 | |
| 587 | // loads the pattern |
| 588 | cv::FileStorage fs(pattern_file.c_str(), cv::FileStorage::READ); |
| 589 | if(!fs.isOpened()) throw string("Could not open file ") + pattern_file; |
| 590 | |
| 591 | vector<int> x1, y1, x2, y2; |
| 592 | fs["x1"] >> x1; |
| 593 | fs["x2"] >> x2; |
| 594 | fs["y1"] >> y1; |
| 595 | fs["y2"] >> y2; |
| 596 | |
| 597 | m_brief.importPairs(x1, y1, x2, y2); |
| 598 | } |
| 599 | |
| 600 |
nothing calls this directly
no test coverage detected