base_klt.py 文件源码

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

项目:pybot 作者: spillai 项目源码 文件源码
def create_mask(self, shape, pts): 
        """
        Create a mask image to prevent feature extraction around regions
        that already have features detected. i.e prevent feature crowding
        """

        mask = np.ones(shape=shape, dtype=np.uint8) * 255
        all_pts = np.vstack([self.aug_pts_, pts]) if hasattr(self, 'aug_pts_') \
                  else pts
        try: 
            for pt in all_pts: 
                cv2.circle(mask, tuple(map(int, pt)), self.mask_size_, 0, -1, lineType=cv2.CV_AA)
        except:
            pass
        return mask
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号