test_features.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:prototype 作者: chutsu 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号