tracker_utils.py 文件源码

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

项目:pybot 作者: spillai 项目源码 文件源码
def add(self, pts, ids=None, prune=True): 
        # Add only if valid and non-zero
        if not len(pts): 
            return

        # Retain valid points
        valid = np.isfinite(pts).all(axis=1)
        pts = pts[valid]

        # ID valid points
        max_id = np.max(self.ids) + 1 if len(self.ids) else 0
        tids = np.arange(len(pts), dtype=np.int64) + max_id if ids is None else ids[valid].astype(np.int64)

        # Add pts to track
        for tid, pt in zip(tids, pts): 
            self.tracks_[tid].append(self.index_, pt)

        # If features are propagated
        if prune: 
            self.prune()

        # Frame counter
        self.index_ += 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号