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

Function ScaleKeypoints

src/colmap/controllers/feature_extraction.cc:45–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43namespace {
44
45void ScaleKeypoints(int bitmap_width,
46 int bitmap_height,
47 size_t camera_width,
48 size_t camera_height,
49 FeatureKeypoints* keypoints) {
50 if (static_cast<size_t>(bitmap_width) != camera_width ||
51 static_cast<size_t>(bitmap_height) != camera_height) {
52 const float scale_x = static_cast<float>(camera_width) / bitmap_width;
53 const float scale_y = static_cast<float>(camera_height) / bitmap_height;
54 for (auto& keypoint : *keypoints) {
55 keypoint.Rescale(scale_x, scale_y);
56 }
57 }
58}
59
60void MaskFeatures(const Bitmap& mask,
61 FeatureKeypoints* keypoints,

Callers 1

RunMethod · 0.85

Calls 1

RescaleMethod · 0.45

Tested by

no test coverage detected