| 113 | } |
| 114 | |
| 115 | void Keyframe::computeBRISKPoint() { |
| 116 | // for searchByDescriptor to create new BRISK keypoints and descriptors |
| 117 | std::shared_ptr<cv::FeatureDetector> detector( |
| 118 | new brisk::ScaleSpaceFeatureDetector<brisk::HarrisScoreCalculator>(Keyframe::briskDetectionThreshold_, |
| 119 | Keyframe::briskDetectionOctaves_, |
| 120 | Keyframe::briskDetectionAbsoluteThreshold_, |
| 121 | Keyframe::briskDetectionMaximumKeypoints_)); |
| 122 | |
| 123 | std::shared_ptr<cv::DescriptorExtractor> extractor(new brisk::BriskDescriptorExtractor( |
| 124 | Keyframe::briskDescriptionRotationInvariance_, Keyframe::briskDescriptionScaleInvariance_)); |
| 125 | |
| 126 | detector->detect(image, brisk_keypoints); |
| 127 | |
| 128 | if (!window_keypoints.empty()) { |
| 129 | extractor->compute(image, window_keypoints, window_brisk_descriptors); |
| 130 | } else { |
| 131 | std::cout << "window keypoints are empty. This is a problem!!" << std::endl; |
| 132 | } |
| 133 | extractor->compute(image, brisk_keypoints, brisk_descriptors); |
| 134 | |
| 135 | std::cout << "Size of Brisk keypoints: " << brisk_keypoints.size() << std::endl; |
| 136 | } |
| 137 | |
| 138 | void Keyframe::computeBoW() { |
| 139 | if (bowVec.empty() || featVec.empty()) { |