From 7406fb91415783367e263748b4a0e820e5920d60 Mon Sep 17 00:00:00 2001 From: Shuo Zhong Date: Mon, 22 Jul 2024 12:59:49 -0400 Subject: [PATCH] fix dspsift color pick --- opensfm/features.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opensfm/features.py b/opensfm/features.py index eb8ce6b0d..a21ce9796 100644 --- a/opensfm/features.py +++ b/opensfm/features.py @@ -656,6 +656,8 @@ def extract_features( xs = points[:, 0].round().astype(int) ys = points[:, 1].round().astype(int) + xs = np.clip(xs, 0, image.shape[1] - 1) + ys = np.clip(ys, 0, image.shape[0] - 1) colors = image[ys, xs] if image.shape[2] == 1: colors = np.repeat(colors, 3).reshape((-1, 3))