MCPcopy Create free account
hub / github.com/colmap/colmap / FeatureKeypointsFromBlob

Function FeatureKeypointsFromBlob

src/colmap/scene/database_sqlite.cc:100–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100FeatureKeypoints FeatureKeypointsFromBlob(const FeatureKeypointsBlob& blob) {
101 FeatureKeypoints keypoints(static_cast<size_t>(blob.rows()));
102 if (blob.rows() == 0) {
103 return keypoints;
104 } else if (blob.cols() == 2) {
105 for (FeatureKeypointsBlob::Index i = 0; i < blob.rows(); ++i) {
106 keypoints[i] = FeatureKeypoint(blob(i, 0), blob(i, 1));
107 }
108 } else if (blob.cols() == 4) {
109 for (FeatureKeypointsBlob::Index i = 0; i < blob.rows(); ++i) {
110 keypoints[i] =
111 FeatureKeypoint(blob(i, 0), blob(i, 1), blob(i, 2), blob(i, 3));
112 }
113 } else if (blob.cols() == 6) {
114 for (FeatureKeypointsBlob::Index i = 0; i < blob.rows(); ++i) {
115 keypoints[i] = FeatureKeypoint(blob(i, 0),
116 blob(i, 1),
117 blob(i, 2),
118 blob(i, 3),
119 blob(i, 4),
120 blob(i, 5));
121 }
122 } else {
123 LOG(FATAL_THROW) << "Keypoint format not supported";
124 }
125 return keypoints;
126}
127
128FeatureMatchesBlob FeatureMatchesToBlob(const FeatureMatches& matches) {
129 const FeatureMatchesBlob::Index kNumCols = 2;

Callers 1

ReadKeypointsMethod · 0.85

Calls 1

FeatureKeypointClass · 0.85

Tested by

no test coverage detected