-
Notifications
You must be signed in to change notification settings - Fork 416
Open
Description
The keypoint coordinates are extracted from the heatmap via:
SuperPointPretrainedNetwork/demo_superpoint.py
Lines 251 to 257 in 1fda796
xs, ys = np.where(heatmap >= self.conf_thresh) # Confidence threshold. | |
if len(xs) == 0: | |
return np.zeros((3, 0)), None, None | |
pts = np.zeros((3, len(xs))) # Populate point data sized 3xN. | |
pts[0, :] = ys | |
pts[1, :] = xs | |
pts[2, :] = heatmap[xs, ys] |
The indices returned by np.where
, respectively np.nonzero
are in order of the dimensions. In a NumPy array, the first dimension is along the rows (i.e. the y
coordinates in an image), the second dimension is along the columns (i.e. the x
coordinates in an image).
Hence, syntactically this should be:
ys, xs = np.where(heatmap >= self.conf_thresh) # Confidence threshold.
# [...]
pts[0, :] = xs
pts[1, :] = ys
pts[2, :] = heatmap[ys, xs]
The actual variable name does not matter later, as those values are correctly normalised.
Metadata
Metadata
Assignees
Labels
No labels