| 95 | } |
| 96 | |
| 97 | void ThrowCheckFeatureTypesMatch(const FeatureMatcher::Image& image1, |
| 98 | const FeatureMatcher::Image& image2, |
| 99 | bool check_keypoints = false) { |
| 100 | THROW_CHECK_NOTNULL(image1.descriptors); |
| 101 | THROW_CHECK_NOTNULL(image2.descriptors); |
| 102 | THROW_CHECK_EQ(image1.descriptors->type, FeatureExtractorType::SIFT); |
| 103 | THROW_CHECK_EQ(image2.descriptors->type, FeatureExtractorType::SIFT); |
| 104 | THROW_CHECK_EQ(image1.descriptors->data.cols(), kSiftDescriptorDim); |
| 105 | THROW_CHECK_EQ(image2.descriptors->data.cols(), kSiftDescriptorDim); |
| 106 | if (check_keypoints) { |
| 107 | THROW_CHECK_NOTNULL(image1.camera); |
| 108 | THROW_CHECK_NOTNULL(image2.camera); |
| 109 | THROW_CHECK_NOTNULL(image1.keypoints); |
| 110 | THROW_CHECK_NOTNULL(image2.keypoints); |
| 111 | THROW_CHECK_EQ(image1.descriptors->data.rows(), image1.keypoints->size()); |
| 112 | THROW_CHECK_EQ(image2.descriptors->data.rows(), image2.keypoints->size()); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | // VLFeat uses a different convention to store its descriptors. This transforms |
| 117 | // the VLFeat format into the original SIFT format that is also used by SiftGPU. |
no test coverage detected