| 112 | }; |
| 113 | |
| 114 | void BindFeatureExtraction(py::module& m) { |
| 115 | auto PyNormalization = |
| 116 | py::enum_<SiftExtractionOptions::Normalization>(m, "Normalization") |
| 117 | .value("L1_ROOT", |
| 118 | SiftExtractionOptions::Normalization::L1_ROOT, |
| 119 | "L1-normalizes each descriptor followed by element-wise " |
| 120 | "square rooting. This normalization is usually better than " |
| 121 | "standard " |
| 122 | "L2-normalization. See 'Three things everyone should know " |
| 123 | "to improve object retrieval', Relja Arandjelovic and " |
| 124 | "Andrew Zisserman, CVPR 2012.") |
| 125 | .value("L2", |
| 126 | SiftExtractionOptions::Normalization::L2, |
| 127 | "Each vector is L2-normalized."); |
| 128 | AddStringToEnumConstructor(PyNormalization); |
| 129 | |
| 130 | auto PySiftExtractionOptions = |
| 131 | py::classh<SiftExtractionOptions>(m, "SiftExtractionOptions") |
| 132 | .def(py::init<>()) |
| 133 | .def_readwrite("max_num_features", |
| 134 | &SiftExtractionOptions::max_num_features, |
| 135 | "Maximum number of features to detect, keeping " |
| 136 | "larger-scale features.") |
| 137 | .def_readwrite("first_octave", |
| 138 | &SiftExtractionOptions::first_octave, |
| 139 | "First octave in the pyramid, i.e. -1 upsamples the " |
| 140 | "image by one level.") |
| 141 | .def_readwrite("num_octaves", &SiftExtractionOptions::num_octaves) |
| 142 | .def_readwrite("octave_resolution", |
| 143 | &SiftExtractionOptions::octave_resolution, |
| 144 | "Number of levels per octave.") |
| 145 | .def_readwrite("peak_threshold", |
| 146 | &SiftExtractionOptions::peak_threshold, |
| 147 | "Peak threshold for detection.") |
| 148 | .def_readwrite("edge_threshold", |
| 149 | &SiftExtractionOptions::edge_threshold, |
| 150 | "Edge threshold for detection.") |
| 151 | .def_readwrite("estimate_affine_shape", |
| 152 | &SiftExtractionOptions::estimate_affine_shape, |
| 153 | "Estimate affine shape of SIFT features in the form " |
| 154 | "of oriented ellipses as opposed to original SIFT " |
| 155 | "which estimates oriented disks.") |
| 156 | .def_readwrite("max_num_orientations", |
| 157 | &SiftExtractionOptions::max_num_orientations, |
| 158 | "Maximum number of orientations per keypoint if not " |
| 159 | "estimate_affine_shape.") |
| 160 | .def_readwrite("upright", |
| 161 | &SiftExtractionOptions::upright, |
| 162 | "Fix the orientation to 0 for upright features") |
| 163 | .def_readwrite("darkness_adaptivity", |
| 164 | &SiftExtractionOptions::darkness_adaptivity, |
| 165 | "Whether to adapt the feature detection depending " |
| 166 | "on the image darkness. only available on GPU.") |
| 167 | .def_readwrite( |
| 168 | "domain_size_pooling", |
| 169 | &SiftExtractionOptions::domain_size_pooling, |
| 170 | "\"Domain-Size Pooling in Local Descriptors and Network" |
| 171 | "Architectures\", J. Dong and S. Soatto, CVPR 2015") |
no test coverage detected