| 85 | } |
| 86 | |
| 87 | void KeyFrame::computeBRIEFPoint() |
| 88 | { |
| 89 | BriefExtractor extractor(BRIEF_PATTERN_FILE.c_str()); |
| 90 | const int fast_th = 20; // corner detector response threshold |
| 91 | if(1) |
| 92 | cv::FAST(image, keypoints, fast_th, true); |
| 93 | else |
| 94 | { |
| 95 | vector<cv::Point2f> tmp_pts; |
| 96 | cv::goodFeaturesToTrack(image, tmp_pts, 500, 0.01, 10); |
| 97 | for(int i = 0; i < (int)tmp_pts.size(); i++) |
| 98 | { |
| 99 | cv::KeyPoint key; |
| 100 | key.pt = tmp_pts[i]; |
| 101 | keypoints.push_back(key); |
| 102 | } |
| 103 | } |
| 104 | extractor(image, keypoints, brief_descriptors); |
| 105 | for (int i = 0; i < (int)keypoints.size(); i++) |
| 106 | { |
| 107 | Eigen::Vector3d tmp_p; |
| 108 | m_camera->liftProjective(Eigen::Vector2d(keypoints[i].pt.x, keypoints[i].pt.y), tmp_p); |
| 109 | cv::KeyPoint tmp_norm; |
| 110 | tmp_norm.pt = cv::Point2f(tmp_p.x()/tmp_p.z(), tmp_p.y()/tmp_p.z()); |
| 111 | keypoints_norm.push_back(tmp_norm); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | void BriefExtractor::operator() (const cv::Mat &im, vector<cv::KeyPoint> &keys, vector<BRIEF::bitset> &descriptors) const |
| 116 | { |
nothing calls this directly
no test coverage detected