def test_update(self):
debug = False
tracks_tracked = []
# Loop through images
index = 0
while index < len(self.img):
# Index out of bounds guard
index = 0 if index < 0 else index
# Feature tracker update
self.tracker.update(self.img[index], debug)
tracks_tracked.append(len(self.tracker.tracks_tracking))
# Display image
if debug:
cv2.imshow("VO Sequence " + self.data.sequence, self.img[index])
key = cv2.waitKey(0)
if key == ord('q'): # Quit
sys.exit(1)
elif key == ord('p'): # Previous image
index -= 1
else:
index += 1
else:
index += 1
if debug:
import matplotlib.pylab as plt
plt.plot(range(len(tracks_tracked)), tracks_tracked)
plt.show()
plt.clf()
评论列表
文章目录