Skip to content

Commit

Permalink
Mapping with subsampling
Browse files Browse the repository at this point in the history
  • Loading branch information
Samleo8 committed May 5, 2022
1 parent f4a281d commit dbd1a44
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def convertFeaturesLocalToGlobal(
featurePointsGlobal = (R @ (featurePointsGlobal.T) + t).T

return featurePointsGlobal

def getPrunedFeaturesGlobalPosition(self):
x, y, th = self.pose

Expand Down Expand Up @@ -224,9 +224,14 @@ def plot(self, fig: plt.figure, show: bool = False):
points_global = np.empty((0, 2))
for kf in self.keyframes:
points_global = np.vstack((points_global,kf.getPrunedFeaturesGlobalPosition()))

subsampleFactor = 4
plt.scatter(points_global[::subsampleFactor, 0], points_global[::subsampleFactor, 1], marker='+', color='g',alpha=.8,label='Map Points')
plt.scatter(points_global[::subsampleFactor, 0],
points_global[::subsampleFactor, 1],
marker='+',
color='g',
alpha=.8,
label='Map Points')

if show:
plt.show()
Expand Down

0 comments on commit dbd1a44

Please sign in to comment.