keypoint.py 文件源码

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

项目:AlphaLogo 作者: gigaflw 项目源码 文件源码
def _find_in_image(self, image, n_max):
        """
        Calculate keypoints from a image
        Using cv2.goodFeaturesToTrack to find good points

        @param: image: np.ndarray
        @return: a list


        Cowards use this. The brave use '_key_points' which starts from scratch
        """
        rows, cols = image.shape
        kp = cv2.goodFeaturesToTrack(image, n_max, 0.01, 10, 3)
        # assert kp.shape = (<number of keypoints>, 1, 2)

        if kp is None:
            return []

        return [list(i) for i in kp.reshape(-1, 2)[:, ::-1].astype(np.int)]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号