| 147 | : public ::testing::TestWithParam<SiftCpuExtractionParams> {}; |
| 148 | |
| 149 | TEST_P(SiftCpuExtractionTest, Nominal) { |
| 150 | const auto& p = GetParam(); |
| 151 | const Bitmap bitmap = CreateImageWithSquare(256); |
| 152 | |
| 153 | FeatureExtractionOptions options(FeatureExtractorType::SIFT); |
| 154 | options.use_gpu = false; |
| 155 | options.sift->estimate_affine_shape = p.estimate_affine_shape; |
| 156 | options.sift->domain_size_pooling = p.domain_size_pooling; |
| 157 | options.sift->force_covariant_extractor = p.force_covariant_extractor; |
| 158 | options.sift->upright = p.upright; |
| 159 | auto extractor = CreateSiftFeatureExtractor(options); |
| 160 | |
| 161 | FeatureKeypoints keypoints; |
| 162 | FeatureDescriptors descriptors; |
| 163 | EXPECT_TRUE(extractor->Extract(bitmap, &keypoints, &descriptors)); |
| 164 | |
| 165 | EXPECT_EQ(keypoints.size(), p.expected_keypoints); |
| 166 | ValidateKeypoints(keypoints, bitmap); |
| 167 | EXPECT_EQ(descriptors.data.rows(), p.expected_keypoints); |
| 168 | ValidateDescriptorNorms(descriptors); |
| 169 | } |
| 170 | |
| 171 | INSTANTIATE_TEST_SUITE_P( |
| 172 | SiftCpuExtraction, |
nothing calls this directly
no test coverage detected