Skip to content

Commit 1152881

Browse files
committed
feat: renormalize from 0 -255 before sending to GPU match
1 parent 67e4972 commit 1152881

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

opensfm/feature_loading.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,8 @@ def _load_features_nocache(self, data, image):
104104
return points, features, colors
105105

106106
def create_gpu_keypoints_from_features(self, p1, f1):
107-
########################################################################
108-
# Merge keypoints in central memory
109-
########################################################################
110-
if type(f1[0][0]) is not int:
111-
f1 = np.uint8(f1 * 512)
107+
info = np.iinfo(np.uint8)
108+
f1 = (f1 * info.max).astype(np.uint8)
112109
total_size = len(p1)
113110
dtype_kp = np.dtype([('x', np.float32),
114111
('y', np.float32),
@@ -120,6 +117,6 @@ def create_gpu_keypoints_from_features(self, p1, f1):
120117
output[:total_size].x = p1[:, 0]
121118
output[:total_size].y = p1[:, 1]
122119
output[:total_size].scale = p1[:, 2]
123-
# output[:total_size].angle = p1[:, 3]
120+
output[:total_size].angle = 0.
124121
output[:total_size].desc = f1
125122
return output

0 commit comments

Comments
 (0)