| 220 | } |
| 221 | |
| 222 | FeatureKeypointsMatrix KeypointsToMatrix( |
| 223 | const FeatureKeypoints& feature_keypoints) { |
| 224 | const size_t num_features = feature_keypoints.size(); |
| 225 | FeatureKeypointsMatrix keypoints(num_features, kKeypointMatrixCols); |
| 226 | for (size_t i = 0; i < num_features; ++i) { |
| 227 | keypoints(i, 0) = feature_keypoints[i].x; |
| 228 | keypoints(i, 1) = feature_keypoints[i].y; |
| 229 | keypoints(i, 2) = feature_keypoints[i].ComputeScale(); |
| 230 | keypoints(i, 3) = feature_keypoints[i].ComputeOrientation(); |
| 231 | } |
| 232 | return keypoints; |
| 233 | } |
| 234 | |
| 235 | FeatureKeypoints KeypointsFromMatrix( |
| 236 | const Eigen::Ref<const FeatureKeypointsMatrix>& keypoints) { |