| 69 | } |
| 70 | |
| 71 | void ValidateKeypoints(const FeatureKeypoints& keypoints, |
| 72 | const Bitmap& bitmap) { |
| 73 | for (size_t i = 0; i < keypoints.size(); ++i) { |
| 74 | EXPECT_GE(keypoints[i].x, 0); |
| 75 | EXPECT_GE(keypoints[i].y, 0); |
| 76 | EXPECT_LE(keypoints[i].x, bitmap.Width()); |
| 77 | EXPECT_LE(keypoints[i].y, bitmap.Height()); |
| 78 | EXPECT_GT(keypoints[i].ComputeScale(), 0); |
| 79 | EXPECT_GT(keypoints[i].ComputeOrientation(), -M_PI); |
| 80 | EXPECT_LT(keypoints[i].ComputeOrientation(), M_PI); |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | void ValidateDescriptorNorms(const FeatureDescriptors& descriptors) { |
| 85 | EXPECT_EQ(descriptors.type, FeatureExtractorType::SIFT); |
no test coverage detected